Permalink
Browse files

Generate spec/tag changes appropriately

To be squashed with previous commit ultimately.
  • Loading branch information...
1 parent 6e19519 commit 1dd48ff66a5356970762aac217a05d7a17b44d85 @tsee tsee committed Dec 18, 2013
Showing with 35 additions and 30 deletions.
  1. +5 −3 Java/src/com/booking/sereal/SerealHeader.java
  2. +8 −8 Perl/Decoder/srl_decoder.h
  3. +15 −12 Perl/shared/srl_protocol.h
  4. +7 −7 sereal_spec.pod
@@ -39,12 +39,14 @@
static final byte SRL_HDR_COPY = (byte) 47; /* 47 0x2f 0b00101111 <OFFSET-VARINT> - copy of item defined at offset */
static final byte SRL_HDR_WEAKEN = (byte) 48; /* 48 0x30 0b00110000 <REF-TAG> - Weaken the following reference */
static final byte SRL_HDR_REGEXP = (byte) 49; /* 49 0x31 0b00110001 <PATTERN-STR-TAG> <MODIFIERS-STR-TAG> */
- static final byte SRL_HDR_RESERVED = (byte) 50; /* 50 0x32 0b00110010 reserved */
- static final byte SRL_HDR_RESERVED_LOW = (byte) 50; /* 50 0x32 0b00110010 reserved */
+ static final byte SRL_HDR_OBJECT_FREEZE = (byte) 50; /* 50 0x32 0b00110010 <STR-TAG> <ITEM-TAG> - class, object-item. Need to call "THAW" method on class after decoding */
+ static final byte SRL_HDR_OBJECTV_FREEZE = (byte) 51; /* 51 0x33 0b00110011 <OFFSET-VARINT> <ITEM-TAG> - (OBJECTV_FREEZE is to OBJECT_FREEZE as OBJECTV is to OBJECT) */
+ static final byte SRL_HDR_RESERVED = (byte) 52; /* 52 0x34 0b00110100 reserved */
+ static final byte SRL_HDR_RESERVED_LOW = (byte) 52; /* 52 0x34 0b00110100 reserved */
static final byte SRL_HDR_RESERVED_HIGH = (byte) 57; /* 57 0x39 0b00111001 reserved */
static final byte SRL_HDR_FALSE = (byte) 58; /* 58 0x3a 0b00111010 false (PL_sv_no) */
static final byte SRL_HDR_TRUE = (byte) 59; /* 59 0x3b 0b00111011 true (PL_sv_yes) */
- static final byte SRL_HDR_MANY = (byte) 60; /* 60 0x3c 0b00111100 <LEN-VARINT> <TYPE-BYTE> <TAG-DATA> - repeated tag (not done yet, will be implemented in version 2) */
+ static final byte SRL_HDR_MANY = (byte) 60; /* 60 0x3c 0b00111100 <LEN-VARINT> <TYPE-BYTE> <TAG-DATA> - repeated tag (not done yet, will be implemented in version 3) */
static final byte SRL_HDR_PACKET_START = (byte) 61; /* 61 0x3d 0b00111101 (first byte of magic string in header) */
static final byte SRL_HDR_EXTEND = (byte) 62; /* 62 0x3e 0b00111110 <BYTE> - for additional tags */
static final byte SRL_HDR_PAD = (byte) 63; /* 63 0x3f 0b00111111 (ignored tag, skip to next byte) */
View
@@ -171,14 +171,14 @@ static const char * const tag_name[] = {
"COPY", /* "/" 47 0x2f 0b00101111 */
"WEAKEN", /* "0" 48 0x30 0b00110000 */
"REGEXP", /* "1" 49 0x31 0b00110001 */
- "RESERVED_0", /* "2" 50 0x32 0b00110010 */
- "RESERVED_1", /* "3" 51 0x33 0b00110011 */
- "RESERVED_2", /* "4" 52 0x34 0b00110100 */
- "RESERVED_3", /* "5" 53 0x35 0b00110101 */
- "RESERVED_4", /* "6" 54 0x36 0b00110110 */
- "RESERVED_5", /* "7" 55 0x37 0b00110111 */
- "RESERVED_6", /* "8" 56 0x38 0b00111000 */
- "RESERVED_7", /* "9" 57 0x39 0b00111001 */
+ "OBJECT_FREEZE", /* "2" 50 0x32 0b00110010 */
+ "OBJECTV_FREEZE", /* "3" 51 0x33 0b00110011 */
+ "RESERVED_0", /* "4" 52 0x34 0b00110100 */
+ "RESERVED_1", /* "5" 53 0x35 0b00110101 */
+ "RESERVED_2", /* "6" 54 0x36 0b00110110 */
+ "RESERVED_3", /* "7" 55 0x37 0b00110111 */
+ "RESERVED_4", /* "8" 56 0x38 0b00111000 */
+ "RESERVED_5", /* "9" 57 0x39 0b00111001 */
"FALSE", /* ":" 58 0x3a 0b00111010 */
"TRUE", /* ";" 59 0x3b 0b00111011 */
"MANY", /* "<" 60 0x3c 0b00111100 */
View
@@ -57,17 +57,17 @@
COPY | "/" | 47 | 0x2f | 0b00101111 | <OFFSET-VARINT> - copy of item defined at offset
WEAKEN | "0" | 48 | 0x30 | 0b00110000 | <REF-TAG> - Weaken the following reference
REGEXP | "1" | 49 | 0x31 | 0b00110001 | <PATTERN-STR-TAG> <MODIFIERS-STR-TAG>
- RESERVED_0 | "2" | 50 | 0x32 | 0b00110010 | reserved
- RESERVED_1 | "3" | 51 | 0x33 | 0b00110011 |
- RESERVED_2 | "4" | 52 | 0x34 | 0b00110100 |
- RESERVED_3 | "5" | 53 | 0x35 | 0b00110101 |
- RESERVED_4 | "6" | 54 | 0x36 | 0b00110110 |
- RESERVED_5 | "7" | 55 | 0x37 | 0b00110111 |
- RESERVED_6 | "8" | 56 | 0x38 | 0b00111000 |
- RESERVED_7 | "9" | 57 | 0x39 | 0b00111001 | reserved
+ OBJECT_FREEZE | "2" | 50 | 0x32 | 0b00110010 | <STR-TAG> <ITEM-TAG> - class, object-item. Need to call "THAW" method on class after decoding
+ OBJECTV_FREEZE | "3" | 51 | 0x33 | 0b00110011 | <OFFSET-VARINT> <ITEM-TAG> - (OBJECTV_FREEZE is to OBJECT_FREEZE as OBJECTV is to OBJECT)
+ RESERVED_0 | "4" | 52 | 0x34 | 0b00110100 | reserved
+ RESERVED_1 | "5" | 53 | 0x35 | 0b00110101 |
+ RESERVED_2 | "6" | 54 | 0x36 | 0b00110110 |
+ RESERVED_3 | "7" | 55 | 0x37 | 0b00110111 |
+ RESERVED_4 | "8" | 56 | 0x38 | 0b00111000 |
+ RESERVED_5 | "9" | 57 | 0x39 | 0b00111001 | reserved
FALSE | ":" | 58 | 0x3a | 0b00111010 | false (PL_sv_no)
TRUE | ";" | 59 | 0x3b | 0b00111011 | true (PL_sv_yes)
- MANY | "<" | 60 | 0x3c | 0b00111100 | <LEN-VARINT> <TYPE-BYTE> <TAG-DATA> - repeated tag (not done yet, will be implemented in version 2)
+ MANY | "<" | 60 | 0x3c | 0b00111100 | <LEN-VARINT> <TYPE-BYTE> <TAG-DATA> - repeated tag (not done yet, will be implemented in version 3)
PACKET_START | "=" | 61 | 0x3d | 0b00111101 | (first byte of magic string in header)
EXTEND | ">" | 62 | 0x3e | 0b00111110 | <BYTE> - for additional tags
PAD | "?" | 63 | 0x3f | 0b00111111 | (ignored tag, skip to next byte)
@@ -195,16 +195,19 @@
#define SRL_HDR_WEAKEN ((char)48) /* <REF-TAG> - Weaken the following reference */
#define SRL_HDR_REGEXP ((char)49) /* <PATTERN-STR-TAG> <MODIFIERS-STR-TAG>*/
+#define SRL_HDR_OBJECT_FREEZE ((char)50) /* <STR-TAG> <ITEM-TAG> - class, object-item. Need to call "THAW" method on class after decoding */
+#define SRL_HDR_OBJECTV_FREEZE ((char)51) /* <OFFSET-VARINT> <ITEM-TAG> - (OBJECTV_FREEZE is to OBJECT_FREEZE as OBJECTV is to OBJECT) */
+
/* Note: Can do reserved check with a range now, but as we start using
* them, might have to explicit == check later. */
-#define SRL_HDR_RESERVED ((char)50) /* reserved */
-#define SRL_HDR_RESERVED_LOW ((char)50)
+#define SRL_HDR_RESERVED ((char)52) /* reserved */
+#define SRL_HDR_RESERVED_LOW ((char)52)
#define SRL_HDR_RESERVED_HIGH ((char)57)
#define SRL_HDR_FALSE ((char)58) /* false (PL_sv_no) */
#define SRL_HDR_TRUE ((char)59) /* true (PL_sv_yes) */
-#define SRL_HDR_MANY ((char)60) /* <LEN-VARINT> <TYPE-BYTE> <TAG-DATA> - repeated tag (not done yet, will be implemented in version 2) */
+#define SRL_HDR_MANY ((char)60) /* <LEN-VARINT> <TYPE-BYTE> <TAG-DATA> - repeated tag (not done yet, will be implemented in version 3) */
#define SRL_HDR_PACKET_START ((char)61) /* (first byte of magic string in header) */
View
@@ -247,15 +247,15 @@ header.
REGEXP | "1" | 49 | 0x31 | 0b00110001 | <PATTERN-STR-TAG> <MODIFIERS-STR-TAG>
OBJECT_FREEZE | "2" | 50 | 0x32 | 0b00110010 | <STR-TAG> <ITEM-TAG> - class, object-item. Need to call "THAW" method on class after decoding
OBJECTV_FREEZE | "3" | 51 | 0x33 | 0b00110011 | <OFFSET-VARINT> <ITEM-TAG> - (OBJECTV_FREEZE is to OBJECT_FREEZE as OBJECTV is to OBJECT)
- RESERVED_2 | "4" | 52 | 0x34 | 0b00110100 | reserved
- RESERVED_3 | "5" | 53 | 0x35 | 0b00110101 | reserved
- RESERVED_4 | "6" | 54 | 0x36 | 0b00110110 | reserved
- RESERVED_5 | "7" | 55 | 0x37 | 0b00110111 | reserved
- RESERVED_6 | "8" | 56 | 0x38 | 0b00111000 | reserved
- RESERVED_7 | "9" | 57 | 0x39 | 0b00111001 | reserved
+ RESERVED_0 | "4" | 52 | 0x34 | 0b00110100 | reserved
+ RESERVED_1 | "5" | 53 | 0x35 | 0b00110101 |
+ RESERVED_2 | "6" | 54 | 0x36 | 0b00110110 |
+ RESERVED_3 | "7" | 55 | 0x37 | 0b00110111 |
+ RESERVED_4 | "8" | 56 | 0x38 | 0b00111000 |
+ RESERVED_5 | "9" | 57 | 0x39 | 0b00111001 | reserved
FALSE | ":" | 58 | 0x3a | 0b00111010 | false (PL_sv_no)
TRUE | ";" | 59 | 0x3b | 0b00111011 | true (PL_sv_yes)
- MANY | "<" | 60 | 0x3c | 0b00111100 | <LEN-VARINT> <TYPE-BYTE> <TAG-DATA> - repeated tag (not done yet, may be implemented in version 3)
+ MANY | "<" | 60 | 0x3c | 0b00111100 | <LEN-VARINT> <TYPE-BYTE> <TAG-DATA> - repeated tag (not done yet, will be implemented in version 3)
PACKET_START | "=" | 61 | 0x3d | 0b00111101 | (first byte of magic string in header)
EXTEND | ">" | 62 | 0x3e | 0b00111110 | <BYTE> - for additional tags
PAD | "?" | 63 | 0x3f | 0b00111111 | (ignored tag, skip to next byte)

0 comments on commit 1dd48ff

Please sign in to comment.