From 42a7116dc64892ef4bf7a1483aa9df82d9a34439 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 12 Feb 2016 18:59:44 +0100 Subject: erts: Polish erl_nif docs --- erts/doc/src/erl_nif.xml | 69 ++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 37 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 7a8325c200..1e95634d1b 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -614,13 +614,13 @@ typedef enum { ErlNifUniqueInteger

An enumeration of the properties that can be requested from - - enif_unique_integer.

+ enif_unique_integer. + For default properties, use the value 0.

ERL_NIF_UNIQUE_POSITIVE -

A positive integer

+

Return only positive integers

ERL_NIF_UNIQUE_MONOTONIC -

A +

Return only strictly monotonically increasing integer corresponding to creation time

@@ -765,11 +765,10 @@ typedef enum { rounded using the floor function.

Returns ERL_NIF_TIME_ERROR if called with an invalid time unit argument.

-

See also:

- - ErlNifTime - ErlNifTimeUnit - +

See also: + ErlNifTime and + ErlNifTimeUnit. +

@@ -842,7 +841,7 @@ typedef enum { intenif_get_local_port(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPort* port_id) Read an local port term -

If term is the port of a node local port, initialize the +

If term identifies a node local port, initialize the port variable *port_id from it and return true. Otherwise return false. No check if the port is alive is done.

@@ -1074,7 +1073,7 @@ typedef enum { enif_is_exception, but not to any other NIF API function.

See also: enif_has_pending_exception - and enif_raise_exception + and enif_raise_exception.

In earlier versions (older than erts-7.0, OTP 18) the return value from enif_make_badarg had to be returned from the NIF. This @@ -1320,10 +1319,9 @@ typedef enum { integer returned. It is possible to combine them by or:ing the two values together.

-

See also:

- - ErlNifUniqueInteger - +

See also: + ErlNifUniqueInteger. +

ERL_NIF_TERMenif_make_ulong(ErlNifEnv* env, unsigned long i) @@ -1408,7 +1406,7 @@ enif_map_iterator_destroy(env, &iter); Time unit of returned value.

- Returns + Returns the current Erlang monotonic time. Note that it is not uncommon with negative values. @@ -1416,11 +1414,10 @@ enif_map_iterator_destroy(env, &iter);

Returns ERL_NIF_TIME_ERROR if called with an invalid time unit argument, or if called from a thread that is not a scheduler thread.

-

See also:

- - ErlNifTime - ErlNifTimeUnit - +

See also: + ErlNifTime and + ErlNifTimeUnit. +

@@ -1509,10 +1506,7 @@ enif_map_iterator_destroy(env, &iter); and enif_free_env into one call. This optimization is only usefull when a majority of the terms are to be copied from env to the msg_env.

The call may return false if it detects that the command failed for some reason. Otherwise true is returned.

-

See also:

- - enif_get_local_port - +

See also: enif_get_local_port.

void *enif_priv_data(ErlNifEnv* env) @@ -1649,6 +1643,8 @@ enif_map_iterator_destroy(env, &iter); of cleared for reuse with enif_clear_env.

This function is only thread-safe when the emulator with SMP support is used. It can only be used in a non-SMP emulator from a NIF-calling thread.

+

Passing msg_env as NULL is only supported since + erts-8.0 (OTP 19).

unsignedenif_sizeof_resource(void* obj) @@ -1665,13 +1661,13 @@ enif_map_iterator_destroy(env, &iter); intenif_term_to_binary(ErlNifEnv *env, ERL_NIF_TERM term, ErlNifBinary *bin) Convert a term to the external format -

Returns a binary data object that is the result of encoding term - according to the Erlang external term format.

-

See also:

- - erlang:term_to_binary/1 - enif_binary_to_term - +

Allocates a new binary with enif_alloc_binary + and stores the result of encoding term according to the Erlang external term format.

+

Returns true on success or false if allocation failed.

+

See also: + erlang:term_to_binary/1 and + enif_binary_to_term. +

intenif_thread_create(char *name,ErlNifTid *tid,void * (*func)(void *),void *args,ErlNifThreadOpts *opts) @@ -1723,11 +1719,10 @@ enif_map_iterator_destroy(env, &iter);

Returns ERL_NIF_TIME_ERROR if called with an invalid time unit argument, or if called from a thread that is not a scheduler thread.

-

See also:

- - ErlNifTime - ErlNifTimeUnit - +

See also: + ErlNifTime and + ErlNifTimeUnit. +

-- cgit v1.2.3