Skip to content

iamfotx/jmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

jmap

jmap is a lightweight JSON-to-struct mapper for C, using a simple schema system.

It lets you populate C structs from JSON without manually extracting every field — ideal for config files, API responses, or embedded systems.


Features

  • Minimal schema-based mapping
  • Safe assignment with type checks
  • Supports strings, integers, and booleans
  • Works with JSON strings or files
  • No macros, no runtime reflection

Example

typedef struct {
    char name[64];
    int age;
    bool active;
} Person;

Person p = {0};

JField fields[] = {
    {"name", J_STRING, p.name},
    {"age", J_INT, &p.age},
    {"active", J_BOOL, &p.active}
};

JSchema schema = { fields, 3 };

jmap_parse(json_str, &schema);

JSON input:

{ "name": "Jake", "age": 27, "active": true }

License

MIT

About

Schema-based JSON to C struct mapper. Simple, safe, and runtime dynamic — built for C developers who want zero-boilerplate deserialization.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors