File: interface.h

package info (click to toggle)
inn2 2.4.5-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 8,912 kB
  • ctags: 7,860
  • sloc: ansic: 85,104; perl: 11,427; sh: 9,863; makefile: 2,498; yacc: 1,563; python: 298; lex: 252; tcl: 7
file content (58 lines) | stat: -rw-r--r-- 2,289 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*  $Id: interface.h 5933 2002-12-07 09:47:17Z rra $
**
**  Storage Manager interface header
*/

#ifndef __INTERFACE_H__
#define __INTERFACE_H__

#include "config.h"
#include "storage.h"
#include <stdio.h>

typedef struct {
    bool	selfexpire;
    bool	expensivestat;
} SMATTRIBUTE;

typedef struct {
    const char          *name;
    unsigned char       type;
    bool                (*init)(SMATTRIBUTE *attr);
    TOKEN               (*store)(const ARTHANDLE article, const STORAGECLASS storageclass);
    ARTHANDLE           *(*retrieve)(const TOKEN token, const RETRTYPE amount);
    ARTHANDLE           *(*next)(const ARTHANDLE *article, const RETRTYPE amount);
    void                (*freearticle)(ARTHANDLE *article);
    bool                (*cancel)(TOKEN token);
    bool                (*ctl)(PROBETYPE type, TOKEN *token, void *value);
    bool                (*flushcacheddata)(FLUSHTYPE type);
    void                (*printfiles)(FILE *, TOKEN, char **xref, int ngroups);
    void                (*shutdown)(void);
} STORAGE_METHOD;

typedef struct __S_SUB__ {
    int                 type;        /* Index into storage_methods of the one to use */
    size_t              minsize;     /* Minimum size to send to this method */
    size_t              maxsize;     /* Maximum size to send to this method */
    time_t		minexpire;   /* Minimum expire offset to send method */
    time_t		maxexpire;   /* Maximum expire offset to send method */
    int                 numpatterns; /* Number of patterns in patterns */
    int                 class;       /* Number of the storage class for this subscription */
    char                *pattern;    /* Wildmat pattern to check against the
					groups to determine if the article
					should go to this method */
    char		*options;    /* additional options specific to the
				        method */
    bool		exactmatch;  /* all newsgroups to which article belongs
				        should match the patterns */
    struct __S_SUB__   *next;
} STORAGE_SUB;

extern bool SMopenmode;
extern bool SMpreopen;
char *SMFindBody(char *article, int len);
STORAGE_SUB *SMGetConfig(STORAGETYPE type, STORAGE_SUB *sub);
STORAGE_SUB *SMgetsub(const ARTHANDLE article);
void SMseterror(int errorno, char *error);

#endif /* __INTERFACE_H__ */