* Added a generic (void *) parameter to the ForEachUser() and ForEachRoom()
authorArt Cancro <ajc@citadel.org>
Sat, 15 Jan 2000 18:29:15 +0000 (18:29 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 15 Jan 2000 18:29:15 +0000 (18:29 +0000)
  callback mechanisms, to allow callers and callbacks to pass arbitrary data
  between each other without requiring TSD variables.
* room_ops.c: eliminated the need for 'FloorBeingSearched' TSD variable
* internet_addressing.c: eliminated 'buffer1' and 'buffer2' TSD variables

citadel/ChangeLog
citadel/dynloader.h
citadel/housekeeping.c
citadel/internet_addressing.c
citadel/room_ops.c
citadel/room_ops.h
citadel/serv_expire.c
citadel/serv_smtp.c
citadel/server.h
citadel/user_ops.c
citadel/user_ops.h

index 2e7f520d05118b68cd0b67914795772b3836092e..e2b551e9c6b460c8aba9d8f889ec4683032536f4 100644 (file)
@@ -1,4 +1,11 @@
 $Log$
+Revision 1.443  2000/01/15 18:29:15  ajc
+* Added a generic (void *) parameter to the ForEachUser() and ForEachRoom()
+  callback mechanisms, to allow callers and callbacks to pass arbitrary data
+  between each other without requiring TSD variables.
+* room_ops.c: eliminated the need for 'FloorBeingSearched' TSD variable
+* internet_addressing.c: eliminated 'buffer1' and 'buffer2' TSD variables
+
 Revision 1.442  2000/01/15 04:31:44  ajc
 * Removed UI_DIALOG mode in setup.  Can't count on 'dialog' to be consistent.
 
@@ -1547,3 +1554,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
+
index b53e159a649de5232732c6af6cbeab0ba52fa2a3..088f4d2fb2ba416b03d402f9444c4eec4c6f69f5 100644 (file)
@@ -1,19 +1,27 @@
 /* $Id$ */
 void DLoader_Init(char *pathname);
 int DLoader_Exec_Cmd(char *cmdbuf);
+char *Dynamic_Module_Init(void);
+
 void CtdlRegisterLogHook(void (*fcn_ptr)(char *), int loglevel);
-void CtdlRegisterCleanupHook(void (*fcn_ptr)(void));
-void CtdlRegisterSessionHook(void (*fcn_ptr)(void), int EventType);
 void PerformLogHooks(int loglevel, char *logmsg);
+
+
+void CtdlRegisterSessionHook(void (*fcn_ptr)(void), int EventType);
 void PerformSessionHooks(int EventType);
-void PerformUserHooks(char *username, long usernum, int EventType);
-int PerformXmsgHooks(char *, char *, char *);
-void CtdlRegisterProtoHook(void (*handler)(char *), char *cmd, char *desc);
+
 void CtdlRegisterUserHook(void (*fcn_ptr)(char*, long), int EventType);
+void PerformUserHooks(char *username, long usernum, int EventType);
+
 void CtdlRegisterXmsgHook(int (*fcn_ptr)(char *, char *, char *), int order);
+int PerformXmsgHooks(char *, char *, char *);
+
 void CtdlRegisterMessageHook(int (*handler)(struct CtdlMessage *), int EventType);
+int PerformMessageHooks(struct CtdlMessage *, int EventType);
+
+void CtdlRegisterCleanupHook(void (*fcn_ptr)(void));
+void CtdlRegisterProtoHook(void (*handler)(char *), char *cmd, char *desc);
 void CtdlRegisterServiceHook(int tcp_port,
                         void (*h_greeting_function) (void),
                         void (*h_command_function) (void) ) ;
-int PerformMessageHooks(struct CtdlMessage *, int EventType);
-char *Dynamic_Module_Init(void);
+
index 81dd76ebab8fc5acf8350c9dd3350e80431a151f..50deb5f9cdb815fd76730fe3d10331aa976cf22a 100644 (file)
@@ -157,7 +157,7 @@ void enter_housekeeping_cmd(char *cmd) {
  * NOTE: this function pair should ONLY be called during startup.  It is NOT
  * thread safe.
  */
-void check_ref_counts_backend(struct quickroom *qrbuf) {
+void check_ref_counts_backend(struct quickroom *qrbuf, void *data) {
        struct floor flbuf;
 
        getfloor(&flbuf, qrbuf->QRfloor);
@@ -177,6 +177,6 @@ void check_ref_counts(void) {
                putfloor(&flbuf, a);
                }
 
-       ForEachRoom(check_ref_counts_backend);
+       ForEachRoom(check_ref_counts_backend, NULL);
        }       
 
index 24b088ec0b7fd8073dd11a7eb13cd1f3c5776c08..365a1ec9f57dd6252272072f7cc10bb7a04534b9 100644 (file)
 #include "parsedate.h"
 
 
+struct trynamebuf {
+       char buffer1[256];
+       char buffer2[256];
+};
+
 
 /*
  * Return 0 if a given string fuzzy-matches a Citadel user account
@@ -218,18 +223,20 @@ void process_rfc822_addr(char *rfc822, char *user, char *node, char *name)
  * Back end for convert_internet_address()
  * (Compares an internet name [buffer1] and stores in [buffer2] if found)
  */
-void try_name(struct usersupp *us) {
+void try_name(struct usersupp *us, void *data) {
+       struct trynamebuf *tnb;
+       tnb = (struct trynamebuf *)data;
        
-       if (!strncasecmp(CC->buffer1, "cit", 3))
-               if (atol(&CC->buffer1[3]) == us->usernum)
-                       strcpy(CC->buffer2, us->fullname);
+       if (!strncasecmp(tnb->buffer1, "cit", 3))
+               if (atol(&tnb->buffer1[3]) == us->usernum)
+                       strcpy(tnb->buffer2, us->fullname);
 
-       if (!collapsed_strcmp(CC->buffer1, us->fullname)) 
-                       strcpy(CC->buffer2, us->fullname);
+       if (!collapsed_strcmp(tnb->buffer1, us->fullname)) 
+                       strcpy(tnb->buffer2, us->fullname);
 
        if (us->uid != BBSUID)
-               if (!strcasecmp(CC->buffer1, getpwuid(us->uid)->pw_name))
-                       strcpy(CC->buffer2, us->fullname);
+               if (!strcasecmp(tnb->buffer1, getpwuid(us->uid)->pw_name))
+                       strcpy(tnb->buffer2, us->fullname);
 }
 
 
@@ -243,6 +250,7 @@ int convert_internet_address(char *destuser, char *desthost, char *source)
        char name[256];
        struct quickroom qrbuf;
        int i;
+       struct trynamebuf tnb;
 
        /* Split it up */
        process_rfc822_addr(source, user, node, name);
@@ -274,11 +282,11 @@ int convert_internet_address(char *destuser, char *desthost, char *source)
                /* Try all local users */
                strcpy(destuser, user);
                strcpy(desthost, config.c_nodename);
-               strcpy(CC->buffer1, user);
-               strcpy(CC->buffer2, "");
-               ForEachUser(try_name);
-               if (strlen(CC->buffer2) == 0) return(rfc822_no_such_user);
-               strcpy(destuser, CC->buffer2);
+               strcpy(tnb.buffer1, user);
+               strcpy(tnb.buffer2, "");
+               ForEachUser(try_name, &tnb);
+               if (strlen(tnb.buffer2) == 0) return(rfc822_no_such_user);
+               strcpy(destuser, tnb.buffer2);
                return(rfc822_address_locally_validated);
        }
 
index b1823ad0953d4c84a6645156b18400dc922ba719..7883268f5fbb65a39ab1245f6c392b62b48c5a93 100644 (file)
@@ -291,7 +291,8 @@ void lputfloor(struct floor *flbuf, int floor_num)
 /* 
  *  Traverse the room file...
  */
-void ForEachRoom(void (*CallBack) (struct quickroom * EachRoom))
+void ForEachRoom(void (*CallBack) (struct quickroom *EachRoom, void *out_data),
+               void *in_data)
 {
        struct quickroom qrbuf;
        struct cdbdata *cdbqr;
@@ -306,7 +307,7 @@ void ForEachRoom(void (*CallBack) (struct quickroom * EachRoom))
                cdb_free(cdbqr);
                room_sanity_check(&qrbuf);
                if (qrbuf.QRflags & QR_INUSE)
-                       (*CallBack) (&qrbuf);
+                       (*CallBack)(&qrbuf, in_data);
        }
 }
 
@@ -417,20 +418,23 @@ void list_roomname(struct quickroom *qrbuf)
 /* 
  * cmd_lrms()   -  List all accessible rooms, known or forgotten
  */
-void cmd_lrms_backend(struct quickroom *qrbuf)
+void cmd_lrms_backend(struct quickroom *qrbuf, void *data)
 {
+       int FloorBeingSearched = (-1);
+       FloorBeingSearched = *(int *)data;
+
        if (((CtdlRoomAccess(qrbuf, &CC->usersupp)
              & (UA_KNOWN | UA_ZAPPED)))
-           && ((qrbuf->QRfloor == (CC->FloorBeingSearched))
-               || ((CC->FloorBeingSearched) < 0)))
+           && ((qrbuf->QRfloor == (FloorBeingSearched))
+               || ((FloorBeingSearched) < 0)))
                list_roomname(qrbuf);
 }
 
 void cmd_lrms(char *argbuf)
 {
-       CC->FloorBeingSearched = (-1);
+       int FloorBeingSearched = (-1);
        if (strlen(argbuf) > 0)
-               CC->FloorBeingSearched = extract_int(argbuf, 0);
+               FloorBeingSearched = extract_int(argbuf, 0);
 
        if (!(CC->logged_in)) {
                cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
@@ -442,7 +446,7 @@ void cmd_lrms(char *argbuf)
        }
        cprintf("%d Accessible rooms:\n", LISTING_FOLLOWS);
 
-       ForEachRoom(cmd_lrms_backend);
+       ForEachRoom(cmd_lrms_backend, &FloorBeingSearched);
        cprintf("000\n");
 }
 
@@ -451,20 +455,23 @@ void cmd_lrms(char *argbuf)
 /* 
  * cmd_lkra()   -  List all known rooms
  */
-void cmd_lkra_backend(struct quickroom *qrbuf)
+void cmd_lkra_backend(struct quickroom *qrbuf, void *data)
 {
+       int FloorBeingSearched = (-1);
+       FloorBeingSearched = *(int *)data;
+
        if (((CtdlRoomAccess(qrbuf, &CC->usersupp)
              & (UA_KNOWN)))
-           && ((qrbuf->QRfloor == (CC->FloorBeingSearched))
-               || ((CC->FloorBeingSearched) < 0)))
+           && ((qrbuf->QRfloor == (FloorBeingSearched))
+               || ((FloorBeingSearched) < 0)))
                list_roomname(qrbuf);
 }
 
 void cmd_lkra(char *argbuf)
 {
-       CC->FloorBeingSearched = (-1);
+       int FloorBeingSearched = (-1);
        if (strlen(argbuf) > 0)
-               CC->FloorBeingSearched = extract_int(argbuf, 0);
+               FloorBeingSearched = extract_int(argbuf, 0);
 
        if (!(CC->logged_in)) {
                cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
@@ -476,7 +483,7 @@ void cmd_lkra(char *argbuf)
        }
        cprintf("%d Known rooms:\n", LISTING_FOLLOWS);
 
-       ForEachRoom(cmd_lkra_backend);
+       ForEachRoom(cmd_lkra_backend, &FloorBeingSearched);
        cprintf("000\n");
 }
 
@@ -485,23 +492,25 @@ void cmd_lkra(char *argbuf)
 /* 
  * cmd_lkrn()   -  List all known rooms with new messages
  */
-void cmd_lkrn_backend(struct quickroom *qrbuf)
+void cmd_lkrn_backend(struct quickroom *qrbuf, void *data)
 {
        int ra;
+       int FloorBeingSearched = (-1);
+       FloorBeingSearched = *(int *)data;
 
        ra = CtdlRoomAccess(qrbuf, &CC->usersupp);
        if ((ra & UA_KNOWN)
            && (ra & UA_HASNEWMSGS)
-           && ((qrbuf->QRfloor == (CC->FloorBeingSearched))
-               || ((CC->FloorBeingSearched) < 0)))
+           && ((qrbuf->QRfloor == (FloorBeingSearched))
+               || ((FloorBeingSearched) < 0)))
                list_roomname(qrbuf);
 }
 
 void cmd_lkrn(char *argbuf)
 {
-       CC->FloorBeingSearched = (-1);
+       int FloorBeingSearched = (-1);
        if (strlen(argbuf) > 0)
-               CC->FloorBeingSearched = extract_int(argbuf, 0);
+               FloorBeingSearched = extract_int(argbuf, 0);
 
        if (!(CC->logged_in)) {
                cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
@@ -513,7 +522,7 @@ void cmd_lkrn(char *argbuf)
        }
        cprintf("%d Rooms w/ new msgs:\n", LISTING_FOLLOWS);
 
-       ForEachRoom(cmd_lkrn_backend);
+       ForEachRoom(cmd_lkrn_backend, &FloorBeingSearched);
        cprintf("000\n");
 }
 
