1
0
mirror of https://github.com/woo-j/zint.git synced 2024-12-23 01:33:55 +03:00

GS1: add new AI 7011 (GSCN 22-163)

This commit is contained in:
gitlost 2022-12-07 10:54:36 +00:00
parent 2230c3a2ec
commit 1daa1ab0ab
4 changed files with 300 additions and 280 deletions

View File

@ -63,6 +63,9 @@ Changes
checkboxes
- CLI: use new `validate_float()` to parse float options (7 significant digits
allowed only, no scientific notation)
- CLI: mirror: use -o directory if any (ticket #193)
- QRCODE/UPNQR: add FAST_MODE (try 4 not 8 masks automatically)
- GS1: add new AI 7011 (GSCN 22-163)
- DATAMATRIX/GRIDMATRIX/PDF417/QR/ULTRA: micro-optimize structapp ID parse
- library/CLI: fiddle with static asserts (make CHAR_BIT sensitive, supposedly)
- win32/README: update building libpng (assembly removed)

View File

@ -1,6 +1,6 @@
/*
* GS1 AI checker generated by "backend/tools/gen_gs1_lint.php" from
* standards/GS1/gs1-syntax-dictionary-2022-07-11.txt
* https://ref.gs1.org/tools/gs1-barcode-syntax-resource/syntax-dictionary/
*/
/*
libzint - the open source barcode library
@ -355,6 +355,18 @@ static int x__2(const unsigned char *data, const int data_len,
&& cset82(data, data_len, 0, 1, 2, p_err_no, p_err_posn, err_msg);
}
/* N6,yymmdd [N4],hhmm (Used by TEST BY DATE) */
static int n6_yymmdd__n4__hhmm(const unsigned char *data, const int data_len,
int *p_err_no, int *p_err_posn, char err_msg[50]) {
return data_len >= 6 && data_len <= 10
&& yymmdd(data, data_len, 0, 6, 6, p_err_no, p_err_posn, err_msg, 1 /*length_only*/)
&& hhmm(data, data_len, 6, 0, 4, p_err_no, p_err_posn, err_msg, 1 /*length_only*/)
&& numeric(data, data_len, 0, 6, 6, p_err_no, p_err_posn, err_msg)
&& yymmdd(data, data_len, 0, 6, 6, p_err_no, p_err_posn, err_msg, 0)
&& numeric(data, data_len, 6, 0, 4, p_err_no, p_err_posn, err_msg)
&& hhmm(data, data_len, 6, 0, 4, p_err_no, p_err_posn, err_msg, 0);
}
/* N3,iso3166999 X..27 (Used by PROCESSOR # 0, PROCESSOR # 1, PROCESSOR # 2, PROCESSOR # 3...) */
static int n3_iso3166999_x__27(const unsigned char *data, const int data_len,
int *p_err_no, int *p_err_posn, char err_msg[50]) {
@ -759,6 +771,9 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len,
if (ai == 7010) {
return x__2(data, data_len, p_err_no, p_err_posn, err_msg);
}
if (ai == 7011) {
return n6_yymmdd__n4__hhmm(data, data_len, p_err_no, p_err_posn, err_msg);
}
if (ai >= 7020 && ai <= 7022) {
return x__20(data, data_len, p_err_no, p_err_posn, err_msg);
}

View File

@ -1076,272 +1076,275 @@ static void test_gs1_verify(const testCtx *const p_ctx) {
/*716*/ { "[7010]01", 0, "701001" },
/*717*/ { "[7010]1", 0, "70101" },
/*718*/ { "[7010]012", ZINT_ERROR_INVALID_DATA, "" },
/*719*/ { "[7011]1234", ZINT_ERROR_INVALID_DATA, "" },
/*720*/ { "[7012]1234", ZINT_ERROR_INVALID_DATA, "" },
/*721*/ { "[7019]1234", ZINT_ERROR_INVALID_DATA, "" },
/*722*/ { "[7020]abcdefghijklmnopqrst", 0, "7020abcdefghijklmnopqrst" },
/*723*/ { "[7020]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*724*/ { "[7021]abcdefghijklmnopqrst", 0, "7021abcdefghijklmnopqrst" },
/*725*/ { "[7021]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*726*/ { "[7022]abcdefghijklmnopqrst", 0, "7022abcdefghijklmnopqrst" },
/*727*/ { "[7022]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*728*/ { "[7023]1234abcdefghijklmnopqrstuvwxyz", 0, "70231234abcdefghijklmnopqrstuvwxyz" },
/*729*/ { "[7023]1234abcdefghijklmnopqrstuvwxyza", ZINT_ERROR_INVALID_DATA, "" },
/*730*/ { "[7024]1234", ZINT_ERROR_INVALID_DATA, "" },
/*731*/ { "[7025]1234", ZINT_ERROR_INVALID_DATA, "" },
/*732*/ { "[7029]1234", ZINT_ERROR_INVALID_DATA, "" },
/*733*/ { "[7030]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7030123abcdefghijklmnopqrstuvwxyza" },
/*734*/ { "[7030]004abcdefghijklmnopqrstuvwxyza", 0, "7030004abcdefghijklmnopqrstuvwxyza" },
/*735*/ { "[7030]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*736*/ { "[7031]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7031123abcdefghijklmnopqrstuvwxyza" },
/*737*/ { "[7031]004abcdefghijklmnopqrstuvwxyza", 0, "7031004abcdefghijklmnopqrstuvwxyza" },
/*738*/ { "[7031]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*739*/ { "[7032]004abcdefghijklmnopqrstuvwxyza", 0, "7032004abcdefghijklmnopqrstuvwxyza" },
/*740*/ { "[7032]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*741*/ { "[7033]004abcdefghijklmnopqrstuvwxyza", 0, "7033004abcdefghijklmnopqrstuvwxyza" },
/*742*/ { "[7033]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*743*/ { "[7034]004abcdefghijklmnopqrstuvwxyza", 0, "7034004abcdefghijklmnopqrstuvwxyza" },
/*744*/ { "[7034]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*745*/ { "[7035]004abcdefghijklmnopqrstuvwxyza", 0, "7035004abcdefghijklmnopqrstuvwxyza" },
/*746*/ { "[7035]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*747*/ { "[7036]004abcdefghijklmnopqrstuvwxyza", 0, "7036004abcdefghijklmnopqrstuvwxyza" },
/*748*/ { "[7036]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*749*/ { "[7037]004abcdefghijklmnopqrstuvwxyza", 0, "7037004abcdefghijklmnopqrstuvwxyza" },
/*750*/ { "[7037]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*751*/ { "[7038]004abcdefghijklmnopqrstuvwxyza", 0, "7038004abcdefghijklmnopqrstuvwxyza" },
/*752*/ { "[7038]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*753*/ { "[7039]004abcdefghijklmnopqrstuvwxyza", 0, "7039004abcdefghijklmnopqrstuvwxyza" },
/*754*/ { "[7039]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*755*/ { "[7040]1abc", 0, "70401abc" },
/*756*/ { "[7040]1ab", ZINT_ERROR_INVALID_DATA, "" },
/*757*/ { "[7040]1abcd", ZINT_ERROR_INVALID_DATA, "" },
/*758*/ { "[7041]1234", ZINT_ERROR_INVALID_DATA, "" },
/*759*/ { "[7042]1234", ZINT_ERROR_INVALID_DATA, "" },
/*760*/ { "[7050]1234", ZINT_ERROR_INVALID_DATA, "" },
/*761*/ { "[7090]1234", ZINT_ERROR_INVALID_DATA, "" },
/*762*/ { "[7099]1234", ZINT_ERROR_INVALID_DATA, "" },
/*763*/ { "[71]1234", ZINT_ERROR_INVALID_DATA, "" },
/*764*/ { "[710]abcdefghijklmnopqrst", 0, "710abcdefghijklmnopqrst" },
/*765*/ { "[710]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*766*/ { "[7100]1234", ZINT_ERROR_INVALID_DATA, "" },
/*767*/ { "[711]abcdefghijklmnopqrst", 0, "711abcdefghijklmnopqrst" },
/*768*/ { "[711]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*769*/ { "[712]abcdefghijklmnopqrst", 0, "712abcdefghijklmnopqrst" },
/*770*/ { "[712]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*771*/ { "[713]abcdefghijklmnopqrst", 0, "713abcdefghijklmnopqrst" },
/*772*/ { "[713]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*773*/ { "[714]abcdefghijklmnopqrst", 0, "714abcdefghijklmnopqrst" },
/*774*/ { "[714]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*775*/ { "[715]abcdefghijklmnopqrst", 0, "715abcdefghijklmnopqrst" },
/*776*/ { "[715]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*777*/ { "[716]1234", ZINT_ERROR_INVALID_DATA, "" },
/*778*/ { "[719]1234", ZINT_ERROR_INVALID_DATA, "" },
/*779*/ { "[72]1234", ZINT_ERROR_INVALID_DATA, "" },
/*780*/ { "[720]1234", ZINT_ERROR_INVALID_DATA, "" },
/*781*/ { "[7200]1234", ZINT_ERROR_INVALID_DATA, "" },
/*782*/ { "[721]1234", ZINT_ERROR_INVALID_DATA, "" },
/*783*/ { "[7210]1234", ZINT_ERROR_INVALID_DATA, "" },
/*784*/ { "[7220]1234", ZINT_ERROR_INVALID_DATA, "" },
/*785*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzab", 0, "7230EMabcdefghijklmnopqrstuvwxyzab" },
/*786*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*787*/ { "[7230]EM", ZINT_ERROR_INVALID_DATA, "" },
/*788*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzab", 0, "7231EMabcdefghijklmnopqrstuvwxyzab" },
/*789*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*790*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzab", 0, "7232EMabcdefghijklmnopqrstuvwxyzab" },
/*791*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*792*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzab", 0, "7233EMabcdefghijklmnopqrstuvwxyzab" },
/*793*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*794*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzab", 0, "7234EMabcdefghijklmnopqrstuvwxyzab" },
/*795*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*796*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzab", 0, "7235EMabcdefghijklmnopqrstuvwxyzab" },
/*797*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*798*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzab", 0, "7236EMabcdefghijklmnopqrstuvwxyzab" },
/*799*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*800*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzab", 0, "7237EMabcdefghijklmnopqrstuvwxyzab" },
/*801*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*802*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzab", 0, "7238EMabcdefghijklmnopqrstuvwxyzab" },
/*803*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*804*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzab", 0, "7239EMabcdefghijklmnopqrstuvwxyzab" },
/*805*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*806*/ { "[7239]E", ZINT_ERROR_INVALID_DATA, "" },
/*807*/ { "[7240]abcdefghijklmnopqrst", 0, "7240abcdefghijklmnopqrst" },
/*808*/ { "[7240]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*809*/ { "[7241]1234", ZINT_ERROR_INVALID_DATA, "" },
/*810*/ { "[7249]1234", ZINT_ERROR_INVALID_DATA, "" },
/*811*/ { "[7250]1234", ZINT_ERROR_INVALID_DATA, "" },
/*812*/ { "[7299]1234", ZINT_ERROR_INVALID_DATA, "" },
/*813*/ { "[73]1234", ZINT_ERROR_INVALID_DATA, "" },
/*814*/ { "[7300]1234", ZINT_ERROR_INVALID_DATA, "" },
/*815*/ { "[74]1234", ZINT_ERROR_INVALID_DATA, "" },
/*816*/ { "[7400]1234", ZINT_ERROR_INVALID_DATA, "" },
/*817*/ { "[79]1234", ZINT_ERROR_INVALID_DATA, "" },
/*818*/ { "[7900]1234", ZINT_ERROR_INVALID_DATA, "" },
/*819*/ { "[7999]1234", ZINT_ERROR_INVALID_DATA, "" },
/*820*/ { "[80]1234", ZINT_ERROR_INVALID_DATA, "" },
/*821*/ { "[800]1234", ZINT_ERROR_INVALID_DATA, "" },
/*822*/ { "[8000]1234", ZINT_ERROR_INVALID_DATA, "" },
/*823*/ { "[8001]12345678901234", ZINT_WARN_NONCOMPLIANT, "800112345678901234" },
/*824*/ { "[8001]12345678901204", 0, "800112345678901204" },
/*825*/ { "[8001]1234123456789012345", ZINT_ERROR_INVALID_DATA, "" },
/*826*/ { "[8002]abcdefghijklmnopqrst", 0, "8002abcdefghijklmnopqrst" },
/*827*/ { "[8002]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*828*/ { "[8003]01234567890123abcdefghijklmnop", ZINT_WARN_NONCOMPLIANT, "800301234567890123abcdefghijklmnop" },
/*829*/ { "[8003]01234567890128abcdefghijklmnop", 0, "800301234567890128abcdefghijklmnop" },
/*830*/ { "[8003]01234567890128abcdefghijklmnopq", ZINT_ERROR_INVALID_DATA, "" },
/*831*/ { "[8004]abcdefghijklmnopqrstuvwxyz1234", ZINT_WARN_NONCOMPLIANT, "8004abcdefghijklmnopqrstuvwxyz1234" },
/*832*/ { "[8004]12cdefghijklmnopqrstuvwxyz1234", 0, "800412cdefghijklmnopqrstuvwxyz1234" },
/*833*/ { "[8004]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" },
/*834*/ { "[8005]123456", 0, "8005123456" },
/*835*/ { "[8005]12345", ZINT_ERROR_INVALID_DATA, "" },
/*836*/ { "[8005]1234567", ZINT_ERROR_INVALID_DATA, "" },
/*837*/ { "[8006]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8006123456789012341212" },
/*838*/ { "[8006]123456789012311212", 0, "8006123456789012311212" },
/*839*/ { "[8006]12345678901234121", ZINT_ERROR_INVALID_DATA, "" },
/*840*/ { "[8006]1234567890123412123", ZINT_ERROR_INVALID_DATA, "" },
/*841*/ { "[8007]abcdefghijklmnopqrstuvwxyz12345678", ZINT_WARN_NONCOMPLIANT, "8007abcdefghijklmnopqrstuvwxyz12345678" },
/*842*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678" },
/*843*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ123456789", ZINT_ERROR_INVALID_DATA, "" },
/*844*/ { "[8008]123456121212", ZINT_WARN_NONCOMPLIANT, "8008123456121212" },
/*845*/ { "[8008]121256121212", ZINT_WARN_NONCOMPLIANT, "8008121256121212" },
/*846*/ { "[8008]121231121212", 0, "8008121231121212" },
/*847*/ { "[8008]1234561212", ZINT_WARN_NONCOMPLIANT, "80081234561212" },
/*848*/ { "[8008]1212311212", 0, "80081212311212" },
/*849*/ { "[8008]12345612", ZINT_WARN_NONCOMPLIANT, "800812345612" },
/*850*/ { "[8008]12010112", 0, "800812010112" },
/*851*/ { "[8008]1234561", ZINT_ERROR_INVALID_DATA, "" },
/*852*/ { "[8008]123456121", ZINT_ERROR_INVALID_DATA, "" },
/*853*/ { "[8008]12345612121", ZINT_ERROR_INVALID_DATA, "" },
/*854*/ { "[8008]1234561212123", ZINT_ERROR_INVALID_DATA, "" },
/*855*/ { "[8009]12345678901234567890123456789012345678901234567890", 0, "800912345678901234567890123456789012345678901234567890" },
/*856*/ { "[8009]123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*857*/ { "[8010]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "" },
/*858*/ { "[8011]123456789012", 0, "8011123456789012" },
/*859*/ { "[8011]1234567890123", ZINT_ERROR_INVALID_DATA, "" },
/*860*/ { "[8012]abcdefghijklmnopqrst", 0, "8012abcdefghijklmnopqrst" },
/*861*/ { "[8012]abcdefghijklmnopqrstuv", ZINT_ERROR_INVALID_DATA, "" },
/*862*/ { "[8013]1234abcdefghijklmnopqrsQP", 0, "80131234abcdefghijklmnopqrsQP" },
/*863*/ { "[8013]1234abcdefghijklmnopqrsQPv", ZINT_ERROR_INVALID_DATA, "" },
/*864*/ { "[8014]1234", ZINT_ERROR_INVALID_DATA, "" },
/*865*/ { "[8016]1234", ZINT_ERROR_INVALID_DATA, "" },
/*866*/ { "[8017]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8017313131313131313139" },
/*867*/ { "[8017]313131313131313131", 0, "8017313131313131313131" },
/*868*/ { "[8017]31313131313131313", ZINT_ERROR_INVALID_DATA, "" },
/*869*/ { "[8017]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" },
/*870*/ { "[8018]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8018313131313131313139" },
/*871*/ { "[8018]313131313131313131", 0, "8018313131313131313131" },
/*872*/ { "[8018]31313131313131313", ZINT_ERROR_INVALID_DATA, "" },
/*873*/ { "[8018]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" },
/*874*/ { "[8019]1234567890", 0, "80191234567890" },
/*875*/ { "[8019]12345678901", ZINT_ERROR_INVALID_DATA, "" },
/*876*/ { "[8020]abcdefghijklmnopqrstuvwxy", 0, "8020abcdefghijklmnopqrstuvwxy" },
/*877*/ { "[8020]abcdefghijklmnopqrstuvwxyz", ZINT_ERROR_INVALID_DATA, "" },
/*878*/ { "[8021]1234", ZINT_ERROR_INVALID_DATA, "" },
/*879*/ { "[8025]1234", ZINT_ERROR_INVALID_DATA, "" },
/*880*/ { "[8026]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8026123456789012341212" },
/*881*/ { "[8026]123456789012311212", 0, "8026123456789012311212" },
/*882*/ { "[8026]1234567890123451212", ZINT_ERROR_INVALID_DATA, "" },
/*883*/ { "[8026]12345678901234512", ZINT_ERROR_INVALID_DATA, "" },
/*884*/ { "[8027]1234", ZINT_ERROR_INVALID_DATA, "" },
/*885*/ { "[8030]1234", ZINT_ERROR_INVALID_DATA, "" },
/*886*/ { "[8040]1234", ZINT_ERROR_INVALID_DATA, "" },
/*887*/ { "[8050]1234", ZINT_ERROR_INVALID_DATA, "" },
/*888*/ { "[8060]1234", ZINT_ERROR_INVALID_DATA, "" },
/*889*/ { "[8070]1234", ZINT_ERROR_INVALID_DATA, "" },
/*890*/ { "[8080]1234", ZINT_ERROR_INVALID_DATA, "" },
/*891*/ { "[8090]1234", ZINT_ERROR_INVALID_DATA, "" },
/*892*/ { "[8099]1234", ZINT_ERROR_INVALID_DATA, "" },
/*893*/ { "[81]1234", ZINT_ERROR_INVALID_DATA, "" },
/*894*/ { "[8100]1234", ZINT_ERROR_INVALID_DATA, "" },
/*895*/ { "[8109]1234", ZINT_ERROR_INVALID_DATA, "" },
/*896*/ { "[8110]5123456789011234565123455123450123105123450123512345678901320123190000", 0, "81105123456789011234565123455123450123105123450123512345678901320123190000" },
/*897*/ { "[8110]51234567890112345651234551234501231051234501235123456789013201231900001", ZINT_ERROR_INVALID_DATA, "" },
/*898*/ { "[8111]1234", 0, "81111234" },
/*899*/ { "[8111]12345", ZINT_ERROR_INVALID_DATA, "" },
/*900*/ { "[8111]123", ZINT_ERROR_INVALID_DATA, "" },
/*901*/ { "[8112]1234567890123456789012345678901234567890123456789012345678901234567890", ZINT_WARN_NONCOMPLIANT, "81121234567890123456789012345678901234567890123456789012345678901234567890" },
/*902*/ { "[8112]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*903*/ { "[8112]061234567890121234569123456789012345", 0, "8112061234567890121234569123456789012345" },
/*904*/ { "[8113]1234", ZINT_ERROR_INVALID_DATA, "" },
/*905*/ { "[8120]1234", ZINT_ERROR_INVALID_DATA, "" },
/*906*/ { "[8130]1234", ZINT_ERROR_INVALID_DATA, "" },
/*907*/ { "[8140]1234", ZINT_ERROR_INVALID_DATA, "" },
/*908*/ { "[8150]1234", ZINT_ERROR_INVALID_DATA, "" },
/*909*/ { "[8190]1234", ZINT_ERROR_INVALID_DATA, "" },
/*910*/ { "[8199]1234", ZINT_ERROR_INVALID_DATA, "" },
/*911*/ { "[82]1234", ZINT_ERROR_INVALID_DATA, "" },
/*912*/ { "[8200]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "82001234567890123456789012345678901234567890123456789012345678901234567890" },
/*913*/ { "[8201]1234", ZINT_ERROR_INVALID_DATA, "" },
/*914*/ { "[8210]1234", ZINT_ERROR_INVALID_DATA, "" },
/*915*/ { "[8220]1234", ZINT_ERROR_INVALID_DATA, "" },
/*916*/ { "[8230]1234", ZINT_ERROR_INVALID_DATA, "" },
/*917*/ { "[8240]1234", ZINT_ERROR_INVALID_DATA, "" },
/*918*/ { "[8250]1234", ZINT_ERROR_INVALID_DATA, "" },
/*919*/ { "[8290]1234", ZINT_ERROR_INVALID_DATA, "" },
/*920*/ { "[8299]1234", ZINT_ERROR_INVALID_DATA, "" },
/*921*/ { "[83]1234", ZINT_ERROR_INVALID_DATA, "" },
/*922*/ { "[830]1234", ZINT_ERROR_INVALID_DATA, "" },
/*923*/ { "[8300]1234", ZINT_ERROR_INVALID_DATA, "" },
/*924*/ { "[84]1234", ZINT_ERROR_INVALID_DATA, "" },
/*925*/ { "[840]1234", ZINT_ERROR_INVALID_DATA, "" },
/*926*/ { "[8400]1234", ZINT_ERROR_INVALID_DATA, "" },
/*927*/ { "[85]1234", ZINT_ERROR_INVALID_DATA, "" },
/*928*/ { "[850]1234", ZINT_ERROR_INVALID_DATA, "" },
/*929*/ { "[8500]1234", ZINT_ERROR_INVALID_DATA, "" },
/*930*/ { "[89]1234", ZINT_ERROR_INVALID_DATA, "" },
/*931*/ { "[890]1234", ZINT_ERROR_INVALID_DATA, "" },
/*932*/ { "[8900]1234", ZINT_ERROR_INVALID_DATA, "" },
/*933*/ { "[90]abcdefghijklmnopqrstuvwxyz1234", 0, "90abcdefghijklmnopqrstuvwxyz1234" },
/*934*/ { "[90]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" },
/*935*/ { "[900]1234", ZINT_ERROR_INVALID_DATA, "" },
/*936*/ { "[9000]1234", ZINT_ERROR_INVALID_DATA, "" },
/*937*/ { "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "91123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*938*/ { "[91]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*939*/ { "[910]1234", ZINT_ERROR_INVALID_DATA, "" },
/*940*/ { "[9100]1234", ZINT_ERROR_INVALID_DATA, "" },
/*941*/ { "[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*942*/ { "[92]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*943*/ { "[920]1234", ZINT_ERROR_INVALID_DATA, "" },
/*944*/ { "[9200]1234", ZINT_ERROR_INVALID_DATA, "" },
/*945*/ { "[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "93123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*946*/ { "[93]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*947*/ { "[930]1234", ZINT_ERROR_INVALID_DATA, "" },
/*948*/ { "[9300]1234", ZINT_ERROR_INVALID_DATA, "" },
/*949*/ { "[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "94123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*950*/ { "[94]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*951*/ { "[940]1234", ZINT_ERROR_INVALID_DATA, "" },
/*952*/ { "[9400]1234", ZINT_ERROR_INVALID_DATA, "" },
/*953*/ { "[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "95123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*954*/ { "[95]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*955*/ { "[950]1234", ZINT_ERROR_INVALID_DATA, "" },
/*956*/ { "[9500]1234", ZINT_ERROR_INVALID_DATA, "" },
/*957*/ { "[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "96123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*958*/ { "[96]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*959*/ { "[960]1234", ZINT_ERROR_INVALID_DATA, "" },
/*960*/ { "[9600]1234", ZINT_ERROR_INVALID_DATA, "" },
/*961*/ { "[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "97123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*962*/ { "[97]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*963*/ { "[970]1234", ZINT_ERROR_INVALID_DATA, "" },
/*964*/ { "[9700]1234", ZINT_ERROR_INVALID_DATA, "" },
/*965*/ { "[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "98123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*966*/ { "[98]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*967*/ { "[980]1234", ZINT_ERROR_INVALID_DATA, "" },
/*968*/ { "[9800]1234", ZINT_ERROR_INVALID_DATA, "" },
/*969*/ { "[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "99123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*970*/ { "[99]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*971*/ { "[990]1234", ZINT_ERROR_INVALID_DATA, "" },
/*972*/ { "[9900]1234", ZINT_ERROR_INVALID_DATA, "" },
/*973*/ { "[9999]1234", ZINT_ERROR_INVALID_DATA, "" },
/*974*/ { "[01]12345678901234[7006]200101", ZINT_WARN_NONCOMPLIANT, "01123456789012347006200101" },
/*975*/ { "[01]12345678901231[7006]200101", 0, "01123456789012317006200101" },
/*976*/ { "[3900]1234567890[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "39001234567890[0112345678901234" },
/*977*/ { "[3900]1234567890[01]12345678901231", 0, "39001234567890[0112345678901231" },
/*978*/ { "[253]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[390112345678901234[2012" },
/*979*/ { "[253]12345678901284[3901]12345678901234[20]12", 0, "25312345678901284[390112345678901234[2012" },
/*980*/ { "[253]12345678901234[01]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[0112345678901234390112345678901234[2012" },
/*981*/ { "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", 0, "25312345678901284[0112345678901231390112345678901234[2012" },
/*982*/ { "[01]12345678901231[0A]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "" },
/*983*/ { "[01]12345678901231[0]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "" },
/*984*/ { "[01]12345678901231[]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "" },
/*719*/ { "[7011]121212", 0, "7011121212" },
/*720*/ { "[7011]1212121212", 0, "70111212121212" },
/*721*/ { "[7011]12121", ZINT_ERROR_INVALID_DATA, "" },
/*722*/ { "[7011]121212121", ZINT_ERROR_INVALID_DATA, "" },
/*723*/ { "[7012]1234", ZINT_ERROR_INVALID_DATA, "" },
/*724*/ { "[7019]1234", ZINT_ERROR_INVALID_DATA, "" },
/*725*/ { "[7020]abcdefghijklmnopqrst", 0, "7020abcdefghijklmnopqrst" },
/*726*/ { "[7020]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*727*/ { "[7021]abcdefghijklmnopqrst", 0, "7021abcdefghijklmnopqrst" },
/*728*/ { "[7021]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*729*/ { "[7022]abcdefghijklmnopqrst", 0, "7022abcdefghijklmnopqrst" },
/*730*/ { "[7022]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*731*/ { "[7023]1234abcdefghijklmnopqrstuvwxyz", 0, "70231234abcdefghijklmnopqrstuvwxyz" },
/*732*/ { "[7023]1234abcdefghijklmnopqrstuvwxyza", ZINT_ERROR_INVALID_DATA, "" },
/*733*/ { "[7024]1234", ZINT_ERROR_INVALID_DATA, "" },
/*734*/ { "[7025]1234", ZINT_ERROR_INVALID_DATA, "" },
/*735*/ { "[7029]1234", ZINT_ERROR_INVALID_DATA, "" },
/*736*/ { "[7030]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7030123abcdefghijklmnopqrstuvwxyza" },
/*737*/ { "[7030]004abcdefghijklmnopqrstuvwxyza", 0, "7030004abcdefghijklmnopqrstuvwxyza" },
/*738*/ { "[7030]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*739*/ { "[7031]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7031123abcdefghijklmnopqrstuvwxyza" },
/*740*/ { "[7031]004abcdefghijklmnopqrstuvwxyza", 0, "7031004abcdefghijklmnopqrstuvwxyza" },
/*741*/ { "[7031]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*742*/ { "[7032]004abcdefghijklmnopqrstuvwxyza", 0, "7032004abcdefghijklmnopqrstuvwxyza" },
/*743*/ { "[7032]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*744*/ { "[7033]004abcdefghijklmnopqrstuvwxyza", 0, "7033004abcdefghijklmnopqrstuvwxyza" },
/*745*/ { "[7033]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*746*/ { "[7034]004abcdefghijklmnopqrstuvwxyza", 0, "7034004abcdefghijklmnopqrstuvwxyza" },
/*747*/ { "[7034]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*748*/ { "[7035]004abcdefghijklmnopqrstuvwxyza", 0, "7035004abcdefghijklmnopqrstuvwxyza" },
/*749*/ { "[7035]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*750*/ { "[7036]004abcdefghijklmnopqrstuvwxyza", 0, "7036004abcdefghijklmnopqrstuvwxyza" },
/*751*/ { "[7036]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*752*/ { "[7037]004abcdefghijklmnopqrstuvwxyza", 0, "7037004abcdefghijklmnopqrstuvwxyza" },
/*753*/ { "[7037]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*754*/ { "[7038]004abcdefghijklmnopqrstuvwxyza", 0, "7038004abcdefghijklmnopqrstuvwxyza" },
/*755*/ { "[7038]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*756*/ { "[7039]004abcdefghijklmnopqrstuvwxyza", 0, "7039004abcdefghijklmnopqrstuvwxyza" },
/*757*/ { "[7039]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" },
/*758*/ { "[7040]1abc", 0, "70401abc" },
/*759*/ { "[7040]1ab", ZINT_ERROR_INVALID_DATA, "" },
/*760*/ { "[7040]1abcd", ZINT_ERROR_INVALID_DATA, "" },
/*761*/ { "[7041]1234", ZINT_ERROR_INVALID_DATA, "" },
/*762*/ { "[7042]1234", ZINT_ERROR_INVALID_DATA, "" },
/*763*/ { "[7050]1234", ZINT_ERROR_INVALID_DATA, "" },
/*764*/ { "[7090]1234", ZINT_ERROR_INVALID_DATA, "" },
/*765*/ { "[7099]1234", ZINT_ERROR_INVALID_DATA, "" },
/*766*/ { "[71]1234", ZINT_ERROR_INVALID_DATA, "" },
/*767*/ { "[710]abcdefghijklmnopqrst", 0, "710abcdefghijklmnopqrst" },
/*768*/ { "[710]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*769*/ { "[7100]1234", ZINT_ERROR_INVALID_DATA, "" },
/*770*/ { "[711]abcdefghijklmnopqrst", 0, "711abcdefghijklmnopqrst" },
/*771*/ { "[711]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*772*/ { "[712]abcdefghijklmnopqrst", 0, "712abcdefghijklmnopqrst" },
/*773*/ { "[712]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*774*/ { "[713]abcdefghijklmnopqrst", 0, "713abcdefghijklmnopqrst" },
/*775*/ { "[713]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*776*/ { "[714]abcdefghijklmnopqrst", 0, "714abcdefghijklmnopqrst" },
/*777*/ { "[714]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*778*/ { "[715]abcdefghijklmnopqrst", 0, "715abcdefghijklmnopqrst" },
/*779*/ { "[715]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*780*/ { "[716]1234", ZINT_ERROR_INVALID_DATA, "" },
/*781*/ { "[719]1234", ZINT_ERROR_INVALID_DATA, "" },
/*782*/ { "[72]1234", ZINT_ERROR_INVALID_DATA, "" },
/*783*/ { "[720]1234", ZINT_ERROR_INVALID_DATA, "" },
/*784*/ { "[7200]1234", ZINT_ERROR_INVALID_DATA, "" },
/*785*/ { "[721]1234", ZINT_ERROR_INVALID_DATA, "" },
/*786*/ { "[7210]1234", ZINT_ERROR_INVALID_DATA, "" },
/*787*/ { "[7220]1234", ZINT_ERROR_INVALID_DATA, "" },
/*788*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzab", 0, "7230EMabcdefghijklmnopqrstuvwxyzab" },
/*789*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*790*/ { "[7230]EM", ZINT_ERROR_INVALID_DATA, "" },
/*791*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzab", 0, "7231EMabcdefghijklmnopqrstuvwxyzab" },
/*792*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*793*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzab", 0, "7232EMabcdefghijklmnopqrstuvwxyzab" },
/*794*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*795*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzab", 0, "7233EMabcdefghijklmnopqrstuvwxyzab" },
/*796*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*797*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzab", 0, "7234EMabcdefghijklmnopqrstuvwxyzab" },
/*798*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*799*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzab", 0, "7235EMabcdefghijklmnopqrstuvwxyzab" },
/*800*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*801*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzab", 0, "7236EMabcdefghijklmnopqrstuvwxyzab" },
/*802*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*803*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzab", 0, "7237EMabcdefghijklmnopqrstuvwxyzab" },
/*804*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*805*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzab", 0, "7238EMabcdefghijklmnopqrstuvwxyzab" },
/*806*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*807*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzab", 0, "7239EMabcdefghijklmnopqrstuvwxyzab" },
/*808*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" },
/*809*/ { "[7239]E", ZINT_ERROR_INVALID_DATA, "" },
/*810*/ { "[7240]abcdefghijklmnopqrst", 0, "7240abcdefghijklmnopqrst" },
/*811*/ { "[7240]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*812*/ { "[7241]1234", ZINT_ERROR_INVALID_DATA, "" },
/*813*/ { "[7249]1234", ZINT_ERROR_INVALID_DATA, "" },
/*814*/ { "[7250]1234", ZINT_ERROR_INVALID_DATA, "" },
/*815*/ { "[7299]1234", ZINT_ERROR_INVALID_DATA, "" },
/*816*/ { "[73]1234", ZINT_ERROR_INVALID_DATA, "" },
/*817*/ { "[7300]1234", ZINT_ERROR_INVALID_DATA, "" },
/*818*/ { "[74]1234", ZINT_ERROR_INVALID_DATA, "" },
/*819*/ { "[7400]1234", ZINT_ERROR_INVALID_DATA, "" },
/*820*/ { "[79]1234", ZINT_ERROR_INVALID_DATA, "" },
/*821*/ { "[7900]1234", ZINT_ERROR_INVALID_DATA, "" },
/*822*/ { "[7999]1234", ZINT_ERROR_INVALID_DATA, "" },
/*823*/ { "[80]1234", ZINT_ERROR_INVALID_DATA, "" },
/*824*/ { "[800]1234", ZINT_ERROR_INVALID_DATA, "" },
/*825*/ { "[8000]1234", ZINT_ERROR_INVALID_DATA, "" },
/*826*/ { "[8001]12345678901234", ZINT_WARN_NONCOMPLIANT, "800112345678901234" },
/*827*/ { "[8001]12345678901204", 0, "800112345678901204" },
/*828*/ { "[8001]1234123456789012345", ZINT_ERROR_INVALID_DATA, "" },
/*829*/ { "[8002]abcdefghijklmnopqrst", 0, "8002abcdefghijklmnopqrst" },
/*830*/ { "[8002]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" },
/*831*/ { "[8003]01234567890123abcdefghijklmnop", ZINT_WARN_NONCOMPLIANT, "800301234567890123abcdefghijklmnop" },
/*832*/ { "[8003]01234567890128abcdefghijklmnop", 0, "800301234567890128abcdefghijklmnop" },
/*833*/ { "[8003]01234567890128abcdefghijklmnopq", ZINT_ERROR_INVALID_DATA, "" },
/*834*/ { "[8004]abcdefghijklmnopqrstuvwxyz1234", ZINT_WARN_NONCOMPLIANT, "8004abcdefghijklmnopqrstuvwxyz1234" },
/*835*/ { "[8004]12cdefghijklmnopqrstuvwxyz1234", 0, "800412cdefghijklmnopqrstuvwxyz1234" },
/*836*/ { "[8004]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" },
/*837*/ { "[8005]123456", 0, "8005123456" },
/*838*/ { "[8005]12345", ZINT_ERROR_INVALID_DATA, "" },
/*839*/ { "[8005]1234567", ZINT_ERROR_INVALID_DATA, "" },
/*840*/ { "[8006]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8006123456789012341212" },
/*841*/ { "[8006]123456789012311212", 0, "8006123456789012311212" },
/*842*/ { "[8006]12345678901234121", ZINT_ERROR_INVALID_DATA, "" },
/*843*/ { "[8006]1234567890123412123", ZINT_ERROR_INVALID_DATA, "" },
/*844*/ { "[8007]abcdefghijklmnopqrstuvwxyz12345678", ZINT_WARN_NONCOMPLIANT, "8007abcdefghijklmnopqrstuvwxyz12345678" },
/*845*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678" },
/*846*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ123456789", ZINT_ERROR_INVALID_DATA, "" },
/*847*/ { "[8008]123456121212", ZINT_WARN_NONCOMPLIANT, "8008123456121212" },
/*848*/ { "[8008]121256121212", ZINT_WARN_NONCOMPLIANT, "8008121256121212" },
/*849*/ { "[8008]121231121212", 0, "8008121231121212" },
/*850*/ { "[8008]1234561212", ZINT_WARN_NONCOMPLIANT, "80081234561212" },
/*851*/ { "[8008]1212311212", 0, "80081212311212" },
/*852*/ { "[8008]12345612", ZINT_WARN_NONCOMPLIANT, "800812345612" },
/*853*/ { "[8008]12010112", 0, "800812010112" },
/*854*/ { "[8008]1234561", ZINT_ERROR_INVALID_DATA, "" },
/*855*/ { "[8008]123456121", ZINT_ERROR_INVALID_DATA, "" },
/*856*/ { "[8008]12345612121", ZINT_ERROR_INVALID_DATA, "" },
/*857*/ { "[8008]1234561212123", ZINT_ERROR_INVALID_DATA, "" },
/*858*/ { "[8009]12345678901234567890123456789012345678901234567890", 0, "800912345678901234567890123456789012345678901234567890" },
/*859*/ { "[8009]123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*860*/ { "[8010]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "" },
/*861*/ { "[8011]123456789012", 0, "8011123456789012" },
/*862*/ { "[8011]1234567890123", ZINT_ERROR_INVALID_DATA, "" },
/*863*/ { "[8012]abcdefghijklmnopqrst", 0, "8012abcdefghijklmnopqrst" },
/*864*/ { "[8012]abcdefghijklmnopqrstuv", ZINT_ERROR_INVALID_DATA, "" },
/*865*/ { "[8013]1234abcdefghijklmnopqrsQP", 0, "80131234abcdefghijklmnopqrsQP" },
/*866*/ { "[8013]1234abcdefghijklmnopqrsQPv", ZINT_ERROR_INVALID_DATA, "" },
/*867*/ { "[8014]1234", ZINT_ERROR_INVALID_DATA, "" },
/*868*/ { "[8016]1234", ZINT_ERROR_INVALID_DATA, "" },
/*869*/ { "[8017]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8017313131313131313139" },
/*870*/ { "[8017]313131313131313131", 0, "8017313131313131313131" },
/*871*/ { "[8017]31313131313131313", ZINT_ERROR_INVALID_DATA, "" },
/*872*/ { "[8017]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" },
/*873*/ { "[8018]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8018313131313131313139" },
/*874*/ { "[8018]313131313131313131", 0, "8018313131313131313131" },
/*875*/ { "[8018]31313131313131313", ZINT_ERROR_INVALID_DATA, "" },
/*876*/ { "[8018]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" },
/*877*/ { "[8019]1234567890", 0, "80191234567890" },
/*878*/ { "[8019]12345678901", ZINT_ERROR_INVALID_DATA, "" },
/*879*/ { "[8020]abcdefghijklmnopqrstuvwxy", 0, "8020abcdefghijklmnopqrstuvwxy" },
/*880*/ { "[8020]abcdefghijklmnopqrstuvwxyz", ZINT_ERROR_INVALID_DATA, "" },
/*881*/ { "[8021]1234", ZINT_ERROR_INVALID_DATA, "" },
/*882*/ { "[8025]1234", ZINT_ERROR_INVALID_DATA, "" },
/*883*/ { "[8026]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8026123456789012341212" },
/*884*/ { "[8026]123456789012311212", 0, "8026123456789012311212" },
/*885*/ { "[8026]1234567890123451212", ZINT_ERROR_INVALID_DATA, "" },
/*886*/ { "[8026]12345678901234512", ZINT_ERROR_INVALID_DATA, "" },
/*887*/ { "[8027]1234", ZINT_ERROR_INVALID_DATA, "" },
/*888*/ { "[8030]1234", ZINT_ERROR_INVALID_DATA, "" },
/*889*/ { "[8040]1234", ZINT_ERROR_INVALID_DATA, "" },
/*890*/ { "[8050]1234", ZINT_ERROR_INVALID_DATA, "" },
/*891*/ { "[8060]1234", ZINT_ERROR_INVALID_DATA, "" },
/*892*/ { "[8070]1234", ZINT_ERROR_INVALID_DATA, "" },
/*893*/ { "[8080]1234", ZINT_ERROR_INVALID_DATA, "" },
/*894*/ { "[8090]1234", ZINT_ERROR_INVALID_DATA, "" },
/*895*/ { "[8099]1234", ZINT_ERROR_INVALID_DATA, "" },
/*896*/ { "[81]1234", ZINT_ERROR_INVALID_DATA, "" },
/*897*/ { "[8100]1234", ZINT_ERROR_INVALID_DATA, "" },
/*898*/ { "[8109]1234", ZINT_ERROR_INVALID_DATA, "" },
/*899*/ { "[8110]5123456789011234565123455123450123105123450123512345678901320123190000", 0, "81105123456789011234565123455123450123105123450123512345678901320123190000" },
/*900*/ { "[8110]51234567890112345651234551234501231051234501235123456789013201231900001", ZINT_ERROR_INVALID_DATA, "" },
/*901*/ { "[8111]1234", 0, "81111234" },
/*902*/ { "[8111]12345", ZINT_ERROR_INVALID_DATA, "" },
/*903*/ { "[8111]123", ZINT_ERROR_INVALID_DATA, "" },
/*904*/ { "[8112]1234567890123456789012345678901234567890123456789012345678901234567890", ZINT_WARN_NONCOMPLIANT, "81121234567890123456789012345678901234567890123456789012345678901234567890" },
/*905*/ { "[8112]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*906*/ { "[8112]061234567890121234569123456789012345", 0, "8112061234567890121234569123456789012345" },
/*907*/ { "[8113]1234", ZINT_ERROR_INVALID_DATA, "" },
/*908*/ { "[8120]1234", ZINT_ERROR_INVALID_DATA, "" },
/*909*/ { "[8130]1234", ZINT_ERROR_INVALID_DATA, "" },
/*910*/ { "[8140]1234", ZINT_ERROR_INVALID_DATA, "" },
/*911*/ { "[8150]1234", ZINT_ERROR_INVALID_DATA, "" },
/*912*/ { "[8190]1234", ZINT_ERROR_INVALID_DATA, "" },
/*913*/ { "[8199]1234", ZINT_ERROR_INVALID_DATA, "" },
/*914*/ { "[82]1234", ZINT_ERROR_INVALID_DATA, "" },
/*915*/ { "[8200]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "82001234567890123456789012345678901234567890123456789012345678901234567890" },
/*916*/ { "[8201]1234", ZINT_ERROR_INVALID_DATA, "" },
/*917*/ { "[8210]1234", ZINT_ERROR_INVALID_DATA, "" },
/*918*/ { "[8220]1234", ZINT_ERROR_INVALID_DATA, "" },
/*919*/ { "[8230]1234", ZINT_ERROR_INVALID_DATA, "" },
/*920*/ { "[8240]1234", ZINT_ERROR_INVALID_DATA, "" },
/*921*/ { "[8250]1234", ZINT_ERROR_INVALID_DATA, "" },
/*922*/ { "[8290]1234", ZINT_ERROR_INVALID_DATA, "" },
/*923*/ { "[8299]1234", ZINT_ERROR_INVALID_DATA, "" },
/*924*/ { "[83]1234", ZINT_ERROR_INVALID_DATA, "" },
/*925*/ { "[830]1234", ZINT_ERROR_INVALID_DATA, "" },
/*926*/ { "[8300]1234", ZINT_ERROR_INVALID_DATA, "" },
/*927*/ { "[84]1234", ZINT_ERROR_INVALID_DATA, "" },
/*928*/ { "[840]1234", ZINT_ERROR_INVALID_DATA, "" },
/*929*/ { "[8400]1234", ZINT_ERROR_INVALID_DATA, "" },
/*930*/ { "[85]1234", ZINT_ERROR_INVALID_DATA, "" },
/*931*/ { "[850]1234", ZINT_ERROR_INVALID_DATA, "" },
/*932*/ { "[8500]1234", ZINT_ERROR_INVALID_DATA, "" },
/*933*/ { "[89]1234", ZINT_ERROR_INVALID_DATA, "" },
/*934*/ { "[890]1234", ZINT_ERROR_INVALID_DATA, "" },
/*935*/ { "[8900]1234", ZINT_ERROR_INVALID_DATA, "" },
/*936*/ { "[90]abcdefghijklmnopqrstuvwxyz1234", 0, "90abcdefghijklmnopqrstuvwxyz1234" },
/*937*/ { "[90]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" },
/*938*/ { "[900]1234", ZINT_ERROR_INVALID_DATA, "" },
/*939*/ { "[9000]1234", ZINT_ERROR_INVALID_DATA, "" },
/*940*/ { "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "91123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*941*/ { "[91]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*942*/ { "[910]1234", ZINT_ERROR_INVALID_DATA, "" },
/*943*/ { "[9100]1234", ZINT_ERROR_INVALID_DATA, "" },
/*944*/ { "[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*945*/ { "[92]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*946*/ { "[920]1234", ZINT_ERROR_INVALID_DATA, "" },
/*947*/ { "[9200]1234", ZINT_ERROR_INVALID_DATA, "" },
/*948*/ { "[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "93123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*949*/ { "[93]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*950*/ { "[930]1234", ZINT_ERROR_INVALID_DATA, "" },
/*951*/ { "[9300]1234", ZINT_ERROR_INVALID_DATA, "" },
/*952*/ { "[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "94123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*953*/ { "[94]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*954*/ { "[940]1234", ZINT_ERROR_INVALID_DATA, "" },
/*955*/ { "[9400]1234", ZINT_ERROR_INVALID_DATA, "" },
/*956*/ { "[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "95123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*957*/ { "[95]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*958*/ { "[950]1234", ZINT_ERROR_INVALID_DATA, "" },
/*959*/ { "[9500]1234", ZINT_ERROR_INVALID_DATA, "" },
/*960*/ { "[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "96123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*961*/ { "[96]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*962*/ { "[960]1234", ZINT_ERROR_INVALID_DATA, "" },
/*963*/ { "[9600]1234", ZINT_ERROR_INVALID_DATA, "" },
/*964*/ { "[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "97123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*965*/ { "[97]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*966*/ { "[970]1234", ZINT_ERROR_INVALID_DATA, "" },
/*967*/ { "[9700]1234", ZINT_ERROR_INVALID_DATA, "" },
/*968*/ { "[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "98123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*969*/ { "[98]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*970*/ { "[980]1234", ZINT_ERROR_INVALID_DATA, "" },
/*971*/ { "[9800]1234", ZINT_ERROR_INVALID_DATA, "" },
/*972*/ { "[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "99123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
/*973*/ { "[99]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" },
/*974*/ { "[990]1234", ZINT_ERROR_INVALID_DATA, "" },
/*975*/ { "[9900]1234", ZINT_ERROR_INVALID_DATA, "" },
/*976*/ { "[9999]1234", ZINT_ERROR_INVALID_DATA, "" },
/*977*/ { "[01]12345678901234[7006]200101", ZINT_WARN_NONCOMPLIANT, "01123456789012347006200101" },
/*978*/ { "[01]12345678901231[7006]200101", 0, "01123456789012317006200101" },
/*979*/ { "[3900]1234567890[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "39001234567890[0112345678901234" },
/*980*/ { "[3900]1234567890[01]12345678901231", 0, "39001234567890[0112345678901231" },
/*981*/ { "[253]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[390112345678901234[2012" },
/*982*/ { "[253]12345678901284[3901]12345678901234[20]12", 0, "25312345678901284[390112345678901234[2012" },
/*983*/ { "[253]12345678901234[01]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[0112345678901234390112345678901234[2012" },
/*984*/ { "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", 0, "25312345678901284[0112345678901231390112345678901234[2012" },
/*985*/ { "[01]12345678901231[0A]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "" },
/*986*/ { "[01]12345678901231[0]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "" },
/*987*/ { "[01]12345678901231[]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "" },
};
int data_size = ARRAY_SIZE(data);
int i, length, ret;

View File

@ -10,14 +10,13 @@
*
* php backend/tools/gen_gs1_lint.php > backend/gs1_lint.h
*
* or to use local copy of "gs1-format_spec.txt":
* or to use local copy of "gs1-syntax-dictionary.txt":
*
* php backend/tools/gen_gs1_lint.php -f <local-path>/gs1-format-spec.txt backend/gs1_lint.h
* php backend/tools/gen_gs1_lint.php -f <local-path>/gs1-syntax-dictionary.txt backend/gs1_lint.h
*
*************************************************************************************************
* NOTE: for up-to-update version requires syntax dictionary that will be available from
* https://github.com/gs1/gs1-syntax-dictionary
* on its release. For now this generator should only be run by someone with a pre-release copy!!!
* NOTE: up-to-update version requires syntax dictionary available from
* https://ref.gs1.org/tools/gs1-barcode-syntax-resource/syntax-dictionary/
*************************************************************************************************
*/
@ -28,11 +27,7 @@ $dirdirname = basename(dirname($dirname)) . '/' . basename($dirname);
$opts = getopt('c:f:h:l:t:');
$print_copyright = isset($opts['c']) ? (bool) $opts['c'] : true;
if (!isset($opts['f'])) { // TODO: temporary hack
exit("$basename:" . __LINE__
. " ERROR: For now this generator must only be run locally with a pre-release syntax dictionary" . PHP_EOL);
}
$file = $opts['f'];
$file = isset($opts['f']) ? $opts['f'] : 'https://ref.gs1.org/tools/gs1-barcode-syntax-resource/syntax-dictionary/';
$print_h_guard = isset($opts['h']) ? (bool) $opts['h'] : true;
$use_length_only = isset($opts['l']) ? (bool) $opts['l'] : true;
$tab = isset($opts['t']) ? $opts['t'] : ' ';
@ -40,9 +35,13 @@ $tab = isset($opts['t']) ? $opts['t'] : ' ';
if (($get = file_get_contents($file)) === false) {
exit("$basename:" . __LINE__ . " ERROR: Could not read file \"$file\"" . PHP_EOL);
}
// Strip to last 2 directories TODO: temporary hack
$stripped_dir = dirname($file);
$stripped_file = basename(dirname($stripped_dir)) . '/' . basename($stripped_dir) . '/' . basename($file);
if (strncasecmp($file, "http", 4) != 0) {
// Strip to last 2 directories
$stripped_dir = dirname($file);
$stripped_file = basename(dirname($stripped_dir)) . '/' . basename($stripped_dir) . '/' . basename($file);
} else {
$stripped_file = $file;
}
$lines = explode("\n", $get);