Returns the first warning string associated with the specified grammar (if any) in the specified string, up to a maximum length specified.
- int LV_SRE_ReturnGrammarFirstWarningString(HPORT hport, const char* GrammarLabel, char * OutputString, int MaxOutputStringLength)
The port's handle.
The label of the grammar whose first warning string needs to be returned.
The string buffer that will be populated with the warning string associated with the specified grammar (if any). Users should ensure this buffer is large enough to contain the first warning string being requested (see LV_SRE_ReturnGrammarFirstWarningStringLength to determine the size of this buffer)
The maximum length of a string that can be stored in the specified OutputString buffer, which will contain the result. Users should ensure that OutputString is of at least this size. If the first warning string exceeds this length, it will be truncated at this specified length.
No errors; the first warning string for the specified grammar (if any) was returned. If there is no first warning string for the specified grammar, an empty string is returned in OutputString.
The input hport is not a valid one.
The operation failed because the port was shutting down.
An exception occurred while processing the request.
Values returned by LV_SRE_ReturnGrammarFirstWarningString are particularly useful when debugging grammar load warnings.
Typically, when loading a grammar, some not-fatal warnings may not be severe enough to cause a grammar load to fail, so these warnings may often be overlooked. This function, and the corresponding functions listed below can uncover previously unknown issues within grammars.