json.h
Go to the documentation of this file.
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef _GVM_JSON_H
#define _GVM_JSON_H
#define _GNU_SOURCE
#include <cjson/cJSON.h>
#include <glib.h>
gchar *
gvm_json_string_escape (const char *, gboolean);
double
gvm_json_obj_double (cJSON *, const gchar *);
int
gvm_json_obj_check_int (cJSON *, const gchar *, int *);
int
gvm_json_obj_int (cJSON *, const gchar *);
int
gvm_json_obj_check_str (cJSON *, const gchar *, gchar **);
gchar *
gvm_json_obj_str (cJSON *, const gchar *);
#endif /* _GVM_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