Mercurial > noffle
annotate src/group.h @ 476:29cccddfc307 noffle
[svn] * Makefile.am,Makefile.in: Remove unnecessary install option -D and relace
all user.group params in chown with the more modern user:group. Rerun
automake. MacOS X doesn't have -D on its install and its chown whinges
about user.group. Thanks again to Andre Berger.
author | bears |
---|---|
date | Tue, 16 Mar 2004 11:44:43 +0000 |
parents | 93d5d8b098da |
children |
rev | line source |
---|---|
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
1 /* |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
2 group.h |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
3 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
4 Groups database |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
5 |
250 | 6 $Id: group.h 382 2002-06-05 22:03:44Z mirkol $ |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
7 */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
8 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
9 #ifndef GRP_H |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
10 #define GRP_H |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
11 |
45
32ba1198c6fa
[svn] * Makefile.in, configure, configure.in, docs/Makefile.in, src/Makefile.in:
uh1763
parents:
43
diff
changeset
|
12 #if HAVE_CONFIG_H |
32ba1198c6fa
[svn] * Makefile.in, configure, configure.in, docs/Makefile.in, src/Makefile.in:
uh1763
parents:
43
diff
changeset
|
13 #include <config.h> |
32ba1198c6fa
[svn] * Makefile.in, configure, configure.in, docs/Makefile.in, src/Makefile.in:
uh1763
parents:
43
diff
changeset
|
14 #endif |
32ba1198c6fa
[svn] * Makefile.in, configure, configure.in, docs/Makefile.in, src/Makefile.in:
uh1763
parents:
43
diff
changeset
|
15 |
54
125d79c9e586
[svn] * src/client.c, src/configfile.c, src/content.c, src/control.c,
uh1763
parents:
45
diff
changeset
|
16 #if TIME_WITH_SYS_TIME |
125d79c9e586
[svn] * src/client.c, src/configfile.c, src/content.c, src/control.c,
uh1763
parents:
45
diff
changeset
|
17 #include <sys/time.h> |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
18 #include <time.h> |
54
125d79c9e586
[svn] * src/client.c, src/configfile.c, src/content.c, src/control.c,
uh1763
parents:
45
diff
changeset
|
19 #else |
125d79c9e586
[svn] * src/client.c, src/configfile.c, src/content.c, src/control.c,
uh1763
parents:
45
diff
changeset
|
20 #if HAVE_SYS_TIME_H |
125d79c9e586
[svn] * src/client.c, src/configfile.c, src/content.c, src/control.c,
uh1763
parents:
45
diff
changeset
|
21 #include <sys/time.h> |
125d79c9e586
[svn] * src/client.c, src/configfile.c, src/content.c, src/control.c,
uh1763
parents:
45
diff
changeset
|
22 #else |
125d79c9e586
[svn] * src/client.c, src/configfile.c, src/content.c, src/control.c,
uh1763
parents:
45
diff
changeset
|
23 #include <time.h> |
125d79c9e586
[svn] * src/client.c, src/configfile.c, src/content.c, src/control.c,
uh1763
parents:
45
diff
changeset
|
24 #endif |
125d79c9e586
[svn] * src/client.c, src/configfile.c, src/content.c, src/control.c,
uh1763
parents:
45
diff
changeset
|
25 #endif |
125d79c9e586
[svn] * src/client.c, src/configfile.c, src/content.c, src/control.c,
uh1763
parents:
45
diff
changeset
|
26 |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
27 #include "common.h" |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
28 |
102 | 29 #define GRP_LOCAL_SERVER_NAME "(local)" |
30 #define GRP_RMT_NEXT_NOT_SUBSCRIBED (-1) | |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
31 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
32 /* open group database */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
33 Bool |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
34 Grp_open( void ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
35 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
36 /* close group database */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
37 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
38 Grp_close( void ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
39 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
40 /* does group exist? */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
41 Bool |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
42 Grp_exists( const char *name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
43 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
44 /* is it a local group? */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
45 Bool |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
46 Grp_local( const char *name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
47 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
48 /* create new group and save it in database */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
49 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
50 Grp_create( const char *name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
51 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
52 /* delete a group and its articles from the database. */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
53 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
54 Grp_delete( const char *name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
55 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
56 /* Get group description */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
57 const char * |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
58 Grp_dsc( const char *name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
59 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
60 /* Get server the group resides on */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
61 const char * |
61
adf0af5152f7
[svn] Renamed some variables and function names, because they caused compiler
enz
parents:
54
diff
changeset
|
62 Grp_server( const char *name ); |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
63 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
64 /* |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
65 Get article number of the first article in the group |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
66 This number is a hint only, it is independent of the |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
67 real articles in content.c |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
68 */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
69 int |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
70 Grp_first( const char *name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
71 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
72 /* |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
73 Get article number of the last article in the group |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
74 This number is a hint only, it is independent of the |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
75 real articles in content.c |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
76 */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
77 int |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
78 Grp_last( const char *name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
79 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
80 int |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
81 Grp_lastAccess( const char *name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
82 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
83 int |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
84 Grp_rmtNext( const char *name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
85 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
86 time_t |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
87 Grp_created( const char *name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
88 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
89 char |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
90 Grp_postAllow( const char *name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
91 |
191
28488e0e3630
[svn] * src/group.h,src/group.c,src/noffle.c,src/server.c: Grp_setLastAccess is
bears
parents:
127
diff
changeset
|
92 time_t |
28488e0e3630
[svn] * src/group.h,src/group.c,src/noffle.c,src/server.c: Grp_setLastAccess is
bears
parents:
127
diff
changeset
|
93 Grp_lastPostTime( const char *name ); |
28488e0e3630
[svn] * src/group.h,src/group.c,src/noffle.c,src/server.c: Grp_setLastAccess is
bears
parents:
127
diff
changeset
|
94 |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
95 /* Replace group's description (only if value != ""). */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
96 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
97 Grp_setDsc( const char *name, const char *value ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
98 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
99 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
100 Grp_setLocal( const char *name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
101 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
102 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
103 Grp_setServ( const char *name, const char *value ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
104 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
105 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
106 Grp_setRmtNext( const char *name, int value ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
107 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
108 void |
191
28488e0e3630
[svn] * src/group.h,src/group.c,src/noffle.c,src/server.c: Grp_setLastAccess is
bears
parents:
127
diff
changeset
|
109 Grp_setLastAccess( const char *name ); |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
110 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
111 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
112 Grp_setFirstLast( const char *name, int first, int last ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
113 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
114 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
115 Grp_setPostAllow( const char *name, char postAllow ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
116 |
191
28488e0e3630
[svn] * src/group.h,src/group.c,src/noffle.c,src/server.c: Grp_setLastAccess is
bears
parents:
127
diff
changeset
|
117 void |
28488e0e3630
[svn] * src/group.h,src/group.c,src/noffle.c,src/server.c: Grp_setLastAccess is
bears
parents:
127
diff
changeset
|
118 Grp_setLastPostTime( const char *name ); |
28488e0e3630
[svn] * src/group.h,src/group.c,src/noffle.c,src/server.c: Grp_setLastAccess is
bears
parents:
127
diff
changeset
|
119 |
228 | 120 /* Begin iterating through the names of all groups. Store name of first |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
121 group (or NULL if there aren't any) in name. Returns whether there are |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
122 any groups. */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
123 Bool |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
124 Grp_firstGrp( const char **name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
125 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
126 /* Continue iterating trough the names of all groups. Store name of next |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
127 group (or NULL if there aren't any more) in name. Returns TRUE on |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
128 success, FALSE when there are no more groups. */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
129 Bool |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
130 Grp_nextGrp( const char **name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
131 |
250 | 132 /* Check group name for forbidden patterns. Returns true if the group name |
133 contains patterns like "*.all.*, "*.ctl.", etc. It should be called | |
134 before Grp_create(). This function doesn't call Grp_exists(), though. */ | |
228 | 135 Bool |
250 | 136 Grp_isForbiddenName( const char *name ); |
137 | |
138 /* Check group name for invalid characters. Returns false if the group | |
139 name contains file name separators or whitespace characters. It should | |
140 be called before deleting an overview file or before Grp_create(). */ | |
141 Bool | |
142 Grp_isValidName( const char *name ); | |
228 | 143 |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
144 #endif |