"visit" is now "struct visit" again.
authorArt Cancro <ajc@citadel.org>
Tue, 14 Feb 2023 15:15:59 +0000 (10:15 -0500)
committerArt Cancro <ajc@citadel.org>
Tue, 14 Feb 2023 15:15:59 +0000 (10:15 -0500)
14 files changed:
citadel/server/ctdl_module.h
citadel/server/modules/calendar/serv_calendar.c
citadel/server/modules/ctdlproto/serv_user.c
citadel/server/modules/expire/serv_expire.c
citadel/server/modules/imap/imap_metadata.c
citadel/server/modules/imap/serv_imap.c
citadel/server/modules/migrate/serv_migrate.c
citadel/server/modules/pop3/serv_pop3.c
citadel/server/modules/vcard/serv_vcard.c
citadel/server/msgbase.c
citadel/server/room_ops.c
citadel/server/server.h
citadel/server/user_ops.c
citadel/server/user_ops.h

index 6156d0c20762e44d73ff6908de0cd80a39459dfb..fa1ed4f83ac3b2a794547addb3918e840607f229 100644 (file)
@@ -281,8 +281,8 @@ void CtdlPutUserLock(struct ctdluser *usbuf);
 int CtdlLockGetCurrentUser(void);
 void CtdlPutCurrentUserLock(void);
 int CtdlGetUserByNumber(struct ctdluser *usbuf, long number);
-void CtdlGetRelationship(visit *vbuf, struct ctdluser *rel_user, struct ctdlroom *rel_room);
-void CtdlSetRelationship(visit *newvisit, struct ctdluser *rel_user, struct ctdlroom *rel_room);
+void CtdlGetRelationship(struct visit *vbuf, struct ctdluser *rel_user, struct ctdlroom *rel_room);
+void CtdlSetRelationship(struct visit *newvisit, struct ctdluser *rel_user, struct ctdlroom *rel_room);
 void CtdlMailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix);
 int CtdlLoginExistingUser(const char *username);
 
