projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5997fde
)
* use the const str type libcitadel gives us, instead of roling our own.
author
Wilfried Goesgens
<dothebart@citadel.org>
Sun, 3 Oct 2010 19:34:35 +0000
(21:34 +0200)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Sun, 3 Oct 2010 19:34:35 +0000
(21:34 +0200)
webcit/inetconf.c
patch
|
blob
|
history
diff --git
a/webcit/inetconf.c
b/webcit/inetconf.c
index a19c4fbd70079cd871cbe981a862775f38e2e78c..51fcc946f7eabd4b23c3eda992919d1470b9f07c 100644
(file)
--- a/
webcit/inetconf.c
+++ b/
webcit/inetconf.c
@@
-19,14
+19,9
@@
typedef enum _e_cfg {
ic_max
} ECfg;
ic_max
} ECfg;
-typedef struct _ConstStrBuf {
- const char *name;
- size_t len;
-} ConstStrBuf;
-
/* These are server config keywords; do not localize! */
/* These are server config keywords; do not localize! */
-ConstStr
Buf
CfgNames[] = {
+ConstStr CfgNames[] = {
{ HKEY("localhost") },
{ HKEY("directory") },
{ HKEY("smarthost") },
{ HKEY("localhost") },
{ HKEY("directory") },
{ HKEY("smarthost") },
@@
-55,9
+50,9
@@
void load_inetconf(void)
WCC->InetCfg = NewHash(1, NULL);
WCC->InetCfg = NewHash(1, NULL);
- for (i = 0; i < (sizeof(CfgNames) / sizeof(ConstStr
Buf
)); i++) {
+ for (i = 0; i < (sizeof(CfgNames) / sizeof(ConstStr)); i++) {
Hash = NewHash(1, NULL);
Hash = NewHash(1, NULL);
- Put(WCC->InetCfg, C
fgNames[i].name, CfgNames[i].len
, Hash, HDeleteHash);
+ Put(WCC->InetCfg, C
KEY(CfgNames[i])
, Hash, HDeleteHash);
}
serv_printf("CONF GETSYS|application/x-citadel-internet-config");
}
serv_printf("CONF GETSYS|application/x-citadel-internet-config");
@@
-150,12
+145,12
@@
void new_save_inetconf(void) {
serv_printf("CONF PUTSYS|application/x-citadel-internet-config");
StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) == 4) {
serv_printf("CONF PUTSYS|application/x-citadel-internet-config");
StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) == 4) {
- for (i = 0; i < (sizeof(CfgNames) / sizeof(ConstStr
Buf
)); i++) {
+ for (i = 0; i < (sizeof(CfgNames) / sizeof(ConstStr)); i++) {
HashPos *where;
const char *Key;
long KeyLen;
HashPos *where;
const char *Key;
long KeyLen;
- GetHash(WCC->InetCfg, C
fgNames[i].name, CfgNames[i].len
, &vHash);
+ GetHash(WCC->InetCfg, C
KEY(CfgNames[i])
, &vHash);
Hash = (HashList*) vHash;
if (Hash == NULL) {
sprintf(WC->ImportantMessage, _("Invalid Parameter"));
Hash = (HashList*) vHash;
if (Hash == NULL) {
sprintf(WC->ImportantMessage, _("Invalid Parameter"));
@@
-169,7
+164,7
@@
void new_save_inetconf(void) {
if ((Str!= NULL) && (StrLength(Str) > 0))
serv_printf("%s|%s",
ChrPtr(Str),
if ((Str!= NULL) && (StrLength(Str) > 0))
serv_printf("%s|%s",
ChrPtr(Str),
- CfgNames[i].
name
);
+ CfgNames[i].
Key
);
}
DeleteHashPos(&where);
}
}
DeleteHashPos(&where);
}