Convert C types to Erlang types

Paroli, Bernardo bparoli@REDACTED
Fri Dec 6 18:50:40 CET 2002


I'm make a server socket in Erlang and I send message from C client. The C client send the next message:

typedef struct
{
	int first;
	char second;
} Message;

char buf[1024];
Message*p;
p = (Message*) buf;

p->first   = 1567;
p->second = 's';

send(s, buf, sizeof(Message), 0);

In the Erlang server I'm receive the next binary message:
<<31,6,0,0,115,255,255,255>>

I need convernt this structure to the corresponding C structure. Exist in Erlang something function to make this conversion?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20021206/b7f0a384/attachment.htm>


More information about the erlang-questions mailing list