GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
include
utils
gp_json_common.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: LGPL-2.1-or-later
2
/*
3
* Copyright (C) 2021-2022 Cyril Hrubis <metan@ucw.cz>
4
*/
5
11
#ifndef GP_JSON_COMMON_H
12
#define GP_JSON_COMMON_H
13
15
#define GP_JSON_ERR_MAX 128
17
#define GP_JSON_ID_MAX 64
19
#define GP_JSON_RECURSION_MAX 128
20
21
#define GP_JSON_ERR_PRINT gp_json_err_handler
22
#define GP_JSON_ERR_PRINT_PRIV stderr
23
27
enum
gp_json_type
{
29
GP_JSON_VOID
= 0,
31
GP_JSON_INT
,
33
GP_JSON_FLOAT
,
35
GP_JSON_BOOL
,
37
GP_JSON_NULL
,
39
GP_JSON_STR
,
41
GP_JSON_OBJ
,
43
GP_JSON_ARR
,
44
};
45
52
const
char
*
gp_json_type_name
(
enum
gp_json_type
type);
53
60
void
gp_json_err_handler
(
void
*print_priv,
const
char
*line);
61
62
typedef
struct
gp_json_reader
gp_json_reader
;
63
typedef
struct
gp_json_writer
gp_json_writer
;
64
typedef
struct
gp_json_val
gp_json_val
;
65
66
#endif
/* GP_JSON_COMMON_H */
gp_json_type
gp_json_type
A JSON data type.
Definition
gp_json_common.h:27
GP_JSON_FLOAT
@ GP_JSON_FLOAT
A floating point.
Definition
gp_json_common.h:33
GP_JSON_ARR
@ GP_JSON_ARR
A JSON array.
Definition
gp_json_common.h:43
GP_JSON_BOOL
@ GP_JSON_BOOL
A boolean.
Definition
gp_json_common.h:35
GP_JSON_VOID
@ GP_JSON_VOID
No type. Returned when parser finishes.
Definition
gp_json_common.h:29
GP_JSON_STR
@ GP_JSON_STR
A string.
Definition
gp_json_common.h:39
GP_JSON_OBJ
@ GP_JSON_OBJ
A JSON object.
Definition
gp_json_common.h:41
GP_JSON_INT
@ GP_JSON_INT
An integer.
Definition
gp_json_common.h:31
GP_JSON_NULL
@ GP_JSON_NULL
NULL.
Definition
gp_json_common.h:37
gp_json_err_handler
void gp_json_err_handler(void *print_priv, const char *line)
Default error print handler.
gp_json_type_name
const char * gp_json_type_name(enum gp_json_type type)
Returns type name.
gp_json_reader
A JSON parser internal state.
Definition
gp_json_reader.h:43
gp_json_val
A parsed JSON key value pair.
Definition
gp_json_reader.h:68
gp_json_writer
A JSON writer.
Definition
gp_json_writer.h:30
Generated by
1.9.8