1 /* $Id: history.h 4916 2001-07-18 12:33:01Z alexk $
3 ** Interface to history API
9 #include <inn/defines.h>
14 ** ensure appropriate scoping; we don't pull inn/storage.h as we
15 ** don't need; our caller then has the option
21 ** structure giving cache statistics returned from HISstats
24 /* number of positive hits */
26 /* number of negative hits */
28 /* number of misses (positive hit, but not in cache) */
30 /* number of does not exists (negative hit, but not in cache) */
36 ** flags passed to HISopen
39 /* open database read only */
40 #define HIS_RDONLY (0)
42 /* open database read/write */
43 #define HIS_RDWR (1<<0)
46 #define HIS_CREAT (1<<1)
48 /* hint that the data should be kept on disk */
49 #define HIS_ONDISK (1<<2)
51 /* hint that the data should be kept in core */
52 #define HIS_INCORE (1<<3)
54 /* hint that the data should be kept mmap()ed */
55 #define HIS_MMAP (1<<4)
58 ** values passed to HISctl
61 /* (char **) get history path */
64 /* (char *) set history path */
67 /* (int) how many history writes may be outstanding */
70 /* (size_t) number of pairs for which the database should be sized */
73 /* (bool) Ignore old database during expire */
76 /* (time_t) interval, in s, between stats of the history database
77 * for * detecting a replacement, or 0 to disable (no checks);
78 * defaults {hisv6, taggedhash} */
83 struct history * HISopen(const char *, const char *, int);
84 bool HISclose(struct history *);
85 bool HISsync(struct history *);
86 void HISsetcache(struct history *, size_t);
87 bool HISlookup(struct history *, const char *, time_t *,
88 time_t *, time_t *, struct token *);
89 bool HIScheck(struct history *, const char *);
90 bool HISwrite(struct history *, const char *, time_t,
91 time_t, time_t, const struct token *);
92 bool HISremember(struct history *, const char *, time_t);
93 bool HISreplace(struct history *, const char *, time_t,
94 time_t, time_t, const struct token *);
95 bool HISexpire(struct history *, const char *, const char *,
97 bool (*)(void *, time_t, time_t, time_t,
99 bool HISwalk(struct history *, const char *, void *,
100 bool (*)(void *, time_t, time_t, time_t,
101 const struct token *));
102 struct histstats HISstats(struct history *);
103 const char * HISerror(struct history *);
104 bool HISctl(struct history *, int, void *);
105 void HISlogclose(void);
106 void HISlogto(const char *s);