Skip to content

primepvi/json.c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json.c

Warning

THIS LIBRARY IS WORK IN PROGRESS AND NOT READY FOR PRODUCTION!

Tiny json parser library for c.

Build

xmake build

Example

You can see more examples in examples folder.

#include <stdio.h>
#include "json.h"

int main(void) {
  const char *raw =
      "{\"key\": \"users\", \"values\": [{ \"id\": 1, \"name\": \"carlos\"}]}";
  json_value_t *root = json_parse(raw);

  json_value_t *key = json_get(root, "key");
  json_value_t *id = json_get(root, "values.[0].id");

  printf("%s %lf", key->as.string, id->as.number);

  json_free(root);

  return 0;
}

About

tiny json parser library for c language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published