json-gen-c
0.1.5
json-gen-c generate C code for json manipulation
|
Thread-safe context structure for JSON parsing. More...
#include <stdint.h>
#include <pthread.h>
Go to the source code of this file.
Classes | |
struct | json_field_offset_item |
Field offset item structure for JSON parsing. More... | |
struct | json_context |
Thread-safe JSON parsing context This structure replaces global variables to ensure thread safety. More... | |
Functions | |
struct json_context * | json_context_new (void) |
Create a new JSON parsing context. | |
void | json_context_free (struct json_context *ctx) |
Free a JSON parsing context. | |
int | json_context_init (struct json_context *ctx, struct json_field_offset_item *field_items, int item_count, int *hash_table, int hash_size) |
Initialize context with field offset data. | |
struct json_field_offset_item * | json_context_find_field (struct json_context *ctx, const char *struct_name, const char *field_name) |
Find field offset item in thread-safe manner. | |
Thread-safe context structure for JSON parsing.
struct json_field_offset_item * json_context_find_field | ( | struct json_context * | ctx, |
const char * | struct_name, | ||
const char * | field_name | ||
) |
Find field offset item in thread-safe manner.
ctx | JSON context |
struct_name | Structure name |
field_name | Field name |
void json_context_free | ( | struct json_context * | ctx | ) |
Free a JSON parsing context.
ctx | Context to free |
int json_context_init | ( | struct json_context * | ctx, |
struct json_field_offset_item * | field_items, | ||
int | item_count, | ||
int * | hash_table, | ||
int | hash_size | ||
) |
Initialize context with field offset data.
ctx | Context to initialize |
field_items | Array of field offset items |
item_count | Number of items in array |
hash_table | Hash table for lookups |
hash_size | Size of hash table |
struct json_context * json_context_new | ( | void | ) |
Create a new JSON parsing context.