Natterings about history files
Alex Kiernan
alexk at demon.net
Tue Feb 6 17:43:53 UTC 2001
Russ Allbery <rra at stanford.edu> writes:
> The API that I'm currently considering is:
>
> struct history *HISopen(const char *path, int flags);
> bool HISclose(struct history *);
> bool HISsync(struct history *);
>
> void HISsetcache(struct history *, size_t size);
>
> bool HISlookup(struct history *, const char *key, time_t *arrived,
> time_t *posted, time_t *expires, TOKEN *token);
> bool HIScheck(struct history *, const char *key);
>
> bool HISwrite(struct history *, const char *key, time_t arrived,
> time_t posted, time_t expires, const TOKEN *token);
> bool HISreplace(struct history *, const char *key, time_t arrived,
> time_t posted, time_t expires, const TOKEN *token);
>
> bool HISexpire(struct history *, time_t threshold,
> bool (*exists)(TOKEN *));
>
> struct histstats *HISstats(struct history *);
>
> const char *HISerror(struct history *);
>
> I want to hide details like the hashing function used inside the history
> mechanism so that we can replace them and fiddle with them without having
> to worry about the interface. I'd also like to make the history struct
> opaque to all callers. The HISopen flags would be things like HIS_RDWR,
> HIS_READ, HIS_MMAP, HIS_CREATE, and the like and would use the path as the
> prefix (so, for example, the standard history file would be at
> concat(innconf->pathdb, "/history")).
>
OK, I'm a fairish chunk of the way there (at least for innd), but I'm
just trying to figure out if there's ever a need to return a "I've
seen that article but its expired" distinct from "I know nothing about
that article" from HISlookup - is there ever a need to retrieve the
fact that the history file knows posted/arrived information, but that
its been expired (other than via HIScheck)?
--
Alex Kiernan, Principal Engineer, Development, Thus PLC
More information about the inn-workers
mailing list