1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-17 18:07:02 +00:00

gs1: Use new gs1_encoders_init_ex() API;

remove refs to EXCLUDE_GS1_SYNTAX_DICTIONARY
This commit is contained in:
gitlost
2025-10-02 11:34:45 +01:00
parent 4d301ea560
commit d2b4904401
5 changed files with 19 additions and 12 deletions

View File

@@ -26,7 +26,7 @@ jobs:
run: sudo apt-get install libpng-dev
- name: Install GS1 Syntax Engine
run: git clone --depth=1 https://github.com/gs1/gs1-syntax-engine && cd gs1-syntax-engine/src/c-lib && make CFLAGS_G='-DEXCLUDE_SYNTAX_DICTIONARY_LOADER' lib && sudo make install
run: git clone --depth=1 https://github.com/gs1/gs1-syntax-engine && cd gs1-syntax-engine/src/c-lib && make lib && sudo make install
- name: Install locale
shell: bash
@@ -70,7 +70,7 @@ jobs:
run: sudo apt-get install libpng-dev
- name: Install GS1 Syntax Engine
run: git clone --depth=1 https://github.com/gs1/gs1-syntax-engine && cd gs1-syntax-engine/src/c-lib && make CFLAGS_G='-DEXCLUDE_SYNTAX_DICTIONARY_LOADER' lib && sudo make install
run: git clone --depth=1 https://github.com/gs1/gs1-syntax-engine && cd gs1-syntax-engine/src/c-lib && make lib && sudo make install
- name: Install locale
shell: bash
@@ -236,7 +236,7 @@ jobs:
run: brew install qt5
- name: Install GS1 Syntax Engine
run: git clone --depth=1 https://github.com/gs1/gs1-syntax-engine && cd gs1-syntax-engine/src/c-lib && make CFLAGS_G='-DEXCLUDE_SYNTAX_DICTIONARY_LOADER' lib && (sudo make install || true)
run: git clone --depth=1 https://github.com/gs1/gs1-syntax-engine && cd gs1-syntax-engine/src/c-lib && make lib && (sudo make install || true)
- name: Configure CMake
working-directory: build

View File

@@ -1,4 +1,4 @@
% README.bsd 2025-09-26
% README.bsd 2025-10-02
% Tested on FreeBSD 14.3-RELEASE (with X11 + GNOME installed), OpenBSD 7.7 (with X11) and NetBSD 10.1 (with X11)
1. Prerequisites for building zint
@@ -26,7 +26,7 @@ To install the gs1encoders library, optional but needed for GS1 Syntax Engine su
git clone https://github.com/gs1/gs1-syntax-engine
cd gs1-syntax-engine/src/c-lib
gmake CFLAGS_G='-DEXCLUDE_SYNTAX_DICTIONARY_LOADER' lib
gmake lib
su
gmake install
exit

View File

@@ -1,4 +1,4 @@
% README.linux 2025-09-16
% README.linux 2025-10-02
% Tested on Ubuntu 20.04.4 LTS, Ubuntu 22.04 LTS, Ubuntu 24.04 LTS and
% Fedora Linux 42 (Workstation Edition)
@@ -25,10 +25,10 @@ gs1encoders is optional but necessary for GS1 Syntax Engine support. To install
git clone https://github.com/gs1/gs1-syntax-engine
and navigate to "src/c-lib" and make with EXCLUDE_SYNTAX_DICTIONARY_LOADER defined:
and navigate to "src/c-lib" and make:
cd gs1-syntax-engine/src/c-lib
make CFLAGS_G='-DEXCLUDE_SYNTAX_DICTIONARY_LOADER' lib && sudo make install
make lib && sudo make install
cd ../../..
Now either download the zint source code tarball

View File

@@ -1,4 +1,4 @@
% README.macos 2025-09-16
% README.macos 2025-10-02
% Tested on macOS 12.7.2 Monterey VirtualBox (thanks to https://github.com/myspaghetti/macos-virtualbox)
1. Prerequisites for building zint and zint-qt
@@ -33,7 +33,7 @@ Clone and install the gs1encoders library (optional but necessary for GS1 Syntax
git clone https://github.com/gs1/gs1-syntax-engine
cd gs1-syntax-engine/src/c-lib
make CFLAGS_G='-DEXCLUDE_SYNTAX_DICTIONARY_LOADER' lib && sudo make install
make lib && sudo make install
cd ../../..
Add the Qt5 bin directory to the PATH

View File

@@ -1637,6 +1637,11 @@ static int gs1se_verify(struct zint_symbol *symbol, const unsigned char source[]
unsigned char *local_source2_buf = (unsigned char *) z_alloca(ARRAY_SIZE(symbol->primary) * 2 + length
+ parens_cnt + 1);
int is_digital_link = 0;
char msgBuf[120];
gs1_encoder_init_status_t status = GS1_ENCODERS_INIT_SUCCESS;
gs1_encoder_init_opts_t opts = {
sizeof(gs1_encoder_init_opts_t), gs1_encoder_iNO_SYNDICT | gs1_encoder_iQUIET, &status, msgBuf, sizeof(msgBuf)
};
gs1_encoder *ctx;
int gs1se_ret;
@@ -1702,8 +1707,10 @@ static int gs1se_verify(struct zint_symbol *symbol, const unsigned char source[]
}
}
if (!(ctx = gs1_encoder_init(NULL))) {
return z_errtxt(ZINT_ERROR_MEMORY, symbol, 266, "Insufficient memory for GS1 Syntax Engine");
if (!(ctx = gs1_encoder_init_ex(NULL /*mem*/, &opts))) {
const int error_number = status == GS1_ENCODERS_INIT_FAILED_NO_MEM
? ZINT_ERROR_MEMORY : ZINT_ERROR_ENCODING_PROBLEM;
return z_errtxtf(error_number, symbol, 266, "GS1 Syntax Engine: %s", opts.msgBuf);
}
if (is_digital_link) {