RetroArch
Macros | Functions | Variables
rmsgpack.c File Reference
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <stdint.h>
#include <string.h>
#include <retro_endianness.h>
#include "rmsgpack.h"
Include dependency graph for rmsgpack.c:

Macros

#define _MPF_FIXMAP   0x80
 
#define _MPF_MAP16   0xde
 
#define _MPF_MAP32   0xdf
 
#define _MPF_FIXARRAY   0x90
 
#define _MPF_ARRAY16   0xdc
 
#define _MPF_ARRAY32   0xdd
 
#define _MPF_FIXSTR   0xa0
 
#define _MPF_STR8   0xd9
 
#define _MPF_STR16   0xda
 
#define _MPF_STR32   0xdb
 
#define _MPF_BIN8   0xc4
 
#define _MPF_BIN16   0xc5
 
#define _MPF_BIN32   0xc6
 
#define _MPF_FALSE   0xc2
 
#define _MPF_TRUE   0xc3
 
#define _MPF_INT8   0xd0
 
#define _MPF_INT16   0xd1
 
#define _MPF_INT32   0xd2
 
#define _MPF_INT64   0xd3
 
#define _MPF_UINT8   0xcc
 
#define _MPF_UINT16   0xcd
 
#define _MPF_UINT32   0xce
 
#define _MPF_UINT64   0xcf
 
#define _MPF_NIL   0xc0
 

Functions

int rmsgpack_write_array_header (RFILE *fd, uint32_t size)
 
int rmsgpack_write_map_header (RFILE *fd, uint32_t size)
 
int rmsgpack_write_string (RFILE *fd, const char *s, uint32_t len)
 
int rmsgpack_write_bin (RFILE *fd, const void *s, uint32_t len)
 
int rmsgpack_write_nil (RFILE *fd)
 
int rmsgpack_write_bool (RFILE *fd, int value)
 
int rmsgpack_write_int (RFILE *fd, int64_t value)
 
int rmsgpack_write_uint (RFILE *fd, uint64_t value)
 
static int read_uint (RFILE *fd, uint64_t *out, size_t size)
 
static int read_int (RFILE *fd, int64_t *out, size_t size)
 
static int read_buff (RFILE *fd, size_t size, char **pbuff, uint64_t *len)
 
static int read_map (RFILE *fd, uint32_t len, struct rmsgpack_read_callbacks *callbacks, void *data)
 
static int read_array (RFILE *fd, uint32_t len, struct rmsgpack_read_callbacks *callbacks, void *data)
 
int rmsgpack_read (RFILE *fd, struct rmsgpack_read_callbacks *callbacks, void *data)
 

Variables

static const uint8_t MPF_FIXMAP = _MPF_FIXMAP
 
static const uint8_t MPF_MAP16 = _MPF_MAP16
 
static const uint8_t MPF_MAP32 = _MPF_MAP32
 
static const uint8_t MPF_FIXARRAY = _MPF_FIXARRAY
 
static const uint8_t MPF_ARRAY16 = _MPF_ARRAY16
 
static const uint8_t MPF_ARRAY32 = _MPF_ARRAY32
 
static const uint8_t MPF_FIXSTR = _MPF_FIXSTR
 
static const uint8_t MPF_STR8 = _MPF_STR8
 
static const uint8_t MPF_STR16 = _MPF_STR16
 
static const uint8_t MPF_STR32 = _MPF_STR32
 
static const uint8_t MPF_BIN8 = _MPF_BIN8
 
static const uint8_t MPF_BIN16 = _MPF_BIN16
 
static const uint8_t MPF_BIN32 = _MPF_BIN32
 
static const uint8_t MPF_FALSE = _MPF_FALSE
 
static const uint8_t MPF_TRUE = _MPF_TRUE
 
static const uint8_t MPF_INT8 = _MPF_INT8
 
static const uint8_t MPF_INT16 = _MPF_INT16
 
static const uint8_t MPF_INT32 = _MPF_INT32
 
static const uint8_t MPF_INT64 = _MPF_INT64
 
static const uint8_t MPF_UINT8 = _MPF_UINT8
 
static const uint8_t MPF_UINT16 = _MPF_UINT16
 
static const uint8_t MPF_UINT32 = _MPF_UINT32
 
static const uint8_t MPF_UINT64 = _MPF_UINT64
 
static const uint8_t MPF_NIL = _MPF_NIL
 

Macro Definition Documentation

◆ _MPF_ARRAY16

#define _MPF_ARRAY16   0xdc

◆ _MPF_ARRAY32

#define _MPF_ARRAY32   0xdd

◆ _MPF_BIN16

#define _MPF_BIN16   0xc5

◆ _MPF_BIN32

#define _MPF_BIN32   0xc6

◆ _MPF_BIN8

#define _MPF_BIN8   0xc4

◆ _MPF_FALSE

#define _MPF_FALSE   0xc2

◆ _MPF_FIXARRAY

#define _MPF_FIXARRAY   0x90

◆ _MPF_FIXMAP

#define _MPF_FIXMAP   0x80

◆ _MPF_FIXSTR

