From 63262a64633e72e4096aaeedda6950c02fb4d990 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sat, 28 Aug 2010 13:10:50 +0000 Subject: [PATCH] * do typedef the visit struct, remove all those 'struct' statements from all over the source --- citadel/include/ctdl_module.h | 4 ++-- citadel/modules/calendar/serv_calendar.c | 2 +- citadel/modules/expire/serv_expire.c | 8 +++---- citadel/modules/imap/imap_metadata.c | 2 +- citadel/modules/imap/serv_imap.c | 2 +- citadel/modules/migrate/serv_migrate.c | 12 +++++----- citadel/modules/pop3/serv_pop3.c | 4 ++-- citadel/modules/vcard/serv_vcard.c | 2 +- citadel/msgbase.c | 6 ++--- citadel/room_ops.c | 6 ++--- citadel/server.h | 4 ++-- citadel/user_ops.c | 28 ++++++++++++------------ citadel/user_ops.h | 2 +- 13 files changed, 41 insertions(+), 41 deletions(-) diff --git a/citadel/include/ctdl_module.h b/citadel/include/ctdl_module.h index 21550ed87..de0939461 100644 --- a/citadel/include/ctdl_module.h +++ b/citadel/include/ctdl_module.h @@ -309,10 +309,10 @@ int CtdlGetUserLock(struct ctdluser *usbuf, char *name); void CtdlPutUser(struct ctdluser *usbuf); void CtdlPutUserLock(struct ctdluser *usbuf); int CtdlGetUserByNumber(struct ctdluser *usbuf, long number); -void CtdlGetRelationship(struct visit *vbuf, +void CtdlGetRelationship(visit *vbuf, struct ctdluser *rel_user, struct ctdlroom *rel_room); -void CtdlSetRelationship(struct visit *newvisit, +void CtdlSetRelationship(visit *newvisit, struct ctdluser *rel_user, struct ctdlroom *rel_room); void CtdlMailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix); diff --git a/citadel/modules/calendar/serv_calendar.c b/citadel/modules/calendar/serv_calendar.c index 2e6993447..e1e02ae54 100644 --- a/citadel/modules/calendar/serv_calendar.c +++ b/citadel/modules/calendar/serv_calendar.c @@ -1907,7 +1907,7 @@ void cmd_ical(char *argbuf) void ical_CtdlCreateRoom(void) { struct ctdlroom qr; - struct visit vbuf; + visit vbuf; /* Create the calendar room if it doesn't already exist */ CtdlCreateRoom(USERCALENDARROOM, 4, "", 0, 1, 0, VIEW_CALENDAR); diff --git a/citadel/modules/expire/serv_expire.c b/citadel/modules/expire/serv_expire.c index eaae100b3..25c926bf1 100644 --- a/citadel/modules/expire/serv_expire.c +++ b/citadel/modules/expire/serv_expire.c @@ -614,7 +614,7 @@ int PurgeUsers(void) { */ int PurgeVisits(void) { struct cdbdata *cdbvisit; - struct visit vbuf; + visit vbuf; struct VPurgeList *VisitPurgeList = NULL; struct VPurgeList *vptr; int purged = 0; @@ -633,10 +633,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(struct visit)); + memset(&vbuf, 0, sizeof(visit)); memcpy(&vbuf, cdbvisit->ptr, - ( (cdbvisit->len > sizeof(struct visit)) ? - sizeof(struct visit) : cdbvisit->len) ); + ( (cdbvisit->len > sizeof(visit)) ? + sizeof(visit) : cdbvisit->len) ); cdb_free(cdbvisit); RoomIsValid = 0; diff --git a/citadel/modules/imap/imap_metadata.c b/citadel/modules/imap/imap_metadata.c index 09f8022af..7dc3179ad 100644 --- a/citadel/modules/imap/imap_metadata.c +++ b/citadel/modules/imap/imap_metadata.c @@ -83,7 +83,7 @@ void imap_setmetadata(int num_parms, ConstStr *Params) { int setting_user_value = 0; char set_value[32]; int set_view = VIEW_BBS; - struct visit vbuf; + visit vbuf; if (num_parms != 6) { cprintf("%s BAD usage error\r\n", Params[0].Key); diff --git a/citadel/modules/imap/serv_imap.c b/citadel/modules/imap/serv_imap.c index 27c0da4cc..eca6f3c7f 100644 --- a/citadel/modules/imap/serv_imap.c +++ b/citadel/modules/imap/serv_imap.c @@ -128,7 +128,7 @@ void imap_free_transmitted_message(void) */ void imap_set_seen_flags(int first_msg) { - struct visit vbuf; + visit vbuf; int i; int num_sets; int s; diff --git a/citadel/modules/migrate/serv_migrate.c b/citadel/modules/migrate/serv_migrate.c index cf8512916..8b431c8af 100644 --- a/citadel/modules/migrate/serv_migrate.c +++ b/citadel/modules/migrate/serv_migrate.c @@ -213,16 +213,16 @@ void migr_export_floors(void) { * Traverse the visits file... */ void migr_export_visits(void) { - struct visit vbuf; + visit vbuf; struct cdbdata *cdbv; cdb_rewind(CDB_VISIT); while (cdbv = cdb_next_item(CDB_VISIT), cdbv != NULL) { - memset(&vbuf, 0, sizeof(struct visit)); + memset(&vbuf, 0, sizeof(visit)); memcpy(&vbuf, cdbv->ptr, - ((cdbv->len > sizeof(struct visit)) ? - sizeof(struct visit) : cdbv->len)); + ((cdbv->len > sizeof(visit)) ? + sizeof(visit) : cdbv->len)); cdb_free(cdbv); client_write("\n", 8); @@ -497,7 +497,7 @@ long openid_usernum = 0; char FRname[ROOMNAMELEN]; struct floor flbuf; int floornum = 0; -struct visit vbuf; +visit vbuf; struct MetaData smi; long import_msgnum = 0; char *decoded_msg = NULL; @@ -561,7 +561,7 @@ void migr_xml_start(void *data, const char *el, const char **attr) { 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 (struct visit)); + else if (!strcasecmp(el, "visit")) memset(&vbuf, 0, sizeof (visit)); else if (!strcasecmp(el, "message")) { memset(&smi, 0, sizeof (struct MetaData)); diff --git a/citadel/modules/pop3/serv_pop3.c b/citadel/modules/pop3/serv_pop3.c index 2c1402dbd..50c274901 100644 --- a/citadel/modules/pop3/serv_pop3.c +++ b/citadel/modules/pop3/serv_pop3.c @@ -185,7 +185,7 @@ void pop3_add_message(long msgnum, void *userdata) { * of messages in the inbox, or -1 for error) */ int pop3_grab_mailbox(void) { - struct visit vbuf; + visit vbuf; int i; if (CtdlGetRoom(&CC->room, MAILROOM) != 0) return(-1); @@ -472,7 +472,7 @@ void pop3_dele(char *argbuf) { */ void pop3_update(void) { int i; - struct visit vbuf; + visit vbuf; long *deletemsgs = NULL; int num_deletemsgs = 0; diff --git a/citadel/modules/vcard/serv_vcard.c b/citadel/modules/vcard/serv_vcard.c index fcfd5f3d8..71525578b 100644 --- a/citadel/modules/vcard/serv_vcard.c +++ b/citadel/modules/vcard/serv_vcard.c @@ -1171,7 +1171,7 @@ void check_get_greeting(void) { void vcard_CtdlCreateRoom(void) { struct ctdlroom qr; - struct visit vbuf; + visit vbuf; /* Create the calendar room if it doesn't already exist */ CtdlCreateRoom(USERCONTACTSROOM, 4, "", 0, 1, 0, VIEW_ADDRESSBOOK); diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 6ea0f55a2..5178f2c51 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -356,7 +356,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) { - struct visit vbuf; + visit vbuf; /* Learn about the user and room in question */ CtdlGetRelationship(&vbuf, &CC->user, &CC->room); @@ -381,7 +381,7 @@ void CtdlSetSeen(long *target_msgnums, int num_target_msgnums, int was_seen = 0; long lo = (-1L); long hi = (-1L); - struct visit vbuf; + visit vbuf; long *msglist; int num_msgs = 0; StrBuf *vset; @@ -607,7 +607,7 @@ int CtdlForEachMessage(int mode, long ref, char *search_string, { int a, i, j; - struct visit vbuf; + visit vbuf; struct cdbdata *cdbfr; long *msglist = NULL; int num_msgs = 0; diff --git a/citadel/room_ops.c b/citadel/room_ops.c index 0cba9768b..25d335220 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -53,7 +53,7 @@ void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf, int *result, int *view) { int retval = 0; - struct visit vbuf; + visit vbuf; /* for internal programs, always do everything */ if (((CC->internal_pgm)) && (roombuf->QRflags & QR_INUSE)) { @@ -887,7 +887,7 @@ void CtdlUserGoto(char *where, int display_result, int transiently, int rmailflag; int raideflag; int newmailcount = 0; - struct visit vbuf; + visit vbuf; char truncated_roomname[ROOMNAMELEN]; struct cdbdata *cdbfr; long *msglist = NULL; @@ -1834,7 +1834,7 @@ unsigned CtdlCreateRoom(char *new_room_name, struct ctdlroom qrbuf; struct floor flbuf; - struct visit vbuf; + visit vbuf; CtdlLogPrintf(CTDL_DEBUG, "CtdlCreateRoom(name=%s, type=%d, view=%d)\n", new_room_name, new_room_type, new_room_view); diff --git a/citadel/server.h b/citadel/server.h index d5755f0a6..f894719b2 100644 --- a/citadel/server.h +++ b/citadel/server.h @@ -212,7 +212,7 @@ enum { /* Defines the relationship of a user to a particular room */ -struct visit { +typedef struct __visit { long v_roomnum; long v_roomgen; long v_usernum; @@ -221,7 +221,7 @@ struct visit { char v_seen[SIZ]; char v_answered[SIZ]; int v_view; -}; +} visit; #define V_FORGET 1 /* User has zapped this room */ #define V_LOCKOUT 2 /* User is locked out of this room */ diff --git a/citadel/user_ops.c b/citadel/user_ops.c index 6e15afb8f..042f211f5 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -269,7 +269,7 @@ int GenerateRelationshipIndex(char *IndexBuf, /* * Back end for CtdlSetRelationship() */ -void put_visit(struct visit *newvisit) +void put_visit(visit *newvisit) { char IndexBuf[32]; int IndexLen = 0; @@ -283,7 +283,7 @@ void put_visit(struct visit *newvisit) /* Store the record */ cdb_store(CDB_VISIT, IndexBuf, IndexLen, - newvisit, sizeof(struct visit) + newvisit, sizeof(visit) ); } @@ -293,7 +293,7 @@ void put_visit(struct visit *newvisit) /* * Define a relationship between a user and a room */ -void CtdlSetRelationship(struct visit *newvisit, +void CtdlSetRelationship(visit *newvisit, struct ctdluser *rel_user, struct ctdlroom *rel_room) { @@ -312,7 +312,7 @@ void CtdlSetRelationship(struct visit *newvisit, /* * Locate a relationship between a user and a room */ -void CtdlGetRelationship(struct visit *vbuf, +void CtdlGetRelationship(visit *vbuf, struct ctdluser *rel_user, struct ctdlroom *rel_room) { @@ -328,13 +328,13 @@ void CtdlGetRelationship(struct visit *vbuf, rel_user->usernum); /* Clear out the buffer */ - memset(vbuf, 0, sizeof(struct visit)); + memset(vbuf, 0, sizeof(visit)); cdbvisit = cdb_fetch(CDB_VISIT, IndexBuf, IndexLen); if (cdbvisit != NULL) { memcpy(vbuf, cdbvisit->ptr, - ((cdbvisit->len > sizeof(struct visit)) ? - sizeof(struct visit) : cdbvisit->len)); + ((cdbvisit->len > sizeof(visit)) ? + sizeof(visit) : cdbvisit->len)); cdb_free(cdbvisit); } else { @@ -1452,8 +1452,8 @@ void cmd_setu(char *new_parms) void cmd_slrp(char *new_ptr) { long newlr; - struct visit vbuf; - struct visit original_vbuf; + visit vbuf; + visit original_vbuf; if (CtdlAccessCheck(ac_logged_in)) { return; @@ -1468,7 +1468,7 @@ void cmd_slrp(char *new_ptr) CtdlGetUserLock(&CC->user, CC->curr_user); CtdlGetRelationship(&vbuf, &CC->user, &CC->room); - memcpy(&original_vbuf, &vbuf, sizeof(struct visit)); + memcpy(&original_vbuf, &vbuf, sizeof(visit)); vbuf.v_lastseen = newlr; snprintf(vbuf.v_seen, sizeof vbuf.v_seen, "*:%ld", newlr); @@ -1525,7 +1525,7 @@ void cmd_gtsn(char *argbuf) { */ int CtdlInvtKick(char *iuser, int op) { struct ctdluser USscratch; - struct visit vbuf; + visit vbuf; char bbb[SIZ]; if (CtdlGetUser(&USscratch, iuser) != 0) { @@ -1601,7 +1601,7 @@ void cmd_kick(char *iuser) {cmd_invt_kick(iuser, 0);} * Returns 0 on success */ int CtdlForgetThisRoom(void) { - struct visit vbuf; + visit vbuf; /* On some systems, Aides are not allowed to forget rooms */ if (is_aide() && (config.c_aide_zap == 0) @@ -1961,7 +1961,7 @@ int InitialMailCheck() int a; char mailboxname[ROOMNAMELEN]; struct ctdlroom mailbox; - struct visit vbuf; + visit vbuf; struct cdbdata *cdbfr; long *msglist = NULL; int num_msgs = 0; @@ -2000,7 +2000,7 @@ int InitialMailCheck() */ void cmd_view(char *cmdbuf) { int requested_view; - struct visit vbuf; + visit vbuf; if (CtdlAccessCheck(ac_logged_in)) { return; diff --git a/citadel/user_ops.h b/citadel/user_ops.h index 41899ad91..1dcc07974 100644 --- a/citadel/user_ops.h +++ b/citadel/user_ops.h @@ -31,7 +31,7 @@ void ForEachUser(void (*CallBack)(struct ctdluser *EachUser, void *out_data), void ListThisUser(struct ctdluser *usbuf, void *data); int NewMailCount(void); int InitialMailCheck(void); -void put_visit(struct visit *newvisit); +void put_visit(visit *newvisit); /* MailboxName is deprecated us CtdlMailboxName instead */ void MailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix) __attribute__ ((deprecated)); -- 2.30.2