From: Wilfried Göesgens Date: Sun, 10 Feb 2008 21:40:47 +0000 (+0000) Subject: * add typedefs in citadel.h so we don't need to typedef all over the place. X-Git-Tag: v7.86~2498 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=35707bd874630d38fb1b9d13fd0ad5e73c121217 * add typedefs in citadel.h so we don't need to typedef all over the place. * having a struct 'march' and a global variable 'march' isn't that smart. the variable is marchptr now. * fixed some warnings and unneded inclodes. --- diff --git a/citadel/citadel.c b/citadel/citadel.c index 4b1258368..b2d2b5d38 100644 --- a/citadel/citadel.c +++ b/citadel/citadel.c @@ -62,7 +62,7 @@ int rordercmp(struct ctdlroomlisting *r1, struct ctdlroomlisting *r2); -struct march *march = NULL; +march *marchptr = NULL; /* globals associated with the client program */ char temp[PATH_MAX]; /* Name of general-purpose temp file */ @@ -291,18 +291,18 @@ void remove_march(char *roomname, int floornum) { struct march *mptr, *mptr2; - if (march == NULL) + if (marchptr == NULL) return; - if ((!strcasecmp(march->march_name, roomname)) - || ((!strcasecmp(roomname, "_FLOOR_")) && (march->march_floor == floornum))) { - mptr = march->next; - free(march); - march = mptr; + if ((!strcasecmp(marchptr->march_name, roomname)) + || ((!strcasecmp(roomname, "_FLOOR_")) && (marchptr->march_floor == floornum))) { + mptr = marchptr->next; + free(marchptr); + marchptr = mptr; return; } - mptr2 = march; - for (mptr = march; mptr != NULL; mptr = mptr->next) { + mptr2 = marchptr; + for (mptr = marchptr; mptr != NULL; mptr = mptr->next) { if ((!strcasecmp(mptr->march_name, roomname)) || ((!strcasecmp(roomname, "_FLOOR_")) @@ -526,9 +526,9 @@ void gotonext(CtdlIPC *ipc) /* Check to see if the march-mode list is already allocated. * If it is, pop the first room off the list and go there. */ - if (march == NULL) { + if (marchptr == NULL) { r = CtdlIPCKnownRooms(ipc, SubscribedRoomsWithNewMessages, - AllFloors, &march, buf); + AllFloors, &marchptr, buf); /* add _BASEROOM_ to the end of the march list, so the user will end up * in the system base room (usually the Lobby>) at the end of the loop @@ -538,10 +538,10 @@ void gotonext(CtdlIPC *ipc) mptr->march_order = 0; mptr->march_floor = 0; strcpy(mptr->march_name, "_BASEROOM_"); - if (march == NULL) { - march = mptr; + if (marchptr == NULL) { + marchptr = mptr; } else { - mptr2 = march; + mptr2 = marchptr; while (mptr2->next != NULL) mptr2 = mptr2->next; mptr2->next = mptr; @@ -552,8 +552,8 @@ void gotonext(CtdlIPC *ipc) */ remove_march(room_name, 0); } - if (march != NULL) { - strcpy(next_room, pop_march(curr_floor, march)); + if (marchptr != NULL) { + strcpy(next_room, pop_march(curr_floor, marchptr)); } else { strcpy(next_room, "_BASEROOM_"); } @@ -655,7 +655,7 @@ void gotofloor(CtdlIPC *ipc, char *towhere, int mode) scr_printf("No floor '%s'.\n", towhere); return; } - for (mptr = march; mptr != NULL; mptr = mptr->next) { + for (mptr = marchptr; mptr != NULL; mptr = mptr->next) { if ((mptr->march_floor) == tofloor) { gf_toroom(ipc, mptr->march_name, mode); return; @@ -2319,8 +2319,8 @@ TERMN8: scr_printf("%s logged out.", fullname); termn8 = 0; color(ORIGINAL_PAIR); scr_printf("\n"); - while (march != NULL) { - remove_march(march->march_name, 0); + while (marchptr != NULL) { + remove_march(marchptr->march_name, 0); } if (mcmd == 30) { sln_printf("\n\nType 'off' to disconnect, or next user...\n"); diff --git a/citadel/citadel.h b/citadel/citadel.h index 9b2ebe98b..0e58afd36 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -77,6 +77,7 @@ extern "C" { /* * Message expiration policy stuff */ +typedef struct ExpirePolicy ExpirePolicy; struct ExpirePolicy { /* #include "datadefinitions.h" @@ -98,6 +99,7 @@ struct ExpirePolicy { * fetches from the server. This allows the client to "march" through * relevant rooms without having to ask the server each time where to go next. */ +typedef struct march march; struct march { /* #include "datadefinitions.h" @@ -127,6 +129,7 @@ struct march { /* * User records. */ +typedef struct ctdluser ctdluser; struct ctdluser { /* User record */ /* #include "datadefinitions.h" @@ -158,6 +161,7 @@ struct ctdluser { /* User record */ /* * Room records. */ +typedef struct ctdlroom ctdlroom; struct ctdlroom { /* #include "datadefinitions.h" @@ -204,6 +208,7 @@ struct ctdlroom { /* * Floor record. The floor number is implicit in its location in the file. */ +typedef struct floor floor; struct floor { /* #include "datadefinitions.h" diff --git a/citadel/modules/extnotify/extnotify_main.c b/citadel/modules/extnotify/extnotify_main.c index 338199522..20d40a04e 100644 --- a/citadel/modules/extnotify/extnotify_main.c +++ b/citadel/modules/extnotify/extnotify_main.c @@ -123,7 +123,7 @@ void process_notify(long msgnum, void *usrdata) { * 3. A Funambol server has been entered * */ - if (configMsgNum == -1 || strncasecmp(configMsg, "none", 4) == 0 && + if ((configMsgNum == -1) || (strncasecmp(configMsg, "none", 4) == 0) && IsEmptyStr(config.c_pager_program) && IsEmptyStr(config.c_funambol_host)) { lprintf(CTDL_DEBUG, "No external notifiers configured on system/user"); goto nuke; @@ -220,4 +220,4 @@ CTDL_MODULE_INIT(extnotify) } /* return our Subversion id for the Log */ return "$Id: $"; -} \ No newline at end of file +} diff --git a/citadel/modules/extnotify/funambol65.c b/citadel/modules/extnotify/funambol65.c index 2a9ee2540..b323d8b17 100644 --- a/citadel/modules/extnotify/funambol65.c +++ b/citadel/modules/extnotify/funambol65.c @@ -17,10 +17,10 @@ #include #include +#include "citadel.h" #include "citadel_dirs.h" #include "clientsocket.h" #include "sysdep.h" -#include "sysconfig.h" #include "config.h" #include "sysdep_decls.h" #include "msgbase.h" diff --git a/citadel/modules/managesieve/serv_managesieve.c b/citadel/modules/managesieve/serv_managesieve.c index 614eff97a..cf33b0682 100644 --- a/citadel/modules/managesieve/serv_managesieve.c +++ b/citadel/modules/managesieve/serv_managesieve.c @@ -216,7 +216,6 @@ void cmd_mgsve_auth(int num_parms, char **parms, struct sdm_userdata *u) int retval; char *message; char *username; - char *password; message = NULL; memset (auth, 0, SIZ);