Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

first commit

  • Loading branch information...
commit 6f184589a5d5b548900a9c7bbc2c537b1479cf78 0 parents
@lldong authored
Showing with 6,579 additions and 0 deletions.
  1. +314 −0 AlfredQRCode.xcodeproj/project.pbxproj
  2. +7 −0 AlfredQRCode.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  3. BIN  AlfredQRCode.xcodeproj/project.xcworkspace/xcuserdata/seraph.xcuserdatad/UserInterfaceState.xcuserstate
  4. +85 −0 AlfredQRCode.xcodeproj/xcuserdata/seraph.xcuserdatad/xcschemes/AlfredQRCode.xcscheme
  5. +22 −0 AlfredQRCode.xcodeproj/xcuserdata/seraph.xcuserdatad/xcschemes/xcschememanagement.plist
  6. +7 −0 AlfredQRCode/AlfredQRCode-Prefix.pch
  7. +79 −0 AlfredQRCode/AlfredQRCode.1
  8. +13 −0 AlfredQRCode/AppDelegate.h
  9. +49 −0 AlfredQRCode/AppDelegate.m
  10. +12 −0 AlfredQRCode/QSQRCodeRenderer.h
  11. +100 −0 AlfredQRCode/QSQRCodeRenderer.m
  12. +14 −0 AlfredQRCode/QSQRShowImage.h
  13. +114 −0 AlfredQRCode/QSQRShowImage.m
  14. +510 −0 AlfredQRCode/libqrencode/COPYING
  15. +447 −0 AlfredQRCode/libqrencode/ChangeLog
  16. +115 −0 AlfredQRCode/libqrencode/README
  17. +12 −0 AlfredQRCode/libqrencode/TODO
  18. +235 −0 AlfredQRCode/libqrencode/bitstream.c
  19. +38 −0 AlfredQRCode/libqrencode/bitstream.h
  20. +76 −0 AlfredQRCode/libqrencode/config.h
  21. +296 −0 AlfredQRCode/libqrencode/mask.c
  22. +30 −0 AlfredQRCode/libqrencode/mask.h
  23. +634 −0 AlfredQRCode/libqrencode/qrencode.c
  24. +426 −0 AlfredQRCode/libqrencode/qrencode.h
  25. +81 −0 AlfredQRCode/libqrencode/qrencode_inner.h
  26. +1,329 −0 AlfredQRCode/libqrencode/qrinput.c
  27. +103 −0 AlfredQRCode/libqrencode/qrinput.h
  28. +540 −0 AlfredQRCode/libqrencode/qrspec.c
  29. +171 −0 AlfredQRCode/libqrencode/qrspec.h
  30. +304 −0 AlfredQRCode/libqrencode/rscode.c
  31. +42 −0 AlfredQRCode/libqrencode/rscode.h
  32. +297 −0 AlfredQRCode/libqrencode/split.c
  33. +47 −0 AlfredQRCode/libqrencode/split.h
  34. +23 −0 AlfredQRCode/main.m
  35. +7 −0 README
