A simple, efficient, and dependency-free JSON parser and printer library in C with an interruptible SAX-style API.
libjson is a lightweight JSON parser and printer library written in C. It provides an interruptible, SAX-style API that parses JSON incrementally without building an in-memory object tree, giving developers full control over data handling and memory usage. It is designed for embedding in applications where minimal dependencies and high efficiency are critical.
C developers working on embedded systems, performance-sensitive applications, or projects requiring a simple, dependency-free JSON handling solution without the overhead of a full object model.
Developers choose libjson for its minimal footprint, interruptible parsing that works with any data stream, and flexibility in number conversion and memory management, making it uniquely suited for constrained environments.
a JSON parser and printer library in C. easy to integrate with any model.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows incremental data feeding from any source like network streams, providing full control over input flow without buffering entire documents, as highlighted in the interruptible parser feature.
Uses a SAX-style callback API that avoids allocating a full object tree, making it ideal for memory-constrained embedded systems, with optional user-defined allocation for further control.
Passes numbers as strings in callbacks, letting users decide conversion to native types or custom formats, preventing overflow issues and supporting arbitrary precision.
Optional user-defined memory allocation functions enable integration with custom memory managers, enhancing portability to specialized environments like real-time systems.
Requires users to implement their own data structures for storing and accessing JSON elements, increasing development time for applications needing document navigation or manipulation.
The provided build system is minimal and primarily for testing; integrating on non-Linux platforms may require manual adaptation or direct source inclusion, as noted in the README.
SAX-style parsing necessitates careful state management in callbacks, which can be error-prone and less intuitive than tree-based APIs for handling nested or dynamic JSON structures.