Hacker News new | past | comments | ask | show | jobs | submit login

I started out using JSMN for parsing JSON in our embedded devices at work, but the requirement to pre-allocate all the tokens turned out to be a problem - I was running out of memory when the configuration files got too largeā€¦

So I wrote a new parser that trades lower RAM usage for higher CPU usage: https://bitbucket.org/tlabwest/json-reader/overview

Sample usage:

  json_token_t json;
  json_validate(json_string, &json);
  
  json_token_t value;
  json_find(&json, "key1/subkey:2/value1", &value);
  
  char s[bufsize];
  json_decode_string(&value, s, bufsize);
  
  printf("%s\n", s);
  
  json_free(&json);



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: