Defined user/room relationships
authorArt Cancro <ajc@citadel.org>
Mon, 28 Sep 1998 01:48:04 +0000 (01:48 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 28 Sep 1998 01:48:04 +0000 (01:48 +0000)
citadel/database.c
citadel/server.h

index 3827be57300f29f7429b3a3ef7cdf01183f63403..8f3c75e6702850d0716e2791976726fdd842ce60 100644 (file)
@@ -43,10 +43,11 @@ void defrag_databases(void) {
        gdbm_reorganize(gdbms[CDB_MSGMAIN]);
        end_critical_section(S_MSGMAIN);
 
-       /* defrag the user file and mailboxes */
+       /* defrag the user file, mailboxes, and user/room relationships */
        begin_critical_section(S_USERSUPP);
        gdbm_reorganize(gdbms[CDB_USERSUPP]);
        gdbm_reorganize(gdbms[CDB_MAILBOXES]);
+       gdbm_reorganize(gdbms[CDB_VISIT]);
        end_critical_section(S_USERSUPP);
 
        /* defrag the room files and message lists */
@@ -89,6 +90,13 @@ void open_databases(void) {
                        gdbm_strerror(gdbm_errno));
                }
 
+       gdbms[CDB_VISIT] = gdbm_open("data/visit.gdbm", 0,
+               GDBM_WRCREAT, 0600, NULL);
+       if (gdbms[CDB_VISIT] == NULL) {
+               lprintf(2, "Cannot open visit file: %s\n",
+                       gdbm_strerror(gdbm_errno));
+               }
+
        gdbms[CDB_QUICKROOM] = gdbm_open("data/quickroom.gdbm", 0,
                GDBM_WRCREAT, 0600, NULL);
        if (gdbms[CDB_QUICKROOM] == NULL) {
index a06e8e437de6d8e906af43534673d11a277413c1..27d499670165300a82ed511b72a7a75fefadb7ba 100644 (file)
@@ -122,13 +122,14 @@ struct ChatLine {
 /*
  * Citadel DataBases (define one for each cdb we need to open)
  */
-#define CDB_MSGMAIN    0       /* message base */
-#define CDB_USERSUPP   1       /* user file */
-#define CDB_QUICKROOM  2       /* room index */
-#define CDB_FLOORTAB   3       /* floor index */
-#define CDB_MSGLISTS   4       /* room message lists */
-#define CDB_MAILBOXES  5       /* mailbox message lists */
-#define MAXCDB         6       /* total number of CDB's defined */
+#define CDB_MSGMAIN    0       /* message base                  */
+#define CDB_USERSUPP   1       /* user file                     */
+#define CDB_QUICKROOM  2       /* room index                    */
+#define CDB_FLOORTAB   3       /* floor index                   */
+#define CDB_MSGLISTS   4       /* room message lists            */
+#define CDB_MAILBOXES  5       /* mailbox message lists         */
+#define CDB_VISIT      6       /* user/room relationships       */
+#define MAXCDB         7       /* total number of CDB's defined */
 
 struct cdbdata {
        size_t len;