At 10:31 AM -0700 5/18/99, Tammy Cravit wrote:
>and have the packing/unpacking taken care of? Is this even possible? It seems
>that re-inventing the wheel for ever application is silly if there's a generic
>way to do it.
I think this would be challenging.
Certainly it's possible to abstract out enough of a structure definition so
that some piece of generic pack/unpack code can process it. There are even
some very high level programming languages that do this for you. (e.g.
NewtonScript frames.)
On the other hand, only the app that defines the structure really knows the
details of the data in it, and those details are precisely what's needed to
do the sort of packing and unpacking we're talking about.
The good news is it's generally not very much code. If you're just talking
about packing strings together to skip over the unused bytes in fixed size
buffers, it's nothing more than a bunch of StrCopy or StrNCopy calls. It's
hardly worth the effort to try to generalize something that simple.
--Bob