From 04ee3cff0b6f60e8343034f825b3acfbe1b3261d Mon Sep 17 00:00:00 2001 From: axxel Date: Fri, 8 Mar 2024 10:33:22 +0100 Subject: [PATCH] zint: add as a git submodule and add ZXING_USE_BUNDLED_ZINT cmake option --- .gitmodules | 4 ++ CMakeLists.txt | 1 + Package.swift | 1 + core/CMakeLists.txt | 14 ++++ core/src/libzint/2of5.c | 1 + core/src/libzint/aztec.c | 1 + core/src/libzint/aztec.h | 1 + core/src/libzint/big5.h | 1 + core/src/libzint/channel_precalcs.h | 1 + core/src/libzint/code.c | 1 + core/src/libzint/code128.c | 1 + core/src/libzint/code128.h | 1 + core/src/libzint/common.c | 1 + core/src/libzint/common.h | 1 + core/src/libzint/dmatrix.c | 1 + core/src/libzint/dmatrix.h | 1 + core/src/libzint/dmatrix_trace.h | 1 + core/src/libzint/eci.c | 1 + core/src/libzint/eci.h | 1 + core/src/libzint/eci_sb.h | 1 + core/src/libzint/filemem.c | 1 + core/src/libzint/filemem.h | 1 + core/src/libzint/fonts/normal_woff2.h | 1 + core/src/libzint/fonts/upcean_woff2.h | 1 + core/src/libzint/gb18030.h | 1 + core/src/libzint/gb2312.h | 1 + core/src/libzint/gbk.h | 1 + core/src/libzint/general_field.c | 1 + core/src/libzint/general_field.h | 1 + core/src/libzint/gs1.c | 1 + core/src/libzint/gs1.h | 1 + core/src/libzint/gs1_lint.h | 1 + core/src/libzint/iso3166.h | 1 + core/src/libzint/iso4217.h | 1 + core/src/libzint/ksx1001.h | 1 + core/src/libzint/large.c | 1 + core/src/libzint/large.h | 1 + core/src/libzint/library.c | 1 + core/src/libzint/maxicode.c | 1 + core/src/libzint/maxicode.h | 1 + core/src/libzint/medical.c | 1 + core/src/libzint/output.c | 1 + core/src/libzint/output.h | 1 + core/src/libzint/pdf417.c | 1 + core/src/libzint/pdf417.h | 1 + core/src/libzint/pdf417_tabs.h | 1 + core/src/libzint/pdf417_trace.h | 1 + core/src/libzint/qr.c | 1 + core/src/libzint/qr.h | 1 + core/src/libzint/raster.c | 1 + core/src/libzint/raster_font.h | 1 + core/src/libzint/reedsol.c | 1 + core/src/libzint/reedsol.h | 1 + core/src/libzint/reedsol_logs.h | 1 + core/src/libzint/rss.c | 1 + core/src/libzint/rss.h | 1 + core/src/libzint/sjis.h | 1 + core/src/libzint/stubs.c | 92 +++++++++++++++++++++++++++ core/src/libzint/svg.c | 1 + core/src/libzint/upcean.c | 1 + core/src/libzint/vector.c | 1 + core/src/libzint/zfiletypes.h | 1 + core/src/libzint/zint.h | 1 + core/src/libzint/zintconfig.h | 1 + wrappers/rust/Cargo.toml | 1 + zint | 1 + zxing-cpp.podspec | 1 + 67 files changed, 174 insertions(+) create mode 100644 .gitmodules create mode 120000 core/src/libzint/2of5.c create mode 120000 core/src/libzint/aztec.c create mode 120000 core/src/libzint/aztec.h create mode 120000 core/src/libzint/big5.h create mode 120000 core/src/libzint/channel_precalcs.h create mode 120000 core/src/libzint/code.c create mode 120000 core/src/libzint/code128.c create mode 120000 core/src/libzint/code128.h create mode 120000 core/src/libzint/common.c create mode 120000 core/src/libzint/common.h create mode 120000 core/src/libzint/dmatrix.c create mode 120000 core/src/libzint/dmatrix.h create mode 120000 core/src/libzint/dmatrix_trace.h create mode 120000 core/src/libzint/eci.c create mode 120000 core/src/libzint/eci.h create mode 120000 core/src/libzint/eci_sb.h create mode 120000 core/src/libzint/filemem.c create mode 120000 core/src/libzint/filemem.h create mode 120000 core/src/libzint/fonts/normal_woff2.h create mode 120000 core/src/libzint/fonts/upcean_woff2.h create mode 120000 core/src/libzint/gb18030.h create mode 120000 core/src/libzint/gb2312.h create mode 120000 core/src/libzint/gbk.h create mode 120000 core/src/libzint/general_field.c create mode 120000 core/src/libzint/general_field.h create mode 120000 core/src/libzint/gs1.c create mode 120000 core/src/libzint/gs1.h create mode 120000 core/src/libzint/gs1_lint.h create mode 120000 core/src/libzint/iso3166.h create mode 120000 core/src/libzint/iso4217.h create mode 120000 core/src/libzint/ksx1001.h create mode 120000 core/src/libzint/large.c create mode 120000 core/src/libzint/large.h create mode 120000 core/src/libzint/library.c create mode 120000 core/src/libzint/maxicode.c create mode 120000 core/src/libzint/maxicode.h create mode 120000 core/src/libzint/medical.c create mode 120000 core/src/libzint/output.c create mode 120000 core/src/libzint/output.h create mode 120000 core/src/libzint/pdf417.c create mode 120000 core/src/libzint/pdf417.h create mode 120000 core/src/libzint/pdf417_tabs.h create mode 120000 core/src/libzint/pdf417_trace.h create mode 120000 core/src/libzint/qr.c create mode 120000 core/src/libzint/qr.h create mode 120000 core/src/libzint/raster.c create mode 120000 core/src/libzint/raster_font.h create mode 120000 core/src/libzint/reedsol.c create mode 120000 core/src/libzint/reedsol.h create mode 120000 core/src/libzint/reedsol_logs.h create mode 120000 core/src/libzint/rss.c create mode 120000 core/src/libzint/rss.h create mode 120000 core/src/libzint/sjis.h create mode 100644 core/src/libzint/stubs.c create mode 120000 core/src/libzint/svg.c create mode 120000 core/src/libzint/upcean.c create mode 120000 core/src/libzint/vector.c create mode 120000 core/src/libzint/zfiletypes.h create mode 120000 core/src/libzint/zint.h create mode 120000 core/src/libzint/zintconfig.h create mode 160000 zint diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..23eb394603 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "zint"] + path = zint + url = https://github.com/zint/zint.git + shallow = true diff --git a/CMakeLists.txt b/CMakeLists.txt index 66b7e104e3..678fa6b62b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ option (BUILD_UNIT_TESTS "Build the unit tests (don't enable for production buil option (BUILD_PYTHON_MODULE "Build the python module" OFF) option (BUILD_C_API "Build the C-API" OFF) option (BUILD_EXPERIMENTAL_API "Build with experimental API" OFF) +option (ZXING_USE_BUNDLED_ZINT "Use the bundled libzint for barcode creation/generation" ON) set(BUILD_DEPENDENCIES "AUTO" CACHE STRING "Fetch from github or use locally installed (AUTO/GITHUB/LOCAL)") if (WIN32) diff --git a/Package.swift b/Package.swift index 27e70a9bc2..b04bfb8c43 100644 --- a/Package.swift +++ b/Package.swift @@ -15,6 +15,7 @@ let package = Package( .target( name: "ZXingCppCore", path: "core/src", + exclude: ["core/src/libzint"], publicHeadersPath: "." ), .target( diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index fec111bcda..e396971059 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -511,9 +511,22 @@ target_compile_features(ZXing PUBLIC cxx_std_17) target_link_libraries (ZXing PRIVATE Threads::Threads) if (BUILD_WRITERS_NEW) + if (ZXING_USE_BUNDLED_ZINT) + aux_source_directory(src/libzint LIBZINT_FILES) # manually re-run cmake after adding a new file/symlink + add_library(bundled_zint STATIC EXCLUDE_FROM_ALL ${LIBZINT_FILES}) + target_include_directories (bundled_zint + PUBLIC "$" + ) + target_compile_options (bundled_zint + PUBLIC ${ZXING_PUBLIC_FLAGS} + PRIVATE ${ZXING_PRIVATE_FLAGS} + ) + target_link_libraries (ZXing PRIVATE bundled_zint) + else() include(../zxing.cmake) zxing_add_package(zint zint https://github.com/zint/zint.git 55a7369cd8c4a6b58bcd62f02a3a2d486952c897) target_link_libraries (ZXing PRIVATE zint) + endif() endif() add_library(ZXing::ZXing ALIAS ZXing) @@ -564,6 +577,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release") src/qrcode/QRMaskUtil.cpp src/qrcode/QRReader.cpp src/qrcode/QRVersion.cpp + ${LIBZINT_FILES} PROPERTIES SKIP_PRECOMPILE_HEADERS ON COMPILE_FLAGS -Os) endif() endif() diff --git a/core/src/libzint/2of5.c b/core/src/libzint/2of5.c new file mode 120000 index 0000000000..deb8da22f5 --- /dev/null +++ b/core/src/libzint/2of5.c @@ -0,0 +1 @@ +../../../zint/backend/2of5.c \ No newline at end of file diff --git a/core/src/libzint/aztec.c b/core/src/libzint/aztec.c new file mode 120000 index 0000000000..a108e7b150 --- /dev/null +++ b/core/src/libzint/aztec.c @@ -0,0 +1 @@ +../../../zint/backend/aztec.c \ No newline at end of file diff --git a/core/src/libzint/aztec.h b/core/src/libzint/aztec.h new file mode 120000 index 0000000000..841e0ffdba --- /dev/null +++ b/core/src/libzint/aztec.h @@ -0,0 +1 @@ +../../../zint/backend/aztec.h \ No newline at end of file diff --git a/core/src/libzint/big5.h b/core/src/libzint/big5.h new file mode 120000 index 0000000000..3d3671649d --- /dev/null +++ b/core/src/libzint/big5.h @@ -0,0 +1 @@ +../../../zint/backend/big5.h \ No newline at end of file diff --git a/core/src/libzint/channel_precalcs.h b/core/src/libzint/channel_precalcs.h new file mode 120000 index 0000000000..dbdcb49c37 --- /dev/null +++ b/core/src/libzint/channel_precalcs.h @@ -0,0 +1 @@ +../../../zint/backend/channel_precalcs.h \ No newline at end of file diff --git a/core/src/libzint/code.c b/core/src/libzint/code.c new file mode 120000 index 0000000000..ae9c968fc1 --- /dev/null +++ b/core/src/libzint/code.c @@ -0,0 +1 @@ +../../../zint/backend/code.c \ No newline at end of file diff --git a/core/src/libzint/code128.c b/core/src/libzint/code128.c new file mode 120000 index 0000000000..a3fa90e2fd --- /dev/null +++ b/core/src/libzint/code128.c @@ -0,0 +1 @@ +../../../zint/backend/code128.c \ No newline at end of file diff --git a/core/src/libzint/code128.h b/core/src/libzint/code128.h new file mode 120000 index 0000000000..a55244c2ab --- /dev/null +++ b/core/src/libzint/code128.h @@ -0,0 +1 @@ +../../../zint/backend/code128.h \ No newline at end of file diff --git a/core/src/libzint/common.c b/core/src/libzint/common.c new file mode 120000 index 0000000000..3f2a1108de --- /dev/null +++ b/core/src/libzint/common.c @@ -0,0 +1 @@ +../../../zint/backend/common.c \ No newline at end of file diff --git a/core/src/libzint/common.h b/core/src/libzint/common.h new file mode 120000 index 0000000000..d25e9beb7c --- /dev/null +++ b/core/src/libzint/common.h @@ -0,0 +1 @@ +../../../zint/backend/common.h \ No newline at end of file diff --git a/core/src/libzint/dmatrix.c b/core/src/libzint/dmatrix.c new file mode 120000 index 0000000000..b4b445559e --- /dev/null +++ b/core/src/libzint/dmatrix.c @@ -0,0 +1 @@ +../../../zint/backend/dmatrix.c \ No newline at end of file diff --git a/core/src/libzint/dmatrix.h b/core/src/libzint/dmatrix.h new file mode 120000 index 0000000000..cefaca1c6e --- /dev/null +++ b/core/src/libzint/dmatrix.h @@ -0,0 +1 @@ +../../../zint/backend/dmatrix.h \ No newline at end of file diff --git a/core/src/libzint/dmatrix_trace.h b/core/src/libzint/dmatrix_trace.h new file mode 120000 index 0000000000..ffe6939227 --- /dev/null +++ b/core/src/libzint/dmatrix_trace.h @@ -0,0 +1 @@ +../../../zint/backend/dmatrix_trace.h \ No newline at end of file diff --git a/core/src/libzint/eci.c b/core/src/libzint/eci.c new file mode 120000 index 0000000000..d43633ca8b --- /dev/null +++ b/core/src/libzint/eci.c @@ -0,0 +1 @@ +../../../zint/backend/eci.c \ No newline at end of file diff --git a/core/src/libzint/eci.h b/core/src/libzint/eci.h new file mode 120000 index 0000000000..fe57c0f5e9 --- /dev/null +++ b/core/src/libzint/eci.h @@ -0,0 +1 @@ +../../../zint/backend/eci.h \ No newline at end of file diff --git a/core/src/libzint/eci_sb.h b/core/src/libzint/eci_sb.h new file mode 120000 index 0000000000..886b41d6e3 --- /dev/null +++ b/core/src/libzint/eci_sb.h @@ -0,0 +1 @@ +../../../zint/backend/eci_sb.h \ No newline at end of file diff --git a/core/src/libzint/filemem.c b/core/src/libzint/filemem.c new file mode 120000 index 0000000000..ae6270e9e4 --- /dev/null +++ b/core/src/libzint/filemem.c @@ -0,0 +1 @@ +../../../zint/backend/filemem.c \ No newline at end of file diff --git a/core/src/libzint/filemem.h b/core/src/libzint/filemem.h new file mode 120000 index 0000000000..cd1023f51d --- /dev/null +++ b/core/src/libzint/filemem.h @@ -0,0 +1 @@ +../../../zint/backend/filemem.h \ No newline at end of file diff --git a/core/src/libzint/fonts/normal_woff2.h b/core/src/libzint/fonts/normal_woff2.h new file mode 120000 index 0000000000..8454dbb4b1 --- /dev/null +++ b/core/src/libzint/fonts/normal_woff2.h @@ -0,0 +1 @@ +../../../../zint/backend/fonts/normal_woff2.h \ No newline at end of file diff --git a/core/src/libzint/fonts/upcean_woff2.h b/core/src/libzint/fonts/upcean_woff2.h new file mode 120000 index 0000000000..fcbcd319cb --- /dev/null +++ b/core/src/libzint/fonts/upcean_woff2.h @@ -0,0 +1 @@ +../../../../zint/backend/fonts/upcean_woff2.h \ No newline at end of file diff --git a/core/src/libzint/gb18030.h b/core/src/libzint/gb18030.h new file mode 120000 index 0000000000..cb6e4e1b4c --- /dev/null +++ b/core/src/libzint/gb18030.h @@ -0,0 +1 @@ +../../../zint/backend/gb18030.h \ No newline at end of file diff --git a/core/src/libzint/gb2312.h b/core/src/libzint/gb2312.h new file mode 120000 index 0000000000..6c92b71ec4 --- /dev/null +++ b/core/src/libzint/gb2312.h @@ -0,0 +1 @@ +../../../zint/backend/gb2312.h \ No newline at end of file diff --git a/core/src/libzint/gbk.h b/core/src/libzint/gbk.h new file mode 120000 index 0000000000..36c4daa918 --- /dev/null +++ b/core/src/libzint/gbk.h @@ -0,0 +1 @@ +../../../zint/backend/gbk.h \ No newline at end of file diff --git a/core/src/libzint/general_field.c b/core/src/libzint/general_field.c new file mode 120000 index 0000000000..62c09e3511 --- /dev/null +++ b/core/src/libzint/general_field.c @@ -0,0 +1 @@ +../../../zint/backend/general_field.c \ No newline at end of file diff --git a/core/src/libzint/general_field.h b/core/src/libzint/general_field.h new file mode 120000 index 0000000000..144c08536d --- /dev/null +++ b/core/src/libzint/general_field.h @@ -0,0 +1 @@ +../../../zint/backend/general_field.h \ No newline at end of file diff --git a/core/src/libzint/gs1.c b/core/src/libzint/gs1.c new file mode 120000 index 0000000000..3f0d779bb5 --- /dev/null +++ b/core/src/libzint/gs1.c @@ -0,0 +1 @@ +../../../zint/backend/gs1.c \ No newline at end of file diff --git a/core/src/libzint/gs1.h b/core/src/libzint/gs1.h new file mode 120000 index 0000000000..3f2f32d4dc --- /dev/null +++ b/core/src/libzint/gs1.h @@ -0,0 +1 @@ +../../../zint/backend/gs1.h \ No newline at end of file diff --git a/core/src/libzint/gs1_lint.h b/core/src/libzint/gs1_lint.h new file mode 120000 index 0000000000..ceb3e9e0aa --- /dev/null +++ b/core/src/libzint/gs1_lint.h @@ -0,0 +1 @@ +../../../zint/backend/gs1_lint.h \ No newline at end of file diff --git a/core/src/libzint/iso3166.h b/core/src/libzint/iso3166.h new file mode 120000 index 0000000000..69632c0774 --- /dev/null +++ b/core/src/libzint/iso3166.h @@ -0,0 +1 @@ +../../../zint/backend/iso3166.h \ No newline at end of file diff --git a/core/src/libzint/iso4217.h b/core/src/libzint/iso4217.h new file mode 120000 index 0000000000..581144e32e --- /dev/null +++ b/core/src/libzint/iso4217.h @@ -0,0 +1 @@ +../../../zint/backend/iso4217.h \ No newline at end of file diff --git a/core/src/libzint/ksx1001.h b/core/src/libzint/ksx1001.h new file mode 120000 index 0000000000..07b6011655 --- /dev/null +++ b/core/src/libzint/ksx1001.h @@ -0,0 +1 @@ +../../../zint/backend/ksx1001.h \ No newline at end of file diff --git a/core/src/libzint/large.c b/core/src/libzint/large.c new file mode 120000 index 0000000000..18ac653b49 --- /dev/null +++ b/core/src/libzint/large.c @@ -0,0 +1 @@ +../../../zint/backend/large.c \ No newline at end of file diff --git a/core/src/libzint/large.h b/core/src/libzint/large.h new file mode 120000 index 0000000000..86a04bb82d --- /dev/null +++ b/core/src/libzint/large.h @@ -0,0 +1 @@ +../../../zint/backend/large.h \ No newline at end of file diff --git a/core/src/libzint/library.c b/core/src/libzint/library.c new file mode 120000 index 0000000000..4e970c04b5 --- /dev/null +++ b/core/src/libzint/library.c @@ -0,0 +1 @@ +../../../zint/backend/library.c \ No newline at end of file diff --git a/core/src/libzint/maxicode.c b/core/src/libzint/maxicode.c new file mode 120000 index 0000000000..4c2983c0d2 --- /dev/null +++ b/core/src/libzint/maxicode.c @@ -0,0 +1 @@ +../../../zint/backend/maxicode.c \ No newline at end of file diff --git a/core/src/libzint/maxicode.h b/core/src/libzint/maxicode.h new file mode 120000 index 0000000000..33302d9147 --- /dev/null +++ b/core/src/libzint/maxicode.h @@ -0,0 +1 @@ +../../../zint/backend/maxicode.h \ No newline at end of file diff --git a/core/src/libzint/medical.c b/core/src/libzint/medical.c new file mode 120000 index 0000000000..64507aed2c --- /dev/null +++ b/core/src/libzint/medical.c @@ -0,0 +1 @@ +../../../zint/backend/medical.c \ No newline at end of file diff --git a/core/src/libzint/output.c b/core/src/libzint/output.c new file mode 120000 index 0000000000..3db74e8f38 --- /dev/null +++ b/core/src/libzint/output.c @@ -0,0 +1 @@ +../../../zint/backend/output.c \ No newline at end of file diff --git a/core/src/libzint/output.h b/core/src/libzint/output.h new file mode 120000 index 0000000000..294aceedf2 --- /dev/null +++ b/core/src/libzint/output.h @@ -0,0 +1 @@ +../../../zint/backend/output.h \ No newline at end of file diff --git a/core/src/libzint/pdf417.c b/core/src/libzint/pdf417.c new file mode 120000 index 0000000000..12d217416a --- /dev/null +++ b/core/src/libzint/pdf417.c @@ -0,0 +1 @@ +../../../zint/backend/pdf417.c \ No newline at end of file diff --git a/core/src/libzint/pdf417.h b/core/src/libzint/pdf417.h new file mode 120000 index 0000000000..398bcd2d7f --- /dev/null +++ b/core/src/libzint/pdf417.h @@ -0,0 +1 @@ +../../../zint/backend/pdf417.h \ No newline at end of file diff --git a/core/src/libzint/pdf417_tabs.h b/core/src/libzint/pdf417_tabs.h new file mode 120000 index 0000000000..239b764616 --- /dev/null +++ b/core/src/libzint/pdf417_tabs.h @@ -0,0 +1 @@ +../../../zint/backend/pdf417_tabs.h \ No newline at end of file diff --git a/core/src/libzint/pdf417_trace.h b/core/src/libzint/pdf417_trace.h new file mode 120000 index 0000000000..c0828c83ab --- /dev/null +++ b/core/src/libzint/pdf417_trace.h @@ -0,0 +1 @@ +../../../zint/backend/pdf417_trace.h \ No newline at end of file diff --git a/core/src/libzint/qr.c b/core/src/libzint/qr.c new file mode 120000 index 0000000000..c7b3f4c566 --- /dev/null +++ b/core/src/libzint/qr.c @@ -0,0 +1 @@ +../../../zint/backend/qr.c \ No newline at end of file diff --git a/core/src/libzint/qr.h b/core/src/libzint/qr.h new file mode 120000 index 0000000000..27765a1686 --- /dev/null +++ b/core/src/libzint/qr.h @@ -0,0 +1 @@ +../../../zint/backend/qr.h \ No newline at end of file diff --git a/core/src/libzint/raster.c b/core/src/libzint/raster.c new file mode 120000 index 0000000000..cd987d43ad --- /dev/null +++ b/core/src/libzint/raster.c @@ -0,0 +1 @@ +../../../zint/backend/raster.c \ No newline at end of file diff --git a/core/src/libzint/raster_font.h b/core/src/libzint/raster_font.h new file mode 120000 index 0000000000..b4d91dda12 --- /dev/null +++ b/core/src/libzint/raster_font.h @@ -0,0 +1 @@ +../../../zint/backend/raster_font.h \ No newline at end of file diff --git a/core/src/libzint/reedsol.c b/core/src/libzint/reedsol.c new file mode 120000 index 0000000000..9661877ce3 --- /dev/null +++ b/core/src/libzint/reedsol.c @@ -0,0 +1 @@ +../../../zint/backend/reedsol.c \ No newline at end of file diff --git a/core/src/libzint/reedsol.h b/core/src/libzint/reedsol.h new file mode 120000 index 0000000000..51dce9726c --- /dev/null +++ b/core/src/libzint/reedsol.h @@ -0,0 +1 @@ +../../../zint/backend/reedsol.h \ No newline at end of file diff --git a/core/src/libzint/reedsol_logs.h b/core/src/libzint/reedsol_logs.h new file mode 120000 index 0000000000..33e15a3419 --- /dev/null +++ b/core/src/libzint/reedsol_logs.h @@ -0,0 +1 @@ +../../../zint/backend/reedsol_logs.h \ No newline at end of file diff --git a/core/src/libzint/rss.c b/core/src/libzint/rss.c new file mode 120000 index 0000000000..ec15132424 --- /dev/null +++ b/core/src/libzint/rss.c @@ -0,0 +1 @@ +../../../zint/backend/rss.c \ No newline at end of file diff --git a/core/src/libzint/rss.h b/core/src/libzint/rss.h new file mode 120000 index 0000000000..e321989961 --- /dev/null +++ b/core/src/libzint/rss.h @@ -0,0 +1 @@ +../../../zint/backend/rss.h \ No newline at end of file diff --git a/core/src/libzint/sjis.h b/core/src/libzint/sjis.h new file mode 120000 index 0000000000..6d5ee55acc --- /dev/null +++ b/core/src/libzint/sjis.h @@ -0,0 +1 @@ +../../../zint/backend/sjis.h \ No newline at end of file diff --git a/core/src/libzint/stubs.c b/core/src/libzint/stubs.c new file mode 100644 index 0000000000..dfe8914ce1 --- /dev/null +++ b/core/src/libzint/stubs.c @@ -0,0 +1,92 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +#include "common.h" + +#define STUB_PIXEL_PLOT(NAME) \ + INTERNAL int NAME(struct zint_symbol* symbol, const unsigned char* pixelbuf) \ + { \ + (void)symbol; \ + (void)pixelbuf; \ + return ZINT_ERROR_ENCODING_PROBLEM; \ + } + +#define STUB_FUNC_CHAR(NAME) \ + INTERNAL int NAME(struct zint_symbol* symbol, unsigned char source[], int length) \ + { \ + (void)symbol; \ + (void)source; \ + (void)length; \ + return ZINT_ERROR_ENCODING_PROBLEM; \ + } + +#define STUB_FUNC_SEGS(NAME) \ + INTERNAL int NAME(struct zint_symbol* symbol, struct zint_seg segs[], const int seg_count) \ + { \ + (void)symbol; \ + (void)segs; \ + (void)seg_count; \ + return ZINT_ERROR_ENCODING_PROBLEM; \ + } + +STUB_PIXEL_PLOT(png_pixel_plot) +STUB_PIXEL_PLOT(bmp_pixel_plot) +STUB_PIXEL_PLOT(pcx_pixel_plot) +STUB_PIXEL_PLOT(gif_pixel_plot) +STUB_PIXEL_PLOT(tif_pixel_plot) + +INTERNAL int ps_plot(struct zint_symbol* symbol) +{ + (void)symbol; + return ZINT_ERROR_ENCODING_PROBLEM; +} +INTERNAL int emf_plot(struct zint_symbol* symbol, int rotate_angle) +{ + (void)symbol; + (void)rotate_angle; + return ZINT_ERROR_ENCODING_PROBLEM; +} + +// STUB_FUNC_CHAR(pzn) +// STUB_FUNC_CHAR(c25ind) +// STUB_FUNC_CHAR(c25iata) +// STUB_FUNC_CHAR(c25inter) +// STUB_FUNC_CHAR(c25logic) +// STUB_FUNC_CHAR(itf14) +// STUB_FUNC_CHAR(dpleit) +// STUB_FUNC_CHAR(dpident) +// STUB_FUNC_CHAR(code11) +STUB_FUNC_CHAR(msi_plessey) +STUB_FUNC_CHAR(telepen) +STUB_FUNC_CHAR(telepen_num) +STUB_FUNC_CHAR(plessey) +// STUB_FUNC_CHAR(pharma) +STUB_FUNC_CHAR(flat) +STUB_FUNC_CHAR(fim) +// STUB_FUNC_CHAR(pharma_two) +STUB_FUNC_CHAR(postnet) +STUB_FUNC_CHAR(planet) +STUB_FUNC_CHAR(usps_imail) +STUB_FUNC_CHAR(rm4scc) +STUB_FUNC_CHAR(auspost) +STUB_FUNC_CHAR(code16k) +STUB_FUNC_CHAR(composite) +STUB_FUNC_CHAR(kix) +// STUB_FUNC_CHAR(code32) +STUB_FUNC_CHAR(daft) +// STUB_FUNC_CHAR(nve18) +STUB_FUNC_CHAR(koreapost) +STUB_FUNC_CHAR(japanpost) +STUB_FUNC_CHAR(code49) +// STUB_FUNC_CHAR(channel) +STUB_FUNC_SEGS(codeone) +STUB_FUNC_SEGS(gridmatrix) +STUB_FUNC_SEGS(hanxin) +STUB_FUNC_SEGS(dotcode) +STUB_FUNC_SEGS(codablockf) +// STUB_FUNC_CHAR(vin) +STUB_FUNC_CHAR(mailmark_2d) +STUB_FUNC_CHAR(mailmark_4s) +// STUB_FUNC_CHAR(upu_s10) +STUB_FUNC_SEGS(ultra) +// STUB_FUNC_CHAR(dpd) +STUB_FUNC_CHAR(bc412) diff --git a/core/src/libzint/svg.c b/core/src/libzint/svg.c new file mode 120000 index 0000000000..fa7fa4d30b --- /dev/null +++ b/core/src/libzint/svg.c @@ -0,0 +1 @@ +../../../zint/backend/svg.c \ No newline at end of file diff --git a/core/src/libzint/upcean.c b/core/src/libzint/upcean.c new file mode 120000 index 0000000000..b554e9f67c --- /dev/null +++ b/core/src/libzint/upcean.c @@ -0,0 +1 @@ +../../../zint/backend/upcean.c \ No newline at end of file diff --git a/core/src/libzint/vector.c b/core/src/libzint/vector.c new file mode 120000 index 0000000000..7ed3081da6 --- /dev/null +++ b/core/src/libzint/vector.c @@ -0,0 +1 @@ +../../../zint/backend/vector.c \ No newline at end of file diff --git a/core/src/libzint/zfiletypes.h b/core/src/libzint/zfiletypes.h new file mode 120000 index 0000000000..df4d2a7f4c --- /dev/null +++ b/core/src/libzint/zfiletypes.h @@ -0,0 +1 @@ +../../../zint/backend/zfiletypes.h \ No newline at end of file diff --git a/core/src/libzint/zint.h b/core/src/libzint/zint.h new file mode 120000 index 0000000000..cdc544328c --- /dev/null +++ b/core/src/libzint/zint.h @@ -0,0 +1 @@ +../../../zint/backend/zint.h \ No newline at end of file diff --git a/core/src/libzint/zintconfig.h b/core/src/libzint/zintconfig.h new file mode 120000 index 0000000000..4480044542 --- /dev/null +++ b/core/src/libzint/zintconfig.h @@ -0,0 +1 @@ +../../../zint/backend/zintconfig.h \ No newline at end of file diff --git a/wrappers/rust/Cargo.toml b/wrappers/rust/Cargo.toml index 55e07ee987..3f74e31fb7 100644 --- a/wrappers/rust/Cargo.toml +++ b/wrappers/rust/Cargo.toml @@ -12,6 +12,7 @@ categories = ["api-bindings", "computer-vision"] exclude = [ "core/**/*Write*", "core/**/*Encode*", + "core/libzint/**", ] [lib] diff --git a/zint b/zint new file mode 160000 index 0000000000..55a7369cd8 --- /dev/null +++ b/zint @@ -0,0 +1 @@ +Subproject commit 55a7369cd8c4a6b58bcd62f02a3a2d486952c897 diff --git a/zxing-cpp.podspec b/zxing-cpp.podspec index 4db8ff0c6e..b861269f2a 100644 --- a/zxing-cpp.podspec +++ b/zxing-cpp.podspec @@ -24,6 +24,7 @@ Pod::Spec.new do |s| s.subspec 'Core' do |ss| ss.source_files = 'core/src/**/*.{h,c,cpp}' + ss.exclude_files = [ 'core/src/libzint/**' ] ss.private_header_files = 'core/src/**/*.h' end