From 031f9ca91ade7fbb9e31c82545401b8a5531e539 Mon Sep 17 00:00:00 2001
From: xsipewe This module contains functions for creating and manipulating
- Erlang terms. This module provides functions for creating and manipulating
+ Erlang terms. An Erlang term is represented by a C structure of type
- The following macros each take a single ETERM pointer as an
- argument. They return a non-zero value if the test is true, and 0
- otherwise:
Each of the following macros takes a single
The following macros can be used for retrieving parts of Erlang - terms. None of these do any type checking; results are undefined - if you pass an ETERM* containing the wrong type. For example, - passing a tuple to ERL_ATOM_PTR() will likely result in garbage. -
+ terms. None of these do any type checking. Results are undefined + if you pass anThis function concatenates two Erlang terms, prepending
-
Concatenates two Erlang terms, prepending
The function returns a new list.
-For example:
+Example:
This function creates and returns a copy of the Erlang term +
Creates and returns a copy of the Erlang term
This function extracts a specified element from an Erlang - tuple.
-The function returns a new Erlang term corresponding to the
- requested element, or NULL if
Extracts a specified element from an Erlang tuple.
+Returns a new Erlang term corresponding to the requested element, or
+
Extracts the first element from a list.
The function returns an Erlang term corresponding to the
- head element in the list, or a NULL pointer if
Returns an Erlang term corresponding to the head
+ head element in the list, or a
This function must be called before any of the others in
- the
This function must be called before any of the others in the
+
Returns the length of an IO list. -
-The function returns the length of
Refer to
Returns the length of an I/O list.
+Returns the length of
For the definition of an I/O list, see
+
This function converts an IO list to a binary term.
+Converts an I/O list to a binary term.
This function an Erlang binary term, or NULL if
Informally, an IO list is a deep list of characters and - binaries which can be sent to an Erlang port. In BNF, an IO - list is formally defined as follows:
+Returns an Erlang binary term, or
Informally, an I/O list is a deep list of characters and + binaries that can be sent to an Erlang port. In BNF, an I/O + list is formally defined as follows:
This function converts an IO list to a '\0' terminated C - string.
-Converts an I/O list to a '\0' terminated C string.
+This function returns a pointer to a dynamically allocated
- buffer containing a string. If
Refer to
Returns a pointer to a dynamically allocated
+ buffer containing a string. If
For the definition of an I/O list, see
+
Determines the length of a proper list.
-Returns -1 if
Returns
Creates an atom.
Returns an Erlang term containing an atom. Note that it is
- the callers responsibility to make sure that
Returns an Erlang term containing an atom. Notice that it is
+ the caller's responsibility to ensure that
Note that the UTF8 variants were introduced in Erlang/OTP releases R16
- and the string returned by
The UTF-8 variants were introduced in Erlang/OTP R16 and the
+ string returned by
This function produces an Erlang binary object from a +
Produces an Erlang binary object from a buffer containing a sequence of bytes.
-The function returns an Erlang binary object.
+Returns an Erlang binary object.
This function creates and returns an empty Erlang list. - Note that NULL is not used to represent an empty list; +
Creates and returns an empty Erlang list.
+ Notice that
This function creates a list from a sequence of bytes.
-The function returns an Erlang list object corresponding to +
Creates a list from a sequence of bytes.
+Returns an Erlang list object corresponding to
the character sequence in
Creates an Erlang float.
-The function returns an Erlang float object with the value
- specified in
Returns an Erlang float object with the value
+ specified in
Creates an Erlang integer.
-The function returns an Erlang integer object with the +
Returns an Erlang integer object with the
value specified in
Creates an Erlang list from an array of Erlang terms, such that each element in the list corresponds to one element in - the array.
-The function creates an Erlang list object, whose length
-
This function creates an Erlang reference, with 82 bits.
-Note that
The function returns an Erlang reference object.
-Creates an Erlang reference, with 82 bits.
+Notice that
Returns an Erlang reference object.
+This function creates an Erlang process identifier. The +
Creates an Erlang process identifier (pid). The resulting pid can be used by Erlang processes wishing to - communicate with the C node.
-The function returns an Erlang pid object.
-Returns an Erlang pid object.
+This function creates an Erlang port identifier.
-The function returns an Erlang port object.
-Creates an Erlang port identifier.
+Returns an Erlang port object.
+This function creates an old Erlang reference, with +
Creates an old Erlang reference, with
only 18 bits - use
Note that
The function returns an Erlang reference object.
-Notice that
Returns an Erlang reference object.
+This function creates a list from a zero terminated string.
-The function returns an Erlang list.
+Creates a list from a zero-terminated string.
+Returns an Erlang list.
Creates an Erlang tuple from an array of Erlang terms.
-The function creates an Erlang tuple, whose arity is
-
To retrieve the size of a tuple, either use the
-
To retrieve the size of a tuple, either use function
+
Creates an Erlang unsigned integer.
The function returns an Erlang unsigned integer object with +
Returns an Erlang unsigned integer object with
the value specified in
This function creates an unbound Erlang variable. The - variable can later be bound through pattern matching or assignment.
+Creates an unbound Erlang variable. The variable can later be bound + through pattern matching or assignment.
The function returns an Erlang variable object with the
- name
Returns an Erlang variable object with the
+ name
This function prints the specified Erlang term to the given - output stream.
-The function returns the number of characters written, or a - negative value if there was an error.
+Prints the specified Erlang term to the specified output stream.
+Returns the number of characters written on success, otherwise a + negative value.
By default, the
A call to
By default, the
A call to
If this function is called, it may only be called once
- directly after the call to the
-
You may run into trouble if this feature is used - carelessly. Always make sure that all communicating + carelessly. Always ensure that all communicating components are either from the same Erlang/OTP release, or from release X and release Y where all components from release Y are in compatibility mode of release X.
Returns the arity of an Erlang tuple, or the - number of bytes in an Erlang binary object.
-The function returns the size of
Returns either the arity of an Erlang tuple or the + number of bytes in an Erlang binary object.
+Returns the size of
Extracts the tail from a list.
The function returns an Erlang list corresponding to the - original list minus the first element, or NULL pointer if +
Returns an Erlang list corresponding to the
+ original list minus the first element, or
This function returns the contents of the specified - variable in an Erlang term. -
-Returns the contents of the specified variable in an Erlang term.
+Returns the Erlang object corresponding to the value of
-