[Nagiosplug-devel] Please can I have GIT access
Alain Williams
addw at phcomp.co.uk
Fri Sep 4 16:54:05 CEST 2009
On Fri, Sep 04, 2009 at 03:38:22PM +0100, Ton Voon wrote:
> >What I would like is to store/retrieve a blob (serialised string)
> >that I can
> >then unserialise to my taste. It might be nice to provide
> >serialisation routines,
> >this might be hard to generalise.
>
> I can picture how this works in perl, but I don't really know about C.
> (Can I get any arbitrary data structure back?)
Not unless you are told something about it -- ie you can't (as you can in Perl)
ask to see what the struct members are. All that you would prob have is it's
address, not even its size. If you had a generic routine you would need to
(for instance) give it an array to describe each member of the struct.
The array itself would be an array of [a different] struct that contained, for
each member: its offset, its type and perhaps a name. In fact it isn't hard to do.
--
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
Past chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h>
More information about the Devel
mailing list