Closed littlesonlp closed 3 years ago
If you are dealing with JSON that varies in size greatly, you can reallocate the tokens array based on feedback from the parser. If parser returns JSMN_ERROR_NOMEM
you can extend the tokens array and retry parsing. The parser will continue from where it left off.
Passing NULL instead of tokens will return the number of tokens needed.
For example, my json file could be very small, it also could be very big. How should I define the jsmn_token array? is there any version that use something like linked list instead of a fix size of array?