LibJSON
libjson is a small C library and small codebase that packs an efficient
parser and a configurable printer. libjson is covered by the LGPLv2 license, or
at your option the LGPLv3 license.
Here's the feature of libjson:
- Interruptible parser: get the JSON data to the parser any way you want; by appending char by char, or string chunks, the input reading is completely left to the caller.
- No object model integrated: easy integration with any model by the means of a simple callback.
- Small codebase: handcoded parser and efficient factorisation make the code smalls.
- Fast: use efficient code, and small parsing tables to not do any extra work and remains as fast and efficient as possible.
- Full JSON support: tested through a small and precise testsuite.
- No native conversion: callback only string of data and leave the actual representation of data to the caller
- Supports putting limits on nesting level. security against DoS over very deep data.
- Supports putting limits on data (string/int/float) size. security against DoS over very large data object.
- Optionally support YAML/python comments and C comments.
- Supports projects-specific allocation functions to integrate completely with projects
- jsonlint utility provided with the library to verify, or reformat json stream. also useful as example on how to use the library.
you can consult the documentation here: HTML
it's here or to the repository on github
You can also clone me using git:
git clone git://github.com/vincenthz/libjson/
- 0.8: fix an uninitialized variable that was in rare condition wrongly returning an error.
- 0.7: add source documentation (wiki format)
- 0.6: add a generic DOM-like helper built on top of the SAJ parser. the tree structure is still left to the caller's side
- 0.5: fix backslash escape when printing string
- 0.4: install fixes, comments typos
- 0.3: some fixes in the install rules, add a pc file for pkgconfig
- 0.2: add print_args that takes variable number of parameters and pass then to the print function
- 0.1: Initial release