#define _MPF_FIXSTR   0xa0

◆ _MPF_INT16

#define _MPF_INT16   0xd1

◆ _MPF_INT32

#define _MPF_INT32   0xd2

◆ _MPF_INT64

#define _MPF_INT64   0xd3

◆ _MPF_INT8

#define _MPF_INT8   0xd0

◆ _MPF_MAP16

#define _MPF_MAP16   0xde

◆ _MPF_MAP32

#define _MPF_MAP32   0xdf

◆ _MPF_NIL

#define _MPF_NIL   0xc0

◆ _MPF_STR16

#define _MPF_STR16   0xda

◆ _MPF_STR32

#define _MPF_STR32   0xdb

◆ _MPF_STR8

#define _MPF_STR8   0xd9

◆ _MPF_TRUE

#define _MPF_TRUE   0xc3

◆ _MPF_UINT16

#define _MPF_UINT16   0xcd

◆ _MPF_UINT32

#define _MPF_UINT32   0xce

◆ _MPF_UINT64

#define _MPF_UINT64   0xcf

◆ _MPF_UINT8

#define _MPF_UINT8   0xcc

Function Documentation

◆ read_array()

static int read_array ( RFILE fd,
uint32_t  len,
struct rmsgpack_read_callbacks callbacks,
void data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_buff()

static int read_buff ( RFILE fd,
size_t  size,
char **  pbuff,
uint64_t len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_int()

static int read_int ( RFILE fd,
int64_t out,
size_t  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_map()

static int read_map ( RFILE fd,
uint32_t  len,
struct rmsgpack_read_callbacks callbacks,
void data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_uint()

static int read_uint ( RFILE fd,
uint64_t out,
size_t  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rmsgpack_read()

int rmsgpack_read ( RFILE fd,
struct rmsgpack_read_callbacks callbacks,
void data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rmsgpack_write_array_header()

int rmsgpack_write_array_header ( RFILE fd,
uint32_t  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rmsgpack_write_bin()

int rmsgpack_write_bin ( RFILE fd,
const void s,
uint32_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rmsgpack_write_bool()

int rmsgpack_write_bool ( RFILE fd,
int  value 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rmsgpack_write_int()

int rmsgpack_write_int ( RFILE fd,
int64_t  value 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rmsgpack_write_map_header()

int rmsgpack_write_map_header ( RFILE fd,
uint32_t  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rmsgpack_write_nil()

int rmsgpack_write_nil ( RFILE fd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rmsgpack_write_string()

int rmsgpack_write_string ( RFILE fd,
const char *  s,
uint32_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rmsgpack_write_uint()

int rmsgpack_write_uint ( RFILE fd,
uint64_t  value 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ MPF_ARRAY16

const uint8_t MPF_ARRAY16 = _MPF_ARRAY16
static

◆ MPF_ARRAY32

const uint8_t MPF_ARRAY32 = _MPF_ARRAY32
static

◆ MPF_BIN16

const uint8_t MPF_BIN16 = _MPF_BIN16
static

◆ MPF_BIN32

const uint8_t MPF_BIN32 = _MPF_BIN32
static

◆ MPF_BIN8

const uint8_t MPF_BIN8 = _MPF_BIN8
static

◆ MPF_FALSE

const uint8_t MPF_FALSE = _MPF_FALSE
static

◆ MPF_FIXARRAY

const uint8_t MPF_FIXARRAY = _MPF_FIXARRAY
static

◆ MPF_FIXMAP

const uint8_t MPF_FIXMAP = _MPF_FIXMAP
static

◆ MPF_FIXSTR

const uint8_t MPF_FIXSTR = _MPF_FIXSTR
static

◆ MPF_INT16

const uint8_t MPF_INT16 = _MPF_INT16
static

◆ MPF_INT32

const uint8_t MPF_INT32 = _MPF_INT32
static

◆ MPF_INT64

const uint8_t MPF_INT64 = _MPF_INT64
static

◆ MPF_INT8

const uint8_t MPF_INT8 = _MPF_INT8
static

◆ MPF_MAP16

const uint8_t MPF_MAP16 = _MPF_MAP16
static

◆ MPF_MAP32

const uint8_t MPF_MAP32 = _MPF_MAP32
static

◆ MPF_NIL

const uint8_t MPF_NIL = _MPF_NIL
static

◆ MPF_STR16

const uint8_t MPF_STR16 = _MPF_STR16
static

◆ MPF_STR32

const uint8_t MPF_STR32 = _MPF_STR32
static

◆ MPF_STR8

const uint8_t MPF_STR8 = _MPF_STR8
static

◆ MPF_TRUE

const uint8_t MPF_TRUE = _MPF_TRUE
static

◆ MPF_UINT16

const uint8_t MPF_UINT16 = _MPF_UINT16
static

◆ MPF_UINT32

const uint8_t MPF_UINT32 = _MPF_UINT32
static

◆ MPF_UINT64

const uint8_t MPF_UINT64 = _MPF_UINT64
static

◆ MPF_UINT8

const uint8_t MPF_UINT8 = _MPF_UINT8
static