Greenbone Vulnerability Management Libraries 22.18.1
json.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Greenbone AG
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 */
5
6#ifndef _GVM_JSON_H
7#define _GVM_JSON_H
8
9#define _GNU_SOURCE
10
11#include <cjson/cJSON.h>
12#include <glib.h>
13
14gchar *
15gvm_json_string_escape (const char *, gboolean);
16
17double
18gvm_json_obj_double (cJSON *, const gchar *);
19
20int
21gvm_json_obj_check_int (cJSON *, const gchar *, int *);
22
23int
24gvm_json_obj_int (cJSON *, const gchar *);
25
26int
27gvm_json_obj_check_str (cJSON *, const gchar *, gchar **);
28
29gchar *
30gvm_json_obj_str (cJSON *, const gchar *);
31
32#endif /* _GVM_JSON_H */
int gvm_json_obj_check_str(cJSON *, const gchar *, gchar **)
Get a string field from a JSON object.
Definition json.c:142
int gvm_json_obj_check_int(cJSON *, const gchar *, int *)
Get an int field from a JSON object.
Definition json.c:97
int gvm_json_obj_int(cJSON *, const gchar *)
Get an int field from a JSON object.
Definition json.c:120
gchar * gvm_json_string_escape(const char *, gboolean)
Escapes a string according to the JSON or JSONPath standard.
Definition json.c:17
gchar * gvm_json_obj_str(cJSON *, const gchar *)
Get a string field from a JSON object.
Definition json.c:165
double gvm_json_obj_double(cJSON *, const gchar *)
Get a double field from a JSON object.
Definition json.c:75