RetroArch
rmsgpack_dom.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2017 The RetroArch team
2  *
3  * ---------------------------------------------------------------------------------------
4  * The following license statement only applies to this file (rmsgpack_dom.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 __LIBRETRODB_MSGPACK_DOM_H__
24 #define __LIBRETRODB_MSGPACK_DOM_H__
25 
26 #include <stdint.h>
27 
28 #include <retro_common_api.h>
29 #include <streams/file_stream.h>
30 
32 
34 {
35  RDT_NULL = 0,
43 };
44 
46 {
48  union
49  {
52  struct
53  {
55  char *buff;
56  } string;
57  struct
58  {
59  uint32_t len;
60  char *buff;
61  } binary;
62  int bool_;
63  struct
64  {
65  uint32_t len;
67  } map;
68  struct
69  {
70  uint32_t len;
72  } array;
73  } val;
74 };
75 
77 {
80 };
81 
84 
86  const struct rmsgpack_dom_value *a, const struct rmsgpack_dom_value *b);
87 
89  const struct rmsgpack_dom_value *map,
90  const struct rmsgpack_dom_value *key);
91 
93 
94 int rmsgpack_dom_write(RFILE *fd, const struct rmsgpack_dom_value *obj);
95 
96 int rmsgpack_dom_read_into(RFILE *fd, ...);
97 
99 
100 #endif
int rmsgpack_dom_write(RFILE *fd, const struct rmsgpack_dom_value *obj)
Definition: rmsgpack_dom.c:355
struct rmsgpack_dom_value::@793::@796 map
int rmsgpack_dom_read(RFILE *fd, struct rmsgpack_dom_value *out)
Definition: rmsgpack_dom.c:405
uint32_t len
Definition: rmsgpack_dom.h:54
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
int rmsgpack_dom_read_into(RFILE *fd,...)
Definition: rmsgpack_dom.c:421
union rmsgpack_dom_value::@793 val
struct passwd out
Definition: missing_libc_functions.c:51
Definition: file_stream.c:53
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
int rmsgpack_dom_value_cmp(const struct rmsgpack_dom_value *a, const struct rmsgpack_dom_value *b)
Definition: rmsgpack_dom.c:242
char * buff
Definition: rmsgpack_dom.h:55
struct rmsgpack_dom_value::@793::@797 array
Definition: rmsgpack_dom.h:40
Definition: rmsgpack_dom.h:39
void rmsgpack_dom_value_free(struct rmsgpack_dom_value *v)
Definition: rmsgpack_dom.c:192
int64_t int_
Definition: rmsgpack_dom.h:51
Definition: rmsgpack_dom.h:41
int bool_
Definition: rmsgpack_dom.h:62
Definition: rmsgpack_dom.h:37
void rmsgpack_dom_value_print(struct rmsgpack_dom_value *obj)
Definition: rmsgpack_dom.c:302
Definition: rmsgpack_dom.h:76
Definition: rmsgpack_dom.h:35
struct rmsgpack_dom_pair * items
Definition: rmsgpack_dom.h:66
rmsgpack_dom_type
Definition: rmsgpack_dom.h:33
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
Definition: rmsgpack_dom.h:45
uint64_t uint_
Definition: rmsgpack_dom.h:50
Definition: rmsgpack_dom.h:38
const GLdouble * v
Definition: glext.h:6391
struct rmsgpack_dom_value::@793::@795 binary
struct rmsgpack_dom_value * rmsgpack_dom_value_map_value(const struct rmsgpack_dom_value *map, const struct rmsgpack_dom_value *key)
Definition: rmsgpack_dom.c:226
struct rmsgpack_dom_value::@793::@794 string
signed __int64 int64_t
Definition: stdint.h:135
Definition: rmsgpack_dom.h:36
struct rmsgpack_dom_value * items
Definition: rmsgpack_dom.h:71
GLsizei const GLfloat * value
Definition: glext.h:6709
struct rmsgpack_dom_value key
Definition: rmsgpack_dom.h:78
enum rmsgpack_dom_type type
Definition: rmsgpack_dom.h:47
Definition: rmsgpack_dom.h:42
unsigned __int64 uint64_t
Definition: stdint.h:136
unsigned int uint32_t
Definition: stdint.h:126
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6844
GLsizei GLsizei GLuint * obj
Definition: glext.h:6682