From b5d0041b6dc5742b23b61725c755b97894cd0afb Mon Sep 17 00:00:00 2001 From: axxel Date: Sat, 9 Mar 2024 19:07:43 +0100 Subject: [PATCH] cmake: replace -DZXING_BUILD_READER with #define in Version.h * ZXVersion.h -> Version.h (with deprecated ZXVersion.h for compatibility) * Version.h contains #define ZXING_HAS_READERS and/or ZXING_HAS_WRITERS * work around issue with rusts bindgen not knowing about Version.h --- core/CMakeLists.txt | 10 +- core/{ZXVersion.h.in => Version.h.in} | 9 +- core/src/ZXVersion.h | 10 ++ core/src/ZXingC.cpp | 6 +- core/src/ZXingC.h | 170 +++++++++++++++----------- example/ZXingReader.cpp | 2 +- example/ZXingWriter.cpp | 6 +- wrappers/c/ZXingCTest.c | 2 +- wrappers/rust/build.rs | 2 +- wrappers/rust/src/bindings.rs | 94 +++++++------- 10 files changed, 179 insertions(+), 132 deletions(-) rename core/{ZXVersion.h.in => Version.h.in} (65%) create mode 100644 core/src/ZXVersion.h diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 875db53b45..8226c95e7c 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -44,8 +44,6 @@ if (MSVC) endif() set (ZXING_PRIVATE_FLAGS - $<$:-DZXING_BUILD_READERS> - $<$:-DZXING_BUILD_WRITERS> $<$:-DZXING_USE_ZINT> $<$:-DZXING_BUILD_FOR_TEST> ) @@ -106,6 +104,7 @@ set (COMMON_FILES src/ZXAlgorithms.h src/ZXConfig.h src/ZXTestSupport.h + src/ZXVersion.h # [[deprecated]] $<$:src/ZXingC.h> $<$:src/ZXingC.cpp> ) @@ -208,6 +207,7 @@ set (PUBLIC_HEADERS src/StructuredAppend.h src/TextUtfEncoding.h # [[deprecated]] src/ZXAlgorithms.h + src/ZXVersion.h # [[deprecated]] $<$:${CMAKE_CURRENT_SOURCE_DIR}/src/ZXingC.h> ) if (BUILD_READERS) @@ -599,10 +599,12 @@ install ( PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ZXing" ) -configure_file (ZXVersion.h.in ZXVersion.h) +set(ZXING_HAS_READERS ${BUILD_READERS}) +set(ZXING_HAS_WRITERS ${BUILD_WRITERS}) +configure_file (Version.h.in Version.h) install ( - FILES "${CMAKE_CURRENT_BINARY_DIR}/ZXVersion.h" + FILES "${CMAKE_CURRENT_BINARY_DIR}/Version.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ZXing" ) diff --git a/core/ZXVersion.h.in b/core/Version.h.in similarity index 65% rename from core/ZXVersion.h.in rename to core/Version.h.in index 41dd401145..40678ccec2 100644 --- a/core/ZXVersion.h.in +++ b/core/Version.h.in @@ -6,13 +6,12 @@ #pragma once +#cmakedefine ZXING_HAS_READERS +#cmakedefine ZXING_HAS_WRITERS + // Version numbering #define ZXING_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ #define ZXING_VERSION_MINOR @PROJECT_VERSION_MINOR@ #define ZXING_VERSION_PATCH @PROJECT_VERSION_PATCH@ -namespace ZXing { - -constexpr const char* ZXING_VERSION_STR = "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@"; - -} +#define ZXING_VERSION_STR "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" diff --git a/core/src/ZXVersion.h b/core/src/ZXVersion.h new file mode 100644 index 0000000000..e7abadb28e --- /dev/null +++ b/core/src/ZXVersion.h @@ -0,0 +1,10 @@ +/* +* Copyright 2024 Axel Waggershauser +*/ +// SPDX-License-Identifier: Apache-2.0 + +#pragma once + +#include "Version.h" + +#pragma message("Header `ZXVersion.h` is deprecated, please include `Version.h`.") diff --git a/core/src/ZXingC.cpp b/core/src/ZXingC.cpp index f5e26419b3..2c33051eb2 100644 --- a/core/src/ZXingC.cpp +++ b/core/src/ZXingC.cpp @@ -65,7 +65,7 @@ static uint8_t* copy(const ByteArray& ba, int* len) noexcept } \ ZX_CATCH({}) -#ifdef ZXING_BUILD_READERS +#ifdef ZXING_HAS_READERS static std::tuple ReadBarcodesAndSetLastError(const ZXing_ImageView* iv, const ZXing_ReaderOptions* opts, int maxSymbols) { @@ -250,7 +250,7 @@ ZXing_Barcode* ZXing_Barcodes_move(ZXing_Barcodes* barcodes, int i) ZX_TRY(new Barcode(std::move((*barcodes)[i]))); } -#ifdef ZXING_BUILD_READERS +#ifdef ZXING_HAS_READERS /* * ZXing/ReaderOptions.h @@ -319,7 +319,7 @@ ZXing_Barcodes* ZXing_ReadBarcodes(const ZXing_ImageView* iv, const ZXing_Reader #endif -#ifdef ZXING_BUILD_WRITERS +#ifdef ZXING_HAS_WRITERS #ifdef ZXING_BUILD_EXPERIMENTAL_API /* * ZXing/WriteBarcode.h diff --git a/core/src/ZXingC.h b/core/src/ZXingC.h index f35a118de2..259bb94681 100644 --- a/core/src/ZXingC.h +++ b/core/src/ZXingC.h @@ -10,13 +10,30 @@ #include #include +#ifdef RUST_BINDGEN +#define ZXING_HAS_READERS +#else +#include "Version.h" +#endif + #ifdef __cplusplus #include "Barcode.h" #include "ImageView.h" + +typedef ZXing::Barcode ZXing_Barcode; +typedef ZXing::Barcodes ZXing_Barcodes; +typedef ZXing::ImageView ZXing_ImageView; +typedef ZXing::Image ZXing_Image; + +#ifdef ZXING_HAS_READERS #include "ReaderOptions.h" +typedef ZXing::ReaderOptions ZXing_ReaderOptions; +#endif + #ifdef ZXING_BUILD_EXPERIMENTAL_API +#ifdef ZXING_HAS_WRITERS #include "WriteBarcode.h" typedef ZXing::CreatorOptions ZXing_CreatorOptions; typedef ZXing::WriterOptions ZXing_WriterOptions; @@ -24,24 +41,25 @@ typedef ZXing::WriterOptions ZXing_WriterOptions; typedef struct ZXing_CreatorOptions ZXing_CreatorOptions; typedef struct ZXing_WriterOptions ZXing_WriterOptions; #endif - -typedef ZXing::ImageView ZXing_ImageView; -typedef ZXing::Image ZXing_Image; -typedef ZXing::ReaderOptions ZXing_ReaderOptions; -typedef ZXing::Barcode ZXing_Barcode; -typedef ZXing::Barcodes ZXing_Barcodes; +#endif extern "C" { #else +typedef struct ZXing_Barcode ZXing_Barcode; +typedef struct ZXing_Barcodes ZXing_Barcodes; typedef struct ZXing_ImageView ZXing_ImageView; typedef struct ZXing_Image ZXing_Image; + +#ifdef ZXING_HAS_READERS typedef struct ZXing_ReaderOptions ZXing_ReaderOptions; +#endif + +#ifdef ZXING_HAS_WRITERS typedef struct ZXing_CreatorOptions ZXing_CreatorOptions; typedef struct ZXing_WriterOptions ZXing_WriterOptions; -typedef struct ZXing_Barcode ZXing_Barcode; -typedef struct ZXing_Barcodes ZXing_Barcodes; +#endif #endif @@ -122,6 +140,69 @@ ZXing_BarcodeFormats ZXing_BarcodeFormatsFromString(const char* str); ZXing_BarcodeFormat ZXing_BarcodeFormatFromString(const char* str); char* ZXing_BarcodeFormatToString(ZXing_BarcodeFormat format); +/* + * ZXing/Barcode.h + */ + +typedef enum +{ + ZXing_ContentType_Text, + ZXing_ContentType_Binary, + ZXing_ContentType_Mixed, + ZXing_ContentType_GS1, + ZXing_ContentType_ISO15434, + ZXing_ContentType_UnknownECI +} ZXing_ContentType; + +typedef enum +{ + ZXing_ErrorType_None, + ZXing_ErrorType_Format, + ZXing_ErrorType_Checksum, + ZXing_ErrorType_Unsupported +} ZXing_ErrorType; + +char* ZXing_ContentTypeToString(ZXing_ContentType type); + +typedef struct ZXing_PointI +{ + int x, y; +} ZXing_PointI; + +typedef struct ZXing_Position +{ + ZXing_PointI topLeft, topRight, bottomRight, bottomLeft; +} ZXing_Position; + +char* ZXing_PositionToString(ZXing_Position position); + +bool ZXing_Barcode_isValid(const ZXing_Barcode* barcode); +ZXing_ErrorType ZXing_Barcode_errorType(const ZXing_Barcode* barcode); +char* ZXing_Barcode_errorMsg(const ZXing_Barcode* barcode); +ZXing_BarcodeFormat ZXing_Barcode_format(const ZXing_Barcode* barcode); +ZXing_ContentType ZXing_Barcode_contentType(const ZXing_Barcode* barcode); +uint8_t* ZXing_Barcode_bytes(const ZXing_Barcode* barcode, int* len); +uint8_t* ZXing_Barcode_bytesECI(const ZXing_Barcode* barcode, int* len); +char* ZXing_Barcode_text(const ZXing_Barcode* barcode); +char* ZXing_Barcode_ecLevel(const ZXing_Barcode* barcode); +char* ZXing_Barcode_symbologyIdentifier(const ZXing_Barcode* barcode); +ZXing_Position ZXing_Barcode_position(const ZXing_Barcode* barcode); +int ZXing_Barcode_orientation(const ZXing_Barcode* barcode); +bool ZXing_Barcode_hasECI(const ZXing_Barcode* barcode); +bool ZXing_Barcode_isInverted(const ZXing_Barcode* barcode); +bool ZXing_Barcode_isMirrored(const ZXing_Barcode* barcode); +int ZXing_Barcode_lineCount(const ZXing_Barcode* barcode); + +void ZXing_Barcode_delete(ZXing_Barcode* barcode); +void ZXing_Barcodes_delete(ZXing_Barcodes* barcodes); + +int ZXing_Barcodes_size(const ZXing_Barcodes* barcodes); +const ZXing_Barcode* ZXing_Barcodes_at(const ZXing_Barcodes* barcodes, int i); +ZXing_Barcode* ZXing_Barcodes_move(ZXing_Barcodes* barcodes, int i); + + +#ifdef ZXING_HAS_READERS + /* * ZXing/ReaderOptions.h */ @@ -179,59 +260,6 @@ ZXing_TextMode ZXing_ReaderOptions_getTextMode(const ZXing_ReaderOptions* opts); int ZXing_ReaderOptions_getMinLineCount(const ZXing_ReaderOptions* opts); int ZXing_ReaderOptions_getMaxNumberOfSymbols(const ZXing_ReaderOptions* opts); -/* - * ZXing/Barcode.h - */ - -typedef enum -{ - ZXing_ContentType_Text, - ZXing_ContentType_Binary, - ZXing_ContentType_Mixed, - ZXing_ContentType_GS1, - ZXing_ContentType_ISO15434, - ZXing_ContentType_UnknownECI -} ZXing_ContentType; - -typedef enum -{ - ZXing_ErrorType_None, - ZXing_ErrorType_Format, - ZXing_ErrorType_Checksum, - ZXing_ErrorType_Unsupported -} ZXing_ErrorType; - -char* ZXing_ContentTypeToString(ZXing_ContentType type); - -typedef struct ZXing_PointI -{ - int x, y; -} ZXing_PointI; - -typedef struct ZXing_Position -{ - ZXing_PointI topLeft, topRight, bottomRight, bottomLeft; -} ZXing_Position; - -char* ZXing_PositionToString(ZXing_Position position); - -bool ZXing_Barcode_isValid(const ZXing_Barcode* barcode); -ZXing_ErrorType ZXing_Barcode_errorType(const ZXing_Barcode* barcode); -char* ZXing_Barcode_errorMsg(const ZXing_Barcode* barcode); -ZXing_BarcodeFormat ZXing_Barcode_format(const ZXing_Barcode* barcode); -ZXing_ContentType ZXing_Barcode_contentType(const ZXing_Barcode* barcode); -uint8_t* ZXing_Barcode_bytes(const ZXing_Barcode* barcode, int* len); -uint8_t* ZXing_Barcode_bytesECI(const ZXing_Barcode* barcode, int* len); -char* ZXing_Barcode_text(const ZXing_Barcode* barcode); -char* ZXing_Barcode_ecLevel(const ZXing_Barcode* barcode); -char* ZXing_Barcode_symbologyIdentifier(const ZXing_Barcode* barcode); -ZXing_Position ZXing_Barcode_position(const ZXing_Barcode* barcode); -int ZXing_Barcode_orientation(const ZXing_Barcode* barcode); -bool ZXing_Barcode_hasECI(const ZXing_Barcode* barcode); -bool ZXing_Barcode_isInverted(const ZXing_Barcode* barcode); -bool ZXing_Barcode_isMirrored(const ZXing_Barcode* barcode); -int ZXing_Barcode_lineCount(const ZXing_Barcode* barcode); - /* * ZXing/ReadBarcode.h */ @@ -240,17 +268,10 @@ int ZXing_Barcode_lineCount(const ZXing_Barcode* barcode); ZXing_Barcode* ZXing_ReadBarcode(const ZXing_ImageView* iv, const ZXing_ReaderOptions* opts); ZXing_Barcodes* ZXing_ReadBarcodes(const ZXing_ImageView* iv, const ZXing_ReaderOptions* opts); -void ZXing_Barcode_delete(ZXing_Barcode* barcode); -void ZXing_Barcodes_delete(ZXing_Barcodes* barcodes); - -int ZXing_Barcodes_size(const ZXing_Barcodes* barcodes); -const ZXing_Barcode* ZXing_Barcodes_at(const ZXing_Barcodes* barcodes, int i); -ZXing_Barcode* ZXing_Barcodes_move(ZXing_Barcodes* barcodes, int i); +#endif /* ZXING_HAS_READERS */ -/* ZXing_LastErrorMsg() returns NULL in case there is no last error and a copy of the string otherwise. */ -char* ZXing_LastErrorMsg(); - -void ZXing_free(void* ptr); +#ifdef ZXING_HAS_WRITERS +#ifdef ZXING_BUILD_EXPERIMENTAL_API /* * ZXing/WriteBarcode.h @@ -298,6 +319,13 @@ ZXing_Barcode* ZXing_CreateBarcodeFromBytes(const void* data, int size, const ZX char* ZXing_WriteBarcodeToSVG(const ZXing_Barcode* barcode, const ZXing_WriterOptions* opts); ZXing_Image* ZXing_WriteBarcodeToImage(const ZXing_Barcode* barcode, const ZXing_WriterOptions* opts); +#endif /* ZXING_HAS_WRITERS */ +#endif /* ZXING_BUILD_EXPERIMENTAL_API */ + +/* ZXing_LastErrorMsg() returns NULL in case there is no last error and a copy of the string otherwise. */ +char* ZXing_LastErrorMsg(); + +void ZXing_free(void* ptr); #ifdef __cplusplus } diff --git a/example/ZXingReader.cpp b/example/ZXingReader.cpp index 01337254b4..599a6c2a0c 100644 --- a/example/ZXingReader.cpp +++ b/example/ZXingReader.cpp @@ -6,7 +6,7 @@ #include "GTIN.h" #include "ReadBarcode.h" -#include "ZXVersion.h" +#include "Version.h" #ifdef ZXING_BUILD_EXPERIMENTAL_API #include "WriteBarcode.h" diff --git a/example/ZXingWriter.cpp b/example/ZXingWriter.cpp index ab307f141b..a04acbf916 100644 --- a/example/ZXingWriter.cpp +++ b/example/ZXingWriter.cpp @@ -3,17 +3,15 @@ */ // SPDX-License-Identifier: Apache-2.0 -#include "BarcodeFormat.h" -#include "BitMatrixIO.h" - #ifdef ZXING_BUILD_EXPERIMENTAL_API #include "WriteBarcode.h" #else #include "BitMatrix.h" +#include "BitMatrixIO.h" #include "CharacterSet.h" #include "MultiFormatWriter.h" #endif -#include "ZXVersion.h" +#include "Version.h" #include #include diff --git a/wrappers/c/ZXingCTest.c b/wrappers/c/ZXingCTest.c index 6685dd9b31..0ad85555df 100644 --- a/wrappers/c/ZXingCTest.c +++ b/wrappers/c/ZXingCTest.c @@ -74,7 +74,7 @@ int main(int argc, char** argv) CHECK(iv) } else { fprintf(stderr, "Could not read image '%s'\n", filename); -#ifdef ZXING_BUILD_EXPERIMENTAL_API +#if defined(ZXING_BUILD_EXPERIMENTAL_API) && defined(ZXING_HAS_WRITERS) if (formats == ZXing_BarcodeFormat_Invalid) return 2; fprintf(stderr, "Using '%s' as text input to create barcode\n", filename); diff --git a/wrappers/rust/build.rs b/wrappers/rust/build.rs index 8f43f3a1be..62bd233647 100644 --- a/wrappers/rust/build.rs +++ b/wrappers/rust/build.rs @@ -29,7 +29,7 @@ fn main() -> miette::Result<()> { } // manual bindings.rs generation: - // bindgen core/src/ZXingC.h -o src/bindings.rs --no-prepend-enum-name --merge-extern-blocks --use-core --no-doc-comments --no-layout-tests --with-derive-partialeq --allowlist-item "ZXing.*" + // bindgen core/src/ZXingC.h -o src/bindings.rs --no-prepend-enum-name --merge-extern-blocks --use-core --no-doc-comments --no-layout-tests --with-derive-partialeq --allowlist-item "ZXing.*" -- -DRUST_BINDGEN Ok(()) } diff --git a/wrappers/rust/src/bindings.rs b/wrappers/rust/src/bindings.rs index 1cfcfd2f02..e1f8902d91 100644 --- a/wrappers/rust/src/bindings.rs +++ b/wrappers/rust/src/bindings.rs @@ -2,22 +2,27 @@ #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ZXing_ImageView { +pub struct ZXing_Barcode { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ZXing_ReaderOptions { +pub struct ZXing_Barcodes { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ZXing_Barcode { +pub struct ZXing_ImageView { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ZXing_Barcodes { +pub struct ZXing_Image { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ZXing_ReaderOptions { _unused: [u8; 0], } pub const ZXing_ImageFormat_None: ZXing_ImageFormat = 0; @@ -56,21 +61,6 @@ pub const ZXing_BarcodeFormat_Any: ZXing_BarcodeFormat = 524287; pub const ZXing_BarcodeFormat_Invalid: ZXing_BarcodeFormat = 4294967295; pub type ZXing_BarcodeFormat = ::core::ffi::c_uint; pub use self::ZXing_BarcodeFormat as ZXing_BarcodeFormats; -pub const ZXing_Binarizer_LocalAverage: ZXing_Binarizer = 0; -pub const ZXing_Binarizer_GlobalHistogram: ZXing_Binarizer = 1; -pub const ZXing_Binarizer_FixedThreshold: ZXing_Binarizer = 2; -pub const ZXing_Binarizer_BoolCast: ZXing_Binarizer = 3; -pub type ZXing_Binarizer = ::core::ffi::c_uint; -pub const ZXing_EanAddOnSymbol_Ignore: ZXing_EanAddOnSymbol = 0; -pub const ZXing_EanAddOnSymbol_Read: ZXing_EanAddOnSymbol = 1; -pub const ZXing_EanAddOnSymbol_Require: ZXing_EanAddOnSymbol = 2; -pub type ZXing_EanAddOnSymbol = ::core::ffi::c_uint; -pub const ZXing_TextMode_Plain: ZXing_TextMode = 0; -pub const ZXing_TextMode_ECI: ZXing_TextMode = 1; -pub const ZXing_TextMode_HRI: ZXing_TextMode = 2; -pub const ZXing_TextMode_Hex: ZXing_TextMode = 3; -pub const ZXing_TextMode_Escaped: ZXing_TextMode = 4; -pub type ZXing_TextMode = ::core::ffi::c_uint; pub const ZXing_ContentType_Text: ZXing_ContentType = 0; pub const ZXing_ContentType_Binary: ZXing_ContentType = 1; pub const ZXing_ContentType_Mixed: ZXing_ContentType = 2; @@ -97,6 +87,21 @@ pub struct ZXing_Position { pub bottomRight: ZXing_PointI, pub bottomLeft: ZXing_PointI, } +pub const ZXing_Binarizer_LocalAverage: ZXing_Binarizer = 0; +pub const ZXing_Binarizer_GlobalHistogram: ZXing_Binarizer = 1; +pub const ZXing_Binarizer_FixedThreshold: ZXing_Binarizer = 2; +pub const ZXing_Binarizer_BoolCast: ZXing_Binarizer = 3; +pub type ZXing_Binarizer = ::core::ffi::c_uint; +pub const ZXing_EanAddOnSymbol_Ignore: ZXing_EanAddOnSymbol = 0; +pub const ZXing_EanAddOnSymbol_Read: ZXing_EanAddOnSymbol = 1; +pub const ZXing_EanAddOnSymbol_Require: ZXing_EanAddOnSymbol = 2; +pub type ZXing_EanAddOnSymbol = ::core::ffi::c_uint; +pub const ZXing_TextMode_Plain: ZXing_TextMode = 0; +pub const ZXing_TextMode_ECI: ZXing_TextMode = 1; +pub const ZXing_TextMode_HRI: ZXing_TextMode = 2; +pub const ZXing_TextMode_Hex: ZXing_TextMode = 3; +pub const ZXing_TextMode_Escaped: ZXing_TextMode = 4; +pub type ZXing_TextMode = ::core::ffi::c_uint; extern "C" { pub fn ZXing_ImageView_new( data: *const u8, @@ -124,9 +129,37 @@ extern "C" { height: ::core::ffi::c_int, ); pub fn ZXing_ImageView_rotate(iv: *mut ZXing_ImageView, degree: ::core::ffi::c_int); + pub fn ZXing_Image_delete(img: *mut ZXing_Image); + pub fn ZXing_Image_data(img: *const ZXing_Image) -> *const u8; + pub fn ZXing_Image_width(img: *const ZXing_Image) -> ::core::ffi::c_int; + pub fn ZXing_Image_height(img: *const ZXing_Image) -> ::core::ffi::c_int; + pub fn ZXing_Image_format(img: *const ZXing_Image) -> ZXing_ImageFormat; pub fn ZXing_BarcodeFormatsFromString(str_: *const ::core::ffi::c_char) -> ZXing_BarcodeFormats; pub fn ZXing_BarcodeFormatFromString(str_: *const ::core::ffi::c_char) -> ZXing_BarcodeFormat; pub fn ZXing_BarcodeFormatToString(format: ZXing_BarcodeFormat) -> *mut ::core::ffi::c_char; + pub fn ZXing_ContentTypeToString(type_: ZXing_ContentType) -> *mut ::core::ffi::c_char; + pub fn ZXing_PositionToString(position: ZXing_Position) -> *mut ::core::ffi::c_char; + pub fn ZXing_Barcode_isValid(barcode: *const ZXing_Barcode) -> bool; + pub fn ZXing_Barcode_errorType(barcode: *const ZXing_Barcode) -> ZXing_ErrorType; + pub fn ZXing_Barcode_errorMsg(barcode: *const ZXing_Barcode) -> *mut ::core::ffi::c_char; + pub fn ZXing_Barcode_format(barcode: *const ZXing_Barcode) -> ZXing_BarcodeFormat; + pub fn ZXing_Barcode_contentType(barcode: *const ZXing_Barcode) -> ZXing_ContentType; + pub fn ZXing_Barcode_bytes(barcode: *const ZXing_Barcode, len: *mut ::core::ffi::c_int) -> *mut u8; + pub fn ZXing_Barcode_bytesECI(barcode: *const ZXing_Barcode, len: *mut ::core::ffi::c_int) -> *mut u8; + pub fn ZXing_Barcode_text(barcode: *const ZXing_Barcode) -> *mut ::core::ffi::c_char; + pub fn ZXing_Barcode_ecLevel(barcode: *const ZXing_Barcode) -> *mut ::core::ffi::c_char; + pub fn ZXing_Barcode_symbologyIdentifier(barcode: *const ZXing_Barcode) -> *mut ::core::ffi::c_char; + pub fn ZXing_Barcode_position(barcode: *const ZXing_Barcode) -> ZXing_Position; + pub fn ZXing_Barcode_orientation(barcode: *const ZXing_Barcode) -> ::core::ffi::c_int; + pub fn ZXing_Barcode_hasECI(barcode: *const ZXing_Barcode) -> bool; + pub fn ZXing_Barcode_isInverted(barcode: *const ZXing_Barcode) -> bool; + pub fn ZXing_Barcode_isMirrored(barcode: *const ZXing_Barcode) -> bool; + pub fn ZXing_Barcode_lineCount(barcode: *const ZXing_Barcode) -> ::core::ffi::c_int; + pub fn ZXing_Barcode_delete(barcode: *mut ZXing_Barcode); + pub fn ZXing_Barcodes_delete(barcodes: *mut ZXing_Barcodes); + pub fn ZXing_Barcodes_size(barcodes: *const ZXing_Barcodes) -> ::core::ffi::c_int; + pub fn ZXing_Barcodes_at(barcodes: *const ZXing_Barcodes, i: ::core::ffi::c_int) -> *const ZXing_Barcode; + pub fn ZXing_Barcodes_move(barcodes: *mut ZXing_Barcodes, i: ::core::ffi::c_int) -> *mut ZXing_Barcode; pub fn ZXing_ReaderOptions_new() -> *mut ZXing_ReaderOptions; pub fn ZXing_ReaderOptions_delete(opts: *mut ZXing_ReaderOptions); pub fn ZXing_ReaderOptions_setTryHarder(opts: *mut ZXing_ReaderOptions, tryHarder: bool); @@ -153,31 +186,8 @@ extern "C" { pub fn ZXing_ReaderOptions_getTextMode(opts: *const ZXing_ReaderOptions) -> ZXing_TextMode; pub fn ZXing_ReaderOptions_getMinLineCount(opts: *const ZXing_ReaderOptions) -> ::core::ffi::c_int; pub fn ZXing_ReaderOptions_getMaxNumberOfSymbols(opts: *const ZXing_ReaderOptions) -> ::core::ffi::c_int; - pub fn ZXing_ContentTypeToString(type_: ZXing_ContentType) -> *mut ::core::ffi::c_char; - pub fn ZXing_PositionToString(position: ZXing_Position) -> *mut ::core::ffi::c_char; - pub fn ZXing_Barcode_isValid(barcode: *const ZXing_Barcode) -> bool; - pub fn ZXing_Barcode_errorType(barcode: *const ZXing_Barcode) -> ZXing_ErrorType; - pub fn ZXing_Barcode_errorMsg(barcode: *const ZXing_Barcode) -> *mut ::core::ffi::c_char; - pub fn ZXing_Barcode_format(barcode: *const ZXing_Barcode) -> ZXing_BarcodeFormat; - pub fn ZXing_Barcode_contentType(barcode: *const ZXing_Barcode) -> ZXing_ContentType; - pub fn ZXing_Barcode_bytes(barcode: *const ZXing_Barcode, len: *mut ::core::ffi::c_int) -> *mut u8; - pub fn ZXing_Barcode_bytesECI(barcode: *const ZXing_Barcode, len: *mut ::core::ffi::c_int) -> *mut u8; - pub fn ZXing_Barcode_text(barcode: *const ZXing_Barcode) -> *mut ::core::ffi::c_char; - pub fn ZXing_Barcode_ecLevel(barcode: *const ZXing_Barcode) -> *mut ::core::ffi::c_char; - pub fn ZXing_Barcode_symbologyIdentifier(barcode: *const ZXing_Barcode) -> *mut ::core::ffi::c_char; - pub fn ZXing_Barcode_position(barcode: *const ZXing_Barcode) -> ZXing_Position; - pub fn ZXing_Barcode_orientation(barcode: *const ZXing_Barcode) -> ::core::ffi::c_int; - pub fn ZXing_Barcode_hasECI(barcode: *const ZXing_Barcode) -> bool; - pub fn ZXing_Barcode_isInverted(barcode: *const ZXing_Barcode) -> bool; - pub fn ZXing_Barcode_isMirrored(barcode: *const ZXing_Barcode) -> bool; - pub fn ZXing_Barcode_lineCount(barcode: *const ZXing_Barcode) -> ::core::ffi::c_int; pub fn ZXing_ReadBarcode(iv: *const ZXing_ImageView, opts: *const ZXing_ReaderOptions) -> *mut ZXing_Barcode; pub fn ZXing_ReadBarcodes(iv: *const ZXing_ImageView, opts: *const ZXing_ReaderOptions) -> *mut ZXing_Barcodes; - pub fn ZXing_Barcode_delete(barcode: *mut ZXing_Barcode); - pub fn ZXing_Barcodes_delete(barcodes: *mut ZXing_Barcodes); - pub fn ZXing_Barcodes_size(barcodes: *const ZXing_Barcodes) -> ::core::ffi::c_int; - pub fn ZXing_Barcodes_at(barcodes: *const ZXing_Barcodes, i: ::core::ffi::c_int) -> *const ZXing_Barcode; - pub fn ZXing_Barcodes_move(barcodes: *mut ZXing_Barcodes, i: ::core::ffi::c_int) -> *mut ZXing_Barcode; pub fn ZXing_LastErrorMsg() -> *mut ::core::ffi::c_char; pub fn ZXing_free(ptr: *mut ::core::ffi::c_void); }