erl-interface - ing type question

Shawn Pearce <>
Mon Mar 3 13:28:22 CET 2003


Well, since you are using the older erl_interface API, I offer two
options:

    - Upgrade your code to ei.  See the Erl_Interface Library Reference
	  and look at the ei and ei_connect functions, they have string
      handling functions builtin.

    - Use binaries.  Use list_to_binary/1 in Erlang to build up the
      binary and sent it to your process, and use ERL_BIN_SIZE(t)
      to discover the string length, and ERL_BIN_PTR(t) to get to the
      string.  You should be able to copy it out to a char* and use
      it as is.  Note that it won't be null byte terminated.

DANIESC SCHUTTE <> wrote:
> Thanks for the information so far
> 
> The only question now remains, as we have all the data in lists
> internally and need to pass it to the driver - what can be used
> to "receive" lists in c code, instead of ERL_ATOM_PTR - since the
> information in erlang will either have to be converted from list to
> atom - NOT GOOD - or I need to receive it in a list/s.

-- 
Shawn.

  Chicken Little was right.



More information about the erlang-questions mailing list