]> code.citadel.org Git - citadel.git/blobdiff - citadel/user_ops.c
* Added a generic (void *) parameter to the ForEachUser() and ForEachRoom()
[citadel.git] / citadel / user_ops.c
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");
        }