From 6465de7e3a5393a80ed0e2c63f012fd126de706f Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 3 Apr 2019 21:16:59 +0200 Subject: erl_interface: Add bitstring and export fun support --- lib/erl_interface/doc/src/ei.xml | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'lib/erl_interface/doc') diff --git a/lib/erl_interface/doc/src/ei.xml b/lib/erl_interface/doc/src/ei.xml index d0d472c42b..254ae27cc8 100644 --- a/lib/erl_interface/doc/src/ei.xml +++ b/lib/erl_interface/doc/src/ei.xml @@ -182,6 +182,35 @@ typedef enum { + + intei_decode_bitstring(const char *buf, int *index, void *p, size_t plen, size_t *bitsp) + Decode a bitstring. + +

Decodes a bitstring from the binary format.

+ + p +

Either NULL or points to a buffer where the bytes of the + bitstring will be written.

+
+ plen +

The max size of the bitstring in bytes, that is the + size of the buffer if p != NULL.

+
+ *bitsp +

If bitsp is not NULL, set to the actual + number of bits of the bitstring.

+
+
+

Returns 0 if it was a bitstring no longer than plen + bytes. The actual length of the bitstring will be + (*bitsp+7)/8 bytes. If (*bitsp % 8) > 0 only the high + (*bitsp % 8) bits of the last byte are significant.

+

Number of bits may be divisible by 8, which means a binary + decodable by ei_decode_binary is also decodable by + ei_decode_bitstring.

+
+
+ intei_decode_boolean(const char *buf, int *index, int *p) Decode a boolean. @@ -460,6 +489,18 @@ typedef enum { + + intei_encode_bitstring(char *buf, int *index, const void *p, size_t bits) + intei_x_encode_bitstring(ei_x_buff* x, const void *p, size_t bits) + Encode a bitstring. + +

Encodes a bitstring in the binary format. The data is at + p. The size of the data is bits bits or + (bits+7)/8 bytes. If (bits%8) > 0 only the high + (bits%8) bits of the last byte are significant.

+
+
+ intei_encode_boolean(char *buf, int *index, int p) intei_x_encode_boolean(ei_x_buff* x, int p) -- cgit v1.2.3