Skip to content
codehero edited this page Sep 23, 2010 · 1 revision

When you call bnj_parse, you supply:

  • an input buffer and its size
  • an output buffer of length OB to store parsed values
  • ctx (parsing context with an optional set of keys to match against)

benejson will call you back under the following circumstances:

  • Parsing error
  • Parsing has reached end of buffer and you will get values + value fragment in your output buffer
  • Parsed enough values to fill the output buffer
  • Parsed the remaining values in the current scope (ie, tail of end of a list or map) but not enough to fill output buffer
  • Change in document depth (up or down). Note that consecutive '[' or ']' are combined. The depth_change field reflects this.
  • Reached end of document
Clone this wiki locally