On Fri, Sep 06, 2002 at 10:17:19AM +1000, Tim Potter wrote: > On Thu, Sep 05, 2002 at 12:15:36PM +0200, Rafal Szczesniak wrote: > > > This is first implementation of caching mechanism. It includes > > both lib/gencache.c code and utils/net_cache.c as command-line > > control/testing tool. > > > > comments are welcome > > Rafal, that looks pretty good. Since you ask, I do have a few comments. > (-: > > You assume that any cached data will be in null terminated string format > which is not always the case.
I understand this is a design property - it's up to the caller to mess with structs etc. This keeps the cache simple, and allows for human inspection with 'net cache' etc. > This is just my personal opinion but I would prefer for gencache_set to > crash if you pass it a NULL pointer for the key or value parameter. > Returning false in this case only hides the error until further along > in the execution path by which time it will be more difficult to track > down the original error. Agreed. Andrew Bartlett