libmemcache - custom structures

Steven Grimm sgrimm at facebook.com
Sat Dec 9 19:01:56 UTC 2006


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
>  
>   
>> You might want to use strlen("obj") instead of sizeof("obj")...
>> /Stefan
>>     
>  
>   
>>> mc_set(mc, "obj", sizeof("obj"), &one, sizeof(person), 0, 0);
>>> sizeof("obj") - 1
>>> to avoid the NULL byte?
>>> --Iain
>>>       
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20061209/803ad136/attachment.html


More information about the memcached mailing list