@@ -522,23 +531,25 @@ void cmd_lkrn(char *argbuf)
 /* 
  * cmd_lkro()   -  List all known rooms
  */
-void cmd_lkro_backend(struct quickroom *qrbuf)
+void cmd_lkro_backend(struct quickroom *qrbuf, void *data)
 {
        int ra;
+       int FloorBeingSearched = (-1);
+       FloorBeingSearched = *(int *)data;
 
        ra = CtdlRoomAccess(qrbuf, &CC->usersupp);
        if ((ra & UA_KNOWN)
            && ((ra & UA_HASNEWMSGS) == 0)
-           && ((qrbuf->QRfloor == (CC->FloorBeingSearched))
-               || ((CC->FloorBeingSearched) < 0)))
+           && ((qrbuf->QRfloor == (FloorBeingSearched))
+               || ((FloorBeingSearched) < 0)))
                list_roomname(qrbuf);
 }
 
 void cmd_lkro(char *argbuf)
 {
-       CC->FloorBeingSearched = (-1);
+       int FloorBeingSearched = (-1);
        if (strlen(argbuf) > 0)
-               CC->FloorBeingSearched = extract_int(argbuf, 0);
+               FloorBeingSearched = extract_int(argbuf, 0);
 
        if (!(CC->logged_in)) {
                cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
@@ -550,7 +561,7 @@ void cmd_lkro(char *argbuf)
        }
        cprintf("%d Rooms w/o new msgs:\n", LISTING_FOLLOWS);
 
-       ForEachRoom(cmd_lkro_backend);
+       ForEachRoom(cmd_lkro_backend, &FloorBeingSearched);
        cprintf("000\n");
 }
 
