mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-06 17:59:52 +00:00
integrate machine-dependent integer serialization routine to msgpack/pack_template.h
git-svn-id: file:///Users/frsyuki/project/msgpack-git/svn/x@90 5a5092ae-2292-43ba-b2d5-dcab9c1a2731
This commit is contained in:
parent
adba617f45
commit
cd973b8483
10 changed files with 468 additions and 272 deletions
|
|
@ -10,6 +10,7 @@ ext/pack.h
|
|||
ext/rbinit.c
|
||||
ext/unpack.c
|
||||
ext/unpack.h
|
||||
msgpack/pack_define.h
|
||||
msgpack/pack_template.h
|
||||
msgpack/unpack_define.h
|
||||
msgpack/unpack_template.h
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ cp rbinit.c gem/ext/
|
|||
cp unpack.c gem/ext/
|
||||
cp unpack.h gem/ext/
|
||||
#cp ../README gem/README.txt
|
||||
cp ../msgpack/pack_define.h gem/msgpack/
|
||||
cp ../msgpack/pack_template.h gem/msgpack/
|
||||
cp ../msgpack/unpack_define.h gem/msgpack/
|
||||
cp ../msgpack/unpack_template.h gem/msgpack/
|
||||
|
|
|
|||
30
ruby/pack.c
30
ruby/pack.c
|
|
@ -16,41 +16,19 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "ruby.h"
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "msgpack/pack_define.h"
|
||||
|
||||
#define msgpack_pack_inline_func(name) \
|
||||
static inline void msgpack_pack_##name
|
||||
|
||||
#define msgpack_pack_inline_func_cint(name) \
|
||||
static inline void msgpack_pack_##name
|
||||
|
||||
#define msgpack_pack_user VALUE
|
||||
|
||||
#define msgpack_pack_append_buffer(user, buf, len) \
|
||||
rb_str_buf_cat(user, (const void*)buf, len)
|
||||
|
||||
/*
|
||||
static void msgpack_pack_int(VALUE x, int d);
|
||||
static void msgpack_pack_unsigned_int(VALUE x, unsigned int d);
|
||||
static void msgpack_pack_long(VALUE x, long d);
|
||||
static void msgpack_pack_unsigned_long(VALUE x, unsigned long d);
|
||||
static void msgpack_pack_uint8(VALUE x, uint8_t d);
|
||||
static void msgpack_pack_uint16(VALUE x, uint16_t d);
|
||||
static void msgpack_pack_uint32(VALUE x, uint32_t d);
|
||||
static void msgpack_pack_uint64(VALUE x, uint64_t d);
|
||||
static void msgpack_pack_int8(VALUE x, int8_t d);
|
||||
static void msgpack_pack_int16(VALUE x, int16_t d);
|
||||
static void msgpack_pack_int32(VALUE x, int32_t d);
|
||||
static void msgpack_pack_int64(VALUE x, int64_t d);
|
||||
static void msgpack_pack_float(VALUE x, float d);
|
||||
static void msgpack_pack_double(VALUE x, double d);
|
||||
static void msgpack_pack_nil(VALUE x);
|
||||
static void msgpack_pack_true(VALUE x);
|
||||
static void msgpack_pack_false(VALUE x);
|
||||
static void msgpack_pack_array(VALUE x, unsigned int n);
|
||||
static void msgpack_pack_map(VALUE x, unsigned int n);
|
||||
static void msgpack_pack_raw(VALUE x, size_t l);
|
||||
static void msgpack_pack_raw_body(VALUE x, const void* b, size_t l);
|
||||
*/
|
||||
|
||||
#include "msgpack/pack_template.h"
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue