{"id":20381705,"url":"https://github.com/jacob-c-smith/json","last_synced_at":"2026-02-13T14:38:55.729Z","repository":{"id":65555478,"uuid":"370210940","full_name":"Jacob-C-Smith/json","owner":"Jacob-C-Smith","description":"A tested JSON parser / serializer","archived":false,"fork":false,"pushed_at":"2024-12-27T17:37:51.000Z","size":350,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T08:53:05.030Z","etag":null,"topics":["c","json","parser","serializer","tested"],"latest_commit_sha":null,"homepage":"https://g10.app/status/#parser_serializer","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jacob-C-Smith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-24T02:59:43.000Z","updated_at":"2024-12-27T17:37:54.000Z","dependencies_parsed_at":"2023-02-15T21:30:49.805Z","dependency_job_id":"f179750a-4687-4087-8d67-4a7cadd12881","html_url":"https://github.com/Jacob-C-Smith/json","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Fjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Fjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Fjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Fjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jacob-C-Smith","download_url":"https://codeload.github.com/Jacob-C-Smith/json/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248543882,"owners_count":21121838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","json","parser","serializer","tested"],"created_at":"2024-11-15T02:14:59.796Z","updated_at":"2026-02-13T14:38:50.684Z","avatar_url":"https://github.com/Jacob-C-Smith.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json\r\n[![CMake](https://github.com/Jacob-C-Smith/json/actions/workflows/cmake.yml/badge.svg)](https://github.com/Jacob-C-Smith/json/actions/workflows/cmake.yml)\r\n\r\n**Dependencies:**\\\r\n[![dict](https://github.com/Jacob-C-Smith/dict/actions/workflows/cmake.yml/badge.svg)](https://github.com/Jacob-C-Smith/dict/actions/workflows/cmake.yml)\r\n[![array](https://github.com/Jacob-C-Smith/array/actions/workflows/cmake.yml/badge.svg?branch=main)](https://github.com/Jacob-C-Smith/array/actions/workflows/cmake.yml)\r\n[![hash-cache](https://github.com/Jacob-C-Smith/hash-cache/actions/workflows/cmake.yml/badge.svg)](https://github.com/Jacob-C-Smith/hash-cache/actions/workflows/cmake.yml) \r\n[![sync](https://github.com/Jacob-C-Smith/sync/actions/workflows/cmake.yml/badge.svg)](https://github.com/Jacob-C-Smith/sync/actions/workflows/cmake.yml)\r\n[![log](https://github.com/Jacob-C-Smith/log/actions/workflows/cmake.yml/badge.svg)](https://github.com/Jacob-C-Smith/log/actions/workflows/cmake.yml)\r\n\r\n A JSON parser / serializer written in C. \r\n \r\n \u003e 0 [Try it](#try-it)\r\n \u003e\r\n \u003e 1 [Download](#download)\r\n \u003e\r\n \u003e 2 [Build](#build)\r\n \u003e\r\n \u003e 3 [Example](#example)\r\n \u003e\r\n \u003e\u003e 3.1 [Example input](#example-input)\r\n \u003e\u003e\r\n \u003e\u003e 3.2 [Example output](#example-output)\r\n \u003e\r\n \u003e 4 [Tester](#tester)\r\n \u003e\r\n \u003e 5 [Definitions](#definitions)\r\n \u003e\r\n \u003e\u003e 5.1 [Type definitions](#type-definitions)\r\n \u003e\u003e\r\n \u003e\u003e 5.2 [Function definitions](#function-definitions)\r\n \u003e\u003e\r\n \u003e\u003e 5.3 [Macro definitions](#macro-definitinos)\r\n\r\n## Try it\r\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/Jacob-C-Smith/json?quickstart=1)\r\n\r\nWait for a few moments, then click the play button on the bottom of the window. This will run the example program.\r\n\r\n ## Download\r\n To download json, execute the following command\r\n ```bash\r\n $ git clone https://github.com/Jacob-C-Smith/json --recurse-submodules\r\n ```\r\n\r\n ## Build\r\n To build on UNIX like machines, execute the following commands in the same directory\r\n ```bash\r\n $ cd json\r\n $ cmake .\r\n $ make\r\n ```\r\n  This will build the example program, and dynamic / shared libraries\r\n\r\n  To build json for Windows machines, open the base directory in Visual Studio, and build your desired target(s)\r\n ## Example\r\n **NOTE: If you are running the tester program on Windows, you may have to copy example files to the ```Debug``` or ```Release``` directories.**\r\n The example program parses the input file, and writes the parsed tokens to stdout. To run the example program, execute this command.\r\n ```\r\n ./json_example file1.json [file2.json ... fileN.json]\r\n ```\r\n ### Example input \r\n ```json\r\n{\r\n    \"name\"      : \"Jacob Smith\",\r\n    \"age\"       : 20,\r\n    \"height\"    : 1.775,\r\n    \"dog\"       : {\r\n        \"name\"  : \"Eddie\",\r\n        \"sex\"   : \"Male\",\r\n        \"breed\" : \"Terrier\"\r\n    },\r\n    \"interests\" : [\r\n        \"Computer science\",\r\n        \"3D modeling\",\r\n        \"Organic chemistry\",\r\n        \"Mathematics\",\r\n        \"Computer games\",\r\n        \"Epistemology\"\r\n    ]\r\n}\r\n ```\r\n[example.json](example.json)\r\n\r\n ### Example output\r\n ```\r\n--- example.json ---\r\n{\"name\":\"Jacob Smith\",\"age\":20,\"height\":1.775,\"dog\":{\"name\":\"Eddie\",\"sex\":\"Male\",\"breed\":\"Terrier\"},\"interests\":[\"Computer science\",\"3D modeling\",\"Organic chemistry\",\"Mathematics\",\"Computer games\",\"Epistemology\"]}\r\n ```\r\n [Source](main.c)\r\n \r\n ## Tester\r\n **NOTE: If you are running the tester program on Windows, you may have to copy the ```serial test cases``` and ```parse test cases``` directories to the ```Debug``` or ```Release``` directories.**\r\n\r\n To run the tester program, execute this command after building\r\n ```\r\n $ ./json_test\r\n ```\r\n [Source](json_test.c)\r\n \r\n [Tester output](test_output.txt)\r\n ## Definitions\r\n \r\n ### Type definitions\r\n ```c\r\n typedef struct json_value_s json_value;\r\n ```\r\n ### Function definitions\r\n\r\n ```c\r\n// Parser\r\nint json_value_parse ( char *text, char **return_pointer, json_value **const pp_value );\r\n\r\n// Serializer\r\nint json_value_serialize ( const json_value *const p_value, char *_buffer );\r\nint json_value_print     ( const json_value *const p_value );\r\nint json_value_fprint    ( const json_value *const p_value, FILE *p_f );\r\n\r\n// Destructor\r\nvoid json_value_free ( json_value *p_value );\r\n ```\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacob-c-smith%2Fjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacob-c-smith%2Fjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacob-c-smith%2Fjson/lists"}