vox-etf 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/vox/decoder.hpp +2 -2
- data/ext/vox/encoder.hpp +3 -2
- data/ext/vox/etf.hpp +0 -36
- data/lib/vox/etf/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd3946973c5609f6a44d6f1bc0ea10d3f5ed7095dd0009ddaaa64593c90de538
|
4
|
+
data.tar.gz: 6e50761784880810734201a0d6e4684c2def7b6f4e7de0464ac8e42491768a12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 111a3cc908087690d58e0ac939c3b3d1576d05bfc50fdb457e55eaa0ee54b71f1ae29bfb804e234c98bae047c8809803f5268ab1fddb5808cfff81ed5a492007
|
7
|
+
data.tar.gz: c176eb3b67e1d83d6972eb50e5263f57286a37c1093b47ad3c92f3513f4e1c2902ec4b218dce4e813f004cd4e6d8e8917cdef223f40d1650db4e115c78a85fb6
|
data/ext/vox/decoder.hpp
CHANGED
@@ -156,7 +156,7 @@ namespace etf
|
|
156
156
|
VALUE array = decode_array(length);
|
157
157
|
const uint8_t tail = read8();
|
158
158
|
|
159
|
-
if (tail !=
|
159
|
+
if (tail != NIL_EXT)
|
160
160
|
{
|
161
161
|
rb_raise(rb_eArgError, "List doesn't end with `NIL`, but it must!");
|
162
162
|
return Qnil;
|
@@ -278,7 +278,7 @@ namespace etf
|
|
278
278
|
const uint8_t sign = read8();
|
279
279
|
const char *buff = read_string(length);
|
280
280
|
|
281
|
-
|
281
|
+
int flags = INTEGER_PACK_LITTLE_ENDIAN | (sign * INTEGER_PACK_NEGATIVE);
|
282
282
|
return rb_integer_unpack(buff, length, 1, 0, flags);
|
283
283
|
}
|
284
284
|
|
data/ext/vox/encoder.hpp
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "erlpack/encoder.h"
|
2
|
+
#include "erlpack/constants.h"
|
2
3
|
#include "etf.hpp"
|
3
4
|
|
4
5
|
namespace etf
|
@@ -101,7 +102,7 @@ namespace etf
|
|
101
102
|
{
|
102
103
|
// id byte | n byte | sign byte | data
|
103
104
|
uint8_t buff[3 + byte_count];
|
104
|
-
buff[0] =
|
105
|
+
buff[0] = SMALL_BIG_EXT;
|
105
106
|
buff[1] = byte_count;
|
106
107
|
buff[2] = FIX2LONG(bignum) >= 0 ? 0 : 1;
|
107
108
|
rb_integer_pack(bignum, buff + 3, byte_count, sizeof(uint8_t), 0, INTEGER_PACK_LITTLE_ENDIAN);
|
@@ -111,7 +112,7 @@ namespace etf
|
|
111
112
|
{
|
112
113
|
// id byte | 4 byte n | sign byte | data
|
113
114
|
uint8_t buff[6 + byte_count];
|
114
|
-
buff[0] =
|
115
|
+
buff[0] = LARGE_BIG_EXT;
|
115
116
|
_erlpack_store32(buff + 1, byte_count);
|
116
117
|
buff[5] = RBIGNUM_SIGN(bignum) ? 0 : 1;
|
117
118
|
rb_integer_pack(bignum, buff + 6, byte_count, sizeof(uint8_t), 0, INTEGER_PACK_LITTLE_ENDIAN);
|
data/ext/vox/etf.hpp
CHANGED
@@ -2,42 +2,6 @@
|
|
2
2
|
|
3
3
|
#define ETF_VERSION 131
|
4
4
|
|
5
|
-
// Term IDs, first byte of any term.
|
6
|
-
enum term
|
7
|
-
{
|
8
|
-
new_float = 70,
|
9
|
-
bit_binary = 77,
|
10
|
-
atom_cache = 82,
|
11
|
-
new_pid = 88,
|
12
|
-
new_port = 89,
|
13
|
-
newer_reference = 90,
|
14
|
-
small_integer = 97,
|
15
|
-
integer = 98,
|
16
|
-
// annoying
|
17
|
-
etf_float = 99,
|
18
|
-
atom = 100,
|
19
|
-
reference = 101,
|
20
|
-
port = 102,
|
21
|
-
pid = 103,
|
22
|
-
small_tuple = 104,
|
23
|
-
large_tuple = 105,
|
24
|
-
nil = 106,
|
25
|
-
string = 107,
|
26
|
-
list = 108,
|
27
|
-
binary = 109,
|
28
|
-
small_big = 110,
|
29
|
-
large_big = 111,
|
30
|
-
new_fun = 112,
|
31
|
-
// annoying
|
32
|
-
etf_export = 113,
|
33
|
-
new_reference = 114,
|
34
|
-
small_atom = 115,
|
35
|
-
map = 116,
|
36
|
-
fun = 117,
|
37
|
-
atom_utf8 = 118,
|
38
|
-
small_atom_utf8 = 119
|
39
|
-
};
|
40
|
-
|
41
5
|
VALUE decode(VALUE self, VALUE input);
|
42
6
|
VALUE encode(VALUE self, VALUE input);
|
43
7
|
|
data/lib/vox/etf/version.rb
CHANGED