On Sat, Jan 26, 2002 at 02:33:49PM -0000, Laurence Mee wrote: > To be properly portable, you would need a function that takes the byte > stream and populated each of the structure's elements with the appropriate > data (or writes the structure's elements back to the byte stream). However, > I can't see this being that future proof either if you are going to change > the structures later.
This is what I was referring to. Perhaps the most elegant way would be to design a data description language and implement a parser. The program would read the format description and handle data accordingly. The downside of this approach is that it could be a little bit complex to implement and would impose some overhead to the runtime (both in terms of code size and time/memory utilization). A cheaper alternative would be to write a C code generator, emitting C code to encode/decode the stream from/to C structures. The data description language could be XML or Scheme for example (my vote would be for the latter, but YMMV). Marco -- ======================================================================== Marco Pantaleoni [EMAIL PROTECTED] Padova, Italy [EMAIL PROTECTED] elastiC language developer http://www.elasticworld.org -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
