| 1 |
/* |
| 2 |
* MessagePack unpacking routine template |
| 3 |
* |
| 4 |
* Copyright (C) 2008-2010 FURUHASHI Sadayuki |
| 5 |
* |
| 6 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 |
* you may not use this file except in compliance with the License. |
| 8 |
* You may obtain a copy of the License at |
| 9 |
* |
| 10 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 11 |
* |
| 12 |
* Unless required by applicable law or agreed to in writing, software |
| 13 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 14 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 |
* See the License for the specific language governing permissions and |
| 16 |
* limitations under the License. |
| 17 |
*/ |
| 18 |
#ifndef MSGPACK_UNPACK_DEFINE_H__ |
| 19 |
#define MSGPACK_UNPACK_DEFINE_H__ |
| 20 |
|
| 21 |
#include "msgpack/sysdep.h" |
| 22 |
#include <stdlib.h> |
| 23 |
#include <string.h> |
| 24 |
#include <assert.h> |
| 25 |
#include <stdio.h> |
| 26 |
|
| 27 |
#ifdef __cplusplus |
| 28 |
extern "C" { |
| 29 |
#endif |
| 30 |
|
| 31 |
|
| 32 |
#ifndef MSGPACK_EMBED_STACK_SIZE |
| 33 |
#define MSGPACK_EMBED_STACK_SIZE 32 |
| 34 |
#endif |
| 35 |
|
| 36 |
|
| 37 |
// CS is first byte & 0x1f |
| 38 |
typedef enum { |
| 39 |
CS_HEADER = 0x00, // nil |
| 40 |
|
| 41 |
//CS_ = 0x01, |
| 42 |
//CS_ = 0x02, // false |
| 43 |
//CS_ = 0x03, // true |
| 44 |
|
| 45 |
CS_BIN_8 = 0x04, |
| 46 |
CS_BIN_16 = 0x05, |
| 47 |
CS_BIN_32 = 0x06, |
| 48 |
|
| 49 |
CS_EXT_8 = 0x07, |
| 50 |
CS_EXT_16 = 0x08, |
| 51 |
CS_EXT_32 = 0x09, |
| 52 |
|
| 53 |
CS_FLOAT = 0x0a, |
| 54 |
CS_DOUBLE = 0x0b, |
| 55 |
CS_UINT_8 = 0x0c, |
| 56 |
CS_UINT_16 = 0x0d, |
| 57 |
CS_UINT_32 = 0x0e, |
| 58 |
CS_UINT_64 = 0x0f, |
| 59 |
CS_INT_8 = 0x10, |
| 60 |
CS_INT_16 = 0x11, |
| 61 |
CS_INT_32 = 0x12, |
| 62 |
CS_INT_64 = 0x13, |
| 63 |
|
| 64 |
//CS_FIXEXT1 = 0x14, |
| 65 |
//CS_FIXEXT2 = 0x15, |
| 66 |
//CS_FIXEXT4 = 0x16, |
| 67 |
//CS_FIXEXT8 = 0x17, |
| 68 |
//CS_FIXEXT16 = 0x18, |
| 69 |
|
| 70 |
CS_RAW_8 = 0x19, |
| 71 |
CS_RAW_16 = 0x1a, |
| 72 |
CS_RAW_32 = 0x1b, |
| 73 |
CS_ARRAY_16 = 0x1c, |
| 74 |
CS_ARRAY_32 = 0x1d, |
| 75 |
CS_MAP_16 = 0x1e, |
| 76 |
CS_MAP_32 = 0x1f, |
| 77 |
|
| 78 |
ACS_RAW_VALUE, |
| 79 |
ACS_BIN_VALUE, |
| 80 |
ACS_EXT_VALUE, |
| 81 |
} msgpack_unpack_state; |
| 82 |
|
| 83 |
|
| 84 |
typedef enum { |
| 85 |
CT_ARRAY_ITEM, |
| 86 |
CT_MAP_KEY, |
| 87 |
CT_MAP_VALUE, |
| 88 |
} msgpack_container_type; |
| 89 |
|
| 90 |
|
| 91 |
#ifdef __cplusplus |
| 92 |
} |
| 93 |
#endif |
| 94 |
|
| 95 |
#endif /* msgpack/unpack_define.h */ |