From 649bc2686601d8c76c1aa76e62700067719e3312 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 19 Jul 2010 19:03:15 +0200 Subject: NIF 64-bit integer support --- erts/doc/src/erl_nif.xml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index f7b7b2f346..8d2913ba4f 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -456,6 +456,10 @@ typedef enum { to return information about the runtime system. Contains currently the exact same content as ErlDrvSysInfo.

+ ErlNifSInt64 +

A native signed 64-bit integer type.

+ ErlNifUInt64 +

A native unsigned 64-bit integer type.

@@ -571,7 +575,13 @@ typedef enum { Read an integer term

Set *ip to the integer value of term. Return true on success or false if term is not an - integer or is outside the bounds of type int

+ integer or is outside the bounds of type int.

+ + intenif_get_int64(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifSInt64* ip) + Read a 64-bit integer term +

Set *ip to the integer value of + term. Return true on success or false if term is not an + integer or is outside the bounds of a signed 64-bit integer.

intenif_get_local_pid(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPid* pid) Read an local pid term @@ -633,7 +643,12 @@ typedef enum { return true, or return false if term is not an unsigned integer or is outside the bounds of type unsigned int.

- + intenif_get_uint64(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifUInt64* ip) + Read an unsigned 64-bit integer term. +

Set *ip to the unsigned integer value of term and + return true, or return false if term is not an unsigned integer or + is outside the bounds of an unsigned 64-bit integer.

+
intenif_get_ulong(ErlNifEnv* env, ERL_NIF_TERM term, unsigned long* ip) Read an unsigned integer term.

Set *ip to the unsigned long integer value of term @@ -758,6 +773,10 @@ typedef enum { Create an integer term

Create an integer term.

+ ERL_NIF_TERMenif_make_int64(ErlNifEnv* env, ErlNifSInt64 i) + Create an integer term +

Create an integer term from a signed 64-bit integer.

+
ERL_NIF_TERMenif_make_list(ErlNifEnv* env, unsigned cnt, ...) Create a list term.

Create an ordinary list term of length cnt. Expects @@ -894,6 +913,10 @@ typedef enum { Create an unsigned integer term

Create an integer term from an unsigned int.

+ ERL_NIF_TERMenif_make_uint64(ErlNifEnv* env, ErlNifUInt64 i) + Create an unsigned integer term +

Create an integer term from an unsigned 64-bit integer.

+
ERL_NIF_TERMenif_make_ulong(ErlNifEnv* env, unsigned long i) Create an integer term from an unsigned long int

Create an integer term from an unsigned long int.

-- cgit v1.2.3 From ad632e7f3ce05a44e51965202205a468bc357b3e Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 23 Jul 2010 15:27:29 +0200 Subject: NIF doc official support note --- erts/doc/src/erl_nif.xml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 8d2913ba4f..8e4d8130f5 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -34,11 +34,10 @@ erl_nif API functions for an Erlang NIF library -

The NIF concept was introduced in R13B03 as an - EXPERIMENTAL feature. The interfaces may be changed in any way - in coming releases. The plan is however to lift the experimental label and - maintain interface backward compatibility from R14B.

-

Incompatible changes in R14A:

+

The NIF concept is officially supported from R14B. NIF source code + written for earlier experimental versions might need adaption to run on R14B.

+

No incompatible changes between R14B and R14A.

+

Incompatible changes between R14A and R13B04:

Environment argument removed for enif_alloc, enif_realloc, enif_free, enif_alloc_binary, @@ -50,14 +49,14 @@ Module argument added to enif_open_resource_type while changing name spaces of resource types from global to module local. -

Incompatible changes in R13B04:

+

Incompatible changes between R13B04 and R13B03:

The function prototypes of the NIFs have changed to expect argc and argv arguments. The arity of a NIF is by that no longer limited to 3. enif_get_data renamed as enif_priv_data. enif_make_string got a third argument for character encoding. -
+

A NIF library contains native implementation of some functions of an Erlang module. The native implemented functions (NIFs) are -- cgit v1.2.3