summaryrefslogtreecommitdiff
path: root/lib/erl_interface
diff options
context:
space:
mode:
authorRickard Green <rickard@erlang.org>2020-05-05 15:01:05 +0200
committerRickard Green <rickard@erlang.org>2020-05-05 15:01:05 +0200
commit8a8f2f071999d0f79b9946c1f8d4aaad1fa6a984 (patch)
tree3a36a174a829aa7ba83caa2780e4533fc052176e /lib/erl_interface
parentafa1e373909dcadd1b4ee7f8da34d86ecadc2510 (diff)
parent4ce63b6b7f4a39656afb94c4760d0f2a9dea010a (diff)
downloaderlang-8a8f2f071999d0f79b9946c1f8d4aaad1fa6a984.tar.gz
Merge branch 'rickard/ei-doc/OTP-16633'
* rickard/ei-doc/OTP-16633: Further erl_interface doc improvements
Diffstat (limited to 'lib/erl_interface')
-rw-r--r--lib/erl_interface/doc/src/ei.xml223
-rw-r--r--lib/erl_interface/doc/src/ei_connect.xml238
-rw-r--r--lib/erl_interface/doc/src/ei_global.xml16
3 files changed, 396 insertions, 81 deletions
diff --git a/lib/erl_interface/doc/src/ei.xml b/lib/erl_interface/doc/src/ei.xml
index 7138b3279a..a7afa1f84b 100644
--- a/lib/erl_interface/doc/src/ei.xml
+++ b/lib/erl_interface/doc/src/ei.xml
@@ -100,6 +100,29 @@
<section>
<title>Data Types</title>
<taglist>
+ <tag><marker id="ei_term"/><c>ei_term</c></tag>
+ <item>
+ <code type="none">
+typedef struct {
+ char ei_type;
+ int arity;
+ int size;
+ union {
+ long i_val;
+ double d_val;
+ char atom_name[MAXATOMLEN_UTF8];
+ erlang_pid pid;
+ erlang_port port;
+ erlang_ref ref;
+ } value;
+} ei_term;</code>
+ <p>Structure written by
+ <seecref marker="#ei_decode_ei_term"><c>ei_decode_ei_term()</c></seecref>.
+ The <c>ei_type</c> field is the type of the term which equals to
+ what <seecref marker="#ei_get_type"><c>ei_get_type()</c></seecref>
+ sets <c>*type</c> to.
+ </p>
+ </item>
<tag><marker id="ei_x_buff"/><c>ei_x_buff</c></tag>
<item>
<p>A dynamically resized buffer. It is a <c>struct</c> with
@@ -141,6 +164,26 @@ typedef enum {
Notice that these constants are bit-flags and can be combined with
bitwise OR.</p>
</item>
+ <tag><marker id="erlang_fun"/><c>erlang_fun</c></tag>
+ <item>
+ <p>Opaque data type representing an Erlang fun.</p>
+ </item>
+ <tag><marker id="erlang_pid"/><c>erlang_pid</c></tag>
+ <item>
+ <p>Opaque data type representing an Erlang process identifier.</p>
+ </item>
+ <tag><marker id="erlang_port"/><c>erlang_port</c></tag>
+ <item>
+ <p>Opaque data type representing an Erlang port identifier.</p>
+ </item>
+ <tag><marker id="erlang_ref"/><c>erlang_ref</c></tag>
+ <item>
+ <p>Opaque data type representing an Erlang reference.</p>
+ </item>
+ <tag><marker id="erlang_trace"/><c>erlang_trace</c></tag>
+ <item>
+ <p>Opaque data type representing an Erlang sequential trace token.</p>
+ </item>
</taglist>
</section>
@@ -148,6 +191,9 @@ typedef enum {
<func>
<name since="OTP @OTP-16594@"><ret>int</ret><nametext>ei_cmp_pids(erlang_pid *a, erlang_pid *b)</nametext></name>
<fsummary>Compare two pids.</fsummary>
+ <type>
+ <v><seecref marker="#erlang_pid"><c>erlang_pid</c></seecref></v>
+ </type>
<desc>
<p>
Compare two process identifiers. The comparison is done the same way
@@ -165,6 +211,9 @@ typedef enum {
<func>
<name since="OTP @OTP-16594@"><ret>int</ret><nametext>ei_cmp_ports(erlang_port *a, erlang_port *b)</nametext></name>
<fsummary>Compare two ports.</fsummary>
+ <type>
+ <v><seecref marker="#erlang_port"><c>erlang_port</c></seecref></v>
+ </type>
<desc>
<p>
Compare two port identifiers. The comparison is done the same way as
@@ -182,6 +231,9 @@ typedef enum {
<func>
<name since="OTP @OTP-16594@"><ret>int</ret><nametext>ei_cmp_refs(erlang_ref *a, erlang_ref *b)</nametext></name>
<fsummary>Compare two references.</fsummary>
+ <type>
+ <v><seecref marker="#erlang_ref"><c>erlang_ref</c></seecref></v>
+ </type>
<desc>
<p>
Compare two references. The comparison is done the same way as Erlang
@@ -209,6 +261,9 @@ typedef enum {
<func>
<name since="OTP R16B"><ret>int</ret><nametext>ei_decode_atom_as(const char *buf, int *index, char *p, int plen, erlang_char_encoding want, erlang_char_encoding* was, erlang_char_encoding* result)</nametext></name>
<fsummary>Decode an atom.</fsummary>
+ <type>
+ <v><seecref marker="#erlang_char_encoding"><c>erlang_char_encoding</c></seecref></v>
+ </type>
<desc>
<p>Decodes an atom from the binary format. The <c>NULL</c>-terminated
name of the atom is placed in buffer at <c>p</c> of length <c>plen</c>
@@ -325,6 +380,9 @@ typedef enum {
<func>
<name since=""><ret>int</ret><nametext>ei_decode_ei_term(const char* buf, int* index, ei_term* term)</nametext></name>
<fsummary>Decode a term, without previous knowledge of type.</fsummary>
+ <type>
+ <v><seecref marker="#ei_term"><c>ei_term</c></seecref></v>
+ </type>
<desc>
<p>Decodes any term, or at least tries to. If the term
pointed at by <c>*index</c> in <c>buf</c> fits
@@ -347,6 +405,9 @@ typedef enum {
<name since=""><ret>int</ret><nametext>ei_decode_fun(const char *buf, int *index, erlang_fun *p)</nametext></name>
<name since=""><ret>void</ret><nametext>free_fun(erlang_fun* f)</nametext></name>
<fsummary>Decode a fun.</fsummary>
+ <type>
+ <v><seecref marker="#erlang_fun"><c>erlang_fun</c></seecref></v>
+ </type>
<desc>
<p>Decodes a fun from the binary format. Parameter
<c>p</c> is to be <c>NULL</c> or point to an
@@ -362,7 +423,7 @@ typedef enum {
<name since="OTP @OTP-16594@"><ret>int</ret><nametext>ei_decode_iodata(const char *buf, int *index, int *size, char *outbuf)</nametext></name>
<fsummary>Decode iodata().</fsummary>
<desc>
- <p>Decodes a term of the type <seeguide marker="system/reference_manual:typespec#types-and-their-syntax"><c>iodata()</c></seeguide>. The <c>iodata()</c> term will be
+ <p>Decodes a term of the type <seeguide marker="system/reference_manual:typespec#builtin_types"><c>iodata()</c></seeguide>. The <c>iodata()</c> term will be
flattened an written into the buffer pointed to by the <c>outbuf</c>
argument. The byte size of the <c>iodata</c> is written into the
integer variable pointed to by the <c>size</c> argument. Both <c>size</c>
@@ -422,8 +483,7 @@ typedef enum {
<desc>
<p>Decodes a GCC <c>long long</c> or Visual C++
<c>__int64</c>
- (64-bit) integer from the binary format. This
- function is missing in the VxWorks port.</p>
+ (64-bit) integer from the binary format.</p>
</desc>
</func>
@@ -443,6 +503,9 @@ typedef enum {
<func>
<name since=""><ret>int</ret><nametext>ei_decode_pid(const char *buf, int *index, erlang_pid *p)</nametext></name>
<fsummary>Decode a <c>pid</c>.</fsummary>
+ <type>
+ <v><seecref marker="#erlang_pid"><c>erlang_pid</c></seecref></v>
+ </type>
<desc>
<p>Decodes a process identifier (pid) from the binary format.</p>
</desc>
@@ -451,6 +514,9 @@ typedef enum {
<func>
<name since=""><ret>int</ret><nametext>ei_decode_port(const char *buf, int *index, erlang_port *p)</nametext></name>
<fsummary>Decode a port.</fsummary>
+ <type>
+ <v><seecref marker="#erlang_port"><c>erlang_port</c></seecref></v>
+ </type>
<desc>
<p>Decodes a port identifier from the binary format.</p>
</desc>
@@ -459,6 +525,9 @@ typedef enum {
<func>
<name since=""><ret>int</ret><nametext>ei_decode_ref(const char *buf, int *index, erlang_ref *p)</nametext></name>
<fsummary>Decode a reference.</fsummary>
+ <type>
+ <v><seecref marker="#erlang_ref"><c>erlang_ref</c></seecref></v>
+ </type>
<desc>
<p>Decodes a reference from the binary format.</p>
</desc>
@@ -482,6 +551,9 @@ typedef enum {
<func>
<name since=""><ret>int</ret><nametext>ei_decode_trace(const char *buf, int *index, erlang_trace *p)</nametext></name>
<fsummary>Decode a trace token.</fsummary>
+ <type>
+ <v><seecref marker="#erlang_trace"><c>erlang_trace</c></seecref></v>
+ </type>
<desc>
<p>Decodes an Erlang trace token from the binary format.</p>
</desc>
@@ -513,7 +585,7 @@ typedef enum {
<desc>
<p>Decodes a GCC <c>unsigned long long</c> or Visual C++
<c>unsigned __int64</c> (64-bit) integer from the binary
- format. This function is missing in the VxWorks port.</p>
+ format.</p>
</desc>
</func>
@@ -533,6 +605,9 @@ typedef enum {
<name since=""><ret>int</ret><nametext>ei_x_encode_atom(ei_x_buff* x, const char *p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_atom_len(ei_x_buff* x, const char *p, int len)</nametext></name>
<fsummary>Encode an atom.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes an atom in the binary format. Parameter <c>p</c>
is the name of the atom in Latin-1 encoding. Only up to
@@ -548,6 +623,10 @@ typedef enum {
<name since="OTP R16B"><ret>int</ret><nametext>ei_x_encode_atom_as(ei_x_buff* x, const char *p, erlang_char_encoding from_enc, erlang_char_encoding to_enc)</nametext></name>
<name since="OTP R16B"><ret>int</ret><nametext>ei_x_encode_atom_len_as(ei_x_buff* x, const char *p, int len, erlang_char_encoding from_enc, erlang_char_encoding to_enc)</nametext></name>
<fsummary>Encode an atom.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ <v><seecref marker="#erlang_char_encoding"><c>erlang_char_encoding</c></seecref></v>
+ </type>
<desc>
<p>Encodes an atom in the binary format. Parameter <c>p</c> is the name of the atom with
character encoding
@@ -566,6 +645,9 @@ typedef enum {
<name since=""><ret>int</ret><nametext>ei_encode_bignum(char *buf, int *index, mpz_t obj)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_bignum(ei_x_buff *x, mpz_t obj)</nametext></name>
<fsummary>Encode an arbitrary precision integer.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a GMP <c>mpz_t</c> integer to binary format.
To use this function, the <c>ei</c> library must be configured and
@@ -577,6 +659,9 @@ typedef enum {
<name since=""><ret>int</ret><nametext>ei_encode_binary(char *buf, int *index, const void *p, long len)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_binary(ei_x_buff* x, const void *p, long len)</nametext></name>
<fsummary>Encode a binary.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a binary in the binary format. The data is at
<c>p</c>, of <c>len</c> bytes length.</p>
@@ -589,6 +674,9 @@ typedef enum {
<name since="OTP 22.0"><ret>int</ret>
<nametext>ei_x_encode_bitstring(ei_x_buff* x, const char *p, size_t bitoffs, size_t nbits)</nametext></name>
<fsummary>Encode a bitstring.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a bit string in the binary format.</p>
<p>The data is at <c>p</c>. The length of the bit string is <c>nbits</c>
@@ -609,6 +697,9 @@ typedef enum {
<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>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a boolean value as the atom <c>true</c> if
<c>p</c> is not zero, or <c>false</c> if <c>p</c> is
@@ -620,6 +711,9 @@ typedef enum {
<name since=""><ret>int</ret><nametext>ei_encode_char(char *buf, int *index, char p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_char(ei_x_buff* x, char p)</nametext></name>
<fsummary>Encode an 8-bit integer between 0-255.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a char (8-bit) as an integer between 0-255 in the binary
format. For historical reasons the integer argument is of
@@ -634,6 +728,9 @@ typedef enum {
<name since=""><ret>int</ret><nametext>ei_encode_double(char *buf, int *index, double p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_double(ei_x_buff* x, double p)</nametext></name>
<fsummary>Encode a double float.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a double-precision (64-bit) floating point number in
the binary format.</p>
@@ -646,6 +743,9 @@ typedef enum {
<name since=""><ret>int</ret><nametext>ei_encode_empty_list(char* buf, int* index)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_empty_list(ei_x_buff* x)</nametext></name>
<fsummary>Encode an empty list (<c>nil</c>).</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes an empty list. It is often used at the tail of a list.</p>
</desc>
@@ -655,6 +755,10 @@ typedef enum {
<name since=""><ret>int</ret><nametext>ei_encode_fun(char *buf, int *index, const erlang_fun *p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_fun(ei_x_buff* x, const erlang_fun* fun)</nametext></name>
<fsummary>Encode a fun.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ <v><seecref marker="#erlang_fun"><c>erlang_fun</c></seecref></v>
+ </type>
<desc>
<p>Encodes a fun in the binary format. Parameter <c>p</c>
points to an <c>erlang_fun</c> structure. The
@@ -668,6 +772,9 @@ typedef enum {
<name since=""><ret>int</ret><nametext>ei_encode_list_header(char *buf, int *index, int arity)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_list_header(ei_x_buff* x, int arity)</nametext></name>
<fsummary>Encode a list.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a list header, with a specified
arity. The next <c>arity+1</c> terms are the elements
@@ -705,6 +812,9 @@ ei_x_encode_empty_list(&amp;x);</pre>
<name since=""><ret>int</ret><nametext>ei_encode_long(char *buf, int *index, long p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_long(ei_x_buff* x, long p)</nametext></name>
<fsummary>Encode integer.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a long integer in the binary format.
If the code is 64 bits, the function <c>ei_encode_long()</c> is
@@ -716,10 +826,12 @@ ei_x_encode_empty_list(&amp;x);</pre>
<name since=""><ret>int</ret><nametext>ei_encode_longlong(char *buf, int *index, long long p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_longlong(ei_x_buff* x, long long p)</nametext></name>
<fsummary>Encode integer.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a GCC <c>long long</c> or Visual C++
- <c>__int64</c> (64-bit) integer in the binary format.
- This function is missing in the VxWorks port.</p>
+ <c>__int64</c> (64-bit) integer in the binary format.</p>
</desc>
</func>
@@ -727,6 +839,9 @@ ei_x_encode_empty_list(&amp;x);</pre>
<name since="OTP 17.0"><ret>int</ret><nametext>ei_encode_map_header(char *buf, int *index, int arity)</nametext></name>
<name since="OTP 17.0"><ret>int</ret><nametext>ei_x_encode_map_header(ei_x_buff* x, int arity)</nametext></name>
<fsummary>Encode a map.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a map header, with a specified arity. The next
<c>arity*2</c> terms encoded will be the keys and values of the map
@@ -748,11 +863,20 @@ ei_x_encode_string(&amp;x, "Banana");</pre>
<name since=""><ret>int</ret><nametext>ei_encode_pid(char *buf, int *index, const erlang_pid *p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_pid(ei_x_buff* x, const erlang_pid *p)</nametext></name>
<fsummary>Encode a pid.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ <v><seecref marker="#erlang_pid"><c>erlang_pid</c></seecref></v>
+ </type>
<desc>
<p>Encodes an Erlang process identifier (pid) in the binary
format. Parameter <c>p</c> points to an
- <c>erlang_pid</c> structure (which should have been
- obtained earlier with <c>ei_decode_pid()</c>).</p>
+ <c>erlang_pid</c> structure which should either have been
+ obtained earlier with
+ <seecref marker="#ei_decode_pid"><c>ei_decode_pid()</c></seecref>,
+ <seecref marker="ei_connect#ei_self"><c>ei_self()</c></seecref> or
+ created by
+ <seecref marker="ei_connect#ei_make_pid"><c>ei_make_pid()</c></seecref>.
+ </p>
</desc>
</func>
@@ -760,11 +884,16 @@ ei_x_encode_string(&amp;x, "Banana");</pre>
<name since=""><ret>int</ret><nametext>ei_encode_port(char *buf, int *index, const erlang_port *p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_port(ei_x_buff* x, const erlang_port *p)</nametext></name>
<fsummary>Encode a port.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ <v><seecref marker="#erlang_port"><c>erlang_port</c></seecref></v>
+ </type>
<desc>
<p>Encodes an Erlang port in the binary format. Parameter
- <c>p</c> points to a <c>erlang_port</c>
- structure (which should have been obtained earlier with
- <c>ei_decode_port()</c>).</p>
+ <c>p</c> points to an <c>erlang_port</c> structure which
+ should have been obtained earlier with
+ <seecref marker="#ei_decode_port"><c>ei_decode_port()</c></seecref>,
+ </p>
</desc>
</func>
@@ -772,11 +901,17 @@ ei_x_encode_string(&amp;x, "Banana");</pre>
<name since=""><ret>int</ret><nametext>ei_encode_ref(char *buf, int *index, const erlang_ref *p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_ref(ei_x_buff* x, const erlang_ref *p)</nametext></name>
<fsummary>Encode a ref.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ <v><seecref marker="#erlang_ref"><c>erlang_ref</c></seecref></v>
+ </type>
<desc>
<p>Encodes an Erlang reference in the binary format. Parameter
- <c>p</c> points to a <c>erlang_ref</c>
- structure (which should have been obtained earlier with
- <c>ei_decode_ref()</c>).</p>
+ <c>p</c> points to an <c>erlang_ref</c>
+ structure which either should have been obtained earlier with
+ <seecref marker="#ei_decode_ref"><c>ei_decode_ref()</c></seecref>, or
+ created by
+ <seecref marker="ei_connect#ei_make_ref"><c>ei_make_ref()</c></seecref>.</p>
</desc>
</func>
@@ -786,6 +921,9 @@ ei_x_encode_string(&amp;x, "Banana");</pre>
<name since=""><ret>int</ret><nametext>ei_x_encode_string(ei_x_buff* x, const char *p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_string_len(ei_x_buff* x, const char* s, int len)</nametext></name>
<fsummary>Encode a string.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a string in the binary format. (A string in Erlang
is a list, but is encoded as a character array in the binary
@@ -797,11 +935,16 @@ ei_x_encode_string(&amp;x, "Banana");</pre>
<name since=""><ret>int</ret><nametext>ei_encode_trace(char *buf, int *index, const erlang_trace *p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_trace(ei_x_buff* x, const erlang_trace *p)</nametext></name>
<fsummary>Encode a trace token.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ <v><seecref marker="#erlang_trace"><c>erlang_trace</c></seecref></v>
+ </type>
<desc>
<p>Encodes an Erlang trace token in the binary format.
Parameter <c>p</c> points to a
- <c>erlang_trace</c> structure (which should have been
- obtained earlier with <c>ei_decode_trace()</c>).</p>
+ <c>erlang_trace</c> structure which should have been
+ obtained earlier with
+ <seecref marker="#ei_decode_trace"><c>ei_decode_trace()</c></seecref>.</p>
</desc>
</func>
@@ -809,6 +952,9 @@ ei_x_encode_string(&amp;x, "Banana");</pre>
<name since=""><ret>int</ret><nametext>ei_encode_tuple_header(char *buf, int *index, int arity)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_tuple_header(ei_x_buff* x, int arity)</nametext></name>
<fsummary>Encode a tuple.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a tuple header, with a specified
arity. The next <c>arity</c> terms encoded will be the
@@ -828,6 +974,9 @@ ei_encode_tuple_header(buf, &amp;i, 0);</pre>
<name since=""><ret>int</ret><nametext>ei_encode_ulong(char *buf, int *index, unsigned long p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_ulong(ei_x_buff* x, unsigned long p)</nametext></name>
<fsummary>Encode unsigned integer.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes an unsigned long integer in the binary format.
If the code is 64 bits, the function <c>ei_encode_ulong()</c> is
@@ -839,10 +988,13 @@ ei_encode_tuple_header(buf, &amp;i, 0);</pre>
<name since=""><ret>int</ret><nametext>ei_encode_ulonglong(char *buf, int *index, unsigned long long p)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_ulonglong(ei_x_buff* x, unsigned long long p)</nametext></name>
<fsummary>Encode unsigned integer.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a GCC <c>unsigned long long</c> or Visual C++
<c>unsigned __int64</c> (64-bit) integer in the binary
- format. This function is missing in the VxWorks port.</p>
+ format.</p>
</desc>
</func>
@@ -850,6 +1002,9 @@ ei_encode_tuple_header(buf, &amp;i, 0);</pre>
<name since=""><ret>int</ret><nametext>ei_encode_version(char *buf, int *index)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_encode_version(ei_x_buff* x)</nametext></name>
<fsummary>Encode version.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Encodes a version magic number for the binary format. Must
be the first token in a binary term.</p>
@@ -948,7 +1103,7 @@ ei_encode_tuple_header(buf, &amp;i, 0);</pre>
<tag>ERL_PORT_EXT</tag>
<item><p>
Decode using
- <seecref marker="#ei_decode_pid"><c>ei_decode_pid()</c></seecref>.
+ <seecref marker="#ei_decode_port"><c>ei_decode_port()</c></seecref>.
</p></item>
<tag>ERL_NEW_REFERENCE_EXT</tag>
@@ -1007,11 +1162,8 @@ ei_encode_tuple_header(buf, &amp;i, 0);</pre>
</func>
<func>
- <name since=""><ret>void</ret><nametext>ei_set_compat_rel(release_number)</nametext></name>
+ <name since=""><ret>void</ret><nametext>ei_set_compat_rel(unsigned release_number)</nametext></name>
<fsummary>Set the ei library in compatibility mode.</fsummary>
- <type>
- <v>unsigned release_number;</v>
- </type>
<desc>
<marker id="ei_set_compat_rel"></marker>
<p>In general, the <c>ei</c> library is guaranteed
@@ -1084,6 +1236,9 @@ ei_encode_tuple_header(buf, &amp;i, 0);</pre>
<name since=""><ret>int</ret><nametext>ei_x_append(ei_x_buff* x, const ei_x_buff* x2)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_append_buf(ei_x_buff* x, const char* buf, int len)</nametext></name>
<fsummary>Append a buffer at the end.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
<p>Appends data at the end of buffer <c>x</c>.</p>
</desc>
@@ -1093,6 +1248,10 @@ ei_encode_tuple_header(buf, &amp;i, 0);</pre>
<name since=""><ret>int</ret><nametext>ei_x_format(ei_x_buff* x, const char* fmt, ...)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_format_wo_ver(ei_x_buff* x, const char *fmt, ... )</nametext></name>
<fsummary>Format a term from a format string and parameters.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ <v><seecref marker="#erlang_pid"><c>erlang_pid</c></seecref></v>
+ </type>
<desc>
<p>Formats a term, given as a string, to a buffer.
Works like a sprintf for Erlang terms.
@@ -1121,10 +1280,13 @@ encodes the tuple {numbers,12,3.14159}</pre>
<func>
<name since=""><ret>int</ret><nametext>ei_x_free(ei_x_buff* x)</nametext></name>
<fsummary>Free a buffer.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
- <p>Deallocates the content of an
- <seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref> buffer.
- After deallocation, the <c>buff</c> field is set to <c>NULL</c>.</p>
+ <p>Deallocates the dynamically allocated content of the buffer
+ referred by <c>x</c>. After deallocation, the <c>buff</c> field
+ is set to <c>NULL</c>.</p>
</desc>
</func>
@@ -1132,11 +1294,14 @@ encodes the tuple {numbers,12,3.14159}</pre>
<name since=""><ret>int</ret><nametext>ei_x_new(ei_x_buff* x)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_x_new_with_version(ei_x_buff* x)</nametext></name>
<fsummary>Allocate a new buffer.</fsummary>
+ <type>
+ <v><seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ </type>
<desc>
- <p>Allocates a new <seecref marker="#ei_x_buff"><c>ei_x_buff</c></seecref>
- buffer. The
- fields of the structure pointed to by parameter <c>x</c>
- is filled in, and a default buffer is allocated.
+ <p>Initialize the dynamically realizable buffer referred to
+ by <c>x</c>. The fields of the structure pointed to by
+ parameter <c>x</c> is filled in, and a default buffer is
+ allocated.
<c>ei_x_new_with_version()</c> also puts an initial
version byte, which is used in the binary format (so that
<c>ei_x_encode_version()</c> will not be needed.)</p>
diff --git a/lib/erl_interface/doc/src/ei_connect.xml b/lib/erl_interface/doc/src/ei_connect.xml
index 026a6ae30b..f85652dd5b 100644
--- a/lib/erl_interface/doc/src/ei_connect.xml
+++ b/lib/erl_interface/doc/src/ei_connect.xml
@@ -109,27 +109,10 @@
only supports IPv4. That is, at this time <c>addr</c> always
points to a <c>struct sockaddr_in</c> structure.</p>
- <p>The <c>ei_socket_callbacks</c> structure may be enlarged in
- the future. All fields not set, <em>needs</em> to be zeroed out.</p>
-
- <marker id="ei_socket_callbacks"/>
- <code type="none"><![CDATA[
-typedef struct {
- int flags;
- int (*socket)(void **ctx, void *setup_ctx);
- int (*close)(void *ctx);
- int (*listen)(void *ctx, void *addr, int *len, int backlog);
- int (*accept)(void **ctx, void *addr, int *len, unsigned tmo);
- int (*connect)(void *ctx, void *addr, int len, unsigned tmo);
- int (*writev)(void *ctx, const void *iov, int iovcnt, ssize_t *len, unsigned tmo);
- int (*write)(void *ctx, const char *buf, ssize_t *len, unsigned tmo);
- int (*read)(void *ctx, char *buf, ssize_t *len, unsigned tmo);
- int (*handshake_packet_header_size)(void *ctx, int *sz);
- int (*connect_handshake_complete)(void *ctx);
- int (*accept_handshake_complete)(void *ctx);
- int (*get_fd)(void *ctx, int *fd);
-} ei_socket_callbacks;
- ]]></code>
+ <p><marker id="ei_socket_callbacks_fields"/>The
+ <seecref marker="#ei_socket_callbacks"><c>ei_socket_callbacks</c></seecref>
+ structure may be enlarged in the future. All fields not set, <em>needs</em>
+ to be zeroed out. Currently the following fields exist:</p>
<taglist>
@@ -352,6 +335,79 @@ typedef struct {
</item>
</taglist>
</section>
+ <section>
+ <title>Data Types</title>
+ <taglist>
+ <tag><marker id="ei_cnode"/><c>ei_cnode</c></tag>
+ <item><p>
+ Opaque data type representing a C-node. A <c>ei_cnode</c>
+ structure is initialized by calling
+ <seecref marker="#ei_connect_init"><c>ei_connect_init()</c></seecref>
+ or friends.
+ </p></item>
+
+ <tag><marker id="ei_socket_callbacks"/><c>ei_socket_callbacks</c></tag>
+ <item><code type="none">
+typedef struct {
+ int flags;
+ int (*socket)(void **ctx, void *setup_ctx);
+ int (*close)(void *ctx);
+ int (*listen)(void *ctx, void *addr, int *len, int backlog);
+ int (*accept)(void **ctx, void *addr, int *len, unsigned tmo);
+ int (*connect)(void *ctx, void *addr, int len, unsigned tmo);
+ int (*writev)(void *ctx, const void *iov, int iovcnt, ssize_t *len, unsigned tmo);
+ int (*write)(void *ctx, const char *buf, ssize_t *len, unsigned tmo);
+ int (*read)(void *ctx, char *buf, ssize_t *len, unsigned tmo);
+ int (*handshake_packet_header_size)(void *ctx, int *sz);
+ int (*connect_handshake_complete)(void *ctx);
+ int (*accept_handshake_complete)(void *ctx);
+ int (*get_fd)(void *ctx, int *fd);
+} ei_socket_callbacks;</code>
+ <p>
+ Callbacks functions for a <seecref marker="#ussi"><i>User
+ Supplied Socket Implementation</i></seecref>.
+ <seecref marker="#ei_socket_callbacks_fields">Documentation
+ of each field</seecref> can be found in the
+ <i>User Supplied Socket Implementation</i> section
+ above.
+ </p>
+
+ </item>
+
+ <tag><marker id="ErlConnect"/><c>ErlConnect</c></tag>
+ <item><code type="none">
+typedef struct {
+ char ipadr[4]; /* Ip v4 address in network byte order */
+ char nodename[MAXNODELEN];
+} ErlConnect;</code>
+ <p>IP v4 address and nodename.</p>
+ </item>
+
+ <tag><marker id="Erl_IpAddr"/><c>Erl_IpAddr</c></tag>
+ <item><code type="none">
+typedef struct {
+ unsigned s_addr; /* Ip v4 address in network byte order */
+} Erl_IpAddr;</code>
+ <p>IP v4 address.</p>
+ </item>
+
+ <tag><marker id="erlang_msg"/><c>erlang_msg</c></tag>
+ <item>
+ <code type="none">
+typedef struct {
+ long msgtype;
+ erlang_pid from;
+ erlang_pid to;
+ char toname[MAXATOMLEN+1];
+ char cookie[MAXATOMLEN+1];
+ erlang_trace token;
+} erlang_msg;</code>
+ <p>Information about a message received via
+ <seecref marker="#ei_receive_msg"><c>ei_receive_msg()</c></seecref>
+ or friends.</p>
+ </item>
+ </taglist>
+ </section>
<funcs>
<func>
<name since=""><ret>struct hostent *</ret><nametext>ei_gethostbyaddr(const char *addr, int len, int type)</nametext></name>
@@ -368,6 +424,10 @@ typedef struct {
<func>
<name since=""><ret>int</ret><nametext>ei_accept(ei_cnode *ec, int listensock, ErlConnect *conp)</nametext></name>
<fsummary>Accept a connection from another node.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ <v><seecref marker="#ErlConnect"><c>ErlConnect</c></seecref></v>
+ </type>
<desc>
<p>Used by a server process to accept a
connection from a client process.</p>
@@ -381,13 +441,8 @@ typedef struct {
</item>
<item>
<p><c>conp</c> is a pointer to an
- <c>ErlConnect</c> struct, described as follows:</p>
- <code type="none"><![CDATA[
-typedef struct {
- char ipadr[4];
- char nodename[MAXNODELEN];
-} ErlConnect;
- ]]></code>
+ <seecref marker="#ErlConnect"><c>ErlConnect</c></seecref>
+ struct.</p>
</item>
</list>
<p>On success, <c>conp</c> is filled in with the address and
@@ -401,6 +456,10 @@ typedef struct {
<name since=""><ret>int</ret><nametext>ei_accept_tmo(ei_cnode *ec, int listensock, ErlConnect *conp, unsigned timeout_ms)</nametext></name>
<fsummary>Accept a connection from another node with optional
time-out.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ <v><seecref marker="#ErlConnect"><c>ErlConnect</c></seecref></v>
+ </type>
<desc>
<p>Equivalent to
<c>ei_accept</c> with an optional time-out argument,
@@ -422,6 +481,10 @@ typedef struct {
<name since="OTP @OTP-16251@"><ret>int</ret><nametext>ei_connect_host_port(ei_cnode* ec, char *hostname, int port)</nametext></name>
<name since="OTP @OTP-16251@"><ret>int</ret><nametext>ei_xconnect_host_port(ei_cnode* ec, Erl_IpAddr adr, int port)</nametext></name>
<fsummary>Establish a connection to an Erlang node.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ <v><seecref marker="#Erl_IpAddr"><c>Erl_IpAddr</c></seecref></v>
+ </type>
<desc>
<p>Sets up a connection to an Erlang node.</p>
<p><c>ei_xconnect()</c> requires the IP address of the
@@ -483,6 +546,11 @@ fd = ei_xconnect(&ec, &addr, ALIVE);
<name since=""><ret>int</ret><nametext>ei_connect_xinit(ei_cnode* ec, const char *thishostname, const char *thisalivename, const char *thisnodename, Erl_IpAddr thisipaddr, const char *cookie, short creation)</nametext></name>
<name since="OTP 21.3"><ret>int</ret><nametext>ei_connect_xinit_ussi(ei_cnode* ec, const char *thishostname, const char *thisalivename, const char *thisnodename, Erl_IpAddr thisipaddr, const char *cookie, short creation, ei_socket_callbacks *cbs, int cbs_sz, void *setup_context)</nametext></name>
<fsummary>Initialize for a connection.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ <v><seecref marker="#Erl_IpAddr"><c>Erl_IpAddr</c></seecref></v>
+ <v><seecref marker="#ei_socket_callbacks"><c>ei_socket_callbacks</c></seecref></v>
+ </type>
<desc>
<p>Initializes the <c>ec</c> structure, to
identify the node name and cookie of the server. One of them
@@ -584,6 +652,10 @@ if (ei_connect_init(&ec, "madonna", "cookie...", n++) < 0) {
<name since="OTP @OTP-16251@"><ret>int</ret><nametext>ei_xconnect_host_port_tmo(ei_cnode* ec, Erl_IpAddr adr, int port, unsigned ms)</nametext></name>
<fsummary>Establish a connection to an Erlang node with optional
time-out.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ <v><seecref marker="#Erl_IpAddr"><c>Erl_IpAddr</c></seecref></v>
+ </type>
<desc>
<p>Equivalent to <c>ei_connect</c>, <c>ei_xconnect</c>,
<c>ei_connect_host_port</c> and
@@ -610,6 +682,10 @@ if (ei_connect_init(&ec, "madonna", "cookie...", n++) < 0) {
<name since="OTP 21.3"><ret>int</ret><nametext>ei_listen(ei_cnode *ec, int *port, int backlog)</nametext></name>
<name since="OTP 21.3"><ret>int</ret><nametext>ei_xlisten(ei_cnode *ec, Erl_IpAddr adr, int *port, int backlog)</nametext></name>
<fsummary>Create a listen socket.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ <v><seecref marker="#Erl_IpAddr"><c>Erl_IpAddr</c></seecref></v>
+ </type>
<desc>
<p>Used by a server process to setup a listen socket which
later can be used for accepting connections from client processes.
@@ -648,6 +724,10 @@ if (ei_connect_init(&ec, "madonna", "cookie...", n++) < 0) {
<func>
<name since="OTP @OTP-16594@"><ret>int</ret><nametext>ei_make_pid(ei_cnode *ec, erlang_pid *pid)</nametext></name>
<fsummary>Create a new process identifier</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ <v><seecref marker="ei#erlang_pid"><c>erlang_pid</c></seecref></v>
+ </type>
<desc>
<p>
Creates a new process identifier in the argument <c>pid</c>. This process identifier
@@ -669,6 +749,10 @@ if (ei_connect_init(&ec, "madonna", "cookie...", n++) < 0) {
<func>
<name since="OTP @OTP-16594@"><ret>int</ret><nametext>ei_make_ref(ei_cnode *ec, erlang_ref *ref)</nametext></name>
<fsummary>Create a new reference</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ <v><seecref marker="ei#erlang_ref"><c>erlang_ref</c></seecref></v>
+ </type>
<desc>
<p>
Creates a new reference in the argument <c>ref</c>. This reference originates
@@ -689,6 +773,9 @@ if (ei_connect_init(&ec, "madonna", "cookie...", n++) < 0) {
<func>
<name since=""><ret>int</ret><nametext>ei_publish(ei_cnode *ec, int port)</nametext></name>
<fsummary>Publish a node name.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ </type>
<desc>
<p>Used by a server process to register
with the local name server EPMD, thereby allowing
@@ -726,6 +813,9 @@ if (ei_connect_init(&ec, "madonna", "cookie...", n++) < 0) {
<func>
<name since=""><ret>int</ret><nametext>ei_publish_tmo(ei_cnode *ec, int port, unsigned timeout_ms)</nametext></name>
<fsummary>Publish a node name with optional time-out.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ </type>
<desc>
<p>Equivalent to
<c>ei_publish</c> with an optional time-out argument,
@@ -777,6 +867,9 @@ if (ei_connect_init(&ec, "madonna", "cookie...", n++) < 0) {
<func>
<name since=""><ret>int</ret><nametext>ei_receive_encoded(int fd, char **mbufp, int *bufsz, erlang_msg *msg, int *msglen)</nametext></name>
<fsummary>Obsolete function for receiving a message.</fsummary>
+ <type>
+ <v><seecref marker="#erlang_msg"><c>erlang_msg</c></seecref></v>
+ </type>
<desc>
<p>This function is retained for compatibility with code
generated by the interface compiler and with code following
@@ -808,6 +901,9 @@ if (ei_connect_init(&ec, "madonna", "cookie...", n++) < 0) {
<name since=""><ret>int</ret><nametext>ei_receive_encoded_tmo(int fd, char **mbufp, int *bufsz, erlang_msg *msg, int *msglen, unsigned timeout_ms)</nametext></name>
<fsummary>Obsolete function for receiving a message with time-out.
</fsummary>
+ <type>
+ <v><seecref marker="#erlang_msg"><c>erlang_msg</c></seecref></v>
+ </type>
<desc>
<p>Equivalent to
<c>ei_receive_encoded</c> with an optional time-out argument,
@@ -819,6 +915,10 @@ if (ei_connect_init(&ec, "madonna", "cookie...", n++) < 0) {
<name since=""><ret>int</ret><nametext>ei_receive_msg(int fd, erlang_msg* msg, ei_x_buff* x)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_xreceive_msg(int fd, erlang_msg* msg, ei_x_buff* x)</nametext></name>
<fsummary>Receive a message.</fsummary>
+ <type>
+ <v><seecref marker="ei#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ <v><seecref marker="#erlang_msg"><c>erlang_msg</c></seecref></v>
+ </type>
<desc>
<p>Receives a message to the buffer in <c>x</c>.
<c>ei_xreceive_msg</c> allows the buffer in
@@ -835,18 +935,8 @@ if (ei_connect_init(&ec, "madonna", "cookie...", n++) < 0) {
<c>ei_x_new</c>.</item>
</list>
<p>On success, the functions return <c>ERL_MSG</c> and the
- <c>msg</c> struct is initialized.
- <c>erlang_msg</c> is defined as follows:</p>
- <code type="none"><![CDATA[
-typedef struct {
- long msgtype;
- erlang_pid from;
- erlang_pid to;
- char toname[MAXATOMLEN+1];
- char cookie[MAXATOMLEN+1];
- erlang_trace token;
-} erlang_msg;
- ]]></code>
+ <seecref marker="#erlang_msg"><c>msg</c></seecref> struct
+ is initialized.</p>
<p><c>msgtype</c> identifies the type of message, and is
one of the following:</p>
<taglist>
@@ -884,6 +974,10 @@ typedef struct {
<name since=""><ret>int</ret><nametext>ei_receive_msg_tmo(int fd, erlang_msg* msg, ei_x_buff* x, unsigned imeout_ms)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_xreceive_msg_tmo(int fd, erlang_msg* msg, ei_x_buff* x, unsigned timeout_ms)</nametext></name>
<fsummary>Receive a message with optional time-out.</fsummary>
+ <type>
+ <v><seecref marker="ei#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ <v><seecref marker="#erlang_msg"><c>erlang_msg</c></seecref></v>
+ </type>
<desc>
<p>Equivalent to <c>ei_receive_msg</c> and <c>ei_xreceive_msg</c>
with an optional time-out argument,
@@ -904,6 +998,9 @@ typedef struct {
<func>
<name since=""><ret>int</ret><nametext>ei_reg_send(ei_cnode* ec, int fd, char* server_name, char* buf, int len)</nametext></name>
<fsummary>Send a message to a registered name.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ </type>
<desc>
<p>Sends an Erlang term to a registered process.</p>
<list type="bulleted">
@@ -937,6 +1034,9 @@ if (ei_reg_send(&ec, fd, x.buff, x.index) < 0)
<name since=""><ret>int</ret><nametext>ei_reg_send_tmo(ei_cnode* ec, int fd, char* server_name, char* buf, int len, unsigned timeout_ms)</nametext></name>
<fsummary>Send a message to a registered name with optional time-out
</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ </type>
<desc>
<p>Equivalent to
<c>ei_reg_send</c> with an optional time-out argument,
@@ -949,6 +1049,11 @@ if (ei_reg_send(&ec, fd, x.buff, x.index) < 0)
<name since=""><ret>int</ret><nametext>ei_rpc_to(ei_cnode *ec, int fd, char *mod, char *fun, const char *argbuf, int argbuflen)</nametext></name>
<name since=""><ret>int</ret><nametext>ei_rpc_from(ei_cnode *ec, int fd, int timeout, erlang_msg *msg, ei_x_buff *x)</nametext></name>
<fsummary>Remote Procedure Call from C to Erlang.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ <v><seecref marker="ei#ei_x_buff"><c>ei_x_buff</c></seecref></v>
+ <v><seecref marker="#erlang_msg"><c>erlang_msg</c></seecref></v>
+ </type>
<desc>
<p>Supports calling Erlang functions on remote nodes.
<c>ei_rpc_to()</c> sends an RPC request to a remote node
@@ -1048,19 +1153,40 @@ if (ei_decode_version(result.buff, &index) < 0
<func>
<name since=""><ret>erlang_pid *</ret><nametext>ei_self(ei_cnode *ec)</nametext></name>
<fsummary>Retrieve the pid of the C-node.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ <v><seecref marker="ei#erlang_pid"><c>erlang_pid</c></seecref></v>
+ </type>
<desc>
- <p>Retrieves the pid of the C-node. Every C-node
+ <p>Retrieves a generic pid of the C-node. Every C-node
has a (pseudo) pid used in <c>ei_send_reg</c>,
- <c>ei_rpc</c>,
+ <c>ei_rpc()</c>,
and others. This is contained in a field in the <c>ec</c>
- structure. It will be safe for a long time to fetch this
- field directly from the <c>ei_cnode</c> structure.</p>
+ structure. Do <em>not</em> modify this structure.
+ </p>
+ <p>
+ On success a pointer to the process identifier is returned.
+ On failure <c>NULL</c> is returned and <c>erl_errno</c> is
+ set.
+ </p>
+ <p>
+ The C-node identified by <c>ec</c> must have been initialized
+ and must have received a name prior to the call to <c>ei_self()</c>.
+ Initialization of the C-node is done by a call to
+ <seecref marker="#ei_connect_init"><c>ei_connect_init()</c></seecref>
+ or friends. If the name is dynamically assigned from the peer node, the
+ C-node also has to be connected.
+ </p>
+
</desc>
</func>
<func>
<name since=""><ret>int</ret><nametext>ei_send(int fd, erlang_pid* to, char* buf, int len)</nametext></name>
<fsummary>Send a message.</fsummary>
+ <type>
+ <v><seecref marker="ei#erlang_pid"><c>erlang_pid</c></seecref></v>
+ </type>
<desc>
<p>Sends an Erlang term to a process.</p>
<list type="bulleted">
@@ -1082,6 +1208,9 @@ if (ei_decode_version(result.buff, &index) < 0
<func>
<name since=""><ret>int</ret><nametext>ei_send_encoded(int fd, erlang_pid* to, char* buf, int len)</nametext></name>
<fsummary>Obsolete function to send a message.</fsummary>
+ <type>
+ <v><seecref marker="ei#erlang_pid"><c>erlang_pid</c></seecref></v>
+ </type>
<desc>
<p>Works exactly as <c>ei_send</c>, the alternative name is retained for
backward compatibility. The function will <em>not</em> be
@@ -1093,6 +1222,9 @@ if (ei_decode_version(result.buff, &index) < 0
<name since=""><ret>int</ret><nametext>ei_send_encoded_tmo(int fd, erlang_pid* to, char* buf, int len, unsigned timeout_ms)</nametext></name>
<fsummary>Obsolete function to send a message with optional time-out.
</fsummary>
+ <type>
+ <v><seecref marker="ei#erlang_pid"><c>erlang_pid</c></seecref></v>
+ </type>
<desc>
<p>Equivalent to
<c>ei_send_encoded</c> with an optional time-out argument,
@@ -1104,6 +1236,9 @@ if (ei_decode_version(result.buff, &index) < 0
<name since=""><ret>int</ret><nametext>ei_send_reg_encoded(int fd, const erlang_pid *from, const char *to, const char *buf, int len)</nametext></name>
<fsummary>Obsolete function to send a message to a registered name.
</fsummary>
+ <type>
+ <v><seecref marker="ei#erlang_pid"><c>erlang_pid</c></seecref></v>
+ </type>
<desc>
<p>This function is retained for compatibility with code
generated by the interface compiler and with code following
@@ -1123,6 +1258,9 @@ if (ei_decode_version(result.buff, &index) < 0
<name since=""><ret>int</ret><nametext>ei_send_reg_encoded_tmo(int fd, const erlang_pid *from, const char *to, const char *buf, int len)</nametext></name>
<fsummary>Obsolete function to send a message to a registered name with
time-out.</fsummary>
+ <type>
+ <v><seecref marker="ei#erlang_pid"><c>erlang_pid</c></seecref></v>
+ </type>
<desc>
<p>Equivalent to
<c>ei_send_reg_encoded</c> with an optional time-out argument,
@@ -1133,6 +1271,9 @@ if (ei_decode_version(result.buff, &index) < 0
<func>
<name since=""><ret>int</ret><nametext>ei_send_tmo(int fd, erlang_pid* to, char* buf, int len, unsigned timeout_ms)</nametext></name>
<fsummary>Send a message with optional time-out.</fsummary>
+ <type>
+ <v><seecref marker="ei#erlang_pid"><c>erlang_pid</c></seecref></v>
+ </type>
<desc>
<p>Equivalent to
<c>ei_send</c> with an optional time-out argument,
@@ -1145,6 +1286,9 @@ if (ei_decode_version(result.buff, &index) < 0
<name since=""><ret>const char *</ret><nametext>ei_thishostname(ei_cnode *ec)</nametext></name>
<name since=""><ret>const char *</ret><nametext>ei_thisalivename(ei_cnode *ec)</nametext></name>
<fsummary>Retrieve some values.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ </type>
<desc>
<p>Can be used to retrieve information about
the C-node. These values are initially set with
@@ -1160,6 +1304,9 @@ if (ei_decode_version(result.buff, &index) < 0
<func>
<name since=""><ret>int</ret><nametext>ei_unpublish(ei_cnode *ec)</nametext></name>
<fsummary>Forcefully unpublish a node name.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ </type>
<desc>
<p>Can be called by a process to unregister a
specified node from EPMD on the local host. This is, however, usually
@@ -1183,6 +1330,9 @@ if (ei_decode_version(result.buff, &index) < 0
<func>
<name since=""><ret>int</ret><nametext>ei_unpublish_tmo(ei_cnode *ec, unsigned timeout_ms)</nametext></name>
<fsummary>Unpublish a node name with optional time-out.</fsummary>
+ <type>
+ <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v>
+ </type>
<desc>
<p>Equivalent to
<c>ei_unpublish</c> with an optional time-out argument,
diff --git a/lib/erl_interface/doc/src/ei_global.xml b/lib/erl_interface/doc/src/ei_global.xml
index 404d6d8435..148068490e 100644
--- a/lib/erl_interface/doc/src/ei_global.xml
+++ b/lib/erl_interface/doc/src/ei_global.xml
@@ -51,14 +51,14 @@
<name since=""><ret>char **</ret><nametext>ei_global_names(ec,fd,count)</nametext></name>
<fsummary>Obtain list of global names.</fsummary>
<type>
- <v>ei_cnode *ec;</v>
+ <v><seecref marker="ei_connect#ei_cnode"><c>ei_cnode</c></seecref> *ec;</v>
<v>int fd;</v>
<v>int *count;</v>
</type>
<desc>
<p>Retrieves a list of all known global names.</p>
<list type="bulleted">
- <item><c>ec</c> is the ei_cnode representing the current cnode.</item>
+ <item><c>ec</c> is the <c>ei_cnode</c> representing the current cnode.</item>
<item><c>fd</c> is an open descriptor to an Erlang
connection.</item>
<item><c>count</c> is the address of an integer, or
@@ -86,7 +86,7 @@
<type>
<v>int fd;</v>
<v>const char *name;</v>
- <v>erlang_pid *pid;</v>
+ <v><seecref marker="ei#erlang_pid"><c>erlang_pid</c></seecref> *pid;</v>
</type>
<desc>
<p>Registers a name in <c>global</c>.</p>
@@ -108,14 +108,14 @@
<name since=""><ret>int</ret><nametext>ei_global_unregister(ec,fd,name)</nametext></name>
<fsummary>Unregister a name from global.</fsummary>
<type>
- <v>ei_cnode *ec;</v>
+ <v><seecref marker="ei_connect#ei_cnode"><c>ei_cnode</c></seecref> *ec;</v>
<v>int fd;</v>
<v>const char *name;</v>
</type>
<desc>
<p>Unregisters a name from <c>global</c>.</p>
<list type="bulleted">
- <item><c>ec</c> is the ei_cnode representing the current cnode.</item>
+ <item><c>ec</c> is the <c>ei_cnode</c> representing the current cnode.</item>
<item><c>fd</c> is an open descriptor to an Erlang
connection.</item>
<item><c>name</c> is the name to unregister from
@@ -129,16 +129,16 @@
<name since=""><ret>int</ret><nametext>ei_global_whereis(ec,fd,name,pid,node)</nametext></name>
<fsummary>Look up a name in global.</fsummary>
<type>
- <v>ei_cnode *ec;</v>
+ <v><seecref marker="ei_connect#ei_cnode"><c>ei_cnode</c></seecref> *ec;</v>
<v>int fd;</v>
<v>const char *name;</v>
- <v>erlang_pid* pid;</v>
+ <v><seecref marker="ei#erlang_pid"><c>erlang_pid</c></seecref> *pid;</v>
<v>char *node;</v>
</type>
<desc>
<p>Looks up a name in <c>global</c>.</p>
<list type="bulleted">
- <item><c>ec</c> is the ei_cnode representing the current cnode.</item>
+ <item><c>ec</c> is the <c>ei_cnode</c> representing the current cnode.</item>
<item><c>fd</c> is an open descriptor to an Erlang
connection.</item>
<item><c>name</c> is the name that is to be looked up in