|
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.
|
Macros | |
| #define | GS1_LINTER_LIKELY(x) (x) |
| Implementation may provide hint to the compiler that the expression is likely to be true. | |
| #define | GS1_LINTER_UNLIKELY(x) (x) |
| Implementation may provide hint to the compiler that the expression is likely to be false. | |
| #define | GS1_LINTER_RETURN_OK |
| Return from a linter indicating that no problem was detected with the given data. | |
| #define | GS1_LINTER_RETURN_ERROR(error, position, length) |
| Return from a linter indicating that a problem was detected with the given data. | |
| #define | GS1_LINTER_BITFIELD_LOOKUP(bit, field, valid) |
| Perform a lookup of a position in a bit field. | |
| #define | GS1_LINTER_BINARY_SEARCH(needle, needle_len, haystack, valid) |
| Perform a binary search for a search term in a sorted set of strings. | |
This header provides utility macros used by the reference linter functions.
| #define GS1_LINTER_BINARY_SEARCH | ( | needle, | |
| needle_len, | |||
| haystack, | |||
| valid | |||
| ) |
Perform a binary search for a search term in a sorted set of strings.
| [in] | needle | A search term string to be exactly matched. |
| [in] | needle_len | Length of the needle string. |
| [in] | haystack | A array of strings to be searched. The array must be sorted, otherwise the matching behaviour is undefined. |
| [out] | valid | Set to 1 if needle is found in haystack, otherwise set to 0. |
| #define GS1_LINTER_BITFIELD_LOOKUP | ( | bit, | |
| field, | |||
| valid | |||
| ) |
Perform a lookup of a position in a bit field.
| [in] | bit | The bit position in the field to lookup. The position must be in the field otherwise the behaviour is undefined. |
| [in] | field | An array whose elements (of type with arbitrary size) when concatenated produce a single bit field whose positions are numbered from left to right (MSB of first element to LSB of last element). |
| [out] | valid | Set to 1 if the position numbered bit is set in the field, otherwise set to 0. |
| #define GS1_LINTER_RETURN_ERROR | ( | error, | |
| position, | |||
| length | |||
| ) |
Return from a linter indicating that a problem was detected with the given data.
| [in] | error | An error of type gs1_lint_err_t to return. |
| [in] | position | The starting position of the invalid data. |
| [in] | length | The length of the invalid data segment. |
| #define GS1_LINTER_RETURN_OK |
Return from a linter indicating that no problem was detected with the given data.