database.h
Go to the documentation of this file.
1 /* Copyright (C) 2000-2004 Thomas Bopp, Thorsten Hampel, Ludger Merkens
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * $Id: database.h,v 1.1 2008/03/31 13:39:57 exodusd Exp $
18  */
19 
20 #ifndef _DATABASE_H
21 #define _DATABASE_H
22 
23 #define ID_DATABASE 1
24 
25 #define _SECURITY _Server->get_module("security")
26 #define _FILEPATH _Server->get_module("filepath:tree")
27 #define _TYPES _Server->get_module("types")
28 #define _LOG _Server->get_module("log")
29 
30 #define OBJ(s) _FILEPATH->path_to_object(s)
31 
32 #define MODULE_USERS (_Server ? _Server->get_module("users") : 0)
33 #define MODULE_GROUPS (_Server ? _Server->get_module("groups") : 0)
34 #define MODULE_OBJECTS (_Server ? _Server->get_module("objects") : 0)
35 #define MODULE_SMTP (_Server ? _Server->get_module("smtp") : 0)
36 #define MODULE_URL (_Server ? _Server->get_module("url") : 0)
37 #define MODULE_ICONS (_Server ? _Server->get_module("icons") : 0)
38 #define SECURITY_CACHE (_Server ? _Server->get_module("Security:cache"):0)
39 #define MODULE_SERVICE (_Server ? _Server->get_module("ServiceManager"):0)
40 
41 #define MOD(s) (_Server->get_module(s))
42 #define USER(s) MODULE_USERS->lookup(s)
43 #define GROUP(s) MODULE_GROUPS->lookup(s)
44 
45 #define _ROOTROOM _Persistence->lookup("rootroom")
46 #define _STEAMUSER _Persistence->lookup_group("steam")
47 #define _ROOT _Persistence->lookup_user("root")
48 #define _GUEST _Persistence->lookup_user("guest")
49 
50 #define _ADMIN _Persistence->lookup_group("admin")
51 #define _WORLDUSER _Persistence->lookup_group("everyone")
52 #define _AUTHORS _Persistence->lookup_group("authors")
53 #define _REVIEWER _Persistence->lookup_group("reviewer")
54 #define _BUILDER _Persistence->lookup_group("builder")
55 #define _CODER _Persistence->lookup_group("coder")
56 
57 
58 #define PSTAT_FAIL_DELETED -3
59 #define PSTAT_FAIL_UNSERIALIZE -2
60 #define PSTAT_FAIL_COMPILE -1
61 #define PSTAT_DISK 0
62 #define PSTAT_SAVE_OK 1
63 #define PSTAT_SAVE_PENDING 2
64 #define PSTAT_DELETED 3
65 
66 #define SAVE_INSERT 1
67 #define SAVE_REMOVE 2
68 #define SAVE_ORDER 3
69 
70 #define PSTAT_NAMES ({ "deletion failed", "unserialize failed","compile failed", \
71 "on disk", "Ok", "save pending", "deleted" })
72 
73 #define STORE_GROUP "group"
74 #define STORE_ATTRIB "attrib"
75 #define STORE_ACCESS "access"
76 #define STORE_DATA "data"
77 #define STORE_KEYWORDS "keyword"
78 #define STORE_EVENTS "events"
79 #define STORE_ANNOTS "annots"
80 #define STORE_REFS "refs"
81 #define STORE_CONTENT "content"
82 #define STORE_CONTAINER "container"
83 #define STORE_HTMLLINK "htmllink"
84 #define STORE_DOCLPC "doclpc"
85 #define STORE_LINK "link"
86 #define STORE_USER "user"
87 #define STORE_ATTREG "attreg"
88 #define STORE_ICONS "icons"
89 #define STORE_NEWSGRP "newsgrp"
90 #define STORE_QUOTA "quota"
91 #define STORE_SMTP "smtp"
92 #define STORE_TASKS "tasks"
93 #define STORE_TEMPOBJ "tempobj"
94 #define STORE_FORWARD "forward"
95 #define STORE_SERVERS "servers"
96 #define STORE_AUTH "auth"
97 #define STORE_DECORATIONS "decorations"
98 
99 #define PSTAT(i) PSTAT_NAMES[(i+3)]
100 #define OID_BITS 28
101 
102 #endif
103 
104 
105 
106 
107