From f0cfce64b6a061ffeafeda254734f0b1f2f452fd Mon Sep 17 00:00:00 2001
From: Steve Vinoski Create an atom term from the null-terminated C-string
Create an atom term from the string
Create a floating-point term from a
Create a floating-point term from a
Create an atom term from the null-terminated C-string
Create an atom term from the string
Make a badarg exception to be returned from a NIF, and set
- an associated exception reason in
Make a badarg exception to be returned from a NIF, and associate
+ it with the environment
In earlier versions (older than erts-7.0, OTP 18) the return value
+ from
Create a floating-point term from a
Return true if a pending exception is associated
+ with the environment
Initialize the structure pointed to by
See also:
In earlier versions (older than erts-7.0, OTP 18) the return value
from The NIF concept is officially supported from R14B. NIF source code
- written for earlier experimental versions might need adaption to run on R14B
- or later versions: A minimal example of a NIF library can look like this:
-
-
-
-
-
-
--
cgit v1.2.3
From 884afd8efb8672df2889df98b5b94f3dbb53952c Mon Sep 17 00:00:00 2001
From: Steve Vinoski
Return true if a pending exception is associated
- with the environment
See also:
See also:
See also:
See also:
See also:
In earlier versions (older than erts-7.0, OTP 18) the return value
from
Was previously named
Create an error exception with the term
See also:
Change the size of a binary
All elements of a list/tuple must belong to the same environment as the - list/tuple itself. Terms can be copied between environments with +
All contained terms of a list/tuple/map must belong to the same
+ environment as the list/tuple/map itself. Terms can be copied between
+ environments with
Set
Set
Set
Return true on success or false if Return true if
Return true if
Return true if
Create an ordinary list containing the elements of array
Set Set
The
Return a pointer to the raw binary data and set
Make an empty map term.
Make a copy of map
The
Make a copy of map
The
If map
The
Make a pid term from
Create an integer term from an
Create an iterator for the map
A map iterator is only useful during the lifetime of the environment
+
+ERL_NIF_TERM key, value;
+ErlNifMapIterator iter;
+enif_map_iterator_create(env, my_map, ERL_NIF_MAP_ITERATOR_FIRST);
+
+while (enif_map_iterator_get_pair(env, &iter, &key, &value)) {
+ do_something(key,value);
+ enif_map_iterator_next(env, &iter);
+}
+enif_map_iterator_destroy(env, &iter);
+
+ The key-value pairs of a map have no defined iteration + order. The only guarantee is that the iteration order of a single map + instance is preserved during the lifetime of the environment that the map + belongs to.
+Destroy a map iterator created by
+
Get key and value terms at current map iterator position.
+ On success set
Return true if map iterator
Return true if map iterator
Increment map iterator to point to next key-value entry. + Return true if the iterator is now positioned at a valid key-value entry, + or false if the iterator is positioned at the tail (beyond the last + entry).
Decrement map iterator to point to previous key-value entry. + Return true if the iterator is now positioned at a valid key-value entry, + or false if the iterator is positioned at the head (before the first + entry).
Same as Create an ordinary list containing the elements of array
Set
The
Create an integer term from a
Set
The
Create a list containing the characters of the
--
cgit v1.2.3
From a519a52617a6a5bbdb8b17bdd892ab012cf8080b Mon Sep 17 00:00:00 2001
From: Sverker Eriksson Allocate memory of Allocate a new binary of size Allocate a memory managed resource object of type Free all terms in an environment and clear it for reuse. The environment must
have been allocated with
Set
Set
Set
Set
Write a null-terminated string, in the buffer pointed to by
If
Set
Set
Set
Return true if a pending exception is associated
with the environment
Make a badarg exception to be returned from a NIF, and associate
it with the environment
Make a binary term from
Make a copy of term
Create an integer term from a signed 64-bit integer.
Create an ordinary list term of length
Create an ordinary list term with length indicated by the
function name. Prefer these functions (macros) over the variadic
Create a list cell
Create an ordinary list containing the elements of array
Make a pid term from
Create a reference like
The
Create a list containing the characters of the
null-terminated string
Create a list containing the characters of the string
Make a subbinary of binary
Create a tuple term of arity
Create a tuple term with length indicated by the
function name. Prefer these functions (macros) over the variadic
Create a tuple containing the elements of array
Was previously named
Change the size of a binary
Release a binary obtained from
Remove a reference to resource object
Initialize the pid variable
Send a message to a process.
ERL_NIF_TERM key, value;
ErlNifMapIterator iter;
-enif_map_iterator_create(env, my_map, ERL_NIF_MAP_ITERATOR_FIRST);
+enif_map_iterator_create(env, my_map, &iter, ERL_NIF_MAP_ITERATOR_FIRST);
while (enif_map_iterator_get_pair(env, &iter, &key, &value)) {
do_something(key,value);
--
cgit v1.2.3
From 738c34d4bb8f1a3811acd00af8c6c12107f8315b Mon Sep 17 00:00:00 2001
From: Bruce Yinhe
Date: Thu, 18 Jun 2015 11:31:02 +0200
Subject: Change license text to APLv2
---
erts/doc/src/erl_nif.xml | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
(limited to 'erts/doc/src/erl_nif.xml')
diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml
index 412c0e02ac..23c3d5fcee 100644
--- a/erts/doc/src/erl_nif.xml
+++ b/erts/doc/src/erl_nif.xml
@@ -8,16 +8,17 @@
Ericsson AB. All Rights Reserved.
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
--
cgit v1.2.3