Mercurial > noffle
annotate src/configfile.c @ 111:6f681d41734c noffle
[svn] path-header added.
author | bears |
---|---|
date | Sat, 24 Jun 2000 21:28:01 +0100 |
parents | 402300614185 |
children | 8897b7e3b108 |
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 configfile.c |
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 The following macros must be set, when compiling this file: |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
5 CONFIGFILE |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
6 SPOOLDIR |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
7 VERSION |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
8 |
111 | 9 $Id: configfile.c 155 2000-06-24 20:28:01Z bears $ |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
10 */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
11 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
12 #if HAVE_CONFIG_H |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
13 #include <config.h> |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
14 #endif |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
15 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
16 #include "configfile.h" |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
17 |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
18 #include <ctype.h> |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
19 #include <limits.h> |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
20 #include "itemlist.h" |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
21 #include "log.h" |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
22 #include "util.h" |
54
125d79c9e586
[svn] * src/client.c, src/configfile.c, src/content.c, src/control.c,
uh1763
parents:
43
diff
changeset
|
23 #include "portable.h" |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
24 #include "wildmat.h" |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
25 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
26 typedef struct |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
27 { |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
28 int numGroup; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
29 int maxGroup; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
30 char **groups; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
31 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
32 GroupEntry; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
33 |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
34 struct GroupEnum |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
35 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
36 GroupEntry *groupEntry; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
37 int groupIdx; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
38 }; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
39 |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
40 typedef struct |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
41 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
42 char *name; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
43 char *user; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
44 char *pass; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
45 GroupEntry getgroups; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
46 GroupEntry omitgroups; |
43
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 ServEntry; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
49 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
50 typedef struct |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
51 { |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
52 char *pattern; |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
53 int days; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
54 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
55 ExpireEntry; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
56 |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
57 typedef struct |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
58 { |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
59 char *pattern; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
60 char *mode; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
61 } |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
62 AutoSubscribeModeEntry; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
63 |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
64 struct |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
65 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
66 /* Compile time options */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
67 const char *spoolDir; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
68 const char *version; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
69 /* Options from the config file */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
70 int maxFetch; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
71 int autoUnsubscribeDays; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
72 int threadFollowTime; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
73 int connectTimeout; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
74 Bool autoSubscribe; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
75 Bool autoUnsubscribe; |
82 | 76 Bool infoAlways; |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
77 Bool replaceMsgId; |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
78 Bool postLocal; |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
79 Str defaultAutoSubscribeMode; |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
80 Str mailTo; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
81 int defaultExpire; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
82 int numServ; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
83 int maxServ; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
84 ServEntry *serv; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
85 int servIdx; /* for server enumeration */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
86 int numExpire; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
87 int maxExpire; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
88 ExpireEntry *expire; |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
89 int numAutoSubscribeMode; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
90 int maxAutoSubscribeMode; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
91 AutoSubscribeModeEntry *autoSubscribeMode; |
111 | 92 Str pathHeader; |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
93 } config = |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
94 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
95 SPOOLDIR, /* spoolDir */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
96 VERSION, /* version */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
97 300, /* maxFetch */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
98 30, /* autoUnsubscribeDays */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
99 7, /* threadFollowTime */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
100 30, /* connectTimeout */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
101 FALSE, /* autoSubscribe */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
102 FALSE, /* autoUnsubscribe */ |
82 | 103 TRUE, /* infoAlways */ |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
104 TRUE, /* replaceMsgId */ |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
105 FALSE, /* postLocal */ |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
106 "over", /* defaultAutoSubscribeMode */ |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
107 "", /* mailTo */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
108 14, /* defaultExpire */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
109 0, /* numServ */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
110 0, /* maxServ */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
111 NULL, /* serv */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
112 0, /* servIdx */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
113 0, /* numExpire */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
114 0, /* maxExpire */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
115 NULL, /* expire */ |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
116 0, /* numAutoSubscribeMode */ |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
117 0, /* maxAutoSubscribeMode */ |
111 | 118 NULL, /* autoSubscribeMode */ |
119 "" /* pathHeader */ | |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
120 }; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
121 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
122 const char * Cfg_spoolDir( void ) { return config.spoolDir; } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
123 const char * Cfg_version( void ) { return config.version; } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
124 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
125 int Cfg_maxFetch( void ) { return config.maxFetch; } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
126 int Cfg_autoUnsubscribeDays( void ) { return config.autoUnsubscribeDays; } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
127 int Cfg_threadFollowTime( void ) { return config.threadFollowTime; } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
128 int Cfg_connectTimeout( void ) { return config.connectTimeout; } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
129 Bool Cfg_autoUnsubscribe( void ) { return config.autoUnsubscribe; } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
130 Bool Cfg_autoSubscribe( void ) { return config.autoSubscribe; } |
82 | 131 Bool Cfg_infoAlways( void ) { return config.infoAlways; } |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
132 Bool Cfg_replaceMsgId( void ) { return config.replaceMsgId; } |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
133 Bool Cfg_postLocal( void ) { return config.postLocal; } |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
134 const char * Cfg_defaultAutoSubscribeMode( void ) { |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
135 return config.defaultAutoSubscribeMode; } |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
136 const char * Cfg_mailTo( void ) { return config.mailTo; } |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
137 int Cfg_defaultExpire( void ) { return config.defaultExpire; } |
111 | 138 const char * Cfg_pathHeader( void ) { return config.pathHeader; } |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
139 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
140 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
141 Cfg_beginServEnum( void ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
142 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
143 config.servIdx = 0; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
144 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
145 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
146 Bool |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
147 Cfg_nextServ( Str name ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
148 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
149 if ( config.servIdx >= config.numServ ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
150 return FALSE; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
151 strcpy( name, config.serv[ config.servIdx ].name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
152 ++config.servIdx; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
153 return TRUE; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
154 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
155 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
156 static Bool |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
157 searchServ( const char *name, int *idx ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
158 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
159 int i; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
160 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
161 for ( i = 0; i < config.numServ; ++i ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
162 if ( strcmp( name, config.serv[ i ].name ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
163 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
164 *idx = i; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
165 return TRUE; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
166 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
167 return FALSE; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
168 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
169 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
170 Bool |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
171 Cfg_servListContains( const char *name ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
172 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
173 int idx; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
174 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
175 return searchServ( name, &idx ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
176 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
177 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
178 Bool |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
179 Cfg_servIsPreferential( const char *name1, const char *name2 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
180 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
181 Bool exists1, exists2; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
182 int idx1, idx2; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
183 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
184 exists1 = searchServ( name1, &idx1 ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
185 exists2 = searchServ( name2, &idx2 ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
186 if ( exists1 && exists2 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
187 return ( idx1 < idx2 ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
188 if ( exists1 && ! exists2 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
189 return TRUE; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
190 /* ( ! exists1 && exists2 ) || ( ! exists1 && ! exists2 ) */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
191 return FALSE; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
192 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
193 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
194 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
195 Cfg_authInfo( const char *name, Str user, Str pass ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
196 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
197 int idx; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
198 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
199 if ( searchServ( name, &idx ) ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
200 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
201 strcpy( user, config.serv[ idx ].user ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
202 strcpy( pass, config.serv[ idx ].pass ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
203 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
204 else |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
205 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
206 user[ 0 ] = '\0'; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
207 pass[ 0 ] = '\0'; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
208 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
209 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
210 |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
211 int |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
212 Cfg_expire( const char *grp ) |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
213 { |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
214 int i, res; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
215 |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
216 for ( i = 0; i < config.numExpire; i++ ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
217 if ( Wld_match( grp, config.expire[ i ].pattern ) ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
218 { |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
219 res = config.expire[ i ].days; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
220 Log_dbg( "Custom expire period %d for group %s", res, grp ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
221 return res; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
222 } |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
223 |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
224 return Cfg_defaultExpire(); |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
225 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
226 |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
227 const char * |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
228 Cfg_autoSubscribeMode( const char *grp ) |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
229 { |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
230 int i; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
231 const char *res; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
232 |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
233 for ( i = 0; i < config.numAutoSubscribeMode; i++ ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
234 if ( Wld_match( grp, config.autoSubscribeMode[ i ].pattern ) ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
235 { |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
236 res = config.autoSubscribeMode[ i ].mode; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
237 Log_dbg( "Custom auto subscribe mode %s for group %s", res, grp ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
238 return res; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
239 } |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
240 |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
241 return Cfg_defaultAutoSubscribeMode(); |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
242 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
243 |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
244 GroupEnum * |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
245 new_GetGrEn( const char *name ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
246 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
247 GroupEnum *res; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
248 int servIdx; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
249 |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
250 res = (GroupEnum *) malloc( sizeof( GroupEnum ) ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
251 if ( res == NULL ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
252 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
253 Log_err( "Malloc of GroupEnum failed." ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
254 exit( EXIT_FAILURE ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
255 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
256 if ( ! searchServ( name, &servIdx ) ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
257 res->groupEntry = NULL; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
258 else |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
259 res->groupEntry = &config.serv[ servIdx ].getgroups; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
260 GrEn_first( res ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
261 return res; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
262 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
263 |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
264 GroupEnum * |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
265 new_OmitGrEn( const char *name ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
266 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
267 GroupEnum *res; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
268 int servIdx; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
269 |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
270 res = (GroupEnum *) malloc( sizeof( GroupEnum ) ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
271 if ( res == NULL ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
272 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
273 Log_err( "Malloc of GroupEnum failed." ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
274 exit( EXIT_FAILURE ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
275 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
276 if ( ! searchServ( name, &servIdx ) ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
277 res->groupEntry = NULL; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
278 else |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
279 res->groupEntry = &config.serv[ servIdx ].omitgroups; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
280 GrEn_first( res ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
281 return res; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
282 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
283 |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
284 void |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
285 del_GrEn( GroupEnum *ge ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
286 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
287 free(ge); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
288 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
289 |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
290 void |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
291 GrEn_first( GroupEnum *ge ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
292 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
293 ge->groupIdx = 0; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
294 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
295 |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
296 const char * |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
297 GrEn_next( GroupEnum *ge ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
298 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
299 if ( ge->groupEntry == NULL || |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
300 ge->groupIdx >= ge->groupEntry->numGroup ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
301 return NULL; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
302 return ge->groupEntry->groups[ ge->groupIdx++ ]; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
303 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
304 |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
305 static void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
306 logSyntaxErr( const char *line ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
307 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
308 Log_err( "Syntax error in config file: %s", line ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
309 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
310 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
311 static void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
312 getBool( Bool *variable, const char *line ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
313 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
314 Str value, name, lowerLn; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
315 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
316 strcpy( lowerLn, line ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
317 Utl_toLower( lowerLn ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
318 if ( sscanf( lowerLn, "%s %s", name, value ) != 2 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
319 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
320 logSyntaxErr( line ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
321 return; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
322 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
323 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
324 if ( strcmp( value, "yes" ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
325 *variable = TRUE; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
326 else if ( strcmp( value, "no" ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
327 *variable = FALSE; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
328 else |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
329 Log_err( "Error in config file %s must be yes or no", name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
330 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
331 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
332 static void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
333 getInt( int *variable, int min, int max, const char *line ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
334 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
335 int value; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
336 Str name; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
337 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
338 if ( sscanf( line, "%s %d", name, &value ) != 2 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
339 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
340 logSyntaxErr( line ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
341 return; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
342 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
343 if ( value < min || value > max ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
344 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
345 Log_err( "Range error in config file %s [%d,%d]", name, min, max ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
346 return; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
347 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
348 *variable = value; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
349 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
350 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
351 static void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
352 getStr( char *variable, const char *line ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
353 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
354 Str dummy; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
355 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
356 if ( sscanf( line, "%s %s", dummy, variable ) != 2 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
357 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
358 logSyntaxErr( line ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
359 return; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
360 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
361 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
362 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
363 static void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
364 getServ( const char *line ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
365 { |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
366 Str dummy, name, user, pass; |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
367 int r, len; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
368 ServEntry entry; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
369 |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
370 memset( &entry, 0, sizeof( entry ) ); |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
371 r = sscanf( line, "%s %s %s %s", |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
372 dummy, name, user, pass ); |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
373 if ( r < 2 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
374 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
375 logSyntaxErr( line ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
376 return; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
377 } |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
378 len = strlen( name ); |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
379 /* To make server name more definit, it is made lowercase and |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
380 port is removed, if it is the default port */ |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
381 if ( len > 4 && strcmp( name + len - 4, ":119" ) == 0 ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
382 name[ len - 4 ] = '\0'; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
383 Utl_toLower( name ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
384 |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
385 Utl_allocAndCpy( &entry.name, name ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
386 Utl_allocAndCpy( &entry.user, user ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
387 Utl_allocAndCpy( &entry.pass, pass ); |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
388 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
389 if ( config.maxServ < config.numServ + 1 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
390 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
391 if ( ! ( config.serv = realloc( config.serv, |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
392 ( config.maxServ + 5 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
393 * sizeof( ServEntry ) ) ) ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
394 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
395 Log_err( "Could not realloc server list" ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
396 exit( EXIT_FAILURE ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
397 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
398 config.maxServ += 5; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
399 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
400 config.serv[ config.numServ++ ] = entry; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
401 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
402 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
403 static void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
404 getExpire( const char *line ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
405 { |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
406 Str dummy, pattern; |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
407 ExpireEntry entry; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
408 int days; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
409 |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
410 if ( sscanf( line, "%s %s %d", dummy, pattern, &days ) != 3 ) |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
411 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
412 logSyntaxErr( line ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
413 return; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
414 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
415 else |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
416 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
417 if ( days < 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
418 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
419 Log_err( "Expire days error in '%s': must be integer > 0", |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
420 line, days ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
421 return; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
422 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
423 |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
424 Utl_toLower( pattern ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
425 Utl_allocAndCpy( &entry.pattern, pattern ); |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
426 entry.days = days; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
427 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
428 if ( config.maxExpire < config.numExpire + 1 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
429 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
430 if ( ! ( config.expire = realloc( config.expire, |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
431 ( config.maxExpire + 5 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
432 * sizeof( ExpireEntry ) ) ) ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
433 { |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
434 Log_err( "Could not realloc expire list" ); |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
435 exit( EXIT_FAILURE ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
436 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
437 config.maxExpire += 5; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
438 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
439 config.expire[ config.numExpire++ ] = entry; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
440 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
441 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
442 |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
443 static void |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
444 getGroups( char *line, Bool isGet ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
445 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
446 const char *name; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
447 ItemList *patterns; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
448 const char *pattern; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
449 |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
450 if ( config.numServ == 0 ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
451 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
452 Log_err( "No current server in %s", line ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
453 return; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
454 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
455 |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
456 name = line; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
457 /* Skip over name and terminate it */ |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
458 while ( line[ 0 ] != '\0' && ! isspace( line[ 0 ] ) ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
459 line++; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
460 if ( line[ 0 ] == '\0' ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
461 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
462 logSyntaxErr( name ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
463 return; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
464 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
465 line[ 0 ] = '\0'; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
466 line++; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
467 |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
468 patterns = new_Itl( line, " ," ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
469 for( pattern = Itl_first( patterns ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
470 pattern != NULL; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
471 pattern = Itl_next( patterns ) ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
472 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
473 GroupEntry *g; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
474 |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
475 if ( isGet ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
476 g = &config.serv[ config.numServ - 1 ].getgroups; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
477 else |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
478 g = &config.serv[ config.numServ - 1 ].omitgroups; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
479 if ( g->maxGroup < g->numGroup + 1 ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
480 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
481 if ( ! ( g->groups = realloc( g->groups, |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
482 ( g->maxGroup + 5 ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
483 * sizeof( char * ) ) ) ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
484 { |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
485 Log_err( "Could not realloc group list" ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
486 exit( EXIT_FAILURE ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
487 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
488 g->maxGroup += 5; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
489 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
490 Utl_allocAndCpy( &g->groups[ g->numGroup++ ], pattern ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
491 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
492 del_Itl( patterns) ; |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
493 } |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
494 |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
495 static Bool |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
496 isValidAutoSubscribeMode( const char *mode ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
497 { |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
498 return strcmp( mode, "full" ) == 0 |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
499 || strcmp( mode, "thread" ) == 0 |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
500 || strcmp( mode, "over" ) == 0 |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
501 || strcmp( mode, "off" ) == 0; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
502 } |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
503 |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
504 static void |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
505 getAutoSubscribeMode( const char *line ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
506 { |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
507 Str dummy, pattern, mode; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
508 AutoSubscribeModeEntry entry; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
509 int items; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
510 |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
511 items = sscanf( line, "%s %s %s", dummy, pattern, mode ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
512 if ( items == 2 ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
513 { |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
514 /* Backwards compat. default-auto-subscribe-mode */ |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
515 Utl_cpyStr( mode, pattern ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
516 Utl_toLower( mode ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
517 if ( ! isValidAutoSubscribeMode( mode ) ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
518 { |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
519 logSyntaxErr( line ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
520 return; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
521 } |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
522 strcpy( config.defaultAutoSubscribeMode, mode ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
523 return; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
524 } |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
525 else if ( items != 3 ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
526 { |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
527 logSyntaxErr( line ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
528 return; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
529 } |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
530 |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
531 Utl_toLower( mode ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
532 if ( ! isValidAutoSubscribeMode( mode ) ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
533 { |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
534 logSyntaxErr( line ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
535 return; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
536 } |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
537 |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
538 Utl_toLower( pattern ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
539 Utl_allocAndCpy( &entry.pattern, pattern ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
540 Utl_allocAndCpy( &entry.mode, mode ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
541 |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
542 if ( config.maxAutoSubscribeMode < config.numAutoSubscribeMode + 1 ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
543 { |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
544 if ( ! ( config.autoSubscribeMode = |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
545 realloc( config.autoSubscribeMode, |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
546 ( config.maxAutoSubscribeMode + 5 ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
547 * sizeof( AutoSubscribeModeEntry ) ) ) ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
548 { |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
549 Log_err( "Could not realloc auto subscribe mode list" ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
550 exit( EXIT_FAILURE ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
551 } |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
552 config.maxAutoSubscribeMode += 5; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
553 } |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
554 config.autoSubscribeMode[ config.numAutoSubscribeMode++ ] = entry; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
555 } |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
556 |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
557 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
558 Cfg_read( void ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
559 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
560 char *p; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
561 FILE *f; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
562 Str file, line, lowerLine, name, s; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
563 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
564 snprintf( file, MAXCHAR, CONFIGFILE ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
565 if ( ! ( f = fopen( file, "r" ) ) ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
566 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
567 Log_err( "Cannot read %s", file ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
568 return; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
569 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
570 while ( fgets( line, MAXCHAR, f ) ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
571 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
572 p = Utl_stripWhiteSpace( line ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
573 Utl_stripComment( p ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
574 Utl_cpyStr( lowerLine, p ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
575 Utl_toLower( lowerLine ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
576 if ( *p == '\0' ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
577 continue; |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
578 if ( sscanf( p, "%s", name ) != 1 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
579 Log_err( "Syntax error in %s: %s", file, line ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
580 else if ( strcmp( "max-fetch", name ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
581 getInt( &config.maxFetch, 0, INT_MAX, p ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
582 else if ( strcmp( "auto-unsubscribe-days", name ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
583 getInt( &config.autoUnsubscribe, -1, INT_MAX, p ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
584 else if ( strcmp( "thread-follow-time", name ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
585 getInt( &config.threadFollowTime, 0, INT_MAX, p ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
586 else if ( strcmp( "connect-timeout", name ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
587 getInt( &config.connectTimeout, 0, INT_MAX, p ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
588 else if ( strcmp( "default-expire", name ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
589 getInt( &config.defaultExpire, 0, INT_MAX, p ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
590 else if ( strcmp( "auto-subscribe", name ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
591 getBool( &config.autoSubscribe, p ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
592 else if ( strcmp( "auto-unsubscribe", name ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
593 getBool( &config.autoUnsubscribe, p ); |
82 | 594 else if ( strcmp( "info-always-unread", name ) == 0 ) |
595 getBool( &config.infoAlways, p ); | |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
596 else if ( strcmp( "replace-messageid", name ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
597 getBool( &config.replaceMsgId, p ); |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
598 else if ( strcmp( "post-locally", name ) == 0 ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
599 getBool( &config.postLocal, p ); |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
600 else if ( strcmp( "default-auto-subscribe-mode", name ) == 0 ) |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
601 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
602 getStr( s, p ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
603 Utl_toLower( s ); |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
604 if ( ! isValidAutoSubscribeMode( s ) ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
605 { |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
606 logSyntaxErr( line ); |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
607 return; |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
608 } |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
609 else |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
610 strcpy( config.defaultAutoSubscribeMode, s ); |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
611 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
612 else if ( strcmp( "server", name ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
613 /* Server needs line not p, |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
614 because password may contain uppercase */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
615 getServ( line ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
616 else if ( strcmp( "mail-to", name ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
617 getStr( config.mailTo, p ); |
111 | 618 else if ( strcmp( "path-header", name ) == 0 ) |
619 getStr( config.pathHeader, p ); | |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
620 else if ( strcmp( "expire", name ) == 0 ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
621 getExpire( p ); |
104
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
622 else if ( strcmp( "auto-subscribe-mode", name ) == 0 ) |
402300614185
[svn] Remove expire enum, add Cfg_expire(grp). Rename Cfg_autoSubscribeMode()
bears
parents:
88
diff
changeset
|
623 getAutoSubscribeMode( p ); |
88
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
624 else if ( strcmp( "getgroups", name ) == 0 ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
625 getGroups( p, TRUE ); |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
626 else if ( strcmp( "omitgroups", name ) == 0 ) |
1fcdced0246e
[svn] Move posting code to post.c, add command line posting
bears
parents:
82
diff
changeset
|
627 getGroups( p, FALSE ); |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
628 else |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
629 Log_err( "Unknown config option: %s", name ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
630 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
631 fclose( f ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
632 if ( ! config.numServ ) |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
633 { |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
634 Log_err( "Config file contains no server" ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
635 exit( EXIT_FAILURE ); |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
636 } |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
637 } |