aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/legacy
AgeCommit message (Collapse)Author
2019-02-05Introduce ei_init()Rickard Green
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).
2019-01-23Pluggable distribution socket implementation for EIRickard Green
2018-08-14Fixed bug calling erl_compare_ext with terms containing listsSimon Cornish
The comparison did not consider the list tail and therefore would consider the following pairs of terms equal: {<<1,2,3>>, [901,902], 224} and {<<1,2,3>>, [901,902], 228} {a|b} and {a|c}
2018-06-18Update copyright yearHenrik Nord
2018-04-21erl_interface: fix bad memsetMikael Pettersson
Compiling OTP-20.3.4 with GCC-7 generates the following warning: CC /tmp/otp_src_20.3.4/lib/erl_interface/obj.st/x86_64-unknown-linux-gnu/erl_marshal.o legacy/erl_marshal.c: In function 'erl_init_marshal': legacy/erl_marshal.c:110:5: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] memset(cmp_array, 0, CMP_ARRAY_SIZE); ^~~~~~ CMP_ARRAY_SIZE (256) is the number of elements in that array, but the elements are not char but enum, which is 4 bytes on e.g. x86-64. This results in 3/4 of the array not being correctly initialized. Idiomatic C is to pass sizeof cmp_array to memset(), so that's what I did.
2017-05-04Update copyright yearRaimo Niskanen
2017-03-08erl_interface: Do not generate atoms on old latin1 ext formatSverker Eriksson
Solved by letting ei_encode_atom_as ignore 'to_enc' argument and always encode in UTF8 format.
2017-02-14Fixed typos in lib/erl_interfaceAndrew Dryga
2016-06-13Fix decoding of LLONG_MIN in erl_decodeBjörn-Egil Dahlberg
Reported-by: Peter Lemenkov
2016-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-04-07erl_interface: Support 32-bit creation for pid,port,refsSverker Eriksson
2016-03-15update copyright-yearHenrik Nord
2015-06-18Change license text to APLv2Bruce Yinhe
2015-06-02erl_interface: Surround isfinite with HAVE_ISFINITE conditionalBjörn-Egil Dahlberg
2015-06-02erl_interface: Use isfinite instead of fpclassifyBjörn-Egil Dahlberg
2015-03-19Do not accept Nan and Infinity valuesDavid N. Welton
Erlang does not accept these values, so we return an error in the C interface rather than letting them through to the Erlang VM, which rejects the message with a somewhat cryptic "bad external term".
2014-08-25Fix misspellings of 'another'Tuncer Ayaz
2013-12-02Silence two warnings about tests being always trueAnthony Ramine
encode/encode_ulonglong.c:55:25: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare] if ((p < 256) && (p >= 0)) { ~ ^ ~ legacy/erl_marshal.c:293:24: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare] if ((ul < 256) && (ul >= 0)) { ~~ ^ ~
2013-09-12Remove ^L characters hidden randomly in the code. Not those used in text ↵Pierre Fenoll
files as delimiters. While working on a tool that processes Erlang code and testing it against this repo, I found out about those little sneaky 0xff. I thought it may be of help to other people build such tools to remove non-conforming-to-standard characters.
2013-02-18erl_interface,ic: Remove node_org_enc from erlang_{pid,port,ref}Sverker Eriksson
in order to be backward compatible with user code that accesses the members of erlang_pid and friend. The documentation does not mention the content of these structs, but we have example code that does. So the safe way it the revert the node_org_enc field (added in R16A) and instead determine in runtime which atom encoding to use depending on if the node atom contains unicode (>255) characters or not.
2013-02-07erl_interface: Change enum erlang_char_encoding to a typedefSverker Eriksson
to make the API independent of the actual type of erlang_char_encoding
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-23erl_interface: Changed erlang_char_encoding interfaceSverker Eriksson
to allow bitwise-or'd combinations.
2013-01-22erl_interface: even more utf8 atom stuffSverker Eriksson
2013-01-18erl_interface: utf8 atoms continuedSverker Eriksson
2013-01-08erl_interface: Enable decode of unicode atomsSverker Eriksson
No API changes or additions. Just the ability for erl_interface to decode unicode atoms and convert them into latin1 strings to preserve backward compatibility for the existing API.
2011-12-09Update copyright yearsBjörn-Egil Dahlberg
2011-12-08Only step pointer arity stepsLukas Larsson
Don't know why the 1 was there, it does however cause the buffer to overflow when decoding the atoms from rex. OTP-9799
2011-09-29Update copyright yearsBjörn-Egil Dahlberg
2011-09-06Changes inspired by running cppcheck(1)Christian von Roques
2011-05-11Merge branch 'gl/erl_do_receive_msg/OTP-9241' into devBjörn-Egil Dahlberg
* gl/erl_do_receive_msg/OTP-9241: The function 'erl_xreceive_msg' returned garbage in the 'to' and 'to_name' members of the message. The reason for that was found in the 'erl_do_receive_msg' function. When no 'pid' is provided by the sender, like when doing rpc calls as those uses registered name sends, it doesn't initialize the 'to' member and also the 'to_name' member is copied by the function.
2011-04-26The function 'erl_xreceive_msg' returned garbage in the 'to' and 'to_name' ↵Goran Larsson
members of the message. The reason for that was found in the 'erl_do_receive_msg' function. When no 'pid' is provided by the sender, like when doing rpc calls as those uses registered name sends, it doesn't initialize the 'to' member and also the 'to_name' member is copied by the function.
2011-04-13erl_interface: fix compile errorMichael Santos
2011-03-11Update copyright yearsBjörn-Egil Dahlberg
2011-02-22erl_interface: fix buffer overflowsMichael Santos
2010-12-10Fix wrong erl_compare_ext result comparing listsVitaliy Batichko
Function erl_compare_ext of erl_interface library returns 1 instead -1 when comparing lists like [0] and [0, 1000]. Credits to: Evgeny Khirin <evgeny.khirin <at> erlios.com>
2010-12-10Correct erl_global{register, unregister} functionsVitaliy Batichko
C node needs DFLAG_DIST_MONITOR flag set when connecting, and support for processing monitoring start/end messages received from counterpart, to make global registration actually work.
2010-11-25erl_interface: Fix erl_term_len for integers and refsSverker Eriksson
From R14B integers use all 32 bits of external format INTEGER_EXT. erl_term_len still had the 28-bit check and therefor returned a too large values (7 instead of 5) for integers of 29-32 bits. erl_term_len also returned a 2 bytes too small value for references.
2010-10-29ei: error if return value of ei_alloc_big is NULLMichael Santos
2010-07-05term_to_binary use all 32 bits of INTEGER_EXTSverker Eriksson
Earlier, external format INTEGER_EXT was only produced for 28-bit signed integers. Now full 32-bit signed integers are produced as INTEGER_EXT to avoid the more costly SMALL_BIG_EXT format. Both old and new code can read 32-bit INTEGER_EXT. Also fixed integer encoding bugs in erl_interface erl_encode/erl_decode. (Thanks to Alexander Demidenko for reporting)
2010-06-08Merge branch 'sv/serge-new_float_ext' into devErlang/OTP
* sv/serge-new_float_ext: Let ei_get_type() return ERL_FLOAT_EXT instead of NEW_FLOAT_EXT Fix ei_tmo to restrict dflags to NEW_FLOAT_EXT compact IEEE 754 double encoding in external binary format for ei fix typo in ei_decode_ei_term documentation OTP-8684 sv/serge-new_float_ext compact IEEE 754 double encoding in external binary format for ei Implement the compact IEEE 754 double encoding in external binary format for ei. Encoding for ei now always produces the NEW_FLOAT_EXT format. Decoding and term printing handle both the old ERL_FLOAT_EXT encoding and the new NEW_FLOAT_EXT encoding. Legacy erl_interface code also handles the new encoding, but still produces the ERL_FLOAT_EXT encoding by default. Also enable the DFLAG_NEW_FLOATS distribution flag. ei_get_type() will return ERL_FLOAT_EXT regardless if the external format is encoded with ERL_FLOAT_EXT or NEW_FLOAT_EXT for doubles. Reduce the number of copies of the code for encoding and decoding doubles throughout ei and erl_interface by instead calling the ei encoding and decoding functions wherever possible. Restore commented-out float tests in ei_decode_SUITE and ei_encode_SUITE in lib/erl_interface/test. Modify them to make them match the style of other tests in the same suites. These changes are based on an ei float patch from Serge Aleynikov originally submitted against R12B-2 in July 2008 and reworked by Steve Vinoski May 2010.
2010-06-07compact IEEE 754 double encoding in external binary format for eiSteve Vinoski
Implement the compact IEEE 754 double encoding in external binary format for ei. Encoding for ei now always produces the NEW_FLOAT_EXT format. Decoding and term printing handle both the old ERL_FLOAT_EXT encoding and the new NEW_FLOAT_EXT encoding. Legacy erl_interface code also handles the new encoding, but still produces the ERL_FLOAT_EXT encoding by default. Also enable the DFLAG_NEW_FLOATS distribution flag. Reduce the number of copies of the code for encoding and decoding doubles throughout ei and erl_interface by instead calling the ei encoding and decoding functions wherever possible. Restore commented-out float tests in ei_decode_SUITE and ei_encode_SUITE in lib/erl_interface/test. Modify them to make them match the style of other tests in the same suites. These changes are based on an ei float patch from Serge Aleynikov originally submitted against R12B-2 in July 2008.
2010-02-02Merge branch 'sf/erl_match-longlong' into ccase/r13b04_devErlang/OTP
* sf/erl_match-longlong: erl_interface: Allow erl_match() to match ERL_LONGLONG and ERL_U_LONGLONG terms OTP-8400 Allow erl_match() to match ERL_LONGLONG and ERL_U_LONGLONG terms (Thanks to Scott Lystig Fritchie).
2010-01-23erl_interface: Allow erl_match() to match ERL_LONGLONG and ERL_U_LONGLONG termsScott Lystig Fritchie
The Erlang/OTP distro now includes 90% of what's required to handle signed and unsigned ints up to 8 bytes long, so add this remaining (?) 10%.
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP