GS1 Barcode Syntax Tests reference
A reference to the AI component "linter" routines referred to by the GS1 Barcode Syntax Dictionary. Copyright (c) 2022-2024 GS1 AISBL.
|
The GS1 Barcode Syntax Dictionary contains entries describing the composition of each Application Identifier (AI) in the GS1 system in terms of its concatenated components.
Each component may be associated with one or more GS1 Barcode Syntax Tests ("linters") whose task is to analyse the component and detect common errors using the information that is available to them.
This documentation describes the actions of the set of reference linters that are provided by GS1 for use with the GS1 Barcode Syntax Dictionary, which are available here:
https://ref.gs1.org/tools/gs1-barcode-syntax-resource/syntax-tests/implementation/
For each target platform it is intended that the linters may be cross-compiled, wrapped with language-specific code that calls the native functions, transliterated, or otherwise made available.
For each linter, its general action is described and a detailed reference is provided in the form of annotated C language source.
If the functions are being transliterated then the resulting code should be cross checked by additionally porting the extensive unit tests provided in the reference linter source files.
gs1syntaxdictionary-utils.h | This header provides utility macros used by the reference linter functions |
gs1syntaxdictionary.h | This header contains the declarations for the reference linter functions of type gs1_linter_t referred to in the GS1 Barcode Syntax Dictionary, as well as the list of all possible return codes with a description of the indicated error conditions |
couponcode | The couponcode linter ensures that the data conforms to the original North American Coupon Code (NACC) specification, as carried in AI (8110) |
couponposoffer | The couponposoffer linter ensures that the data conforms to the modernised North American positive offer file coupon code standard, as carried in AI (8112) |
cset39 | The cset39 linter ensures that the given data contains only characters within GS1 AI encodable character set 39 ("CSET 39") |
cset64 | The cset64 linter ensures that the given data contains only characters within the GS1 AI encodable character set 64 ("CSET 64") |
cset82 | The cset82 linter ensures that the given data contains only characters within the GS1 AI encodable character set 82 ("CSET 82") |
csetnumeric | The csetnumeric linter ensures that the given data contains only digits |
csum | The csum linter ensures that the data has a valid numeric check digit |
csumalpha | The csumalpha linter ensures that the data has a valid alphanumeric check character pair |
hasnondigit | The hasnondigit linter ensures that the given data contains a non-digit character |
hh | The hh linter ensures that the given data is a meaningful hour number in a day |
hhmi | The hhmi linter ensures that the given data is meaningful time as hours and minutes, in HHMI format |
hyphen | The hyphen linter ensures that the given data contains only hyphens |
iban | The iban linter ensures that the data conforms to the format required for an International Bank Account Number (IBAN) number |
importeridx | The importeridx linter ensures that the given data is a valid Importer Index, as included in a Facility ID or Machine ID used in the EU 2018/574 system |
iso3166 | The iso3166 linter ensures that the data represents a valid ISO 3166 "num-3" country code |
iso3166999 | The iso3166999 linter ensures that the data represents an ISO 3166 "num-3" country code, or the value "999" |
iso3166alpha2 | The iso3166alpha2 linter ensures that the data represents an ISO 3166 "alpha-2" country code |
iso4217 | The iso4217 linter ensures that the data is in the list of ISO 4217 three-digit currency codes |
iso5218 | The iso5218 linter ensures that the given data represents a ISO/IEC 5218 biological sex code, either "0" (not known), "1" (male), "2" (female) or "9" (not applicable) |
key | The key linter checks whether an input starts with a GS1 Company Prefix ("GCP") |
latitude | The latitude linter ensures that the given data represents the latitude component of a WGS84 coordinate expressed as a 10-digit number |
longitude | The longitude linter ensures that the given data represents the longitude component of a WGS84 coordinate expressed as a 10-digit number |
mediatype | The mediatype linter ensures that the data represents a valid AIDC media type |
mi | The mi linter ensures that the given data is a meaningful minute number in an hour |
nonzero | The nonzero linter ensures that the given data has a non-zero value |
nozeroprefix | The nozeroprefix linter ensures that the given data does not start with a zero |
packagetype | The packagetype linter ensures that the data represents a valid UN/ECE Recommendation 21 alphanumeric code, extended with additional GS1 code values |
pcenc | The pcenc linter ensures that the data has correct percent-encoding |
pieceoftotal | The pieceoftotal linter ensures that the data represents a meaningful piece of total, i.e. a concatenation of non-zero piece number follow by an equal-width, non-zero total number of pieces |
posinseqslash | The posinseqslash linter ensures that the data represents a meaningful position in a sequence in the format "`<pos>/<end>`" |
ss | The ss linter ensures that the given data is a meaningful second number in a minute |
winding | The winding linter ensures that the given data represents a meaningful Winding Direction on a roll, either "0" (face out), "1" (face in) or "9" (undefined) |
yesno | The yesno linter ensures that the given data represents a meaningful boolean state, either "0" (no) or "1" (yes) |
yymmd0 | The yymmd0 linter ensures that the data represents a meaningful date, in YYMMDD format, additionally permitting YYMM00 format indicating an unspecified day |
yymmdd | The yymmdd linter ensures that the data represents a meaningful date, in YYMMDD format |
yyyymmd0 | The yyyymmd0 linter ensures that the data represents a meaningful date, in YYYYMMDD format, additionally permitting YYYYMM00 format indicating an unspecified day |
yyyymmdd | The yyyymmdd linter ensures that the data represents a meaningful date, in YYYYMMDD format |
zero | The zero linter ensures that the given data has a zero value |