From dbeaca78bc6c0d4719a522e447fa59d7a1006ae0 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 5 Feb 2019 15:55:23 +0100 Subject: Introduce ei_init() You previously had to initialize ei via erl_init() which implied that you were forced to link against the erl_interface even when not using it (besides initializing ei). --- lib/erl_interface/doc/src/ei.xml | 15 +++++++++++++++ lib/erl_interface/doc/src/ei_users_guide.xml | 18 +++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) (limited to 'lib/erl_interface/doc') diff --git a/lib/erl_interface/doc/src/ei.xml b/lib/erl_interface/doc/src/ei.xml index 9502fb1ee7..a7cbf06085 100644 --- a/lib/erl_interface/doc/src/ei.xml +++ b/lib/erl_interface/doc/src/ei.xml @@ -732,6 +732,21 @@ ei_encode_tuple_header(buf, &i, 0); + + intei_init(void) + Initialize the ei library. + +

Initialize the ei library. This function should be called once + (and only once) before calling any other functionality in the ei + library. However, note the exception below.

+

If the ei library is used together with the erl_interface + library, this function should not be called directly. It will be + called by the erl_init() function which should be used to initialize + the combination of the two libraries instead.

+

On success zero is returned. On failure a posix error code is returned.

+
+
+ intei_print_term(FILE* fp, const char* buf, int* index) intei_s_print_term(char** s, const char* buf, int* index) diff --git a/lib/erl_interface/doc/src/ei_users_guide.xml b/lib/erl_interface/doc/src/ei_users_guide.xml index 0eed50b50b..2dfd99e35a 100644 --- a/lib/erl_interface/doc/src/ei_users_guide.xml +++ b/lib/erl_interface/doc/src/ei_users_guide.xml @@ -162,12 +162,20 @@ $ ld -L/usr/local/otp/lib/erl_interface-3.2.3/
- Initializing the Erl_Interface Library -

Before calling any of the other Erl_Interface functions, call - erl_init() exactly once to initialize the library. + Initializing the Libraries +

+ Before calling any of the other functions in the erl_interface + and ei libraries, call erl_init() exactly once to initialize + both libraries. erl_init() takes two arguments. However, the arguments - are no longer used by Erl_Interface and are therefore to be - specified as erl_init(NULL,0).

+ are no longer used by erl_interface and are therefore to be + specified as erl_init(NULL,0). +

+

+ If you only use the ei library, instead initialize it by calling + ei_init() exactly once before calling any other functions in + the ei library. +

-- cgit v1.2.3