From 6409b7aa33156c921654d5bdc0c46830848230d0 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 14 Feb 2023 10:15:59 -0500 Subject: [PATCH] "visit" is now "struct visit" again. --- citadel/server/ctdl_module.h | 4 ++-- .../server/modules/calendar/serv_calendar.c | 2 +- citadel/server/modules/ctdlproto/serv_user.c | 10 +++++----- citadel/server/modules/expire/serv_expire.c | 8 ++++---- citadel/server/modules/imap/imap_metadata.c | 2 +- citadel/server/modules/imap/serv_imap.c | 2 +- citadel/server/modules/migrate/serv_migrate.c | 18 +++++++++--------- citadel/server/modules/pop3/serv_pop3.c | 4 ++-- citadel/server/modules/vcard/serv_vcard.c | 2 +- citadel/server/msgbase.c | 6 +++--- citadel/server/room_ops.c | 6 +++--- citadel/server/server.h | 4 ++-- citadel/server/user_ops.c | 18 +++++++++--------- citadel/server/user_ops.h | 2 +- 14 files changed, 44 insertions(+), 44 deletions(-) diff --git a/citadel/server/ctdl_module.h b/citadel/server/ctdl_module.h index 6156d0c20..fa1ed4f83 100644 --- a/citadel/server/ctdl_module.h +++ b/citadel/server/ctdl_module.h @@ -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); diff --git a/citadel/server/modules/calendar/serv_calendar.c b/citadel/server/modules/calendar/serv_calendar.c index 6ae4e37f1..b9a4d1faa 100644 --- a/citadel/server/modules/calendar/serv_calendar.c +++ b/citadel/server/modules/calendar/serv_calendar.c @@ -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); diff --git a/citadel/server/modules/ctdlproto/serv_user.c b/citadel/server/modules/ctdlproto/serv_user.c index aa560ee4d..96c5a2620 100644 --- a/citadel/server/modules/ctdlproto/serv_user.c +++ b/citadel/server/modules/ctdlproto/serv_user.c @@ -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; diff --git a/citadel/server/modules/expire/serv_expire.c b/citadel/server/modules/expire/serv_expire.c index 58988c197..396932213 100644 --- a/citadel/server/modules/expire/serv_expire.c +++ b/citadel/server/modules/expire/serv_expire.c @@ -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; diff --git a/citadel/server/modules/imap/imap_metadata.c b/citadel/server/modules/imap/imap_metadata.c index 3cfbbc81e..b61196d10 100644 --- a/citadel/server/modules/imap/imap_metadata.c +++ b/citadel/server/modules/imap/imap_metadata.c @@ -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"); diff --git a/citadel/server/modules/imap/serv_imap.c b/citadel/server/modules/imap/serv_imap.c index e492bc74f..74697f1fa 100644 --- a/citadel/server/modules/imap/serv_imap.c +++ b/citadel/server/modules/imap/serv_imap.c @@ -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; diff --git a/citadel/server/modules/migrate/serv_migrate.c b/citadel/server/modules/migrate/serv_migrate.c index ffd615a48..0b44fb3b7 100644 --- a/citadel/server/modules/migrate/serv_migrate.c +++ b/citadel/server/modules/migrate/serv_migrate.c @@ -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("\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)); diff --git a/citadel/server/modules/pop3/serv_pop3.c b/citadel/server/modules/pop3/serv_pop3.c index 067c30435..322f2d826 100644 --- a/citadel/server/modules/pop3/serv_pop3.c +++ b/citadel/server/modules/pop3/serv_pop3.c @@ -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; diff --git a/citadel/server/modules/vcard/serv_vcard.c b/citadel/server/modules/vcard/serv_vcard.c index 3ae799732..d71f3d6a8 100644 --- a/citadel/server/modules/vcard/serv_vcard.c +++ b/citadel/server/modules/vcard/serv_vcard.c @@ -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); diff --git a/citadel/server/msgbase.c b/citadel/server/msgbase.c index bf6bb4056..43481ad2c 100644 --- a/citadel/server/msgbase.c +++ b/citadel/server/msgbase.c @@ -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; diff --git a/citadel/server/room_ops.c b/citadel/server/room_ops.c index f9abe8778..cb85378c5 100644 --- a/citadel/server/room_ops.c +++ b/citadel/server/room_ops.c @@ -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); diff --git a/citadel/server/server.h b/citadel/server/server.h index 96ead6791..d0a4cf8f6 100644 --- a/citadel/server/server.h +++ b/citadel/server/server.h @@ -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 diff --git a/citadel/server/user_ops.c b/citadel/server/user_ops.c index d907074a4..5ee1da4a6 100644 --- a/citadel/server/user_ops.c +++ b/citadel/server/user_ops.c @@ -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; diff --git a/citadel/server/user_ops.h b/citadel/server/user_ops.h index 1a1ba66bc..ffcc0e857 100644 --- a/citadel/server/user_ops.h +++ b/citadel/server/user_ops.h @@ -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); -- 2.39.2