A lightweight JSON parser and generator for C/C++ with a scanf/printf-like interface, designed for embedded systems.
Frozen is a JSON parser and generator library for C and C++ that provides a scanf/printf-like interface for reading and writing JSON data. It solves the problem of handling JSON in resource-constrained environments like embedded systems by offering a minimal, dependency-free implementation with a familiar API.
C/C++ developers working on embedded systems, IoT devices, or any application where memory footprint and portability are critical constraints.
Developers choose Frozen for its extremely small size, lack of dependencies, and intuitive API that mirrors standard C I/O functions, making JSON handling in low-resource environments straightforward and efficient.
JSON parser and generator for C/C++ with scanf/printf like interface. Targeting embedded systems.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Frozen has a very small footprint, ideal for embedded systems with scarce memory, and offers a minimal mode (-DJSON_MINIMAL=1) to further reduce size, as emphasized in the README for low-power microcontrollers.
Written in pure ISO C/C++ with no external library requirements, Frozen ensures portability and easy integration into any C/C++ project, as stated in the key features.
Functions like json_scanf() and json_printf() mirror standard C I/O, making JSON handling intuitive for C developers, with detailed examples in the API reference for direct variable scanning and printing.
Frozen includes json_fread/json_fprintf for file I/O and base64/hex encoding for binary data, providing practical functionality for embedded use cases without extra dependencies.
The json_setf() function allows updating existing JSON strings without full re-parsing, enabling efficient configuration changes in memory-constrained environments, as shown in the examples.
When built with -DJSON_MINIMAL=1, Frozen only supports integers, disabling floating-point numbers and hex/base64 conversions, which restricts compatibility with JSON containing decimals or binary data.
Low-level APIs like json_walk() require implementing callback functions for SAX-style parsing, which can be more cumbersome and error-prone compared to DOM-based approaches in libraries like cJSON.
Formats such as %Q and %V return malloc-ed strings that the caller must free, adding boilerplate code and risk of memory leaks if not handled carefully, as noted in the API documentation.
The scanf-like API returns negative numbers on errors without detailed error messages, making debugging challenging for malformed JSON or mismatched format specifiers.