<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2002/07/71c26b67baafe720885c555fc4a75f00"
  from="Brian Naylor &lt;bwv211mail@y...&gt;"
  author="Brian Naylor"
  date="2002-07-19T06:18:40"
  subject="[Caml-list] serialize/deserialize"
  prev="2002/07/adb807c0494bb2efa45ae2255111211f"
  next="2002/07/a87458b34f17954225461279e156f79e"
  next-in-thread="2002/07/ba0baa32ded70571bcdb771a87128e9a"
  prev-thread="2002/07/1555d185cf3a3a8758041c92a7f7d521"
  next-thread="2002/07/1ba7258845ed8bd9491c0456e7a05b1e"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] serialize/deserialize">
<msg 
  url="2002/07/71c26b67baafe720885c555fc4a75f00"
  from="Brian Naylor &lt;bwv211mail@y...&gt;"
  author="Brian Naylor"
  date="2002-07-19T06:18:40"
  subject="[Caml-list] serialize/deserialize">
<msg 
  url="2002/07/ba0baa32ded70571bcdb771a87128e9a"
  from="Michael Hicks &lt;mwh@c...&gt;"
  author="Michael Hicks"
  date="2002-07-20T14:20:57"
  subject="RE: [Caml-list] serialize/deserialize">
</msg>
</msg>
</thread>

<contents>
I need to write my own marshalling functions for a network protocol stack. Is
there any way I can make use of the &lt;caml/intext.h&gt; serialization and
deserialization functions? Has anyone trod this path before me and is willing
to share their wisdom?

Why am I doing this, you ask? Bandwidth is critical, and custom marshalling can
save a lot of space - especially in getting rid of headers. Also, I want to do
things like serialize some info, add a MAC, then serialize some more. The
off-the-shelf solution is too space-inefficient:

let alen = Marshal.to_buffer buf ofs max adata [] in
let mac = Digest.substring buf ofs alen in
let blen = Marshal.to_buffer buf (ofs + alen) (max - alen) (mac, bdata) [] in
...

Thanks for any advice...

__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