index 6ae4e37f19195c5a69fc756226279b13b3a505c8..b9a4d1faa9ef03e4676c95f0f86f9e8908af1326 100644 (file)
@@ -1888,7 +1888,7 @@ void cmd_ical(char *argbuf)
 void ical_CtdlCreateRoom(void)
 {
        struct ctdlroom qr;
-       visit vbuf;
+       struct visit vbuf;
 
        /* Create the calendar room if it doesn't already exist */
        CtdlCreateRoom(USERCALENDARROOM, 4, "", 0, 1, 0, VIEW_CALENDAR);
index aa560ee4d3b1382e2f579c38e6fbf4d41ed2cfff..96c5a2620381e2d3dd678a88e73f16b5bee27c8a 100644 (file)
@@ -248,8 +248,8 @@ void cmd_setu(char *new_parms) {
 // set last read pointer (marks all messages in the current room as read, up to the specified point)
 void cmd_slrp(char *new_ptr) {
        long newlr;
-       visit vbuf;
-       visit original_vbuf;
+       struct visit vbuf;
+       struct visit original_vbuf;
 
        if (CtdlAccessCheck(ac_logged_in)) {
                return;
@@ -265,7 +265,7 @@ void cmd_slrp(char *new_ptr) {
        CtdlLockGetCurrentUser();
 
        CtdlGetRelationship(&vbuf, &CC->user, &CC->room);
-       memcpy(&original_vbuf, &vbuf, sizeof(visit));
+       memcpy(&original_vbuf, &vbuf, sizeof(struct visit));
        vbuf.v_lastseen = newlr;
        snprintf(vbuf.v_seen, sizeof vbuf.v_seen, "*:%ld", newlr);
 
@@ -304,7 +304,7 @@ void cmd_seen(char *argbuf) {
 
 
 void cmd_gtsn(char *argbuf) {
-       visit vbuf;
+       struct visit vbuf;
 
        if (CtdlAccessCheck(ac_logged_in)) {
                return;
@@ -710,7 +710,7 @@ void cmd_asea(char *cmdbuf) {
 // Set the preferred view for the current user/room combination
 void cmd_view(char *cmdbuf) {
        int requested_view;
-       visit vbuf;
+       struct visit vbuf;
 
        if (CtdlAccessCheck(ac_logged_in)) {
                return;
index 58988c197a0398828286c6ebed065d86b4fa1a8c..396932213405b691bfdce1adb176e7a91018e676 100644 (file)
@@ -505,7 +505,7 @@ int PurgeUsers(void) {
 //
 int PurgeVisits(void) {
        struct cdbdata *cdbvisit;
-       visit vbuf;
+       struct visit vbuf;
        struct VPurgeList *VisitPurgeList = NULL;
        struct VPurgeList *vptr;
        int purged = 0;
@@ -524,10 +524,10 @@ int PurgeVisits(void) {
        // Now traverse through the visits, purging irrelevant records...
        cdb_rewind(CDB_VISIT);
        while(cdbvisit = cdb_next_item(CDB_VISIT), cdbvisit != NULL) {
-               memset(&vbuf, 0, sizeof(visit));
+               memset(&vbuf, 0, sizeof(struct visit));
                memcpy(&vbuf, cdbvisit->ptr,
-                       ( (cdbvisit->len > sizeof(visit)) ?
-                         sizeof(visit) : cdbvisit->len) );
+                       ( (cdbvisit->len > sizeof(struct visit)) ?
+                         sizeof(struct visit) : cdbvisit->len) );
                cdb_free(cdbvisit);
 
                RoomIsValid = 0;
index 3cfbbc81ea3a9aab9674782d1d9a422aa793fefb..b61196d10557f005d09b3fbe92a1f5b4d5aeba7e 100644 (file)
@@ -69,7 +69,7 @@ void imap_setmetadata(int num_parms, ConstStr *Params) {
        int setting_user_value = 0;
        char set_value[32];
        int set_view = VIEW_BBS;
-       visit vbuf;
+       struct visit vbuf;
 
        if (num_parms != 6) {
                IReply("BAD usage error");
index e492bc74faef77eb2f3385e8558b88827272daaf..74697f1faffbde81b1c6991b7c72bf17f9469930 100644 (file)
@@ -159,7 +159,7 @@ void imap_free_transmitted_message(void) {
  */
 void imap_set_seen_flags(int first_msg) {
        citimap *Imap = IMAP;
-       visit vbuf;
+       struct visit vbuf;
        int i;
        int num_sets;
        int s;
index ffd615a48a56298b0c2413e44d974f4aa6fc4cc0..0b44fb3b72bf2625030366a3a5cdcb9d0d02f03f 100644 (file)
@@ -252,16 +252,16 @@ int is_sequence_set(char *s) {
 
 // Traverse the visits file...
 void migr_export_visits(void) {
-       visit vbuf;
+       struct visit vbuf;
        struct cdbdata *cdbv;
 
        cdb_rewind(CDB_VISIT);
 
        while (cdbv = cdb_next_item(CDB_VISIT), cdbv != NULL) {
-               memset(&vbuf, 0, sizeof(visit));
+               memset(&vbuf, 0, sizeof(struct visit));
                memcpy(&vbuf, cdbv->ptr,
-                      ((cdbv->len > sizeof(visit)) ?
-                       sizeof(visit) : cdbv->len));
+                      ((cdbv->len > sizeof(struct visit)) ?
+                       sizeof(struct visit) : cdbv->len));
                cdb_free(cdbv);
 
                client_write(HKEY("<visit>\n"));
@@ -500,7 +500,7 @@ long openid_usernum = 0;
 char FRname[ROOMNAMELEN];
 struct floor flbuf;
 int floornum = 0;
-visit vbuf;
+struct visit vbuf;
 struct MetaData smi;
 long import_msgnum = 0;
 
@@ -540,12 +540,12 @@ void migr_xml_start(void *data, const char *el, const char **attr) {
 
        // When we begin receiving XML for one of these record types, clear out the associated
        // buffer so we don't accidentally carry over any data from a previous record.
-       if (!strcasecmp(el, "user"))                    memset(&usbuf, 0, sizeof (struct ctdluser));
+       if (!strcasecmp(el, "user"))                    memset(&usbuf, 0, sizeof(struct ctdluser));
        else if (!strcasecmp(el, "openid"))             memset(openid_url, 0, sizeof openid_url);
-       else if (!strcasecmp(el, "room"))               memset(&qrbuf, 0, sizeof (struct ctdlroom));
+       else if (!strcasecmp(el, "room"))               memset(&qrbuf, 0, sizeof(struct ctdlroom));
        else if (!strcasecmp(el, "room_messages"))      memset(FRname, 0, sizeof FRname);
-       else if (!strcasecmp(el, "floor"))              memset(&flbuf, 0, sizeof (struct floor));
-       else if (!strcasecmp(el, "visit"))              memset(&vbuf, 0, sizeof (visit));
+       else if (!strcasecmp(el, "floor"))              memset(&flbuf, 0, sizeof(struct floor));
+       else if (!strcasecmp(el, "visit"))              memset(&vbuf, 0, sizeof(struct visit));
 
        else if (!strcasecmp(el, "message")) {
                memset(&smi, 0, sizeof (struct MetaData));
index 067c30435174ed35f4dd0ed9deb279080bdf7968..322f2d826038834c47f55d21ef714339a75c98e9 100644 (file)
@@ -144,7 +144,7 @@ void pop3_add_message(long msgnum, void *userdata) {
 // (This should be called only once, by pop3_pass(), and returns the number
 // of messages in the inbox, or -1 for error)
 int pop3_grab_mailbox(void) {
-        visit vbuf;
+        struct visit vbuf;
        int i;
 
        if (CtdlGetRoom(&CC->room, MAILROOM) != 0) return(-1);
@@ -360,7 +360,7 @@ void pop3_dele(char *argbuf) {
 // Perform "UPDATE state" stuff
 void pop3_update(void) {
        int i;
-        visit vbuf;
+        struct visit vbuf;
 
        long *deletemsgs = NULL;
        int num_deletemsgs = 0;
index 3ae7997321dd0324a0af1123978e830660eafb69..d71f3d6a80ceb297c59f67692cb56a9cf4dcd396 100644 (file)
@@ -957,7 +957,7 @@ void check_get_greeting(void) {
 void vcard_CtdlCreateRoom(void)
 {
        struct ctdlroom qr;
-       visit vbuf;
+       struct visit vbuf;
 
        /* Create the calendar room if it doesn't already exist */
        CtdlCreateRoom(USERCONTACTSROOM, 4, "", 0, 1, 0, VIEW_ADDRESSBOOK);
index bf6bb4056e622723310c64c6a6eda23779ecaaf1..43481ad2c80705faf03488c01df1dfa478e67167 100644 (file)
@@ -386,7 +386,7 @@ int CtdlMsgCmp(struct CtdlMessage *msg, struct CtdlMessage *template) {
 
 // Retrieve the "seen" message list for the current room.
 void CtdlGetSeen(char *buf, int which_set) {
-       visit vbuf;
+       struct visit vbuf;
 
        // Learn about the user and room in question
        CtdlGetRelationship(&vbuf, &CC->user, &CC->room);
@@ -410,7 +410,7 @@ void CtdlSetSeen(long *target_msgnums, int num_target_msgnums,
        int was_seen = 0;
        long lo = (-1L);
        long hi = (-1L);
-       visit vbuf;
+       struct visit vbuf;
        long *msglist;
        int num_msgs = 0;
        StrBuf *vset;
@@ -625,7 +625,7 @@ int CtdlForEachMessage(int mode, long ref, char *search_string,
                        void *userdata)
 {
        int a, i, j;
-       visit vbuf;
+       struct visit vbuf;
        struct cdbdata *cdbfr;
        long *msglist = NULL;
        int num_msgs = 0;
index f9abe87785db6a740bbab734f08083c9859efff3..cb85378c50d2f292d9f336d8668e0c0b04b5cac4 100644 (file)
@@ -97,7 +97,7 @@ int CtdlDoIHavePermissionToDeleteMessagesFromThisRoom(void) {
 // Yes, it has a couple of gotos.  If you don't like that, go die in a car fire.
 void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf, int *result, int *view) {
        int retval = 0;
-       visit vbuf;
+       struct visit vbuf;
        int is_me = 0;
        int is_guest = 0;
 
@@ -625,7 +625,7 @@ void CtdlUserGoto(char *where, int display_result, int transiently, int *retmsgs
        int info = 0;
        int rmailflag;
        int raideflag;
-       visit vbuf;
+       struct visit vbuf;
        char truncated_roomname[ROOMNAMELEN];
         struct cdbdata *cdbfr;
        long *msglist = NULL;
@@ -1031,7 +1031,7 @@ unsigned CtdlCreateRoom(char *new_room_name,
 {
        struct ctdlroom qrbuf;
        struct floor flbuf;
-       visit vbuf;
+       struct visit vbuf;
 
        syslog(LOG_DEBUG, "room_ops: CtdlCreateRoom(name=%s, type=%d, view=%d)", new_room_name, new_room_type, new_room_view);
 
index 96ead6791df9d6f0a2e276a6f7c4d973d0f914d1..d0a4cf8f647c85623d3ea168b3393e9e9290eab8 100644 (file)
@@ -74,7 +74,7 @@ struct cdbdata {
 
 
 // Defines the relationship of a user to a particular room
-typedef struct __visit {
+struct visit {
        long v_roomnum;
        long v_roomgen;
        long v_usernum;
@@ -83,7 +83,7 @@ typedef struct __visit {
        char v_seen[SIZ];
        char v_answered[SIZ];
        int v_view;
-} visit;
+};
 
 
 // Supplementary data for a message on disk
index d907074a4f88fb8367bbc3af755cc8a596f48ad1..5ee1da4a6c56b7d2e467e2a0ddd4bacc4e39c620 100644 (file)
@@ -246,7 +246,7 @@ int GenerateRelationshipIndex(char *IndexBuf,
 
 
 // Back end for CtdlSetRelationship()
-void put_visit(visit *newvisit) {
+void put_visit(struct visit *newvisit) {
        char IndexBuf[32];
        int IndexLen = 0;
 
@@ -256,13 +256,13 @@ void put_visit(visit *newvisit) {
 
        // Store the record
        cdb_store(CDB_VISIT, IndexBuf, IndexLen,
-                 newvisit, sizeof(visit)
+                 newvisit, sizeof(struct visit)
        );
 }
 
 
 // Define a relationship between a user and a room
-void CtdlSetRelationship(visit *newvisit, struct ctdluser *rel_user, struct ctdlroom *rel_room) {
+void CtdlSetRelationship(struct visit *newvisit, struct ctdluser *rel_user, struct ctdlroom *rel_room) {
        // We don't use these in Citadel because they're implicit by the
        // index, but they must be present if the database is exported.
        newvisit->v_roomnum = rel_room->QRnumber;
@@ -274,7 +274,7 @@ void CtdlSetRelationship(visit *newvisit, struct ctdluser *rel_user, struct ctdl
 
 
 // Locate a relationship between a user and a room
-void CtdlGetRelationship(visit *vbuf, struct ctdluser *rel_user, struct ctdlroom *rel_room) {
+void CtdlGetRelationship(struct visit *vbuf, struct ctdluser *rel_user, struct ctdlroom *rel_room) {
        char IndexBuf[32];
        int IndexLen;
        struct cdbdata *cdbvisit;
@@ -283,11 +283,11 @@ void CtdlGetRelationship(visit *vbuf, struct ctdluser *rel_user, struct ctdlroom
        IndexLen = GenerateRelationshipIndex(IndexBuf, rel_room->QRnumber, rel_room->QRgen, rel_user->usernum);
 
        // Clear out the buffer
-       memset(vbuf, 0, sizeof(visit));
+       memset(vbuf, 0, sizeof(struct visit));
 
        cdbvisit = cdb_fetch(CDB_VISIT, IndexBuf, IndexLen);
        if (cdbvisit != NULL) {
-               memcpy(vbuf, cdbvisit->ptr, ((cdbvisit->len > sizeof(visit)) ?  sizeof(visit) : cdbvisit->len));
+               memcpy(vbuf, cdbvisit->ptr, ((cdbvisit->len > sizeof(struct visit)) ?  sizeof(struct visit) : cdbvisit->len));
                cdb_free(cdbvisit);
        }
        else {
@@ -1016,7 +1016,7 @@ void CtdlSetPassword(char *new_pw) {
 // Set iuser to the name of the user, and op to 1=invite or 0=kick
 int CtdlInvtKick(char *iuser, int op) {
        struct ctdluser USscratch;
-       visit vbuf;
+       struct visit vbuf;
        char bbb[SIZ];
 
        if (CtdlGetUser(&USscratch, iuser) != 0) {
@@ -1049,7 +1049,7 @@ int CtdlInvtKick(char *iuser, int op) {
 // Forget (Zap) the current room (API call)
 // Returns 0 on success
 int CtdlForgetThisRoom(void) {
-       visit vbuf;
+       struct visit vbuf;
 
        // On some systems, Admins are not allowed to forget rooms
        if (is_aide() && (CtdlGetConfigInt("c_aide_zap") == 0)
@@ -1134,7 +1134,7 @@ int InitialMailCheck() {
        int a;
        char mailboxname[ROOMNAMELEN];
        struct ctdlroom mailbox;
-       visit vbuf;
+       struct visit vbuf;
        struct cdbdata *cdbfr;
        long *msglist = NULL;
        int num_msgs = 0;
index 1a1ba66bc2e28952c3a0a3d0e37e60ad9375cb45..ffcc0e857a7f5b0b4417952b8208592d8c43820e 100644 (file)
@@ -38,7 +38,7 @@ int CtdlInvtKick(char *iuser, int op);
 void ForEachUser(void (*CallBack) (char *, void *out_data), void *in_data);
 int NewMailCount(void);
 int InitialMailCheck(void);
-void put_visit(visit *newvisit);
+void put_visit(struct visit *newvisit);
 int GenerateRelationshipIndex(char *IndexBuf, long RoomID, long RoomGen, long UserID);
 int CtdlAssociateSystemUser(char *screenname, char *loginname);