Add callback context pointer to stream_parser_t #14
EricSidorov
started this conversation in
Ideas
Replies: 3 comments 3 replies
-
Should such context be part of init function or rather of parser function? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I implemented this feature in my fork and adjusted the stream example accordingly |
Beta Was this translation helpful? Give feedback.
0 replies
-
My proposal only. Make a function that allows user to set user data which can be retrieved in the callback function. You thoughts? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I was looking for a lightweight json lib for embedded devices and stumbled upon your great project.
I loved it and I had some improvement idea for the stream parser
It would be useful to pass user context pointer to the stream parser callback
for example if we'd like to parse
{"a":1,"b":{"c":true,"d":false}}
to a struct s_t
We could pass the struct object to the stream callback function by adding a void pointer to the stream_parset_t struct and its initializer function:
and then pass our struct to the callback function and fill its entries of the struct while parsing :
If this feature is desirable I'd be happy to implement it
Beta Was this translation helpful? Give feedback.
All reactions