aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/doc
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2019-04-03 21:16:59 +0200
committerSverker Eriksson <[email protected]>2019-04-17 19:09:12 +0200
commit6465de7e3a5393a80ed0e2c63f012fd126de706f (patch)
treef85198d2afe765a8f3b7c94ed31b36830346b006 /lib/erl_interface/doc
parent46aa940b9d771c4806aacaf065c2f637474e9815 (diff)
downloadotp-6465de7e3a5393a80ed0e2c63f012fd126de706f.tar.gz
otp-6465de7e3a5393a80ed0e2c63f012fd126de706f.tar.bz2
otp-6465de7e3a5393a80ed0e2c63f012fd126de706f.zip
erl_interface: Add bitstring and export fun support
Diffstat (limited to 'lib/erl_interface/doc')
-rw-r--r--lib/erl_interface/doc/src/ei.xml41
1 files changed, 41 insertions, 0 deletions
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
@@ -183,6 +183,35 @@ typedef enum {
</func>
<func>
+ <name since="OTP @OTP-15712@"><ret>int</ret><nametext>ei_decode_bitstring(const char *buf, int *index, void *p, size_t plen, size_t *bitsp)</nametext></name>
+ <fsummary>Decode a bitstring.</fsummary>
+ <desc>
+ <p>Decodes a bitstring from the binary format.</p>
+ <taglist>
+ <tag><c>p</c></tag>
+ <item><p>Either <c>NULL</c> or points to a buffer where the bytes of the
+ bitstring will be written.</p>
+ </item>
+ <tag><c>plen</c></tag>
+ <item><p>The max size of the bitstring in <em>bytes</em>, that is the
+ size of the buffer if <c>p != NULL</c>.</p>
+ </item>
+ <tag><c>*bitsp</c></tag>
+ <item><p>If <c>bitsp</c> is not <c>NULL</c>, set to the actual
+ number of <em>bits</em> of the bitstring.</p>
+ </item>
+ </taglist>
+ <p>Returns <c>0</c> if it was a bitstring no longer than <c>plen</c>
+ bytes. The actual length of the bitstring will be
+ <c>(*bitsp+7)/8</c> bytes. If <c>(*bitsp % 8) > 0</c> only the high
+ <c>(*bitsp % 8)</c> bits of the last byte are significant.</p>
+ <p>Number of bits may be divisible by 8, which means a binary
+ decodable by <c>ei_decode_binary</c> is also decodable by
+ <c>ei_decode_bitstring</c>.</p>
+ </desc>
+ </func>
+
+ <func>
<name since=""><ret>int</ret><nametext>ei_decode_boolean(const char *buf, int *index, int *p)</nametext></name>
<fsummary>Decode a boolean.</fsummary>
<desc>
@@ -461,6 +490,18 @@ typedef enum {
</func>
<func>
+ <name since="OTP @OTP-15712@"><ret>int</ret><nametext>ei_encode_bitstring(char *buf, int *index, const void *p, size_t bits)</nametext></name>
+ <name since="OTP @OTP-15712@"><ret>int</ret><nametext>ei_x_encode_bitstring(ei_x_buff* x, const void *p, size_t bits)</nametext></name>
+ <fsummary>Encode a bitstring.</fsummary>
+ <desc>
+ <p>Encodes a bitstring in the binary format. The data is at
+ <c>p</c>. The size of the data is <c>bits</c> bits or
+ <c>(bits+7)/8</c> bytes. If <c>(bits%8) > 0</c> only the high
+ <c>(bits%8)</c> bits of the last byte are significant.</p>
+ </desc>
+ </func>
+
+ <func>
<name since=""><ret>int</ret><nametext>ei_encode_boolean(char *buf, int *index, int p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_boolean(ei_x_buff* x, int p)</nametext></name>
<fsummary>Encode a boolean.</fsummary>