36. cJSON: recursive-descent parsing and tagged unions
What it is: a small (~2500-line), extremely widely embedded JSON library — if Section 16.3's mini JSON parser felt approachable, cJSON is the natural next read: same recursive-descent structure, production- hardened.
Concept mapping, directly against your own Section 16.3 parser:
cJSONthe struct is Section 8.3's tagged union, just flattened into one struct with atypeint field and multiple payload fields instead of aunionblock — a deliberate simplicity trade-off (slightly more memory per node) for slightly simpler code than a realunion.cJSON_Parse→parse_value→parse_object/parse_array/parse_string/parse_numberis exactly your Section 16.3 function breakdown, function-for-function, because that decomposition is simply what JSON's grammar requires — reading cJSON's actualcJSON_Parse*functions after writing your own is one of the fastest ways to feel the jump from "I can write basic C" to "I can read real C."cJSON_Deletewalking the tree and freeing children before parents is Section 16.3'sjson_free, and it's the same recursive-teardown shape as Section 18.1'slist_freeand Section 18.3's tree traversal — once you've written one recursive free function, you can read every other one.