Skip to content

Commit 3113c6f

Browse files
committed
add a comment about ERL types
The two new types are extensions, so this commit adds a comment documenting what these extensions are for (namely so that we can support string encodings over the wire).
1 parent 31ab659 commit 3113c6f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ext/bert/c/decode.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@
1515
#define ERL_BIN 109
1616
#define ERL_SMALL_BIGNUM 110
1717
#define ERL_LARGE_BIGNUM 111
18-
#define ERL_ENC_STRING 112
19-
#define ERL_UNICODE_STRING 113
18+
19+
/* These two types are specific to version 2 of the protocol. They diverge
20+
* from Erlang, but allow us to pass string encodings across the wire. */
21+
#define ERLEXT_ENC_STRING 112
22+
#define ERLEXT_UNICODE_STRING 113
23+
24+
/* Protocol version constants. */
2025
#define ERL_VERSION 131
2126
#define ERL_VERSION2 132
2227

23-
#define BERT_VALID_TYPE(t) ((t) >= ERL_SMALL_INT && (t) <= ERL_UNICODE_STRING)
28+
#define BERT_VALID_TYPE(t) ((t) >= ERL_SMALL_INT && (t) <= ERLEXT_UNICODE_STRING)
2429
#define BERT_TYPE_OFFSET (ERL_SMALL_INT)
2530

2631
static VALUE rb_mBERT;

0 commit comments

Comments
 (0)