libgson

libgson
Login

libgson is a json generator library for C.

Installation

Clone this repository using fossil:

$ fossil clone https://foutaise.org/fossil/libgson

Compile and install libgson:

$ cd libgson
$ make
$ sudo make install

API

The gson.h file provide details on gson API.

Example

See the example directory for an example of libgson usage.

$ make example
$ ./example/gsonexample
{
  "json null": null,
  "json booleans": {
    "true": true,
    "false": false
  },
  "json numbers": [
    12,
    -123.56,
    1e+20
  ],
  "json array": [
    "1rst entry",
    "2nd entry",
    "3rd entry"
  ],
  "json object": {
    "firstname": "Jean",
    "lastname": "Bon",
    "age": 42
  }
}