diff options
Diffstat (limited to 'lib/erl_interface')
34 files changed, 256 insertions, 126 deletions
diff --git a/lib/erl_interface/configure.in b/lib/erl_interface/configure.in index 14f06f946f..53c2f7069c 100644 --- a/lib/erl_interface/configure.in +++ b/lib/erl_interface/configure.in @@ -61,7 +61,7 @@ fi TARGET=$host AC_SUBST(TARGET) -AC_CONFIG_HEADER([src/$host/config.h:config.h.in]) +AC_CONFIG_HEADER([src/$host/config.h:config.h.in include/$host/ei_config.h:include/ei_config.h.in]) dnl ---------------------------------------------------------------------- dnl Optional features @@ -184,6 +184,14 @@ AC_TRY_COMPILE([#include <sys/types.h> AC_DEFINE(HAVE_SOCKLEN_T, [], [Define if you have the `socklen_t' type])], [AC_MSG_RESULT(no)]) +AC_MSG_CHECKING([for deprecated attribute]) +AC_TRY_COMPILE([], +[void my_function(void) __attribute__((deprecated));], +[AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_DEPRECATED_ATTRIBUTE, [], [Define to 1 if you have the `deprecated' attribute])], +[AC_MSG_RESULT(no)]) + + # Checks for library functions. AC_FUNC_ALLOCA dnl AC_FUNC_FORK @@ -360,6 +368,7 @@ LDFLAGS="$LDFLAGS $sanitizers" # XXX # --------------------------------------------------------------------------- + AC_OUTPUT( src/$host/Makefile:src/Makefile.in src/$host/eidefs.mk:src/eidefs.mk.in diff --git a/lib/erl_interface/doc/src/ei.xml b/lib/erl_interface/doc/src/ei.xml index ae322255ad..2bdb390644 100644 --- a/lib/erl_interface/doc/src/ei.xml +++ b/lib/erl_interface/doc/src/ei.xml @@ -35,6 +35,9 @@ <lib>ei</lib> <libsummary>Routines for handling the Erlang binary term format.</libsummary> <description> + <note><p>The support for VxWorks is deprecated as of OTP 22, and + will be removed in OTP 23.</p></note> + <p>The library <c>ei</c> contains macros and functions to encode and decode the Erlang binary term format.</p> diff --git a/lib/erl_interface/doc/src/ei_connect.xml b/lib/erl_interface/doc/src/ei_connect.xml index e318dd6664..df40973270 100644 --- a/lib/erl_interface/doc/src/ei_connect.xml +++ b/lib/erl_interface/doc/src/ei_connect.xml @@ -34,6 +34,9 @@ <lib>ei_connect</lib> <libsummary>Communicate with distributed Erlang.</libsummary> <description> + <note><p>The support for VxWorks is deprecated as of OTP 22, and + will be removed in OTP 23.</p></note> + <p>This module enables C-programs to communicate with Erlang nodes, using the Erlang distribution over TCP/IP.</p> diff --git a/lib/erl_interface/doc/src/ei_users_guide.xml b/lib/erl_interface/doc/src/ei_users_guide.xml index 2dfd99e35a..7ca10d1a99 100644 --- a/lib/erl_interface/doc/src/ei_users_guide.xml +++ b/lib/erl_interface/doc/src/ei_users_guide.xml @@ -34,6 +34,18 @@ </header> <section> + <title>Deprecation and Removal</title> + <note><p>The support for VxWorks is deprecated as of OTP 22, and + will be removed in OTP 23.</p></note> + <note><p>The old legacy <c>erl_interface</c> library (functions + with prefix <c>erl_</c>) is deprecated as of OTP 22, and will be + removed in OTP 23. This does not apply to the <c>ei</c> + library. Reasonably new <c>gcc</c> compilers will issue deprecation + warnings. In order to disable these warnings, define the macro + <c>EI_NO_DEPR_WARN</c>.</p></note> + </section> + + <section> <title>Introduction</title> <p>The <c>Erl_Interface</c> library contains functions that help you integrate programs written in C and Erlang. The functions in diff --git a/lib/erl_interface/doc/src/erl_connect.xml b/lib/erl_interface/doc/src/erl_connect.xml index 139ac9e2f0..9492a82864 100644 --- a/lib/erl_interface/doc/src/erl_connect.xml +++ b/lib/erl_interface/doc/src/erl_connect.xml @@ -35,6 +35,15 @@ <lib>erl_connect</lib> <libsummary>Communicate with distributed Erlang.</libsummary> <description> + <note><p>The support for VxWorks is deprecated as of OTP 22, and + will be removed in OTP 23.</p></note> + <note><p>The old legacy <c>erl_interface</c> library (functions + with prefix <c>erl_</c>) is deprecated as of OTP 22, and will be + removed in OTP 23. This does not apply to the <c>ei</c> + library. Reasonably new <c>gcc</c> compilers will issue deprecation + warnings. In order to disable these warnings, define the macro + <c>EI_NO_DEPR_WARN</c>.</p></note> + <p>This module provides support for communication between distributed Erlang nodes and C-nodes, in a manner that is transparent to Erlang processes.</p> diff --git a/lib/erl_interface/doc/src/erl_eterm.xml b/lib/erl_interface/doc/src/erl_eterm.xml index 070ed30dfe..295760b4e6 100644 --- a/lib/erl_interface/doc/src/erl_eterm.xml +++ b/lib/erl_interface/doc/src/erl_eterm.xml @@ -35,6 +35,15 @@ <lib>erl_eterm</lib> <libsummary>Functions for Erlang term construction.</libsummary> <description> + <note><p>The support for VxWorks is deprecated as of OTP 22, and + will be removed in OTP 23.</p></note> + <note><p>The old legacy <c>erl_interface</c> library (functions + with prefix <c>erl_</c>) is deprecated as of OTP 22, and will be + removed in OTP 23. This does not apply to the <c>ei</c> + library. Reasonably new <c>gcc</c> compilers will issue deprecation + warnings. In order to disable these warnings, define the macro + <c>EI_NO_DEPR_WARN</c>.</p></note> + <p>This module provides functions for creating and manipulating Erlang terms.</p> diff --git a/lib/erl_interface/doc/src/erl_global.xml b/lib/erl_interface/doc/src/erl_global.xml index 72d43e81d5..39085b46f0 100644 --- a/lib/erl_interface/doc/src/erl_global.xml +++ b/lib/erl_interface/doc/src/erl_global.xml @@ -35,6 +35,15 @@ <lib>erl_global</lib> <libsummary>Access globally registered names.</libsummary> <description> + <note><p>The support for VxWorks is deprecated as of OTP 22, and + will be removed in OTP 23.</p></note> + <note><p>The old legacy <c>erl_interface</c> library (functions + with prefix <c>erl_</c>) is deprecated as of OTP 22, and will be + removed in OTP 23. This does not apply to the <c>ei</c> + library. Reasonably new <c>gcc</c> compilers will issue deprecation + warnings. In order to disable these warnings, define the macro + <c>EI_NO_DEPR_WARN</c>.</p></note> + <p>This module provides support for registering, looking up, and unregistering names in the <c>global</c> module. For more information, see diff --git a/lib/erl_interface/doc/src/erl_interface.xml b/lib/erl_interface/doc/src/erl_interface.xml index 4e66655b39..decd66046a 100644 --- a/lib/erl_interface/doc/src/erl_interface.xml +++ b/lib/erl_interface/doc/src/erl_interface.xml @@ -58,6 +58,18 @@ </list> <section> + <title>Deprecation and Removal</title> + <note><p>The support for VxWorks is deprecated as of OTP 22, and + will be removed in OTP 23.</p></note> + <note><p>The old legacy <c>erl_interface</c> library (functions + with prefix <c>erl_</c>) is deprecated as of OTP 22, and will be + removed in OTP 23. This does not apply to the <c>ei</c> + library. Reasonably new <c>gcc</c> compilers will issue deprecation + warnings. In order to disable these warnings, define the macro + <c>EI_NO_DEPR_WARN</c>.</p></note> + </section> + + <section> <title>Compiling and Linking Your Code</title> <p>In order to use any of the Erl_Interface functions, include the following lines in your code:</p> diff --git a/lib/erl_interface/doc/src/erl_malloc.xml b/lib/erl_interface/doc/src/erl_malloc.xml index aae3b7e078..6650620064 100644 --- a/lib/erl_interface/doc/src/erl_malloc.xml +++ b/lib/erl_interface/doc/src/erl_malloc.xml @@ -35,6 +35,14 @@ <lib>erl_malloc</lib> <libsummary>Memory allocation functions.</libsummary> <description> + <note><p>The support for VxWorks is deprecated as of OTP 22, and + will be removed in OTP 23.</p></note> + <note><p>The old legacy <c>erl_interface</c> library (functions + with prefix <c>erl_</c>) is deprecated as of OTP 22, and will be + removed in OTP 23. This does not apply to the <c>ei</c> + library. Reasonably new <c>gcc</c> compilers will issue deprecation + warnings. In order to disable these warnings, define the macro + <c>EI_NO_DEPR_WARN</c>.</p></note> <p>This module provides functions for allocating and deallocating memory.</p> </description> diff --git a/lib/erl_interface/doc/src/erl_marshal.xml b/lib/erl_interface/doc/src/erl_marshal.xml index 1a6d3bb43c..33d359d871 100644 --- a/lib/erl_interface/doc/src/erl_marshal.xml +++ b/lib/erl_interface/doc/src/erl_marshal.xml @@ -35,6 +35,14 @@ <lib>erl_marshal</lib> <libsummary>Encoding and decoding of Erlang terms.</libsummary> <description> + <note><p>The support for VxWorks is deprecated as of OTP 22, and + will be removed in OTP 23.</p></note> + <note><p>The old legacy <c>erl_interface</c> library (functions + with prefix <c>erl_</c>) is deprecated as of OTP 22, and will be + removed in OTP 23. This does not apply to the <c>ei</c> + library. Reasonably new <c>gcc</c> compilers will issue deprecation + warnings. In order to disable these warnings, define the macro + <c>EI_NO_DEPR_WARN</c>.</p></note> <p>This module contains functions for encoding Erlang terms into a sequence of bytes, and for decoding Erlang terms from a sequence of bytes.</p> diff --git a/lib/erl_interface/doc/src/ref_man.xml b/lib/erl_interface/doc/src/ref_man.xml index 1e20637cb7..a4f947c79f 100644 --- a/lib/erl_interface/doc/src/ref_man.xml +++ b/lib/erl_interface/doc/src/ref_man.xml @@ -29,6 +29,14 @@ <file>ref_man.xml</file> </header> <description> + <note><p>The support for VxWorks is deprecated as of OTP 22, and + will be removed in OTP 23.</p></note> + <note><p>The old legacy <c>erl_interface</c> library (functions + with prefix <c>erl_</c>) is deprecated as of OTP 22, and will be + removed in OTP 23. This does not apply to the <c>ei</c> + library. Reasonably new <c>gcc</c> compilers will issue deprecation + warnings. In order to disable these warnings, define the macro + <c>EI_NO_DEPR_WARN</c>.</p></note> </description> <xi:include href="ei.xml"/> <xi:include href="ei_connect.xml"/> diff --git a/lib/erl_interface/doc/src/ref_man_ei.xml b/lib/erl_interface/doc/src/ref_man_ei.xml index 92ff9ed328..d8d1deaea1 100644 --- a/lib/erl_interface/doc/src/ref_man_ei.xml +++ b/lib/erl_interface/doc/src/ref_man_ei.xml @@ -30,8 +30,14 @@ <file>ref_man_ei.xml</file> </header> <description> - <p>The <c>ei</c> library is a <c>C</c> interface library for - communication with <c>Erlang</c>.</p> + <note><p>The support for VxWorks is deprecated as of OTP 22, and + will be removed in OTP 23.</p></note> + <note><p>The old legacy <c>erl_interface</c> library (functions + with prefix <c>erl_</c>) is deprecated as of OTP 22, and will be + removed in OTP 23. This does not apply to the <c>ei</c> + library. Reasonably new <c>gcc</c> compilers will issue deprecation + warnings. In order to disable these warnings, define the macro + <c>EI_NO_DEPR_WARN</c>.</p></note> <note> <p>By default, the <c>ei</c> library is only guaranteed to be compatible with other Erlang/OTP components from the same diff --git a/lib/erl_interface/doc/src/ref_man_erl_interface.xml b/lib/erl_interface/doc/src/ref_man_erl_interface.xml index 4b1d0e9981..2b69d0fa74 100644 --- a/lib/erl_interface/doc/src/ref_man_erl_interface.xml +++ b/lib/erl_interface/doc/src/ref_man_erl_interface.xml @@ -30,6 +30,14 @@ <file>ref_man_erl_interface.xml</file> </header> <description> + <note><p>The support for VxWorks is deprecated as of OTP 22, and + will be removed in OTP 23.</p></note> + <note><p>The old legacy <c>erl_interface</c> library (functions + with prefix <c>erl_</c>) is deprecated as of OTP 22, and will be + removed in OTP 23. This does not apply to the <c>ei</c> + library. Reasonably new <c>gcc</c> compilers will issue deprecation + warnings. In order to disable these warnings, define the macro + <c>EI_NO_DEPR_WARN</c>.</p></note> <p>The <c>erl_interface</c> library is a <c>C</c> interface library for communication with <c>Erlang</c>.</p> <note> diff --git a/lib/erl_interface/include/ei.h b/lib/erl_interface/include/ei.h index ca4960b252..10a6e5bf50 100644 --- a/lib/erl_interface/include/ei.h +++ b/lib/erl_interface/include/ei.h @@ -47,6 +47,20 @@ typedef LONG_PTR ssize_t; /* Sigh... */ # include <netdb.h> #endif +#ifndef EI_INCLUDED_CONFIG_H__ +#include "ei_config.h" +#endif + +#if defined(HAVE_DEPRECATED_ATTRIBUTE) && !defined(EI_NO_DEPR_WARN) +#define EI_HAVE_DEPRECATED_ATTR__ 1 +#define EI_DEPRECATED_ATTR_NAME deprecated +#define EI_DEPRECATED_ATTR __attribute__((EI_DEPRECATED_ATTR_NAME)) +#else +#undef EI_HAVE_DEPRECATED_ATTR__ +#define EI_DEPRECATED_ATTR_NAME +#define EI_DEPRECATED_ATTR +#endif + /* -------------------------------------------------------------------- */ /* Defines part of API */ diff --git a/lib/erl_interface/include/ei_config.h.in b/lib/erl_interface/include/ei_config.h.in new file mode 100644 index 0000000000..dfcf676bed --- /dev/null +++ b/lib/erl_interface/include/ei_config.h.in @@ -0,0 +1,3 @@ + +/* Define to 1 if you have the `deprecated' attribute */ +#undef HAVE_DEPRECATED_ATTRIBUTE diff --git a/lib/erl_interface/include/erl_interface.h b/lib/erl_interface/include/erl_interface.h index c22f21af2b..7c87223a38 100644 --- a/lib/erl_interface/include/erl_interface.h +++ b/lib/erl_interface/include/erl_interface.h @@ -25,8 +25,6 @@ /* Note: the 'ei' interface is the prefered C API. */ /************************************************************************/ -/* FIXME only include if needed? */ - #include "ei.h" /* ei is the base */ /* -------------------------------------------------------------------- */ @@ -195,11 +193,11 @@ typedef struct { int lenL; } Erl_Atom_data; -char* erl_atom_ptr_latin1(Erl_Atom_data*); -char* erl_atom_ptr_utf8(Erl_Atom_data*); -int erl_atom_size_latin1(Erl_Atom_data*); -int erl_atom_size_utf8(Erl_Atom_data*); -char* erl_atom_init_latin1(Erl_Atom_data*, const char*); +char* erl_atom_ptr_latin1(Erl_Atom_data*) EI_DEPRECATED_ATTR; +char* erl_atom_ptr_utf8(Erl_Atom_data*) EI_DEPRECATED_ATTR; +int erl_atom_size_latin1(Erl_Atom_data*) EI_DEPRECATED_ATTR; +int erl_atom_size_utf8(Erl_Atom_data*) EI_DEPRECATED_ATTR; +char* erl_atom_init_latin1(Erl_Atom_data*, const char*) EI_DEPRECATED_ATTR; typedef struct { Erl_Header h; @@ -324,110 +322,117 @@ typedef unsigned char Erl_Heap; /* The functions */ /* -------------------------------------------------------------------- */ -void erl_init(void *x, long y); -void erl_set_compat_rel(unsigned); -int erl_connect_init(int, char*,short); -int erl_connect_xinit(char*,char*,char*,struct in_addr*,char*,short); -int erl_connect(char*); -int erl_xconnect(struct in_addr*,char *); -int erl_close_connection(int); -int erl_receive(int, unsigned char*, int); -int erl_receive_msg(int, unsigned char*, int, ErlMessage*); -int erl_xreceive_msg(int, unsigned char**, int*, ErlMessage*); -int erl_send(int, ETERM*, ETERM*); -int erl_reg_send(int, char*, ETERM*); -ETERM *erl_rpc(int,char*,char*,ETERM*); -int erl_rpc_to(int,char*,char*,ETERM*); -int erl_rpc_from(int,int,ErlMessage*); +void erl_init(void *x, long y) EI_DEPRECATED_ATTR; +void erl_set_compat_rel(unsigned) EI_DEPRECATED_ATTR; +int erl_connect_init(int, char*,short) EI_DEPRECATED_ATTR; +int erl_connect_xinit(char*,char*,char*,struct in_addr*,char*,short) EI_DEPRECATED_ATTR; +int erl_connect(char*) EI_DEPRECATED_ATTR; +int erl_xconnect(struct in_addr*,char *) EI_DEPRECATED_ATTR; +int erl_close_connection(int) EI_DEPRECATED_ATTR; +int erl_receive(int, unsigned char*, int) EI_DEPRECATED_ATTR; +int erl_receive_msg(int, unsigned char*, int, ErlMessage*) EI_DEPRECATED_ATTR; +int erl_xreceive_msg(int, unsigned char**, int*, ErlMessage*) EI_DEPRECATED_ATTR; +int erl_send(int, ETERM*, ETERM*) EI_DEPRECATED_ATTR; +int erl_reg_send(int, char*, ETERM*) EI_DEPRECATED_ATTR; +ETERM *erl_rpc(int,char*,char*,ETERM*) EI_DEPRECATED_ATTR; +int erl_rpc_to(int,char*,char*,ETERM*) EI_DEPRECATED_ATTR; +int erl_rpc_from(int,int,ErlMessage*) EI_DEPRECATED_ATTR; /* erl_publish returns open descriptor on success, or -1 */ -int erl_publish(int port); -int erl_accept(int,ErlConnect*); +int erl_publish(int port) EI_DEPRECATED_ATTR; +int erl_accept(int,ErlConnect*) EI_DEPRECATED_ATTR; -const char *erl_thiscookie(void); -const char *erl_thisnodename(void); -const char *erl_thishostname(void); -const char *erl_thisalivename(void); -short erl_thiscreation(void); +const char *erl_thiscookie(void) EI_DEPRECATED_ATTR; +const char *erl_thisnodename(void) EI_DEPRECATED_ATTR; +const char *erl_thishostname(void) EI_DEPRECATED_ATTR; +const char *erl_thisalivename(void) EI_DEPRECATED_ATTR; +short erl_thiscreation(void) EI_DEPRECATED_ATTR; /* returns 0 on success, -1 if node not known to epmd or epmd not reached */ -int erl_unpublish(const char *alive); +int erl_unpublish(const char *alive) EI_DEPRECATED_ATTR; + +#ifdef EI_HAVE_DEPRECATED_ATTR__ +#define EI_DEPR_ATTR_EXTRA , EI_DEPRECATED_ATTR_NAME +#else +#define EI_DEPR_ATTR_EXTRA +#endif + /* Report generic error to stderr. */ void erl_err_msg(const char * __template, ...) - __attribute__ ((__format__ (printf, 1, 2))); + __attribute__ ((__format__ (printf, 1, 2) EI_DEPR_ATTR_EXTRA)) ; /* Report generic error to stderr and die. */ void erl_err_quit(const char * __template, ...) - __attribute__ ((__format__ (printf, 1, 2), __noreturn__)); + __attribute__ ((__format__ (printf, 1, 2), __noreturn__ EI_DEPR_ATTR_EXTRA)); /* Report system/libc error to stderr. */ void erl_err_ret(const char * __template, ...) - __attribute__ ((__format__ (printf, 1, 2))); + __attribute__ ((__format__ (printf, 1, 2) EI_DEPR_ATTR_EXTRA)); /* Report system/libc error to stderr and die. */ void erl_err_sys(const char * __template, ...) - __attribute__ ((__format__ (printf, 1, 2), __noreturn__)); - -ETERM *erl_cons(ETERM*,ETERM*); -ETERM *erl_copy_term(const ETERM*); -ETERM *erl_element(int,const ETERM*); - -ETERM *erl_hd(const ETERM*); -ETERM* erl_iolist_to_binary(const ETERM* term); -char* erl_iolist_to_string(const ETERM* term); -int erl_iolist_length(const ETERM*); -int erl_length(const ETERM*); -ETERM *erl_mk_atom(const char*); -ETERM *erl_mk_binary(const char*,int); -ETERM *erl_mk_empty_list(void); -ETERM *erl_mk_estring(const char*, int); -ETERM *erl_mk_float(double); -ETERM *erl_mk_int(int); -ETERM *erl_mk_longlong(long long); -ETERM *erl_mk_list(ETERM**,int); -ETERM *erl_mk_pid(const char*,unsigned int,unsigned int,unsigned char); -ETERM *erl_mk_port(const char*,unsigned int,unsigned char); -ETERM *erl_mk_ref(const char*,unsigned int,unsigned char); + __attribute__ ((__format__ (printf, 1, 2), __noreturn__ EI_DEPR_ATTR_EXTRA)); + +ETERM *erl_cons(ETERM*,ETERM*) EI_DEPRECATED_ATTR; +ETERM *erl_copy_term(const ETERM*) EI_DEPRECATED_ATTR; +ETERM *erl_element(int,const ETERM*) EI_DEPRECATED_ATTR; + +ETERM *erl_hd(const ETERM*) EI_DEPRECATED_ATTR; +ETERM* erl_iolist_to_binary(const ETERM* term) EI_DEPRECATED_ATTR; +char* erl_iolist_to_string(const ETERM* term) EI_DEPRECATED_ATTR; +int erl_iolist_length(const ETERM*) EI_DEPRECATED_ATTR; +int erl_length(const ETERM*) EI_DEPRECATED_ATTR; +ETERM *erl_mk_atom(const char*) EI_DEPRECATED_ATTR; +ETERM *erl_mk_binary(const char*,int) EI_DEPRECATED_ATTR; +ETERM *erl_mk_empty_list(void) EI_DEPRECATED_ATTR; +ETERM *erl_mk_estring(const char*, int) EI_DEPRECATED_ATTR; +ETERM *erl_mk_float(double) EI_DEPRECATED_ATTR; +ETERM *erl_mk_int(int) EI_DEPRECATED_ATTR; +ETERM *erl_mk_longlong(long long) EI_DEPRECATED_ATTR; +ETERM *erl_mk_list(ETERM**,int) EI_DEPRECATED_ATTR; +ETERM *erl_mk_pid(const char*,unsigned int,unsigned int,unsigned char) EI_DEPRECATED_ATTR; +ETERM *erl_mk_port(const char*,unsigned int,unsigned char) EI_DEPRECATED_ATTR; +ETERM *erl_mk_ref(const char*,unsigned int,unsigned char) EI_DEPRECATED_ATTR; ETERM *erl_mk_long_ref(const char*,unsigned int,unsigned int, - unsigned int,unsigned char); -ETERM *erl_mk_string(const char*); -ETERM *erl_mk_tuple(ETERM**,int); -ETERM *erl_mk_uint(unsigned int); -ETERM *erl_mk_ulonglong(unsigned long long); -ETERM *erl_mk_var(const char*); -int erl_print_term(FILE*,const ETERM*); -/* int erl_sprint_term(char*,const ETERM*); */ -int erl_size(const ETERM*); -ETERM *erl_tl(const ETERM*); -ETERM *erl_var_content(const ETERM*, const char*); - -ETERM *erl_format(char*, ... ); -int erl_match(ETERM*, ETERM*); - -char **erl_global_names(int fd, int *count); -int erl_global_register(int fd, const char *name, ETERM *pid); -int erl_global_unregister(int fd, const char *name); -ETERM *erl_global_whereis(int fd, const char *name, char *node); - -void erl_init_malloc(Erl_Heap*,long); -ETERM *erl_alloc_eterm(unsigned char); -void erl_eterm_release(void); -void erl_eterm_statistics(unsigned long*,unsigned long*); -void erl_free_array(ETERM**,int); -void erl_free_term(ETERM*); -void erl_free_compound(ETERM*); -void *erl_malloc(long); -void erl_free(void*); - -int erl_compare_ext(unsigned char*, unsigned char*); -ETERM *erl_decode(unsigned char*); -ETERM *erl_decode_buf(unsigned char**); -int erl_encode(ETERM*,unsigned char*t); -int erl_encode_buf(ETERM*,unsigned char**); -int erl_ext_size(unsigned char*); -unsigned char erl_ext_type(unsigned char*); /* Note: returned 'char' before R9C */ -unsigned char *erl_peek_ext(unsigned char*,int); -int erl_term_len(ETERM*); - -int cmp_latin1_vs_utf8(const char* sL, int lenL, const char* sU, int lenU); + unsigned int,unsigned char) EI_DEPRECATED_ATTR; +ETERM *erl_mk_string(const char*) EI_DEPRECATED_ATTR; +ETERM *erl_mk_tuple(ETERM**,int) EI_DEPRECATED_ATTR; +ETERM *erl_mk_uint(unsigned int) EI_DEPRECATED_ATTR; +ETERM *erl_mk_ulonglong(unsigned long long) EI_DEPRECATED_ATTR; +ETERM *erl_mk_var(const char*) EI_DEPRECATED_ATTR; +int erl_print_term(FILE*,const ETERM*) EI_DEPRECATED_ATTR; +/* int erl_sprint_term(char*,const ETERM*) EI_DEPRECATED_ATTR; */ +int erl_size(const ETERM*) EI_DEPRECATED_ATTR; +ETERM *erl_tl(const ETERM*) EI_DEPRECATED_ATTR; +ETERM *erl_var_content(const ETERM*, const char*) EI_DEPRECATED_ATTR; + +ETERM *erl_format(char*, ... ) EI_DEPRECATED_ATTR; +int erl_match(ETERM*, ETERM*) EI_DEPRECATED_ATTR; + +char **erl_global_names(int fd, int *count) EI_DEPRECATED_ATTR; +int erl_global_register(int fd, const char *name, ETERM *pid) EI_DEPRECATED_ATTR; +int erl_global_unregister(int fd, const char *name) EI_DEPRECATED_ATTR; +ETERM *erl_global_whereis(int fd, const char *name, char *node) EI_DEPRECATED_ATTR; + +void erl_init_malloc(Erl_Heap*,long) EI_DEPRECATED_ATTR; +ETERM *erl_alloc_eterm(unsigned char) EI_DEPRECATED_ATTR; +void erl_eterm_release(void) EI_DEPRECATED_ATTR; +void erl_eterm_statistics(unsigned long*,unsigned long*) EI_DEPRECATED_ATTR; +void erl_free_array(ETERM**,int) EI_DEPRECATED_ATTR; +void erl_free_term(ETERM*) EI_DEPRECATED_ATTR; +void erl_free_compound(ETERM*) EI_DEPRECATED_ATTR; +void *erl_malloc(long) EI_DEPRECATED_ATTR; +void erl_free(void*) EI_DEPRECATED_ATTR; + +int erl_compare_ext(unsigned char*, unsigned char*) EI_DEPRECATED_ATTR; +ETERM *erl_decode(unsigned char*) EI_DEPRECATED_ATTR; +ETERM *erl_decode_buf(unsigned char**) EI_DEPRECATED_ATTR; +int erl_encode(ETERM*,unsigned char*t) EI_DEPRECATED_ATTR; +int erl_encode_buf(ETERM*,unsigned char**) EI_DEPRECATED_ATTR; +int erl_ext_size(unsigned char*) EI_DEPRECATED_ATTR; +unsigned char erl_ext_type(unsigned char*) EI_DEPRECATED_ATTR; /* Note: returned 'char' before R9C */ +unsigned char *erl_peek_ext(unsigned char*,int) EI_DEPRECATED_ATTR; +int erl_term_len(ETERM*) EI_DEPRECATED_ATTR; + +int cmp_latin1_vs_utf8(const char* sL, int lenL, const char* sU, int lenU) EI_DEPRECATED_ATTR; /* -------------------------------------------------------------------- */ /* Wrappers around ei functions */ @@ -437,29 +442,29 @@ int cmp_latin1_vs_utf8(const char* sL, int lenL, const char* sU, int lenU); * Undocumented before R9C, included for compatibility with old code */ -struct hostent *erl_gethostbyname(const char *name); -struct hostent *erl_gethostbyaddr(const char *addr, int len, int type); +struct hostent *erl_gethostbyname(const char *name) EI_DEPRECATED_ATTR; +struct hostent *erl_gethostbyaddr(const char *addr, int len, int type) EI_DEPRECATED_ATTR; struct hostent *erl_gethostbyname_r(const char *name, struct hostent *hostp, char *buffer, int buflen, - int *h_errnop); + int *h_errnop) EI_DEPRECATED_ATTR; struct hostent *erl_gethostbyaddr_r(const char *addr, int length, int type, struct hostent *hostp, char *buffer, int buflen, - int *h_errnop); + int *h_errnop) EI_DEPRECATED_ATTR; /* * Undocumented, included for compatibility with old code */ -void erl_init_resolve(void); -int erl_distversion(int fd); -int erl_epmd_connect(struct in_addr *inaddr); -int erl_epmd_port(struct in_addr *inaddr, const char *alive, int *dist); +void erl_init_resolve(void) EI_DEPRECATED_ATTR; +int erl_distversion(int fd) EI_DEPRECATED_ATTR; +int erl_epmd_connect(struct in_addr *inaddr) EI_DEPRECATED_ATTR; +int erl_epmd_port(struct in_addr *inaddr, const char *alive, int *dist) EI_DEPRECATED_ATTR; #ifdef __cplusplus } diff --git a/lib/erl_interface/src/Makefile.in b/lib/erl_interface/src/Makefile.in index b05d494884..1b19a85f1e 100644 --- a/lib/erl_interface/src/Makefile.in +++ b/lib/erl_interface/src/Makefile.in @@ -118,7 +118,7 @@ else AR_FLAGS=rcv endif -INCFLAGS = -I. -I../include -Iconnect -Iencode -Idecode -Imisc -Iepmd \ +INCFLAGS = -I. -I../include -I../include/$(TARGET) -Iconnect -Iencode -Idecode -Imisc -Iepmd \ -Iregistry -I$(TARGET) ifeq ($(USING_VC),yes) @@ -127,6 +127,8 @@ else WARNFLAGS = @WFLAGS@ endif +WARNFLAGS += -DEI_NO_DEPR_WARN + CFLAGS = @LIB_CFLAGS@ $(WARNFLAGS) $(INCFLAGS) $(TYPE_FLAGS) PROG_CFLAGS = @CFLAGS@ $(WARNFLAGS) $(INCFLAGS) $(TYPE_FLAGS) -Ilegacy @@ -320,7 +322,8 @@ HEADERS = \ ../include/ei.h \ ../include/ei_connect.h \ ../include/eicode.h \ - ../include/erl_interface.h + ../include/erl_interface.h \ + ../include/$(TARGET)/ei_config.h EISOURCES = \ $(CONNECTSRC) \ diff --git a/lib/erl_interface/src/misc/eidef.h b/lib/erl_interface/src/misc/eidef.h index f38824d826..083814c6e9 100644 --- a/lib/erl_interface/src/misc/eidef.h +++ b/lib/erl_interface/src/misc/eidef.h @@ -25,6 +25,7 @@ /* Common definitions used in ei user interface */ +#define EI_INCLUDED_CONFIG_H__ #include "config.h" /* Central include of config.h */ /* vxWorks.h needs to be before stddef.h */ diff --git a/lib/erl_interface/test/all_SUITE_data/Makefile.src b/lib/erl_interface/test/all_SUITE_data/Makefile.src index 4f27b097c8..57e522fd3e 100644 --- a/lib/erl_interface/test/all_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/all_SUITE_data/Makefile.src @@ -21,8 +21,8 @@ include @erl_interface_mk_include@ CC0 = @CC@ CC = .@DS@gccifier@exe@ -CC"$(CC0)" -CFLAGS0 = @CFLAGS@ -I@erl_interface_include@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ +CFLAGS0 = @CFLAGS@ -I@erl_interface_include@ @erl_interface_target_include@ +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ EI_COMMON_OBJS = runner@obj@ ei_runner@obj@ ALL_OBJS = gccifier@exe@ $(EI_COMMON_OBJS) diff --git a/lib/erl_interface/test/ei_accept_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_accept_SUITE_data/Makefile.src index 10ef437f8b..76dc84221f 100644 --- a/lib/erl_interface/test/ei_accept_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/ei_accept_SUITE_data/Makefile.src @@ -27,7 +27,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/ei_runner@obj@ \ $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data EI_ACCEPT_OBJS = ei_accept_test@obj@ ei_accept_test_decl@obj@ EIACCNODE_OBJS = eiaccnode@obj@ diff --git a/lib/erl_interface/test/ei_connect_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_connect_SUITE_data/Makefile.src index c2d8261dd8..d1694e607d 100644 --- a/lib/erl_interface/test/ei_connect_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/ei_connect_SUITE_data/Makefile.src @@ -28,7 +28,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/ei_runner@obj@ \ $(LIBERL) $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data EI_CONNECT_OBJS = ei_connect_test@obj@ ei_connect_test_decl@obj@ EINODE_OBJS = einode@obj@ diff --git a/lib/erl_interface/test/ei_decode_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_decode_SUITE_data/Makefile.src index e678914a40..76591d893c 100644 --- a/lib/erl_interface/test/ei_decode_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/ei_decode_SUITE_data/Makefile.src @@ -27,7 +27,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/ei_runner@obj@ \ $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data EI_DECODE_OBJS = ei_decode_test@obj@ ei_decode_test_decl@obj@ all: ei_decode_test@exe@ diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.src index 853fe9ddeb..3f5fa4f295 100644 --- a/lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.src @@ -27,7 +27,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/ei_runner@obj@ \ $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data EI_DECODE_ENCODE_OBJS = ei_decode_encode_test@obj@ ei_decode_encode_test_decl@obj@ all: ei_decode_encode_test@exe@ diff --git a/lib/erl_interface/test/ei_encode_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_encode_SUITE_data/Makefile.src index 3b2cab7af4..489382d85e 100644 --- a/lib/erl_interface/test/ei_encode_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/ei_encode_SUITE_data/Makefile.src @@ -27,7 +27,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/ei_runner@obj@ \ $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data EI_ENCODE_OBJS = ei_encode_test@obj@ ei_encode_test_decl@obj@ all: ei_encode_test@exe@ diff --git a/lib/erl_interface/test/ei_format_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_format_SUITE_data/Makefile.src index b89dcae45a..9e5a271db6 100644 --- a/lib/erl_interface/test/ei_format_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/ei_format_SUITE_data/Makefile.src @@ -27,7 +27,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/ei_runner@obj@ \ $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data EI_FORMAT_OBJS = ei_format_test@obj@ ei_format_test_decl@obj@ all: ei_format_test@exe@ diff --git a/lib/erl_interface/test/ei_print_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_print_SUITE_data/Makefile.src index 150c11b99c..354011f1a5 100644 --- a/lib/erl_interface/test/ei_print_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/ei_print_SUITE_data/Makefile.src @@ -27,7 +27,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/ei_runner@obj@ \ $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data EI_PRINT_OBJS = ei_print_test@obj@ ei_print_test_decl@obj@ all: ei_print_test@exe@ diff --git a/lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.src index b4ee361939..76a9c6a606 100644 --- a/lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.src @@ -27,7 +27,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/ei_runner@obj@ \ $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data EI_TMO_OBJS = ei_tmo_test@obj@ ei_tmo_test_decl@obj@ all: ei_tmo_test@exe@ diff --git a/lib/erl_interface/test/erl_connect_SUITE_data/Makefile.src b/lib/erl_interface/test/erl_connect_SUITE_data/Makefile.src index ff4c382c97..19b076794a 100644 --- a/lib/erl_interface/test/erl_connect_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/erl_connect_SUITE_data/Makefile.src @@ -28,7 +28,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/runner@obj@ \ $(LIBERL) $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data OBJS = erl_connect_test@obj@ erl_connect_test_decl@obj@ all: erl_connect_test@exe@ diff --git a/lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.src b/lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.src index 4b1ddf77b6..cd4de56d7c 100644 --- a/lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.src @@ -28,7 +28,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/runner@obj@ \ $(LIBERL) $(LIBEI) @erl_interface_sock_libs@ @LIBS@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data ETERM_OBJS = eterm_test@obj@ eterm_test_decl@obj@ CNODE_OBJS = cnode@obj@ PRINT_OBJS = print_term@obj@ diff --git a/lib/erl_interface/test/erl_ext_SUITE_data/Makefile.src b/lib/erl_interface/test/erl_ext_SUITE_data/Makefile.src index fe8caebbd6..50b60637cd 100644 --- a/lib/erl_interface/test/erl_ext_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/erl_ext_SUITE_data/Makefile.src @@ -28,7 +28,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/runner@obj@ \ $(LIBERL) $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data EXT_OBJS = ext_test@obj@ ext_test_decl@obj@ all: ext_test@exe@ diff --git a/lib/erl_interface/test/erl_format_SUITE_data/Makefile.src b/lib/erl_interface/test/erl_format_SUITE_data/Makefile.src index 2ba59ab651..7d51cd6007 100644 --- a/lib/erl_interface/test/erl_format_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/erl_format_SUITE_data/Makefile.src @@ -28,7 +28,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/runner@obj@ \ $(LIBERL) $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data FORMAT_OBJS = format_test@obj@ format_test_decl@obj@ all: format_test@exe@ diff --git a/lib/erl_interface/test/erl_global_SUITE_data/Makefile.src b/lib/erl_interface/test/erl_global_SUITE_data/Makefile.src index 1c1530d1b6..9f2a8619ac 100644 --- a/lib/erl_interface/test/erl_global_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/erl_global_SUITE_data/Makefile.src @@ -28,7 +28,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/runner@obj@ \ $(LIBERL) $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data OBJS = erl_global_test@obj@ erl_global_test_decl@obj@ all: erl_global_test@exe@ diff --git a/lib/erl_interface/test/erl_match_SUITE_data/Makefile.src b/lib/erl_interface/test/erl_match_SUITE_data/Makefile.src index 156214a269..56ed1df203 100644 --- a/lib/erl_interface/test/erl_match_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/erl_match_SUITE_data/Makefile.src @@ -28,7 +28,7 @@ LIBEI = @erl_interface_eilib@ LIBFLAGS = ../all_SUITE_data/runner@obj@ \ $(LIBERL) $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \ @erl_interface_threadlib@ -CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data +CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data MATCH_OBJS = match_test@obj@ match_test_decl@obj@ all: match_test@exe@ diff --git a/lib/erl_interface/test/port_call_SUITE_data/Makefile.src b/lib/erl_interface/test/port_call_SUITE_data/Makefile.src index 0f97ce9f70..e09e0fe175 100644 --- a/lib/erl_interface/test/port_call_SUITE_data/Makefile.src +++ b/lib/erl_interface/test/port_call_SUITE_data/Makefile.src @@ -27,7 +27,7 @@ LIBERL = @erl_interface_lib_drv@ LIBEI = @erl_interface_eilib_drv@ SHLIB_EXTRA_LDLIBS = $(LIBERL) $(LIBEI) @erl_interface_threadlib@ -SHLIB_EXTRA_CFLAGS = -I@erl_interface_include@ -I../all_SUITE_data +SHLIB_EXTRA_CFLAGS = -I@erl_interface_include@ @erl_interface_target_include@ -I../all_SUITE_data all: port_call_drv@dll@ |