Returns the length of the first warning string associated with the specified grammar (if any). This can be used to determine the size of a string buffer needed to hold the warning string prior to calling LV_SRE_ReturnGrammarFirstWarningString
Function
- int LV_SRE_ReturnGrammarFirstWarningStringLength(HPORT hport, const char* GrammarLabel)
Parameters
hport
The port's handle.
GrammarLabel
The label of the grammar whose first warning string needs to be returned.
Return Values
Non-Negative number
The actual length of the first warning string for the specified grammar (if any). This value can be used to determine the buffer size needed to hold the string prior to calling LV_SRE_ReturnGrammarFirstWarningString.
LV_INVALID_HPORT
The input hport is not a valid one.
LV_FAILURE
The operation failed because the port was shutting down.
LV_EXCEPTION
An exception occurred while processing the request.
Remarks
Values returned by LV_SRE_ReturnGrammarFirstWarningStringLength 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.