conv.h
Go to the documentation of this file.
1 #ifndef MPACK_CONV_H
2 #define MPACK_CONV_H
3 
4 #include "mpack_core.h"
5 
6 #if ULLONG_MAX == 0xffffffffffffffff
7 typedef long long mpack_sintmax_t;
8 typedef unsigned long long mpack_uintmax_t;
9 #elif UINT64_MAX == 0xffffffffffffffff
10 typedef int64_t mpack_sintmax_t;
11 typedef uint64_t mpack_uintmax_t;
12 #else
13 typedef mpack_sint32_t mpack_sintmax_t;
14 typedef mpack_uint32_t mpack_uintmax_t;
15 #endif
16 
17 #ifndef bool
18 # define bool unsigned
19 #endif
20 
28 MPACK_API mpack_token_t mpack_pack_chunk(const char *p, mpack_uint32_t l)
32 MPACK_API mpack_token_t mpack_pack_ext(int type, mpack_uint32_t l)
33  FUNUSED FPURE;
42 
43 /* The mpack_{pack,unpack}_float_fast functions should work in 99% of the
44  * platforms. When compiling for a platform where floats don't use ieee754 as
45  * the internal format, pass
46  * -Dmpack_{pack,unpack}_float=mpack_{pack,unpack}_float_compat to the
47  * compiler.*/
48 #ifndef mpack_pack_float
49 # define mpack_pack_float mpack_pack_float_fast
50 #endif
51 #ifndef mpack_unpack_float
52 # define mpack_unpack_float mpack_unpack_float_fast
53 #endif
54 
55 #endif /* MPACK_CONV_H */
mpack_unpack_uint
MPACK_API mpack_uintmax_t mpack_unpack_uint(mpack_token_t t) FUNUSED FPURE
Definition: conv.c:201
mpack_pack_map
MPACK_API mpack_token_t mpack_pack_map(mpack_uint32_t l) FUNUSED FPURE
Definition: conv.c:188
mpack_unpack_boolean
MPACK_API bool mpack_unpack_boolean(mpack_token_t t) FUNUSED FPURE
Definition: conv.c:196
mpack_sintmax_t
mpack_sint32_t mpack_sintmax_t
Definition: conv.h:13
p
char_u * p
Definition: eval.c:2013
FNONULL
#define FNONULL
Definition: mpack_core.h:19
type
err type
Definition: helpers.c:1043
mpack_core.h
mpack_pack_float_compat
MPACK_API mpack_token_t mpack_pack_float_compat(double v) FUNUSED FPURE
Definition: conv.c:61
v
dictitem_T * v
Definition: userfunc.c:816
FPURE
#define FPURE
Definition: mpack_core.h:18
mpack_pack_str
MPACK_API mpack_token_t mpack_pack_str(mpack_uint32_t l) FUNUSED FPURE
Definition: conv.c:155
mpack_unpack_sint
MPACK_API mpack_sintmax_t mpack_unpack_sint(mpack_token_t t) FUNUSED FPURE
Definition: conv.c:208
mpack_pack_number
MPACK_API mpack_token_t mpack_pack_number(double v) FUNUSED FPURE
Definition: conv.c:111
mpack_pack_sint
MPACK_API mpack_token_t mpack_pack_sint(mpack_sintmax_t v) FUNUSED FPURE
Definition: conv.c:47
mpack_unpack_number
MPACK_API double mpack_unpack_number(mpack_token_t t) FUNUSED FPURE
Definition: conv.c:290
mpack_pack_bin
MPACK_API mpack_token_t mpack_pack_bin(mpack_uint32_t l) FUNUSED FPURE
Definition: conv.c:163
mpack_pack_boolean
MPACK_API mpack_token_t mpack_pack_boolean(unsigned v) FUNUSED FPURE
Definition: conv.c:29
mpack_pack_nil
MPACK_API mpack_token_t mpack_pack_nil(void) FUNUSED FPURE
FUNUSED
#define FUNUSED
Definition: mpack_core.h:21
mpack_unpack_float_compat
MPACK_API double mpack_unpack_float_compat(mpack_token_t t) FUNUSED FPURE
Definition: conv.c:227
t
nfa_thread_T * t
Definition: regexp_nfa.c:5069
mpack_pack_ext
MPACK_API mpack_token_t mpack_pack_ext(int type, mpack_uint32_t l) FUNUSED FPURE
Definition: conv.c:171
mpack_pack_array
MPACK_API mpack_token_t mpack_pack_array(mpack_uint32_t l) FUNUSED FPURE
Definition: conv.c:180
mpack_pack_float_fast
MPACK_API mpack_token_t mpack_pack_float_fast(double v) FUNUSED FPURE
Definition: conv.c:79
mpack_pack_uint
MPACK_API mpack_token_t mpack_pack_uint(mpack_uintmax_t v) FUNUSED FPURE
Definition: conv.c:38
l
list_T *const l
Definition: funcs.c:9040
mpack_unpack_float_fast
MPACK_API double mpack_unpack_float_fast(mpack_token_t t) FUNUSED FPURE
Definition: conv.c:266
mpack_uintmax_t
mpack_uint32_t mpack_uintmax_t
Definition: conv.h:14
mpack_token_s
Definition: mpack_core.h:61
mpack_pack_chunk
MPACK_API mpack_token_t mpack_pack_chunk(const char *p, mpack_uint32_t l) FUNUSED FPURE FNONULL
Definition: conv.c:146
MPACK_API
#define MPACK_API
Definition: mpack_core.h:5