1 /* $Id: interface.h 5933 2002-12-07 09:47:17Z rra $
3 ** Storage Manager interface header
6 #ifndef __INTERFACE_H__
7 #define __INTERFACE_H__
21 bool (*init)(SMATTRIBUTE *attr);
22 TOKEN (*store)(const ARTHANDLE article, const STORAGECLASS storageclass);
23 ARTHANDLE *(*retrieve)(const TOKEN token, const RETRTYPE amount);
24 ARTHANDLE *(*next)(const ARTHANDLE *article, const RETRTYPE amount);
25 void (*freearticle)(ARTHANDLE *article);
26 bool (*cancel)(TOKEN token);
27 bool (*ctl)(PROBETYPE type, TOKEN *token, void *value);
28 bool (*flushcacheddata)(FLUSHTYPE type);
29 void (*printfiles)(FILE *, TOKEN, char **xref, int ngroups);
30 void (*shutdown)(void);
33 typedef struct __S_SUB__ {
34 int type; /* Index into storage_methods of the one to use */
35 size_t minsize; /* Minimum size to send to this method */
36 size_t maxsize; /* Maximum size to send to this method */
37 time_t minexpire; /* Minimum expire offset to send method */
38 time_t maxexpire; /* Maximum expire offset to send method */
39 int numpatterns; /* Number of patterns in patterns */
40 int class; /* Number of the storage class for this subscription */
41 char *pattern; /* Wildmat pattern to check against the
42 groups to determine if the article
43 should go to this method */
44 char *options; /* additional options specific to the
46 bool exactmatch; /* all newsgroups to which article belongs
47 should match the patterns */
48 struct __S_SUB__ *next;
51 extern bool SMopenmode;
52 extern bool SMpreopen;
53 char *SMFindBody(char *article, int len);
54 STORAGE_SUB *SMGetConfig(STORAGETYPE type, STORAGE_SUB *sub);
55 STORAGE_SUB *SMgetsub(const ARTHANDLE article);
56 void SMseterror(int errorno, char *error);
58 #endif /* __INTERFACE_H__ */