R – C libraries for parsing Erlang binaries

c++erlang

I have an erlang server that will be communicating via tcp sockets with a client written in C. Are there any C libraries for parsing erlang binary terms to C structs?

I realize this is not absolutely necessary, but it would be very convenient.

Best Solution

I've crafted my own: EPAPI (Erlang Port API) in C/C++. Very easy to use and I provide a Debian repo for easy updates.

Example

 PktHandler *ph = new PktHandler();
 MsgHandler *mh = new MsgHandler(ph);

 //Register a message type
 // {echo, {Counter}}
 mh->registerType(1, "echo", "l" );

 //Wait for a message
 Msg *m;
 result = mh->rx(&m);

 //Verify return code
 if (result) {
    //handle error
    printf("ERROR, message: %s", mh->strerror());
    // ...
 }