From: Wilfried Göesgens Date: Sat, 13 Dec 2008 18:59:52 +0000 (+0000) Subject: * typedef wcsession, so we don't always need to say gcc again its a struct. X-Git-Tag: v7.86~1712 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=8c321fbcc2a64f0d0627562fdf5651442e525ab1 * typedef wcsession, so we don't always need to say gcc again its a struct. * removed faster blabla comments, since we should know it meanwhile. --- diff --git a/webcit/auth.c b/webcit/auth.c index e8c627399..3ae236e4c 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -176,7 +176,7 @@ void become_logged_in(char *user, char *pass, char *serv_response) */ void do_login(void) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; char buf[SIZ]; if (havebstr("language")) { @@ -342,7 +342,7 @@ void do_openid_login(void) void finalize_openid_login(void) { char buf[1024]; - struct wcsession *WCC = WC; + wcsession *WCC = WC; int already_logged_in = (WCC->logged_in) ; int linecount = 0; char result[128] = ""; @@ -850,7 +850,7 @@ int ConditionalRoomAide(WCTemplateToken *Tokens, void *Context, int ContextType) int ConditionalRoomAcessDelete(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ( (WCC->is_room_aide) || (WCC->is_mailbox) || (WCC->room_flags2 & QR2_COLLABDEL) ); } diff --git a/webcit/calendar.c b/webcit/calendar.c index 9dc2b0733..30698c816 100644 --- a/webcit/calendar.c +++ b/webcit/calendar.c @@ -397,7 +397,7 @@ void display_individual_cal(icalcomponent *cal, long msgnum, char *from, int unr icalproperty *ps = NULL; struct icaltimetype dtstart, dtend; struct icaldurationtype dur; - struct wcsession *WCC = WC; + wcsession *WCC = WC; disp_cal *Cal; size_t len; time_t final_recurrence = 0; diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c index 14112d093..db5c45346 100644 --- a/webcit/calendar_view.c +++ b/webcit/calendar_view.c @@ -182,7 +182,7 @@ void calendar_month_view_display_events(int year, int month, int day) int all_day_event = 0; int show_event = 0; char buf[256]; - struct wcsession *WCC = WC; /* This is done to make it run faster; WC is a function */ + wcsession *WCC = WC; time_t tt; if (GetCount(WCC->disp_cal_items) == 0) { @@ -362,7 +362,7 @@ void calendar_month_view_brief_events(time_t thetime, const char *daycolor) { time_t event_tt; time_t event_tts; time_t event_tte; - struct wcsession *WCC = WC; /* This is done to make it run faster; WC is a function */ + wcsession *WCC = WC; struct tm event_tms; struct tm event_tme; struct tm today_tm; @@ -778,7 +778,7 @@ void calendar_day_view_display_events(time_t thetime, int show_event = 0; int all_day_event = 0; int ongoing_event = 0; - struct wcsession *WCC = WC; /* This is done to make it run faster; WC is a function */ + wcsession *WCC = WC; disp_cal *Cal; struct icaltimetype t; struct icaltimetype end_t; @@ -1257,7 +1257,7 @@ void calendar_summary_view(void) { time_t now; int all_day_event = 0; char timestring[SIZ]; - struct wcsession *WCC = WC; /* This is done to make it run faster; WC is a function */ + wcsession *WCC = WC; if (GetCount(WC->disp_cal_items) == 0) { return; @@ -1481,7 +1481,7 @@ void do_tasks_view(void) { time_t due; char buf[SIZ]; icalproperty *p; - struct wcsession *WCC = WC; /* This is done to make it run faster; WC is a function */ + wcsession *WCC = WC; wprintf("
" "\n\n" diff --git a/webcit/context_loop.c b/webcit/context_loop.c index 128487dc0..fa789c138 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -14,13 +14,13 @@ /* Only one thread may manipulate SessionList at a time... */ pthread_mutex_t SessionListMutex; -struct wcsession *SessionList = NULL; /**< our sessions ????*/ +wcsession *SessionList = NULL; /**< our sessions ????*/ pthread_key_t MyConKey; /**< TSD key for MySession() */ -void DestroySession(struct wcsession **sessions_to_kill) +void DestroySession(wcsession **sessions_to_kill) { close((*sessions_to_kill)->serv_sock); close((*sessions_to_kill)->chat_sock); @@ -47,7 +47,7 @@ void DestroySession(struct wcsession **sessions_to_kill) void shutdown_sessions(void) { - struct wcsession *sptr; + wcsession *sptr; for (sptr = SessionList; sptr != NULL; sptr = sptr->next) { sptr->killthis = 1; @@ -56,8 +56,8 @@ void shutdown_sessions(void) void do_housekeeping(void) { - struct wcsession *sptr, *ss; - struct wcsession *sessions_to_kill = NULL; + wcsession *sptr, *ss; + wcsession *sessions_to_kill = NULL; int num_sessions = 0; static int num_threads = MIN_WORKER_THREADS; @@ -297,7 +297,7 @@ void context_loop(int *sock) int desired_session = 0; int got_cookie = 0; int gzip_ok = 0; - struct wcsession *TheSession, *sptr; + wcsession *TheSession, *sptr; char httpauth_string[1024]; char httpauth_user[1024]; char httpauth_pass[1024]; @@ -529,9 +529,9 @@ authentication */ if (TheSession == NULL) { lprintf(3, "Creating a new session\n"); - TheSession = (struct wcsession *) - malloc(sizeof(struct wcsession)); - memset(TheSession, 0, sizeof(struct wcsession)); + TheSession = (wcsession *) + malloc(sizeof(wcsession)); + memset(TheSession, 0, sizeof(wcsession)); TheSession->serv_sock = (-1); TheSession->chat_sock = (-1); @@ -615,7 +615,7 @@ authentication void tmpl_nonce(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; StrBufAppendPrintf(Target, "%ld", (WCC != NULL)? WCC->nonce:0); } diff --git a/webcit/downloads.c b/webcit/downloads.c index 23e1ccd23..8ec113738 100644 --- a/webcit/downloads.c +++ b/webcit/downloads.c @@ -428,7 +428,7 @@ void upload_file(void) char buf[1024]; long bytes_transmitted = 0; long blocksize; - struct wcsession *WCC = WC; /* stack this for faster access (WC is a function) */ + wcsession *WCC = WC; /* stack this for faster access (WC is a function) */ MimeType = GuessMimeType(WCC->upload, WCC->upload_length); serv_printf("UOPN %s|%s|%s", WCC->upload_filename, MimeType, bstr("description")); @@ -471,7 +471,7 @@ void upload_file(void) */ void output_image() { - struct wcsession *WCC = WC; + wcsession *WCC = WC; char buf[SIZ]; off_t bytes; const char *MimeType; diff --git a/webcit/gettext.c b/webcit/gettext.c index d504a6eaf..f055ee5a3 100644 --- a/webcit/gettext.c +++ b/webcit/gettext.c @@ -251,7 +251,7 @@ void set_selected_language(const char *lang) { */ void go_selected_language(void) { #ifdef HAVE_USELOCALE - struct wcsession *WCC = WC; + wcsession *WCC = WC; if (WCC->selected_language < 0) return; uselocale(wc_locales[WCC->selected_language]); /** switch locales */ textdomain(textdomain(NULL)); /** clear the cache */ diff --git a/webcit/iconbar.c b/webcit/iconbar.c index cab143b88..271d0d6ba 100644 --- a/webcit/iconbar.c +++ b/webcit/iconbar.c @@ -53,7 +53,7 @@ inline const char *PrintInt(void *Prefstr) void LoadIconSettings(void) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; StrBuf *iconbar = NULL; StrBuf *buf = NewStrBuf();; StrBuf *key = NewStrBuf(); @@ -805,7 +805,7 @@ void commit_iconbar(void) { void tmplput_iconbar(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; if ((WCC != NULL) && (WCC->logged_in)) { wprintf("
"); diff --git a/webcit/inetconf.c b/webcit/inetconf.c index 10313f167..56981ddaa 100644 --- a/webcit/inetconf.c +++ b/webcit/inetconf.c @@ -44,7 +44,7 @@ ConstStrBuf CfgNames[] = { */ void load_inetconf(void) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; StrBuf *Buf, *CfgToken, *Value; void *vHash; HashList *Hash; @@ -93,7 +93,7 @@ void load_inetconf(void) * save changes to the inet config */ void new_save_inetconf(void) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; HashList *Hash; StrBuf *Str; const StrBuf *eType, *eNum, *eName; @@ -182,7 +182,7 @@ void InetCfgSubst(StrBuf *TemplBuffer, void *vContext, WCTemplateToken *Tokens) void DeleteInetConfHash(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; if (WCC->InetCfg != NULL) DeleteHash(&WCC->InetCfg); @@ -192,7 +192,7 @@ void DeleteInetConfHash(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void HashList *GetInetConfHash(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; void *vHash; if (WCC->InetCfg == NULL) diff --git a/webcit/messages.c b/webcit/messages.c index bad4b3e8b..9d14b3c38 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -376,7 +376,7 @@ message_summary *ReadOneMessageSummary(StrBuf *RawMessage, const char *DefaultSu int load_msg_ptrs(char *servcmd, int with_headers) { StrBuf* FoundCharset = NULL; - struct wcsession *WCC = WC; + wcsession *WCC = WC; message_summary *Msg; StrBuf *Buf, *Buf2; ///char buf[1024]; @@ -489,7 +489,7 @@ inline message_summary* GetMessagePtrAt(int n, HashList *Summ) void DrawMessageDropdown(StrBuf *Selector, long maxmsgs, long startmsg) { StrBuf *TmpBuf; - struct wcsession *WCC = WC; + wcsession *WCC = WC; message_summary* Msg; int lo, hi, n; int i = 0; @@ -579,7 +579,7 @@ void readloop(long oper) addrbookent *addrbook = NULL; int num_ab = 0; int bbs_reverse = 0; - struct wcsession *WCC = WC; + wcsession *WCC = WC; HashPos *at; const char *HashKey; long HKLen; @@ -887,7 +887,7 @@ DONE: * ... this is where the actual message gets transmitted to the server. */ void post_mime_to_server(void) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; char top_boundary[SIZ]; char alt_boundary[SIZ]; int is_multipart = 0; @@ -1001,7 +1001,7 @@ void post_message(void) wc_mime_attachment *att; int is_anonymous = 0; const StrBuf *display_name = NULL; - struct wcsession *WCC = WC; + wcsession *WCC = WC; if (havebstr("force_room")) { gotoroom(bstr("force_room")); @@ -1194,7 +1194,7 @@ void display_enter(void) int recipient_bad = 0; int is_anonymous = 0; - struct wcsession *WCC = WC; + wcsession *WCC = WC; now = time(NULL); diff --git a/webcit/msg_renderers.c b/webcit/msg_renderers.c index c6dbf1795..c10c7cd98 100644 --- a/webcit/msg_renderers.c +++ b/webcit/msg_renderers.c @@ -916,7 +916,7 @@ void tmplput_MIME_Data(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void void tmplput_MIME_LoadData(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; wc_mime_attachment *mime = (wc_mime_attachment*) Context; wc_mime_attachment *att; diff --git a/webcit/paramhandling.c b/webcit/paramhandling.c index 628f914f6..7e85cfbe4 100644 --- a/webcit/paramhandling.c +++ b/webcit/paramhandling.c @@ -22,7 +22,7 @@ void ParseURLParams(StrBuf *url) const char *aptr, *bptr, *eptr, *up; int len, keylen; urlcontent *u; - struct wcsession *WCC = WC; + wcsession *WCC = WC; if (WCC->urlstrings == NULL) WCC->urlstrings = NewHash(1, NULL); @@ -86,7 +86,7 @@ void free_urls(void) void dump_vars(void) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; urlcontent *u; void *U; long HKLen; diff --git a/webcit/roomops.c b/webcit/roomops.c index 51dd72788..6a41b0c41 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -79,7 +79,7 @@ void load_floorlist(void) /* * Free a session's march list */ -void free_march_list(struct wcsession *wcf) +void free_march_list(wcsession *wcf) { struct march *mptr; @@ -3197,7 +3197,7 @@ void do_rooms_view(struct folder *fold, int max_folders, int num_floors) { * \param which_floordiv name of the floordiv??? */ void set_floordiv_expanded(void) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; StrBuf *FloorDiv; FloorDiv = NewStrBuf(); @@ -3682,7 +3682,7 @@ void tmplput_roombanner(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void void tmplput_ungoto(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; if ((WCC!=NULL) && (!IsEmptyStr(WCC->ugname))) @@ -3692,7 +3692,7 @@ void tmplput_ungoto(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Co int ConditionalHaveUngoto(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && (!IsEmptyStr(WCC->ugname)) && @@ -3704,7 +3704,7 @@ int ConditionalHaveUngoto(WCTemplateToken *Tokens, void *Context, int ContextTyp int ConditionalRoomHas_QR_PERMANENT(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_PERMANENT) != 0)); @@ -3712,7 +3712,7 @@ int ConditionalRoomHas_QR_PERMANENT(WCTemplateToken *Tokens, void *Context, int int ConditionalRoomHas_QR_INUSE(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_INUSE) != 0)); @@ -3720,7 +3720,7 @@ int ConditionalRoomHas_QR_INUSE(WCTemplateToken *Tokens, void *Context, int Cont int ConditionalRoomHas_QR_PRIVATE(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_PRIVATE) != 0)); @@ -3728,7 +3728,7 @@ int ConditionalRoomHas_QR_PRIVATE(WCTemplateToken *Tokens, void *Context, int Co int ConditionalRoomHas_QR_PASSWORDED(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_PASSWORDED) != 0)); @@ -3736,7 +3736,7 @@ int ConditionalRoomHas_QR_PASSWORDED(WCTemplateToken *Tokens, void *Context, int int ConditionalRoomHas_QR_GUESSNAME(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_GUESSNAME) != 0)); @@ -3744,7 +3744,7 @@ int ConditionalRoomHas_QR_GUESSNAME(WCTemplateToken *Tokens, void *Context, int int ConditionalRoomHas_QR_DIRECTORY(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_DIRECTORY) != 0)); @@ -3752,7 +3752,7 @@ int ConditionalRoomHas_QR_DIRECTORY(WCTemplateToken *Tokens, void *Context, int int ConditionalRoomHas_QR_UPLOAD(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_UPLOAD) != 0)); @@ -3760,7 +3760,7 @@ int ConditionalRoomHas_QR_UPLOAD(WCTemplateToken *Tokens, void *Context, int Con int ConditionalRoomHas_QR_DOWNLOAD(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_DOWNLOAD) != 0)); @@ -3768,7 +3768,7 @@ int ConditionalRoomHas_QR_DOWNLOAD(WCTemplateToken *Tokens, void *Context, int C int ConditionalRoomHas_QR_VISDIR(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_VISDIR) != 0)); @@ -3776,7 +3776,7 @@ int ConditionalRoomHas_QR_VISDIR(WCTemplateToken *Tokens, void *Context, int Con int ConditionalRoomHas_QR_ANONONLY(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_ANONONLY) != 0)); @@ -3784,7 +3784,7 @@ int ConditionalRoomHas_QR_ANONONLY(WCTemplateToken *Tokens, void *Context, int C int ConditionalRoomHas_QR_ANONOPT(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_ANONOPT) != 0)); @@ -3792,7 +3792,7 @@ int ConditionalRoomHas_QR_ANONOPT(WCTemplateToken *Tokens, void *Context, int Co int ConditionalRoomHas_QR_NETWORK(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_NETWORK) != 0)); @@ -3800,7 +3800,7 @@ int ConditionalRoomHas_QR_NETWORK(WCTemplateToken *Tokens, void *Context, int Co int ConditionalRoomHas_QR_PREFONLY(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_PREFONLY) != 0)); @@ -3808,7 +3808,7 @@ int ConditionalRoomHas_QR_PREFONLY(WCTemplateToken *Tokens, void *Context, int C int ConditionalRoomHas_QR_READONLY(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_READONLY) != 0)); @@ -3816,7 +3816,7 @@ int ConditionalRoomHas_QR_READONLY(WCTemplateToken *Tokens, void *Context, int C int ConditionalRoomHas_QR_MAILBOX(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ((WCC!=NULL) && ((WCC->room_flags & QR_MAILBOX) != 0)); @@ -3829,7 +3829,7 @@ int ConditionalRoomHas_QR_MAILBOX(WCTemplateToken *Tokens, void *Context, int Co int ConditionalHaveRoomeditRights(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; return ( (WCC!= NULL) && ((WCC->axlevel >= 6) || diff --git a/webcit/rss.c b/webcit/rss.c index ffdf08c4f..136909890 100644 --- a/webcit/rss.c +++ b/webcit/rss.c @@ -46,7 +46,7 @@ void display_rss_control(char *reply_to, char *subject) void display_rss(char *roomname, StrBuf *request_method) { message_summary *Msg; - struct wcsession *WCC = WC; + wcsession *WCC = WC; int nummsgs; int a, b; int bq = 0; diff --git a/webcit/serv_func.c b/webcit/serv_func.c index 24d645896..cd7b73a39 100644 --- a/webcit/serv_func.c +++ b/webcit/serv_func.c @@ -469,7 +469,7 @@ int read_server_binary(StrBuf *Ret, size_t total_len) */ int read_server_text(StrBuf *Buf, long *nLines) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; long nRead; long nTotal = 0; long nlines; diff --git a/webcit/siteconfig.c b/webcit/siteconfig.c index 53d8684f2..58c7e1ca6 100644 --- a/webcit/siteconfig.c +++ b/webcit/siteconfig.c @@ -125,7 +125,7 @@ CfgMapping ServerConfig[] = { */ void load_siteconfig(void) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; StrBuf *Buf, *CfgToken; HashList *Cfg; char buf[SIZ]; @@ -195,7 +195,7 @@ void load_siteconfig(void) */ void siteconfig(void) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; int i; char buf[256]; @@ -247,7 +247,7 @@ void siteconfig(void) void tmplput_servcfg(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; void *vBuf; StrBuf *Buf; @@ -265,7 +265,7 @@ void tmplput_servcfg(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *C int ConditionalServCfg(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; void *vBuf; StrBuf *Buf; @@ -290,7 +290,7 @@ int ConditionalServCfg(WCTemplateToken *Tokens, void *Context, int ContextType) int ConditionalServCfgSubst(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; void *vBuf; StrBuf *Buf; diff --git a/webcit/smtpqueue.c b/webcit/smtpqueue.c index a830b660f..ca17b24e1 100644 --- a/webcit/smtpqueue.c +++ b/webcit/smtpqueue.c @@ -165,7 +165,7 @@ void display_queue_msg(long msgnum) void display_smtpqueue_inner_div(void) { message_summary *Msg; - struct wcsession *WCC = WC; + wcsession *WCC = WC; int i; int num_msgs; diff --git a/webcit/subst.c b/webcit/subst.c index 41aad9274..1de23b6ae 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -139,7 +139,7 @@ void VarPrintEntry(const char *Key, void *vSubst, int odd) /** * \brief Clear out the list of substitution variables local to this session */ -void clear_substs(struct wcsession *wc) { +void clear_substs(wcsession *wc) { if (wc->vars != NULL) { DeleteHash(&wc->vars); @@ -221,7 +221,7 @@ void deletevar(void *data) wcsubst *NewSubstVar(const char *keyname, int keylen, int type) { wcsubst* ptr; - struct wcsession *WCC = WC; + wcsession *WCC = WC; ptr = (wcsubst *) malloc(sizeof(wcsubst)); memset(ptr, 0, sizeof(wcsubst)); @@ -259,7 +259,7 @@ void SVPRINTF(char *keyname, int keytype, const char *format,...) void *vPtr; wcsubst *ptr = NULL; size_t keylen; - struct wcsession *WCC = WC; + wcsession *WCC = WC; keylen = strlen(keyname); /** @@ -295,7 +295,7 @@ void svprintf(char *keyname, size_t keylen, int keytype, const char *format,...) va_list arg_ptr; void *vPtr; wcsubst *ptr = NULL; - struct wcsession *WCC = WC; + wcsession *WCC = WC; /** * First look if we're doing a replacement of @@ -329,7 +329,7 @@ void SVPut(char *keyname, size_t keylen, int keytype, char *Data) { void *vPtr; wcsubst *ptr = NULL; - struct wcsession *WCC = WC; + wcsession *WCC = WC; /** @@ -360,7 +360,7 @@ void SVPutLong(char *keyname, size_t keylen, long Data) { void *vPtr; wcsubst *ptr = NULL; - struct wcsession *WCC = WC; + wcsession *WCC = WC; /** @@ -389,7 +389,7 @@ void SVCallback(char *keyname, size_t keylen, WCHandlerFunc fcn_ptr) { wcsubst *ptr; void *vPtr; - struct wcsession *WCC = WC; + wcsession *WCC = WC; /** * First look if we're doing a replacement of @@ -419,7 +419,7 @@ void SVPUTBuf(const char *keyname, int keylen, const StrBuf *Buf, int ref) { wcsubst *ptr; void *vPtr; - struct wcsession *WCC = WC; + wcsession *WCC = WC; /** * First look if we're doing a replacement of @@ -518,7 +518,7 @@ void GetTemplateTokenString(WCTemplateToken *Tokens, * \param keyname get a key to print */ void print_value_of(StrBuf *Target, WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; wcsubst *ptr; void *vVar; @@ -568,7 +568,7 @@ void print_value_of(StrBuf *Target, WCTemplateToken *Tokens, void *Context, int int CompareSubstToToken(TemplateParam *ParamToCompare, TemplateParam *ParamToLookup) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; wcsubst *ptr; void *vVar; @@ -606,7 +606,7 @@ int CompareSubstToToken(TemplateParam *ParamToCompare, TemplateParam *ParamToLoo int CompareSubstToStrBuf(StrBuf *Compare, TemplateParam *ParamToLookup) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; wcsubst *ptr; void *vVar; @@ -647,7 +647,7 @@ void StrBufAppendTemplate(StrBuf *Target, void *Context, int ContextType, const StrBuf *Source, int FormatTypeIndex) { - struct wcsession *WCC; + wcsession *WCC; StrBuf *Buf; char EscapeAs = ' '; diff --git a/webcit/summary.c b/webcit/summary.c index 41d2aa025..d48643b13 100644 --- a/webcit/summary.c +++ b/webcit/summary.c @@ -82,7 +82,7 @@ void tasks_section(void) { long HKLen; void *vMsg; message_summary *Msg; - struct wcsession *WCC = WC; + wcsession *WCC = WC; gotoroom("_TASKS_"); if (WCC->wc_view != VIEW_TASKS) { @@ -119,7 +119,7 @@ void calendar_section(void) { long HKLen; void *vMsg; message_summary *Msg; - struct wcsession *WCC = WC; + wcsession *WCC = WC; struct calview c; gotoroom("_CALENDAR_"); diff --git a/webcit/tcp_sockets.c b/webcit/tcp_sockets.c index d7a43f414..8c603ee1e 100644 --- a/webcit/tcp_sockets.c +++ b/webcit/tcp_sockets.c @@ -119,7 +119,7 @@ int tcp_connectsock(char *host, char *service) * buf the buffer to get the input to * bytes the maximal number of bytes to read */ -inline void _serv_read(char *buf, int bytes, struct wcsession *WCC) +inline void _serv_read(char *buf, int bytes, wcsession *WCC) { int len, rlen; @@ -143,7 +143,7 @@ inline void _serv_read(char *buf, int bytes, struct wcsession *WCC) void serv_read(char *buf, int bytes) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; _serv_read(buf, bytes, WCC); } @@ -152,7 +152,7 @@ void serv_read(char *buf, int bytes) */ int serv_getln(char *strbuf, int bufsize) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; int ch, len; char buf[2]; diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c index d137d191e..bc0ed9174 100644 --- a/webcit/vcard_edit.c +++ b/webcit/vcard_edit.c @@ -1127,7 +1127,7 @@ void display_vcard_photo_img(void) struct vCard *v; char *photosrc; const char *contentType; - struct wcsession *WCC = WC; + wcsession *WCC = WC; msgnum = StrTol(WCC->UrlFragment2); diff --git a/webcit/webcit.c b/webcit/webcit.c index 7054c7d95..909a40387 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -44,7 +44,7 @@ void WebcitAddUrlHandler(const char * UrlString, */ void wprintf(const char *format,...) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; va_list arg_ptr; if (WCC->WBuf == NULL) @@ -60,7 +60,7 @@ void wprintf(const char *format,...) */ void hprintf(const char *format,...) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; va_list arg_ptr; va_start(arg_ptr, format); @@ -407,7 +407,7 @@ void authorization_required(const char *message) * Convenience functions to wrap around asynchronous ajax responses */ void begin_ajax_response(void) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; FlushStrBuf(WCC->HBuf); output_headers(0, 0, 0, 0, 0, 0); @@ -565,7 +565,7 @@ void session_loop(HashList *HTTPHeaders, StrBuf *ReqLine, StrBuf *request_method char c_httpauth_string[SIZ]; char c_httpauth_user[SIZ]; char c_httpauth_pass[SIZ]; - struct wcsession *WCC; + wcsession *WCC; safestrncpy(c_username, "", sizeof c_username); safestrncpy(c_password, "", sizeof c_password); @@ -1021,7 +1021,7 @@ void diagnostics(void) int ConditionalImportantMesage(WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; if (WCC != NULL) return (!IsEmptyStr(WCC->ImportantMessage)); else @@ -1030,7 +1030,7 @@ int ConditionalImportantMesage(WCTemplateToken *Tokens, void *Context, int Conte void tmplput_importantmessage(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; if (WCC != NULL) { /* @@ -1065,7 +1065,7 @@ void tmplput_bstr(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Cont void tmplput_trailing_javascript(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *vContext, int ContextType) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; if (WCC != NULL) StrBufAppendTemplate(Target, nArgs, Tokens, vContext, ContextType, @@ -1082,7 +1082,7 @@ void tmplput_csslocal(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void * void tmplput_url_part(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) { StrBuf *UrlBuf; - struct wcsession *WCC = WC; + wcsession *WCC = WC; if (WCC != NULL) { if (Tokens->Params[0]->lvalue == 0) diff --git a/webcit/webcit.h b/webcit/webcit.h index 51462a1a4..9fe3dfad1 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -533,8 +533,9 @@ enum { * One of these is kept for each active Citadel session. * HTTP transactions are bound to one at a time. */ +typedef struct wcsession wcsession; struct wcsession { - struct wcsession *next; /**< Linked list */ + wcsession *next; /**< Linked list */ int wc_session; /**< WebCit session ID */ char wc_username[128]; /**< login name of current user */ char wc_fullname[128]; /**< Screen name of current user */ @@ -916,8 +917,8 @@ void render_calendar_view(struct calview *c); void do_tasks_view(void); void calendar_summary_view(void); int load_msg_ptrs(char *servcmd, int with_headers); -void free_attachments(struct wcsession *sess); -void free_march_list(struct wcsession *wcf); +void free_attachments(wcsession *sess); +void free_march_list(wcsession *wcf); void display_rules_editor_inner_div(void); void generate_uuid(char *); void CtdlMakeTempFileName(char *, int); diff --git a/webcit/webserver.c b/webcit/webserver.c index 480cdcf0d..517a9d307 100644 --- a/webcit/webserver.c +++ b/webcit/webserver.c @@ -263,7 +263,7 @@ void begin_burst(void) */ long end_burst(void) { - struct wcsession *WCC = WC; + wcsession *WCC = WC; const char *ptr, *eptr; long count; ssize_t res; diff --git a/webcit/who.c b/webcit/who.c index 33f9f99a3..68b33d806 100644 --- a/webcit/who.c +++ b/webcit/who.c @@ -43,7 +43,7 @@ int CompareUserStruct(const void *VUser1, const void *VUser2) int GetWholistSection(HashList *List, time_t now) { StrBuf *Buf, *XBuf; - struct wcsession *WCC = WC; /* This is done to make it run faster; WC is a function */ + wcsession *WCC = WC; UserStateStruct *User, *OldUser; void *VOldUser; size_t BufLen;