You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by mx...@apache.org on 2012/05/20 19:11:01 UTC
svn commit: r1340770 - in /tcl/rivet/branches/2.0: ./ doc/ doc/xml/
rivet/packages/entities/ rivet/packages/form/ rivet/packages/session/
rivet/rivet-tcl/ src/apache-2/ tclconfig/
Author: mxmanghi
Date: Sun May 20 17:11:00 2012
New Revision: 1340770
URL: http://svn.apache.org/viewvc?rev=1340770&view=rev
Log:
preparing release of Rivet 2.0.5
* rivet/rivet-tcl/{parray_table.tcl,http_accept.tcl}: new commands for printing arrays in HTML tables and
parsing of Accept HTTP header lines
* rivet/packages/entities/entities.tcl: backport from trunk of package RivetEntities
* doc/xml/entities.xml: page manual for package RivetEntities
* doc/xml/commands.xml: new manual page for http_accept
* src/apache-2/mod_rivet.c: if RIVET_DISPLAY_VERSION is defined then the symbol RIVET_SERVER is
stored in the 'server' array
* configure.ac,VERSION: Rivet version is now 2.0.5
* tclconfig/ltmain.sh: updated from recent autotools installation
Added:
tcl/rivet/branches/2.0/doc/xml/entities.xml
tcl/rivet/branches/2.0/rivet/packages/entities/
tcl/rivet/branches/2.0/rivet/packages/entities/entities.tcl (with props)
tcl/rivet/branches/2.0/rivet/rivet-tcl/http_accept.tcl (with props)
tcl/rivet/branches/2.0/rivet/rivet-tcl/parray_table.tcl (with props)
Modified:
tcl/rivet/branches/2.0/ChangeLog
tcl/rivet/branches/2.0/Makefile.in
tcl/rivet/branches/2.0/VERSION
tcl/rivet/branches/2.0/configure.ac
tcl/rivet/branches/2.0/doc/rivet.xml
tcl/rivet/branches/2.0/doc/xml/commands.xml
tcl/rivet/branches/2.0/rivet/packages/form/form.tcl (contents, props changed)
tcl/rivet/branches/2.0/rivet/packages/session/session-create-mysql.sql
tcl/rivet/branches/2.0/rivet/rivet-tcl/tclIndex
tcl/rivet/branches/2.0/src/apache-2/mod_rivet.c
tcl/rivet/branches/2.0/tclconfig/ltmain.sh
Modified: tcl/rivet/branches/2.0/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/ChangeLog?rev=1340770&r1=1340769&r2=1340770&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/ChangeLog (original)
+++ tcl/rivet/branches/2.0/ChangeLog Sun May 20 17:11:00 2012
@@ -1,3 +1,14 @@
+2012-05-20 Massimo Manghi <mx...@apache.org>
+ * rivet/rivet-tcl/{parray_table.tcl,http_accept.tcl}: new commands for printing arrays in HTML tables and
+ parsing of Accept HTTP header lines
+ * rivet/packages/entities/entities.tcl: backport from trunk of package RivetEntities
+ * doc/xml/entities.xml: page manual for package RivetEntities
+ * doc/xml/commands.xml: new manual page for http_accept
+ * src/apache-2/mod_rivet.c: if RIVET_DISPLAY_VERSION is defined then the symbol RIVET_SERVER is
+ stored in the 'server' array
+ * configure.ac,VERSION: Rivet version is now 2.0.5
+ * tclconfig/ltmain.sh: updated from recent autotools installation
+
2012-05-17 Massimo Manghi <mx...@apache.org>
* rivet/packages/dio/dio.tcl: fixed SQL syntax that would break compatibility with Oracle (Fixes reopened
bug #53222)
Modified: tcl/rivet/branches/2.0/Makefile.in
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/Makefile.in?rev=1340770&r1=1340769&r2=1340770&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/Makefile.in (original)
+++ tcl/rivet/branches/2.0/Makefile.in Sun May 20 17:11:00 2012
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -85,9 +85,11 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCE
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
- { test ! -d "$(distdir)" \
- || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -fr "$(distdir)"; }; }
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -116,6 +118,8 @@ am__relativize = \
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -308,7 +312,7 @@ all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
-am--refresh:
+am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
@@ -344,10 +348,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
config.h: stamp-h1
- @if test ! -f $@; then \
- rm -f stamp-h1; \
- $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
- else :; fi
+ @if test ! -f $@; then rm -f stamp-h1; else :; fi
+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
@@ -576,7 +578,11 @@ dist-gzip: distdir
$(am__remove_distdir)
dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__remove_distdir)
dist-lzma: distdir
@@ -584,7 +590,7 @@ dist-lzma: distdir
$(am__remove_distdir)
dist-xz: distdir
- tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__remove_distdir)
dist-tarZ: distdir
@@ -615,6 +621,8 @@ distcheck: dist
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
@@ -634,6 +642,7 @@ distcheck: dist
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -662,8 +671,16 @@ distcheck: dist
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
- @$(am__cd) '$(distuninstallcheck_dir)' \
- && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
@@ -694,10 +711,15 @@ install-am: all-am
installcheck: installcheck-recursive
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
mostlyclean-generic:
clean-generic:
@@ -786,8 +808,8 @@ uninstall-am: uninstall-local
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
- dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
- distcheck distclean distclean-generic distclean-hdr \
+ dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \
+ dist-zip distcheck distclean distclean-generic distclean-hdr \
distclean-libtool distclean-local distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
Modified: tcl/rivet/branches/2.0/VERSION
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/VERSION?rev=1340770&r1=1340769&r2=1340770&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/VERSION (original)
+++ tcl/rivet/branches/2.0/VERSION Sun May 20 17:11:00 2012
@@ -1 +1 @@
-2.0.4
+2.0.5
Modified: tcl/rivet/branches/2.0/configure.ac
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/configure.ac?rev=1340770&r1=1340769&r2=1340770&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/configure.ac (original)
+++ tcl/rivet/branches/2.0/configure.ac Sun May 20 17:11:00 2012
@@ -22,7 +22,7 @@ dnl
# so you can encode the package version directly into the source files.
#-----------------------------------------------------------------------
-AC_INIT([Rivet],[2.0.4])
+AC_INIT([Rivet],[2.0.5])
TEA_INIT([3.9])
AC_CONFIG_AUX_DIR(tclconfig)
Modified: tcl/rivet/branches/2.0/doc/rivet.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/doc/rivet.xml?rev=1340770&r1=1340769&r2=1340770&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/doc/rivet.xml (original)
+++ tcl/rivet/branches/2.0/doc/rivet.xml Sun May 20 17:11:00 2012
@@ -9,7 +9,7 @@
<!ENTITY upload.html SYSTEM "examples/upload.html" >
<!ENTITY upload.rvt SYSTEM "examples/upload.rvt" >
<!ENTITY download.tcl SYSTEM "examples/download.tcl" >
- <!ENTITY rivet_web_service.tcl SYSTEM "examples/rivet_web_service.tcl" >
+ <!ENTITY rivet_web_service.tcl SYSTEM "examples/rivet_web_service.tcl" >
<!ENTITY intro.xml SYSTEM "xml/intro.xml" >
<!ENTITY install.xml SYSTEM "xml/install.xml" >
<!ENTITY directives.xml SYSTEM "xml/directives.xml" >
@@ -24,6 +24,7 @@
<!ENTITY help.xml SYSTEM "xml/help.xml" >
<!ENTITY internals.xml SYSTEM "xml/internals.xml" >
<!ENTITY upgrade.xml SYSTEM "xml/upgrade.xml" >
+ <!ENTITY entities.xml SYSTEM "xml/entities.xml" >
]>
<!--
@@ -114,6 +115,9 @@
<!-- Calendar -->
&calendar.xml;
+ <!-- Entities -->
+ &entities.xml;
+
<!-- Help -->
&help.xml;
Modified: tcl/rivet/branches/2.0/doc/xml/commands.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/doc/xml/commands.xml?rev=1340770&r1=1340769&r2=1340770&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/doc/xml/commands.xml (original)
+++ tcl/rivet/branches/2.0/doc/xml/commands.xml Sun May 20 17:11:00 2012
@@ -597,6 +597,63 @@
</refsect1>
</refentry>
+<refentry id="http_accept">
+ <refnamediv>
+ <refname>http_accept</refname>
+ <refpurpose>Parse HTTP Accept header lines</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>http_accept
+ <arg><replaceable>-zeroweight</replaceable></arg>
+ <arg><replaceable>-default</replaceable></arg>
+ <arg><replaceable>-list</replaceable></arg>
+ http_accept_line</command>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+ <para>
+ Command for parsing HTTP Accept header lines that tell the
+ server about preferences and/or capabilities of the browser
+ (e.g. content language,media type, etc.). The following
+ script
+ </para>
+ <para>
+ <command>http_accept</command> returns a dictionary
+ value in which every content preference is matched to its
+ precedence value
+ </para>
+ <programlisting>load_headers
+set language_precedence [http_accept $headers(Accept-Language)]
+foreach lan [dict keys $language_precedence] {
+ puts "$lan -> [dict get $language_precedence $lan]"
+}</programlisting>
+ <para>
+ when run from a browser where 5 languages were chosen
+ would output
+ </para>
+ <programlisting>en-us -> 1
+en -> 0.8
+it -> 0.6
+de-de -> 0.4
+fr-fr -> 0.2</programlisting>
+ <para>
+ The <replaceable>-list</replaceable> switch would suppress
+ the precedence values and the accepted fields
+ are returned listed with decreasing precedence order.
+ </para>
+ <programlisting> puts [http_accept -list $headers(Accept-Language)]
+text/html application/xhtml+xml application/xml */*
+ </programlisting>
+ <para>
+
+ </para>
+ </refsect1>
+
+ </refentry>
+
<refentry id="html">
<refnamediv>
<refname>html</refname>
Added: tcl/rivet/branches/2.0/doc/xml/entities.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/doc/xml/entities.xml?rev=1340770&view=auto
==============================================================================
--- tcl/rivet/branches/2.0/doc/xml/entities.xml (added)
+++ tcl/rivet/branches/2.0/doc/xml/entities.xml Sun May 20 17:11:00 2012
@@ -0,0 +1,70 @@
+<section id="entities">
+ <title>RivetEntities</title>
+ <section>
+ <title>Introduction</title>
+ <para>
+ The <command>RivetEntities</command> package was kindly provided by Harald Oehlmann and
+ is largely taken from a simple yet clever encoder/decoder of HTML entities
+ starting from a utf-8 character string. The original code writted by Andy Goth is
+ at http://wiki.tcl.tk/26403. Package entities extends the functionality in the
+ original code combining it with Tcl's 'encoding' command to encode/decode from
+ any supported encoding
+ </para>
+
+ </section>
+ <refentry id="encode">
+ <refnamediv>
+ <refname>encode</refname>
+ <refpurpose>
+ encode a string replacing every occurrence of characters for
+ which an SGML entity exists
+ </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::encode</command>
+ <arg choice="plain">string</arg>
+ <arg><option>-encoding <replaceable><encoding></replaceable></option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <command>::rivet::encode</command> returns a copy of the input string
+ after replacing every occurence of characters for which an SGML entity
+ exists. By default the command assumes the string is encoded in UTF-8,
+ other encodings are supported by passing the
+ <command>-encoding <encoding></command> argument. The list of
+ available encodings is returned by command
+ </para>
+ <programlisting>encoding names</programlisting>
+ </refsect1>
+ </refentry>
+ <refentry id="decode">
+ <refnamediv>
+ <refname>decode</refname>
+ <refpurpose>
+ decode an SGML encoded string replacing every entity with the
+ corresponding character
+ </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::decode</command>
+ <arg choice="plain">string</arg>
+ <arg><option>-encoding <replaceable><encoding></replaceable></option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <command>::rivet::decode</command> implements the inverse function of
+ <command>::rivet::encode</command>. The input string is scanned searching
+ and replacing every SGML entity with its corresponding character.
+ By default the command assumes the output string has to be encoded in UTF-8.
+ Other encodings are supported by passing the
+ <command>-encoding <encoding></command> argument.
+ </para>
+ </refsect1>
+ </refentry>
+</section>
Added: tcl/rivet/branches/2.0/rivet/packages/entities/entities.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/rivet/packages/entities/entities.tcl?rev=1340770&view=auto
==============================================================================
--- tcl/rivet/branches/2.0/rivet/packages/entities/entities.tcl (added)
+++ tcl/rivet/branches/2.0/rivet/packages/entities/entities.tcl Sun May 20 17:11:00 2012
@@ -0,0 +1,152 @@
+# -- package RivetEntities
+#
+# The code is largely taken from a simple yet clever encoder/decoder of HTML entities
+# starting from a utf-8 character string. The original code writted by Andy Goth is
+# at http://wiki.tcl.tk/26403. Package entities extends the functionality in the
+# original code combining it with Tcl's 'encoding' command to encode/decode from
+# any supported encoding
+#
+# $Id$
+
+package provide RivetEntities 1.0
+
+namespace eval ::rivet {
+# namespace ensemble create -subcommands {encode decode}
+ namespace export encode decode
+ variable utf8_entities_map {
+ \u00a0  \; \u00a1 ¡\; \u00a2 ¢\; \u00a3 £\; \u00a4
+ ¤\; \u00a5 ¥\; \u00a6 ¦\; \u00a7 §\; \u00a8 ¨\;
+ \u00a9 ©\; \u00aa ª\; \u00ab «\; \u00ac ¬\; \u00ad
+ ­\; \u00ae ®\; \u00af ¯\; \u00b0 °\; \u00b1 ±\;
+ \u00b2 ²\; \u00b3 ³\; \u00b4 ´\; \u00b5 µ\; \u00b6
+ ¶\; \u00b7 ·\; \u00b8 ¸\; \u00b9 ¹\; \u00ba º\;
+ \u00bb »\; \u00bc ¼\; \u00bd ½\; \u00be ¾\;
+ \u00bf ¿\; \u00c0 À\; \u00c1 Á\; \u00c2 Â\;
+ \u00c3 Ã\; \u00c4 Ä\; \u00c5 Å\; \u00c6 Æ\; \u00c7
+ Ç\; \u00c8 È\; \u00c9 É\; \u00ca Ê\; \u00cb
+ Ë\; \u00cc Ì\; \u00cd Í\; \u00ce Î\; \u00cf
+ Ï\; \u00d0 Ð\; \u00d1 Ñ\; \u00d2 Ò\; \u00d3
+ Ó\; \u00d4 Ô\; \u00d5 Õ\; \u00d6 Ö\; \u00d7
+ ×\; \u00d8 Ø\; \u00d9 Ù\; \u00da Ú\; \u00db
+ Û\; \u00dc Ü\; \u00dd Ý\; \u00de Þ\; \u00df
+ ß\; \u00e0 à\; \u00e1 á\; \u00e2 â\; \u00e3
+ ã\; \u00e4 ä\; \u00e5 å\; \u00e6 æ\; \u00e7
+ ç\; \u00e8 è\; \u00e9 é\; \u00ea ê\; \u00eb
+ ë\; \u00ec ì\; \u00ed í\; \u00ee î\; \u00ef
+ ï\; \u00f0 ð\; \u00f1 ñ\; \u00f2 ò\; \u00f3
+ ó\; \u00f4 ô\; \u00f5 õ\; \u00f6 ö\; \u00f7
+ ÷\; \u00f8 ø\; \u00f9 ù\; \u00fa ú\; \u00fb
+ û\; \u00fc ü\; \u00fd ý\; \u00fe þ\; \u00ff ÿ\;
+ \u0192 &fnof\; \u0391 &Alpha\; \u0392 &Beta\; \u0393 &Gamma\; \u0394
+ &Delta\; \u0395 &Epsilon\; \u0396 &Zeta\; \u0397 &Eta\; \u0398 &Theta\;
+ \u0399 &Iota\; \u039a &Kappa\; \u039b &Lambda\; \u039c &Mu\; \u039d
+ &Nu\; \u039e &Xi\; \u039f &Omicron\; \u03a0 &Pi\; \u03a1 &Rho\; \u03a3
+ &Sigma\; \u03a4 &Tau\; \u03a5 &Upsilon\; \u03a6 &Phi\; \u03a7 &Chi\;
+ \u03a8 &Psi\; \u03a9 &Omega\; \u03b1 &alpha\; \u03b2 &beta\; \u03b3
+ &gamma\; \u03b4 &delta\; \u03b5 &epsilon\; \u03b6 &zeta\; \u03b7 &eta\;
+ \u03b8 &theta\; \u03b9 &iota\; \u03ba &kappa\; \u03bb &lambda\; \u03bc
+ &mu\; \u03bd &nu\; \u03be &xi\; \u03bf &omicron\; \u03c0 &pi\; \u03c1
+ &rho\; \u03c2 &sigmaf\; \u03c3 &sigma\; \u03c4 &tau\; \u03c5 &upsilon\;
+ \u03c6 &phi\; \u03c7 &chi\; \u03c8 &psi\; \u03c9 &omega\; \u03d1
+ &thetasym\; \u03d2 &upsih\; \u03d6 &piv\; \u2022 &bull\; \u2026
+ &hellip\; \u2032 &prime\; \u2033 &Prime\; \u203e &oline\; \u2044
+ &frasl\; \u2118 &weierp\; \u2111 &image\; \u211c &real\; \u2122
+ &trade\; \u2135 &alefsym\; \u2190 &larr\; \u2191 &uarr\; \u2192 &rarr\;
+ \u2193 &darr\; \u2194 &harr\; \u21b5 &crarr\; \u21d0 &lArr\; \u21d1
+ &uArr\; \u21d2 &rArr\; \u21d3 &dArr\; \u21d4 &hArr\; \u2200 &forall\;
+ \u2202 &part\; \u2203 &exist\; \u2205 &empty\; \u2207 &nabla\; \u2208
+ &isin\; \u2209 ¬in\; \u220b &ni\; \u220f &prod\; \u2211 &sum\;
+ \u2212 &minus\; \u2217 &lowast\; \u221a &radic\; \u221d &prop\; \u221e
+ &infin\; \u2220 &ang\; \u2227 &and\; \u2228 &or\; \u2229 &cap\; \u222a
+ &cup\; \u222b &int\; \u2234 &there4\; \u223c &sim\; \u2245 &cong\;
+ \u2248 &asymp\; \u2260 &ne\; \u2261 &equiv\; \u2264 &le\; \u2265 &ge\;
+ \u2282 &sub\; \u2283 &sup\; \u2284 &nsub\; \u2286 &sube\; \u2287
+ &supe\; \u2295 &oplus\; \u2297 &otimes\; \u22a5 &perp\; \u22c5 &sdot\;
+ \u2308 &lceil\; \u2309 &rceil\; \u230a &lfloor\; \u230b &rfloor\;
+ \u2329 &lang\; \u232a &rang\; \u25ca &loz\; \u2660 &spades\; \u2663
+ &clubs\; \u2665 &hearts\; \u2666 &diams\; \u0022 "\; \u0026 &\;
+ \u003c <\; \u003e >\; \u0152 &OElig\; \u0153 &oelig\; \u0160
+ &Scaron\; \u0161 &scaron\; \u0178 &Yuml\; \u02c6 &circ\; \u02dc
+ &tilde\; \u2002 &ensp\; \u2003 &emsp\; \u2009 &thinsp\; \u200c &zwnj\;
+ \u200d &zwj\; \u200e &lrm\; \u200f &rlm\; \u2013 &ndash\; \u2014
+ &mdash\; \u2018 &lsquo\; \u2019 &rsquo\; \u201a &sbquo\; \u201c
+ &ldquo\; \u201d &rdquo\; \u201e &bdquo\; \u2020 &dagger\; \u2021
+ &Dagger\; \u2030 &permil\; \u2039 &lsaquo\; \u203a &rsaquo\; \u20ac
+ &euro\;
+ }
+
+ variable entitities_utf8_map [lreverse $utf8_entities_map]
+
+ proc args_processing {string mode arglist} {
+
+ if { [dict exists $arglist -encoding]
+ && [dict get $arglist -encoding] ne "utf-8"
+ } {
+ return [encoding $mode [dict get $arglist -encoding] $string]
+ } else {
+ return $string
+ }
+
+ }
+
+# -- encode
+#
+# input string is processed and its characters suitable to be transformed
+# into entities are replaced with their corrisponding HTML (SGML?) entity
+#
+# if the input string encoding is diffrent from utf-8 the string is
+# transformed into utf-8 and then processed for entity substitution
+#
+# ::rivet::encode <input_string> ?-encoding <encoding>?
+#
+# Arguments:
+#
+# * <input_string>: string whose characted must go through HTML
+# entities expansion
+# * <encoding>: input string character encoding (utf-8 when omitted)
+#
+# Returned value:
+#
+# - expanded string
+#
+#
+
+ proc encode {string args} {
+ variable utf8_entities_map
+ return [string map $utf8_entities_map\
+ [args_processing $string convertfrom $args]]
+ }
+
+# -- decode
+#
+# input string is converted into utf-8 and in case the final string
+# has to be in some other encoding Tcl's command 'enconding' is
+# invoked for final conversion
+#
+# ::rivet::decode <input_string> ?-encoding <encoding>?
+#
+# Arguments:
+#
+# * <input_string>: string whose HTML entities have to be reconverted
+# in characters
+# * <encoding>: output string character encoding (utf-8 when omitted)
+#
+# Returned value:
+#
+# - converted string
+#
+
+ proc decode {string args} {
+ variable entitities_utf8_map
+ return [args_processing [string map $entitities_utf8_map $string]\
+ convertto $args]
+ }
+
+# In Rivet 2.0 commands are still in the global namespace, so we export them
+# and then we reimport them into ::
+
+ namespace export encode decode
+}
+
+namespace eval :: { namespace import ::rivet::encode ::rivet::decode }
+
Propchange: tcl/rivet/branches/2.0/rivet/packages/entities/entities.tcl
------------------------------------------------------------------------------
svn:keywords = Id
Modified: tcl/rivet/branches/2.0/rivet/packages/form/form.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/rivet/packages/form/form.tcl?rev=1340770&r1=1340769&r2=1340770&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/rivet/packages/form/form.tcl (original)
+++ tcl/rivet/branches/2.0/rivet/packages/form/form.tcl Sun May 20 17:11:00 2012
@@ -13,7 +13,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
+#
+# $Id$
+#
package require Itcl
@@ -25,23 +27,23 @@ package provide form 1.0
::itcl::class form {
constructor {args} {
- # set the form method to be a post and the action to be
- # a refetching of the current page
- set arguments(method) post
- set arguments(action) [env DOCUMENT_URI]
-
- # use $this for the type for form-global stuff like form arguments
- import_data form $this arguments $args
-
- if {[info exists arguments(defaults)]} {
- # make the public variable contain the name of the array
- # we are sucking default values out of
- set defaults $arguments(defaults)
-
- upvar 1 $arguments(defaults) defaults
- array set DefaultValues [array get defaults]
- unset arguments(defaults)
- }
+ # set the form method to be a post and the action to be
+ # a refetching of the current page
+ set arguments(method) post
+ set arguments(action) [env DOCUMENT_URI]
+
+ # use $this for the type for form-global stuff like form arguments
+ import_data form $this arguments $args
+
+ if {[info exists arguments(defaults)]} {
+ # make the public variable contain the name of the array
+ # we are sucking default values out of
+ set defaults $arguments(defaults)
+
+ upvar 1 $arguments(defaults) callerDefaults
+ array set DefaultValues [array get callerDefaults]
+ unset arguments(defaults)
+ }
}
destructor {
@@ -49,7 +51,7 @@ package provide form 1.0
}
method destroy {} {
- ::itcl::delete object $this
+ ::itcl::delete object $this
}
#
@@ -59,53 +61,53 @@ package provide form 1.0
# key-value pairs in the named array
#
protected method import_data {type name arrayName list} {
- upvar 1 $arrayName data
-
- #
- # If there are elements in the defaultArgs array for the
- # specified type, combine them with the list of key-value
- # pairs, putting the DefaultArgs values first so the
- # key-value pairs from list can possibly override them.
- #
- if {[info exists DefaultArgs($type)]} {
- set list [concat $DefaultArgs($type) $list]
- }
-
- #
- # if there is a default value for the name stored in the
- # DefaultValues array in this class, set the value
- # element of the array the caller named to contain that
- # value
- #
- if {[info exists DefaultValues($name)]} {
- set data(value) $DefaultValues($name)
- }
+ upvar 1 $arrayName data
- #
- # if we don't have an even number of key-value pairs,
- # that just ain't right
- #
- if {[expr [llength $list] % 2]} {
- return -code error "Unmatched key-value pairs"
- }
-
- #
- # for each key-value pair in the list, strip the first
- # dash character from the key part and map it to lower
- # case, then use that as the key for the passed-in
- # array and store the corresonding value in there
- #
- # we also prep and return the list of key-value pairs, normalized
- # with the lowercase thing
- #
- set return ""
- foreach {var val} $list {
- set var [string range [string tolower $var] 1 end]
- set data($var) $val
- if {($var == "values") || ($var == "labels")} { continue }
- lappend return -$var $val
- }
- return $return
+ #
+ # If there are elements in the defaultArgs array for the
+ # specified type, combine them with the list of key-value
+ # pairs, putting the DefaultArgs values first so the
+ # key-value pairs from list can possibly override them.
+ #
+ if {[info exists DefaultArgs($type)]} {
+ set list [concat $DefaultArgs($type) $list]
+ }
+
+ #
+ # if there is a default value for the name stored in the
+ # DefaultValues array in this class, set the value
+ # element of the array the caller named to contain that
+ # value
+ #
+ if {[info exists DefaultValues($name)]} {
+ set data(value) $DefaultValues($name)
+ }
+
+ #
+ # if we don't have an even number of key-value pairs,
+ # that just ain't right
+ #
+ if {[llength $list] % 2} {
+ return -code error "Unmatched key-value pairs"
+ }
+
+ #
+ # for each key-value pair in the list, strip the first
+ # dash character from the key part and map it to lower
+ # case, then use that as the key for the passed-in
+ # array and store the corresonding value in there
+ #
+ # we also prep and return the list of key-value pairs, normalized
+ # with the lowercase thing
+ #
+ set return ""
+ foreach {var val} $list {
+ set var [string range [string tolower $var] 1 end]
+ set data($var) $val
+ if {($var == "values") || ($var == "labels")} { continue }
+ lappend return -$var $val
+ }
+ return $return
}
#
@@ -114,12 +116,12 @@ package provide form 1.0
# array
#
protected method argstring {arrayName} {
- upvar 1 $arrayName data
- set string ""
- foreach arg [lsort [array names data]] {
- append string " $arg=\"$data($arg)\""
- }
- return $string
+ upvar 1 $arrayName data
+ set string ""
+ foreach arg [lsort [array names data]] {
+ append string " $arg=\"$data($arg)\""
+ }
+ return $string
}
#
@@ -148,19 +150,19 @@ package provide form 1.0
#
method default_args {type args} {
- # if only one argument was specified
- if {[lempty $args]} {
- if {![info exists DefaultArgs($type)]} { return }
- return $DefaultArgs($type)
- }
-
- # make sure we have an even number of key-value pairs
- if {[expr [llength $args] % 2]} {
- return -code error "Unmatched key-value pairs"
- }
+ # if only one argument was specified
+ if {[lempty $args]} {
+ if {![info exists DefaultArgs($type)]} { return }
+ return $DefaultArgs($type)
+ }
+
+ # make sure we have an even number of key-value pairs
+ if {[llength $args] % 2} {
+ return -code error "Unmatched key-value pairs"
+ }
- # set the DefaultArgs for the specified type
- return [set DefaultArgs($type) $args]
+ # set the DefaultArgs for the specified type
+ return [set DefaultArgs($type) $args]
}
#
@@ -168,17 +170,17 @@ package provide form 1.0
#
method start {{args ""}} {
if {![lempty $args]} {
- # replicated in constructor
- import_data form $this arguments $args
- }
- html "<form [argstring arguments]>"
+ # replicated in constructor
+ import_data form $this arguments $args
+ }
+ html "<form [argstring arguments]>"
}
#
# end - generate the </form>
#
method end {} {
- html "</form>"
+ html "</form>"
}
#
@@ -188,109 +190,105 @@ package provide form 1.0
#
method field {type name args} {
- # import any default key-value pairs, then any specified in this
- # field declaration
- import_data $type $name data $args
-
- # generate the field definition
- set string "<input type=\"$type\" name=\"$name\""
- append string [argstring data]
-
- switch -- $type {
- "radio" -
- "checkbox" {
- # if there's no value defined, create an empty value
- if {![info exists data(value)]} {
- set data(value) ""
- }
-
- # if there's no label defined, make the label be the
- # same as the value
- if {![info exists data(label)]} {
- set data(label) $data(value)
- }
-
- # ...and if the is a default value for this field
- # and it matches the value we have for it, make
- # the field show up as selected (checked)
- if {[info exists DefaultValues($name)]} {
- if {[lsearch $DefaultValues($name) $data(value)] >= 0} {
- append string { checked="checked"}
- }
- }
- }
- }
- append string " />"
+ # import any default key-value pairs, then any specified in this
+ # field declaration
+ import_data $type $name data $args
+
+ switch -- $type {
+ "radio" -
+ "checkbox" {
+
+ # if there's a label then prepare to output it.
+ if {[info exists data(label)]} {
+ # if there's no id defined, generate something unique so we can reference it.
+ if {![info exists data(id)]} {
+ set data(id) "autogen_[::uuid::uuid generate]"
+ }
+ set label "<label for=\"$data(id)\">$data(label)</label>"
+ }
+
+ # ...and if the is a default value for this field
+ # and it matches the value we have for it, make
+ # the field show up as selected (checked)
+ if {[info exists DefaultValues($name)] && [info exists data(value)]} {
+ if {[lsearch $DefaultValues($name) $data(value)] >= 0} {
+ set data(checked) "checked"
+ }
+ }
+ }
+ }
+ # generate the field definition
+ set string "<input type=\"$type\" name=\"$name\" [argstring data] />"
+ if {[info exists label]} {
+ append string $label
+ }
+
+ # ...and emit it
+ html $string
- # ...and emit it
- if {($type == "radio") || ($type == "checkbox")} {
- html $string$data(label)
- } else {
- html $string
- }
}
#
# text -- emit an HTML "text" field
#
method text {name args} {
- eval field text $name $args
+ eval field text $name $args
}
#
# password -- emit an HTML "password" field
#
method password {name args} {
- eval field password $name $args
+ eval field password $name $args
}
#
# hidden -- emit an HTML "hidden" field
#
method hidden {name args} {
- eval field hidden $name $args
+ eval field hidden $name $args
}
#
# submit -- emit an HTML "submit" field
#
method submit {name args} {
- eval field submit $name $args
+ eval field submit $name $args
}
#
# button -- emit an HTML "button" field
#
method button {name args} {
- eval field button $name $args
+ eval field button $name $args
}
#
# reset -- emit an HTML "reset" button
#
method reset {name args} {
- eval field reset $name $args
+ eval field reset $name $args
}
#
# image -- emit an HTML image field
#
method image {name args} {
- eval field image $name $args
+ eval field image $name $args
}
#
# checkbox -- emit an HTML "checkbox" form field
#
method checkbox {name args} {
- eval field checkbox $name $args
+ eval field checkbox $name $args
}
#
# radio -- emit an HTML "radiobutton" form field
#
method radio {name args} {
- eval field radio $name $args
+ eval field radio $name $args
}
#
@@ -395,18 +393,18 @@ package provide form 1.0
# radiobuttons --
#
method radiobuttons {name args} {
- set data(values) [list]
- set data(labels) [list]
-
- set list [import_data radiobuttons $name data $args]
+ set data(values) [list]
+ set data(labels) [list]
- if {[lempty $data(labels)]} {
- set data(labels) $data(values)
- }
+ set list [import_data radiobuttons $name data $args]
- foreach label $data(labels) value $data(values) {
- eval radio $name $list -label $label -value $value
- }
+ if {[lempty $data(labels)]} {
+ set data(labels) $data(values)
+ }
+
+ foreach label $data(labels) value $data(values) {
+ eval radio $name $list -label $label -value $value
+ }
}
#
@@ -418,67 +416,67 @@ package provide form 1.0
# it'll select it too.
#
method select {name args} {
- # start with empty values and labels so they'll exist even if not set
- set data(values) [list]
- set data(labels) [list]
-
- # import any default data and key-value pairs from the method args
- import_data select $name data $args
-
- # pull the values and labels into scalar variables and remove them
- # from the data array
- set values $data(values)
- set labels $data(labels)
- unset data(values) data(labels)
-
- # get the default value, use an empty string if there isn't one
- set default ""
- if {[info exists DefaultValues($name)]} {
- set default $DefaultValues($name)
- }
-
- # if there is a value set in the value field of the data array,
- # use that instead (that way if we're putting up a form with
- # data already, the data'll show up)
- if {[info exists data(value)]} {
- set default $data(value)
- unset data(value)
- }
-
- #
- # if there are no separate labels defined, use the list of
- # values for the labels
- #
- if {[lempty $labels]} {
- set labels $values
- }
-
- # emit the selector
- html "<select name=\"$name\" [argstring data]>"
-
- # emit each label-value pair
- foreach label $labels value $values {
- if {$value == $default} {
- set string "<option value=\"$value\" selected=\"selected\">"
- } else {
- set string "<option value=\"$value\">"
- }
- html "$string$label</option>"
- }
- html "</select>"
+ # start with empty values and labels so they'll exist even if not set
+ set data(values) [list]
+ set data(labels) [list]
+
+ # import any default data and key-value pairs from the method args
+ import_data select $name data $args
+
+ # pull the values and labels into scalar variables and remove them
+ # from the data array
+ set values $data(values)
+ set labels $data(labels)
+ unset data(values) data(labels)
+
+ # get the default value, use an empty string if there isn't one
+ set default ""
+ if {[info exists DefaultValues($name)]} {
+ set default $DefaultValues($name)
+ }
+
+ # if there is a value set in the value field of the data array,
+ # use that instead (that way if we're putting up a form with
+ # data already, the data'll show up)
+ if {[info exists data(value)]} {
+ set default $data(value)
+ unset data(value)
+ }
+
+ #
+ # if there are no separate labels defined, use the list of
+ # values for the labels
+ #
+ if {[lempty $labels]} {
+ set labels $values
+ }
+
+ # emit the selector
+ html "<select name=\"$name\" [argstring data]>"
+
+ # emit each label-value pair
+ foreach label $labels value $values {
+ if {$value == $default} {
+ set string "<option value=\"$value\" selected=\"selected\">"
+ } else {
+ set string "<option value=\"$value\">"
+ }
+ html "$string$label</option>"
+ }
+ html "</select>"
}
#
# textarea -- emit an HTML "textarea" form field
#
method textarea {name args} {
- import_data textarea $name data $args
- set value ""
- if {[info exists data(value)]} {
- set value $data(value)
- unset data(value)
- }
- html "<textarea name=\"$name\" [argstring data]>$value</textarea>"
+ import_data textarea $name data $args
+ set value ""
+ if {[info exists data(value)]} {
+ set value $data(value)
+ unset data(value)
+ }
+ html "<textarea name=\"$name\" [argstring data]>$value</textarea>"
}
#
@@ -486,8 +484,8 @@ package provide form 1.0
# the key-value pairs out of and copy them into DefaultValues
#
public variable defaults "" {
- upvar 1 $defaults array
- array set DefaultValues [array get array]
+ upvar 1 $defaults array
+ array set DefaultValues [array get array]
}
private variable DefaultValues
Propchange: tcl/rivet/branches/2.0/rivet/packages/form/form.tcl
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun May 20 17:11:00 2012
@@ -1 +1 @@
-Author Date Id Revision
+Id
Modified: tcl/rivet/branches/2.0/rivet/packages/session/session-create-mysql.sql
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/rivet/packages/session/session-create-mysql.sql?rev=1340770&r1=1340769&r2=1340770&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/rivet/packages/session/session-create-mysql.sql (original)
+++ tcl/rivet/branches/2.0/rivet/packages/session/session-create-mysql.sql Sun May 20 17:11:00 2012
@@ -13,17 +13,18 @@ create table rivet_session (
session_update_time datetime default NULL,
session_id varchar(64) NOT NULL default '',
PRIMARY KEY (session_id)
-);
+) ENGINE=INNODB;
DROP TABLE IF EXISTS `rivet_session_cache`;
create table rivet_session_cache(
- session_id varchar(128) default NULL REFERENCES rivet_session(session_id) ON DELETE CASCADE,
+ session_id varchar(128) default NULL,
package_ varchar(64) default NULL,
key_ varchar(128) default NULL,
data varchar(255) default NULL,
UNIQUE KEY riv_sess_cache_ix( session_id, key_ ),
- KEY rivet_session_cache_idx (session_id)
-);
+ KEY rivet_session_cache_idx (session_id),
+ FOREIGN KEY (session_id) REFERENCES rivet_session(session_id) ON DELETE CASCADE
+) ENGINE=INNODB;
-- create index rivet_session_cache_idx ON rivet_session_cache( session_id );
Added: tcl/rivet/branches/2.0/rivet/rivet-tcl/http_accept.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/rivet/rivet-tcl/http_accept.tcl?rev=1340770&view=auto
==============================================================================
--- tcl/rivet/branches/2.0/rivet/rivet-tcl/http_accept.tcl (added)
+++ tcl/rivet/branches/2.0/rivet/rivet-tcl/http_accept.tcl Sun May 20 17:11:00 2012
@@ -0,0 +1,90 @@
+# -- http_accept
+#
+# function for parsing Accept-* HTTP headers lines.
+#
+# http_accept parses an HTTP header line (as in the case
+# for language or media type negoziation) and returns a dictionary
+# where fields are associated to their precedence
+#
+# Output can be controlled with the following switches
+#
+# -zeroweight: appends also fiels with 0 precedence
+# -default: set default weight value to unset fields
+# -list: returns a list of the fields in the header line
+# in descending order of precedence
+#
+# This function was contributed by Harald Oehlmann
+#
+# $Id$
+#
+
+ proc http_accept {args} {
+ set lqValues {}
+ set lItems {}
+
+ # parameter
+ while { [llength $args] > 1 } {
+ set args [lassign $args argCur]
+ switch -exact -- $argCur {
+ -zeroweight { set fZeroWeight 1 }
+ -list {set oList 1}
+ -default { set fDefault 1 }
+ -- {}
+ default { return -code error "Unknown argument '$argCur'" }
+ }
+ }
+ # loop over comma-separated items
+ foreach itemCur [split [lindex $args 0] ,] {
+ # Find q value as last element separated by ;
+ set qCur 1
+ if {[regexp {^(.*); *q=([^;]*)$} $itemCur match itemCur qString]} {
+ if { 1 == [scan $qString %f qVal] && $qVal >= 0 && $qVal <= 1 } {
+ set qCur $qVal
+ }
+ }
+ set itemCur [string trim $itemCur]
+ if { $itemCur in {"*" "*/*" "*-*"} } {
+ unset -nocomplain fDefault
+ }
+ if { [info exists fZeroWeight] || $qCur > 0 } {
+ lappend lqValues $qCur
+ lappend lItems $itemCur
+ }
+ }
+ # build output dict in decreasing q order
+ set dOut {}
+
+ # we are going to keep a list of keys in order of decresing precedence,
+ # in case the list has to be returned.
+
+ # we return a list if oList was set otherwise a dictionary is build
+ # and returned
+
+ if {[info exists oList]} {
+
+ set sorted_keys {}
+ foreach indexCur [lsort -real -decreasing -indices $lqValues] {
+ lappend sorted_keys [lindex $lItems $indexCur]
+ }
+ return $sorted_keys
+
+ } else {
+ foreach indexCur [lsort -real -decreasing -indices $lqValues] {
+ set qCur [lindex $lqValues $indexCur]
+ if {$qCur == 0 && [info exists fDefault]} {
+ dict set dOut * 0.01
+ unset fDefault
+ }
+ set item_key [lindex $lItems $indexCur]
+
+ dict set dOut $item_key $qCur
+ }
+
+ if { [info exists fDefault] } {
+ dict set dOut * 0.01
+ }
+
+ return $dOut
+ }
+ }
+
Propchange: tcl/rivet/branches/2.0/rivet/rivet-tcl/http_accept.tcl
------------------------------------------------------------------------------
svn:keywords = Id
Added: tcl/rivet/branches/2.0/rivet/rivet-tcl/parray_table.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/rivet/rivet-tcl/parray_table.tcl?rev=1340770&view=auto
==============================================================================
--- tcl/rivet/branches/2.0/rivet/rivet-tcl/parray_table.tcl (added)
+++ tcl/rivet/branches/2.0/rivet/rivet-tcl/parray_table.tcl Sun May 20 17:11:00 2012
@@ -0,0 +1,35 @@
+##
+## -- parray_table <arrayName> ?pattern? ?html-attibutes?
+##
+## tablearray prints an array data in HTML table
+## This is good when a table is enough to print consistently
+## related data.
+##
+## arrayName - Name of the array to display
+## pattern - Wildcard pattern of variables. An empty string
+## is tantamout a "*" and prints the whole array
+## html-attributes -
+## list attribute-value pairs to be given
+## to the <table> element tag
+##
+## $Id$
+##
+##
+
+ proc parray_table {arrayName {pattern "*"} {htmlAttributes ""}} {
+ upvar 1 $arrayName array
+ if {![array exists array]} {
+ return -code error "\"$arrayName\" isn't an array"
+ }
+ puts -nonewline stdout "<table"
+ foreach {attr attrval} $htmlAttributes {
+ puts -nonewline " $attr=\"$attrval\""
+ }
+
+ puts "><thead><tr><th colspan=\"2\">$arrayName</th></tr></thead>"
+ puts stdout "<tbody>"
+ foreach name [lsort [array names array $pattern]] {
+ puts stdout [format "<tr><td>%s</td><td>%s</td></tr>" $name $array($name)]
+ }
+ puts stdout "</tbody></table>"
+ }
Propchange: tcl/rivet/branches/2.0/rivet/rivet-tcl/parray_table.tcl
------------------------------------------------------------------------------
svn:keywords = Id
Modified: tcl/rivet/branches/2.0/rivet/rivet-tcl/tclIndex
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/rivet/rivet-tcl/tclIndex?rev=1340770&r1=1340769&r2=1340770&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/rivet/rivet-tcl/tclIndex (original)
+++ tcl/rivet/branches/2.0/rivet/rivet-tcl/tclIndex Sun May 20 17:11:00 2012
@@ -6,20 +6,24 @@
# element name is the name of a command and the value is
# a script that loads the command.
-set auto_index(debug) [list source [file join $dir debug.tcl]]
-set auto_index(lassign) [list source [file join $dir lassign.tcl]]
set auto_index(html) [list source [file join $dir html.tcl]]
set auto_index(incr0) [list source [file join $dir incr0.tcl]]
+set auto_index(lassign) [list source [file join $dir lassign.tcl]]
+set auto_index(random) [list source [file join $dir random.tcl]]
+set auto_index(rivet_command_document) [list source [file join $dir rivet_command_document.tcl]]
+set auto_index(http_accept) [list source [file join $dir http_accept.tcl]]
set auto_index(load_response) [list source [file join $dir load_response.tcl]]
-set auto_index(parray) [list source [file join $dir parray.tcl]]
-set auto_index(read_file) [list source [file join $dir read_file.tcl]]
-set auto_index(wrap) [list source [file join $dir wrap.tcl]]
-set auto_index(wrapline) [list source [file join $dir wrap.tcl]]
-set auto_index(lempty) [list source [file join $dir lempty.tcl]]
-set auto_index(load_cookies) [list source [file join $dir load_cookies.tcl]]
+set auto_index(debug) [list source [file join $dir debug.tcl]]
set auto_index(clock_to_rfc850_gmt) [list source [file join $dir cookie.tcl]]
set auto_index(make_cookie_attributes) [list source [file join $dir cookie.tcl]]
set auto_index(cookie) [list source [file join $dir cookie.tcl]]
-set auto_index(import_keyvalue_pairs) [list source [file join $dir import_keyvalue_pairs.tcl]]
+set auto_index(lempty) [list source [file join $dir lempty.tcl]]
set auto_index(import_switch_args) [list source [file join $dir import_switch_args.tcl]]
-set auto_index(rivet_command_document) [list source [file join $dir rivet_command_document.tcl]]
+set auto_index(lmatch) [list source [file join $dir lmatch.tcl]]
+set auto_index(read_file) [list source [file join $dir read_file.tcl]]
+set auto_index(import_keyvalue_pairs) [list source [file join $dir import_keyvalue_pairs.tcl]]
+set auto_index(parray) [list source [file join $dir parray.tcl]]
+set auto_index(wrap) [list source [file join $dir wrap.tcl]]
+set auto_index(wrapline) [list source [file join $dir wrap.tcl]]
+set auto_index(parray_table) [list source [file join $dir parray_table.tcl]]
+set auto_index(load_cookies) [list source [file join $dir load_cookies.tcl]]
Modified: tcl/rivet/branches/2.0/src/apache-2/mod_rivet.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/src/apache-2/mod_rivet.c?rev=1340770&r1=1340769&r2=1340770&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/src/apache-2/mod_rivet.c (original)
+++ tcl/rivet/branches/2.0/src/apache-2/mod_rivet.c Sun May 20 17:11:00 2012
@@ -220,6 +220,7 @@ Rivet_ParseFileArgString (const char *sz
* SERVER_CONF - Apache's configuration file
* RIVET_DIR - Rivet's Tcl source directory
* RIVET_INIT - Rivet's init.tcl file
+ * if RIVET_DISPLAY_VERSION is defined also RIVET_VERSION is created
*/
static void
Rivet_InitServerVariables( Tcl_Interp *interp, apr_pool_t *p )
@@ -261,6 +262,17 @@ Rivet_InitServerVariables( Tcl_Interp *i
obj,
TCL_GLOBAL_ONLY);
Tcl_DecrRefCount(obj);
+
+#if RIVET_DISPLAY_VERSION
+ obj = Tcl_NewStringObj(RIVET_VERSION, -1);
+ Tcl_IncrRefCount(obj);
+ Tcl_SetVar2Ex(interp,
+ "server",
+ "RIVET_VERSION",
+ obj,
+ TCL_GLOBAL_ONLY);
+ Tcl_DecrRefCount(obj);
+#endif
}
static void
@@ -1567,12 +1579,14 @@ Rivet_ChildInit(apr_pool_t *pChild, serv
apr_pool_cleanup_register (pChild, s, Rivet_ChildExit, Rivet_ChildExit);
}
+
+ //TODO: clarify whether rsc or rdc
+#define USE_APACHE_RSC
+
/* Set things up to execute a file, then execute */
static int
Rivet_SendContent(request_rec *r)
{
-// char error[MAX_STRING_LEN];
-// char timefmt[MAX_STRING_LEN];
int errstatus;
int retval;
int ctype;
@@ -1582,8 +1596,11 @@ Rivet_SendContent(request_rec *r)
static Tcl_Obj *request_cleanup = NULL;
rivet_interp_globals *globals = NULL;
- rivet_server_conf *rsc = NULL;
- rivet_server_conf *rdc;
+#ifdef USE_APACHE_RSC
+ rivet_server_conf *rsc = NULL;
+#else
+ rivet_server_conf *rdc;
+#endif
ctype = Rivet_CheckType(r);
if (ctype == CTYPE_NOT_HANDLED) {
@@ -1606,10 +1623,12 @@ Rivet_SendContent(request_rec *r)
globals->req->charset = NULL;
+#ifndef USE_APACHE_RSC
if (r->per_dir_config != NULL)
rdc = RIVET_SERVER_CONF( r->per_dir_config );
else
rdc = rsc;
+#endif
r->allowed |= (1 << M_GET);
r->allowed |= (1 << M_POST);
@@ -1634,16 +1653,13 @@ Rivet_SendContent(request_rec *r)
goto sendcleanup;
}
-// apr_cpystrn(error, DEFAULT_ERROR_MSG, sizeof(error));
-// apr_cpystrn(timefmt, DEFAULT_TIME_FORMAT, sizeof(timefmt));
-
/* This one is the big catch when it comes to moving towards
Apache 2.0, or one of them, at least. */
if (Rivet_chdir_file(r->filename) < 0)
{
/* something went wrong doing chdir into r->filename, we are not specific
- at this. We simply emit an internal server error and print a log message
- */
+ * at this. We simply emit an internal server error and print a log message
+ */
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, APR_EGENERAL, r->server,
"Error accessing %s, could not chdir into directory", r->filename);
@@ -1651,9 +1667,11 @@ Rivet_SendContent(request_rec *r)
goto sendcleanup;
}
- //TODO: clarify whether rsc or rdc
- //Rivet_PropagatePerDirConfArrays( interp, rdc );
+#ifdef USE_APACHE_RSC
Rivet_PropagatePerDirConfArrays( interp, rsc );
+#else
+ Rivet_PropagatePerDirConfArrays( interp, rdc );
+#endif
/* Initialize this the first time through and keep it around. */
if (request_init == NULL) {
Modified: tcl/rivet/branches/2.0/tclconfig/ltmain.sh
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/tclconfig/ltmain.sh?rev=1340770&r1=1340769&r2=1340770&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/tclconfig/ltmain.sh (original)
+++ tcl/rivet/branches/2.0/tclconfig/ltmain.sh Sun May 20 17:11:00 2012
@@ -1,9 +1,9 @@
-# libtool (GNU libtool) 2.4
+# libtool (GNU libtool) 2.4.2
# Written by Gordon Matzigkeit <go...@gnu.ai.mit.edu>, 1996
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2007, 2008, 2009, 2010, 2011 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.
@@ -41,6 +41,7 @@
# --quiet, --silent don't print informational messages
# --no-quiet, --no-silent
# print informational messages (default)
+# --no-warn don't display warning messages
# --tag=TAG use configuration variables from tag TAG
# -v, --verbose print more informational messages than default
# --no-verbose don't print the extra informational messages
@@ -69,7 +70,7 @@
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4 Debian-2.4-2
+# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1
# automake: $automake_version
# autoconf: $autoconf_version
#
@@ -79,9 +80,9 @@
PROGRAM=libtool
PACKAGE=libtool
-VERSION="2.4 Debian-2.4-2"
+VERSION="2.4.2 Debian-2.4.2-1"
TIMESTAMP=""
-package_revision=1.3293
+package_revision=1.3337
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -136,15 +137,10 @@ progpath="$0"
: ${CP="cp -f"}
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${EGREP="/bin/grep -E"}
-: ${FGREP="/bin/grep -F"}
-: ${GREP="/bin/grep"}
-: ${LN_S="ln -s"}
: ${MAKE="make"}
: ${MKDIR="mkdir"}
: ${MV="mv -f"}
: ${RM="rm -f"}
-: ${SED="/bin/sed"}
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
: ${Xsed="$SED -e 1s/^X//"}
@@ -387,7 +383,7 @@ case $progpath in
;;
*)
save_IFS="$IFS"
- IFS=:
+ IFS=${PATH_SEPARATOR-:}
for progdir in $PATH; do
IFS="$save_IFS"
test -x "$progdir/$progname" && break
@@ -771,8 +767,8 @@ func_help ()
s*\$LTCFLAGS*'"$LTCFLAGS"'*
s*\$LD*'"$LD"'*
s/\$with_gnu_ld/'"$with_gnu_ld"'/
- s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
- s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
p
d
}
@@ -1052,6 +1048,7 @@ opt_finish=false
opt_help=false
opt_help_all=false
opt_silent=:
+opt_warning=:
opt_verbose=:
opt_silent=false
opt_verbose=false
@@ -1120,6 +1117,10 @@ esac
opt_silent=false
func_append preserve_args " $opt"
;;
+ --no-warning|--no-warn)
+ opt_warning=false
+func_append preserve_args " $opt"
+ ;;
--no-verbose)
opt_verbose=false
func_append preserve_args " $opt"
@@ -2059,7 +2060,7 @@ func_mode_compile ()
*.[cCFSifmso] | \
*.ada | *.adb | *.ads | *.asm | \
*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
- *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
+ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
func_xform "$libobj"
libobj=$func_xform_result
;;
@@ -3201,11 +3202,13 @@ func_mode_install ()
# Set up the ranlib parameters.
oldlib="$destdir/$name"
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
if test -n "$stripme" && test -n "$old_striplib"; then
- func_show_eval "$old_striplib $oldlib" 'exit $?'
+ func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
fi
# Do each command in the postinstall commands.
@@ -3470,7 +3473,7 @@ static const void *lt_preloaded_setup()
# linked before any other PIC object. But we must not use
# pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
- *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
*-*-hpux*)
pic_flag_for_symtable=" $pic_flag" ;;
@@ -3982,14 +3985,17 @@ func_exec_program_core ()
# launches target application with the remaining arguments.
func_exec_program ()
{
- for lt_wr_arg
- do
- case \$lt_wr_arg in
- --lt-*) ;;
- *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
- esac
- shift
- done
+ case \" \$* \" in
+ *\\ --lt-*)
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done ;;
+ esac
func_exec_program_core \${1+\"\$@\"}
}
@@ -5057,9 +5063,15 @@ void lt_dump_script (FILE* f)
{
EOF
func_emit_wrapper yes |
- $SED -e 's/\([\\"]\)/\\\1/g' \
- -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
-
+ $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/ fputs ("\1", f);/p
+g
+D'
cat <<"EOF"
}
EOF
@@ -5643,7 +5655,8 @@ func_mode_link ()
continue
;;
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
@@ -6150,7 +6163,8 @@ func_mode_link ()
lib=
found=no
case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
@@ -6834,7 +6848,7 @@ func_mode_link ()
test "$hardcode_direct_absolute" = no; then
add="$dir/$linklib"
elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$dir"
+ add_dir="-L$absdir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
@@ -7319,6 +7333,7 @@ func_mode_link ()
# which has an extra 1 added just for fun
#
case $version_type in
+ # correct linux to gnu/linux during the next big refactor
darwin|linux|osf|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
@@ -7438,7 +7453,7 @@ func_mode_link ()
versuffix="$major.$revision"
;;
- linux)
+ linux) # correct to gnu/linux during the next big refactor
func_arith $current - $age
major=.$func_arith_result
versuffix="$major.$age.$revision"
@@ -8026,6 +8041,11 @@ EOF
# Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
+ # Remove ${wl} instances when linking with ld.
+ # FIXME: should test the right _cmds variable.
+ case $archive_cmds in
+ *\$LD\ *) wl= ;;
+ esac
if test "$hardcode_into_libs" = yes; then
# Hardcode the library paths
hardcode_libdirs=
@@ -8056,7 +8076,7 @@ EOF
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
- *) func_apped perm_rpath " $libdir" ;;
+ *) func_append perm_rpath " $libdir" ;;
esac
fi
done
@@ -8064,11 +8084,7 @@ EOF
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
- if test -n "$hardcode_libdir_flag_spec_ld"; then
- eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
- else
- eval dep_rpath=\"$hardcode_libdir_flag_spec\"
- fi
+ eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
fi
if test -n "$runpath_var" && test -n "$perm_rpath"; then
# We should set the runpath_var.
@@ -9158,6 +9174,8 @@ EOF
esac
done
fi
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
eval cmds=\"$old_archive_cmds\"
func_len " $cmds"
@@ -9267,7 +9285,8 @@ EOF
*.la)
func_basename "$deplib"
name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ func_resolve_sysroot "$deplib"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
test -z "$libdir" && \
func_fatal_error "\`$deplib' is not a valid libtool archive"
func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-cvs-help@tcl.apache.org