* add typedefs in citadel.h so we don't need to typedef all over the place.
authorWilfried Göesgens <willi@citadel.org>
Sun, 10 Feb 2008 21:40:47 +0000 (21:40 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 10 Feb 2008 21:40:47 +0000 (21:40 +0000)
* having a struct 'march' and a global variable 'march' isn't that smart. the variable is marchptr now.
* fixed some warnings and unneded inclodes.

citadel/citadel.c
citadel/citadel.h
citadel/modules/extnotify/extnotify_main.c
citadel/modules/extnotify/funambol65.c
citadel/modules/managesieve/serv_managesieve.c

index 4b12583689c1729ce810411a3e21361660726cfd..b2d2b5d3884e33681a1ba4d6381a7c95f825f01d 100644 (file)
@@ -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");
index 9b2ebe98b6f7f5ae1e3b4d928408cbc863ef15f4..0e58afd369f7b81e8f2a57182e9878494ab85707 100644 (file)
@@ -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"
index 338199522ac4c7e31c6d692aa437bb61ac92dce5..20d40a04ef57fe1a82b92baa73af83a316a0edea 100644 (file)
@@ -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
+}
index 2a9ee25408da2bee9a979a6378914f3478a3af90..b323d8b1791dab5532db6d9526fa7350034a0600 100644 (file)
 #include <time.h>
 #include <libcitadel.h>
 
+#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"
index 614eff97a6d49dd08bb49bf9b6196e31f4da1520..cf33b0682f0ebb2211e8c45be06318fdb4e49511 100644 (file)
@@ -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);