json-c builds and parses JSON objects in C with a reference-counted model. It targets RFC 8259 and ships as a linkable library for Unix, Windows, Android, and retro platforms.
Overview
JSON-C is a C library for creating JSON values, serializing them to text, and parsing JSON strings back into in-memory structures. It uses reference counting on JSON object nodes so C programs can share and release trees without manual memory bookkeeping across typical embed and server code paths.
The implementation aims to conform to RFC 8259. Maintainers document building with CMake on Unix-like systems, optional partial threading support, vcpkg installation on Windows and Unix, cross-compilation guidance for Android, and extensive packaging for Amiga and MorphOS via Docker-based SDK scripts.
Consumers link libjson-c into applications using pkg-config, explicit compiler flags, or CMake find modules. Optional CMake switches control shared versus static libraries, threading helpers, jsonpointer support, and platform-specific toolchain quirks.
Support channels include project forums and issue trackers for bug reports with version and environment details. API documentation can be generated from sources with Doxygen when that tool is available.
Key features
- Reference-counted JSON object model
- JSON parse and stringify APIs
- RFC 8259 conformance goal
- Shared and static library builds
- Optional partial threading support
- CMake-based configuration
- vcpkg package availability
- Cross-build scripts for Amiga targets
Use cases
- JSON I/O in embedded C programs
- Unix daemon configuration parsing
- Android native JSON handling
- Linking JSON support via pkg-config
- Legacy Amiga or MorphOS ports