libmemcache - custom structures

Jure Petrovic fonz at siol.net
Sat Dec 9 11:30:16 UTC 2006


 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
> 



More information about the memcached mailing list