* setup.c: Removed yesno_s()
authorArt Cancro <ajc@citadel.org>
Tue, 25 Aug 1998 03:51:09 +0000 (03:51 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 25 Aug 1998 03:51:09 +0000 (03:51 +0000)
        * citadel.h, room_ops.c: added QRmtime field to struct quickroom,
          modified whenever a room is modified or posted in.
        * citadelapi.c: Added CtdlForEachRoom() function

citadel/ChangeLog
citadel/citadel.h
citadel/citadelapi.c
citadel/ipcdef.h
citadel/room_ops.c
citadel/setup.c
citadel/techdoc/api.txt

index 9b4243fd93dc6ca2af2f1efebfb851d4410379a1..5a5b50542ea1a6d48414de0a135c0cb0072be15b 100644 (file)
@@ -1,3 +1,9 @@
+Mon Aug 24 23:45:01 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * setup.c: Removed yesno_s()
+       * citadel.h, room_ops.c: added QRmtime field to struct quickroom,
+         modified whenever a room is modified or posted in.
+       * citadelapi.c: Added CtdlForEachRoom() function
+
 Mon Aug 24 20:04:04 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
         * Makefile.in: new target `cleaner' does the same as `realclean' 
           without removing sysdep.h
index 1d1fd688a727efdff66a8f6456ad1a8c7a5783cf..b1913411a4db63e81279dd57e5b2b421942bfd63 100644 (file)
@@ -124,6 +124,7 @@ struct quickroom {
        char QRdirname[15];             /* Directory name, if applicable    */
        long QRinfo;                    /* Info file update relative to msgs*/
        char QRfloor;                   /* Which floor this room is on      */
+       time_t QRmtime;                 /* Date/time of last post           */
        };
 
 
index 9e68e87333f6095bf0d4dd86c898ab1c2c7d9b69..a43306a521be85a6478ef40590b30cc2dd5460a7 100644 (file)
@@ -402,6 +402,39 @@ int CtdlForEachUser(int (*CallBack)(char *EachUser))  {
 
 
 
+
+
+int CtdlForEachRoom(int (*CallBack)(char *EachRoom))  {
+       struct CtdlInternalList *TheList = NULL;
+       struct CtdlInternalList *ptr;
+       char buf[256];
+
+       serv_puts("LKRA");
+       serv_gets(buf);
+       if (buf[0] != '1') return(-1);
+
+       while (serv_gets(buf), strcmp(buf, "000")) {
+               ptr = (struct CtdlInternalList *)
+                       malloc(sizeof (struct CtdlInternalList));
+               if (ptr != NULL) {
+                       CtdlInternalExtract(ptr->data, buf, 0);
+                       ptr->next = TheList;
+                       TheList = ptr;
+                       }
+               }
+
+       while (TheList != NULL) {
+               (*CallBack)(TheList->data);
+               ptr = TheList->next;
+               free(TheList);
+               TheList = ptr;
+               }
+
+       return(0);
+       }
+
+
+
 /*
  * Goto a different room
  */
index 5d8069f89fb98ba642b8eec6874464c5f4d8af47..f21408a28c35d77e18d054cccc602aca5f2ed938 100644 (file)
@@ -85,4 +85,5 @@ struct CtdlServerHandle {
 
 struct CtdlRoomInfo {
        char RoomName[32];
+       time_t mtime;
        };
index 8af8feac5c06698b1be196c67d584ecf1d64a3bc..a2ba42af8af5476872fc54bacc4efc6695031262 100644 (file)
@@ -103,7 +103,7 @@ void getroom(struct quickroom *qrbuf, int room_num)
 
 
        /** FIX **   VILE SLEAZY HACK ALERT!!  
-        * This is a temporary fix until I can track down where room names
+        * This is a temporary fix until we can track down where room names
         * are getting corrupted on some systems.
         */
        for (a=0; a<20; ++a) if (qrbuf->QRname[a] < 32) qrbuf->QRname[a] = 0;
@@ -125,7 +125,7 @@ void lgetroom(struct quickroom *qrbuf, int room_num)
  */
 void putroom(struct quickroom *qrbuf, int room_num)
 {
-
+       time(&qrbuf->QRmtime);
        cdb_store(CDB_QUICKROOM, &room_num, sizeof(int),
                qrbuf, sizeof(struct quickroom));
        }
index bf05610ea9551c2f385cab9618a5f9283233471c..66cb932274d72008cc3db9c37f794fee11712997 100644 (file)
@@ -1,7 +1,5 @@
 /*
  * Citadel/UX setup program
- * v4.1 / by Art Cancro
- * see copyright.txt for copyright information
  *
  * *** YOU MUST EDIT sysconfig.h >BEFORE< COMPILING SETUP ***
  */
@@ -139,8 +137,7 @@ char *setup_text[] = {
 "",
 "The most common settings for this will be either 1, for",
 "systems which require new user validation by the system",
-"administrator ('sysop' is a word for people who run DOS",
-"boards!), or 4, for systems which give instant access.",
+"administrator, or 4, for systems which give instant access.",
 "The current access levels available are:",
 
 "11",
@@ -726,50 +723,6 @@ void set_long_val(int msgpos, long int *ip)
        }
 
 
-#if 0 /* FIXME: this isn't used, can we remove it? */
-int yesno_s(char *question) {
-       int a;
-       char buf[4096];
-       char tempfile[64];
-       FILE *fp;
-
-       sprintf(tempfile, "/tmp/setup.%d", getpid());
-       switch (setup_type) {
-       
-               case UI_TEXT:
-                       a=yesno(question);
-                       if (a==1) a=yesno("Are you SURE you want to reinitialize this file? ");
-                       return(a);
-                       break;
-
-               case UI_CURSES:
-                       a=yesno(question);
-                       if (a==1) a=yesno("Are you SURE you want to reinitialize this file? ");
-                       return(a);
-                       break;
-
-               case UI_DIALOG:
-                       a = yesno(question);
-                       if (a==0) return(a);
-                       sprintf(buf, "dialog --title \"Confirm file overwrite\" --menu \"\nAre you SURE you want to reinitialize this file?\n\" 13 80 2 NO \"No, don't overwrite\" YES \"Yes, overwrite the existing file\" 2>%s", tempfile);
-                       a = system(buf);
-                       if (a != 0) return(0);
-                       fp = fopen(tempfile, "rb");
-                       fgets(buf, 4095, fp);
-                       fclose(fp);
-                       if (strlen(buf)>0) 
-                               if (buf[strlen(buf)-1]==10)
-                                       buf[strlen(buf)-1]=0;
-                       return( (!strcmp(buf, "YES")) ? 1 : 0 );
-                       break;
-
-               }
-
-       return(0); /* just in case */
-       }
-#endif
-
-
 void edit_value(int curr)
 {
  int a;
index bfe9e5017172d398de29b722e80123858e80037d..f6880c0a01eefd0b627873dd3ec48dba291f9bf2 100644 (file)
@@ -150,3 +150,10 @@ the user being processed.
 administrative or privileged access may enter any room on the system.  An
 extension running in the context of an ordinary user may enter any room to
 which the user has access.
+ int CtdlForEachRoom(int (*CallBack)(char *EachRoom))  
+ This allows a user-supplied function to be called once for each active room
+on the system; the single argument passed to the function will be the name of
+the room being processed.