Used to ensure that an AI component conforms to the modernised North American positive offer file coupon code standard, as carried in AI (8112).
85 if ((pos = strspn(data,
"0123456789")) != strlen(data)) {
86 if (err_pos) *err_pos = pos;
87 if (err_len) *err_len = 1;
92 q = data + strlen(data);
102 if (err_pos) *err_pos = 0;
103 if (err_len) *err_len = (size_t)(q - data);
107 if (*p !=
'0' && *p !=
'1') {
108 if (err_pos) *err_pos = (size_t)(p - data);
109 if (err_len) *err_len = 1;
122 if (err_pos) *err_pos = 0;
123 if (err_len) *err_len = (size_t)(q - data);
127 if (err_pos) *err_pos = (size_t)(p - data);
128 if (err_len) *err_len = 1;
136 if (err_pos) *err_pos = (p == q) ? 0 : (
size_t)(p - data);
137 if (err_len) *err_len = (p == q) ? (
size_t)(q - data) : (
size_t)(q - p);
149 if (err_pos) *err_pos = (p == q) ? 0 : (
size_t)(p - data);
150 if (err_len) *err_len = (p == q) ? (
size_t)(q - data) : (
size_t)(q - p);
163 if (err_pos) *err_pos = 0;
164 if (err_len) *err_len = (size_t)(q - data);
172 if (err_pos) *err_pos = (p == q) ? 0 : (
size_t)(p - data);
173 if (err_len) *err_len = (p == q) ? (
size_t)(q - data) : (
size_t)(q - p);
185 if (err_pos) *err_pos = (size_t)(p - data);
186 if (err_len) *err_len = (size_t)(q - p);
@ GS1_LINTER_COUPON_MISSING_FORMAT_CODE
The coupon's Format Code is missing.
Definition: gs1syntaxdictionary.h:111
@ GS1_LINTER_COUPON_INVALID_FORMAT_CODE
The coupon's Format Code must be "0" or "1".
Definition: gs1syntaxdictionary.h:112
@ GS1_LINTER_COUPON_MISSING_SERIAL_NUMBER_VLI
The coupon's Serial Number VLI is missing.
Definition: gs1syntaxdictionary.h:117
@ GS1_LINTER_COUPON_TRUNCATED_SERIAL_NUMBER
The coupon's Serial Number is shorter than what is indicated by its VLI.
Definition: gs1syntaxdictionary.h:118
@ GS1_LINTER_COUPON_MISSING_FUNDER_VLI
The coupon's Funder VLI is missing.
Definition: gs1syntaxdictionary.h:113
@ GS1_LINTER_COUPON_TRUNCATED_OFFER_CODE
The coupon's Offer Code is shorter than the required six digits.
Definition: gs1syntaxdictionary.h:116
@ GS1_LINTER_COUPON_EXCESS_DATA
The coupon contains excess data after the recognised optional fields.
Definition: gs1syntaxdictionary.h:166
@ GS1_LINTER_COUPON_INVALID_FUNDER_LENGTH
The coupon's Funder VLI must be "0" to "6".
Definition: gs1syntaxdictionary.h:114
@ GS1_LINTER_OK
No issues were detected by the linter.
Definition: gs1syntaxdictionary.h:66
@ GS1_LINTER_NON_DIGIT_CHARACTER
A non-digit character was found where a digit is expected.
Definition: gs1syntaxdictionary.h:67
@ GS1_LINTER_COUPON_TRUNCATED_FUNDER
The coupon's Funder is shorter than what is indicated by its VLI.
Definition: gs1syntaxdictionary.h:115