Cthulhu  0.2.10
Cthulhu compiler collection
query.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: LGPL-3.0-only
2 #pragma once
3 
4 #include "core/analyze.h"
5 
6 #include "json/json.h"
7 
8 #include <stdbool.h>
9 
11 
12 typedef struct json_t json_t;
13 typedef struct logger_t logger_t;
14 typedef struct arena_t arena_t;
15 
25 CT_JSON_API json_t *json_query(
26  IN_NOTNULL json_t *json,
27  IN_NOTNULL const char *query,
28  IN_NOTNULL logger_t *logger,
29  IN_NOTNULL arena_t *arena);
30 
41 CT_JSON_API json_t *json_query_type(
42  IN_NOTNULL json_t *json,
43  IN_NOTNULL const char *query,
45  IN_NOTNULL logger_t *logger,
46  IN_NOTNULL arena_t *arena);
47 
#define IN_NOTNULL
annotate a parameter as not being null
#define IN_DOMAIN(cmp, it)
annotate a parameter as being bounded by the expression of cmp and it
#define RET_INSPECT
annotate the return value as needing to be inspected this is the same as CT_NODISCARD but implies tha...
#define CT_BEGIN_API
Definition: compiler.h:129
#define CT_END_API
Definition: compiler.h:130
json_kind_t
the kind of json value
Definition: json.h:34
@ eJsonCount
Definition: json.h:38
an allocator object
Definition: arena.h:86
a json value
Definition: json.h:43
a logging sink
Definition: notify.c:14
CT_JSON_API json_t * json_query_type(json_t *json, const char *query, json_kind_t kind, logger_t *logger, arena_t *arena)
query a json object and ensure it is of a specific type
Definition: query.c:115
CT_JSON_API json_t * json_query(json_t *json, const char *query, logger_t *logger, arena_t *arena)
query a json object
Definition: query.c:109