RetroArch
rmsgpack.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.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_H__
24 #define __LIBRETRODB_MSGPACK_H__
25 
26 #include <stdint.h>
27 
28 #include <streams/file_stream.h>
29 
31 {
32  int (*read_nil )(void *);
33  int (*read_bool )(int, void *);
34  int (*read_int )(int64_t, void *);
35  int (*read_uint )(uint64_t, void *);
36  int (*read_string )(char *, uint32_t, void *);
37  int (*read_bin )(void *, uint32_t, void *);
38  int (*read_map_start )(uint32_t, void *);
39  int (*read_array_start)(uint32_t, void *);
40 };
41 
43 
45 
46 int rmsgpack_write_string(RFILE *fd, const char *s, uint32_t len);
47 
48 int rmsgpack_write_bin(RFILE *fd, const void *s, uint32_t len);
49 
50 int rmsgpack_write_nil(RFILE *fd);
51 
52 int rmsgpack_write_bool(RFILE *fd, int value);
53 
55 
57 
58 int rmsgpack_read(RFILE *fd, struct rmsgpack_read_callbacks *callbacks, void *data);
59 
60 #endif
61 
int rmsgpack_write_bin(RFILE *fd, const void *s, uint32_t len)
Definition: rmsgpack.c:222
GLenum GLsizei len
Definition: glext.h:7389
GLsizeiptr size
Definition: glext.h:6559
int(* read_int)(int64_t, void *)
Definition: rmsgpack.h:34
GLdouble s
Definition: glext.h:6390
Definition: file_stream.c:53
int(* read_bin)(void *, uint32_t, void *)
Definition: rmsgpack.h:37
Definition: ibxm.h:9
int(* read_map_start)(uint32_t, void *)
Definition: rmsgpack.h:38
Definition: rmsgpack.h:30
int(* read_nil)(void *)
Definition: rmsgpack.h:32
int rmsgpack_write_nil(RFILE *fd)
Definition: rmsgpack.c:260
int rmsgpack_write_int(RFILE *fd, int64_t value)
Definition: rmsgpack.c:284
int rmsgpack_write_uint(RFILE *fd, uint64_t value)
Definition: rmsgpack.c:348
int rmsgpack_write_string(RFILE *fd, const char *s, uint32_t len)
Definition: rmsgpack.c:171
int rmsgpack_write_bool(RFILE *fd, int value)
Definition: rmsgpack.c:267
int(* read_uint)(uint64_t, void *)
Definition: rmsgpack.h:35
int(* read_string)(char *, uint32_t, void *)
Definition: rmsgpack.h:36
signed __int64 int64_t
Definition: stdint.h:135
int(* read_bool)(int, void *)
Definition: rmsgpack.h:33
GLsizei const GLfloat * value
Definition: glext.h:6709
int rmsgpack_write_map_header(RFILE *fd, uint32_t size)
Definition: rmsgpack.c:137
int rmsgpack_write_array_header(RFILE *fd, uint32_t size)
Definition: rmsgpack.c:101
int(* read_array_start)(uint32_t, void *)
Definition: rmsgpack.h:39
unsigned __int64 uint64_t
Definition: stdint.h:136
int rmsgpack_read(RFILE *fd, struct rmsgpack_read_callbacks *callbacks, void *data)
Definition: rmsgpack.c:529
unsigned int uint32_t
Definition: stdint.h:126