chiark / gitweb /
Unlink lockfiles for old feeds
[innduct.git] / history / hisinterface.h
1 /* $Id: hisinterface.h 5745 2002-09-08 19:52:12Z rra $
2 **
3 ** Interface to history API modules
4 */
5
6 #ifndef HISINTERFACE_H
7 #define HISINTERFACE_H
8
9 #include "config.h"
10 #include <sys/types.h>
11
12 struct token;
13 struct histopts;
14 struct history;
15
16 typedef struct hismethod {
17     const char *name;
18     void *(*open)(const char *path, int flags, struct history *);
19     bool (*close)(void *);
20     bool (*sync)(void *);
21     bool (*lookup)(void *, const char *, time_t *, time_t *, time_t *,
22                    struct token *);
23     bool (*check)(void *, const char *);
24     bool (*write)(void *, const char *, time_t, time_t, time_t,
25                   const struct token *);
26     bool (*replace)(void *, const char *, time_t, time_t, time_t,
27                     const struct token *);
28     bool (*expire)(void *, const char *, const char *, bool, void *, time_t,
29                    bool (*)(void *, time_t, time_t, time_t,
30                             struct token *));
31     bool (*walk)(void *, const char *, void *,
32                  bool (*)(void *, time_t, time_t, time_t,
33                           const struct token *));
34     bool (*remember)(void *, const char *, time_t);
35     bool (*ctl)(void *, int, void *);
36 } HIS_METHOD;
37
38 /* subordinate history manager private methods */
39 void his_seterror(struct history *, const char *);
40
41 enum { S_HIScacheadd, S_HIScachelookup, S_HISsetup, S_HISsync,
42        S_HISlogstats, S_HISclose, S_HISfilesfor, S_HIShavearticle,
43        S_HISwrite, S_HISremember, S_HIS_MAX };
44
45 /* fine grained history logging */
46 void his_logger(char *s, int code);
47 #endif