libmemcache - custom structures

Jure Petrovic fonz at siol.net
Mon Dec 11 16:35:37 UTC 2006



You suggest using xdr.h library together with rpcgen generated function
for converting (encoding) the structure to a string, putting the string
to a memcached server and then reverse this procedure?

I'll try that...

I could use xdrmem_create(XDR *xdrs, char* addr, int size, xdr_op
operation) function, but how do I know, how big will the encoded
structure be?

Regards, 
Jure


On Sat, 2006-12-09 at 11:01 -0800, Steven Grimm wrote:
> You probably want something like Sun's old XDR library, part of its
> RPC package. Google for "rpcgen" and you should find it. You won't
> need the client and server code rpcgen generates, but the _xdr.c code
> should be about what you want.
> 
> -Steve
> 
> 
> Jure Petrovic wrote: 
> >  Hello, 
> >  
> >  Yes, I've seen this error just 3 minutes after posting to the list...
> >  That's what happens when you act before thinking...
> >  Thank you, guys :)
> >  
> >  What about storing something like this?
> >  
> >  typedef struct somestruct {
> >     int a;
> >     anotherstruct *b;
> >  } somestruct;
> >  
> >  Here i'd like to store the whole b also, as there is no use otherwise, 
> >  if you'd like to use it on another machine..
> >  
> >  Is there any automatic mechanism that "packs" everything together?
> >  Anyone found a good solution?
> >  
> >  Thanks, 
> >  Jure



More information about the memcached mailing list