[erlang-questions] What is the best way to parse complex erlang terms in port drivers?

Zhemzhitsky Sergey Sergey_Zhemzhitsky@REDACTED
Fri Jun 8 17:15:53 CEST 2012

Hello Richard,

I'm very interested in the information and answers to the following points:

1. If there is ei API why there are no samples of how to use it here http://www.erlang.org/doc/tutorial/users_guide.html?
2. Why samples here http://www.erlang.org/doc/tutorial/erl_interface.html use ETERM API although the page is about erl interface (ei API?)?
3. I'd like to see more complex samples in the official docs, for examples how to parse a list of tagged tuples (proplist, etc.).
4. I'd like to know how to use ei API correctly. For example 
	1) ei_get_type(const char *buf, const int *index, int *type, int *size)  decodes type of the term. There is no documentation about possible values of the *type* parameter except for ei.h file.
	2) if ei_get_type returns ERL_INTEGER_EXT as a third parameter which of the following functions I have to use ei_decode_long, ei_decode_ulong, ei_decode_longlong, ei_decode_ulonglong to decode the term?
5. I'm also interested in what type of API is legal and recommended to use in c nodes, ports, port drivers. Is it possible to use ei, eterm, etc.? Is there any difference between usage of different api in c nodes, ports, port drivers?
6. I'd like see among the docs for memory, term, etc.-allocating functions information about corresponding disposing functions and whether it's necessary to call them or not.

Best Regards,

-----Original Message-----
From: Richard O'Keefe [mailto:ok@REDACTED] 
Sent: Friday, June 08, 2012 2:43 AM
To: Zhemzhitsky Sergey
Cc: erlang-questions@REDACTED
Subject: Re: [erlang-questions] What is the best way to parse complex erlang terms in port drivers?

On 7/06/2012, at 7:19 PM, Zhemzhitsky Sergey wrote:

> Hi Richard,
> Thanks a lot for answer. It is rather helpful.
>>> Why was it hard to see in the documentation?
> As I'm kinda a newbie at erlang I understand your indignation.

There was no indignation there.  There has been a lot of discussion here about documentation and what to do to improve it, and I really wanted to know what went wrong here.

Would it be sufficient to have a document "Exchanging data between Erlang and C : Overview"
with links between it and the libraries?

What would you like to see in examples?


The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. 
If you need assistance please contact our Contact Center  (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp  

More information about the erlang-questions mailing list