RetroArch
jsonsax.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2018 The RetroArch team
2  *
3  * ---------------------------------------------------------------------------------------
4  * The following license statement only applies to this file (jsonsax.h).
5  * ---------------------------------------------------------------------------------------
6  *
7  * Permission is hereby granted, free of charge,
8  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation the rights to
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef __LIBRETRO_SDK_FORMAT_JSONSAX_H__
24 #define __LIBRETRO_SDK_FORMAT_JSONSAX_H__
25 
26 #include <stddef.h>
27 
28 #include <retro_common_api.h>
29 
31 
32 
33 enum
34 {
44 };
45 
46 #ifdef JSONSAX_ERRORS
47 extern const char* jsonsax_errors[];
48 #endif
49 
50 typedef struct
51 {
52  int ( *start_document )( void* userdata );
53  int ( *end_document )( void* userdata );
54  int ( *start_object )( void* userdata );
55  int ( *end_object )( void* userdata );
56  int ( *start_array )( void* userdata );
57  int ( *end_array )( void* userdata );
58  int ( *key )( void* userdata, const char* name, size_t length );
59  int ( *array_index )( void* userdata, unsigned int index );
60  int ( *string )( void* userdata, const char* string, size_t length );
61  int ( *number )( void* userdata, const char* number, size_t length );
62  int ( *boolean )( void* userdata, int istrue );
63  int ( *null )( void* userdata );
64 }
66 
67 int jsonsax_parse( const char* json, const jsonsax_handlers_t* handlers, void* userdata );
68 
70 
71 #endif /* __LIBRETRO_SDK_FORMAT_JSONSAX_H__ */
int jsonsax_parse(const char *json, const jsonsax_handlers_t *handlers, void *userdata)
Definition: jsonsax.c:293
static char * number(char *str, long num, int base, int size, int precision, int type)
Definition: kprintf.c:42
GLuint const GLchar * name
Definition: glext.h:6671
Definition: jsonsax.h:42
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
Definition: jsonsax.h:41
static const char json[]
Definition: namespacetest.cpp:32
Definition: jsonsax.h:37
Definition: jsonsax.h:43
Definition: jsonsax.h:39
Definition: jsonsax.h:50
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
Definition: jsonsax.h:40
GLuint index
Definition: glext.h:6671
int(* string)(void *userdata, const char *string, size_t length)
Definition: jsonsax.h:60
Definition: jsonsax.h:36
Definition: jsonsax.h:35
Definition: jsonsax.h:38
GLenum GLuint GLenum GLsizei length
Definition: glext.h:6233
int(* number)(void *userdata, const char *number, size_t length)
Definition: jsonsax.h:61