* Renamed "SuppMsgInfo" to "MetaData" because that's what it is
authorArt Cancro <ajc@citadel.org>
Mon, 29 Oct 2001 22:59:23 +0000 (22:59 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 29 Oct 2001 22:59:23 +0000 (22:59 +0000)
citadel/ChangeLog
citadel/msgbase.c
citadel/msgbase.h
citadel/serv_expire.c
citadel/serv_moderate.c
citadel/serv_vandelay.c
citadel/server.h

index e71ae5ae32744c128fc91e843b8d05af330bc3af..c540588ea605d7fc61492cb5f7384711262bdd18 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 580.72  2001/10/29 22:59:22  ajc
+ * Renamed "SuppMsgInfo" to "MetaData" because that's what it is
+
  Revision 580.71  2001/10/29 16:39:54  ajc
  * Finished the migratenet utility (finally).
 
@@ -2846,3 +2849,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
+
index bd02692ab15cc7a26fd7a2a910b1a153a5fca77a..9f4be333c9161b86ea34ccc92186c38678aa20fd 100644 (file)
@@ -377,7 +377,7 @@ int CtdlForEachMessage(int mode, long ref,
        int num_msgs = 0;
        int num_processed = 0;
        long thismsg;
-       struct SuppMsgInfo smi;
+       struct MetaData smi;
        struct CtdlMessage *msg;
        int is_seen;
        long lastold = 0L;
@@ -404,7 +404,7 @@ int CtdlForEachMessage(int mode, long ref,
         * Now begin the traversal.
         */
        if (num_msgs > 0) for (a = 0; a < num_msgs; ++a) {
-               GetSuppMsgInfo(&smi, msglist[a]);
+               GetMetaData(&smi, msglist[a]);
 
                /* Filter out messages that are moderated below the level
                 * currently being viewed at.
@@ -1693,7 +1693,7 @@ long CtdlSaveMsg(struct CtdlMessage *msg, /* message to save */
        char *mptr = NULL;
        struct usersupp userbuf;
        int a;
-       struct SuppMsgInfo smi;
+       struct MetaData smi;
        FILE *network_fp = NULL;
        static int seqnum = 1;
        struct CtdlMessage *imsg;
@@ -1852,12 +1852,12 @@ long CtdlSaveMsg(struct CtdlMessage *msg,       /* message to save */
         * be a critical section because nobody else knows about this message
         * yet.
         */
-       lprintf(9, "Creating SuppMsgInfo record\n");
-       memset(&smi, 0, sizeof(struct SuppMsgInfo));
+       lprintf(9, "Creating MetaData record\n");
+       memset(&smi, 0, sizeof(struct MetaData));
        smi.smi_msgnum = newmsgid;
        smi.smi_refcount = 0;
        safestrncpy(smi.smi_content_type, content_type, 64);
-       PutSuppMsgInfo(&smi);
+       PutMetaData(&smi);
 
        /* Now figure out where to store the pointers */
        lprintf(9, "Storing pointers\n");
@@ -2413,7 +2413,7 @@ int CtdlDeleteMessages(char *room_name,           /* which room */
        int i;
        int num_deleted = 0;
        int delete_this;
-       struct SuppMsgInfo smi;
+       struct MetaData smi;
 
        lprintf(9, "CtdlDeleteMessages(%s, %ld, %s)\n",
                room_name, dmsgnum, content_type);
@@ -2444,7 +2444,7 @@ int CtdlDeleteMessages(char *room_name,           /* which room */
                        if (strlen(content_type) == 0) {
                                delete_this |= 0x02;
                        } else {
-                               GetSuppMsgInfo(&smi, msglist[i]);
+                               GetMetaData(&smi, msglist[i]);
                                if (!strcasecmp(smi.smi_content_type,
                                                content_type)) {
                                        delete_this |= 0x02;
@@ -2578,15 +2578,15 @@ void cmd_move(char *args)
 
 
 /*
- * GetSuppMsgInfo()  -  Get the supplementary record for a message
+ * GetMetaData()  -  Get the supplementary record for a message
  */
-void GetSuppMsgInfo(struct SuppMsgInfo *smibuf, long msgnum)
+void GetMetaData(struct MetaData *smibuf, long msgnum)
 {
 
        struct cdbdata *cdbsmi;
        long TheIndex;
 
-       memset(smibuf, 0, sizeof(struct SuppMsgInfo));
+       memset(smibuf, 0, sizeof(struct MetaData));
        smibuf->smi_msgnum = msgnum;
        smibuf->smi_refcount = 1;       /* Default reference count is 1 */
 
@@ -2598,29 +2598,29 @@ void GetSuppMsgInfo(struct SuppMsgInfo *smibuf, long msgnum)
                return;         /* record not found; go with defaults */
        }
        memcpy(smibuf, cdbsmi->ptr,
-              ((cdbsmi->len > sizeof(struct SuppMsgInfo)) ?
-               sizeof(struct SuppMsgInfo) : cdbsmi->len));
+              ((cdbsmi->len > sizeof(struct MetaData)) ?
+               sizeof(struct MetaData) : cdbsmi->len));
        cdb_free(cdbsmi);
        return;
 }
 
 
 /*
- * PutSuppMsgInfo()  -  (re)write supplementary record for a message
+ * PutMetaData()  -  (re)write supplementary record for a message
  */
-void PutSuppMsgInfo(struct SuppMsgInfo *smibuf)
+void PutMetaData(struct MetaData *smibuf)
 {
        long TheIndex;
 
        /* Use the negative of the message number for its supp record index */
        TheIndex = (0L - smibuf->smi_msgnum);
 
-       lprintf(9, "PuttSuppMsgInfo(%ld) - ref count is %d\n",
+       lprintf(9, "PuttMetaData(%ld) - ref count is %d\n",
                smibuf->smi_msgnum, smibuf->smi_refcount);
 
        cdb_store(CDB_MSGMAIN,
                  &TheIndex, sizeof(long),
-                 smibuf, sizeof(struct SuppMsgInfo));
+                 smibuf, sizeof(struct MetaData));
 
 }
 
@@ -2631,7 +2631,7 @@ void PutSuppMsgInfo(struct SuppMsgInfo *smibuf)
 void AdjRefCount(long msgnum, int incr)
 {
 
-       struct SuppMsgInfo smi;
+       struct MetaData smi;
        long delnum;
 
        /* This is a *tight* critical section; please keep it that way, as
@@ -2639,11 +2639,11 @@ void AdjRefCount(long msgnum, int incr)
         * Complicating this any further will surely cause deadlock!
         */
        begin_critical_section(S_SUPPMSGMAIN);
-       GetSuppMsgInfo(&smi, msgnum);
+       GetMetaData(&smi, msgnum);
        lprintf(9, "Ref count for message <%ld> before write is <%d>\n",
                msgnum, smi.smi_refcount);
        smi.smi_refcount += incr;
-       PutSuppMsgInfo(&smi);
+       PutMetaData(&smi);
        end_critical_section(S_SUPPMSGMAIN);
        lprintf(9, "Ref count for message <%ld> after write is <%d>\n",
                msgnum, smi.smi_refcount);
index e31ff5e2ba8fca4ab2a42d1278a4608ec05cc016..d928117e70beac5a738081b55753a758b5677f40 100644 (file)
@@ -63,8 +63,8 @@ void cmd_ent0 (char *entargs);
 void cmd_ent3 (char *entargs);
 void cmd_dele (char *delstr);
 void cmd_move (char *args);
-void GetSuppMsgInfo(struct SuppMsgInfo *, long);
-void PutSuppMsgInfo(struct SuppMsgInfo *);
+void GetMetaData(struct MetaData *, long);
+void PutMetaData(struct MetaData *);
 void AdjRefCount(long, int);
 void simple_listing(long, void *);
 int CtdlMsgCmp(struct CtdlMessage *msg, struct CtdlMessage *template);
index cffe99032193b2faf25ee7ab15588079f318549b..34a9fd521c62e83c52badc73b74d007d2160ce9d 100644 (file)
@@ -604,7 +604,7 @@ void do_fsck_room(struct quickroom *qrbuf, void *data)
 void cmd_fsck(char *argbuf) {
        long msgnum;
        struct cdbdata *cdbmsg;
-       struct SuppMsgInfo smi;
+       struct MetaData smi;
        struct roomref *ptr;
        int realcount;
 
@@ -631,7 +631,7 @@ void cmd_fsck(char *argbuf) {
                        cdb_free(cdbmsg);
                        cprintf("Message %7ld    ", msgnum);
 
-                       GetSuppMsgInfo(&smi, msgnum);
+                       GetMetaData(&smi, msgnum);
                        cprintf("refcount=%-2d   ", smi.smi_refcount);
 
                        realcount = 0;
@@ -643,7 +643,7 @@ void cmd_fsck(char *argbuf) {
                        if ( (smi.smi_refcount != realcount)
                           || (realcount == 0) ) {
                                smi.smi_refcount = realcount;
-                               PutSuppMsgInfo(&smi);
+                               PutMetaData(&smi);
                                AdjRefCount(msgnum, 0); /* deletes if needed */
                        }
 
index 18fc11af9dbc86a426ee30c2b43b07a2fbe0277e..616a5ee4ebf587cc47360accdd5ce3d5eccc76aa 100644 (file)
@@ -52,7 +52,7 @@
 void cmd_mmod(char *argbuf) {
        long msgnum;
        int newlevel;
-       struct SuppMsgInfo smi;
+       struct MetaData smi;
        int is_message_in_room;
 
        /* user must be at least a Room Aide to moderate */
@@ -75,9 +75,9 @@ void cmd_mmod(char *argbuf) {
                return;
        }
 
-       GetSuppMsgInfo(&smi, msgnum);
+       GetMetaData(&smi, msgnum);
        smi.smi_mod = newlevel;
-       PutSuppMsgInfo(&smi);
+       PutMetaData(&smi);
 
        cprintf("%d Message %ld is moderated to %d\n", OK, msgnum, newlevel);
 }
index d364740cbd027c664775a77ba3024067a996f1bc..c8376047bf657161c166aaa1e5cbc743e3d7dc66 100644 (file)
@@ -182,7 +182,7 @@ void artv_export_visits(void) {
 
 
 void artv_export_message(long msgnum) {
-       struct SuppMsgInfo smi;
+       struct MetaData smi;
        struct CtdlMessage *msg;
        struct ser_ret smr;
        FILE *fp;
@@ -193,7 +193,7 @@ void artv_export_message(long msgnum) {
        if (msg == NULL) return;        /* fail silently */
 
        cprintf("message\n");
-       GetSuppMsgInfo(&smi, msgnum);
+       GetMetaData(&smi, msgnum);
        cprintf("%ld\n", msgnum);
        cprintf("%d\n", smi.smi_refcount);
        cprintf("%s\n", smi.smi_content_type);
@@ -463,7 +463,7 @@ void artv_import_visit(void) {
 
 
 void artv_import_message(void) {
-       struct SuppMsgInfo smi;
+       struct MetaData smi;
        long msgnum;
        long msglen;
        FILE *fp;
@@ -471,7 +471,7 @@ void artv_import_message(void) {
        char tempfile[SIZ];
        char *mbuf;
 
-       memset(&smi, 0, sizeof(struct SuppMsgInfo));
+       memset(&smi, 0, sizeof(struct MetaData));
        client_gets(buf);       msgnum = atol(buf);
                                smi.smi_msgnum = msgnum;
        client_gets(buf);       smi.smi_refcount = atoi(buf);
@@ -504,7 +504,7 @@ void artv_import_message(void) {
        phree(mbuf);
        unlink(tempfile);
 
-       PutSuppMsgInfo(&smi);
+       PutMetaData(&smi);
        lprintf(7, "Imported message %ld\n", msgnum);
 }
 
index f31ed063cc41b41aaa1c220e4a9ba524187f1c1a..07e57315f1c54ae3d49720089616634f286d588c 100644 (file)
@@ -389,7 +389,7 @@ struct visit {
  * (These are kept separately from the message itself because they are
  * fields whose values may change at some point after the message is saved.)
  */
-struct SuppMsgInfo {
+struct MetaData {
        long smi_msgnum;        /* Message number in *local* message base */
        int smi_refcount;       /* Number of rooms which point to this msg */
        char smi_content_type[64];