MessagePack for C
object.h
Go to the documentation of this file.
1 /*
2  * MessagePack for C dynamic typing routine
3  *
4  * Copyright (C) 2008-2009 FURUHASHI Sadayuki
5  *
6  * Distributed under the Boost Software License, Version 1.0.
7  * (See accompanying file LICENSE_1_0.txt or copy at
8  * http://www.boost.org/LICENSE_1_0.txt)
9  */
10 #ifndef MSGPACK_OBJECT_H
11 #define MSGPACK_OBJECT_H
12 
13 #include "zone.h"
14 #include <stdio.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 
27 typedef enum {
35 #if defined(MSGPACK_USE_LEGACY_NAME_AS_FLOAT)
36  MSGPACK_OBJECT_DOUBLE = MSGPACK_OBJECT_FLOAT, /* obsolete */
37 #endif /* MSGPACK_USE_LEGACY_NAME_AS_FLOAT */
44 
45 
46 struct msgpack_object;
47 struct msgpack_object_kv;
48 
49 typedef struct {
50  uint32_t size;
53 
54 typedef struct {
55  uint32_t size;
58 
59 typedef struct {
60  uint32_t size;
61  const char* ptr;
63 
64 typedef struct {
65  uint32_t size;
66  const char* ptr;
68 
69 typedef struct {
70  int8_t type;
71  uint32_t size;
72  const char* ptr;
74 
75 typedef union {
76  bool boolean;
77  uint64_t u64;
78  int64_t i64;
79 #if defined(MSGPACK_USE_LEGACY_NAME_AS_FLOAT)
80  double dec; /* obsolete*/
81 #endif /* MSGPACK_USE_LEGACY_NAME_AS_FLOAT */
82  double f64;
89 
90 typedef struct msgpack_object {
94 
95 typedef struct msgpack_object_kv {
99 
101 void msgpack_object_print(FILE* out, msgpack_object o);
102 
104 int msgpack_object_print_buffer(char *buffer, size_t buffer_size, msgpack_object o);
105 
107 bool msgpack_object_equal(const msgpack_object x, const msgpack_object y);
108 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif /* msgpack/object.h */
int64_t i64
Definition: object.h:78
uint32_t size
Definition: object.h:50
Definition: object.h:64
uint32_t size
Definition: object.h:65
msgpack_object_bin bin
Definition: object.h:86
msgpack_object_type
Definition: object.h:27
#define MSGPACK_DLLEXPORT
Definition: sysdep.h:42
struct msgpack_object msgpack_object
Definition: object.h:40
struct msgpack_object_kv msgpack_object_kv
Definition: object.h:29
Definition: object.h:28
Definition: object.h:38
Definition: object.h:95
Definition: object.h:30
msgpack_object_union via
Definition: object.h:92
Definition: object.h:75
msgpack_object_array array
Definition: object.h:83
Definition: object.h:41
Definition: object.h:31
msgpack_object val
Definition: object.h:97
Definition: object.h:49
Definition: object.h:32
int8_t type
Definition: object.h:70
const char * ptr
Definition: object.h:61
Definition: object.h:42
Definition: object.h:54
const char * ptr
Definition: object.h:72
Definition: object.h:33
uint64_t u64
Definition: object.h:77
msgpack_object_map map
Definition: object.h:84
Definition: object.h:59
double f64
Definition: object.h:82
uint32_t size
Definition: object.h:71
Definition: object.h:90
msgpack_object_str str
Definition: object.h:85
msgpack_object key
Definition: object.h:96
msgpack_object_ext ext
Definition: object.h:87
Definition: object.h:69
uint32_t size
Definition: object.h:60
MSGPACK_DLLEXPORT int msgpack_object_print_buffer(char *buffer, size_t buffer_size, msgpack_object o)
Definition: object.h:39
Definition: object.h:34
struct msgpack_object * ptr
Definition: object.h:51
struct msgpack_object_kv * ptr
Definition: object.h:56
const char * ptr
Definition: object.h:66
uint32_t size
Definition: object.h:55
bool boolean
Definition: object.h:76
msgpack_object_type type
Definition: object.h:91
MSGPACK_DLLEXPORT void msgpack_object_print(FILE *out, msgpack_object o)
MSGPACK_DLLEXPORT bool msgpack_object_equal(const msgpack_object x, const msgpack_object y)