25#if defined(LWS_WITH_STRUCT_SQLITE3)
98#define LSM_SIGNED(type, name, qname) \
103 offsetof(type, name), \
104 sizeof ((type *)0)->name, \
111#define LSM_UNSIGNED(type, name, qname) \
116 offsetof(type, name), \
117 sizeof ((type *)0)->name, \
124#define LSM_BOOLEAN(type, name, qname) \
129 offsetof(type, name), \
130 sizeof ((type *)0)->name, \
137#define LSM_CARRAY(type, name, qname) \
142 offsetof(type, name), \
143 sizeof (((type *)0)->name), \
146 LSMT_STRING_CHAR_ARRAY, \
150#define LSM_STRING_PTR(type, name, qname) \
155 offsetof(type, name), \
156 sizeof (((type *)0)->name), \
163#define LSM_LIST(ptype, pname, ctype, cname, lejp_cb, cmap, qname) \
168 offsetof(ptype, pname), \
170 offsetof(ctype, cname), \
171 LWS_ARRAY_SIZE(cmap), \
176#define LSM_CHILD_PTR(ptype, pname, ctype, lejp_cb, cmap, qname) \
181 offsetof(ptype, pname), \
184 LWS_ARRAY_SIZE(cmap), \
189#define LSM_SCHEMA(ctype, lejp_cb, map, schema_name) \
197 LWS_ARRAY_SIZE(map), \
202#define LSM_SCHEMA_DLL2(ctype, cdll2mem, lejp_cb, map, schema_name) \
207 offsetof(ctype, cdll2mem), \
210 LWS_ARRAY_SIZE(map), \
224#define LSM_JO_SIGNED(type, name, qname) \
229 offsetof(type, name), \
230 sizeof ((type *)0)->name, \
237#define LSM_JO_UNSIGNED(type, name, qname) \
242 offsetof(type, name), \
243 sizeof ((type *)0)->name, \
250#define LSM_JO_BOOLEAN(type, name, qname) \
255 offsetof(type, name), \
256 sizeof ((type *)0)->name, \
263#define LSM_JO_CARRAY(type, name, qname) \
268 offsetof(type, name), \
269 sizeof (((type *)0)->name), \
272 LSMT_STRING_CHAR_ARRAY, \
276#define LSM_JO_STRING_PTR(type, name, qname) \
281 offsetof(type, name), \
282 sizeof (((type *)0)->name), \
289#define LSM_JO_LIST(ptype, pname, ctype, cname, lejp_cb, cmap, qname) \
294 offsetof(ptype, pname), \
296 offsetof(ctype, cname), \
297 LWS_ARRAY_SIZE(cmap), \
302#define LSM_JO_CHILD_PTR(ptype, pname, ctype, lejp_cb, cmap, qname) \
307 offsetof(ptype, pname), \
310 LWS_ARRAY_SIZE(cmap), \
315#define LSM_JO_SCHEMA(ctype, lejp_cb, map, schema_name) \
323 LWS_ARRAY_SIZE(map), \
328#define LSM_JO_SCHEMA_DLL2(ctype, cdll2mem, lejp_cb, map, schema_name) \
333 offsetof(ctype, cdll2mem), \
336 LWS_ARRAY_SIZE(map), \
347#define LSM_BLOB_PTR(type, blobptr_name, qname) \
352 offsetof(type, blobptr_name), \
353 sizeof (((type *)0)->blobptr_name), \
434 size_t map_entries,
int flags,
435 const void *ptoplevel);
459 size_t len,
size_t *written);
490 char create_if_missing,
sqlite3 **pdb);
537 const char *where_col);
542 const char *where_col);
551 struct lwsac **ac,
int start,
int limit);
struct lws_dll2_owner lws_dll2_owner_t
#define LEJP_MAX_PARSING_STACK_DEPTH
#define LEJP_STRING_CHUNK
signed char(* lejp_callback)(struct lejp_ctx *ctx, char reason)
LWS_VISIBLE LWS_EXTERN int lws_struct_json_init_parse(struct lejp_ctx *ctx, lejp_callback cb, void *user)
lws_struct_serialize_st_t st[LEJP_MAX_PARSING_STACK_DEPTH]
char buf[LEJP_STRING_CHUNK+1]
const struct lws_struct_map * child_map
LWS_VISIBLE LWS_EXTERN int lws_struct_sq3_serialize(sqlite3 *pdb, const lws_struct_map_t *schema, lws_dll2_owner_t *owner, uint32_t manual_idx)
LWS_VISIBLE LWS_EXTERN int lws_struct_sq3_close(sqlite3 **pdb)
const lws_struct_map_t * map
int(* lws_struct_args_cb)(void *obj, void *cb_arg)
LWS_VISIBLE LWS_EXTERN lws_struct_json_serialize_result_t lws_struct_json_serialize(lws_struct_serialize_t *js, uint8_t *buf, size_t len, size_t *written)
LWS_VISIBLE LWS_EXTERN void lws_struct_json_serialize_destroy(lws_struct_serialize_t **pjs)
LWS_VISIBLE LWS_EXTERN signed char lws_struct_default_lejp_cb(struct lejp_ctx *ctx, char reason)
LWS_VISIBLE LWS_EXTERN lws_struct_serialize_t * lws_struct_json_serialize_create(const lws_struct_map_t *map, size_t map_entries, int flags, const void *ptoplevel)
struct lws_struct_args lws_struct_args_t
struct lws_struct_serialize lws_struct_serialize_t
const struct lws_dll2 * dllpos
struct lejp_collation lejp_collation_t
struct lws_dll2_owner chunks_owner
LWS_VISIBLE LWS_EXTERN int lws_struct_sq3_create_table(sqlite3 *pdb, const lws_struct_map_t *schema)
struct lws_struct_map lws_struct_map_t
lws_struct_map_type_eum type
LWS_VISIBLE LWS_EXTERN int lws_struct_sq3_update(sqlite3 *pdb, const char *table, const lws_struct_map_t *map, size_t map_entries, const void *data, const char *where_col)
LWS_VISIBLE LWS_EXTERN int lws_struct_sq3_open(struct lws_context *context, const char *sqlite3_path, char create_if_missing, sqlite3 **pdb)
LWS_VISIBLE LWS_EXTERN signed char lws_struct_schema_only_lejp_cb(struct lejp_ctx *ctx, char reason)
LWS_VISIBLE LWS_EXTERN int lws_struct_sq3_deserialize(sqlite3 *pdb, const char *filter, const char *order, const lws_struct_map_t *schema, lws_dll2_owner_t *o, struct lwsac **ac, int start, int limit)
lws_struct_json_serialize_result_t
size_t map_entries_st[LEJP_MAX_PARSING_STACK_DEPTH]
LWS_VISIBLE LWS_EXTERN int lws_struct_sq3_upsert(sqlite3 *pdb, const char *table, const lws_struct_map_t *map, size_t map_entries, const void *data, const char *where_col)
const lws_struct_map_t * map_st[LEJP_MAX_PARSING_STACK_DEPTH]
@ LSSERJ_FLAG_OMIT_SCHEMA
struct lws_struct_serialize_st lws_struct_serialize_st_t