[erlang-questions] FFI Interface - Limitation of the size of parameters

Stasik <>
Fri Oct 10 18:30:41 CEST 2008


Hello,

I am quite new to Erland, and try to get some Erlang-C Communication.
I found a tutorial at http://www.wagerlabs.com/blog/2008/02/erlang-ffi---in.html
(which is a commented version of another tutorial, but it does not
matter). Well, I was successful to compile the example and its pretty
fine, BUT: I noticed that all exchanged parameters in port_driver.c
are chars i.e.:
- static void example_drv_output(ErlDrvData handle, char *buff, int
bufflen) //here the input array consists of chars
- driver_output(d->port, &res, 1); //here &res should point to a char,
driver_output is a predefined function in erl_driver.h
These limitations do not allow to send and receive any values which
are bigger then 255 (and I do not want to split bigger numbers in
bytes if there is a possibility to do it elegantly).

Well, is there a known solution for that problem? I would like to have
an int range.

Cheers,
Sten Gruener



More information about the erlang-questions mailing list