TEMPLATING: add possibility to stack another context inbetween conditional tags
authorWilfried Goesgens <dothebart@citadel.org>
Thu, 18 Oct 2012 18:11:00 +0000 (20:11 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Thu, 18 Oct 2012 18:11:00 +0000 (20:11 +0200)
30 files changed:
webcit/auth.c
webcit/bootstrap
webcit/config.guess
webcit/config.sub
webcit/dav_main.c
webcit/downloads.c
webcit/get_ical_data.sed [deleted file]
webcit/get_ical_data.sh [deleted file]
webcit/iconbar.c
webcit/listsub.c
webcit/marchlist.c
webcit/mk_module_init.sh [deleted file]
webcit/msg_renderers.c
webcit/paging.c
webcit/paramhandling.c
webcit/preferences.c
webcit/roomlist.c
webcit/roomtokens.c
webcit/roomviews.c
webcit/serv_func.c
webcit/sieve.c
webcit/siteconfig.c
webcit/smtpqueue.c
webcit/subst.c
webcit/subst.h
webcit/useredit.c
webcit/webcit.c
webcit/webcit.h
webcit/who.c
webcit/wiki.c

index e2b8390..8b60dac 100644 (file)
@@ -949,9 +949,9 @@ InitModule_AUTH
        WebcitAddUrlHandler(HKEY("ajax_login_username_password"), "", 0, ajax_login_username_password, AJAX|ANONYMOUS);
        WebcitAddUrlHandler(HKEY("ajax_login_newuser"), "", 0, ajax_login_newuser, AJAX|ANONYMOUS);
        WebcitAddUrlHandler(HKEY("switch_language"), "", 0, switch_language, ANONYMOUS);
-       RegisterConditional(HKEY("COND:AIDE"), 2, ConditionalAide, CTX_NONE);
-       RegisterConditional(HKEY("COND:LOGGEDIN"), 2, ConditionalIsLoggedIn, CTX_NONE);
-       RegisterConditional(HKEY("COND:MAY_CREATE_ROOM"), 2,  ConditionalHaveAccessCreateRoom, CTX_NONE);
+       RegisterConditional("COND:AIDE", 2, ConditionalAide, CTX_NONE);
+       RegisterConditional("COND:LOGGEDIN", 2, ConditionalIsLoggedIn, CTX_NONE);
+       RegisterConditional("COND:MAY_CREATE_ROOM", 2,  ConditionalHaveAccessCreateRoom, CTX_NONE);
        return;
 }
 
index 84de74c..2c1f594 100755 (executable)
@@ -6,7 +6,7 @@
 # Remove any vestiges of pre-6.05 build environments
 rm -f .libs modules *.so *.lo *.la 2>/dev/null
 
-./get_ical_data.sh
+./scripts/get_ical_data.sh
 
 echo ... running aclocal ...
 aclocal
@@ -23,7 +23,7 @@ echo ... running autoheader ...
 autoheader
 
 echo ... mk_module_init.sh ...
-./mk_module_init.sh
+./scripts/mk_module_init.sh
 
 
 echo
index 9f957ac..d622a44 100755 (executable)
@@ -2,24 +2,22 @@
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011 Free Software Foundation, Inc.
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2011-05-11'
+timestamp='2012-02-10'
 
 # This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License, version 3.
+# under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
-# 
+# (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
 # WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 # General Public License for more details.
 #
-# 
-# 
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -57,8 +55,8 @@ GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
-Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -145,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
        # NetBSD (nbsd) targets should (where applicable) match one or
-       # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+       # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
        # switched to ELF, *-*-netbsd* would select the old
        # object file format.  This provides both forward
@@ -792,13 +790,12 @@ EOF
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
        exit ;;
     *:FreeBSD:*:*)
-       case ${UNAME_MACHINE} in
-           pc98)
-               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       UNAME_PROCESSOR=`/usr/bin/uname -p`
+       case ${UNAME_PROCESSOR} in
            amd64)
                echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
            *)
-               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+               echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
        esac
        exit ;;
     i*:CYGWIN*:*)
@@ -807,6 +804,9 @@ EOF
     *:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
        exit ;;
+    i*:MSYS*:*)
+       echo ${UNAME_MACHINE}-pc-msys
+       exit ;;
     i*:windows32*:*)
        # uname -m includes "-pc" on this system.
        echo ${UNAME_MACHINE}-mingw32
@@ -861,6 +861,13 @@ EOF
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
        exit ;;
+    aarch64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    aarch64_be:Linux:*:*)
+       UNAME_MACHINE=aarch64_be
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
          EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -895,13 +902,16 @@ EOF
        echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     cris:Linux:*:*)
-       echo cris-axis-linux-gnu
+       echo ${UNAME_MACHINE}-axis-linux-gnu
        exit ;;
     crisv32:Linux:*:*)
-       echo crisv32-axis-linux-gnu
+       echo ${UNAME_MACHINE}-axis-linux-gnu
        exit ;;
     frv:Linux:*:*)
-       echo frv-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    hexagon:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     i*86:Linux:*:*)
        LIBC=gnu
@@ -943,7 +953,7 @@ EOF
        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
        ;;
     or32:Linux:*:*)
-       echo or32-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     padre:Linux:*:*)
        echo sparc-unknown-linux-gnu
@@ -978,13 +988,13 @@ EOF
        echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     tile*:Linux:*:*)
-       echo ${UNAME_MACHINE}-tilera-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     vax:Linux:*:*)
        echo ${UNAME_MACHINE}-dec-linux-gnu
        exit ;;
     x86_64:Linux:*:*)
-       echo x86_64-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     xtensa*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -1315,6 +1325,9 @@ EOF
     i*86:AROS:*:*)
        echo ${UNAME_MACHINE}-pc-aros
        exit ;;
+    x86_64:VMkernel:*:*)
+       echo ${UNAME_MACHINE}-unknown-esx
+       exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
index d29b459..6205f84 100755 (executable)
@@ -2,28 +2,26 @@
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011 Free Software Foundation, Inc.
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2011-03-23'
+timestamp='2012-04-18'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
 # can handle that machine.  It does not imply ALL GNU software can.
 #
 # This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License, version 3.
+# it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
-# 
+# (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
-# 
-# 
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -76,8 +74,8 @@ version="\
 GNU config.sub ($timestamp)
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
-Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -132,6 +130,10 @@ case $maybe_os in
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
   *)
     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
     if [ $basic_machine != $1 ]
@@ -223,6 +225,12 @@ case $os in
        -isc*)
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
+       -lynx*178)
+               os=-lynxos178
+               ;;
+       -lynx*5)
+               os=-lynxos5
+               ;;
        -lynx*)
                os=-lynxos
                ;;
@@ -247,17 +255,22 @@ case $basic_machine in
        # Some are omitted here because they have special meanings below.
        1750a | 580 \
        | a29k \
+       | aarch64 | aarch64_be \
        | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
        | am33_2.0 \
        | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+        | be32 | be64 \
        | bfin \
        | c4x | clipper \
        | d10v | d30v | dlx | dsp16xx \
+       | epiphany \
        | fido | fr30 | frv \
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | hexagon \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
+       | le32 | le64 \
        | lm32 \
        | m32c | m32r | m32rle | m68000 | m68k | m88k \
        | maxq | mb | microblaze | mcore | mep | metag \
@@ -291,7 +304,7 @@ case $basic_machine in
        | pdp10 | pdp11 | pj | pjl \
        | powerpc | powerpc64 | powerpc64le | powerpcle \
        | pyramid \
-       | rx \
+       | rl78 | rx \
        | score \
        | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
@@ -300,7 +313,7 @@ case $basic_machine in
        | spu \
        | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
        | ubicom32 \
-       | v850 | v850e \
+       | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
        | we32k \
        | x86 | xc16x | xstormy16 | xtensa \
        | z8k | z80)
@@ -315,8 +328,7 @@ case $basic_machine in
        c6x)
                basic_machine=tic6x-unknown
                ;;
-       m6811 | m68hc11 | m6812 | m68hc12 | picochip)
-               # Motorola 68HC11/12.
+       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
                basic_machine=$basic_machine-unknown
                os=-none
                ;;
@@ -329,7 +341,10 @@ case $basic_machine in
        strongarm | thumb | xscale)
                basic_machine=arm-unknown
                ;;
-
+       xgate)
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
        xscaleeb)
                basic_machine=armeb-unknown
                ;;
@@ -352,11 +367,13 @@ case $basic_machine in
        # Recognize the basic CPU types with company name.
        580-* \
        | a29k-* \
+       | aarch64-* | aarch64_be-* \
        | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
        | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
        | avr-* | avr32-* \
+       | be32-* | be64-* \
        | bfin-* | bs2000-* \
        | c[123]* | c30-* | [cjt]90-* | c4x-* \
        | clipper-* | craynv-* | cydra-* \
@@ -365,8 +382,10 @@ case $basic_machine in
        | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
        | h8300-* | h8500-* \
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | hexagon-* \
        | i*86-* | i860-* | i960-* | ia64-* \
        | ip2k-* | iq2000-* \
+       | le32-* | le64-* \
        | lm32-* \
        | m32c-* | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
@@ -400,7 +419,7 @@ case $basic_machine in
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
        | pyramid-* \
-       | romp-* | rs6000-* | rx-* \
+       | rl78-* | romp-* | rs6000-* | rx-* \
        | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
        | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
@@ -408,10 +427,11 @@ case $basic_machine in
        | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
        | tahoe-* \
        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-       | tile-* | tilegx-* \
+       | tile*-* \
        | tron-* \
        | ubicom32-* \
-       | v850-* | v850e-* | vax-* \
+       | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+       | vax-* \
        | we32k-* \
        | x86-* | x86_64-* | xc16x-* | xps100-* \
        | xstormy16-* | xtensa*-* \
@@ -711,7 +731,6 @@ case $basic_machine in
        i370-ibm* | ibm*)
                basic_machine=i370-ibm
                ;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
        i*86v32)
                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
                os=-sysv32
@@ -808,10 +827,18 @@ case $basic_machine in
        ms1-*)
                basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
                ;;
+       msys)
+               basic_machine=i386-pc
+               os=-msys
+               ;;
        mvs)
                basic_machine=i370-ibm
                os=-mvs
                ;;
+       nacl)
+               basic_machine=le32-unknown
+               os=-nacl
+               ;;
        ncr3000)
                basic_machine=i486-ncr
                os=-sysv4
@@ -1120,13 +1147,8 @@ case $basic_machine in
                basic_machine=t90-cray
                os=-unicos
                ;;
-       # This must be matched before tile*.
-       tilegx*)
-               basic_machine=tilegx-unknown
-               os=-linux-gnu
-               ;;
        tile*)
-               basic_machine=tile-unknown
+               basic_machine=$basic_machine-unknown
                os=-linux-gnu
                ;;
        tx39)
@@ -1336,7 +1358,7 @@ case $os in
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
              | -chorusos* | -chorusrdb* | -cegcc* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
              | -mingw32* | -linux-gnu* | -linux-android* \
              | -linux-newlib* | -linux-uclibc* \
              | -uxpv* | -beos* | -mpeix* | -udk* \
@@ -1521,6 +1543,9 @@ case $basic_machine in
        c4x-* | tic4x-*)
                os=-coff
                ;;
+       hexagon-*)
+               os=-elf
+               ;;
        tic54x-*)
                os=-coff
                ;;
@@ -1548,9 +1573,6 @@ case $basic_machine in
                ;;
        m68000-sun)
                os=-sunos3
-               # This also exists in the configure program, but was not the
-               # default.
-               # os=-sunos4
                ;;
        m68*-cisco)
                os=-aout
index 06466f2..31cbfaf 100644 (file)
@@ -342,16 +342,16 @@ InitModule_GROUPDAV
 
        RegisterNamespace("DAV:HOSTNAME", 0, 0, tmplput_dav_HOSTNAME, NULL, CTX_NONE);
 
-       RegisterConditional(HKEY("COND:DAV:NS"), 0, Conditional_DAV_NS,  CTX_NONE);
+       RegisterConditional("COND:DAV:NS", 0, Conditional_DAV_NS,  CTX_NONE);
 
        RegisterIterator("DAV:NS", 0, DavNamespaces, NULL, 
                         NULL, NULL, CTX_DAVNS, CTX_NONE, IT_NOFLAG
        );
 
-       RegisterConditional(HKEY("COND:DAV:NSCURRENT"), 0, Conditional_DAV_NSCURRENT,  CTX_DAVNS);
+       RegisterConditional("COND:DAV:NSCURRENT", 0, Conditional_DAV_NSCURRENT,  CTX_DAVNS);
        RegisterNamespace("DAV:NAMESPACE", 0, 1, tmplput_DAV_NAMESPACE, NULL, CTX_NONE);
 
        RegisterHeaderHandler(HKEY("IF-MATCH"), Header_HandleIfMatch);
        RegisterHeaderHandler(HKEY("DEPTH"), Header_HandleDepth);
-       RegisterConditional(HKEY("COND:DAV:DEPTH"), 1, Conditional_DAV_DEPTH,  CTX_NONE);
+       RegisterConditional("COND:DAV:DEPTH", 1, Conditional_DAV_DEPTH,  CTX_NONE);
 }
index f396224..ccb6039 100644 (file)
@@ -464,7 +464,7 @@ InitModule_DOWNLOAD
        RegisterNamespace("FILE:MIMETYPE", 0, 2, tmplput_FILEMIMETYPE, NULL, CTX_FILELIST);
        RegisterNamespace("FILE:COMMENT", 0, 2, tmplput_FILE_COMMENT, NULL, CTX_FILELIST);
 
-       RegisterConditional(HKEY("COND:FILE:ISPIC"), 0, Conditional_FILE_ISPIC, CTX_FILELIST);
+       RegisterConditional("COND:FILE:ISPIC", 0, Conditional_FILE_ISPIC, CTX_FILELIST);
 
        WebcitAddUrlHandler(HKEY("image"), "", 0, output_image, ANONYMOUS);
        WebcitAddUrlHandler(HKEY("display_mime_icon"), "", 0, display_mime_icon , ANONYMOUS);
diff --git a/webcit/get_ical_data.sed b/webcit/get_ical_data.sed
deleted file mode 100755 (executable)
index d584f36..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#! /bin/sed -nf
-
-H
-$ {
-  x
-  s/\n//g
-  p
-}
-$ { 
-  s/.*icalproperty_kind {\(.*\)} icalproperty_kind.*/\1/
- }
diff --git a/webcit/get_ical_data.sh b/webcit/get_ical_data.sh
deleted file mode 100755 (executable)
index fb289a5..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-ICAL=/usr/local/ctdlsupport/include/libical/ical.h
-if test -f /usr/include/libical/ical.h; then 
-    ICAL=/usr/include/libical/ical.h
-fi
-(
-printf '#include "webcit.h"\n\n\nIcalEnumMap icalproperty_kind_map[] = {\n'
-cat $ICAL |\
-sed 's;/\*.*\*/;;' |\
-./get_ical_data.sed |\
-sed -e 's;.*icalproperty_kind {\(.*\)} icalproperty_kind.*;\1,;' \
-    -e 's;/\*.*\*/;;' \
-    -e 's;/;\n/\n;g' \
-    -e 's;,;,\n;g' \
-    -e 's; *;;g' \
-    -e 's;^t*;;g' \
-    -e 's;\=0;;g'|\
-sed -e 's;\(.*\),;{HKEY("\1"), \1},;'
-printf '{"", 0, 0}\n};\n' 
-
-)>ical_maps.c
\ No newline at end of file
index 510fbca..e1ea9b0 100644 (file)
@@ -315,10 +315,10 @@ InitModule_ICONBAR
        WebcitAddUrlHandler(HKEY("commit_iconbar"), "", 0, commit_iconbar, 0);
        WebcitAddUrlHandler(HKEY("toggle_wholist_expanded_state"), "", 0, toggle_wholist_expanded_state, AJAX);
        WebcitAddUrlHandler(HKEY("toggle_roomlist_expanded_state"), "", 0, toggle_roomlist_expanded_state, AJAX);
-       RegisterConditional(HKEY("COND:ICONBAR:ACTIVE"), 3, ConditionalIsActiveStylesheet, CTX_NONE);
+       RegisterConditional("COND:ICONBAR:ACTIVE", 3, ConditionalIsActiveStylesheet, CTX_NONE);
        RegisterNamespace("ICONBAR", 0, 0, tmplput_iconbar, NULL, CTX_NONE);
-       RegisterConditional(HKEY("COND:ICONBAR:WHOLISTEXPANDED"), 0, ConditionalWholistExpanded, CTX_NONE);
-       RegisterConditional(HKEY("COND:ICONBAR:ROOMLISTEXPANDED"), 0, ConditionalRoomlistExpanded, CTX_NONE);
+       RegisterConditional("COND:ICONBAR:WHOLISTEXPANDED", 0, ConditionalWholistExpanded, CTX_NONE);
+       RegisterConditional("COND:ICONBAR:ROOMLISTEXPANDED", 0, ConditionalRoomlistExpanded, CTX_NONE);
 
        RegisterPreference("iconbar", _("Iconbar Setting"), PRF_STRING, LoadIconSettings);
        l = 1;
index 1184420..5d9ceb8 100644 (file)
@@ -142,9 +142,9 @@ void
 InitModule_LISTSUB
 (void)
 {
-       RegisterConditional(HKEY("COND:LISTSUB:EXECUTE:SUBSCRIBE"), 0, Conditional_LISTSUB_EXECUTE_SUBSCRIBE,  CTX_NONE);
-       RegisterConditional(HKEY("COND:LISTSUB:EXECUTE:UNSUBSCRIBE"), 0, Conditional_LISTSUB_EXECUTE_UNSUBSCRIBE,  CTX_NONE);
-       RegisterConditional(HKEY("COND:LISTSUB:EXECUTE:CONFIRM:SUBSCRIBE"), 0, Conditional_LISTSUB_EXECUTE_CONFIRM_SUBSCRIBE,  CTX_NONE);
+       RegisterConditional("COND:LISTSUB:EXECUTE:SUBSCRIBE", 0, Conditional_LISTSUB_EXECUTE_SUBSCRIBE,  CTX_NONE);
+       RegisterConditional("COND:LISTSUB:EXECUTE:UNSUBSCRIBE", 0, Conditional_LISTSUB_EXECUTE_UNSUBSCRIBE,  CTX_NONE);
+       RegisterConditional("COND:LISTSUB:EXECUTE:CONFIRM:SUBSCRIBE", 0, Conditional_LISTSUB_EXECUTE_CONFIRM_SUBSCRIBE,  CTX_NONE);
 
        WebcitAddUrlHandler(HKEY("listsub"), "", 0, do_listsub, ANONYMOUS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE);
 
index 990c24f..2124697 100644 (file)
@@ -246,7 +246,7 @@ void
 InitModule_MARCHLIST
 (void)
 {
-       RegisterConditional(HKEY("COND:UNGOTO"), 0, ConditionalHaveUngoto, CTX_NONE);
+       RegisterConditional("COND:UNGOTO", 0, ConditionalHaveUngoto, CTX_NONE);
        RegisterNamespace("ROOM:UNGOTO", 0, 0, tmplput_ungoto, NULL, CTX_NONE);
 
        WebcitAddUrlHandler(HKEY("gotonext"), "", 0, _gotonext, NEED_URL);
diff --git a/webcit/mk_module_init.sh b/webcit/mk_module_init.sh
deleted file mode 100755 (executable)
index ae1cd37..0000000
+++ /dev/null
@@ -1,503 +0,0 @@
-#!/bin/sh
-#
-# Script to generate $C_FILE
-#
-
-ECHO=/usr/bin/printf
-
-#MINUS_e=X`$ECHO -n -e`
-#if [ $MINUS_e != "X" ] ; then
-#      MINUS_e=""
-#else
-#      MINUS_e="-e"
-#fi
-
-#MINUS_E=X`$ECHO -n -E`
-#if [ $MINUS_E != "X" ] ; then
-#      MINUS_E=""
-#else
-#      MINUS_E="-E"
-#fi
-
-
-CUR_DIR=`pwd`
-C_FILE="$CUR_DIR/modules_init.c"
-H_FILE="$CUR_DIR/modules_init.h"
-MOD_FILE="$CUR_DIR/Make_modules"
-SRC_FILE="$CUR_DIR/Make_sources"
-U_FILE="$CUR_DIR/modules_upgrade.c"
-
-/usr/bin/printf "Scanning extension modules for entry points.\n"
-
-rm -f $C_FILE $H_FILE
-
-# server lifetime:
-START_FUNCS=`grep ServerStartModule_ *.c |sed "s;.*:;;" |sort -u`
-INIT_FUNCS=`grep InitModule_ *.c |sed "s;.*:;;" |sort -u`
-INIT2_FUNCS=`grep InitModule2_ *.c |sed "s;.*:;;" |sort -u`
-FINALIZE_FUNCS=`grep FinalizeModule_ *.c |sed "s;.*:;;" |sort -u`
-SHUTDOWN_FUNCS=`grep ServerShutdownModule_ *.c |sed "s;.*:;;" |sort -u`
-
-# session hooks:
-SESS_NEW_FUNCS=`grep SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
-SESS_ATTACH_FUNCS=`grep SessionAttachModule_ *.c |sed "s;.*:;;" |sort -u`
-SESS_DETACH_FUNCS=`grep SessionDetachModule_ *.c |sed "s;.*:;;" |sort -u`
-SESS_DESTROY_FUNCS=`grep SessionDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
-
-HTTP_NEW_FUNCS=`grep HttpNewModule_ *.c |sed "s;.*:;;" |sort -u`
-HTTP_DETACH_FUNCS=`grep HttpDetachModule_ *.c |sed "s;.*:;;" |sort -u`
-HTTP_DESTROY_FUNCS=`grep HttpDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
-
-
-#SESS_NEW_FUNCS=`grep SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
-
-
-#start the header file
-cat <<EOF > $H_FILE
-/* 
- * $H_FILE
- * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
- */
-
-
-#ifndef MODULES_INIT_H
-#define MODULES_INIT_H
-extern size_t nSizErrmsg;
-
-
-/* 
- * server lifetime: 
- */
-void initialise_modules (void);
-void initialise2_modules (void);
-void start_modules (void);
-void shutdown_modules (void);
-
-
-/*
- * Session lifetime:
- */
-void session_new_modules (wcsession *sess);
-void session_attach_modules (wcsession *sess);
-void session_detach_modules (wcsession *sess);
-void session_destroy_modules (wcsession **sess);
-
-void http_new_modules (ParsedHttpHdrs *httpreq);
-void http_detach_modules (ParsedHttpHdrs *httpreq);
-void http_destroy_modules (ParsedHttpHdrs *httpreq);
-
-
-
-/*
- * forwards...
- */
-
-EOF
-
-
-#start of the files which inturn removes any existing file
-#
-
-# start the Makefile included file for $SERV_MODULES
-cat <<EOF  >$MOD_FILE
-#
-# Make_modules
-# This file is to be included by Makefile to dynamically add modules to the build process
-# THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
-#
-
-EOF
-
-# start the Makefile included file for $SOURCES
-cat <<EOF  >$SRC_FILE
-#
-# Make_sources
-# This file is to be included by Makefile to dynamically add modules to the build process
-# THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
-#
-
-EOF
-
-# start the c file
-cat <<EOF  >$C_FILE
-/*
- * $C_FILE
- * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
- */
-
-
-
-#include "sysdep.h"
-#include <stdlib.h>
-#include <time.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <libcitadel.h>
-#include "webcit.h"
-#include "modules_init.h"
-#include "webserver.h"
-
-void LogPrintMessages(long err);
-extern long DetailErrorFlags;
-
-void start_modules (void)
-{
-EOF
-#********************************************************************************
-# server  ******** start ********  module logic.
-#********************************************************************************
-cat <<EOF >> $H_FILE
-
-/* Server Start Hooks: */
-EOF
-for HOOK in $START_FUNCS; do
-HOOKNAME=`echo $HOOK |sed "s;ServerStartModule_;;"`
-# Add this entry point to the .c file
-cat <<EOF >> $C_FILE
-#ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Starting $HOOKNAME\n");
-#endif
-       $HOOK();
-EOF
-# Add this entry point to the .h file
-cat <<EOF >> $H_FILE
-extern void $HOOK(void);
-EOF
-done
-
-
-#********************************************************************************
-# server module  ******** initialisation ********  logic.
-#********************************************************************************
-cat <<EOF >> $H_FILE
-
-/* Server Init Hooks: */
-EOF
-
-cat <<EOF  >>$C_FILE
-}
-
-
-void initialise_modules (void)
-{
-
-EOF
-for HOOK in $INIT_FUNCS; do
-    HOOKNAME=`echo $HOOK |sed "s;InitModule_;;"`
-# Add this entry point to the .c file
-    cat <<EOF >> $C_FILE
-#ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
-#endif
-       $HOOK();
-EOF
-# Add this entry point to the .h file
-    cat <<EOF >> $H_FILE
-extern void $HOOK(void);
-EOF
-done
-
-#********************************************************************************
-# server module  ******** initialisation ********  second stage.
-#********************************************************************************
-cat <<EOF >> $H_FILE
-
-/* Server Init Hooks: */
-EOF
-
-cat <<EOF  >>$C_FILE
-}
-
-
-void initialise2_modules (void)
-{
-
-EOF
-for HOOK in $INIT2_FUNCS; do
-    HOOKNAME=`echo $HOOK |sed "s;InitModule2_;;"`
-# Add this entry point to the .c file
-    cat <<EOF >> $C_FILE
-#ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
-#endif
-       $HOOK();
-EOF
-# Add this entry point to the .h file
-    cat <<EOF >> $H_FILE
-extern void $HOOK(void);
-EOF
-done
-
-
-
-#********************************************************************************
-# server module    ***** shutdown *****  logic.
-#********************************************************************************
-cat <<EOF >> $H_FILE
-
-/* Server shutdown Hooks: */
-EOF
-cat <<EOF  >>$C_FILE
-}
-
-
-void shutdown_modules (void)
-{
-
-EOF
-for HOOK in $SHUTDOWN_FUNCS; do
-HOOKNAME=`echo $HOOK |sed "s;ServerShutdownModule_;;"`
-# Add this entry point to the .c file
-cat <<EOF >> $C_FILE
-#ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Shutting down $HOOKNAME\n");
-#endif
-       $HOOK();
-EOF
-# Add this entry point to the .h file
-cat <<EOF >> $H_FILE
-extern void $HOOK(void);
-EOF
-done
-
-
-
-
-#********************************************************************************
-# NEW-session module logic.
-#********************************************************************************
-cat <<EOF >> $H_FILE
-
-/* Session New Hooks: */
-EOF
-cat <<EOF  >>$C_FILE
-}
-
-
-void session_new_modules (wcsession *sess)
-{
-
-EOF
-for HOOK in $SESS_NEW_FUNCS; do
-HOOKNAME=`echo $HOOK |sed "s;SessionNewModule_;;"`
-# Add this entry point to the .c file
-cat <<EOF >> $C_FILE
-#ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
-#endif
-       $HOOK(sess);
-EOF
-# Add this entry point to the .h file
-cat <<EOF >> $H_FILE
-extern void $HOOK(wcsession *sess);
-EOF
-done
-
-
-
-#********************************************************************************
-# ATTACH-Session module logic.
-#********************************************************************************
-cat <<EOF >> $H_FILE
-
-/* Session Attach Hooks: */
-EOF
-cat <<EOF  >>$C_FILE
-}
-
-
-void session_attach_modules (wcsession *sess)
-{
-
-EOF
-for HOOK in $SESS_ATTACH_FUNCS; do
-HOOKNAME=`echo $HOOK |sed "s;SessionAttachModule_;;"`
-# Add this entry point to the .c file
-cat <<EOF >> $C_FILE
-#ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Attaching Session; $HOOKNAME\n");
-#endif
-       $HOOK(sess);
-EOF
-# Add this entry point to the .h file
-cat <<EOF >> $H_FILE
-extern void $HOOK(wcsession *sess);
-EOF
-done
-
-
-
-#********************************************************************************
-# DETACH-Session module logic.
-#********************************************************************************
-cat <<EOF >> $H_FILE
-
-/* Session detach Hooks: */
-EOF
-cat <<EOF  >>$C_FILE
-}
-
-
-void session_detach_modules (wcsession *sess)
-{
-
-EOF
-for HOOK in $SESS_DETACH_FUNCS; do
-HOOKNAME=`echo $HOOK |sed "s;SessionDetachModule_;;"`
-# Add this entry point to the .c file
-cat <<EOF >> $C_FILE
-#ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
-#endif
-       $HOOK(sess);
-EOF
-# Add this entry point to the .h file
-cat <<EOF >> $H_FILE
-extern void $HOOK(wcsession *sess);
-EOF
-done
-
-
-
-
-#********************************************************************************
-# DESTROY-Session module logic.
-#********************************************************************************
-cat <<EOF >> $H_FILE
-
-/* Session destroy Hooks: */
-EOF
-cat <<EOF  >>$C_FILE
-}
-
-
-void session_destroy_modules (wcsession **sess)
-{
-
-EOF
-for HOOK in $SESS_DESTROY_FUNCS; do
-HOOKNAME=`echo $HOOK |sed "s;SessionDestroyModule_;;"`
-# Add this entry point to the .c file
-cat <<EOF >> $C_FILE
-#ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
-#endif
-       $HOOK(*sess);
-EOF
-# Add this entry point to the .h file
-cat <<EOF >> $H_FILE
-extern void $HOOK(wcsession *sess);
-EOF
-done
-
-
-cat <<EOF  >>$C_FILE
-       free((*sess));
-       (*sess) = NULL;
-}
-
-
-EOF
-
-
-
-
-
-#********************************************************************************
-# NEW-Httprequest module logic.
-#********************************************************************************
-cat <<EOF >> $C_FILE
-
-void http_new_modules (ParsedHttpHdrs *httpreq)
-{
-EOF
-
-for HOOK in $HTTP_NEW_FUNCS; do
-HOOKNAME=`echo $HOOK |sed "s;HttpNewModule_;;"`
-# Add this entry point to the .c file
-cat <<EOF >> $C_FILE
-#ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "NEW $HOOKNAME\n");
-#endif
-       $HOOK(httpreq);
-EOF
-# Add this entry point to the .h file
-cat <<EOF >> $H_FILE
-extern void $HOOK(ParsedHttpHdrs *httpreq);
-EOF
-done
-
-cat <<EOF  >>$C_FILE
-}
-EOF
-
-#********************************************************************************
-# DETACH-Httprequest module logic.
-#********************************************************************************
-cat <<EOF >> $C_FILE
-
-void http_detach_modules (ParsedHttpHdrs *httpreq)
-{
-EOF
-
-for HOOK in $HTTP_DETACH_FUNCS; do
-HOOKNAME=`echo $HOOK |sed "s;HttpDetachModule_;;"`
-# Add this entry point to the .c file
-cat <<EOF >> $C_FILE
-#ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Detaching $HOOKNAME\n");
-#endif
-       $HOOK(httpreq);
-EOF
-# Add this entry point to the .h file
-cat <<EOF >> $H_FILE
-extern void $HOOK(ParsedHttpHdrs *httpreq);
-EOF
-done
-
-cat <<EOF  >>$C_FILE
-}
-EOF
-
-
-#********************************************************************************
-# DESTROY-Httprequest module logic.
-#********************************************************************************
-cat <<EOF >> $C_FILE
-
-void http_destroy_modules (ParsedHttpHdrs *httpreq)
-{
-EOF
-
-for HOOK in $HTTP_DESTROY_FUNCS; do
-HOOKNAME=`echo $HOOK |sed "s;HttpDestroyModule_;;"`
-# Add this entry point to the .c file
-cat <<EOF >> $C_FILE
-#ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Destructing $HOOKNAME\n");
-#endif
-       $HOOK(httpreq);
-EOF
-# Add this entry point to the .h file
-cat <<EOF >> $H_FILE
-extern void $HOOK(ParsedHttpHdrs *httpreq);
-EOF
-done
-
-cat <<EOF  >>$C_FILE
-}
-EOF
-
-
-
-
-
-
-
-cat <<EOF  >> $H_FILE
-
-#endif /* MODULES_INIT_H */
-
-EOF
index 312640b..3fac04a 100644 (file)
@@ -1517,22 +1517,22 @@ InitModule_MSGRENDERERS
        RegisterNamespace("MAIL:QUOTETEXT", 1, 2, tmplput_QUOTED_MAIL_BODY,  NULL, CTX_NONE);
        RegisterNamespace("MAIL:EDITTEXT", 1, 2, tmplput_EDIT_MAIL_BODY,  NULL, CTX_NONE);
        RegisterNamespace("MAIL:EDITWIKI", 1, 2, tmplput_EDIT_WIKI_BODY,  NULL, CTX_NONE);
-       RegisterConditional(HKEY("COND:MAIL:SUMM:RFCA"), 0, Conditional_MAIL_SUMM_RFCA,  CTX_MAILSUM);
-       RegisterConditional(HKEY("COND:MAIL:SUMM:CCCC"), 0, Conditional_MAIL_SUMM_CCCC,  CTX_MAILSUM);
-       RegisterConditional(HKEY("COND:MAIL:SUMM:REPLYTO"), 0, Conditional_MAIL_SUMM_REPLYTO,  CTX_MAILSUM);
-       RegisterConditional(HKEY("COND:MAIL:SUMM:UNREAD"), 0, Conditional_MAIL_SUMM_UNREAD, CTX_MAILSUM);
-       RegisterConditional(HKEY("COND:MAIL:SUMM:H_NODE"), 0, Conditional_MAIL_SUMM_H_NODE, CTX_MAILSUM);
-       RegisterConditional(HKEY("COND:MAIL:SUMM:OTHERNODE"), 0, Conditional_MAIL_SUMM_OTHERNODE, CTX_MAILSUM);
-       RegisterConditional(HKEY("COND:MAIL:SUMM:SUBJECT"), 0, Conditional_MAIL_SUMM_SUBJECT, CTX_MAILSUM);
-       RegisterConditional(HKEY("COND:MAIL:ANON"), 0, Conditional_ANONYMOUS_MESSAGE, CTX_MAILSUM);
-       RegisterConditional(HKEY("COND:MAIL:TO"), 0, Conditional_MAIL_SUMM_TO, CTX_MAILSUM);    
-       RegisterConditional(HKEY("COND:MAIL:SUBJ"), 0, Conditional_MAIL_SUMM_SUBJ, CTX_MAILSUM);        
+       RegisterConditional("COND:MAIL:SUMM:RFCA", 0, Conditional_MAIL_SUMM_RFCA,  CTX_MAILSUM);
+       RegisterConditional("COND:MAIL:SUMM:CCCC", 0, Conditional_MAIL_SUMM_CCCC,  CTX_MAILSUM);
+       RegisterConditional("COND:MAIL:SUMM:REPLYTO", 0, Conditional_MAIL_SUMM_REPLYTO,  CTX_MAILSUM);
+       RegisterConditional("COND:MAIL:SUMM:UNREAD", 0, Conditional_MAIL_SUMM_UNREAD, CTX_MAILSUM);
+       RegisterConditional("COND:MAIL:SUMM:H_NODE", 0, Conditional_MAIL_SUMM_H_NODE, CTX_MAILSUM);
+       RegisterConditional("COND:MAIL:SUMM:OTHERNODE", 0, Conditional_MAIL_SUMM_OTHERNODE, CTX_MAILSUM);
+       RegisterConditional("COND:MAIL:SUMM:SUBJECT", 0, Conditional_MAIL_SUMM_SUBJECT, CTX_MAILSUM);
+       RegisterConditional("COND:MAIL:ANON", 0, Conditional_ANONYMOUS_MESSAGE, CTX_MAILSUM);
+       RegisterConditional("COND:MAIL:TO", 0, Conditional_MAIL_SUMM_TO, CTX_MAILSUM);  
+       RegisterConditional("COND:MAIL:SUBJ", 0, Conditional_MAIL_SUMM_SUBJ, CTX_MAILSUM);      
 
        /* do we have mimetypes to iterate over? */
-       RegisterConditional(HKEY("COND:MAIL:MIME:ATTACH"), 0, Conditional_MAIL_MIME_ALL, CTX_MAILSUM);
-       RegisterConditional(HKEY("COND:MAIL:MIME:ATTACH:SUBMESSAGES"), 0, Conditional_MAIL_MIME_SUBMESSAGES, CTX_MAILSUM);
-       RegisterConditional(HKEY("COND:MAIL:MIME:ATTACH:LINKS"), 0, Conditional_MAIL_MIME_ATTACHLINKS, CTX_MAILSUM);
-       RegisterConditional(HKEY("COND:MAIL:MIME:ATTACH:ATT"), 0, Conditional_MAIL_MIME_ATTACH, CTX_MAILSUM);
+       RegisterConditional("COND:MAIL:MIME:ATTACH", 0, Conditional_MAIL_MIME_ALL, CTX_MAILSUM);
+       RegisterConditional("COND:MAIL:MIME:ATTACH:SUBMESSAGES", 0, Conditional_MAIL_MIME_SUBMESSAGES, CTX_MAILSUM);
+       RegisterConditional("COND:MAIL:MIME:ATTACH:LINKS", 0, Conditional_MAIL_MIME_ATTACHLINKS, CTX_MAILSUM);
+       RegisterConditional("COND:MAIL:MIME:ATTACH:ATT", 0, Conditional_MAIL_MIME_ATTACH, CTX_MAILSUM);
        RegisterIterator("MAIL:MIME:ATTACH", 0, NULL, iterate_get_mime_All, 
                         NULL, NULL, CTX_MIME_ATACH, CTX_MAILSUM, IT_NOFLAG);
        RegisterIterator("MAIL:MIME:ATTACH:SUBMESSAGES", 0, NULL, iterate_get_mime_Submessages, 
@@ -1568,7 +1568,7 @@ InitModule_MSGRENDERERS
 /*
        RegisterMimeRenderer(HKEY("text/calendar"), render_MIME_ICS, 1, 501);
        RegisterMimeRenderer(HKEY("application/ics"), render_MIME_ICS, 1, 500);
-*/
+//*/
        RegisterMimeRenderer(HKEY("text/x-citadel-variformat"), render_MAIL_variformat, 1, 2);
        RegisterMimeRenderer(HKEY("text/plain"), render_MAIL_text_plain, 1, 3);
        RegisterMimeRenderer(HKEY("text"), render_MAIL_text_plain, 1, 1);
index 38b8b54..4b3dc21 100644 (file)
@@ -144,7 +144,7 @@ InitModule_PAGING
        WebcitAddUrlHandler(HKEY("display_page"), "", 0, display_page, 0);
        WebcitAddUrlHandler(HKEY("page_user"), "", 0, page_user, 0);
        WebcitAddUrlHandler(HKEY("ajax_send_instant_message"), "", 0, ajax_send_instant_message, AJAX);
-       RegisterConditional(HKEY("COND:PAGE:WAITING"), 0, Conditional_PAGE_WAITING, CTX_NONE);
+       RegisterConditional("COND:PAGE:WAITING", 0, Conditional_PAGE_WAITING, CTX_NONE);
 }
 
 
index 3507a9a..46ac872 100644 (file)
@@ -558,7 +558,7 @@ InitModule_PARAMHANDLING
        RegisterNamespace("BSTR:PAIR:X", 1, 2, tmplput_bstr_pair_x, NULL, CTX_BSTRPAIRS);
        RegisterNamespace("BSTR:PAIR:Y", 1, 2, tmplput_bstr_pair_y, NULL, CTX_BSTRPAIRS);
 
-       RegisterConditional(HKEY("COND:BSTR"), 1, ConditionalBstr, CTX_NONE);
+       RegisterConditional("COND:BSTR", 1, ConditionalBstr, CTX_NONE);
        RegisterNamespace("BSTR", 1, 2, tmplput_bstr, NULL, CTX_NONE);
        RegisterNamespace("BSTR:FORWARD", 1, 2, tmplput_bstrforward, NULL, CTX_NONE);
        RegisterNamespace("URLPART", 1, 2, tmplput_url_part, NULL, CTX_NONE);
index bcec00d..260bdc7 100644 (file)
@@ -1188,9 +1188,9 @@ InitModule_PREFERENCES
        
        RegisterNamespace("PREF:DESCR", 1, 1, tmplput_CFG_Descr, NULL, CTX_NONE);
 
-       RegisterConditional(HKEY("COND:PREF"), 4, ConditionalPreference, CTX_NONE);
-       RegisterConditional(HKEY("COND:PREF:SET"), 4, ConditionalHasPreference, CTX_NONE);
-       RegisterConditional(HKEY("COND:ROOM:SET"), 4, ConditionalHasRoomPreference, CTX_NONE);
+       RegisterConditional("COND:PREF", 4, ConditionalPreference, CTX_NONE);
+       RegisterConditional("COND:PREF:SET", 4, ConditionalHasPreference, CTX_NONE);
+       RegisterConditional("COND:ROOM:SET", 4, ConditionalHasRoomPreference, CTX_NONE);
        
        RegisterIterator("PREF:VALID:EMAIL:ADDR", 0, NULL, 
                         GetGVEAHash, NULL, DeleteGVEAHash, CTX_STRBUF, CTX_NONE, IT_NOFLAG);
index 3dad18a..653f01a 100644 (file)
@@ -696,7 +696,7 @@ InitModule_ROOMLIST
 
 
 
-       RegisterConditional(HKEY("COND:ROOM:REST:ISSUBROOM"), 0, ConditionalRoomIsRESTSubRoom, CTX_ROOMS);
+       RegisterConditional("COND:ROOM:REST:ISSUBROOM", 0, ConditionalRoomIsRESTSubRoom, CTX_ROOMS);
 
        RegisterSortFunc(HKEY("byfloorroom"),
                         NULL, 0,
index e3f95ef..72daf67 100644 (file)
@@ -618,10 +618,10 @@ InitModule_ROOMTOKENS
        RegisterNamespace("FLOOR:NROOMS", 0, 0, tmplput_FLOOR_NROOMS, NULL, CTX_FLOORS);
        RegisterNamespace("ROOM:INFO:FLOOR:NROOMS", 0, 0, tmplput_ROOM_FLOOR_NROOMS, NULL, CTX_ROOMS);
 
-       RegisterConditional(HKEY("COND:FLOOR:ISSUBROOM"), 0, ConditionalFloorIsSUBROOM, CTX_FLOORS);
-       RegisterConditional(HKEY("COND:FLOOR:NROOMS"), 1, ConditionalFloorHaveNRooms, CTX_FLOORS);
-       RegisterConditional(HKEY("COND:ROOM:REST:ISSUBFLOOR"), 0, ConditionalFloorIsRESTSubFloor, CTX_FLOORS);
-       RegisterConditional(HKEY("COND:FLOOR:ISVIRTUAL"), 0, ConditionalFloorIsVirtual, CTX_FLOORS);
+       RegisterConditional("COND:FLOOR:ISSUBROOM", 0, ConditionalFloorIsSUBROOM, CTX_FLOORS);
+       RegisterConditional("COND:FLOOR:NROOMS", 1, ConditionalFloorHaveNRooms, CTX_FLOORS);
+       RegisterConditional("COND:ROOM:REST:ISSUBFLOOR", 0, ConditionalFloorIsRESTSubFloor, CTX_FLOORS);
+       RegisterConditional("COND:FLOOR:ISVIRTUAL", 0, ConditionalFloorIsVirtual, CTX_FLOORS);
 
        /**** Room... ******/
         /**** Name ******/
@@ -630,26 +630,26 @@ InitModule_ROOMTOKENS
        RegisterNamespace("ROOM:INFO:NAME", 0, 1, tmplput_ROOM_NAME, NULL, CTX_ROOMS);
        RegisterNamespace("ROOM:INFO:BASENAME", 0, 1, tmplput_ROOM_BASENAME, NULL, CTX_ROOMS);
        RegisterNamespace("ROOM:INFO:LEVELNTIMES", 1, 2, tmplput_ROOM_LEVEL_N_TIMES, NULL, CTX_ROOMS);
-       RegisterConditional(HKEY("COND:ROOM:INFO:IS_INBOX"), 0, ConditionalRoomIsInbox, CTX_ROOMS);
-       RegisterConditional(HKEY("COND:ROOM:INFO:TYPE_IS"), 0, ConditionalRoomIsType, CTX_ROOMS);
-       RegisterConditional(HKEY("COND:ROOM:INFO:NAME_IS"), 1, ConditionalRoomIsName, CTX_ROOMS);
+       RegisterConditional("COND:ROOM:INFO:IS_INBOX", 0, ConditionalRoomIsInbox, CTX_ROOMS);
+       RegisterConditional("COND:ROOM:INFO:TYPE_IS", 0, ConditionalRoomIsType, CTX_ROOMS);
+       RegisterConditional("COND:ROOM:INFO:NAME_IS", 1, ConditionalRoomIsName, CTX_ROOMS);
 
        /****** Properties ******/
        RegisterNamespace("ROOM:INFO:QRFLAGS", 0, 1, tmplput_ROOM_QRFLAGS, NULL, CTX_ROOMS);
-       RegisterConditional(HKEY("COND:THISROOM:FLAG:QR"), 0, ConditionalThisRoomHas_QRFlag, CTX_NONE);
-       RegisterConditional(HKEY("COND:THISROOM:EDIT"), 0, ConditionalRoom_MayEdit, CTX_NONE);
-       RegisterConditional(HKEY("COND:ROOM:FLAG:QR"), 0, ConditionalRoomHas_QRFlag, CTX_ROOMS);
+       RegisterConditional("COND:THISROOM:FLAG:QR", 0, ConditionalThisRoomHas_QRFlag, CTX_NONE);
+       RegisterConditional("COND:THISROOM:EDIT", 0, ConditionalRoom_MayEdit, CTX_NONE);
+       RegisterConditional("COND:ROOM:FLAG:QR", 0, ConditionalRoomHas_QRFlag, CTX_ROOMS);
 
-       RegisterConditional(HKEY("COND:THISROOM:FLAG:QR2"), 0, ConditionalThisRoomHas_QRFlag2, CTX_NONE);
-       RegisterConditional(HKEY("COND:ROOM:FLAG:QR2"), 0, ConditionalRoomHas_QRFlag2, CTX_ROOMS);
+       RegisterConditional("COND:THISROOM:FLAG:QR2", 0, ConditionalThisRoomHas_QRFlag2, CTX_NONE);
+       RegisterConditional("COND:ROOM:FLAG:QR2", 0, ConditionalRoomHas_QRFlag2, CTX_ROOMS);
 
-       RegisterConditional(HKEY("COND:ROOM:FLAG:UA"), 0, ConditionalRoomHas_UAFlag, CTX_ROOMS);
+       RegisterConditional("COND:ROOM:FLAG:UA", 0, ConditionalRoomHas_UAFlag, CTX_ROOMS);
        RegisterNamespace("ROOM:INFO:RAFLAGS", 0, 1, tmplput_ROOM_RAFLAGS, NULL, CTX_ROOMS);
 
 
        RegisterNamespace("ROOM:INFO:LISTORDER", 0, 1, tmplput_ROOM_LISTORDER, NULL, CTX_ROOMS);
        RegisterNamespace("THISROOM:ORDER", 0, 0, tmplput_ThisRoomOrder, NULL, CTX_NONE);
-       RegisterConditional(HKEY("COND:THISROOM:ORDER"), 0, ConditionalThisRoomOrder, CTX_NONE);
+       RegisterConditional("COND:THISROOM:ORDER", 0, ConditionalThisRoomOrder, CTX_NONE);
 
        RegisterNamespace("ROOM:INFO:LASTCHANGE", 0, 1, tmplput_ROOM_LASTCHANGE, NULL, CTX_ROOMS);
 
@@ -658,19 +658,19 @@ InitModule_ROOMTOKENS
 
        RegisterNamespace("THISROOM:PASS", 0, 1, tmplput_ThisRoomPass, NULL, CTX_NONE);
        RegisterNamespace("THISROOM:AIDE", 0, 1, tmplput_ThisRoomAide, NULL, CTX_NONE);
-       RegisterConditional(HKEY("COND:ROOMAIDE"), 2, ConditionalRoomAide, CTX_NONE);
-       RegisterConditional(HKEY("COND:ACCESS:DELETE"), 2, ConditionalRoomAcessDelete, CTX_NONE);
-       RegisterConditional(HKEY("COND:ROOM:EDITACCESS"), 0, ConditionalHaveRoomeditRights, CTX_NONE);
+       RegisterConditional("COND:ROOMAIDE", 2, ConditionalRoomAide, CTX_NONE);
+       RegisterConditional("COND:ACCESS:DELETE", 2, ConditionalRoomAcessDelete, CTX_NONE);
+       RegisterConditional("COND:ROOM:EDITACCESS", 0, ConditionalHaveRoomeditRights, CTX_NONE);
 
-       RegisterConditional(HKEY("COND:THISROOM:HAVE_PIC"), 0, ConditionalThisRoomXHavePic, CTX_NONE);
+       RegisterConditional("COND:THISROOM:HAVE_PIC", 0, ConditionalThisRoomXHavePic, CTX_NONE);
 
        RegisterNamespace("THISROOM:INFOTEXT", 1, 2, tmplput_ThisRoomInfoText, NULL, CTX_NONE);
-       RegisterConditional(HKEY("COND:THISROOM:HAVE_INFOTEXT"), 0, ConditionalThisRoomXHaveInfoText, CTX_NONE);
+       RegisterConditional("COND:THISROOM:HAVE_INFOTEXT", 0, ConditionalThisRoomXHaveInfoText, CTX_NONE);
 
        RegisterNamespace("THISROOM:FILES:N", 0, 1, tmplput_ThisRoomXNFiles, NULL, CTX_NONE);
        RegisterNamespace("THISROOM:FILES:STR", 0, 1, tmplput_ThisRoomX_FileString, NULL, CTX_NONE);
        RegisterNamespace("THISROOM:DIRECTORY", 0, 1, tmplput_ThisRoomDirectory, NULL, CTX_NONE);
 
        RegisterNamespace("ROOM:INFO:ACL", 0, 1, tmplput_ROOM_ACL, NULL, CTX_ROOMS);
-       RegisterConditional(HKEY("COND:THIS:THAT:ROOM"), 0, ConditionalIsThisThatRoom, CTX_ROOMS);
+       RegisterConditional("COND:THIS:THAT:ROOM", 0, ConditionalIsThisThatRoom, CTX_ROOMS);
 }
index e7ff823..ac59c5b 100644 (file)
@@ -258,17 +258,17 @@ InitModule_ROOMVIEWS
        RegisterNamespace("THISROOM:VIEW_STRING", 0, 1, tmplput_CurrentRoomViewString, NULL, CTX_NONE);
        RegisterNamespace("ROOM:VIEW_STRING", 1, 2, tmplput_RoomViewString, NULL, CTX_NONE);
 
-       RegisterConditional(HKEY("COND:ALLOWED_DEFAULT_VIEW"), 0, ConditionalIsAllowedDefaultView, CTX_NONE);
-       RegisterConditional(HKEY("COND:THISROOM:DEFAULT_VIEW"), 0, ConditionalThisRoomDefView, CTX_NONE);
+       RegisterConditional("COND:ALLOWED_DEFAULT_VIEW", 0, ConditionalIsAllowedDefaultView, CTX_NONE);
+       RegisterConditional("COND:THISROOM:DEFAULT_VIEW", 0, ConditionalThisRoomDefView, CTX_NONE);
        RegisterNamespace("THISROOM:DEFAULT_VIEW", 0, 0, tmplput_CurrentRoomDefView, NULL, CTX_NONE);
        RegisterNamespace("ROOM:INFO:DEFVIEW", 0, 1, tmplput_ROOM_DEFVIEW, NULL, CTX_ROOMS);
 
-       RegisterConditional(HKEY("COND:ROOM:TYPE_IS"), 0, ConditionalIsRoomtype, CTX_NONE);
+       RegisterConditional("COND:ROOM:TYPE_IS", 0, ConditionalIsRoomtype, CTX_NONE);
 
-       RegisterConditional(HKEY("COND:THISROOM:HAVE_VIEW"), 0, ConditionalThisRoomHaveView, CTX_NONE);
-       RegisterConditional(HKEY("COND:ROOM:DAV_CONTENT"), 0, ConditionalRoomHasGroupdavContent, CTX_ROOMS);
+       RegisterConditional("COND:THISROOM:HAVE_VIEW", 0, ConditionalThisRoomHaveView, CTX_NONE);
+       RegisterConditional("COND:ROOM:DAV_CONTENT", 0, ConditionalRoomHasGroupdavContent, CTX_ROOMS);
 
-       RegisterConditional(HKEY("COND:THISROOM:CURR_VIEW"), 0, ConditionalThisRoomCurrView, CTX_NONE);
+       RegisterConditional("COND:THISROOM:CURR_VIEW", 0, ConditionalThisRoomCurrView, CTX_NONE);
        RegisterNamespace("ROOM:INFO:VIEW", 0, 1, tmplput_ROOM_VIEW, NULL, CTX_ROOMS);
 
        RegisterNamespace("ROOM:INFO:COLLECTIONTYPE", 0, 1, tmplput_ROOM_COLLECTIONTYPE, NULL, CTX_ROOMS);
index 6d7dc34..6dcf79c 100644 (file)
@@ -701,11 +701,11 @@ InitModule_SERVFUNC
        if (is_uds)
                snprintf(serv_sock_name, PATH_MAX, "%s/citadel.socket", ctdlport);
 
-       RegisterConditional(HKEY("COND:SERV:OPENID"), 2, conditional_serv_supports_openid, CTX_NONE);
-       RegisterConditional(HKEY("COND:SERV:NEWU"), 2, conditional_serv_newuser_disabled, CTX_NONE);
-       RegisterConditional(HKEY("COND:SERV:FULLTEXT_ENABLED"), 2, conditional_serv_fulltext_enabled, CTX_NONE);
-       RegisterConditional(HKEY("COND:SERV:LDAP_ENABLED"), 2, conditional_serv_ldap_enabled, CTX_NONE);
-        RegisterConditional(HKEY("COND:SERV:SUPPORTS_GUEST"), 2, conditional_serv_supports_guest, CTX_NONE);
+       RegisterConditional("COND:SERV:OPENID", 2, conditional_serv_supports_openid, CTX_NONE);
+       RegisterConditional("COND:SERV:NEWU", 2, conditional_serv_newuser_disabled, CTX_NONE);
+       RegisterConditional("COND:SERV:FULLTEXT_ENABLED", 2, conditional_serv_fulltext_enabled, CTX_NONE);
+       RegisterConditional("COND:SERV:LDAP_ENABLED", 2, conditional_serv_ldap_enabled, CTX_NONE);
+        RegisterConditional("COND:SERV:SUPPORTS_GUEST", 2, conditional_serv_supports_guest, CTX_NONE);
        RegisterNamespace("SERV:PID", 0, 0, tmplput_serv_ip, NULL, CTX_NONE);
        RegisterNamespace("SERV:NODENAME", 0, 1, tmplput_serv_nodename, NULL, CTX_NONE);
        RegisterNamespace("SERV:HUMANNODE", 0, 1, tmplput_serv_humannode, NULL, CTX_NONE);
index 214e7b4..ee6bcec 100644 (file)
@@ -934,21 +934,21 @@ InitModule_SIEVE
 
        RegisterIterator("SIEVE:SCRIPTS", 0, NULL, GetSieveScriptListing, NULL, NULL, CTX_SIEVELIST, CTX_NONE, IT_NOFLAG);
 
-       RegisterConditional(HKEY("COND:SIEVE:SCRIPT:ACTIVE"), 0, ConditionalSieveScriptIsActive, CTX_SIEVELIST);
-       RegisterConditional(HKEY("COND:SIEVE:SCRIPT:ISRULES"), 0, ConditionalSieveScriptIsRulesScript, CTX_SIEVELIST);
+       RegisterConditional("COND:SIEVE:SCRIPT:ACTIVE", 0, ConditionalSieveScriptIsActive, CTX_SIEVELIST);
+       RegisterConditional("COND:SIEVE:SCRIPT:ISRULES", 0, ConditionalSieveScriptIsRulesScript, CTX_SIEVELIST);
        RegisterNamespace("SIEVE:SCRIPT:NAME", 0, 1, tmplput_SieveScriptName, NULL, CTX_SIEVELIST);
        RegisterNamespace("SIEVE:SCRIPT:CONTENT", 0, 1, tmplput_SieveScriptContent, NULL, CTX_SIEVELIST);
 
  
        RegisterIterator("SIEVE:RULES", 0, NULL, GetSieveRules, NULL, DeleteHash, CTX_SIEVESCRIPT, CTX_NONE, IT_NOFLAG);
 
-       RegisterConditional(HKEY("COND:SIEVE:ACTIVE"), 1, ConditionalSieveRule_Active, CTX_SIEVESCRIPT);
-       RegisterConditional(HKEY("COND:SIEVE:HFIELD"), 1, ConditionalSieveRule_hfield, CTX_SIEVESCRIPT);
-       RegisterConditional(HKEY("COND:SIEVE:COMPARE"), 1, ConditionalSieveRule_compare, CTX_SIEVESCRIPT);
-       RegisterConditional(HKEY("COND:SIEVE:ACTION"), 1, ConditionalSieveRule_action, CTX_SIEVESCRIPT);
-       RegisterConditional(HKEY("COND:SIEVE:SIZECOMP"), 1, ConditionalSieveRule_sizecomp, CTX_SIEVESCRIPT);
-       RegisterConditional(HKEY("COND:SIEVE:FINAL"), 1, ConditionalSieveRule_final, CTX_SIEVESCRIPT);
-       RegisterConditional(HKEY("COND:SIEVE:THISROOM"), 1, ConditionalSieveRule_ThisRoom, CTX_SIEVESCRIPT);
+       RegisterConditional("COND:SIEVE:ACTIVE", 1, ConditionalSieveRule_Active, CTX_SIEVESCRIPT);
+       RegisterConditional("COND:SIEVE:HFIELD", 1, ConditionalSieveRule_hfield, CTX_SIEVESCRIPT);
+       RegisterConditional("COND:SIEVE:COMPARE", 1, ConditionalSieveRule_compare, CTX_SIEVESCRIPT);
+       RegisterConditional("COND:SIEVE:ACTION", 1, ConditionalSieveRule_action, CTX_SIEVESCRIPT);
+       RegisterConditional("COND:SIEVE:SIZECOMP", 1, ConditionalSieveRule_sizecomp, CTX_SIEVESCRIPT);
+       RegisterConditional("COND:SIEVE:FINAL", 1, ConditionalSieveRule_final, CTX_SIEVESCRIPT);
+       RegisterConditional("COND:SIEVE:THISROOM", 1, ConditionalSieveRule_ThisRoom, CTX_SIEVESCRIPT);
 
        RegisterNamespace("SIEVE:SCRIPT:HTEXT", 0, 1, tmplput_SieveRule_htext, NULL, CTX_SIEVESCRIPT);
        RegisterNamespace("SIEVE:SCRIPT:SIZE", 0, 1, tmplput_SieveRule_sizeval, NULL, CTX_SIEVESCRIPT);
index f755b54..1f513d8 100644 (file)
@@ -478,8 +478,8 @@ InitModule_SITECONFIG
        WebcitAddUrlHandler(HKEY("siteconfig"), "", 0, siteconfig, CTX_NONE);
 
        RegisterNamespace("SERV:CFG", 1, 2, tmplput_servcfg, NULL, CTX_NONE);
-       RegisterConditional(HKEY("COND:SERVCFG"), 3, ConditionalServCfg, CTX_NONE);
-       RegisterConditional(HKEY("COND:SERVCFG:CTXSTRBUF"), 4, ConditionalServCfgCTXStrBuf, CTX_STRBUF);
+       RegisterConditional("COND:SERVCFG", 3, ConditionalServCfg, CTX_NONE);
+       RegisterConditional("COND:SERVCFG:CTXSTRBUF", 4, ConditionalServCfgCTXStrBuf, CTX_STRBUF);
        RegisterIterator("PREF:ZONE", 0, ZoneHash, NULL, NULL, NULL, CTX_STRBUF, CTX_NONE, IT_NOFLAG);
 
        REGISTERTokenParamDefine(roompolicy);
@@ -497,11 +497,11 @@ InitModule_SITECONFIG
        REGISTERTokenParamDefine(CFG_SMTP_FROM_CORRECT);
        REGISTERTokenParamDefine(CFG_SMTP_FROM_REJECT);
 
-       RegisterConditional(HKEY("COND:EXPIRE:MODE"), 2, ConditionalExpire, CTX_NONE);
+       RegisterConditional("COND:EXPIRE:MODE", 2, ConditionalExpire, CTX_NONE);
        RegisterNamespace("EXPIRE:VALUE", 1, 2, tmplput_ExpireValue, NULL, CTX_NONE);
        RegisterNamespace("EXPIRE:MODE", 1, 2, tmplput_ExpireMode, NULL, CTX_NONE);
 
-       RegisterConditional(HKEY("COND:SERVCFG:THISLOGENABLE"), 4, ConditionalServCfgThisLogEnabled, CTX_SRVLOG);
+       RegisterConditional("COND:SERVCFG:THISLOGENABLE", 4, ConditionalServCfgThisLogEnabled, CTX_SRVLOG);
        RegisterIterator("SERVCFG:LOGENABLE", 0, NULL, iterate_GetSrvLogEnable, NULL, DeleteHash, CTX_SRVLOG, CTX_NONE, IT_NOFLAG);
        RegisterNamespace("SERVCFG:LOGNAME", 0, 1, tmplput_servcfg_LogName, NULL, CTX_SRVLOG);
 }
index 2004bad..9013567 100644 (file)
@@ -427,7 +427,7 @@ InitModule_SMTP_QUEUE
        RegisterNamespace("MAILQ:SUBMITTED", 0, 0, tmplput_MailQSubmitted, NULL, CTX_MAILQITEM);
        RegisterNamespace("MAILQ:ENVELOPEFROM", 0, 1, tmplput_MailQEnvelopeFrom, NULL, CTX_MAILQITEM);
        RegisterNamespace("MAILQ:SRCROOM", 0, 1, tmplput_MailQSourceRoom, NULL, CTX_MAILQITEM);
-       RegisterConditional(HKEY("COND:MAILQ:HAVESRCROOM"), 0, Conditional_MailQ_HaveSourceRoom,  CTX_MAILQITEM);
+       RegisterConditional("COND:MAILQ:HAVESRCROOM", 0, Conditional_MailQ_HaveSourceRoom,  CTX_MAILQITEM);
        RegisterNamespace("MAILQ:RETRY", 0, 0, tmplput_MailQRetry, NULL, CTX_MAILQITEM);
 
        RegisterNamespace("MAILQ:RCPT:ADDR", 0, 1, tmplput_MailQRCPT, NULL, CTX_MAILQ_RCPT);
index 1370ca5..e9955a0 100644 (file)
@@ -71,8 +71,13 @@ typedef struct _HashHandler {
        WCHandlerFunc HandlerFunc;
 }HashHandler;
 
+typedef enum _estate {
+       eNext,
+       eSkipTilEnd
+} TemplState;
+
 void *load_template(StrBuf *Target, WCTemplate *NewTemplate);
-int EvaluateConditional(StrBuf *Target, int Neg, int state, WCTemplputParams *TP);
+int EvaluateConditional(StrBuf *Target, int Neg, int state, WCTemplputParams **TPP);
 
 
 
@@ -143,12 +148,14 @@ const char *ContextName(CtxType ContextType)
                return UnknownContext;
 }
 
-void StackContext(WCTemplputParams *Super, 
-                 WCTemplputParams *Sub, 
-                 void *Context,
-                 CtxType ContextType,
-                 int nArgs,
-                 WCTemplateToken *Tokens)
+void StackDynamicContext(WCTemplputParams *Super, 
+                        WCTemplputParams *Sub, 
+                        void *Context,
+                        CtxType ContextType,
+                        int nArgs,
+                        WCTemplateToken *Tokens, 
+                        WCConditionalFunc ExitCtx, 
+                        long ExitCTXID)
 {
        memset(Sub, 0, sizeof(WCTemplputParams));
 
@@ -162,6 +169,8 @@ void StackContext(WCTemplputParams *Super,
        Sub->Filter.ContextType = ContextType;
        Sub->nArgs = nArgs;
        Sub->Tokens = Tokens;
+       Sub->ExitCtx = ExitCtx;
+       Sub->ExitCTXID = ExitCTXID;
 }
 
 void UnStackContext(WCTemplputParams *Sub)
@@ -171,6 +180,13 @@ void UnStackContext(WCTemplputParams *Sub)
                Sub->Super->Sub = Sub->Sub;
        }
 }
+void UnStackDynamicContext(StrBuf *Target, WCTemplputParams **TPP)
+{
+       WCTemplputParams *TP = *TPP;
+       WCTemplputParams *Super = TP->Super;
+       TP->ExitCtx(Target, TP);
+       *TPP = Super;
+}
 
 void *GetContextPayload(WCTemplputParams *TP, CtxType ContextType)
 {
@@ -1681,12 +1697,13 @@ void InitTemplateCache(void)
  * \param state are we in conditional state?
  * \param ContextType what type of information does context giv us?
  */
-int EvaluateToken(StrBuf *Target, int state, WCTemplputParams *TP)
+int EvaluateToken(StrBuf *Target, int state, WCTemplputParams **TPP)
 {
        const char *AppendMe;
        long AppendMeLen;
        HashHandler *Handler;
        void *vVar;
+       WCTemplputParams *TP = *TPP;
        
 /* much output, since pName is not terminated...
        syslog(1,"Doing token: %s\n",Token->pName);
@@ -1701,14 +1718,14 @@ int EvaluateToken(StrBuf *Target, int state, WCTemplputParams *TP)
                if (!CheckContext(Target, &Handler->Filter, TP, "Conditional")) {
                        return -1;
                }
-               return EvaluateConditional(Target, 1, state, TP);
+               return EvaluateConditional(Target, 1, state, TPP);
                break;
        case SV_NEG_CONDITIONAL: /** Reverse conditional evaluation */
                Handler = (HashHandler*) TP->Tokens->PreEval;
                if (!CheckContext(Target, &Handler->Filter, TP, "Conditional")) {
                        return -1;
                }
-               return EvaluateConditional(Target, 0, state, TP);
+               return EvaluateConditional(Target, 0, state, TPP);
                break;
        case SV_CUST_STR_CONDITIONAL: /** Conditional put custom strings from params */
                Handler = (HashHandler*) TP->Tokens->PreEval;
@@ -1716,7 +1733,7 @@ int EvaluateToken(StrBuf *Target, int state, WCTemplputParams *TP)
                        return -1;
                }
                if (TP->Tokens->nParameters >= 6) {
-                       if (EvaluateConditional(Target, 0, state, TP)) {
+                       if (EvaluateConditional(Target, 0, state, TPP)) {
                                GetTemplateTokenString(Target, TP, 5, &AppendMe, &AppendMeLen);
                                StrBufAppendBufPlain(Target, 
                                                     AppendMe, 
@@ -1730,6 +1747,10 @@ int EvaluateToken(StrBuf *Target, int state, WCTemplputParams *TP)
                                                     AppendMeLen,
                                                     0);
                        }
+                       if (*TPP != TP)
+                       {
+                               UnStackDynamicContext(Target, TPP);
+                       }
                }
                else  {
                        LogTemplateError(
@@ -1773,10 +1794,12 @@ const StrBuf *ProcessTemplate(WCTemplate *Tmpl, StrBuf *Target, WCTemplputParams
 {
        WCTemplate *pTmpl = Tmpl;
        int done = 0;
-       int i, state;
+       int i;
+       TemplState state;
        const char *pData, *pS;
        long len;
        WCTemplputParams TP;
+       WCTemplputParams *TPtr = &TP;
 
        memcpy(&TP.Filter, &CallingTP->Filter, sizeof(ContextFilter));
 
@@ -1803,7 +1826,7 @@ const StrBuf *ProcessTemplate(WCTemplate *Tmpl, StrBuf *Target, WCTemplputParams
        pS = pData = ChrPtr(pTmpl->Data);
        len = StrLength(pTmpl->Data);
        i = 0;
-       state = 0;
+       state = eNext;
        while (!done) {
                if (i >= pTmpl->nTokensUsed) {
                        StrBufAppendBufPlain(Target, 
@@ -1812,26 +1835,38 @@ const StrBuf *ProcessTemplate(WCTemplate *Tmpl, StrBuf *Target, WCTemplputParams
                        done = 1;
                }
                else {
+                       int TokenRc;
+
                        StrBufAppendBufPlain(
                                Target, pData, 
                                pTmpl->Tokens[i]->pTokenStart - pData, 0);
-                       TP.Tokens = pTmpl->Tokens[i];
-                       TP.nArgs = pTmpl->Tokens[i]->nParameters;
-                       state = EvaluateToken(Target, state, &TP);
+                       TPtr->Tokens = pTmpl->Tokens[i];
+                       TPtr->nArgs = pTmpl->Tokens[i]->nParameters;
+
+                       TokenRc = EvaluateToken(Target, TokenRc, &TPtr);
+                       if (TokenRc != 0) state = eSkipTilEnd;
 
-                       while ((state != 0) && (i+1 < pTmpl->nTokensUsed)) {
+                       while ((state != eNext) && (i+1 < pTmpl->nTokensUsed)) {
                        /* condition told us to skip till its end condition */
                                i++;
-                               TP.Tokens = pTmpl->Tokens[i];
-                               TP.nArgs = pTmpl->Tokens[i]->nParameters;
+                               TPtr->Tokens = pTmpl->Tokens[i];
+                               TPtr->nArgs = pTmpl->Tokens[i]->nParameters;
                                if ((pTmpl->Tokens[i]->Flags == SV_CONDITIONAL) ||
-                                   (pTmpl->Tokens[i]->Flags == SV_NEG_CONDITIONAL)) {
-                                       if (state == EvaluateConditional(
-                                                   Target, 
-                                                   pTmpl->Tokens[i]->Flags, 
-                                                   state, 
-                                                   &TP))
-                                               state = 0;
+                                   (pTmpl->Tokens[i]->Flags == SV_NEG_CONDITIONAL))
+                               {
+                                       int rc;
+                                       rc = EvaluateConditional(
+                                               Target, 
+                                               pTmpl->Tokens[i]->Flags, 
+                                               TokenRc, 
+                                               &TPtr);
+                                       if (rc == TokenRc)
+                                       {
+                                               TokenRc = 0;
+                                               state = eNext;
+                                               if (TPtr != &TP)
+                                                       UnStackDynamicContext(Target, &TPtr);
+                                       }
                                }
                        }
                        pData = pTmpl->Tokens[i++]->pTokenEnd + 1;
@@ -2175,15 +2210,18 @@ int conditional_ITERATE_LASTN(StrBuf *Target, WCTemplputParams *TP)
 /*-----------------------------------------------------------------------------
  *                      Conditionals
  */
-int EvaluateConditional(StrBuf *Target, int Neg, int state, WCTemplputParams *TP)
+int EvaluateConditional(StrBuf *Target, int Neg, int state, WCTemplputParams **TPP)
 {
        ConditionalStruct *Cond;
        int rc = 0;
        int res;
+       WCTemplputParams *TP = *TPP;
 
        if ((TP->Tokens->Params[0]->len == 1) &&
            (TP->Tokens->Params[0]->Start[0] == 'X'))
+       {
                return (state != 0)?TP->Tokens->Params[1]->lvalue:0;
+       }
            
        Cond = (ConditionalStruct *) TP->Tokens->PreEval;
        if (Cond == NULL) {
@@ -2204,13 +2242,19 @@ int EvaluateConditional(StrBuf *Target, int Neg, int state, WCTemplputParams *TP
                syslog(1, "<%s> : %d %d==%d\n", 
                        ChrPtr(TP->Tokens->FlatToken), 
                        rc, res, Neg);
+       if (TP->Sub != NULL)
+       {
+////   *XC = Cond->CondExitCtx;
+               *TPP = TP->Sub;
+       }
        return rc;
 }
 
-void RegisterConditional(const char *Name, long len, 
-                        int nParams,
-                        WCConditionalFunc CondF, 
-                        int ContextRequired)
+void RegisterContextConditional(const char *Name, long len, 
+                               int nParams,
+                               WCConditionalFunc CondF, 
+                               WCConditionalFunc ExitCtxCond,
+                               int ContextRequired)
 {
        ConditionalStruct *Cond;
 
@@ -2220,6 +2264,7 @@ void RegisterConditional(const char *Name, long len,
        Cond->Filter.nMaxArgs = nParams;
        Cond->Filter.nMinArgs = nParams;
        Cond->CondF = CondF;
+       Cond->CondExitCtx = ExitCtxCond;
        Cond->Filter.ContextType = ContextRequired;
        Put(Conditionals, Name, len, Cond, NULL);
 }
@@ -2878,18 +2923,18 @@ InitModule_SUBST
        RegisterNamespace("LONGVECTOR", 1, 1, tmplput_long_vector, NULL, CTX_LONGVECTOR);
 
 
-       RegisterConditional(HKEY("COND:CONTEXTSTR"), 3, ConditionalContextStr, CTX_STRBUF);
-       RegisterConditional(HKEY("COND:CONTEXTSTRARR"), 4, ConditionalContextStrinArray, CTX_STRBUFARR);
-       RegisterConditional(HKEY("COND:LONGVECTOR"), 4, ConditionalLongVector, CTX_LONGVECTOR);
+       RegisterConditional("COND:CONTEXTSTR", 3, ConditionalContextStr, CTX_STRBUF);
+       RegisterConditional("COND:CONTEXTSTRARR", 4, ConditionalContextStrinArray, CTX_STRBUFARR);
+       RegisterConditional("COND:LONGVECTOR", 4, ConditionalLongVector, CTX_LONGVECTOR);
 
 
-       RegisterConditional(HKEY("COND:ITERATE:ISGROUPCHANGE"), 2, 
+       RegisterConditional("COND:ITERATE:ISGROUPCHANGE", 2, 
                            conditional_ITERATE_ISGROUPCHANGE, 
                            CTX_ITERATE);
-       RegisterConditional(HKEY("COND:ITERATE:LASTN"), 2, 
+       RegisterConditional("COND:ITERATE:LASTN", 2, 
                            conditional_ITERATE_LASTN, 
                            CTX_ITERATE);
-       RegisterConditional(HKEY("COND:ITERATE:FIRSTN"), 2, 
+       RegisterConditional("COND:ITERATE:FIRSTN", 2, 
                            conditional_ITERATE_FIRSTN, 
                            CTX_ITERATE);
 
index 86b76d6..30c3a6b 100644 (file)
@@ -153,6 +153,8 @@ struct WCTemplputParams {
        int nArgs;
        WCTemplateToken *Tokens;
        WCTemplputParams *Sub, *Super;
+       WCConditionalFunc ExitCtx;
+        long ExitCTXID;
 };
 
 
@@ -161,6 +163,7 @@ typedef struct _ConditionalStruct {
        ContextFilter Filter;
        const char *PlainName;
        WCConditionalFunc CondF;
+       WCConditionalFunc CondExitCtx;
 } ConditionalStruct;
 
 
@@ -302,12 +305,21 @@ void RegisterNS(const char *NSName, long len,
  * @param len the token length so we don't have to measure it.
  * @param nParams how many parameters does your conditional need on top of the default conditional parameters
  * @param CondF your Callback to be called when the template is evaluated at runtime; return 0 or 1 to us please.
+ * @param ExitCtxCond if non-NULL, will be called after the area of the conditional is left behind.
  * @param ContextRequired if your token requires a specific context, else say CTX_NONE here.
  */
-void RegisterConditional(const char *Name, long len, 
-                        int nParams,
-                        WCConditionalFunc CondF, 
-                        int ContextRequired);
+void RegisterContextConditional(const char *Name, long len, 
+                               int nParams,
+                               WCConditionalFunc CondF, 
+                               WCConditionalFunc ExitCtxCond,
+                               int ContextRequired);
+
+#define RegisterCtxConditional(Name, nParams, CondF, ExitCtxCond, ContextRequired) \
+       RegisterContextConditional(Name, sizeof(Name) -1, nParams, CondF, ExitCtxCond, ContextRequired)
+
+#define RegisterConditional(Name, nParams, CondF, ContextRequired) \
+       RegisterContextConditional(Name, sizeof(Name) -1, nParams, CondF, NULL, ContextRequired)
+
 
 /**
  * @ingroup subst
@@ -353,12 +365,18 @@ void RegisterITERATOR(const char *Name, long len, /* Our identifier */
 
 
 
-void StackContext(WCTemplputParams *Super, 
-                 WCTemplputParams *Sub, 
-                 void *Context,
-                 CtxType ContextType,
-                 int nArgs,
-                 WCTemplateToken *Tokens);
+void StackDynamicContext(WCTemplputParams *Super, 
+                        WCTemplputParams *Sub, 
+                        void *Context,
+                        CtxType ContextType,
+                        int nArgs,
+                        WCTemplateToken *Tokens, 
+                        WCConditionalFunc ExitCtx,
+                        long ExitCTXID);
+
+#define StackContext(Super, Sub, Context, ContextType, nArgs, Tokens) \
+       StackDynamicContext(Super, Sub, Context, ContextType, nArgs, Tokens, NULL, 0)
+
 
 void UnStackContext(WCTemplputParams *Sub);
 
index 9e70f81..a6041d7 100644 (file)
@@ -827,12 +827,12 @@ InitModule_USEREDIT
 
        RegisterNamespace("USER:BIO", 1, 2, tmplput_USER_BIO,  NULL, CTX_NONE);
 
-       RegisterConditional(HKEY("COND:USERNAME"),  0,    ConditionalUser, CTX_USERLIST);
-       RegisterConditional(HKEY("COND:USERACCESS"), 0,   ConditionalUserAccess, CTX_USERLIST);
-       RegisterConditional(HKEY("COND:USERLIST:FLAG:USE_INTERNET"), 0, ConditionalFlagINetEmail, CTX_USERLIST);
-       RegisterConditional(HKEY("COND:USERLIST:HAVEBIO"), 0, ConditionalHaveBIO, CTX_USERLIST);
+       RegisterConditional("COND:USERNAME",  0,    ConditionalUser, CTX_USERLIST);
+       RegisterConditional("COND:USERACCESS", 0,   ConditionalUserAccess, CTX_USERLIST);
+       RegisterConditional("COND:USERLIST:FLAG:USE_INTERNET", 0, ConditionalFlagINetEmail, CTX_USERLIST);
+       RegisterConditional("COND:USERLIST:HAVEBIO", 0, ConditionalHaveBIO, CTX_USERLIST);
 
-       RegisterConditional(HKEY("COND:USER:PIC"), 1, Conditional_USER_HAS_PIC,  CTX_NONE);
+       RegisterConditional("COND:USER:PIC", 1, Conditional_USER_HAS_PIC,  CTX_NONE);
 
        RegisterIterator("USERLIST", 0, NULL, iterate_load_userlist, NULL, DeleteHash, CTX_USERLIST, CTX_NONE, IT_FLAG_DETECT_GROUPCHANGE);
        
index 9ec539d..78d08f1 100644 (file)
@@ -906,9 +906,9 @@ InitModule_WEBCIT
        WebcitAddUrlHandler(HKEY("pop"), "", 0, pop_destination, 0);
 
        WebcitAddUrlHandler(HKEY("401"), "", 0, authorization_required, ANONYMOUS|COOKIEUNNEEDED);
-       RegisterConditional(HKEY("COND:IMPMSG"), 0, ConditionalImportantMesage, CTX_NONE);
-       RegisterConditional(HKEY("COND:REST:DEPTH"), 0, Conditional_REST_DEPTH, CTX_NONE);
-       RegisterConditional(HKEY("COND:IS_HTTPS"), 0, Conditional_IS_HTTPS, CTX_NONE);
+       RegisterConditional("COND:IMPMSG", 0, ConditionalImportantMesage, CTX_NONE);
+       RegisterConditional("COND:REST:DEPTH", 0, Conditional_REST_DEPTH, CTX_NONE);
+       RegisterConditional("COND:IS_HTTPS", 0, Conditional_IS_HTTPS, CTX_NONE);
 
        RegisterNamespace("CSSLOCAL", 0, 0, tmplput_csslocal, NULL, CTX_NONE);
        RegisterNamespace("IMPORTANTMESSAGE", 0, 0, tmplput_importantmessage, NULL, CTX_NONE);
index 2b30278..be61bbb 100644 (file)
@@ -260,11 +260,16 @@ typedef struct _disp_cal {
        icalproperty_status Status;
 } disp_cal;                                            
 
-typedef struct _IcalEnumMap {
+typedef struct _IcalKindEnumMap {
        const char *Name;
        long NameLen;
        icalproperty_kind map;
-} IcalEnumMap;
+} IcalKindEnumMap;
+typedef struct _IcalMethodEnumMap {
+       const char *Name;
+       long NameLen;
+        icalproperty_method map;
+} IcalMethodEnumMap;
 
 /*
  * Address book entry (keep it short and sweet, it's just a quickie lookup
index 1560011..cb886b9 100644 (file)
@@ -328,9 +328,9 @@ InitModule_WHO
        RegisterNamespace("WHO:NSESSIONS",   0, 1, tmplput_who_nsessions, NULL, CTX_WHO);
        RegisterNamespace("WHO:NSESSIONS",   0, 1, tmplput_who_nsessions, NULL, CTX_WHO);
 
-       RegisterConditional(HKEY("WHO:IDLE"),      1, conditional_who_idle, CTX_WHO);
-       RegisterConditional(HKEY("WHO:NSESSIONS"), 1, conditional_who_nsessions, CTX_WHO);
-       RegisterConditional(HKEY("WHO:ISME"),      1, conditional_who_isme, CTX_WHO);
-       RegisterConditional(HKEY("WHO:REALROOM"),  1, conditional_who_realroom, CTX_WHO);
-       RegisterConditional(HKEY("WHO:REALHOST"),  1, conditional_who_realhost, CTX_WHO);
+       RegisterConditional("WHO:IDLE",      1, conditional_who_idle, CTX_WHO);
+       RegisterConditional("WHO:NSESSIONS", 1, conditional_who_nsessions, CTX_WHO);
+       RegisterConditional("WHO:ISME",      1, conditional_who_isme, CTX_WHO);
+       RegisterConditional("WHO:REALROOM",  1, conditional_who_realroom, CTX_WHO);
+       RegisterConditional("WHO:REALHOST",  1, conditional_who_realhost, CTX_WHO);
 }
index 47af67e..c4a4ac7 100644 (file)
@@ -352,6 +352,6 @@ InitModule_WIKI
        WebcitAddUrlHandler(HKEY("wiki_pagelist"), "", 0, display_wiki_pagelist, 0);
        RegisterNamespace("WIKI:DISPLAYHISTORY", 0, 0, tmplput_display_wiki_history, NULL, CTX_NONE);
        RegisterNamespace("WIKI:DISPLAYPAGELIST", 0, 0, tmplput_display_wiki_pagelist, NULL, CTX_NONE);
-       RegisterConditional(HKEY("COND:WIKI:PAGE"), 1, ConditionalHaveWikiPage, CTX_NONE);
-       RegisterConditional(HKEY("COND:WIKI:TYPE"), 1, ConditionalHavewikiType, CTX_NONE);
+       RegisterConditional("COND:WIKI:PAGE", 1, ConditionalHaveWikiPage, CTX_NONE);
+       RegisterConditional("COND:WIKI:TYPE", 1, ConditionalHavewikiType, CTX_NONE);
 }