+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
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 */
};
+
+
+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
*/
struct CtdlRoomInfo {
char RoomName[32];
+ time_t mtime;
};
/** 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;
*/
void putroom(struct quickroom *qrbuf, int room_num)
{
-
+ time(&qrbuf->QRmtime);
cdb_store(CDB_QUICKROOM, &room_num, sizeof(int),
qrbuf, sizeof(struct quickroom));
}
/*
* Citadel/UX setup program
- * v4.1 / by Art Cancro
- * see copyright.txt for copyright information
*
* *** YOU MUST EDIT sysconfig.h >BEFORE< COMPILING SETUP ***
*/
"",
"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",
}
-#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;
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.