Greenbone Vulnerability Management Libraries: util/json.h Source File

Greenbone Vulnerability Management Libraries 23.7.0

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_UTIL_JSON_H
7#define _GVM_UTIL_JSON_H
8
9#define _GNU_SOURCE
10
11#include <cjson/cJSON.h>
12#include <glib.h>
13
14gchar *
15 gvm_json_string_escape (const char *, gboolean);
16
17double
18 gvm_json_obj_double (cJSON *, const gchar *);
19
20int
21 gvm_json_obj_check_int (cJSON *, const gchar *, int *);
22
23int
24 gvm_json_obj_int (cJSON *, const gchar *);
25
26int
27 gvm_json_obj_check_str (cJSON *, const gchar *, gchar **);
28
29gchar *
30 gvm_json_obj_str (cJSON *, const gchar *);
31
32#endif /* not _GVM_UTIL_JSON_H */
gvm_json_obj_check_str
int gvm_json_obj_check_str(cJSON *, const gchar *, gchar **)
Get a string field from a JSON object.
Definition json.c:142
gvm_json_obj_check_int
int gvm_json_obj_check_int(cJSON *, const gchar *, int *)
Get an int field from a JSON object.
Definition json.c:97
gvm_json_obj_int
int gvm_json_obj_int(cJSON *, const gchar *)
Get an int field from a JSON object.
Definition json.c:120
gvm_json_string_escape
gchar * gvm_json_string_escape(const char *, gboolean)
Escapes a string according to the JSON or JSONPath standard.
Definition json.c:17
gvm_json_obj_str
gchar * gvm_json_obj_str(cJSON *, const gchar *)
Get a string field from a JSON object.
Definition json.c:165
gvm_json_obj_double
double gvm_json_obj_double(cJSON *, const gchar *)
Get a double field from a JSON object.
Definition json.c:75