ref: 62df9a6d3022bf58144fdd44ff950b35e6fcf8f3
parent: 4e58e991e413c61f132552b28917f13f729b04bd
author: sirjofri <sirjofri@sirjofri.de>
date: Sun Mar 15 14:01:57 EDT 2026
updates readme
--- a/README
+++ b/README
@@ -49,13 +49,33 @@
RJSON_STRING(Struct,Name)
RJSON_NUMBER(Struct,Name)
RJSON_BOOL(Struct,Name)
+
+ Struct is the type of the struct this definition reflects.
+ Name is the member variable.
+
RJSON_OBJECT(Struct,Name, Subobject_defs)
+ Subobject_defs is the rjson definition of the subobject.
+RJSON_ARRAY_OBJECT(Struct,Name, Type, Subobject_defs, Counter)
+
+ Type is the struct name of the subobject array.
+ Counter is the name of the member variable that will hold the
+ number of objects within that array.
+
+RJSON_Array(Struct,Name, JSONType, Counter)
+
+ JSONType is the primitive type, e.g. JSONNumber. See json(2).
+
+
IMPORTANT
→ char* members are malloc'd strings.
→ the name in the macros mustn't start with a space character.
+→ the counter variable name can currently start with a space
+ character, and is not reflected.
→ there's currently no array support
→ there should be no leaks
→ there are probably bugs
+→ I recommend deciding on a common scheme for array/counter names
+ and struct types/rjson structure names.
--
⑨