1

Possible Duplicate:
Code generators and libraries for parsing JSON in C

I'd like to read JSON-encoded data into pre-defined C structs. The data meet a well-known object structure.

As performance is crucial here, I really don't like to use libraries which generate a linked object tree.

Which library is suited for this purpose? Are there alternative approaches, like code generators?

Community
  • 1
  • 1
wnrph
  • 3,293
  • 4
  • 26
  • 38
  • Hmm. They closed this one, nobody else voted to reopen the other one, and also they removed my comment recommending reopening. Sorry about all this :v( . Edit: Oh, it looks like a mod closed it just now after a reopen? I'm confused. – Potatoswatter May 22 '12 at 15:17

1 Answers1

1

For performance, I'd go with libjson. It's fast as hell and it doesn't generate it's own data structure. It's a lot like a SAX parser for XML in that it delivers events like START_OBJECT, END_OBJECT, etc. to a callback function, so you can bind it to whatever data structure you want.

jjm
  • 6,028
  • 2
  • 24
  • 27