Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tobybenjaminclark/wjson
📄 Creating, parsing & writing JSON for use with wide character (wchar) files, e.g. Unicode/UTF-8 encoding.
https://github.com/tobybenjaminclark/wjson
c json
Last synced: 20 days ago
JSON representation
📄 Creating, parsing & writing JSON for use with wide character (wchar) files, e.g. Unicode/UTF-8 encoding.
- Host: GitHub
- URL: https://github.com/tobybenjaminclark/wjson
- Owner: tobybenjaminclark
- License: mit
- Created: 2024-02-07T13:26:08.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-08T16:07:01.000Z (11 months ago)
- Last Synced: 2024-02-09T15:27:30.991Z (11 months ago)
- Topics: c, json
- Language: C
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wjson Library Documentation
The wjson library is a simple C library for creating and manipulating JSON-like data structures with wide character support (wchar_t). It provides functions for creating, appending, and printing JSON objects and lists.# Functions
##### void wjson_print(struct wjson* head, int indentation)
Recursively prints a wjson object structure with the specified indentation level.##### struct wjson* wjson_initialize()
Initializes a new wjson object and returns a pointer to it.##### int wjson_append_string(struct wjson* wjson_node, wchar_t* key, wchar_t* value)
Appends a string key-value pair to a wjson object.##### int wjson_append_object(struct wjson* wjson_node, wchar_t* key, struct wjson* value)
Appends an object key-value pair to a wjson object.##### int wjson_append_list(struct wjson* wjson_node, wchar_t* key, struct wjson* value)
Appends a list key-value pair to a wjson object.##### int wjson_append_numerical(struct wjson* wjson_node, wchar_t* key, double value)
Appends a numerical key-value pair to a wjson object.##### int wjson_append_boolean(struct wjson* wjson_node, wchar_t* key, bool value)
Appends a boolean key-value pair to a wjson object.##### struct wjson* wjson_initialize_list()
Initializes a new wjson object for representing a list and returns a pointer to it.##### int wjson_list_append_string(struct wjson* wjson_node, wchar_t* value)
Appends a string value to a wjson list.##### int wjson_list_append_object(struct wjson* wjson_node, struct wjson* value)
Appends an object value to a wjson list.##### int wjson_list_append_numerical(struct wjson* wjson_node, double value)
Appends a numerical value to a wjson list.##### int wjson_list_append_list(struct wjson* wjson_node, struct wjson* value)
Appends a list value to a wjson list.##### int wjson_list_append_boolean(struct wjson* wjson_node, bool value)
Appends a boolean value to a wjson list.##### void wjson_test()
A sample function demonstrating the usage of the wjson library by creating, appending, and printing a complex wjson structure.