314 AlfredQRCode.xcodeproj/project.pbxproj
@@ -0,0 +1,314 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 2816E7871502433400B8DF61 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2816E7861502433400B8DF61 /* main.m */; };
+ 2816E78B1502433400B8DF61 /* AlfredQRCode.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2816E78A1502433400B8DF61 /* AlfredQRCode.1 */; };
+ 2816E7971502435300B8DF61 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2816E7921502434300B8DF61 /* AppDelegate.m */; };
+ 2816E7981502435900B8DF61 /* QSQRCodeRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 2816E7931502434D00B8DF61 /* QSQRCodeRenderer.m */; };
+ 2816E7991502435D00B8DF61 /* QSQRShowImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 2816E7951502434D00B8DF61 /* QSQRShowImage.m */; };
+ 2816E7AF1502436700B8DF61 /* bitstream.c in Sources */ = {isa = PBXBuildFile; fileRef = 2816E79B1502436700B8DF61 /* bitstream.c */; };
+ 2816E7B01502436700B8DF61 /* mask.c in Sources */ = {isa = PBXBuildFile; fileRef = 2816E7A01502436700B8DF61 /* mask.c */; };
+ 2816E7B11502436700B8DF61 /* qrencode.c in Sources */ = {isa = PBXBuildFile; fileRef = 2816E7A21502436700B8DF61 /* qrencode.c */; };
+ 2816E7B21502436700B8DF61 /* qrinput.c in Sources */ = {isa = PBXBuildFile; fileRef = 2816E7A51502436700B8DF61 /* qrinput.c */; };
+ 2816E7B31502436700B8DF61 /* qrspec.c in Sources */ = {isa = PBXBuildFile; fileRef = 2816E7A71502436700B8DF61 /* qrspec.c */; };
+ 2816E7B41502436700B8DF61 /* rscode.c in Sources */ = {isa = PBXBuildFile; fileRef = 2816E7AA1502436700B8DF61 /* rscode.c */; };
+ 2816E7B51502436700B8DF61 /* split.c in Sources */ = {isa = PBXBuildFile; fileRef = 2816E7AC1502436700B8DF61 /* split.c */; };
+ 2816E7B71502439C00B8DF61 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2816E7B61502439C00B8DF61 /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 2816E77D1502433400B8DF61 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = /usr/share/man/man1/;
+ dstSubfolderSpec = 0;
+ files = (
+ 2816E78B1502433400B8DF61 /* AlfredQRCode.1 in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 2816E77F1502433400B8DF61 /* AlfredQRCode */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = AlfredQRCode; sourceTree = BUILT_PRODUCTS_DIR; };
+ 2816E7861502433400B8DF61 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 2816E7891502433400B8DF61 /* AlfredQRCode-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AlfredQRCode-Prefix.pch"; sourceTree = "<group>"; };
+ 2816E78A1502433400B8DF61 /* AlfredQRCode.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = AlfredQRCode.1; sourceTree = "<group>"; };
+ 2816E7911502434300B8DF61 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ 2816E7921502434300B8DF61 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ 2816E7931502434D00B8DF61 /* QSQRCodeRenderer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QSQRCodeRenderer.m; sourceTree = "<group>"; };
+ 2816E7941502434D00B8DF61 /* QSQRShowImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QSQRShowImage.h; sourceTree = "<group>"; };
+ 2816E7951502434D00B8DF61 /* QSQRShowImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QSQRShowImage.m; sourceTree = "<group>"; };
+ 2816E7961502434D00B8DF61 /* QSQRCodeRenderer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QSQRCodeRenderer.h; sourceTree = "<group>"; };
+ 2816E79B1502436700B8DF61 /* bitstream.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bitstream.c; sourceTree = "<group>"; };
+ 2816E79C1502436700B8DF61 /* bitstream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bitstream.h; sourceTree = "<group>"; };
+ 2816E79D1502436700B8DF61 /* ChangeLog */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ChangeLog; sourceTree = "<group>"; };
+ 2816E79E1502436700B8DF61 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
+ 2816E79F1502436700B8DF61 /* COPYING */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = COPYING; sourceTree = "<group>"; };
+ 2816E7A01502436700B8DF61 /* mask.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mask.c; sourceTree = "<group>"; };
+ 2816E7A11502436700B8DF61 /* mask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mask.h; sourceTree = "<group>"; };
+ 2816E7A21502436700B8DF61 /* qrencode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = qrencode.c; sourceTree = "<group>"; };
+ 2816E7A31502436700B8DF61 /* qrencode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qrencode.h; sourceTree = "<group>"; };
+ 2816E7A41502436700B8DF61 /* qrencode_inner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qrencode_inner.h; sourceTree = "<group>"; };
+ 2816E7A51502436700B8DF61 /* qrinput.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = qrinput.c; sourceTree = "<group>"; };
+ 2816E7A61502436700B8DF61 /* qrinput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qrinput.h; sourceTree = "<group>"; };
+ 2816E7A71502436700B8DF61 /* qrspec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = qrspec.c; sourceTree = "<group>"; };
+ 2816E7A81502436700B8DF61 /* qrspec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qrspec.h; sourceTree = "<group>"; };
+ 2816E7A91502436700B8DF61 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ 2816E7AA1502436700B8DF61 /* rscode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rscode.c; sourceTree = "<group>"; };
+ 2816E7AB1502436700B8DF61 /* rscode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rscode.h; sourceTree = "<group>"; };
+ 2816E7AC1502436700B8DF61 /* split.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = split.c; sourceTree = "<group>"; };
+ 2816E7AD1502436700B8DF61 /* split.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = split.h; sourceTree = "<group>"; };
+ 2816E7AE1502436700B8DF61 /* TODO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO; sourceTree = "<group>"; };
+ 2816E7B61502439C00B8DF61 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 2816E77C1502433400B8DF61 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 2816E7B71502439C00B8DF61 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 2816E7741502433300B8DF61 = {
+ isa = PBXGroup;
+ children = (
+ 2816E7851502433400B8DF61 /* AlfredQRCode */,
+ 2816E7821502433400B8DF61 /* Frameworks */,
+ 2816E7801502433400B8DF61 /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ 2816E7801502433400B8DF61 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 2816E77F1502433400B8DF61 /* AlfredQRCode */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 2816E7821502433400B8DF61 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 2816E7B61502439C00B8DF61 /* Cocoa.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 2816E7851502433400B8DF61 /* AlfredQRCode */ = {
+ isa = PBXGroup;
+ children = (
+ 2816E79A1502436700B8DF61 /* libqrencode */,
+ 2816E7911502434300B8DF61 /* AppDelegate.h */,
+ 2816E7921502434300B8DF61 /* AppDelegate.m */,
+ 2816E7941502434D00B8DF61 /* QSQRShowImage.h */,
+ 2816E7951502434D00B8DF61 /* QSQRShowImage.m */,
+ 2816E7961502434D00B8DF61 /* QSQRCodeRenderer.h */,
+ 2816E7931502434D00B8DF61 /* QSQRCodeRenderer.m */,
+ 2816E7861502433400B8DF61 /* main.m */,
+ 2816E78A1502433400B8DF61 /* AlfredQRCode.1 */,
+ 2816E7881502433400B8DF61 /* Supporting Files */,
+ );
+ path = AlfredQRCode;
+ sourceTree = "<group>";
+ };
+ 2816E7881502433400B8DF61 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 2816E7891502433400B8DF61 /* AlfredQRCode-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 2816E79A1502436700B8DF61 /* libqrencode */ = {
+ isa = PBXGroup;
+ children = (
+ 2816E79B1502436700B8DF61 /* bitstream.c */,
+ 2816E79C1502436700B8DF61 /* bitstream.h */,
+ 2816E79D1502436700B8DF61 /* ChangeLog */,
+ 2816E79E1502436700B8DF61 /* config.h */,
+ 2816E79F1502436700B8DF61 /* COPYING */,
+ 2816E7A01502436700B8DF61 /* mask.c */,
+ 2816E7A11502436700B8DF61 /* mask.h */,
+ 2816E7A21502436700B8DF61 /* qrencode.c */,
+ 2816E7A31502436700B8DF61 /* qrencode.h */,
+ 2816E7A41502436700B8DF61 /* qrencode_inner.h */,
+ 2816E7A51502436700B8DF61 /* qrinput.c */,
+ 2816E7A61502436700B8DF61 /* qrinput.h */,
+ 2816E7A71502436700B8DF61 /* qrspec.c */,
+ 2816E7A81502436700B8DF61 /* qrspec.h */,
+ 2816E7A91502436700B8DF61 /* README */,
+ 2816E7AA1502436700B8DF61 /* rscode.c */,
+ 2816E7AB1502436700B8DF61 /* rscode.h */,
+ 2816E7AC1502436700B8DF61 /* split.c */,
+ 2816E7AD1502436700B8DF61 /* split.h */,
+ 2816E7AE1502436700B8DF61 /* TODO */,
+ );
+ path = libqrencode;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 2816E77E1502433400B8DF61 /* AlfredQRCode */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 2816E78E1502433400B8DF61 /* Build configuration list for PBXNativeTarget "AlfredQRCode" */;
+ buildPhases = (
+ 2816E77B1502433400B8DF61 /* Sources */,
+ 2816E77C1502433400B8DF61 /* Frameworks */,
+ 2816E77D1502433400B8DF61 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = AlfredQRCode;
+ productName = AlfredQRCode;
+ productReference = 2816E77F1502433400B8DF61 /* AlfredQRCode */;
+ productType = "com.apple.product-type.tool";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 2816E7761502433300B8DF61 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0430;
+ };
+ buildConfigurationList = 2816E7791502433400B8DF61 /* Build configuration list for PBXProject "AlfredQRCode" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 2816E7741502433300B8DF61;
+ productRefGroup = 2816E7801502433400B8DF61 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 2816E77E1502433400B8DF61 /* AlfredQRCode */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 2816E77B1502433400B8DF61 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 2816E7871502433400B8DF61 /* main.m in Sources */,
+ 2816E7971502435300B8DF61 /* AppDelegate.m in Sources */,
+ 2816E7981502435900B8DF61 /* QSQRCodeRenderer.m in Sources */,
+ 2816E7991502435D00B8DF61 /* QSQRShowImage.m in Sources */,
+ 2816E7AF1502436700B8DF61 /* bitstream.c in Sources */,
+ 2816E7B01502436700B8DF61 /* mask.c in Sources */,
+ 2816E7B11502436700B8DF61 /* qrencode.c in Sources */,
+ 2816E7B21502436700B8DF61 /* qrinput.c in Sources */,
+ 2816E7B31502436700B8DF61 /* qrspec.c in Sources */,
+ 2816E7B41502436700B8DF61 /* rscode.c in Sources */,
+ 2816E7B51502436700B8DF61 /* split.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 2816E78C1502433400B8DF61 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 2816E78D1502433400B8DF61 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ 2816E78F1502433400B8DF61 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "AlfredQRCode/AlfredQRCode-Prefix.pch";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ 2816E7901502433400B8DF61 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "AlfredQRCode/AlfredQRCode-Prefix.pch";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 2816E7791502433400B8DF61 /* Build configuration list for PBXProject "AlfredQRCode" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 2816E78C1502433400B8DF61 /* Debug */,
+ 2816E78D1502433400B8DF61 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 2816E78E1502433400B8DF61 /* Build configuration list for PBXNativeTarget "AlfredQRCode" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 2816E78F1502433400B8DF61 /* Debug */,
+ 2816E7901502433400B8DF61 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 2816E7761502433300B8DF61 /* Project object */;
+}
7 AlfredQRCode.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:AlfredQRCode.xcodeproj">
+ </FileRef>
+</Workspace>
BIN  AlfredQRCode.xcodeproj/project.xcworkspace/xcuserdata/seraph.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
85 AlfredQRCode.xcodeproj/xcuserdata/seraph.xcuserdatad/xcschemes/AlfredQRCode.xcscheme
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "2816E77E1502433400B8DF61"
+ BuildableName = "AlfredQRCode"
+ BlueprintName = "AlfredQRCode"
+ ReferencedContainer = "container:AlfredQRCode.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "2816E77E1502433400B8DF61"
+ BuildableName = "AlfredQRCode"
+ BlueprintName = "AlfredQRCode"
+ ReferencedContainer = "container:AlfredQRCode.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "2816E77E1502433400B8DF61"
+ BuildableName = "AlfredQRCode"
+ BlueprintName = "AlfredQRCode"
+ ReferencedContainer = "container:AlfredQRCode.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "2816E77E1502433400B8DF61"
+ BuildableName = "AlfredQRCode"
+ BlueprintName = "AlfredQRCode"
+ ReferencedContainer = "container:AlfredQRCode.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
22 AlfredQRCode.xcodeproj/xcuserdata/seraph.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>AlfredQRCode.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>2816E77E1502433400B8DF61</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
7 AlfredQRCode/AlfredQRCode-Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'AlfredQRCode' target in the 'AlfredQRCode' project
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
79 AlfredQRCode/AlfredQRCode.1
@@ -0,0 +1,79 @@
+.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples.
+.\"See Also:
+.\"man mdoc.samples for a complete listing of options
+.\"man mdoc for the short list of editing options
+.\"/usr/share/misc/mdoc.template
+.Dd 3/3/12 \" DATE
+.Dt AlfredQRCode 1 \" Program name and manual section number
+.Os Darwin
+.Sh NAME \" Section Header - required - don't modify
+.Nm AlfredQRCode,
+.\" The following lines are read in generating the apropos(man -k) database. Use only key
+.\" words here as the database is built based on the words here and in the .ND line.
+.Nm Other_name_for_same_program(),
+.Nm Yet another name for the same program.
+.\" Use .Nm macro to designate other names for the documented program.
+.Nd This line parsed for whatis database.
+.Sh SYNOPSIS \" Section Header - required - don't modify
+.Nm
+.Op Fl abcd \" [-abcd]
+.Op Fl a Ar path \" [-a path]
+.Op Ar file \" [file]
+.Op Ar \" [file ...]
+.Ar arg0 \" Underlined argument - use .Ar anywhere to underline
+arg2 ... \" Arguments
+.Sh DESCRIPTION \" Section Header - required - don't modify
+Use the .Nm macro to refer to your program throughout the man page like such:
+.Nm
+Underlining is accomplished with the .Ar macro like this:
+.Ar underlined text .
+.Pp \" Inserts a space
+A list of items with descriptions:
+.Bl -tag -width -indent \" Begins a tagged list
+.It item a \" Each item preceded by .It macro
+Description of item a
+.It item b
+Description of item b
+.El \" Ends the list
+.Pp
+A list of flags and their descriptions:
+.Bl -tag -width -indent \" Differs from above in tag removed
+.It Fl a \"-a flag as a list item
+Description of -a flag
+.It Fl b
+Description of -b flag
+.El \" Ends the list
+.Pp
+.\" .Sh ENVIRONMENT \" May not be needed
+.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1
+.\" .It Ev ENV_VAR_1
+.\" Description of ENV_VAR_1
+.\" .It Ev ENV_VAR_2
+.\" Description of ENV_VAR_2
+.\" .El
+.Sh FILES \" File used or created by the topic of the man page
+.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact
+.It Pa /usr/share/file_name
+FILE_1 description
+.It Pa /Users/joeuser/Library/really_long_file_name
+FILE_2 description
+.El \" Ends the list
+.\" .Sh DIAGNOSTICS \" May not be needed
+.\" .Bl -diag
+.\" .It Diagnostic Tag
+.\" Diagnostic informtion here.
+.\" .It Diagnostic Tag
+.\" Diagnostic informtion here.
+.\" .El
+.Sh SEE ALSO
+.\" List links in ascending order by section, alphabetically within a section.
+.\" Please do not reference files that do not exist without filing a bug report
+.Xr a 1 ,
+.Xr b 1 ,
+.Xr c 1 ,
+.Xr a 2 ,
+.Xr b 2 ,
+.Xr a 3 ,
+.Xr b 3
+.\" .Sh BUGS \" Document known, unremedied bugs
+.\" .Sh HISTORY \" Document history if command behaves in a unique manner
13 AlfredQRCode/AppDelegate.h
@@ -0,0 +1,13 @@
+//
+// AppDelegate.h
+// AlfredQRCode
+//
+// Created by Seraph on 3/3/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+@interface AppDelegate : NSObject <NSApplicationDelegate>
+
+@end
49 AlfredQRCode/AppDelegate.m
@@ -0,0 +1,49 @@
+//
+// AppDelegate.m
+// AlfredQRCode
+//
+// Created by Seraph on 3/3/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import "AppDelegate.h"
+
+#import "QSQRShowImage.h"
+#import "QSQRCodeRenderer.h"
+
+@implementation AppDelegate
+
+- (void)dealloc
+{
+ [super dealloc];
+}
+
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+ NSString *text;
+ NSImage *image;
+ NSArray *arguments;
+
+ arguments = [[NSProcessInfo processInfo] arguments];
+ if ([arguments count] > 1) {
+ text = [arguments objectAtIndex:1];
+ // If the text input is from Alfred argument
+ if ([text length]) {
+ image = QRRenderCodeFor(text);
+ [QSQRShowImage showImage:image];
+ }
+ // If the argument from Alfred is empty, read from the clipboard
+ else {
+ NSPasteboard *thePasteboard = [NSPasteboard generalPasteboard];
+ text = [thePasteboard stringForType:NSStringPboardType];
+ if ([text length]) {
+ NSImage *image = QRRenderCodeFor(text);
+ [QSQRShowImage showImage:image];
+ } else {
+ [NSApp terminate:nil];
+ }
+ }
+ }
+}
+
+@end
12 AlfredQRCode/QSQRCodeRenderer.h
@@ -0,0 +1,12 @@
+//
+// QSQRCodeRenderer.h
+// QSQRCode
+//
+// Created by Eric Doughty-Papassideris on 3/01/10.
+// Copyright 2010 FWA. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+NSImage *QRRenderCodeFor(NSString *text);
+BOOL QRCopyCodeFor(NSString *text);
100 AlfredQRCode/QSQRCodeRenderer.m
@@ -0,0 +1,100 @@
+//
+// QSQRCodeRenderer.m
+// QSQRCode
+//
+// Created by Eric Doughty-Papassideris on 3/01/10.
+// Copyright 2010 FWA. All rights reserved.
+//
+
+#import "QSQRCodeRenderer.h"
+#include "qrencode.h"
+
+#define QRCode_Margin 4
+#define QRCode_CellSize 8
+#define QRCode_MaxData 7090
+
+QRcode *getCode(NSString *text)
+{
+ QRcode *code;
+ const char *intext = [text cStringUsingEncoding:NSUTF8StringEncoding];
+ if (strlen(intext) > QRCode_MaxData)
+ return nil;
+ code = QRcode_encodeString8bit(intext, 0, QR_ECLEVEL_L);
+ return code;
+}
+
+NSBitmapImageRep *getBitmap(QRcode *code)
+{
+ int size = (code->width + QRCode_Margin * 2) * QRCode_CellSize;
+ NSBitmapImageRep *bmrep;
+ bmrep = [[[NSBitmapImageRep alloc]initWithBitmapDataPlanes:nil
+ pixelsWide:size
+ pixelsHigh:size
+ bitsPerSample:1
+ samplesPerPixel:1
+ hasAlpha:NO
+ isPlanar:NO
+ colorSpaceName:NSCalibratedWhiteColorSpace
+ bytesPerRow:0
+ bitsPerPixel:1] autorelease];
+
+ unsigned char *pixels = [bmrep bitmapData];
+ int bpr = [bmrep bytesPerRow];
+ unsigned int x, y;
+ for (y = 0; y < size; y++) {
+ unsigned char *row = pixels + (y * bpr);
+ for (x = 0; x < size; x++) {
+ unsigned char *pixel = row + x / 8;
+ unsigned int pixelMask = 1u << (7 - x % 8);
+ int codeValue;
+
+ int codeX = x / QRCode_CellSize - QRCode_Margin;
+ int codeY = y / QRCode_CellSize - QRCode_Margin;
+
+ if (codeY < 0 || codeY >= code->width ||
+ codeX < 0 || codeX >= code->width) {
+ codeValue = 0; // Margin area - White
+ } else {
+ codeValue = code->data[code->width * codeY + codeX] & 1;
+ }
+ if (codeValue) {
+ *pixel = *pixel & ~pixelMask;
+ } else {
+ *pixel = *pixel | pixelMask;
+ }
+ }
+ }
+ return bmrep;
+}
+
+NSImage *getImage(NSBitmapImageRep *bmp)
+{
+ NSImage *result = [[NSImage alloc] initWithSize:[bmp size]];
+ [result addRepresentation:bmp];
+ return result;
+}
+
+void copyBMP(NSBitmapImageRep *bmp)
+{
+ NSPasteboard *pb = [NSPasteboard generalPasteboard];
+ [pb declareTypes:[NSArray arrayWithObjects:NSTIFFPboardType, nil] owner:nil];
+ [pb setData:[bmp TIFFRepresentation] forType:NSTIFFPboardType];
+}
+
+
+BOOL QRCopyCodeFor(NSString *text)
+{
+ QRcode *code = getCode(text);
+ if (!code)
+ return NO;
+ copyBMP(getBitmap(code));
+ return YES;
+}
+
+NSImage *QRRenderCodeFor(NSString *text)
+{
+ QRcode *code = getCode(text);
+ if (!code)
+ return nil;
+ return getImage(getBitmap(code));
+}
14 AlfredQRCode/QSQRShowImage.h
@@ -0,0 +1,14 @@
+//
+// QSQRShowImage.h
+// QSQRCode
+//
+// Created by Eric Doughty-Papassideris on 4/01/10.
+// Copyright 2010 FWA. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface QSQRShowImage : NSPanel
++ (void)showImage:(NSImage *)image;
+@end
114 AlfredQRCode/QSQRShowImage.m
@@ -0,0 +1,114 @@
+//
+// QSQRShowImage.m
+// QSQRCode
+//
+// Created by Eric Doughty-Papassideris on 4/01/10.
+// Copyright 2010 FWA. All rights reserved.
+//
+
+#import "QSQRShowImage.h"
+
+
+/* Function copied from Adam Maxwell
+ http://code.google.com/p/mactlmgr/source/browse/trunk/TLMStatusWindow.m?spec=svn569&r=569
+*/
+static void CenterRectInRect(NSRect *toCenter, NSRect enclosingRect)
+{
+ CGFloat halfWidth = NSWidth(*toCenter) / 2.0;
+ CGFloat halfHeight = NSHeight(*toCenter) / 2.0;
+ NSPoint centerPoint = NSMakePoint(NSMidX(enclosingRect), NSMidY(enclosingRect));
+ centerPoint.x -= halfWidth;
+ centerPoint.y -= halfHeight;
+ toCenter->origin = centerPoint;
+}
+
+@implementation QSQRShowImage
+
++ (void)showImage:(NSImage *)image
+{
+ NSRect visibleRect = [[NSScreen mainScreen] visibleFrame];
+ NSSize size = [image size];
+ NSSize maxCodeSize = NSMakeSize(visibleRect.size.width * 0.85, visibleRect.size.height * 0.85);
+
+ if (size.width > maxCodeSize.width) {
+ size.height = size.height * (maxCodeSize.width / size.width);
+ size.width = maxCodeSize.width;
+ }
+
+ if (size.height > maxCodeSize.height) {
+ size.width = size.width * (maxCodeSize.height / size.height);
+ size.height = maxCodeSize.height;
+ }
+
+ NSRect imageRect = NSMakeRect(0, 0, size.width, size.height);
+ NSRect frameRect = NSMakeRect(0, 0, size.width, size.height);
+
+ NSImageView *imageView;
+ imageView = [[[NSImageView alloc] initWithFrame:imageRect] autorelease];
+ [imageView setImage:image];
+ [imageView setEditable:NO];
+ [imageView setImageScaling:NSImageScaleProportionallyUpOrDown];
+
+ CenterRectInRect(&frameRect, visibleRect);
+
+ NSWindow *largeTypeWindow;
+ largeTypeWindow = [[QSQRShowImage alloc]
+ initWithContentRect:imageRect
+ styleMask:NSBorderlessWindowMask |
+ NSNonactivatingPanelMask
+ backing:NSBackingStoreBuffered
+ defer:NO];
+
+ [largeTypeWindow setFrame:frameRect display:YES];
+ [largeTypeWindow setIgnoresMouseEvents:YES];
+ [largeTypeWindow setOpaque:YES];
+ [largeTypeWindow setLevel:NSFloatingWindowLevel];
+ [largeTypeWindow setBackgroundColor:[NSColor clearColor]];
+ [largeTypeWindow setHidesOnDeactivate:NO];
+ [largeTypeWindow setContentView:imageView];
+ [largeTypeWindow makeKeyAndOrderFront:nil];
+ [largeTypeWindow setInitialFirstResponder:imageView];
+ [[largeTypeWindow contentView] display];
+}
+
+- (id)initWithContentRect:(NSRect)contentRect
+ styleMask:(NSUInteger)aStyle
+ backing:(NSBackingStoreType)bufferingType
+ defer:(BOOL)flag
+{
+ if (self = [super initWithContentRect:contentRect
+ styleMask:aStyle
+ backing:bufferingType
+ defer:flag]) {
+ [self setReleasedWhenClosed:YES];
+ }
+
+ return self;
+}
+
+- (IBAction)copy:(id)sender
+{
+ NSPasteboard *pb = [NSPasteboard generalPasteboard];
+ [pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self];
+ [pb setString:[(NSTextField *)[self initialFirstResponder] stringValue]
+ forType:NSStringPboardType];
+}
+
+- (BOOL)canBecomeKeyWindow { return YES; }
+
+- (void)keyDown:(NSEvent *)theEvent
+{
+ [self close];
+ [NSApp terminate:nil];
+}
+
+- (void)resignKeyWindow
+{
+ [super resignKeyWindow];
+ if ([self isVisible]) {
+ [self close];
+ [NSApp terminate:nil];
+ }
+}
+
+@end
510 AlfredQRCode/libqrencode/COPYING
@@ -0,0 +1,510 @@
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations
+below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it
+becomes a de-facto standard. To achieve this, non-free programs must
+be allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control
+compilation and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at least
+ three years, to give the same user the materials specified in
+ Subsection 6a, above, for a charge no more than the cost of
+ performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply, and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License
+may add an explicit geographical distribution limitation excluding those
+countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms
+of the ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library.
+It is safest to attach them to the start of each source file to most
+effectively convey the exclusion of warranty; and each file should
+have at least the "copyright" line and a pointer to where the full
+notice is found.
+
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or
+your school, if any, to sign a "copyright disclaimer" for the library,
+if necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James
+ Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
447 AlfredQRCode/libqrencode/ChangeLog
@@ -0,0 +1,447 @@
+2009.06.06 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * Backported from the main trunk.
+ * Makefile.am:
+ - Dependency check was incorrect because of misconfiguration.
+ * Version 3.1.0 has been released.
+
+2009.05.30 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrinput.c:
+ - padlen check was wrong in QRinput_appendPaddingBit().
+ * tests/test_qrinput.c:
+ - Stop printing bstream->data.
+ - test_padding2() has been added.
+
+2009.05.21 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrinput.c:
+ - 'padding' was not initialize.
+
+2009.05.20 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrenc.c, qrinput.c, qrencode.c:
+ - Some compile warnings cleared.
+ * qrencode.c, tests/test_qrencode.c:
+ - NULL check of an input arg has been added to
+ QRcode_encodeString8bit().
+ - NULL check test and empty string test have been added for
+ QRcode_encodeString8bit().
+ * qrinput.h, qrencode_inner.h, split.c:
+ - Copyright year updates.
+ * split.[ch]:
+ - Split_splitStringToQRinput() set errno EINVAL if input string is
+ NULL or empty.
+ - Documentation improved.
+ * qrenc.c:
+ - perror() is now used to show the details of some errors.
+ * qrencode.[ch]:
+ - Some functions now set errno appropriately.
+ - Typo fixes.
+
+2009.05.20 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * tests/create_frame_pattern.c, tests/Makefile.am:
+ - New test tool "create_frame_pattern" has been added.
+ * tests/test_qrspec.c:
+ - test_alignment1() has been replaced with test_newframe().
+ test_newframe() compares newly created frames with frame pattern
+ data created by create_frame_pattern.
+ * tests/frame, tests/Makefile.am:
+ - Pattern file "frame" has been added to EXTRA_DIST.
+ * mask.c:
+ - Very small improvement. Unnecessary malloc()s are reduced.
+ * tests/test_qrencode.c:
+ - Two new tests have been added.
+ * split.c:
+ - NULL check and string length check have been added.
+ * qrspec.c, tests/test_qrinput.c:
+ - Forgotten padding bits bug has been fixed. (enbugged at 2009.5.18)
+ - New test for the bug above has been added.
+ * qrspec.[ch], qrencode_inner.h:
+ - Some function becomes __STATIC and their declarations have been
+ moved to qrencode_inner.h.
+ * tests/prof_qrencode.c:
+ - Now liberates all heap at the end of the program.
+
+2009.05.19 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrencode.c, qrencode_inner.h:
+ - calloc() is now used to initialize rsblock.
+ - Number of malloc()s in RSblock_initBlock() has been integrated to
+ one malloc() in QRraw_new().
+ * rscode.c:
+ - A very small code improvement.
+ * qrinput.[ch]:
+ - More return value checks.
+ - Code cleanups.
+ * tests/common.h, tests/test_{split,monkey,qrinput}.c:
+ - Tests improved.
+ * qrspec.[ch], tests/test_qrspec.c:
+ - Code cleanups.
+ - QRspec_rs{Data,Ecc}Length() have been added.
+ * tests/view_qrcode.c:
+ - Code cleanups.
+ - Disabled mask setting in structured mode.
+ * tests/common.h:
+ - assert_nothing() has been added.
+ * qrinput.c, qrencode.c, tests/test_*.c:
+ - Various *_free() now allow NULL pointer. (nothing performed)
+ * qrspec.[ch]:
+ - Alignment pattern is now put by QRspec_putAlignmentPattern().
+ QRspec_getAlignmentPattern() and QRspec_freeAlignment() have been
+ removed.
+
+2009.05.18 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrencode.c:
+ - More return value checks.
+ * bitstream.c:
+ - BitStream_free() allows NULL pointer (nothing performed).
+ * qrinput.c:
+ - QRinput_List_freeEntry() and QRinput_free() allow NULL pointer.
+ - QRinput_createPaddingBit() has been replaced with
+ QRinput_appendPaddingBit().
+ - QRinput_convertData() now sets errno to EINVAL when input is too
+ large.
+ - More return value checks. Mainly for ENOMEM error.
+
+2009.05.16 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrencode.h:
+ - Indent improvement.
+ * Makefile.am:
+ - qrencode.spec has been added to EXTRA_DIST.
+
+2009.05.14 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrinput.c, qrencode.c, qrspe.c:
+ - More return value checks. Mainly for ENOMEM error.
+ * qrspec.[ch], qrencode.c, tests/test_qrspec.c:
+ - QRspec_getEccSpec() now accepts an int array instead to return
+ multiple values instead of returning dynamic allocated array.
+ * mask.c, rscode.c:
+ - More return value checks from malloc().
+ * configure.ac:
+ - Added "--enable-mudflap" option.
+ * rscode.[ch]:
+ - Added free_rs_cache() for debug purpose.
+ * tests/test_{monkey,qrencode,rs}.c:
+ - Call free_rs_cache() at the end of the tests.
+ * qrencode.c:
+ - QRraw_new() and RSblock_init() have been improved.
+ - Eliminated unnecessary calls of init_rs().
+ * autogen.sh, configure.ac:
+ - Darwin workarounds.
+ * tests/common.h, tests/test_bitstream.c:
+ - New tests have been added.
+
+2009.05.12 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * bitstream.c:
+ - BitStream_toByte() had returned non-NULL for an empty BitStream.
+ * tests/test_bitstream.c:
+ - test_null() has been added.
+ * qrinput.c:
+ - A possible memory leak has been eliminated. It happend when a wrong
+ version number was given.
+ * tests/test_qriput.c:
+ - Memory leaks have been eliminated.
+
+2009.05.01 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * Bumped vertion to 3.1.0.
+
+2009.04.30 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * bistream.[ch]:
+ - Internal representation of BitStream has been changed from
+ NUL-terminated string to unsigned char array.
+ * tests/common.h, tests/test_{bitstream,qrinput}.c:
+ - Some test sequences have been updated (see above).
+
+2009.03.25 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * configure.ac:
+ - "--without-tests" has become default setting.
+ * bitstream.[ch]:
+ - Now functions strictly check return value from malloc() and return
+ error if it fails.
+
+2008.10.31 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * tests/commo.h:
+ - __FUNCTION__ has been replaced with __func__, to follow the C99
+ standard.
+ - The way of variadic macros has been changed, to follow the C99
+ standard.
+
+2008.10.11 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrencode_inner.h:
+ - Now this header is called only by test programs.
+ * qrencode.c, qrencode_inner.h:
+ - Some definitions and declares written in qrencode_inner.h have been
+ moved into qrencode.c:
+ - QRraw_*() have been declared as __STATIC.
+ * mask.[ch], qrencode.c, qrencode_inner.h:
+ - Mask_makeMask() now requires QRecLevel.
+ - QRencode_writeFormatInformation() has been renamed and moved to
+ Mask_writeFormatInformation(), and become __STATIC.
+ * tests/*.c:
+ - Unneeded #include "qrencode_inner.h" have been removed.
+
+2008.10.11 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * autogen.sh:
+ - Darwin workaround.
+ * configure.ac:
+ - Now config.h offers "__STATIC" macro becomes "static" when
+ "--without-tests" is specified. This macro is useful for functions
+ called from test programs but not from other library codes.
+ * qrinput.c:
+ - Very little performance improvement.
+ * mask.c:
+ - Code cleanups.
+
+2008.09.12 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * tests/view_qrcode.c:
+ - Unused variable 'pitch' has been removed from draw_QRcode().
+
+2008.06.03 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * Merged to the main trunk.
+
+2008.06.01 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrenc.c:
+ - Now it does not show the full usage when unrecognized options are
+ given.
+ - When "--help" is given, it displays the long usage.
+ * Version 3.0.3 has been released.
+
+2008.05.26 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrenc.c, tests/view_qrcode.c:
+ - getopt_long_only() has been replaced with getopt_long() which is
+ widely available. (Thanks to Gavan Fantom)
+ - Now it accepts long options.
+ * qrencode.1.in:
+ - followed the above changes.
+ * Bumped version to 3.0.3.
+
+2008.05.18 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrspec.c:
+ - The bit order of "Version information" has been corrected.
+ (Thanks to Paul Janssesn)
+ * configure.ac, Makefile.am:
+ - The "--without-tests" has been added to the configure script.
+ * qrencode.spec.in:
+ - Uses "--without-tests".
+ * Version 3.0.2 has been released.
+
+2008.05.14 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * various files:
+ - Some compile-time warnings/erros with g++ have been fixed.
+ (Thanks to wangsai)
+
+2008.05.09 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrenc.c:
+ - Now qrencode writes an image file in binary mode for non-POSIX
+ platform, such as MS-Windows. (bug report from Paul Janssens)
+ * Makefile.am:
+ - tests/test_all.sh has been added.
+ * tests/test_all.sh:
+ - Now it exits immediately if any test fails.
+ * Version 3.0.1 has been released.
+
+2008.05.01 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrencode.spec.in:
+ - Added the man page to the files section.
+
+2008.04.30 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * Version 3.0.0 has been released.
+
+2008.04.23 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * Version 3.0.0rc3 has been released.
+ - This will probably be the final release candidate, if all goes well.
+
+2008.04.23 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * split.c:
+ - Split_identifyMode() now uses isdigit() and isalnum() macros.
+ * qrinput.c:
+ - Error checks have been improved.
+ * qrenc.c, tests/view_qrcode.c:
+ - Return value checks have been added.
+ - Structured-append encode with version 0 now returns error.
+ * qrencode.[ch]:
+ - QRencode_encodeStructuredInput() -> QRencode_encodeInputStructured()
+ (for consistency with other QRencode_encode*Structured() functions)
+ * mask.c:
+ - A code block never called has been eliminated.
+
+2008.04.14 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * Version 3.0.0rc2 has been released.
+
+2008.04.20 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrencode.h:
+ - QR_MODE_NUL has been added to QRencodeMode. Basically it is used
+ only by Split_identifyMode().
+ * qrinput.[ch], split.c:
+ - QRinput_identifyMode() has been moved to split.c, changed to static
+ and now needs a hint.
+ * split.c:
+ - Auto-splitting has been improved.
+ * qrinput.c:
+ - A memory leak has been fixed.
+ * configure.ac:
+ - The "--enable-gprof" and "--enable-gcov" options have been added.
+ * Makefile.am:
+ - man1_MANS has been moved into the "if BUILD_TOOLS - endif" block.
+
+2008.04.14 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * Version 3.0.0rc1 has been released.
+
+2008.04.14 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * Bumped version to 3.0.0.
+ * qrencode.[ch]:
+ - QRcode_encodeInput() has changed the API. Previously it takes a
+ QRinput, version and level, but now it takes only a QRinput, because
+ QRinput holds the version and level in it. From 3.0.0, you should
+ set them by calling QRinput_setVersion() and
+ QRinput_setErrorCorrectionLevel(), or use QRinput_new2() to
+ instantiate a QRinput object.
+
+2008.04.14 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrspe.c:
+ - NULL check has been added.
+ * split.[ch]:
+ - API changed.
+ * qrencode.c:
+ - Arguments (version and level) are now checked in QRcode_encodeMask().
+ Internal functions trust the arguments are valid.
+ - Error checks improved.
+ * qrinput.c:
+ - Error checks improved.
+ * qrencode.h:
+ - Documentation improvements.
+
+2008.04.13 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrencode.c, qrencode_innter.h, tests/view_qrcode.c:
+ - Changed API of QRcode_encodeMask().
+ * qrencode.[ch], qrinput.[ch], split.[ch]:
+ - Some functions now set errno appropriately.
+
+2008.04.09 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrencode.h, qrinput.c:
+ - QRinput_Struct_insertStructuredAppendHeaders() and
+ QRinput_insertStructuredAppendHeader now returns error, when the
+ input contains too many structured inputs.
+ * qrencode.c:
+ - QRcode_encodeInputToStructured() now returns NULL when
+ QRinput_splitQRinputToStruct() fails.
+ * tests/view_qrcode.c:
+ - Segmentation fault bug has been fixed. (see previous memo)
+
+2008.04.08 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrinput.c:
+ - Fixed a bug in QRinput_estimateBitStreamSizeOfEntry(). It could
+ overestimate the size.
+ * rscode.c:
+ - Optimized the order of the parameters equality test in init_rs().
+ * qrspec.c, qrspec.h:
+ - Added QRspec_clearCache().
+ * tests/test_estimatebit.c:
+ - Bug fixed in test_numbit3().
+
+2008.04.07 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * Bumped version to 2.1.0.
+ * Structured append is now supported (patches from Yusuke Mihara):
+ - Two new types, QRcode_List and QRinput_Struct, have been added.
+ - Following functions have been added:
+ - QRcode_encodeStructuredInput()
+ - QRcode_encodeStringStructured()
+ - QRcode_encodeString8bitStructured()
+ - Some functions to handle structured append symbols have been added.
+ See Doxygen-ized descriptions for the details.
+ * qrenc.c:
+ - "-S" option has been added for structured append.
+ * split.h:
+ - "extern" was dropped.
+ * qrinput.h, qrencode.h:
+ - Moved declarations of QRinput_{get,set}{Version,ErrorCorrectionLevel}
+ from qrinput.h to qrencode.h. Now they are publicly accessible.
+ * qrencode.h, qrinput.h, qrinput.c:
+ - Added QRinput_new2().
+ - QRinput_newEntry(), QRinput_freeEntry have been renamed to
+ QRinput_List_newEntry(), QRinput_List_freeEntry().
+ * split.c:
+ - Bug fix: Split_eat8() now eats at least 1 byte. Previously it could
+ produce a 0-length input entry.
+
+2008.01.23 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrencode.1.in, Makefile.am, configure.ac:
+ - Manpage of qrencode has been added.
+ * qrenc.c, tests/view_qrcode.c:
+ - Usage message has been updated.
+
+2008.01.18 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * split.c:
+ - Bug fixes.
+ * tests/test_split.c:
+ - Followed recent API changes.
+ - Added new test "test_toupper()".
+ * qrenc.c, tests/view_qrcode.c:
+ - Source-level compatibility has been improved.
+ - view_qrcode now accepts stdin like qrencode.
+ - Usage message has been updated/fixed.
+ * Copyright year has been updated.
+
+2008.01.16 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrinput.c, split.c:
+ - Case-sensitive mode becomes now default mode.
+ - Alphabet-Numeric mode now encodes only upper-case alphabet and
+ numeric characters. If "-i" option is given, split.c converts
+ lower-case characters to upper-case characters at first.
+ * qrenc.c, tests/view_qrcode.c:
+ - Case-sensitive mode becomes now default mode.
+ - Option "-i" has been added.
+
+2007.12.14 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * tests/test_qrencode.c:
+ - New test has been added.
+ * tests/view_qrcode.c:
+ - Options supported.
+ - Default mask is now -1 (auto).
+
+2007.12.13 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrencode.[ch]:
+ - QRcode_writeFormatInformation now returns a number of dark modules.
+ * mask.c:
+ - The mask evaluation function now writes format information before
+ evaluation. (Philippe Delcroix)
+ * split.[ch]:
+ - Case-sensitive mode has been added to QRcode_encodeString().
+ - "-8" option has been added to qrenc.c.
+ - "-c" now encodes in improved case-sensitive mode.
+ * tests/test_{split,qrencode}.c:
+ - test_split*() have been moved to test_split.c.
+
+2007.12.10 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * Bumped version to 2.0.0.
+ * Merged to main trunk.
+ * mask.[ch], split.[ch]:
+ - Masking functions and splitString functions are separated from
+ qrencode.c.
+ * mqrspec.[ch]:
+ - Specification of Micro QR code has been added, but not used yet.
+
+2007.03.24 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * Bumped version to 1.0.2.
+
+2007.03.24 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrencode.c (QRcode_splitStringToQRinput):
+ - a small bug fix. (Thanks to NANKI Haruo)
+ * qrencode.h:
+ - "extern "C"" barrier has been added for C++.
+ * test/view_qrcode.c:
+ - a typo fix.
+
+2006.12.27 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * Bumped version to 1.0.1.
+
+2006.12.27 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrenc.c, qrencode.[ch]:
+ - Added force 8-bit encoding mode.
+ * Makefile.am :
+ - Automake/Autoconf files have been added to dist-package.
+
+2006.12.17 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * qrencode_inner.h, qrencode.c:
+ - Removed unused member variable "b2" from QRRawCode.
+ * configure.ac, Makefile.am, acinclude.m4:
+ - Better configuration of libpng. (now uses pkg-config correctly)
+
+2006.12.02 Kentaro FUKUCHI <fukuchi@megaui.net>
+ * Bumped version to 1.0.0.
115 AlfredQRCode/libqrencode/README
@@ -0,0 +1,115 @@
+libqrencode 3.1.0 - QR Code encoding library
+
+GENERAL INFORMATION
+===================
+Libqrencode is a library for encoding data in a QR Code symbol, a kind of 2D
+symbology that can be scanned by handy terminals such as a mobile phone with
+CCD. The capacity of QR Code is up to 7000 digits or 4000 characters, and has
+high robustness.
+
+Libqrencode accepts a string or a list of data chunks then encodes in a QR Code
+symbol as a bitmap array. While other QR Code applications generate an image
+file, using libqrencode allows applications to render QR Code symbols from raw
+bitmap data directly. This library also contains a command-line utility outputs
+a QR Code symbol as a PNG image. It will help light-weight CGI programs.
+
+
+SPECIFICATION
+=============
+Libqrencode supports QR Code model 2, described in JIS (Japanese Industrial
+Standards) X0510:2004 or ISO/IEC 18004. Most of features in the specification
+are implemented such as:
+- Numeric, alphabet, Japanese kanji (Shift-JIS) or any 8 bit code can be
+ embedded
+- Optimized encoding of a string
+- Structured-append of symbols
+
+Currently the following features are not supported:
+- ECI and FNC1 mode
+- Micro QR Code
+- QR Code model 1 (deprecated)
+
+
+INSTALL
+=======
+
+Requirements
+------------
+Some test programs or utility tools uses SDL or PNG, but the library itself
+has no dependencies. You can skip compiling those tools if you want not to
+install programs using SDL or PNG.
+
+Compile & install
+-----------------
+Just try
+
+./configure
+make
+make install
+
+This compiles and installs the library and header file to the appropriate
+directories. By default, /usr/local/lib and /usr/local/include. You can change
+the destination directory by passing some options to the configure script.
+Run "./configure --help" to see the list of options.
+
+It also installs a binary "qrencode" to /usr/local/bin. If you want not to
+install it, give "--without-tools" option to the configure script.
+
+
+USAGE
+=====
+Basic usages of this library are written in the header file (qrencode.h).
+You can generate a manual of the library by using Doxygen.
+
+
+WARNINGS
+========
+Some functions are THREAD UNSAFE. See qrencode.h for the details.
+
+Carefully use the qrencode command if it is used by a web application (CGI).
+For example, giving "-s" option with too large number to qrencode may cause DoS.
+You should limit the parameter by your application.
+
+
+LICENSING INFORMATION
+=====================
+Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi
+
+This library is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2.1 of the License, or any later version.
+
+This library is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this library; if not, write to the Free Software Foundation, Inc., 51
+Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+CONTACTS
+========
+Visit the homepage at:
+
+http://megaui.net/fukuchi/works/qrencode/index.en.html
+
+for new releases.
+
+Please mail any bug reports, suggestions, comments and questions to
+Kentaro Fukuchi <fukuchi@megaui.net>. Questions of license compliance
+are also welcome.
+
+
+ACKNOWLEDGMENTS
+===============
+QR Code is registered trademarks of DENSO WAVE INCORPORATED in JAPAN and other
+countries.
+
+Reed-Solomon code encoder is written by Phil Karn, KA9Q.
+Copyright (C) 2002, 2003, 2004, 2006 Phil Karn, KA9Q
+
+NANKI Haruo - improved lower-case characteres encoding
+Philippe Delcroix - improved mask evaluation
+Yusuke Mihara - structured-append support
+Shigeyuki Hirai, Paul Janssens, wangsai, Gavan Fantom - bug report / suggestion
12 AlfredQRCode/libqrencode/TODO
@@ -0,0 +1,12 @@
+Thread unsafe.
+Only two functions, QRspec_newFrame() and init_rs(), are thread unsafe, but
+most of qrencode functions are thread unsafe because of them.
+
+This package contains
+*.c and *.h files (total): 8077 lines, 198863 bytes.
+configure script : 22539 lines, 725612 bytes.
+It's absolutely crazy.
+
+Documents (not only the README, but also the manual of the library) needs
+revision of grammer, spell or to resolve ambiguity or incomplete descriptions.
+Feel really free to send us your revision.
235 AlfredQRCode/libqrencode/bitstream.c
@@ -0,0 +1,235 @@
+/*
+ * qrencode - QR Code encoder
+ *
+ * Binary sequence class.
+ * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "bitstream.h"
+
+BitStream *BitStream_new(void)
+{
+ BitStream *bstream;
+
+ bstream = (BitStream *)malloc(sizeof(BitStream));
+ if(bstream == NULL) return NULL;
+
+ bstream->length = 0;
+ bstream->data = NULL;
+
+ return bstream;
+}
+
+static int BitStream_allocate(BitStream *bstream, int length)
+{
+ unsigned char *data;
+
+ if(bstream == NULL) {
+ return -1;
+ }
+
+ data = (unsigned char *)malloc(length);
+ if(data == NULL) {
+ return -1;
+ }
+
+ if(bstream->data) {
+ free(bstream->data);
+ }
+ bstream->length = length;
+ bstream->data = data;
+
+ return 0;
+}
+
+static BitStream *BitStream_newFromNum(int bits, unsigned int num)
+{
+ unsigned int mask;
+ int i;
+ unsigned char *p;
+ BitStream *bstream;
+
+ bstream = BitStream_new();
+ if(bstream == NULL) return NULL;
+
+ if(BitStream_allocate(bstream, bits)) {
+ BitStream_free(bstream);
+ return NULL;
+ }
+
+ p = bstream->data;
+ mask = 1 << (bits - 1);
+ for(i=0; i<bits; i++) {
+ if(num & mask) {
+ *p = 1;
+ } else {
+ *p = 0;
+ }
+ p++;
+ mask = mask >> 1;
+ }
+
+ return bstream;
+}
+
+static BitStream *BitStream_newFromBytes(int size, unsigned char *data)
+{
+ unsigned char mask;
+ int i, j;
+ unsigned char *p;
+ BitStream *bstream;
+
+ bstream = BitStream_new();
+ if(bstream == NULL) return NULL;
+
+ if(BitStream_allocate(bstream, size * 8)) {
+ BitStream_free(bstream);
+ return NULL;
+ }
+
+ p = bstream->data;
+ for(i=0; i<size; i++) {
+ mask = 0x80;
+ for(j=0; j<8; j++) {
+ if(data[i] & mask) {
+ *p = 1;
+ } else {
+ *p = 0;
+ }
+ p++;
+ mask = mask >> 1;
+ }
+ }
+
+ return bstream;
+}
+
+int BitStream_append(BitStream *bstream, BitStream *arg)
+{
+ unsigned char *data;
+
+ if(arg == NULL) {
+ return -1;
+ }
+ if(arg->length == 0) {
+ return 0;
+ }
+ if(bstream->length == 0) {
+ if(BitStream_allocate(bstream, arg->length)) {
+ return -1;
+ }
+ memcpy(bstream->data, arg->data, arg->length);
+ return 0;
+ }
+
+ data = (unsigned char *)malloc(bstream->length + arg->length);
+ if(data == NULL) {
+ return -1;
+ }
+ memcpy(data, bstream->data, bstream->length);
+ memcpy(data + bstream->length, arg->data, arg->length);
+
+ free(bstream->data);
+ bstream->length += arg->length;
+ bstream->data = data;
+
+ return 0;
+}
+
+int BitStream_appendNum(BitStream *bstream, int bits, unsigned int num)
+{
+ BitStream *b;
+ int ret;
+
+ if(bits == 0) return 0;
+
+ b = BitStream_newFromNum(bits, num);
+ if(b == NULL) return -1;
+
+ ret = BitStream_append(bstream, b);
+ BitStream_free(b);
+
+ return ret;
+}
+
+int BitStream_appendBytes(BitStream *bstream, int size, unsigned char *data)
+{
+ BitStream *b;
+ int ret;
+
+ if(size == 0) return 0;
+
+ b = BitStream_newFromBytes(size, data);
+ if(b == NULL) return -1;
+
+ ret = BitStream_append(bstream, b);
+ BitStream_free(b);
+
+ return ret;
+}
+
+unsigned char *BitStream_toByte(BitStream *bstream)
+{
+ int i, j, size, bytes;
+ unsigned char *data, v;
+ unsigned char *p;
+
+ size = BitStream_size(bstream);
+ if(size == 0) {
+ return NULL;
+ }
+ data = (unsigned char *)malloc((size + 7) / 8);
+ if(data == NULL) {
+ return NULL;
+ }
+
+ bytes = size / 8;
+
+ p = bstream->data;
+ for(i=0; i<bytes; i++) {
+ v = 0;
+ for(j=0; j<8; j++) {
+ v = v << 1;
+ v |= *p;
+ p++;
+ }
+ data[i] = v;
+ }
+ if(size & 7) {
+ v = 0;
+ for(j=0; j<(size & 7); j++) {
+ v = v << 1;
+ v |= *p;
+ p++;
+ }
+ data[bytes] = v;
+ }
+
+ return data;
+}
+
+void BitStream_free(BitStream *bstream)
+{
+ if(bstream != NULL) {
+ free(bstream->data);
+ free(bstream);
+ }
+}
38 AlfredQRCode/libqrencode/bitstream.h
@@ -0,0 +1,38 @@
+/*
+ * qrencode - QR Code encoder
+ *
+ * Binary sequence class.
+ * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __BITSTREAM_H__
+#define __BITSTREAM_H__
+
+typedef struct {
+ int length;
+ unsigned char *data;
+} BitStream;
+
+extern BitStream *BitStream_new(void);
+extern int BitStream_append(BitStream *bstream, BitStream *arg);
+extern int BitStream_appendNum(BitStream *bstream, int bits, unsigned int num);
+extern int BitStream_appendBytes(BitStream *bstream, int size, unsigned char *data);
+#define BitStream_size(__bstream__) (__bstream__->length)
+extern unsigned char *BitStream_toByte(BitStream *bstream);
+extern void BitStream_free(BitStream *bstream);
+
+#endif /* __BITSTREAM_H__ */
76 AlfredQRCode/libqrencode/config.h
@@ -0,0 +1,76 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Name of package */
+#define PACKAGE "qrencode"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "3.1.0"
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to 'static' if no test programs will be compiled. */
+ #define __STATIC static
+
296 AlfredQRCode/libqrencode/mask.c
@@ -0,0 +1,296 @@
+/*
+ * qrencode - QR Code encoder
+ *
+ * Masking.
+ * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+#include "config.h"
+#include "qrencode.h"
+#include "qrspec.h"
+#include "mask.h"
+
+__STATIC int Mask_writeFormatInformation(int width, unsigned char *frame, int mask, QRecLevel level)
+{
+ unsigned int format;
+ unsigned char v;
+ int i;
+ int blacks = 0;
+
+ format = QRspec_getFormatInfo(mask, level);
+
+ for(i=0; i<8; i++) {
+ if(format & 1) {
+ blacks += 2;
+ v = 0x85;
+ } else {
+ v = 0x84;
+ }
+ frame[width * 8 + width - 1 - i] = v;
+ if(i < 6) {
+ frame[width * i + 8] = v;
+ } else {
+ frame[width * (i + 1) + 8] = v;
+ }
+ format= format >> 1;
+ }
+ for(i=0; i<7; i++) {
+ if(format & 1) {
+ blacks += 2;
+ v = 0x85;
+ } else {
+ v = 0x84;
+ }
+ frame[width * (width - 7 + i) + 8] = v;
+ if(i == 0) {
+ frame[width * 8 + 7] = v;
+ } else {
+ frame[width * 8 + 6 - i] = v;
+ }
+ format= format >> 1;
+ }
+
+ return blacks;
+}
+
+/**
+ * Demerit coefficients.
+ * See Section 8.8.2, pp.45, JIS X0510:2004.
+ */
+#define N1 (3)
+#define N2 (3)
+#define N3 (40)
+#define N4 (10)
+
+#define MASKMAKER(__exp__) \
+ int x, y;\
+ int b = 0;\
+\
+ for(y=0; y<width; y++) {\
+ for(x=0; x<width; x++) {\
+ if(*s & 0x80) {\
+ *d = *s;\
+ } else {\
+ *d = *s ^ ((__exp__) == 0);\
+ }\
+ b += (int)(*d & 1);\
+ s++; d++;\
+ }\
+ }\
+ return b;
+
+static int Mask_mask0(int width, const unsigned char *s, unsigned char *d)
+{
+ MASKMAKER((x+y)&1)
+}
+
+static int Mask_mask1(int width, const unsigned char *s, unsigned char *d)
+{
+ MASKMAKER(y&1)
+}
+
+static int Mask_mask2(int width, const unsigned char *s, unsigned char *d)
+{
+ MASKMAKER(x%3)
+}
+
+static int Mask_mask3(int width, const unsigned char *s, unsigned char *d)
+{
+ MASKMAKER((x+y)%3)
+}
+
+static int Mask_mask4(int width, const unsigned char *s, unsigned char *d)
+{
+ MASKMAKER(((y/2)+(x/3))&1)
+}
+
+static int Mask_mask5(int width, const unsigned char *s, unsigned char *d)
+{
+ MASKMAKER(((x*y)&1)+(x*y)%3)
+}
+
+static int Mask_mask6(int width, const unsigned char *s, unsigned char *d)
+{
+ MASKMAKER((((x*y)&1)+(x*y)%3)&1)
+}
+
+static int Mask_mask7(int width, const unsigned char *s, unsigned char *d)
+{
+ MASKMAKER((((x*y)%3)+((x+y)&1))&1)
+}
+
+typedef int MaskMaker(int, const unsigned char *, unsigned char *);
+static MaskMaker *maskMakers[] = {
+ Mask_mask0, Mask_mask1, Mask_mask2, Mask_mask3,
+ Mask_mask4, Mask_mask5, Mask_mask6, Mask_mask7
+};
+
+unsigned char *Mask_makeMask(int width, unsigned char *frame, int mask, QRecLevel level)
+{
+ unsigned char *masked;
+
+ masked = (unsigned char *)malloc(width * width);
+ if(masked == NULL) return NULL;
+
+ maskMakers[mask](width, frame, masked);
+ Mask_writeFormatInformation(width, masked, mask, level);
+
+ return masked;
+}
+
+static int runLength[QRSPEC_WIDTH_MAX + 1];
+
+//static int n1;
+//static int n2;
+//static int n3;
+//static int n4;
+
+static int Mask_calcN1N3(int length, int *runLength)
+{
+ int i;
+ int demerit = 0;
+ int fact;
+
+ for(i=0; i<length; i++) {
+ if(runLength[i] >= 5) {
+ demerit += N1 + (runLength[i] - 5);
+ //n1 += N1 + (runLength[i] - 5);
+ }
+ if((i & 1)) {
+ if(i >= 3 && i < length-2 && (runLength[i] % 3) == 0) {
+ fact = runLength[i] / 3;
+ if(runLength[i-2] == fact &&
+ runLength[i-1] == fact &&
+ runLength[i+1] == fact &&
+ runLength[i+2] == fact) {
+ if(runLength[i-3] < 0 || runLength[i-3] >= 4 * fact) {
+ demerit += N3;
+ //n3 += N3;
+ } else if(i+3 >= length || runLength[i+3] >= 4 * fact) {
+ demerit += N3;
+ //n3 += N3;
+ }
+ }
+ }
+ }
+ }
+
+ return demerit;
+}
+
+__STATIC int Mask_evaluateSymbol(int width, unsigned char *frame)
+{
+ int x, y;
+ unsigned char *p;
+ unsigned char b22, w22;
+ int head;
+ int demerit = 0;
+
+ p = frame;
+ for(y=0; y<width; y++) {
+ head = 0;
+ runLength[0] = 1;
+ for(x=0; x<width; x++) {
+ if(x > 0 && y > 0) {
+ b22 = p[0] & p[-1] & p[-width] & p [-width-1];
+ w22 = p[0] | p[-1] | p[-width] | p [-width-1];
+ if((b22 | (w22 ^ 1))&1) {
+ demerit += N2;
+ }
+ }
+ if(x == 0 && (p[0] & 1)) {
+ runLength[0] = -1;
+ head = 1;
+ runLength[head] = 1;
+ } else if(x > 0) {
+ if((p[0] ^ p[-1]) & 1) {
+ head++;
+ runLength[head] = 1;
+ } else {
+ runLength[head]++;
+ }
+ }
+ p++;
+ }
+ demerit += Mask_calcN1N3(head+1, runLength);
+ }
+
+ for(x=0; x<width; x++) {
+ head = 0;
+ runLength[0] = 1;
+ p = frame + x;
+ for(y=0; y<width; y++) {
+ if(y == 0 && (p[0] & 1)) {
+ runLength[0] = -1;
+ head = 1;
+ runLength[head] = 1;
+ } else if(y > 0) {
+ if((p[0] ^ p[-width]) & 1) {
+ head++;
+ runLength[head] = 1;
+ } else {
+ runLength[head]++;
+ }
+ }
+ p+=width;
+ }
+ demerit += Mask_calcN1N3(head+1, runLength);
+ }
+
+ return demerit;
+}
+
+unsigned char *Mask_mask(int width, unsigned char *frame, QRecLevel level)
+{
+ int i;
+ unsigned char *mask, *bestMask;
+ int minDemerit = INT_MAX;
+ int bestMaskNum = 0;
+ int blacks;
+ int demerit;
+
+ mask = (unsigned char *)malloc(width * width);
+ if(mask == NULL) return NULL;
+ bestMask = NULL;
+
+ for(i=0; i<8; i++) {
+// n1 = n2 = n3 = n4 = 0;
+ demerit = 0;
+ blacks = maskMakers[i](width, frame, mask);
+ blacks += Mask_writeFormatInformation(width, mask, i, level);
+ blacks = 100 * blacks / (width * width);
+ demerit = (abs(blacks - 50) / 5) * N4;
+// n4 = demerit;
+ demerit += Mask_evaluateSymbol(width, mask);
+// printf("(%d,%d,%d,%d)=%d\n", n1, n2, n3 ,n4, demerit);
+ if(demerit < minDemerit) {
+ minDemerit = demerit;
+ bestMaskNum = i;
+ if(bestMask != NULL) {
+ free(bestMask);