GS1 Syntax Dictionary: Linter reference
A reference to the AI component linter routines referred to by the GS1 Syntax Dictionary.
Main Page

The GS1 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 "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 Syntax Dictionary, which are available here:

https://github.com/gs1/gs1-syntax-dictionary

Remarks

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.

Linter reference

 gs1syntaxdictionary.hThis header contains the declarations for the reference linter functions of type gs1_linter_t referred to in the GS1 Syntax Dictionary, as well as the list of all possible return codes with a description of the indicated error conditions
 couponcodeThe couponcode linter ensures that the data conforms to the original North American Coupon Code (NACC) specification, as carried in AI (8110)
 couponposofferThe couponposoffer linter ensures that the data conforms to the modernised North American positive offer file coupon code standard, as carried in AI (8112)
 cset39The cset39 linter ensures that the given data contains only characters within GS1 AI encodable character set 39 ("CSET 39")
 cset82The cset82 linter ensures that the given data contains only characters within the GS1 AI encodable character set 82 ("CSET 82")
 csetnumericThe csetnumeric linter ensures that the given data contains only digits
 csumThe csum linter ensures that the data has a valid numeric check digit
 csumalphaThe csumalpha linter ensures that the data has a valid alphanumeric check character pair
 hhmmThe hhmm linter ensures that the given data is meaningful time as hours and minutes, in HHMM format
 ibanThe iban linter ensures that the data conforms to the format required for an International Bank Account Number (IBAN) number
 importeridxThe 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
 iso3166The iso3166 linter ensures that the data represents a valid ISO 3166 "num-3" country code
 iso3166999The iso3166999 linter ensures that the data represents an ISO 3166 "num-3" country code, or the value "999"
 iso3166alpha2The iso3166alpha2 linter ensures that the data represents an ISO 3166 "alpha-2" country code
 iso3166listThe iso3166list linter ensures that the data is a concatenated sequence of ISO 3166 "num-3" country codes
 iso4217The iso4217 linter ensures that the data is in the list of ISO 4217 three-digit currency codes
 keyThe key linter checks whether an input starts with a GS1 Company Prefix ("GCP")
 latlongThe latlong linter ensures that the given data represents a WGS84 coordinate expressed as the concatenation of two 10-digit numbers
 mmoptssThe mmoptss linter ensures that the data represents a meaningful time fragment as minutes and optional seconds, in MMSS or MM format
 nonzeroThe nonzero linter ensures that the given data has a non-zero value
 nozeroprefixThe nozeroprefix linter ensures that the given data does not start with a zero
 pcencThe pcenc linter ensures that the data has correct percent-encoding
 pieceoftotalThe 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
 windingThe 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)
 yesnoThe yesno linter ensures that the given data represents a meaningful boolean state, either "0" (no) or "1" (yes)
 yymmd0The yymmd0 linter ensures that the data represents a meaningful date, in YYMMDD format, additionally permitting YYMM00 format indicating an unspecified day
 yymmddThe yymmdd linter ensures that the data represents a meaningful date, in YYMMDD format
 yymmddhhThe yymmddhh linter ensures that the data represents a meaningful date and hour of day, in YYMMDDHH format
 zeroThe zero linter ensures that the given data has a zero value