I want to be able to pass in a string – list – into a C node for Erlang and return back a string to the Erlang process after some computation.
result = function(input_string),
where input_string is of type ETERM *
My computation on the string uses char * variables for strings.
Please let me know if this is sufficient information to go on.
[The C node example in the erl_interface tutorial uses integer input to and output from the C node]
TIA,
BR,
Shailen
Use
erl_iolist_to_stringfor input (every Erlang “string” is also an iolist).Use
erl_mk_stringinstead oferl_mk_intfor output.http://erlang.org/doc/man/erl_eterm.html#erl_iolist_to_string
http://erlang.org/doc/man/erl_eterm.html#erl_mk_string