diff -Nru clearsilver-0.9.2/Makefile clearsilver-0.9.3/Makefile --- clearsilver-0.9.2/Makefile Mon Aug 18 13:24:45 2003 +++ clearsilver-0.9.3/Makefile Sun Aug 31 12:10:37 2003 @@ -105,9 +105,9 @@ mkdir -p $$mdir; \ done -CS_DISTDIR = clearsilver-0.9.2 -CS_LABEL = CLEARSILVER-0_9_2 -CS_FILES = LICENSE CS_LICENSE rules.mk.in Makefile util cs cgi python scripts mod_ecs imd java-jni perl ruby acconfig.h autogen.sh config.guess config.sub configure.in cs_config.h.in mkinstalldirs install-sh ClearSilver.h ports +CS_DISTDIR = clearsilver-0.9.3 +CS_LABEL = CLEARSILVER-0_9_3 +CS_FILES = README README.python INSTALL LICENSE CS_LICENSE rules.mk.in Makefile util cs cgi python scripts mod_ecs imd java-jni perl ruby dso csharp acconfig.h autogen.sh config.guess config.sub configure.in cs_config.h.in mkinstalldirs install-sh ClearSilver.h ports contrib cs_dist: rm -rf $(CS_DISTDIR) cvs -q tag -F $(CS_LABEL) $(CS_FILES) diff -Nru clearsilver-0.9.2/README clearsilver-0.9.3/README --- clearsilver-0.9.2/README Wed Dec 31 16:00:00 1969 +++ clearsilver-0.9.3/README Mon Aug 11 14:59:30 2003 @@ -0,0 +1,66 @@ +************************************ +* Clearsilver README +************************************ + +For more information, see the website: + + http://www.clearsilver.net/ + +This package includes Clearsilver, the CGI kit and HTML templating +system. For information about building and installing, see the +included INSTALL file. This package also includes tools which +help you use Clearsilver, as well as a few examples. + +************************************************************ +*** Clearsilver + +* Clearsilver - This is our html template system and cgi kit. + +There are too many great things about clearsilver to list them all +here, but here are some of the salient points: + + * get the html out of your code + * loops, conditionals, macros, and stuff + * cgi kit unifies query variable and cookie handling + * super-easy to go from static mockup to dynamic page + * run multiple front-ends on the same application code + * super-fast C-library + * unifies Query variable and cookie handling + * language neutral (C,C++,Python,Ruby,Perl,Java,C#) + * nice iterative page debugging/development features + * generate static-data-driven page content without using any code + * did I mention super-fast? + +Supported language information: + + README.python + +************************************************************* +*** Tools + +* trans.py + +This is our transparent translation system. It's based on how we did +translation at Yahoo!. You leave all the english strings right in the +clearsilver templates. trans parses the html and extracts your +language strings into a translation database. You can then translate +the strings using any means. (it includes tools for dump and loading +per-language files for shipping to translators). Occasionally trans +isn't smart enough to find your language strings, in this case you can +manually extract them into static language string files and trans will +automatically pick them up. When it comes time to ship, trans +generates language-independent templates, and a set of language files +from your database. + +************************************************************* +*** Examples + +* static.cgi + +This is a standalone binary which handles Clearsilver rendering of +static content. This is a great way to play with clearsilver syntax +before you start writing dynamic CGIs with it. This is also a great +way to do webpage mockups with much more power than server side +includes. See the INSTALL file for information about configuring +this for use with apache. + diff -Nru clearsilver-0.9.2/README.python clearsilver-0.9.3/README.python --- clearsilver-0.9.2/README.python Wed Dec 31 16:00:00 1969 +++ clearsilver-0.9.3/README.python Mon Aug 11 14:56:55 2003 @@ -0,0 +1,65 @@ + + +************************************************************ +*** Python Environment Information + +* Python - we know it and love it +* Apache - the defacto standard + +* PyApache/mod_python + +Either one is fine, the goal is to load all Python code once, before +Apache forks. Then, for every web-request, Apache just makes a +function call into the Python environment which serves the page. This +is "really fast" as it gets rid of all of the parsing and loading of +Python. Various versions of PyApache and mod_python have gained and +lost and gained again the ability to do this well. We used a hacked +version of PyApache way back when, I think mod_python does this out of +the box today. + + + +************************************************************ +*** Python Tools + +* CSPage.py + +This is our "page rendering superclass". It's pretty simple and has +nice machinery for some of the stuff talked about on this list. For +example, it has nice debugging and redirect support, and it has a +mechanism for mapping form submit buttons to method names. Here is an +example of how the form stuff works: + +
+ +
+ + class MyPage(CSPage): + def setup(self): + # this runs before everything else + pass + def display(self): + # this is a regular non-submission render + pass + def Action_Foo(self): + # this is run automatically when the Foo submit button is clicked + pass + +* odb.py + +This is an object to relational database mapping tool. It makes +interacting with SQL databases really easy. It gives you a place to +put all your SQL code. It also could be changed to work with flat +files as well. We have some nice hooks to connect this to Clearsilver, +so rendering database data into webpages is really easy. Here is an +example: + +rows = mydb.mytable.fetchAllRows() # fetch all rows +rows.hdfExport("CGI.tabledata",ncgi.hdf) # export them into the dataset + +# it is also really easy to change rows: + +row = mydb.mytable.fetchRow( ('user', 'jeske') ) +row.email = 'jeske at chat.net' +row.save() + diff -Nru clearsilver-0.9.2/configure.in clearsilver-0.9.3/configure.in --- clearsilver-0.9.2/configure.in Mon Aug 18 13:24:45 2003 +++ clearsilver-0.9.3/configure.in Sun Aug 31 10:33:24 2003 @@ -235,15 +235,19 @@ cs_cv_python=no; AC_MSG_RESULT(Disabling python module) fi]) -AC_ARG_WITH(python, [ --with-python=path Set location of Python Includes], [cs_cv_python_path="$withval"], [cs_cv_python_path=no]) +AC_ARG_WITH(python, [ --with-python=path Set location of Python Interpreter], [cs_cv_python_path="$withval"], [cs_cv_python_path=no]) if test $cs_cv_python = yes; then AC_MSG_CHECKING(for python includes) python_inc=no python_search_path="/neo/opt /usr/local /usr /c" python_versions="2.2 2.1 2.0 1.5 22 21 20 15" - if test $cs_cv_python_path != "no" -a -d $cs_cv_python_path; then - python_path=$cs_cv_python_path + if test $cs_cv_python_path != "no" -a -x $cs_cv_python_path; then + python_bin=$cs_cv_python_path + vers=`$python_bin -c "import sys; print sys.version[[:3]]"` + py_inst_dir=`$python_bin -c "import sys; print sys.exec_prefix"` + python_inc=$py_inst_dir/include/python$vers + python_lib="-L$py_inst_dir/lib/python$vers/config -lpython$vers" else for vers in $python_versions; do for path in $python_search_path; do @@ -253,7 +257,6 @@ if test -f $path/include/python$vers/Python.h; then python_inc=$path/include/python$vers python_lib="-L$path/lib/python$vers/config -lpython$vers" - python_site=$path/lib/python$vers/site-packages break 2 fi dnl This is currently special cased mostly for Windows @@ -261,7 +264,6 @@ if test -f $path/python$vers/include/Python.h; then python_inc=$path/python$vers/include python_lib="-L$path/python$vers/libs -lpython$vers" - python_site=$path/python$vers/lib/site-packages break 2 fi done @@ -278,7 +280,7 @@ PYTHON=$python_bin PYTHON_INC="-I$python_inc" PYTHON_LIB=$python_lib - PYTHON_SITE=$python_site + PYTHON_SITE=`$python_bin -c "import site; print site.sitedirs[[0]]"` BUILD_WRAPPERS="$BUILD_WRAPPERS python" fi fi diff -Nru clearsilver-0.9.2/contrib/cs-mode.el clearsilver-0.9.3/contrib/cs-mode.el --- clearsilver-0.9.2/contrib/cs-mode.el Wed Dec 31 16:00:00 1969 +++ clearsilver-0.9.3/contrib/cs-mode.el Mon Aug 18 13:00:30 2003 @@ -0,0 +1,50 @@ +(defvar cs-font-lock-keywords + (list + '("<\\?cs[^\\?]*\\?>" 0 font-lock-keyword-face t) + '("<\\?cs +\\(call\\|each\\|if\\|alt\\|var\\|include\\)" 1 font-lock-keyword-face t) + '("<\\?cs +\\(/each\\|/if\\|/alt\\|/var\\|/include\\)" 1 font-lock-keyword-face t) + + ; variable names + '("<\\?cs +var:\\([_0-9a-zA-Z\.]+\\)[^\\?]+\\?>" 1 font-lock-variable-name-face t) + '("<\\?cs +alt:\\([_0-9a-zA-Z\.]+\\)[^\\?]+\\?>" 1 font-lock-variable-name-face t) + '("<\\?cs +each:\\([_0-9a-zA-Z\.]+\\)[^\\?]+\\?>" 1 font-lock-variable-name-face t) + + ; string + '("<\\?cs[^\"\\?]+\\(\"[^\"]+\"\\)[^\\?]+\\?>" 1 font-lock-string-face t) + +)) + +(defvar cs-mode-map ()) + +(if (not cs-mode-map) + (progn + (setq cs-mode-map (make-sparse-keymap)) + (define-key cs-mode-map "\C-c\C-i" 'cs-insert-tag) + )) + +(defun cs-mode nil + "ClearSilver mode" + + (interactive) + (setq major-mode 'cs-mode) + (setq mode-name "CS") + (use-local-map cs-mode-map) + + (make-local-variable 'font-lock-defaults) + (setq font-lock-defaults + '((cs-font-lock-keywords) t)) + + (setq font-lock-keywords cs-font-lock-keywords) + + (font-lock-mode 1) + + (run-hooks 'cs-mode-hook) + +) + +(defun cs-insert-tag () + (interactive) + (insert "") + (backward-char 3) +) + diff -Nru clearsilver-0.9.2/ports/rpm/clearsilver.spec clearsilver-0.9.3/ports/rpm/clearsilver.spec --- clearsilver-0.9.2/ports/rpm/clearsilver.spec Mon Aug 11 15:11:32 2003 +++ clearsilver-0.9.3/ports/rpm/clearsilver.spec Sun Aug 31 12:07:39 2003 @@ -1,24 +1,78 @@ # # spec file for ClearSilver Linux RPM (based on RedHat installs) # - -%define python_sitepath %(eval `python -c 'import sys; print "%%s/lib/python%%s/site-packages" %% (sys.exec_prefix, sys.version[:3])'`) -%define perl_sitearch %(eval "`perl -V:installsitearch`"; echo %$installsitearch) +# Caveats: There is some difficulty getting this file to sync with the +# actual information discovered by configure. In theory, some of this +# stuff in here could be driven off of configure.. except that configure +# is supposed to be driven off this file... +# +# * PREFIX vs perl/python PREFIX: where the perl/python modules get +# installed is actually defined by the installation of perl/python you +# are using to build the module. For that reason, we need to use a +# different PREFIX for the python/perl modules. For python, we just +# override PYTHON_SITE during install, for perl we have to run make +# install again with a new PREFIX. This means the perl module might be +# installed in two different locations, but we just package the second +# one. +# +# * The perl suggestions for rpms: +# http://archive.develooper.com/perl-dist@perl.org/msg00055.html +# suggest using find to get all of the files for the perl module. I'm +# currently hard coding them since we're not just building the perl +# module. In particular, the file path of the ClearSilver.3pm.gz +# manpage is probably wrong on some platforms. +# +# * The apache/java/ruby/csharp packages are not yet finished. For one, +# all of my machines are redhat 7.3 or later, and don't have rpms +# installed for java/ruby/csharp, and my apache installation is Neotonic +# specific and therefore not much help to the rest of you. + +########################################################################## +## Edit these settings +%define __prefix /usr/local +%define __python /usr/bin/python +%define with_python_subpackage 1 %{nil} +%define with_perl_subpackage 1 %{nil} + +# These packages aren't tested at all and probably won't build +%define with_apache_subpackage 0 +%define with_java_subpackage 0 +%define with_ruby_subpackage 0 +%define with_csharp_subpackage 0 + +########################################################################## +## All of the rest of this should work correctly based on the top... +## maybe +%define python_sitepath %(%{__python} -c "import site; print site.sitedirs[0]") +%define perl_sitearch %(eval "`perl -V:installsitearch`"; echo $installsitearch) +%define perl_prefix %(eval "`perl -V:prefix`"; echo $prefix) +%define ruby_sitepath %(echo "i dunno") +%define ruby_version %(echo "i dunno") +%define ruby_arch %(echo "i dunno") %define apache_libexec %(eval `/httpd/bin/apxs -q LIBEXECDIR`) Summary: Neotonic ClearSilver Name: clearsilver -Version: 0.9.2 +Version: 0.9.3 Release: 1 Copyright: Open Source - Neotonic ClearSilver License (Apache 1.1 based) Group: Development/Libraries -Source: http://www.clearsilver.net/downloads/clearsilver-0.9.2.tar.gz +Source: http://www.clearsilver.net/downloads/clearsilver-0.9.3.tar.gz URL: http://www.clearsilver.net/ Vendor: Neotonic Software Corporation, Inc. Packager: Brandon Long BuildRequires: zlib-devel +%if %{with_python_subpackage} BuildRequires: python-devel >= 1.5.2 -BuildRequires: perl-devel >= 0:5.006 +%endif +%if %{with_perl_subpackage} +BuildRequires: perl >= 0:5.006 +%endif +%if %{with_ruby_subpackage} +BuildRequires: ruby >= 1.4.5 +%endif + +BuildRoot: %{_tmppath}/%{name}-root %description ClearSilver is a fast, powerful, and language-neutral HTML template system. @@ -30,6 +84,7 @@ like Python and Perl via modules, it is extremely fast compared to template systems written in a script language. +%if %{with_python_subpackage} %package python Summary: Neotonic ClearSilver Python Module Group: Development/Libraries @@ -39,7 +94,9 @@ %description python The clearsilver-python package provides a python interface to the clearsilver CGI kit and templating system. +%endif +%if %{with_perl_subpackage} %package perl Summary: Neotonic ClearSilver Perl Module Group: Development/Libraries @@ -50,16 +107,21 @@ %description perl The clearsilver-perl package provides a perl interface to the clearsilver templating system. +%endif -%package java -Summary: Neotonic ClearSilver JAVA Module +%if %{with_ruby_subpackage} +%package ruby +Summary: Neotonic ClearSilver Ruby Module Group: Development/Libraries Requires: clearsilver = %PACKAGE_VERSION +Requires: ruby >= 1.4.5 -%description java -The clearsilver-java package provides a java jni interface to the +%description ruby +The clearsilver-ruby package provides a ruby interface to the clearsilver templating system. +%endif +%if %{with_apache_subpackage} %package apache Summary: Neotonic ClearSilver Apache Module Group: Development/Libraries @@ -70,72 +132,89 @@ %description apache The clearsilver-apache package provides an Apache 1.3.x module for loading ClearSilver CGI's as shared libraries. +%endif -%package ruby -Summary: Neotonic ClearSilver Apache Module +%if %{with_java_subpackage} +%package java Group: Development/Libraries Requires: clearsilver = %PACKAGE_VERSION -Requires: ruby >= 1.4.5 -%description ruby -The clearsilver-ruby package provides a ruby interface to the +%description java +The clearsilver-java package provides a java jni interface to the clearsilver templating system. +%endif + %prep %setup %build -./configure --prefix=${__prefix} +./configure --prefix=%{__prefix} --with-python=%{__python} make %install -make DESTDIR="$RPM_BUILD_ROOT" install +make PREFIX="$RPM_BUILD_ROOT%{__prefix}" prefix="$RPM_BUILD_ROOT%{__prefix}" PYTHON_SITE="$RPM_BUILD_ROOT%{python_sitepath}" install +cd perl +make PREFIX="$RPM_BUILD_ROOT%{perl_prefix}" install +cd .. %files -%{__prefix}/include/ClearSilver.h -%{__prefix}/include/cs_config.h -%{__prefix}/include/cgi/cgi.h -%{__prefix}/include/cgi/cgiwrap.h -%{__prefix}/include/cgi/date.h -%{__prefix}/include/cgi/html.h -%{__prefix}/include/cs/cs.h -%{__prefix}/include/util/dict.h -%{__prefix}/include/util/filter.h -%{__prefix}/include/util/neo_date.h -%{__prefix}/include/util/neo_err.h -%{__prefix}/include/util/neo_files.h -%{__prefix}/include/util/neo_hash.h -%{__prefix}/include/util/neo_hdf.h -%{__prefix}/include/util/neo_misc.h* -%{__prefix}/include/util/neo_net.h -%{__prefix}/include/util/neo_rand.h -%{__prefix}/include/util/neo_server.h -%{__prefix}/include/util/neo_str.h -%{__prefix}/include/util/rcfs.h -%{__prefix}/include/util/skiplist.h -%{__prefix}/include/util/ulist.h -%{__prefix}/include/util/ulocks.h -%{__prefix}/include/util/wdb.h -%{__prefix}/include/util/wildmat.h +%{__prefix}/include/ClearSilver/ClearSilver.h +%{__prefix}/include/ClearSilver/cs_config.h +%{__prefix}/include/ClearSilver/cgi/cgi.h +%{__prefix}/include/ClearSilver/cgi/cgiwrap.h +%{__prefix}/include/ClearSilver/cgi/date.h +%{__prefix}/include/ClearSilver/cgi/html.h +%{__prefix}/include/ClearSilver/cs/cs.h +%{__prefix}/include/ClearSilver/util/dict.h +%{__prefix}/include/ClearSilver/util/filter.h +%{__prefix}/include/ClearSilver/util/neo_date.h +%{__prefix}/include/ClearSilver/util/neo_err.h +%{__prefix}/include/ClearSilver/util/neo_files.h +%{__prefix}/include/ClearSilver/util/neo_hash.h +%{__prefix}/include/ClearSilver/util/neo_hdf.h +%{__prefix}/include/ClearSilver/util/neo_misc.h +%{__prefix}/include/ClearSilver/util/neo_net.h +%{__prefix}/include/ClearSilver/util/neo_rand.h +%{__prefix}/include/ClearSilver/util/neo_server.h +%{__prefix}/include/ClearSilver/util/neo_str.h +%{__prefix}/include/ClearSilver/util/rcfs.h +%{__prefix}/include/ClearSilver/util/skiplist.h +%{__prefix}/include/ClearSilver/util/ulist.h +%{__prefix}/include/ClearSilver/util/ulocks.h +%{__prefix}/include/ClearSilver/util/wdb.h +%{__prefix}/include/ClearSilver/util/wildmat.h %{__prefix}/lib/libneo_cgi.a %{__prefix}/lib/libneo_cs.a %{__prefix}/lib/libneo_utl.a %{__prefix}/bin/static.cgi %{__prefix}/bin/cstest +%if %{with_python_subpackage} %files python -${python_sitepath}/neo_cgi.so +%{python_sitepath}/neo_cgi.so +%endif +%if %{with_perl_subpackage} %files perl %{perl_sitearch}/ClearSilver.pm %{perl_sitearch}/auto/ClearSilver/ClearSilver.so +%{perl_sitearch}/auto/ClearSilver/ClearSilver.bs +%{perl_prefix}/share/man/man3/ClearSilver.3pm.gz +%endif -%files java -%{__prefix}/lib/clearsilver.jar -%{__prefix}/lib/libclearsilver-jni.so +%if %{with_ruby_subpackage} +%files ruby +%{ruby_sitepath}/%(ruby_version}/neo.rb +%{ruby_sitepath}/%(ruby_version}/$(ruby_arch}/hdf.so +%endif +%if %{with_apache_subpackage} %files apache %{apache_libexec}/mod_ecs.so +%endif -%files ruby -%{ruby_sitepath}/%(ruby_version}/neo.rb -%{ruby_sitepath}/%(ruby_version}/$(ruby_arch}/hdf.so +%if %{with_java_subpackage} +%files java +%{__prefix}/lib/clearsilver.jar +%{__prefix}/lib/libclearsilver-jni.so +%endif diff -Nru clearsilver-0.9.2/python/examples/base/hdfhelp.py clearsilver-0.9.3/python/examples/base/hdfhelp.py --- clearsilver-0.9.2/python/examples/base/hdfhelp.py Sun Aug 17 22:24:27 2003 +++ clearsilver-0.9.3/python/examples/base/hdfhelp.py Wed Aug 20 22:57:16 2003 @@ -82,7 +82,7 @@ else: # it's a full time/date - return time.strftime("%m/%d/%Y %H:%M%p",then_tuple) + return time.strftime("%m/%d/%Y %I:%M%p",then_tuple) class HdfRow(odb.Row): def hdfExport(self,prefix,hdf_dataset,skip_fields = None, translate_dict = None): diff -Nru clearsilver-0.9.2/python/examples/base/odb.py clearsilver-0.9.3/python/examples/base/odb.py --- clearsilver-0.9.2/python/examples/base/odb.py Sun Aug 17 22:24:27 2003 +++ clearsilver-0.9.3/python/examples/base/odb.py Wed Aug 20 22:57:16 2003 @@ -80,6 +80,7 @@ kIncInteger = "kIncInteger" # - kDateTime = "kDateTime" kTimeStamp = "kTimeStamp" +kReal = "kReal" DEBUG = 0 @@ -279,7 +280,14 @@ else: return long(data) except (ValueError,TypeError): raise eInvalidData, "invalid data (%s) for col (%s:%s) on table (%s)" % (repr(data),col_name,c_type,self.__table_name) - else: + elif c_type == kReal: + try: + if data is None: data = 0.0 + else: return float(data) + except (ValueError,TypeError): + raise eInvalidData, "invalid data (%s) for col (%s:%s) on table (%s)" % (repr(data), col_name,c_type,self.__table_name) + + else: if type(data) == type(long(0)): return "%d" % data else: @@ -507,6 +515,12 @@ raise ValueError, "invalid literal for long(%s) in table %s" % (repr(m_col_val),self.__table_name) sql_where_list.append("%s = %d" % (c_name, m_col_val_long)) + elif c_type == kReal: + try: + m_col_val_float = float(m_col_val) + except ValueError: + raise ValueError, "invalid literal for float(%s) is table %s" % (repr(m_col_val), self.__table_name) + sql_where_list.append("%s = %s" % (c_name, m_col_val_float)) else: sql_where_list.append("%s = '%s'" % (c_name, self.db.escape(m_col_val))) @@ -661,6 +675,9 @@ sql_set_list.append("%s = '%s'" % (c_name, self.db.escape(compressed_data))) else: sql_set_list.append("%s = '%s'" % (c_name, self.db.escape(col_val))) + elif c_type == kReal: + sql_set_list.append("%s = %s" % (c_name,float(col_val))) + else: sql_set_list.append("%s = '%s'" % (c_name, self.db.escape(col_val))) @@ -708,6 +725,8 @@ sql_data_list.append("'%s'" % self.db.escape(compressed_data)) else: sql_data_list.append("'%s'" % self.db.escape(data)) + elif type == kReal: + sql_data_list.append("%s" % data) else: sql_data_list.append("'%s'" % self.db.escape(data)) diff -Nru clearsilver-0.9.2/python/setup.py clearsilver-0.9.3/python/setup.py --- clearsilver-0.9.2/python/setup.py Thu Jul 24 11:36:50 2003 +++ clearsilver-0.9.3/python/setup.py Sun Aug 31 10:33:09 2003 @@ -24,7 +24,7 @@ parts = string.split(line, '=', 1) if len(parts) != 2: continue var, val = parts - var = var.strip() + var = string.strip(var) make_vars[var] = val if var == "CFLAGS": matches = re.findall("-I(\S+)", val) diff -Nru clearsilver-0.9.2/scripts/commitlog.py clearsilver-0.9.3/scripts/commitlog.py --- clearsilver-0.9.2/scripts/commitlog.py Sun Jan 26 22:53:45 2003 +++ clearsilver-0.9.3/scripts/commitlog.py Tue Aug 26 20:24:02 2003 @@ -60,10 +60,15 @@ # check to see if the log line is already there fps = open(filename,"a+") - fps.seek(-len(log_summary),2) - check_data = fps.read(len(log_summary)) - if check_data != log_summary: + try: + fps.seek(-len(log_summary),2) + check_data = fps.read(len(log_summary)) + if check_data != log_summary: + fps.write(log_summary) + except IOError: + # Not enough data to go back that far fps.write(log_summary) + fps.close() os.system('ci -q -m"none" %s %s,v' % (filename,filename)) diff -Nru clearsilver-0.9.2/util/neo_hdf.c clearsilver-0.9.3/util/neo_hdf.c --- clearsilver-0.9.2/util/neo_hdf.c Mon Aug 18 13:40:03 2003 +++ clearsilver-0.9.3/util/neo_hdf.c Tue Aug 26 17:55:49 2003 @@ -880,6 +880,10 @@ if (ln) { ln->next = hp->next; + /* check to see if we are the last parent's last_child, if so + * repoint so hash table inserts will go to the right place */ + if (hp == lp->last_child) + lp->last_child = ln; hp->next = NULL; } else diff -Nru clearsilver-0.9.2/util/test/hash_test.c clearsilver-0.9.3/util/test/hash_test.c --- clearsilver-0.9.2/util/test/hash_test.c Wed Apr 2 15:07:39 2003 +++ clearsilver-0.9.3/util/test/hash_test.c Tue Aug 26 17:55:27 2003 @@ -6,9 +6,9 @@ #include "util/neo_err.h" #include "util/neo_hash.h" -void dump_string_hash(HASH *hash) +void dump_string_hash(NE_HASH *hash) { - HASHNODE *node; + NE_HASHNODE *node; int x; for (x = 0; x < hash->size; x++) @@ -26,11 +26,11 @@ NEOERR *err = STATUS_OK; int x; char *word; - HASH *hash = NULL; + NE_HASH *hash = NULL; FILE *fp; char buf[256]; - err = hash_init(&hash, hash_str_hash, hash_str_comp); + err = ne_hash_init(&hash, ne_hash_str_hash, ne_hash_str_comp); if (err) return nerr_pass(err); @@ -46,9 +46,9 @@ buf[x-1] = '\0'; word = strdup(buf); - err = hash_insert(hash, word, word); + err = ne_hash_insert(hash, word, word); if (err) break; - word = hash_lookup(hash, buf); + word = ne_hash_lookup(hash, buf); if (word == NULL) { err = nerr_raise(NERR_ASSERT, "Unable to find word %s in hash", buf); @@ -79,7 +79,7 @@ if (buf[x-1] == '\n') buf[x-1] = '\0'; - if (!(word = hash_lookup(hash, buf))) + if (!(word = ne_hash_lookup(hash, buf))) { err = nerr_raise(NERR_ASSERT, "Unable to find word %s in hash", buf); break; @@ -91,7 +91,7 @@ } } fclose (fp); - hash_destroy(&hash); + ne_hash_destroy(&hash); return nerr_pass(err); }