chiark / gitweb /
Commit 2.4.5-5 as unpacked
[inn-innduct.git] / storage / trash / trash.c
1 /*  $Id: trash.c 6124 2003-01-14 06:03:29Z rra $
2 **
3 **  Trashing articles method
4 */
5 #include "config.h"
6 #include "clibrary.h"
7 #include "libinn.h"
8 #include "methods.h"
9
10 #include "trash.h"
11
12 bool
13 trash_init(SMATTRIBUTE *attr)
14 {
15     if (attr == NULL) {
16         SMseterror(SMERR_INTERNAL, "attr is NULL");
17         return false;
18     }
19     attr->selfexpire = true;
20     attr->expensivestat = false;
21     return true;
22 }
23
24 TOKEN
25 trash_store(const ARTHANDLE article, const STORAGECLASS class)
26 {
27     TOKEN               token;
28
29     if (article.token == (TOKEN *)NULL)
30         memset(&token, '\0', sizeof(token));
31     else {
32         memcpy(&token, article.token, sizeof(token));
33         memset(&token.token, '\0', STORAGE_TOKEN_LENGTH);
34     }
35     token.type = TOKEN_TRASH;
36     token.class = class;
37     return token;
38 }
39
40 ARTHANDLE *
41 trash_retrieve(const TOKEN token, const RETRTYPE amount UNUSED)
42 {
43     if (token.type != TOKEN_TRASH) {
44         SMseterror(SMERR_INTERNAL, NULL);
45         return (ARTHANDLE *)NULL;
46     }
47     SMseterror(SMERR_NOENT, NULL);
48     return (ARTHANDLE *)NULL;
49 }
50
51 void
52 trash_freearticle(ARTHANDLE *article UNUSED)
53 {
54 }
55
56 bool
57 trash_cancel(TOKEN token UNUSED)
58 {
59     SMseterror(SMERR_NOENT, NULL);
60     return false;
61 }
62
63 bool
64 trash_ctl(PROBETYPE type, TOKEN *token UNUSED, void *value UNUSED)
65 {
66     switch (type) {
67     case SMARTNGNUM:
68     default:
69         return false;
70     }
71 }
72
73 bool
74 trash_flushcacheddata(FLUSHTYPE type UNUSED)
75 {
76     return true;
77 }
78
79 void
80 trash_printfiles(FILE *file UNUSED, TOKEN token UNUSED, char **xref UNUSED,
81                  int ngroups UNUSED)
82 {
83 }
84
85 ARTHANDLE *
86 trash_next(const ARTHANDLE *article UNUSED, const RETRTYPE amount UNUSED)
87 {
88     return NULL;
89 }
90
91 void
92 trash_shutdown(void)
93 {
94 }