@@ -559,23 +570,25 @@ void cmd_lkro(char *argbuf)
 /* 
  * cmd_lzrm()   -  List all forgotten rooms
  */
-void cmd_lzrm_backend(struct quickroom *qrbuf)
+void cmd_lzrm_backend(struct quickroom *qrbuf, void *data)
 {
        int ra;
+       int FloorBeingSearched = (-1);
+       FloorBeingSearched = *(int *)data;
 
        ra = CtdlRoomAccess(qrbuf, &CC->usersupp);
        if ((ra & UA_GOTOALLOWED)
            && (ra & UA_ZAPPED)
-           && ((qrbuf->QRfloor == (CC->FloorBeingSearched))
-               || ((CC->FloorBeingSearched) < 0)))
+           && ((qrbuf->QRfloor == (FloorBeingSearched))
+               || ((FloorBeingSearched) < 0)))
                list_roomname(qrbuf);
 }
 
 void cmd_lzrm(char *argbuf)
 {
-       CC->FloorBeingSearched = (-1);
+       int FloorBeingSearched = (-1);
        if (strlen(argbuf) > 0)
-               CC->FloorBeingSearched = extract_int(argbuf, 0);
+               FloorBeingSearched = extract_int(argbuf, 0);
 
        if (!(CC->logged_in)) {
                cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
@@ -587,7 +600,7 @@ void cmd_lzrm(char *argbuf)
        }
        cprintf("%d Zapped rooms:\n", LISTING_FOLLOWS);
 
-       ForEachRoom(cmd_lzrm_backend);
+       ForEachRoom(cmd_lzrm_backend, &FloorBeingSearched);
        cprintf("000\n");
 }
 
index 3325dda871ecda56737dbb7550d8351bde371b53..ec2e9d1467e72289bdb0826124b1db3f54565f02 100644 (file)
@@ -41,7 +41,8 @@ void cmd_lflr (void);
 void cmd_cflr (char *argbuf);
 void cmd_kflr (char *argbuf);
 void cmd_eflr (char *argbuf);
-void ForEachRoom(void (*CallBack)(struct quickroom *EachRoom));
+void ForEachRoom(void (*CallBack)(struct quickroom *EachRoom, void *out_data),
+       void *in_data);
 void assoc_file_name(char *buf, struct quickroom *qrbuf, char *prefix);
 void delete_room(struct quickroom *qrbuf);
 void list_roomname(struct quickroom *qrbuf);
