Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Go-style JSON Marshal / Unmarshal for C structs (github.com/gyf304)
2 points by gyf304 on Feb 15, 2021 | hide | past | favorite | 1 comment



CMarshal brings Go style JSON marshaling / unmarshaling to C.

You can generate cJSON based JSON serializers and deserializers by adding a /* cmarshal:`true` */ comment to your C struct.

Potential use cases:

* Auto-generated JSON config parsers

* Simple struct printer (as a debugging mechanism, my goal in mind for this project)

* Introspecting C structs using cJSON API

* Easily bloat your program line count! (not the intended use case, of course)

Let me know how you think about this.*




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: