From 611d86f026c1590948e1317406656bfb106217e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Mon, 15 Sep 2008 21:41:22 +0000 Subject: [PATCH] * move stuff in header and subst.c arround to be better grouped * harmonize callback function types * add pre-eval shortcut; if we know the handler while evaluating the template, store a pointer to it, so we save hash lookups at runtime. --- webcit/gettext.c | 2 +- webcit/roomops.c | 10 ++--- webcit/subst.c | 113 +++++++++++++++++++++++++++++++---------------- webcit/summary.c | 2 +- webcit/webcit.c | 11 ++--- webcit/webcit.h | 79 +++++++++++++++++---------------- 6 files changed, 124 insertions(+), 93 deletions(-) diff --git a/webcit/gettext.c b/webcit/gettext.c index 2c12eff80..7e5caeb2f 100644 --- a/webcit/gettext.c +++ b/webcit/gettext.c @@ -204,7 +204,7 @@ void httplang_to_locale(StrBuf *LocaleString) * depending on the browser locale change the sequence of the * language chooser. */ -void offer_languages(void) { +void offer_languages(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context) { int i; #ifndef HAVE_USELOCALE char *Lang = getenv("LANG"); diff --git a/webcit/roomops.c b/webcit/roomops.c index 5869173a5..7c291b4a9 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -273,7 +273,7 @@ void zapped_list(void) /** * \brief read this room's info file (set v to 1 for verbose mode) */ -void readinfo(void) +void readinfo(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context) { char buf[256]; char briefinfo[128]; @@ -322,7 +322,7 @@ void readinfo(void) * keep the browser from using a cached icon from * another room. */ -void embed_room_graphic(void) { +void embed_room_graphic(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context) { char buf[SIZ]; serv_puts("OIMG _roompic_"); @@ -378,7 +378,7 @@ void embed_room_graphic(void) { /** * \brief Display the current view and offer an option to change it */ -void embed_view_o_matic(void) { +void embed_view_o_matic(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context) { int i; wprintf("
\n"); @@ -419,7 +419,7 @@ void embed_view_o_matic(void) { /** * \brief Display a search box */ -void embed_search_o_matic(void) { +void embed_search_o_matic(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context) { wprintf("\n"); wprintf("
\n", WC->nonce); wprintf("