On 10/15/2009 08:34 PM, Anthony Liguori wrote: > Luiz Capitulino wrote: >> Not the right context but I was going to post about this soon, so >> I think this is a good opportunity to talk about it. >> >> I didn't look at all available parsers from json.org, but this one: >> >> http://fara.cs.uni-potsdam.de/~jsg/json_parser/ >> >> Seems interesting. >> >> Anthony, are you ok in using external implementations like that >> if they meet our requirements? > > Otherwise, pulling the code into the tree isn't so bad provided that > it's not huge. It's 36k, and pulling it in gives the opportunity to customize it. For example, the attached patch allows to parse a "%BLAH" extension to JSON that is passed to the callback (since the parsing is done character-by-character, the callback can consume whatever it wants after the % sign). Asprintf+parse JSON unfortunately isn't enough because you'd need to escape all strings. Paolo