index 6ba24723e7f53f11ff5b7278b363555b54387bb7..e70117a384480af9bf1e410b2b70ff663e3f4263 100644 (file)
@@ -92,7 +92,7 @@ int messages_purged;
 
 extern struct CitContext *ContextList;
 
-void DoPurgeMessages(struct quickroom *qrbuf) {
+void DoPurgeMessages(struct quickroom *qrbuf, void *data) {
        struct ExpirePolicy epbuf;
        long delnum;
        time_t xtime, now;
@@ -176,11 +176,11 @@ void DoPurgeMessages(struct quickroom *qrbuf) {
 void PurgeMessages(void) {
        lprintf(5, "PurgeMessages() called\n");
        messages_purged = 0;
-       ForEachRoom(DoPurgeMessages);
+       ForEachRoom(DoPurgeMessages, NULL);
 }
 
 
-void AddValidUser(struct usersupp *usbuf) {
+void AddValidUser(struct usersupp *usbuf, void *data) {
        struct ValidUser *vuptr;
 
        vuptr = (struct ValidUser *)mallok(sizeof(struct ValidUser));
@@ -189,7 +189,7 @@ void AddValidUser(struct usersupp *usbuf) {
        ValidUserList = vuptr;
 }
 
-void AddValidRoom(struct quickroom *qrbuf) {
+void AddValidRoom(struct quickroom *qrbuf, void *data) {
        struct ValidRoom *vrptr;
 
        vrptr = (struct ValidRoom *)mallok(sizeof(struct ValidRoom));
@@ -199,7 +199,7 @@ void AddValidRoom(struct quickroom *qrbuf) {
        ValidRoomList = vrptr;
 }
 
-void DoPurgeRooms(struct quickroom *qrbuf) {
+void DoPurgeRooms(struct quickroom *qrbuf, void *data) {
        time_t age, purge_secs;
        struct PurgeList *pptr;
        struct ValidUser *vuptr;
@@ -263,10 +263,10 @@ int PurgeRooms(void) {
 
        /* Load up a table full of valid user numbers so we can delete
         * user-owned rooms for users who no longer exist */
-       ForEachUser(AddValidUser);
+       ForEachUser(AddValidUser, NULL);
 
        /* Then cycle through the room file */
-       ForEachRoom(DoPurgeRooms);
+       ForEachRoom(DoPurgeRooms, NULL);
 
        /* Free the valid user list */
        while (ValidUserList != NULL) {
@@ -300,7 +300,7 @@ int PurgeRooms(void) {
 }
 
 
-void do_user_purge(struct usersupp *us) {
+void do_user_purge(struct usersupp *us, void *data) {
        int purge;
        time_t now;
        time_t purge_time;
@@ -361,7 +361,7 @@ int PurgeUsers(void) {
 
        lprintf(5, "PurgeUsers() called\n");
        if (config.c_userpurge > 0) {
-               ForEachUser(do_user_purge);
+               ForEachUser(do_user_purge, NULL);
        }
 
        transcript = mallok(256);
@@ -411,10 +411,10 @@ int PurgeVisits(void) {
        int RoomIsValid, UserIsValid;
 
        /* First, load up a table full of valid room/gen combinations */
-       ForEachRoom(AddValidRoom);
+       ForEachRoom(AddValidRoom, NULL);
 
        /* Then load up a table full of valid user numbers */
-       ForEachUser(AddValidUser);
+       ForEachUser(AddValidUser, NULL);
 
        /* Now traverse through the visits, purging irrelevant records... */
        cdb_rewind(CDB_VISIT);
index 6b39d021c91db6c99c2bd0a4841efe3316e7e73d..5dacdabb38891bbc3041c8d4f5585dfdc982cd76 100644 (file)
@@ -180,7 +180,7 @@ void smtp_auth(char *argbuf) {
 /*
  * Back end for smtp_vrfy() command
  */
-void smtp_vrfy_backend(struct usersupp *us) {
+void smtp_vrfy_backend(struct usersupp *us, void *data) {
 
        if (!fuzzy_match(us, SMTP->vrfy_match)) {
                ++SMTP->vrfy_count;
@@ -196,7 +196,7 @@ void smtp_vrfy_backend(struct usersupp *us) {
 void smtp_vrfy(char *argbuf) {
        SMTP->vrfy_count = 0;
        strcpy(SMTP->vrfy_match, argbuf);
-       ForEachUser(smtp_vrfy_backend);
+       ForEachUser(smtp_vrfy_backend, NULL);
 
        if (SMTP->vrfy_count < 1) {
                cprintf("550 String does not match anything.\r\n");
@@ -219,7 +219,7 @@ void smtp_vrfy(char *argbuf) {
 /*
  * Back end for smtp_expn() command
  */
-void smtp_expn_backend(struct usersupp *us) {
+void smtp_expn_backend(struct usersupp *us, void *data) {
 
        if (!fuzzy_match(us, SMTP->vrfy_match)) {
 
@@ -243,7 +243,7 @@ void smtp_expn_backend(struct usersupp *us) {
 void smtp_expn(char *argbuf) {
        SMTP->vrfy_count = 0;
        strcpy(SMTP->vrfy_match, argbuf);
-       ForEachUser(smtp_expn_backend);
+       ForEachUser(smtp_expn_backend, NULL);
 
        if (SMTP->vrfy_count < 1) {
                cprintf("550 String does not match anything.\r\n");
index 26e8020cea9eee3df1fd061dd8b2cd7677418186..00136f7ea42d45990737df05faa9491e18b0878e 100644 (file)
@@ -98,11 +98,7 @@ struct CitContext {
        char fake_hostname[25]; /* Name of the fake hostname <bc>    */
        char fake_roomname[ROOMNAMELEN];        /* Name of the fake room <bc> */
 
-       int FloorBeingSearched; /* This is used by cmd_lrms() etc.   */
-
        struct CtdlSessData *FirstSessData;     /* Allocated session data */
-       char buffer1[256];              /* General-purpose workspace */
-       char buffer2[256];              /* General-purpose workspace */
 };
 
 typedef struct CitContext t_context;
index 3ed2d286894123533c0f9b283a42fbc2bcb5df34..75dda4ba4ddf2fb213a05b65733add72ad032380 100644 (file)
@@ -992,7 +992,8 @@ void cmd_vali(char *v_args)
 /* 
  *  Traverse the user file...
  */
-void ForEachUser(void (*CallBack)(struct usersupp *EachUser)) {
+void ForEachUser(void (*CallBack)(struct usersupp *EachUser, void *out_data),
+               void *in_data) {
        struct usersupp usbuf;
        struct cdbdata *cdbus;
 
@@ -1004,7 +1005,7 @@ void ForEachUser(void (*CallBack)(struct usersupp *EachUser)) {
                        ( (cdbus->len > sizeof(struct usersupp)) ?
                        sizeof(struct usersupp) : cdbus->len) );
                cdb_free(cdbus);
-               (*CallBack)(&usbuf);
+               (*CallBack)(&usbuf, in_data);
                }
        }
 
@@ -1012,7 +1013,7 @@ void ForEachUser(void (*CallBack)(struct usersupp *EachUser)) {
 /*
  * List one user (this works with cmd_list)
  */
-void ListThisUser(struct usersupp *usbuf) {
+void ListThisUser(struct usersupp *usbuf, void *data) {
        if (usbuf->axlevel > 0) {
                if ((CC->usersupp.axlevel>=6)
                   ||((usbuf->flags&US_UNLISTED)==0)
@@ -1036,7 +1037,7 @@ void ListThisUser(struct usersupp *usbuf) {
  */
 void cmd_list(void) {
        cprintf("%d \n",LISTING_FOLLOWS);
-       ForEachUser(ListThisUser);
+       ForEachUser(ListThisUser, NULL);
        cprintf("000\n");
        }
 
index b151ff18f1fce7045333add6cb512af2e2f80893..144a3c1117235b80efd0bcae64a8056178ededfb 100644 (file)
@@ -22,8 +22,9 @@ void cmd_invt_kick (char *iuser, int op);
 void cmd_forg (void);
 void cmd_gnur (void);
 void cmd_vali (char *v_args);
-void ForEachUser(void (*CallBack)(struct usersupp *EachUser));
-void ListThisUser(struct usersupp *usbuf);
+void ForEachUser(void (*CallBack)(struct usersupp *EachUser, void *out_data),
+       void *in_data);
+void ListThisUser(struct usersupp *usbuf, void *data);
 void cmd_list (void);
 void cmd_chek (void);
 void cmd_qusr (char *who);