Used to ensure that an AI component conforms to HHMI format.
55{
56
57 size_t len;
59 char buf[3] = { 0 };
60
61 assert(data);
62
63 len = strlen(data);
64
65
66
67
68
69 if (len != 4)
72 0,
73 len
74 );
75
76 memcpy(buf, data, 2);
78
82
85
86 memcpy(buf, data+2, 2);
88
92
95
97
98}
#define GS1_LINTER_RETURN_ERROR(error, position, length)
Return from a linter indicating that a problem was detected with the given data.
Definition gs1syntaxdictionary-utils.h:77
#define GS1_LINTER_RETURN_OK
Return from a linter indicating that no problem was detected with the given data.
Definition gs1syntaxdictionary-utils.h:62
GS1_SYNTAX_DICTIONARY_API gs1_lint_err_t gs1_lint_mi(const char *data, size_t *err_pos, size_t *err_len)
Definition lint_mi.c:54
GS1_SYNTAX_DICTIONARY_API gs1_lint_err_t gs1_lint_hh(const char *data, size_t *err_pos, size_t *err_len)
Definition lint_hh.c:54
gs1_lint_err_t
Linter return codes other than GS1_LINTER_OK indicate an error condition.
Definition gs1syntaxdictionary.h:76
@ GS1_LINTER_HOUR_WITH_MINUTE_TOO_LONG
The hour with minute is too long for HHMI format.
Definition gs1syntaxdictionary.h:111
@ GS1_LINTER_ILLEGAL_MINUTE
The time contains an illegal minute.
Definition gs1syntaxdictionary.h:116
@ GS1_LINTER_ILLEGAL_HOUR
The time contains an illegal hour.
Definition gs1syntaxdictionary.h:115
@ GS1_LINTER_HOUR_WITH_MINUTE_TOO_SHORT
The hour with minute is too short for HHMI format.
Definition gs1syntaxdictionary.h:110
@ GS1_LINTER_OK
No issues were detected by the linter.
Definition gs1syntaxdictionary.h:77
@ GS1_LINTER_NON_DIGIT_CHARACTER
A non-digit character was found where a digit is expected.
Definition gs1syntaxdictionary.h:78