<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif">Hi Jovi,</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif">Since the communication
is in between Erlang and C nodes, you don't have to worry about
marshaling/un-marshaling the data at the Erlang node side. You can send and
receive 'messages' in the 'record tuple' format. But, at the C node side,
you have the work. You will have to hand code marshaling/un-marshaling routines
to populate the Erlang ‘records’ or to populate the C structures.</span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif">It very simple to edit C
structures into Erlang records. I don’t think you will have to invent an interpreter
for that. May be, you want to have a utility to generate marshaling/un-marshaling
routines in C, from your C structures.</span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif">If you are familiar with
C preprocessor techniques, you can simply write a reusable module to generate
marshaling/un-marshaling routines, and of course relevant Erlang records, with
the help of a ‘definition file’.</span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif">Kannan.</span></p><div><br></div><div><br><br><div class="gmail_quote">On Mon, Apr 16, 2012 at 3:03 PM, Jovi Zhang <span dir="ltr"><<a href="mailto:bookjovi@gmail.com">bookjovi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>Currently I'm working a Erlang project which need send msg represent by C language data structure.</div>
<div>I know that Erlang have record represent by tuple, Is there have any open source project aim on resolve this problem? </div>
<div>generate record format for C data structure automatically? note that there have many C data structure need to transform.</div><div><br></div><div>There have JSON and protobuf, but none is toward plain C data structure, I cannot change the message protocol now because Erlang node need to communicate with C node.  </div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>.jovi</div>
</font></span><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>