tDOM-0.8.3/0000755000175000017500000000000011004675162012561 5ustar ssobernissobernitDOM-0.8.3/aclocal.m40000644000175000017500000000025410311376076014424 0ustar ssobernissoberni# # Include the TEA standard macro set # builtin(include,tclconfig/tcl.m4) # # Add here whatever m4 macros you want to define for your package # builtin(include,tdom.m4) tDOM-0.8.3/unix/0000755000175000017500000000000011004674376013552 5ustar ssobernissobernitDOM-0.8.3/unix/CVS/0000755000175000017500000000000011004674376014205 5ustar ssobernissobernitDOM-0.8.3/unix/CVS/Root0000644000175000017500000000006211004674376015051 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/unix/CVS/Entries0000644000175000017500000000012611004674376015540 0ustar ssobernissoberni/CONFIG/1.9/Wed Aug 15 21:43:54 2007// /tclAppInit.c/1.5/Sat Aug 11 22:20:11 2007// D tDOM-0.8.3/unix/CVS/Repository0000644000175000017500000000001211004674376016300 0ustar ssobernissobernitdom/unix tDOM-0.8.3/unix/CONFIG0000644000175000017500000001024110660671632014437 0ustar ssobernissoberni#!/bin/sh # # This is a small collection of example settings you can use to # compile tdom on different platforms. Just uncomment the line(s) # you need and run this script with "sh CONFIG". # # It's best, to leave the tDOM specfic configuration options alone # (that is: use the defaults, do nothing). # # --enable-tdomalloc # Default: off # With this option on, a special memory allocator is used, which is # optimized for low memory allocation overhead. This allocator works # only on 32-bit plattforms. If you build for a 64-bit OS, you _must_ # disable this (and it's disabled by default). # # --enable-dtd # Default: on # With this option on, the underlying XML parser expat will be build # with parsing support of XML DTDs. Leave this option at default. If # you disable this option, then all the SAX handlers related to DTD # events won't work any more. It also affects the DOM interface: # without DTD support, the fetching of external entities with the # -externalentitycommand won't work. With this option off, the test # suite will report a lot of failure because of missing features. # # --enable-ns # Default: on # With this option on, the underlying XML parser expat will be build # with parsing support of XML namespaces. This affects only the SAX # interface; the DOM interface always uses a non XML namespace expat # parser behind the scene and does the XML namespace handling by # its own. # # --enable-unknown # Default: off # With this option on, tDOM replaces the standard unknown command with # its own version. This allows a special shortcut syntax together with # the deprecated XPointer methods. It's there for backward # compatibility reasons. It is known, that it cause trouble together # with itcl. # # --with-aolserver # If building tDOM as module for AOLserver, this points to the # directory with the AOLserver source distribution. See below # for examples. # # --with-tdom # Useful (and avaliable) only for building extensions to tDOM (as # tnc). Use it to point to the tdomConfig.sh file. # # # # Comment-out next line if building with GCC compiler. # CC=gcc; export CC # # # Tcl 8.0.5 on Unix. Uses public Tcl library # ------------------------------------------- # ../configure-tcl8.0.5 # # # Tcl 8.1+ on Unix. Uses public Tcl library # ------------------------------------------- # ../configure # # # For 64-bit Unix you've to use --disable-tdomalloc # ------------------------------------------------- # ../configure --disable-tdomalloc # # # AOLserver 3.X. It delivers its own patched Tcl lib. # Also, this one builds tdom as AOLserver module. # Please do not use "make install" after doing "make". # You have to manually adjust AOLserver config file # to load tdom module. See README.AOL for more info. # Also, you need to modify the "aolsrc" to point to # the directory with AOLserver source distribution. # ---------------------------------------------------- # aolsrc="/usr/src/aolserver-3.4" # ../configure --enable-threads --disable-tdomalloc \ # --with-aolserver=$aolsrc \ # --with-tcl=$aolsrc/tcl8.3.4/unix # # # AOLserver 4.X. It uses public Tcl library. # Builds the package as a regular Tcl module # but installs it in the AOLserver tree. # Just do "make" and "make install". You might # want to change the default AOLserver install # directory (/usr/local/aolserver). # ---------------------------------------------------- # ../configure --enable-threads --disable-tdomalloc \ # --prefix=/usr/local/aolserver # # AOLserver 4.X. It uses public Tcl library. # Builds the package as a AOLserver module. # You will have to manually trim your AOLserver # startup script to load it. # Just do "make" and "make install". You might # want to change the default AOLserver install # directory (/usr/local/aolserver). # ---------------------------------------------------- # ../configure --enable-threads --disable-tdomalloc \ # --with-aolserver=/usr/local/aolserver \ # --prefix=/usr/local/aolserver # # # Mac OS X. Uses public Tcl library. # -------------------------------------------- # ../configure \ # --mandir=/usr/local/share/man \ # --libdir=/Library/Tcl \ # --with-tcl=/Library/Frameworks/Tcl.framework \ # --with-tclinclude=/Library/Frameworks/Tcl.framework/Headers # # EOF tDOM-0.8.3/unix/tclAppInit.c0000644000175000017500000000413510657433033015764 0ustar ssobernissoberni/*---------------------------------------------------------------------------- | Copyright (c) 2007 Rolf Ade (rolf@pointsman.de) +----------------------------------------------------------------------------- | | $Id: tclAppInit.c,v 1.5 2007/08/11 22:20:11 rolf Exp $ | | | Main file for a standalone tclsh with tDOM build in ('big tclsh'). | | The contents of this file are subject to the Mozilla Public License | Version 1.1 (the "License"); you may not use this file except in | compliance with the License. You may obtain a copy of the License at | http://www.mozilla.org/MPL/ | | Software distributed under the License is distributed on an "AS IS" | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | License for the specific language governing rights and limitations | under the License. | | The Original Code is tDOM. | | The Initial Developer of the Original Code is Jochen Loewer | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 | Jochen Loewer. All Rights Reserved. | | Contributor(s): | | | written by Rolf Ade | August, 2007 | \---------------------------------------------------------------------------*/ #include "tcl.h" extern int Tdom_Init _ANSI_ARGS_((Tcl_Interp *interp)); extern int Tdom_SafeInit _ANSI_ARGS_((Tcl_Interp *interp)); /*---------------------------------------------------------------------------- | main | \---------------------------------------------------------------------------*/ int main( int argc, char **argv ) { Tcl_Main (argc, argv, Tcl_AppInit); return 0; } /*---------------------------------------------------------------------------- | Tcl_AppInit | \---------------------------------------------------------------------------*/ int Tcl_AppInit(interp) Tcl_Interp *interp; { if (Tcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } if (Tdom_Init(interp) == TCL_ERROR) { return TCL_ERROR; } Tcl_StaticPackage(interp, "tdom", Tdom_Init, Tdom_SafeInit); Tcl_SetVar(interp, "tcl_rcFileName", "~/.tcldomshrc", TCL_GLOBAL_ONLY); return TCL_OK; } tDOM-0.8.3/tclconfig/0000755000175000017500000000000011004674374014535 5ustar ssobernissobernitDOM-0.8.3/tclconfig/install-sh0000755000175000017500000000421207520722637016544 0ustar ssobernissoberni#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5; it is not part of GNU. # # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" instcmd="$mvprog" chmodcmd="" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` fi # Make a temp file name in the proper directory. dstdir=`dirname $dst` dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp # and set any options; do chmod last to preserve setuid bits if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi # Now rename the file to the real destination. $doit $rmcmd $dst $doit $mvcmd $dsttmp $dst exit 0 tDOM-0.8.3/tclconfig/tcl.m40000644000175000017500000036766510652230706015603 0ustar ssobernissoberni# tcl.m4 -- # # This file provides a set of autoconf macros to help TEA-enable # a Tcl extension. # # Copyright (c) 1999-2000 Ajuba Solutions. # Copyright (c) 2002-2005 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: tcl.m4,v 1.7 2007/07/26 23:44:06 rolf Exp $ AC_PREREQ(2.57) dnl TEA extensions pass us the version of TEA they think they dnl are compatible with (must be set in TEA_INIT below) dnl TEA_VERSION="3.6" # Possible values for key variables defined: # # TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') # TEA_PLATFORM - windows unix # #------------------------------------------------------------------------ # TEA_PATH_TCLCONFIG -- # # Locate the tclConfig.sh file and perform a sanity check on # the Tcl compile flags # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the directory containing # the tclConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_TCLCONFIG], [ dnl Make sure we are initialized AC_REQUIRE([TEA_INIT]) # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl], [directory containing tcl configuration (tclConfig.sh)]), with_tclconfig=${withval}) AC_MSG_CHECKING([for Tcl configuration]) AC_CACHE_VAL(ac_cv_c_tclconfig,[ # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case ${with_tclconfig} in */tclConfig.sh ) if test -f ${with_tclconfig}; then AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` break fi done fi # on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi ]) if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" AC_MSG_WARN([Can't find Tcl configuration definitions]) exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_PATH_TKCONFIG -- # # Locate the tkConfig.sh file # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tk=... # # Defines the following vars: # TK_BIN_DIR Full path to the directory containing # the tkConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_TKCONFIG], [ # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true AC_ARG_WITH(tk, AC_HELP_STRING([--with-tk], [directory containing tk configuration (tkConfig.sh)]), with_tkconfig=${withval}) AC_MSG_CHECKING([for Tk configuration]) AC_CACHE_VAL(ac_cv_c_tkconfig,[ # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then case ${with_tkconfig} in */tkConfig.sh ) if test -f ${with_tkconfig}; then AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` fi ;; esac if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` else AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) fi fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi ]) if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" AC_MSG_WARN([Can't find Tk configuration definitions]) exit 0 else no_tk= TK_BIN_DIR=${ac_cv_c_tkconfig} AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_LOAD_TCLCONFIG -- # # Load the tclConfig.sh file # # Arguments: # # Requires the following vars to be set: # TCL_BIN_DIR # # Results: # # Subst the following vars: # TCL_BIN_DIR # TCL_SRC_DIR # TCL_LIB_FILE # #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_TCLCONFIG], [ AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then AC_MSG_RESULT([loading]) . "${TCL_BIN_DIR}/tclConfig.sh" else AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TCL_BIN_DIR}/Makefile" ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} elif test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tcl.framework installed in an arbitary location. case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then for i in "`cd ${TCL_BIN_DIR}; pwd`" \ "`cd ${TCL_BIN_DIR}/../..; pwd`"; do if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" break fi done fi if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" fi ;; esac fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" AC_SUBST(TCL_VERSION) AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) AC_SUBST(TCL_LIBS) AC_SUBST(TCL_DEFS) AC_SUBST(TCL_EXTRA_CFLAGS) AC_SUBST(TCL_LD_FLAGS) AC_SUBST(TCL_SHLIB_LD_LIBS) ]) #------------------------------------------------------------------------ # TEA_LOAD_TKCONFIG -- # # Load the tkConfig.sh file # # Arguments: # # Requires the following vars to be set: # TK_BIN_DIR # # Results: # # Sets the following vars that should be in tkConfig.sh: # TK_BIN_DIR #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_TKCONFIG], [ AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then AC_MSG_RESULT([loading]) . "${TK_BIN_DIR}/tkConfig.sh" else AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) fi # eval is required to do the TK_DBGX substitution eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TK_BIN_DIR}/Makefile" ; then TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} elif test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tk.framework installed in an arbitary location. case ${TK_DEFS} in *TK_FRAMEWORK*) if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then for i in "`cd ${TK_BIN_DIR}; pwd`" \ "`cd ${TK_BIN_DIR}/../..; pwd`"; do if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" break fi done fi if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" fi ;; esac fi # eval is required to do the TK_DBGX substitution eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" # Ensure windowingsystem is defined if test "${TEA_PLATFORM}" = "unix" ; then case ${TK_DEFS} in *MAC_OSX_TK*) AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) TEA_WINDOWINGSYSTEM="aqua" ;; *) TEA_WINDOWINGSYSTEM="x11" ;; esac elif test "${TEA_PLATFORM}" = "windows" ; then TEA_WINDOWINGSYSTEM="win32" fi AC_SUBST(TK_VERSION) AC_SUBST(TK_BIN_DIR) AC_SUBST(TK_SRC_DIR) AC_SUBST(TK_LIB_FILE) AC_SUBST(TK_LIB_FLAG) AC_SUBST(TK_LIB_SPEC) AC_SUBST(TK_STUB_LIB_FILE) AC_SUBST(TK_STUB_LIB_FLAG) AC_SUBST(TK_STUB_LIB_SPEC) AC_SUBST(TK_LIBS) AC_SUBST(TK_XINCLUDES) ]) #------------------------------------------------------------------------ # TEA_ENABLE_SHARED -- # # Allows the building of shared libraries # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-shared=yes|no # # Defines the following vars: # STATIC_BUILD Used for building import/export libraries # on Windows. # # Sets the following vars: # SHARED_BUILD Value of 1 or 0 #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_SHARED], [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, AC_HELP_STRING([--enable-shared], [build and link with shared libraries (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then AC_MSG_RESULT([shared]) SHARED_BUILD=1 else AC_MSG_RESULT([static]) SHARED_BUILD=0 AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) fi AC_SUBST(SHARED_BUILD) ]) #------------------------------------------------------------------------ # TEA_ENABLE_THREADS -- # # Specify if thread support should be enabled. If "yes" is specified # as an arg (optional), threads are enabled by default, "no" means # threads are disabled. "yes" is the default. # # TCL_THREADS is checked so that if you are compiling an extension # against a threaded core, your extension must be compiled threaded # as well. # # Note that it is legal to have a thread enabled extension run in a # threaded or non-threaded Tcl core, but a non-threaded extension may # only run in a non-threaded Tcl core. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-threads # # Sets the following vars: # THREADS_LIBS Thread library(s) # # Defines the following vars: # TCL_THREADS # _REENTRANT # _THREAD_SAFE # #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_THREADS], [ AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads], [build with threads]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then TCL_THREADS=1 if test "${TEA_PLATFORM}" != "windows" ; then # We are always OK on Windows, so check what this platform wants: # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention AC_DEFINE(USE_THREAD_ALLOC, 1, [Do we want to use the threaded memory allocator?]) AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) if test "`uname -s`" = "SunOS" ; then AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) fi AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the same # library, as some systems hide it there until pthread.h is # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] AC_CHECK_LIB(pthread, __pthread_mutex_init, tcl_ok=yes, tcl_ok=no) fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else AC_CHECK_LIB(pthreads, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else AC_CHECK_LIB(c, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "no"; then AC_CHECK_LIB(c_r, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) fi fi fi fi fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output AC_MSG_CHECKING([for building with threads]) if test "${TCL_THREADS}" = 1; then AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) AC_MSG_RESULT([yes (default)]) else AC_MSG_RESULT([no]) fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then AC_MSG_WARN([ Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads.]) fi ;; *) if test "${TCL_THREADS}" = "1"; then AC_MSG_WARN([ --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core.]) fi ;; esac AC_SUBST(TCL_THREADS) ]) #------------------------------------------------------------------------ # TEA_ENABLE_SYMBOLS -- # # Specify if debugging symbols should be used. # Memory (TCL_MEM_DEBUG) debugging can also be enabled. # # Arguments: # none # # TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives # the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. # Requires the following vars to be set in the Makefile: # CFLAGS_DEFAULT # LDFLAGS_DEFAULT # # Results: # # Adds the following arguments to configure: # --enable-symbols # # Defines the following vars: # CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true # Sets to $(CFLAGS_OPTIMIZE) if false # LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true # Sets to $(LDFLAGS_OPTIMIZE) if false # DBGX Formerly used as debug library extension; # always blank now. # #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_SYMBOLS], [ dnl Make sure we are initialized AC_REQUIRE([TEA_CONFIG_CFLAGS]) AC_MSG_CHECKING([for build with symbols]) AC_ARG_ENABLE(symbols, AC_HELP_STRING([--enable-symbols], [build with debugging symbols (default: off)]), [tcl_ok=$enableval], [tcl_ok=no]) DBGX="" if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" AC_MSG_RESULT([no]) else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then AC_MSG_RESULT([yes (standard debugging)]) fi fi if test "${TEA_PLATFORM}" != "windows" ; then LDFLAGS_DEFAULT="${LDFLAGS}" fi AC_SUBST(TCL_DBGX) AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then AC_MSG_RESULT([enabled symbols mem debugging]) else AC_MSG_RESULT([enabled $tcl_ok debugging]) fi fi ]) #------------------------------------------------------------------------ # TEA_ENABLE_LANGINFO -- # # Allows use of modern nl_langinfo check for better l10n. # This is only relevant for Unix. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-langinfo=yes|no (default is yes) # # Defines the following vars: # HAVE_LANGINFO Triggers use of nl_langinfo if defined. # #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_LANGINFO], [ AC_ARG_ENABLE(langinfo, AC_HELP_STRING([--enable-langinfo], [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), [langinfo_ok=$enableval], [langinfo_ok=yes]) HAVE_LANGINFO=0 if test "$langinfo_ok" = "yes"; then AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) fi AC_MSG_CHECKING([whether to use nl_langinfo]) if test "$langinfo_ok" = "yes"; then AC_CACHE_VAL(tcl_cv_langinfo_h, [ AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);], [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) AC_MSG_RESULT([$tcl_cv_langinfo_h]) if test $tcl_cv_langinfo_h = yes; then AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) fi else AC_MSG_RESULT([$langinfo_ok]) fi ]) #-------------------------------------------------------------------- # TEA_CONFIG_SYSTEM # # Determine what the system is (some things cannot be easily checked # on a feature-driven basis, alas). This can usually be done via the # "uname" command, but there are a few systems, like Next, where # this doesn't work. # # Arguments: # none # # Results: # Defines the following var: # # system - System/platform/version identification code. # #-------------------------------------------------------------------- AC_DEFUN([TEA_CONFIG_SYSTEM], [ AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows elif test -f /usr/lib/NextStep/software_version; then tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then AC_MSG_WARN([can't find uname command]) tcl_cv_sys_version=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi fi fi ]) system=$tcl_cv_sys_version ]) #-------------------------------------------------------------------- # TEA_CONFIG_CFLAGS # # Try to determine the proper flags to pass to the compiler # for building shared libraries and other such nonsense. # # Arguments: # none # # Results: # # Defines and substitutes the following vars: # # DL_OBJS - Name of the object file that implements dynamic # loading for Tcl on this system. # DL_LIBS - Library file(s) to include in tclsh and other base # applications in order for the "load" command to work. # LDFLAGS - Flags to pass to the compiler when linking object # files into an executable application binary such # as tclsh. # LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. Could # be the same as CC_SEARCH_FLAGS if ${CC} is used to link. # CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. # SHLIB_CFLAGS - Flags to pass to cc when compiling the components # of a shared library (may request position-independent # code, among other things). # SHLIB_LD - Base command to use for combining object files # into a shared library. # SHLIB_LD_LIBS - Dependent libraries for the linker to scan when # creating shared libraries. This symbol typically # goes at the end of the "ld" commands that build # shared libraries. The value of the symbol is # "${LIBS}" if all of the dependent libraries should # be specified when creating a shared library. If # dependent libraries should not be specified (as on # SunOS 4.x, where they cause the link to fail, or in # general if Tcl and Tk aren't themselves shared # libraries), then this symbol has an empty string # as its value. # SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable # extensions. An empty string means we don't know how # to use shared libraries on this platform. # LIB_SUFFIX - Specifies everything that comes after the "libfoo" # in a static or shared library name, using the $VERSION variable # to put the version in the right place. This is used # by platforms that need non-standard library names. # Examples: ${VERSION}.so.1.1 on NetBSD, since it needs # to have a version after the .so, and ${VERSION}.a # on AIX, since a shared library needs to have # a .a extension whereas shared objects for loadable # extensions have a .so extension. Defaults to # ${VERSION}${SHLIB_SUFFIX}. # TCL_NEEDS_EXP_FILE - # 1 means that an export file is needed to link to a # shared library. # TCL_EXP_FILE - The name of the installed export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # TCL_BUILD_EXP_FILE - # The name of the built export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # CFLAGS_DEBUG - # Flags used when running the compiler in debug mode # CFLAGS_OPTIMIZE - # Flags used when running the compiler in optimize mode # CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) # #-------------------------------------------------------------------- AC_DEFUN([TEA_CONFIG_CFLAGS], [ dnl Make sure we are initialized AC_REQUIRE([TEA_INIT]) # Step 0.a: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is requested]) AC_ARG_ENABLE(64bit, AC_HELP_STRING([--enable-64bit], [enable 64bit support (default: off)]), [do64bit=$enableval], [do64bit=no]) AC_MSG_RESULT([$do64bit]) # Step 0.b: Enable Solaris 64 bit VIS support? AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) AC_ARG_ENABLE(64bit-vis, AC_HELP_STRING([--enable-64bit-vis], [enable 64bit Sparc VIS support (default: off)]), [do64bitVIS=$enableval], [do64bitVIS=no]) AC_MSG_RESULT([$do64bitVIS]) if test "$do64bitVIS" = "yes"; then # Force 64bit on with VIS do64bit=yes fi # Step 0.c: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = "windows" ; then AC_MSG_CHECKING([if Windows/CE build is requested]) AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no]) AC_MSG_RESULT([$doWince]) fi # Step 1: set the variable "system" to hold the name and version number # for the system. TEA_CONFIG_SYSTEM # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) # Require ranlib early so we can override it in special cases below. AC_REQUIRE([AC_PROG_RANLIB]) # Step 3: set configuration options based on system name and version. # This is similar to Tcl's unix/tcl.m4 except that we've added a # "windows" case. do64bit_ok=no LDFLAGS_ORIG="$LDFLAGS" # When ld needs options to work in 64-bit mode, put them in # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] # is disabled by the user. [Bug 1016796] LDFLAGS_ARCH="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O if test "$GCC" = "yes" ; then CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wno-implicit-int" else CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. dnl AC_CHECK_TOOL(AR, ar) AC_CHECK_PROG(AR, ar, ar) STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" case $system in windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|ia64. MACHINE="X86" if test "$do64bit" != "no" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft Platform SDK" fi MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # default to AMD64 64-bit build PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" PATH64="${MSSDK}/Bin/Win64" ;; esac if test ! -d "${PATH64}" ; then AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) AC_MSG_WARN([Ensure latest Platform SDK is installed]) do64bit="no" else AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) fi if test "$GCC" = "yes" ; then AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) fi TEA_PATH_CELIB # Set defaults for common evc4/PPC2003 setup # Currently Tcl requires 300+, possibly 420+ for sockets CEVERSION=420; # could be 211 300 301 400 420 ... TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... ARCH=ARM; # could be ARM MIPS X86EM ... PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" if test "$doWince" != "yes"; then # If !yes then the user specified something # Reset ARCH to allow user to skip specifying it ARCH= eval `echo $doWince | awk -F, '{ \ if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ }'` if test "x${ARCH}" = "x" ; then ARCH=$TARGETCPU; fi fi OSVERSION=WCE$CEVERSION; if test "x${WCEROOT}" = "x" ; then WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" if test ! -d "${WCEROOT}" ; then WCEROOT="C:/Program Files/Microsoft eMbedded Tools" fi fi if test "x${SDKROOT}" = "x" ; then SDKROOT="C:/Program Files/Windows CE Tools" if test ! -d "${SDKROOT}" ; then SDKROOT="C:/Windows CE Tools" fi fi WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) doWince="no" else # We could PATH_NOSPACE these, but that's not important, # as long as we quote them when used. CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" if test -d "${CEINCLUDE}/${TARGETCPU}" ; then CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" fi CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" fi fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" != "no" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs CC="\"${PATH64}/cl.exe\"" CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" RC="\"${MSSDK}/bin/rc.exe\"" lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" # Avoid 'unresolved external symbol __security_cookie' # errors, c.f. http://support.microsoft.com/?id=894573 TEA_ADD_LIBS([bufferoverflowU.lib]) elif test "$doWince" != "no" ; then CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" if test "${TARGETCPU}" = "X86"; then CC="\"${CEBINROOT}/cl.exe\"" else CC="\"${CEBINROOT}/cl${ARCH}.exe\"" fi CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" if test "${SHARED_BUILD}" = "1" ; then # Static CE builds require static celib as well defs="${defs} _DLL" fi for i in $defs ; do AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i) done AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version]) AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version]) CFLAGS_DEBUG="-nologo -Zi -Od" CFLAGS_OPTIMIZE="-nologo -Ox" lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" AC_SUBST(CELIB_DIR) else RC="rc" lflags="-nologo" LINKBIN="link" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode RC="windres" CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" SHLIB_LD="$CC -shared" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" else SHLIB_LD="${LINKBIN} -dll ${lflags}" # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # This essentially turns it all on. LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" LDFLAGS_OPTIMIZE="-release" if test "$doWince" != "no" ; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots # Bogus to avoid getting this turned off DL_OBJS="tclLoadNone.obj" ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r) # ok ... ;; *) CC=${CC}_r ;; esac AC_MSG_RESULT([Using $CC for compiling with threads]) fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker on AIX 4+ if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN([64bit mode not supported with GCC on $system]) else do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS_ARCH="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi if test "`uname -m`" = "ia64" ; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = "yes" ; then CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else if test "$GCC" = "yes" ; then SHLIB_LD="gcc -shared" else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" fi SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' fi # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then AC_LIBOBJ([tclLoadAix]) DL_LIBS="-lld" fi # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?]) fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CC} -nostart" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" #----------------------------------------------------------- # Check for inet_ntoa in -lbind, for BeOS (which also needs # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD="cc -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) # Needed by Tcl, but not most extensions #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) #LIBS="$LIBS -lxnet" # Use the XOPEN network library if test "`uname -m`" = "ia64" ; then SHLIB_SUFFIX=".so" else SHLIB_SUFFIX=".sl" fi AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = "yes" ; then SHLIB_LD="gcc -shared" SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then hpux_arch=`${CC} -dumpmachine` case $hpux_arch in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD="${CC} -shared" SHLIB_LD_LIBS='${LIBS}' CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) AC_MSG_WARN([64bit mode not supported with GCC on $system]) ;; esac else do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS_ARCH="+DD64" fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN([64bit mode not supported by gcc]) else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS_ARCH="-64" fi fi ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi if test $do64bit = yes; then AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_m64 = yes; then CFLAGS="$CFLAGS -m64" do64bit_ok=yes fi fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The # -fno-builtin flag should address this problem # but it does not work. The -fno-inline flag # is kind of overkill but it works. # Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x ; then CFLAGS="$CFLAGS -fno-inline" fi ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" SHLIB_LD="${CC} -shared" DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 SHLIB_LD="${CC} -shared " DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,-Bexport" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[[1-2]].*) # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) if test $tcl_cv_ld_elf = yes; then SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' else SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' fi # Ancient FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. case `machine` in sparc|sparc64) SHLIB_CFLAGS="-fPIC";; *) SHLIB_CFLAGS="-fpic";; esac SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) if test $tcl_cv_ld_elf = yes; then LDFLAGS=-Wl,-export-dynamic else LDFLAGS="" fi # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; FreeBSD-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "${TCL_THREADS}" = "1" ; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Darwin-*) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" # To avoid discrepancies between what headers configure sees during # preprocessing tests and compiling tests, move any -isysroot and # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" if test $do64bit = yes; then case `arch` in ppc) AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], tcl_cv_cc_arch_ppc64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes, tcl_cv_cc_arch_ppc64=no) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_arch_ppc64 = yes; then CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes fi;; i386) AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], tcl_cv_cc_arch_x86_64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes, tcl_cv_cc_arch_x86_64=no) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_arch_x86_64 = yes; then CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes fi;; *) AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; esac else # Check for combined 32-bit and 64-bit fat build echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ fat_32_64=yes fi # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no) LDFLAGS=$hold_ldflags]) if test $tcl_cv_ld_single_module = yes; then SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" # Don't use -prebind when building for Mac OS X 10.4 or later only: test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4 && \ LDFLAGS="$LDFLAGS -prebind" LDFLAGS="$LDFLAGS -headerpad_max_install_names" AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no) LDFLAGS=$hold_ldflags]) if test $tcl_cv_ld_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" # TEA specific: for Tk extensions, remove 64-bit arch flags from # CFLAGS et al. for combined 32 & 64 bit fat builds as neither # TkAqua nor TkX11 can be built for 64-bit at present. test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD="cc -nostdlib -r" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h [Should OS/390 do the right thing with sockets?]) ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export $@:' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD='ld -shared -expect_unresolved "*"' else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = "1" ; then CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = "yes" ; then LIBS="$LIBS -lpthread -lmach -lexc" else CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[[0-6]]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) SHLIB_CFLAGS="-KPIC" # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_LD="$CC -shared" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) else do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" SHLIB_CFLAGS="-fPIC" fi else do64bit_ok=yes if test "$do64bitVIS" = "yes" ; then CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" else CFLAGS="$CFLAGS -xarch=v9" LDFLAGS_ARCH="-xarch=v9" fi # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi elif test "$arch" = "amd64 i386" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN([64bit mode not supported with GCC on $system]) else do64bit_ok=yes CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64" fi else AC_MSG_WARN([64bit mode not supported for $arch]) fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_LD="$CC -shared" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "$do64bit_ok" = "yes" ; then # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" fi else SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no) LDFLAGS=$hold_ldflags]) if test $tcl_cv_ld_Bexport = yes; then LDFLAGS="$LDFLAGS -Wl,-Bexport" fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) fi dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so dnl # until the end of configure, as configure's compile and link tests use dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's dnl # preprocessing tests use only CPPFLAGS. AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) # Step 4: disable dynamic loading if requested via a command-line switch. AC_ARG_ENABLE(load, AC_HELP_STRING([--enable-load], [allow dynamic loading and "load" command (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "$tcl_ok" = "no"; then DL_OBJS="" fi if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" echo "on this system." SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then if test "$GCC" = "yes" ; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*) ;; Darwin-*) ;; SCO_SV-3.2*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi AC_SUBST(DL_LIBS) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(CFLAGS_WARNING) AC_SUBST(STLIB_LD) AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_LD_LIBS) AC_SUBST(SHLIB_CFLAGS) AC_SUBST(LD_LIBRARY_PATH_VAR) # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary TEA_TCL_EARLY_FLAGS TEA_TCL_64BIT_FLAGS ]) #-------------------------------------------------------------------- # TEA_SERIAL_PORT # # Determine which interface to use to talk to the serial port. # Note that #include lines must begin in leftmost column for # some compilers to recognize them as preprocessor directives, # and some build environments have stdin not pointing at a # pseudo-terminal (usually /dev/null instead.) # # Arguments: # none # # Results: # # Defines only one of the following vars: # HAVE_SYS_MODEM_H # USE_TERMIOS # USE_TERMIO # USE_SGTTY # #-------------------------------------------------------------------- AC_DEFUN([TEA_SERIAL_PORT], [ AC_CHECK_HEADERS(sys/modem.h) AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ AC_TRY_RUN([ #include int main() { struct termios t; if (tcgetattr(0, &t) == 0) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include #include int main() { struct termios t; if (tcgetattr(0, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no; then AC_TRY_RUN([ #include #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no; then AC_TRY_RUN([ #include #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) fi]) case $tcl_cv_api_serial in termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; esac ]) #-------------------------------------------------------------------- # TEA_MISSING_POSIX_HEADERS # # Supply substitutes for missing POSIX header files. Special # notes: # - stdlib.h doesn't define strtol, strtoul, or # strtod insome versions of SunOS # - some versions of string.h don't declare procedures such # as strstr # # Arguments: # none # # Results: # # Defines some of the following vars: # NO_DIRENT_H # NO_ERRNO_H # NO_VALUES_H # HAVE_LIMITS_H or NO_LIMITS_H # NO_STDLIB_H # NO_STRING_H # NO_SYS_WAIT_H # NO_DLFCN_H # HAVE_SYS_PARAM_H # # HAVE_STRING_H ? # # tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and # CHECK on limits.h #-------------------------------------------------------------------- AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [ AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ AC_TRY_LINK([#include #include ], [ #ifndef _POSIX_SOURCE # ifdef __Lynx__ /* * Generate compilation error to make the test fail: Lynx headers * are only valid if really in the POSIX environment. */ missing_procedure(); # endif #endif DIR *d; struct dirent *entryPtr; char *p; d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); ], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)]) if test $tcl_cv_dirent_h = no; then AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) fi AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])]) AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) AC_CHECK_HEADER(limits.h, [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) if test $tcl_ok = 0; then AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) fi AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) # See also memmove check below for a place where NO_STRING_H can be # set and why. if test $tcl_ok = 0; then AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) fi AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) # OS/390 lacks sys/param.h (and doesn't need it, by chance). AC_HAVE_HEADERS(sys/param.h) ]) #-------------------------------------------------------------------- # TEA_PATH_X # # Locate the X11 header files and the X11 library archive. Try # the ac_path_x macro first, but if it doesn't find the X stuff # (e.g. because there's no xmkmf program) then check through # a list of possible directories. Under some conditions the # autoconf macro will return an include directory that contains # no include files, so double-check its result just to be safe. # # This should be called after TEA_CONFIG_CFLAGS as setting the # LIBS line can confuse some configure macro magic. # # Arguments: # none # # Results: # # Sets the following vars: # XINCLUDES # XLIBSW # PKG_LIBS (appends to) # #-------------------------------------------------------------------- AC_DEFUN([TEA_PATH_X], [ if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then TEA_PATH_UNIX_X fi ]) AC_DEFUN([TEA_PATH_UNIX_X], [ AC_PATH_X not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then AC_TRY_CPP([#include ], , not_really_there="yes") else if test ! -r $x_includes/X11/Intrinsic.h; then not_really_there="yes" fi fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then AC_MSG_CHECKING([for X11 header files]) found_xincludes="no" AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no") if test "$found_xincludes" = "no"; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Intrinsic.h; then AC_MSG_RESULT([$i]) XINCLUDES=" -I$i" found_xincludes="yes" break fi done fi else if test "$x_includes" != ""; then XINCLUDES="-I$x_includes" found_xincludes="yes" fi fi if test found_xincludes = "no"; then AC_MSG_RESULT([couldn't find any!]) fi if test "$no_x" = yes; then AC_MSG_CHECKING([for X11 libraries]) XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then AC_MSG_RESULT([$i]) XLIBSW="-L$i -lX11" x_libraries="$i" break fi done else if test "$x_libraries" = ""; then XLIBSW=-lX11 else XLIBSW="-L$x_libraries -lX11" fi fi if test "$XLIBSW" = nope ; then AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) fi if test "$XLIBSW" = nope ; then AC_MSG_RESULT([could not find any! Using -lX11.]) XLIBSW=-lX11 fi if test x"${XLIBSW}" != x ; then PKG_LIBS="${PKG_LIBS} ${XLIBSW}" fi ]) #-------------------------------------------------------------------- # TEA_BLOCKING_STYLE # # The statements below check for systems where POSIX-style # non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. # On these systems (mostly older ones), use the old BSD-style # FIONBIO approach instead. # # Arguments: # none # # Results: # # Defines some of the following vars: # HAVE_SYS_IOCTL_H # HAVE_SYS_FILIO_H # USE_FIONBIO # O_NONBLOCK # #-------------------------------------------------------------------- AC_DEFUN([TEA_BLOCKING_STYLE], [ AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/filio.h) TEA_CONFIG_SYSTEM AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) case $system in # There used to be code here to use FIONBIO under AIX. However, it # was reported that FIONBIO doesn't work under AIX 3.2.5. Since # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO # code (JO, 5/31/97). OSF*) AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) AC_MSG_RESULT([FIONBIO]) ;; SunOS-4*) AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) AC_MSG_RESULT([FIONBIO]) ;; *) AC_MSG_RESULT([O_NONBLOCK]) ;; esac ]) #-------------------------------------------------------------------- # TEA_TIME_HANLDER # # Checks how the system deals with time.h, what time structures # are used on the system, and what fields the structures have. # # Arguments: # none # # Results: # # Defines some of the following vars: # USE_DELTA_FOR_TZ # HAVE_TM_GMTOFF # HAVE_TM_TZADJ # HAVE_TIMEZONE_VAR # #-------------------------------------------------------------------- AC_DEFUN([TEA_TIME_HANDLER], [ AC_CHECK_HEADERS(sys/time.h) AC_HEADER_TIME AC_STRUCT_TIMEZONE AC_CHECK_FUNCS(gmtime_r localtime_r) AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)]) if test $tcl_cv_member_tm_tzadj = yes ; then AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) fi AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)]) if test $tcl_cv_member_tm_gmtoff = yes ; then AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) fi # # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ AC_TRY_COMPILE([#include ], [extern long timezone; timezone += 1; exit (0);], tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)]) if test $tcl_cv_timezone_long = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) else # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ AC_TRY_COMPILE([#include ], [extern time_t timezone; timezone += 1; exit (0);], tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)]) if test $tcl_cv_timezone_time = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) fi fi ]) #-------------------------------------------------------------------- # TEA_BUGGY_STRTOD # # Under Solaris 2.4, strtod returns the wrong value for the # terminating character under some conditions. Check for this # and if the problem exists use a substitute procedure # "fixstrtod" (provided by Tcl) that corrects the error. # Also, on Compaq's Tru64 Unix 5.0, # strtod(" ") returns 0.0 instead of a failure to convert. # # Arguments: # none # # Results: # # Might defines some of the following vars: # strtod (=fixstrtod) # #-------------------------------------------------------------------- AC_DEFUN([TEA_BUGGY_STRTOD], [ AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) if test "$tcl_strtod" = 1; then AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ AC_TRY_RUN([ extern double strtod(); int main() { char *infString="Inf", *nanString="NaN", *spaceString=" "; char *term; double value; value = strtod(infString, &term); if ((term != infString) && (term[-1] == 0)) { exit(1); } value = strtod(nanString, &term); if ((term != nanString) && (term[-1] == 0)) { exit(1); } value = strtod(spaceString, &term); if (term == (spaceString+1)) { exit(1); } exit(0); }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy, tcl_cv_strtod_buggy=buggy)]) if test "$tcl_cv_strtod_buggy" = buggy; then AC_LIBOBJ([fixstrtod]) USE_COMPAT=1 AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) fi fi ]) #-------------------------------------------------------------------- # TEA_TCL_LINK_LIBS # # Search for the libraries needed to link the Tcl shell. # Things like the math library (-lm) and socket stuff (-lsocket vs. # -lnsl) are dealt with here. # # Arguments: # Requires the following vars to be set in the Makefile: # DL_LIBS # LIBS # MATH_LIBS # # Results: # # Subst's the following var: # TCL_LIBS # MATH_LIBS # # Might append to the following vars: # LIBS # # Might define the following vars: # HAVE_NET_ERRNO_H # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_LINK_LIBS], [ #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) AC_CHECK_HEADER(net/errno.h, [ AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) if test "$tcl_checkSocket" = 1; then AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) fi AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])]) # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call TEA_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' AC_SUBST(TCL_LIBS) AC_SUBST(MATH_LIBS) ]) #-------------------------------------------------------------------- # TEA_TCL_EARLY_FLAGS # # Check for what flags are needed to be passed so the correct OS # features are available. # # Arguments: # None # # Results: # # Might define the following vars: # _ISOC99_SOURCE # _LARGEFILE64_SOURCE # _LARGEFILE_SOURCE64 # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_EARLY_FLAG],[ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, AC_TRY_COMPILE([[#define ]$1[ 1 ]$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then AC_DEFINE($1, 1, [Add the ]$1[ flag when building]) tcl_flags="$tcl_flags $1" fi ]) AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ AC_MSG_CHECKING([for required early compiler flags]) tcl_flags="" TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], [char *p = (char *)strtoll; char *q = (char *)strtoull;]) TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], [struct stat64 buf; int i = stat64("/", &buf);]) TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include ], [char *p = (char *)open64;]) if test "x${tcl_flags}" = "x" ; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([${tcl_flags}]) fi ]) #-------------------------------------------------------------------- # TEA_TCL_64BIT_FLAGS # # Check for what is defined in the way of 64-bit features. # # Arguments: # None # # Results: # # Might define the following vars: # TCL_WIDE_INT_IS_LONG # TCL_WIDE_INT_TYPE # HAVE_STRUCT_DIRENT64 # HAVE_STRUCT_STAT64 # HAVE_TYPE_OFF64_T # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ AC_MSG_CHECKING([for 64-bit integer type]) AC_CACHE_VAL(tcl_cv_type_64bit,[ tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], tcl_type_64bit=__int64, tcl_type_64bit="long long") # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... AC_TRY_COMPILE(,[switch (0) { case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; }],tcl_cv_type_64bit=${tcl_type_64bit})]) if test "${tcl_cv_type_64bit}" = none ; then AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?]) AC_MSG_RESULT([using long]) elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # We actually want to use the default tcl.h checks in this # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* AC_MSG_RESULT([using Tcl header defaults]) else AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, [What type should be used to define wide integers?]) AC_MSG_RESULT([${tcl_cv_type_64bit}]) # Now check for auxiliary declarations AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ AC_TRY_COMPILE([#include #include ],[struct dirent64 p;], tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) fi AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ AC_TRY_COMPILE([#include ],[struct stat64 p; ], tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) if test "x${tcl_cv_struct_stat64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) fi AC_CHECK_FUNCS(open64 lseek64) AC_MSG_CHECKING([for off64_t]) AC_CACHE_VAL(tcl_cv_type_off64_t,[ AC_TRY_COMPILE([#include ],[off64_t offset; ], tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the dnl functions lseek64 and open64 are defined. if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi ]) ## ## Here ends the standard Tcl configuration bits and starts the ## TEA specific functions ## #------------------------------------------------------------------------ # TEA_INIT -- # # Init various Tcl Extension Architecture (TEA) variables. # This should be the first called TEA_* macro. # # Arguments: # none # # Results: # # Defines and substs the following vars: # CYGPATH # EXEEXT # Defines only: # TEA_VERSION # TEA_INITED # TEA_PLATFORM (windows or unix) # # "cygpath" is used on windows to generate native path names for include # files. These variables should only be used with the compiler and linker # since they generate native path names. # # EXEEXT # Select the executable extension based on the host type. This # is a lightweight replacement for AC_EXEEXT that doesn't require # a compiler. #------------------------------------------------------------------------ AC_DEFUN([TEA_INIT], [ # TEA extensions pass this us the version of TEA they think they # are compatible with. TEA_VERSION="3.6" AC_MSG_CHECKING([for correct TEA configuration]) if test x"${PACKAGE_NAME}" = x ; then AC_MSG_ERROR([ The PACKAGE_NAME variable must be defined by your TEA configure.in]) fi if test x"$1" = x ; then AC_MSG_ERROR([ TEA version not specified.]) elif test "$1" != "${TEA_VERSION}" ; then AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"]) else AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) fi case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac # Check if exec_prefix is set. If not use fall back to prefix. # Note when adjusted, so that TEA_PREFIX can correct for this. # This is needed for recursive configures, since autoconf propagates # $prefix, but not $exec_prefix (doh!). if test x$exec_prefix = xNONE ; then exec_prefix_default=yes exec_prefix=$prefix fi AC_SUBST(EXEEXT) AC_SUBST(CYGPATH) # This package name must be replaced statically for AC_SUBST to work AC_SUBST(PKG_LIB_FILE) # Substitute STUB_LIB_FILE in case package creates a stub library too. AC_SUBST(PKG_STUB_LIB_FILE) # We AC_SUBST these here to ensure they are subst'ed, # in case the user doesn't call TEA_ADD_... AC_SUBST(PKG_STUB_SOURCES) AC_SUBST(PKG_STUB_OBJECTS) AC_SUBST(PKG_TCL_SOURCES) AC_SUBST(PKG_HEADERS) AC_SUBST(PKG_INCLUDES) AC_SUBST(PKG_LIBS) AC_SUBST(PKG_CFLAGS) ]) #------------------------------------------------------------------------ # TEA_ADD_SOURCES -- # # Specify one or more source files. Users should check for # the right platform before adding to their list. # It is not important to specify the directory, as long as it is # in the generic, win or unix subdirectory of $(srcdir). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_SOURCES # PKG_OBJECTS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_SOURCES], [ vars="$@" for i in $vars; do case $i in [\$]*) # allow $-var names PKG_SOURCES="$PKG_SOURCES $i" PKG_OBJECTS="$PKG_OBJECTS $i" ;; *) # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then AC_MSG_ERROR([could not find source file '$i']) fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" fi PKG_OBJECTS="$PKG_OBJECTS $j" ;; esac done AC_SUBST(PKG_SOURCES) AC_SUBST(PKG_OBJECTS) ]) #------------------------------------------------------------------------ # TEA_ADD_STUB_SOURCES -- # # Specify one or more source files. Users should check for # the right platform before adding to their list. # It is not important to specify the directory, as long as it is # in the generic, win or unix subdirectory of $(srcdir). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_STUB_SOURCES # PKG_STUB_OBJECTS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_STUB_SOURCES], [ vars="$@" for i in $vars; do # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then AC_MSG_ERROR([could not find stub source file '$i']) fi PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" fi PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" done AC_SUBST(PKG_STUB_SOURCES) AC_SUBST(PKG_STUB_OBJECTS) ]) #------------------------------------------------------------------------ # TEA_ADD_TCL_SOURCES -- # # Specify one or more Tcl source files. These should be platform # independent runtime files. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_TCL_SOURCES #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_TCL_SOURCES], [ vars="$@" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done AC_SUBST(PKG_TCL_SOURCES) ]) #------------------------------------------------------------------------ # TEA_ADD_HEADERS -- # # Specify one or more source headers. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_HEADERS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_HEADERS], [ vars="$@" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then AC_MSG_ERROR([could not find header file '${srcdir}/$i']) fi PKG_HEADERS="$PKG_HEADERS $i" done AC_SUBST(PKG_HEADERS) ]) #------------------------------------------------------------------------ # TEA_ADD_INCLUDES -- # # Specify one or more include dirs. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_INCLUDES], [ vars="$@" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done AC_SUBST(PKG_INCLUDES) ]) #------------------------------------------------------------------------ # TEA_ADD_LIBS -- # # Specify one or more libraries. Users should check for # the right platform before adding to their list. For Windows, # libraries provided in "foo.lib" format will be converted to # "-lfoo" when using GCC (mingw). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_LIBS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_LIBS], [ vars="$@" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done AC_SUBST(PKG_LIBS) ]) #------------------------------------------------------------------------ # TEA_ADD_CFLAGS -- # # Specify one or more CFLAGS. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_CFLAGS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_CFLAGS], [ PKG_CFLAGS="$PKG_CFLAGS $@" AC_SUBST(PKG_CFLAGS) ]) #------------------------------------------------------------------------ # TEA_PREFIX -- # # Handle the --prefix=... option by defaulting to what Tcl gave # # Arguments: # none # # Results: # # If --prefix or --exec-prefix was not specified, $prefix and # $exec_prefix will be set to the values given to Tcl when it was # configured. #------------------------------------------------------------------------ AC_DEFUN([TEA_PREFIX], [ if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) prefix=${TCL_PREFIX} else AC_MSG_NOTICE([--prefix defaulting to /usr/local]) prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ -o x"${exec_prefix_default}" = x"yes" ; then if test x"${TCL_EXEC_PREFIX}" != x; then AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) exec_prefix=${TCL_EXEC_PREFIX} else AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) exec_prefix=$prefix fi fi ]) #------------------------------------------------------------------------ # TEA_SETUP_COMPILER_CC -- # # Do compiler checks the way we want. This is just a replacement # for AC_PROG_CC in TEA configure.in files to make them cleaner. # # Arguments: # none # # Results: # # Sets up CC var and other standard bits we need to make executables. #------------------------------------------------------------------------ AC_DEFUN([TEA_SETUP_COMPILER_CC], [ # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) # in this macro, they need to go into TEA_SETUP_COMPILER instead. # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- AC_PROG_MAKE_SET #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- AC_PROG_RANLIB #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- AC_OBJEXT AC_EXEEXT ]) #------------------------------------------------------------------------ # TEA_SETUP_COMPILER -- # # Do compiler checks that use the compiler. This must go after # TEA_SETUP_COMPILER_CC, which does the actual compiler check. # # Arguments: # none # # Results: # # Sets up CC var and other standard bits we need to make executables. #------------------------------------------------------------------------ AC_DEFUN([TEA_SETUP_COMPILER], [ # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. AC_REQUIRE([TEA_SETUP_COMPILER_CC]) #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then AC_CACHE_CHECK([if the compiler understands -pipe], tcl_cv_cc_pipe, [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi fi #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- AC_C_BIGENDIAN if test "${TEA_PLATFORM}" = "unix" ; then TEA_TCL_LINK_LIBS TEA_MISSING_POSIX_HEADERS # Let the user call this, because if it triggers, they will # need a compat/strtod.c that is correct. Users can also # use Tcl_GetDouble(FromObj) instead. #TEA_BUGGY_STRTOD fi ]) #------------------------------------------------------------------------ # TEA_MAKE_LIB -- # # Generate a line that can be used to build a shared/unshared library # in a platform independent manner. # # Arguments: # none # # Requires: # # Results: # # Defines the following vars: # CFLAGS - Done late here to note disturb other AC macros # MAKE_LIB - Command to execute to build the Tcl library; # differs depending on whether or not Tcl is being # compiled as a shared library. # MAKE_SHARED_LIB Makefile rule for building a shared library # MAKE_STATIC_LIB Makefile rule for building a static library # MAKE_STUB_LIB Makefile rule for building a stub library #------------------------------------------------------------------------ AC_DEFUN([TEA_MAKE_LIB], [ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure any variables in the suffix is # substituted. (@@@ Might not be necessary anymore) #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" fi eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" if test "$GCC" = "yes"; then PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} fi # These aren't needed on Windows (either MSVC or gcc) RANLIB=: RANLIB_STUB=: else RANLIB_STUB="${RANLIB}" if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" fi eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" fi # These are escaped so that only CFLAGS is picked up at configure time. # The other values will be substituted at make time. CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" if test "${SHARED_BUILD}" = "1" ; then CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" fi AC_SUBST(MAKE_LIB) AC_SUBST(MAKE_SHARED_LIB) AC_SUBST(MAKE_STATIC_LIB) AC_SUBST(MAKE_STUB_LIB) AC_SUBST(RANLIB_STUB) ]) #------------------------------------------------------------------------ # TEA_LIB_SPEC -- # # Compute the name of an existing object library located in libdir # from the given base name and produce the appropriate linker flags. # # Arguments: # basename The base name of the library without version # numbers, extensions, or "lib" prefixes. # extra_dir Extra directory in which to search for the # library. This location is used first, then # $prefix/$exec-prefix, then some defaults. # # Requires: # TEA_INIT and TEA_PREFIX must be called first. # # Results: # # Defines the following vars: # ${basename}_LIB_NAME The computed library name. # ${basename}_LIB_SPEC The computed linker flags. #------------------------------------------------------------------------ AC_DEFUN([TEA_LIB_SPEC], [ AC_MSG_CHECKING([for $1 library]) # Look in exec-prefix for the library (defined by TEA_PREFIX). tea_lib_name_dir="${exec_prefix}/lib" # Or in a user-specified location. if test x"$2" != x ; then tea_extra_lib_dir=$2 else tea_extra_lib_dir=NONE fi for i in \ `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do if test -f "$i" ; then tea_lib_name_dir=`dirname $i` $1_LIB_NAME=`basename $i` $1_LIB_PATH_NAME=$i break fi done if test "${TEA_PLATFORM}" = "windows"; then $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" else # Strip off the leading "lib" and trailing ".a" or ".so" tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" fi if test "x${$1_LIB_NAME}" = x ; then AC_MSG_ERROR([not found]) else AC_MSG_RESULT([${$1_LIB_SPEC}]) fi ]) #------------------------------------------------------------------------ # TEA_PRIVATE_TCL_HEADERS -- # # Locate the private Tcl include files # # Arguments: # # Requires: # TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has # already been called. # # Results: # # Substs the following vars: # TCL_TOP_DIR_NATIVE # TCL_GENERIC_DIR_NATIVE # TCL_UNIX_DIR_NATIVE # TCL_WIN_DIR_NATIVE # TCL_BMAP_DIR_NATIVE # TCL_TOOL_DIR_NATIVE # TCL_PLATFORM_DIR_NATIVE # TCL_BIN_DIR_NATIVE # TCL_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ AC_MSG_CHECKING([for Tcl private include files]) TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" if test "${TEA_PLATFORM}" = "windows"; then TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} else TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} fi # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi ;; esac else if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}]) fi fi AC_SUBST(TCL_TOP_DIR_NATIVE) AC_SUBST(TCL_GENERIC_DIR_NATIVE) AC_SUBST(TCL_UNIX_DIR_NATIVE) AC_SUBST(TCL_WIN_DIR_NATIVE) AC_SUBST(TCL_BMAP_DIR_NATIVE) AC_SUBST(TCL_TOOL_DIR_NATIVE) AC_SUBST(TCL_PLATFORM_DIR_NATIVE) AC_SUBST(TCL_INCLUDES) AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}]) ]) #------------------------------------------------------------------------ # TEA_PUBLIC_TCL_HEADERS -- # # Locate the installed public Tcl header files # # Arguments: # None. # # Requires: # CYGPATH must be set # # Results: # # Adds a --with-tclinclude switch to configure. # Result is cached. # # Substs the following vars: # TCL_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ AC_MSG_CHECKING([for Tcl public headers]) AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tclh, [ # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) fi else if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers directory case ${TCL_DEFS} in *TCL_FRAMEWORK*) list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" ;; esac fi # Look in the source dir only if Tcl is not installed, # and in that situation, look there before installed locations. if test -f "${TCL_BIN_DIR}/Makefile" ; then list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TCL_INCLUDE_SPEC}" != x ; then d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi ]) # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) else AC_MSG_RESULT([${ac_cv_c_tclh}]) fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TCL_INCLUDES) ]) #------------------------------------------------------------------------ # TEA_PRIVATE_TK_HEADERS -- # # Locate the private Tk include files # # Arguments: # # Requires: # TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has # already been called. # # Results: # # Substs the following vars: # TK_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ AC_MSG_CHECKING([for Tk private include files]) TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" if test "${TEA_PLATFORM}" = "windows"; then TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} else TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} fi # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}" fi if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx" fi if test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TK_DEFS} in *TK_FRAMEWORK*) if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi ;; esac else if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}]) fi fi AC_SUBST(TK_TOP_DIR_NATIVE) AC_SUBST(TK_UNIX_DIR_NATIVE) AC_SUBST(TK_WIN_DIR_NATIVE) AC_SUBST(TK_GENERIC_DIR_NATIVE) AC_SUBST(TK_XLIB_DIR_NATIVE) AC_SUBST(TK_PLATFORM_DIR_NATIVE) AC_SUBST(TK_INCLUDES) AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}]) ]) #------------------------------------------------------------------------ # TEA_PUBLIC_TK_HEADERS -- # # Locate the installed public Tk header files # # Arguments: # None. # # Requires: # CYGPATH must be set # # Results: # # Adds a --with-tkinclude switch to configure. # Result is cached. # # Substs the following vars: # TK_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ AC_MSG_CHECKING([for Tk public headers]) AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tkh, [ # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) fi else if test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use # the framework's Headers directory. case ${TK_DEFS} in *TK_FRAMEWORK*) list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" ;; esac fi # Look in the source dir only if Tk is not installed, # and in that situation, look there before installed locations. if test -f "${TK_BIN_DIR}/Makefile" ; then list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tk's --prefix location, # relative to directory of tkConfig.sh, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TK_PREFIX}/include 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" fi for i in $list ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi ]) # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) else AC_MSG_RESULT([${ac_cv_c_tkh}]) fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TK_INCLUDES) if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then # On Windows and Aqua, we need the X compat headers AC_MSG_CHECKING([for X11 header files]) if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TK_XINCLUDES) fi AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) fi ]) #------------------------------------------------------------------------ # TEA_PROG_TCLSH # Determine the fully qualified path name of the tclsh executable # in the Tcl build directory or the tclsh installed in a bin # directory. This macro will correctly determine the name # of the tclsh executable even if tclsh has not yet been # built in the build directory. The tclsh found is always # associated with a tclConfig.sh file. This tclsh should be used # only for running extension test cases. It should never be # or generation of files (like pkgIndex.tcl) at build time. # # Arguments # none # # Results # Subst's the following values: # TCLSH_PROG #------------------------------------------------------------------------ AC_DEFUN([TEA_PROG_TCLSH], [ AC_MSG_CHECKING([for tclsh]) if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="${TCL_BIN_DIR}/tclsh" fi else # tclConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" fi list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" for i in $list ; do if test -f "$i/${TCLSH_PROG}" ; then REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" break fi done TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" fi AC_MSG_RESULT([${TCLSH_PROG}]) AC_SUBST(TCLSH_PROG) ]) #------------------------------------------------------------------------ # TEA_PROG_WISH # Determine the fully qualified path name of the wish executable # in the Tk build directory or the wish installed in a bin # directory. This macro will correctly determine the name # of the wish executable even if wish has not yet been # built in the build directory. The wish found is always # associated with a tkConfig.sh file. This wish should be used # only for running extension test cases. It should never be # or generation of files (like pkgIndex.tcl) at build time. # # Arguments # none # # Results # Subst's the following values: # WISH_PROG #------------------------------------------------------------------------ AC_DEFUN([TEA_PROG_WISH], [ AC_MSG_CHECKING([for wish]) if test -f "${TK_BIN_DIR}/Makefile" ; then # tkConfig.sh is in Tk build directory if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="${TK_BIN_DIR}/wish" fi else # tkConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" fi list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ `ls -d ${TK_PREFIX}/bin 2>/dev/null`" for i in $list ; do if test -f "$i/${WISH_PROG}" ; then REAL_TK_BIN_DIR="`cd "$i"; pwd`/" break fi done WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" fi AC_MSG_RESULT([${WISH_PROG}]) AC_SUBST(WISH_PROG) ]) #------------------------------------------------------------------------ # TEA_PATH_CONFIG -- # # Locate the ${1}Config.sh file and perform a sanity check on # the ${1} compile flags. These are used by packages like # [incr Tk] that load *Config.sh files from more than Tcl and Tk. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-$1=... # # Defines the following vars: # $1_BIN_DIR Full path to the directory containing # the $1Config.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_CONFIG], [ # # Ok, lets find the $1 configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-$1 # if test x"${no_$1}" = x ; then # we reset no_$1 in case something fails here no_$1=true AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) AC_MSG_CHECKING([for $1 configuration]) AC_CACHE_VAL(ac_cv_c_$1config,[ # First check to see if --with-$1 was specified. if test x"${with_$1config}" != x ; then case ${with_$1config} in */$1Config.sh ) if test -f ${with_$1config}; then AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` fi;; esac if test -f "${with_$1config}/$1Config.sh" ; then ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` else AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) fi fi # then check for a private $1 installation if test x"${ac_cv_c_$1config}" = x ; then for i in \ ../$1 \ `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ../../$1 \ `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ../../../$1 \ `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ${srcdir}/../$1 \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi if test -f "$i/unix/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_$1config}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi done fi ]) if test x"${ac_cv_c_$1config}" = x ; then $1_BIN_DIR="# no $1 configs found" AC_MSG_WARN([Cannot find $1 configuration definitions]) exit 0 else no_$1= $1_BIN_DIR=${ac_cv_c_$1config} AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_LOAD_CONFIG -- # # Load the $1Config.sh file # # Arguments: # # Requires the following vars to be set: # $1_BIN_DIR # # Results: # # Subst the following vars: # $1_SRC_DIR # $1_LIB_FILE # $1_LIB_SPEC # #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_CONFIG], [ AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) if test -f "${$1_BIN_DIR}/$1Config.sh" ; then AC_MSG_RESULT([loading]) . "${$1_BIN_DIR}/$1Config.sh" else AC_MSG_RESULT([file not found]) fi # # If the $1_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable $1_LIB_SPEC will be set to the value # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC # instead of $1_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f "${$1_BIN_DIR}/Makefile" ; then AC_MSG_WARN([Found Makefile - using build library specs for $1]) $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} fi AC_SUBST($1_VERSION) AC_SUBST($1_BIN_DIR) AC_SUBST($1_SRC_DIR) AC_SUBST($1_LIB_FILE) AC_SUBST($1_LIB_SPEC) AC_SUBST($1_STUB_LIB_FILE) AC_SUBST($1_STUB_LIB_SPEC) AC_SUBST($1_STUB_LIB_PATH) ]) #------------------------------------------------------------------------ # TEA_PATH_CELIB -- # # Locate Keuchel's celib emulation layer for targeting Win/CE # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-celib=... # # Defines the following vars: # CELIB_DIR Full path to the directory containing # the include and platform lib files #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_CELIB], [ # First, look for one uninstalled. # the alternative search directory is invoked by --with-celib if test x"${no_celib}" = x ; then # we reset no_celib in case something fails here no_celib=true AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) AC_MSG_CHECKING([for Windows/CE celib directory]) AC_CACHE_VAL(ac_cv_c_celibconfig,[ # First check to see if --with-celibconfig was specified. if test x"${with_celibconfig}" != x ; then if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) fi fi # then check for a celib library if test x"${ac_cv_c_celibconfig}" = x ; then for i in \ ../celib-palm-3.0 \ ../celib \ ../../celib-palm-3.0 \ ../../celib \ `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ ${srcdir}/../celib-palm-3.0 \ ${srcdir}/../celib \ `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ ; do if test -d "$i/inc" ; then ac_cv_c_celibconfig=`(cd $i; pwd)` break fi done fi ]) if test x"${ac_cv_c_celibconfig}" = x ; then AC_MSG_ERROR([Cannot find celib support library directory]) else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` AC_MSG_RESULT([found $CELIB_DIR]) fi fi ]) # Local Variables: # mode: autoconf # End: tDOM-0.8.3/tclconfig/CVS/0000755000175000017500000000000011004674374015170 5ustar ssobernissobernitDOM-0.8.3/tclconfig/CVS/Root0000644000175000017500000000006211004674374016034 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/tclconfig/CVS/Entries0000644000175000017500000000017711004674374016531 0ustar ssobernissoberni/README.txt/1.4/Thu Jul 26 23:44:22 2007// /install-sh/1.1/Sun Jul 28 08:04:47 2002// /tcl.m4/1.7/Thu Jul 26 23:44:06 2007// D tDOM-0.8.3/tclconfig/CVS/Repository0000644000175000017500000000001711004674374017270 0ustar ssobernissobernitdom/tclconfig tDOM-0.8.3/tclconfig/README.txt0000644000175000017500000000050310652230726016226 0ustar ssobernissoberniThe other files in this directory are the functional core of the Tcl Extension Architecture (TEA). For more information on TEA see: http://www.tcl.tk/doc/tea/ The other files in this directory are out of the tclconfig directory of: http://cvs.sourceforge.net/viewcvs.py/tcl/sampleextension/ from 2007-07-26 (TEA 3.6). tDOM-0.8.3/expat/0000755000175000017500000000000011004674367013710 5ustar ssobernissobernitDOM-0.8.3/expat/xmlrole.h0000644000175000017500000000571707621501111015537 0ustar ssobernissoberni/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ #ifndef XmlRole_INCLUDED #define XmlRole_INCLUDED 1 #ifdef __VMS /* 0 1 2 3 0 1 2 3 1234567890123456789012345678901 1234567890123456789012345678901 */ #define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt #endif #include "xmltok.h" #ifdef __cplusplus extern "C" { #endif enum { XML_ROLE_ERROR = -1, XML_ROLE_NONE = 0, XML_ROLE_XML_DECL, XML_ROLE_INSTANCE_START, XML_ROLE_DOCTYPE_NONE, XML_ROLE_DOCTYPE_NAME, XML_ROLE_DOCTYPE_SYSTEM_ID, XML_ROLE_DOCTYPE_PUBLIC_ID, XML_ROLE_DOCTYPE_INTERNAL_SUBSET, XML_ROLE_DOCTYPE_CLOSE, XML_ROLE_GENERAL_ENTITY_NAME, XML_ROLE_PARAM_ENTITY_NAME, XML_ROLE_ENTITY_NONE, XML_ROLE_ENTITY_VALUE, XML_ROLE_ENTITY_SYSTEM_ID, XML_ROLE_ENTITY_PUBLIC_ID, XML_ROLE_ENTITY_COMPLETE, XML_ROLE_ENTITY_NOTATION_NAME, XML_ROLE_NOTATION_NONE, XML_ROLE_NOTATION_NAME, XML_ROLE_NOTATION_SYSTEM_ID, XML_ROLE_NOTATION_NO_SYSTEM_ID, XML_ROLE_NOTATION_PUBLIC_ID, XML_ROLE_ATTRIBUTE_NAME, XML_ROLE_ATTRIBUTE_TYPE_CDATA, XML_ROLE_ATTRIBUTE_TYPE_ID, XML_ROLE_ATTRIBUTE_TYPE_IDREF, XML_ROLE_ATTRIBUTE_TYPE_IDREFS, XML_ROLE_ATTRIBUTE_TYPE_ENTITY, XML_ROLE_ATTRIBUTE_TYPE_ENTITIES, XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN, XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS, XML_ROLE_ATTRIBUTE_ENUM_VALUE, XML_ROLE_ATTRIBUTE_NOTATION_VALUE, XML_ROLE_ATTLIST_NONE, XML_ROLE_ATTLIST_ELEMENT_NAME, XML_ROLE_IMPLIED_ATTRIBUTE_VALUE, XML_ROLE_REQUIRED_ATTRIBUTE_VALUE, XML_ROLE_DEFAULT_ATTRIBUTE_VALUE, XML_ROLE_FIXED_ATTRIBUTE_VALUE, XML_ROLE_ELEMENT_NONE, XML_ROLE_ELEMENT_NAME, XML_ROLE_CONTENT_ANY, XML_ROLE_CONTENT_EMPTY, XML_ROLE_CONTENT_PCDATA, XML_ROLE_GROUP_OPEN, XML_ROLE_GROUP_CLOSE, XML_ROLE_GROUP_CLOSE_REP, XML_ROLE_GROUP_CLOSE_OPT, XML_ROLE_GROUP_CLOSE_PLUS, XML_ROLE_GROUP_CHOICE, XML_ROLE_GROUP_SEQUENCE, XML_ROLE_CONTENT_ELEMENT, XML_ROLE_CONTENT_ELEMENT_REP, XML_ROLE_CONTENT_ELEMENT_OPT, XML_ROLE_CONTENT_ELEMENT_PLUS, XML_ROLE_PI, XML_ROLE_COMMENT, #ifdef XML_DTD XML_ROLE_TEXT_DECL, XML_ROLE_IGNORE_SECT, XML_ROLE_INNER_PARAM_ENTITY_REF, #endif /* XML_DTD */ XML_ROLE_PARAM_ENTITY_REF }; typedef struct prolog_state { int (PTRCALL *handler) (struct prolog_state *state, int tok, const char *ptr, const char *end, const ENCODING *enc); unsigned level; int role_none; #ifdef XML_DTD unsigned includeLevel; int documentEntity; int inEntityValue; #endif /* XML_DTD */ } PROLOG_STATE; void XmlPrologStateInit(PROLOG_STATE *); #ifdef XML_DTD void XmlPrologStateInitExternalEntity(PROLOG_STATE *); #endif /* XML_DTD */ #define XmlTokenRole(state, tok, ptr, end, enc) \ (((state)->handler)(state, tok, ptr, end, enc)) #ifdef __cplusplus } #endif #endif /* not XmlRole_INCLUDED */ tDOM-0.8.3/expat/expat_external.h0000644000175000017500000000644410653477535017123 0ustar ssobernissoberni/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ #ifndef Expat_External_INCLUDED #define Expat_External_INCLUDED 1 /* External API definitions */ #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) #define XML_USE_MSC_EXTENSIONS 1 #endif /* Expat tries very hard to make the API boundary very specifically defined. There are two macros defined to control this boundary; each of these can be defined before including this header to achieve some different behavior, but doing so it not recommended or tested frequently. XMLCALL - The calling convention to use for all calls across the "library boundary." This will default to cdecl, and try really hard to tell the compiler that's what we want. XMLIMPORT - Whatever magic is needed to note that a function is to be imported from a dynamically loaded library (.dll, .so, or .sl, depending on your platform). The XMLCALL macro was added in Expat 1.95.7. The only one which is expected to be directly useful in client code is XMLCALL. Note that on at least some Unix versions, the Expat library must be compiled with the cdecl calling convention as the default since system headers may assume the cdecl convention. */ #ifndef XMLCALL #if defined(_MSC_VER) #define XMLCALL __cdecl #elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER) #define XMLCALL __attribute__((cdecl)) #else /* For any platform which uses this definition and supports more than one calling convention, we need to extend this definition to declare the convention used on that platform, if it's possible to do so. If this is the case for your platform, please file a bug report with information on how to identify your platform via the C pre-processor and how to specify the same calling convention as the platform's malloc() implementation. */ #define XMLCALL #endif #endif /* not defined XMLCALL */ #if !defined(XML_STATIC) && !defined(XMLIMPORT) #ifndef XML_BUILDING_EXPAT /* using Expat from an application */ #ifdef XML_USE_MSC_EXTENSIONS #define XMLIMPORT __declspec(dllimport) #endif #endif #endif /* not defined XML_STATIC */ /* If we didn't define it above, define it away: */ #ifndef XMLIMPORT #define XMLIMPORT #endif #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL #ifdef __cplusplus extern "C" { #endif #ifdef XML_UNICODE_WCHAR_T #define XML_UNICODE #endif #ifdef XML_UNICODE /* Information is UTF-16 encoded. */ #ifdef XML_UNICODE_WCHAR_T typedef wchar_t XML_Char; typedef wchar_t XML_LChar; #else typedef unsigned short XML_Char; typedef char XML_LChar; #endif /* XML_UNICODE_WCHAR_T */ #else /* Information is UTF-8 encoded. */ typedef char XML_Char; typedef char XML_LChar; #endif /* XML_UNICODE */ #ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */ #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 typedef __int64 XML_Index; typedef unsigned __int64 XML_Size; #else typedef long long XML_Index; typedef unsigned long long XML_Size; #endif #else typedef long XML_Index; typedef unsigned long XML_Size; #endif /* XML_LARGE_SIZE */ #ifdef __cplusplus } #endif #endif /* not Expat_External_INCLUDED */ tDOM-0.8.3/expat/xmlrole.c0000644000175000017500000007733410653477535015563 0ustar ssobernissoberni/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ #include #ifdef COMPILED_FROM_DSP #include "winconfig.h" #elif defined(MACOS_CLASSIC) #include "macconfig.h" #elif defined(__amigaos4__) #include "amigaconfig.h" #elif defined(__WATCOMC__) #include "watcomconfig.h" #else #ifdef HAVE_EXPAT_CONFIG_H #include #endif #endif /* ndef COMPILED_FROM_DSP */ #include "expat_external.h" #include "internal.h" #include "xmlrole.h" #include "ascii.h" /* Doesn't check: that ,| are not mixed in a model group content of literals */ static const char KW_ANY[] = { ASCII_A, ASCII_N, ASCII_Y, '\0' }; static const char KW_ATTLIST[] = { ASCII_A, ASCII_T, ASCII_T, ASCII_L, ASCII_I, ASCII_S, ASCII_T, '\0' }; static const char KW_CDATA[] = { ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; static const char KW_DOCTYPE[] = { ASCII_D, ASCII_O, ASCII_C, ASCII_T, ASCII_Y, ASCII_P, ASCII_E, '\0' }; static const char KW_ELEMENT[] = { ASCII_E, ASCII_L, ASCII_E, ASCII_M, ASCII_E, ASCII_N, ASCII_T, '\0' }; static const char KW_EMPTY[] = { ASCII_E, ASCII_M, ASCII_P, ASCII_T, ASCII_Y, '\0' }; static const char KW_ENTITIES[] = { ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_I, ASCII_E, ASCII_S, '\0' }; static const char KW_ENTITY[] = { ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_Y, '\0' }; static const char KW_FIXED[] = { ASCII_F, ASCII_I, ASCII_X, ASCII_E, ASCII_D, '\0' }; static const char KW_ID[] = { ASCII_I, ASCII_D, '\0' }; static const char KW_IDREF[] = { ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, '\0' }; static const char KW_IDREFS[] = { ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, ASCII_S, '\0' }; #ifdef XML_DTD static const char KW_IGNORE[] = { ASCII_I, ASCII_G, ASCII_N, ASCII_O, ASCII_R, ASCII_E, '\0' }; #endif static const char KW_IMPLIED[] = { ASCII_I, ASCII_M, ASCII_P, ASCII_L, ASCII_I, ASCII_E, ASCII_D, '\0' }; #ifdef XML_DTD static const char KW_INCLUDE[] = { ASCII_I, ASCII_N, ASCII_C, ASCII_L, ASCII_U, ASCII_D, ASCII_E, '\0' }; #endif static const char KW_NDATA[] = { ASCII_N, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; static const char KW_NMTOKEN[] = { ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, '\0' }; static const char KW_NMTOKENS[] = { ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, ASCII_S, '\0' }; static const char KW_NOTATION[] = { ASCII_N, ASCII_O, ASCII_T, ASCII_A, ASCII_T, ASCII_I, ASCII_O, ASCII_N, '\0' }; static const char KW_PCDATA[] = { ASCII_P, ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; static const char KW_PUBLIC[] = { ASCII_P, ASCII_U, ASCII_B, ASCII_L, ASCII_I, ASCII_C, '\0' }; static const char KW_REQUIRED[] = { ASCII_R, ASCII_E, ASCII_Q, ASCII_U, ASCII_I, ASCII_R, ASCII_E, ASCII_D, '\0' }; static const char KW_SYSTEM[] = { ASCII_S, ASCII_Y, ASCII_S, ASCII_T, ASCII_E, ASCII_M, '\0' }; #ifndef MIN_BYTES_PER_CHAR #define MIN_BYTES_PER_CHAR(enc) ((enc)->minBytesPerChar) #endif #ifdef XML_DTD #define setTopLevel(state) \ ((state)->handler = ((state)->documentEntity \ ? internalSubset \ : externalSubset1)) #else /* not XML_DTD */ #define setTopLevel(state) ((state)->handler = internalSubset) #endif /* not XML_DTD */ typedef int PTRCALL PROLOG_HANDLER(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc); static PROLOG_HANDLER prolog0, prolog1, prolog2, doctype0, doctype1, doctype2, doctype3, doctype4, doctype5, internalSubset, entity0, entity1, entity2, entity3, entity4, entity5, entity6, entity7, entity8, entity9, entity10, notation0, notation1, notation2, notation3, notation4, attlist0, attlist1, attlist2, attlist3, attlist4, attlist5, attlist6, attlist7, attlist8, attlist9, element0, element1, element2, element3, element4, element5, element6, element7, #ifdef XML_DTD externalSubset0, externalSubset1, condSect0, condSect1, condSect2, #endif /* XML_DTD */ declClose, error; static int FASTCALL common(PROLOG_STATE *state, int tok); static int PTRCALL prolog0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: state->handler = prolog1; return XML_ROLE_NONE; case XML_TOK_XML_DECL: state->handler = prolog1; return XML_ROLE_XML_DECL; case XML_TOK_PI: state->handler = prolog1; return XML_ROLE_PI; case XML_TOK_COMMENT: state->handler = prolog1; return XML_ROLE_COMMENT; case XML_TOK_BOM: return XML_ROLE_NONE; case XML_TOK_DECL_OPEN: if (!XmlNameMatchesAscii(enc, ptr + 2 * MIN_BYTES_PER_CHAR(enc), end, KW_DOCTYPE)) break; state->handler = doctype0; return XML_ROLE_DOCTYPE_NONE; case XML_TOK_INSTANCE_START: state->handler = error; return XML_ROLE_INSTANCE_START; } return common(state, tok); } static int PTRCALL prolog1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_PI: return XML_ROLE_PI; case XML_TOK_COMMENT: return XML_ROLE_COMMENT; case XML_TOK_BOM: return XML_ROLE_NONE; case XML_TOK_DECL_OPEN: if (!XmlNameMatchesAscii(enc, ptr + 2 * MIN_BYTES_PER_CHAR(enc), end, KW_DOCTYPE)) break; state->handler = doctype0; return XML_ROLE_DOCTYPE_NONE; case XML_TOK_INSTANCE_START: state->handler = error; return XML_ROLE_INSTANCE_START; } return common(state, tok); } static int PTRCALL prolog2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_PI: return XML_ROLE_PI; case XML_TOK_COMMENT: return XML_ROLE_COMMENT; case XML_TOK_INSTANCE_START: state->handler = error; return XML_ROLE_INSTANCE_START; } return common(state, tok); } static int PTRCALL doctype0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_DOCTYPE_NONE; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = doctype1; return XML_ROLE_DOCTYPE_NAME; } return common(state, tok); } static int PTRCALL doctype1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_DOCTYPE_NONE; case XML_TOK_OPEN_BRACKET: state->handler = internalSubset; return XML_ROLE_DOCTYPE_INTERNAL_SUBSET; case XML_TOK_DECL_CLOSE: state->handler = prolog2; return XML_ROLE_DOCTYPE_CLOSE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { state->handler = doctype3; return XML_ROLE_DOCTYPE_NONE; } if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { state->handler = doctype2; return XML_ROLE_DOCTYPE_NONE; } break; } return common(state, tok); } static int PTRCALL doctype2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_DOCTYPE_NONE; case XML_TOK_LITERAL: state->handler = doctype3; return XML_ROLE_DOCTYPE_PUBLIC_ID; } return common(state, tok); } static int PTRCALL doctype3(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_DOCTYPE_NONE; case XML_TOK_LITERAL: state->handler = doctype4; return XML_ROLE_DOCTYPE_SYSTEM_ID; } return common(state, tok); } static int PTRCALL doctype4(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_DOCTYPE_NONE; case XML_TOK_OPEN_BRACKET: state->handler = internalSubset; return XML_ROLE_DOCTYPE_INTERNAL_SUBSET; case XML_TOK_DECL_CLOSE: state->handler = prolog2; return XML_ROLE_DOCTYPE_CLOSE; } return common(state, tok); } static int PTRCALL doctype5(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_DOCTYPE_NONE; case XML_TOK_DECL_CLOSE: state->handler = prolog2; return XML_ROLE_DOCTYPE_CLOSE; } return common(state, tok); } static int PTRCALL internalSubset(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_DECL_OPEN: if (XmlNameMatchesAscii(enc, ptr + 2 * MIN_BYTES_PER_CHAR(enc), end, KW_ENTITY)) { state->handler = entity0; return XML_ROLE_ENTITY_NONE; } if (XmlNameMatchesAscii(enc, ptr + 2 * MIN_BYTES_PER_CHAR(enc), end, KW_ATTLIST)) { state->handler = attlist0; return XML_ROLE_ATTLIST_NONE; } if (XmlNameMatchesAscii(enc, ptr + 2 * MIN_BYTES_PER_CHAR(enc), end, KW_ELEMENT)) { state->handler = element0; return XML_ROLE_ELEMENT_NONE; } if (XmlNameMatchesAscii(enc, ptr + 2 * MIN_BYTES_PER_CHAR(enc), end, KW_NOTATION)) { state->handler = notation0; return XML_ROLE_NOTATION_NONE; } break; case XML_TOK_PI: return XML_ROLE_PI; case XML_TOK_COMMENT: return XML_ROLE_COMMENT; case XML_TOK_PARAM_ENTITY_REF: return XML_ROLE_PARAM_ENTITY_REF; case XML_TOK_CLOSE_BRACKET: state->handler = doctype5; return XML_ROLE_DOCTYPE_NONE; case XML_TOK_NONE: return XML_ROLE_NONE; } return common(state, tok); } #ifdef XML_DTD static int PTRCALL externalSubset0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { state->handler = externalSubset1; if (tok == XML_TOK_XML_DECL) return XML_ROLE_TEXT_DECL; return externalSubset1(state, tok, ptr, end, enc); } static int PTRCALL externalSubset1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_COND_SECT_OPEN: state->handler = condSect0; return XML_ROLE_NONE; case XML_TOK_COND_SECT_CLOSE: if (state->includeLevel == 0) break; state->includeLevel -= 1; return XML_ROLE_NONE; case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_CLOSE_BRACKET: break; case XML_TOK_NONE: if (state->includeLevel) break; return XML_ROLE_NONE; default: return internalSubset(state, tok, ptr, end, enc); } return common(state, tok); } #endif /* XML_DTD */ static int PTRCALL entity0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ENTITY_NONE; case XML_TOK_PERCENT: state->handler = entity1; return XML_ROLE_ENTITY_NONE; case XML_TOK_NAME: state->handler = entity2; return XML_ROLE_GENERAL_ENTITY_NAME; } return common(state, tok); } static int PTRCALL entity1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ENTITY_NONE; case XML_TOK_NAME: state->handler = entity7; return XML_ROLE_PARAM_ENTITY_NAME; } return common(state, tok); } static int PTRCALL entity2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ENTITY_NONE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { state->handler = entity4; return XML_ROLE_ENTITY_NONE; } if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { state->handler = entity3; return XML_ROLE_ENTITY_NONE; } break; case XML_TOK_LITERAL: state->handler = declClose; state->role_none = XML_ROLE_ENTITY_NONE; return XML_ROLE_ENTITY_VALUE; } return common(state, tok); } static int PTRCALL entity3(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ENTITY_NONE; case XML_TOK_LITERAL: state->handler = entity4; return XML_ROLE_ENTITY_PUBLIC_ID; } return common(state, tok); } static int PTRCALL entity4(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ENTITY_NONE; case XML_TOK_LITERAL: state->handler = entity5; return XML_ROLE_ENTITY_SYSTEM_ID; } return common(state, tok); } static int PTRCALL entity5(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ENTITY_NONE; case XML_TOK_DECL_CLOSE: setTopLevel(state); return XML_ROLE_ENTITY_COMPLETE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, KW_NDATA)) { state->handler = entity6; return XML_ROLE_ENTITY_NONE; } break; } return common(state, tok); } static int PTRCALL entity6(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ENTITY_NONE; case XML_TOK_NAME: state->handler = declClose; state->role_none = XML_ROLE_ENTITY_NONE; return XML_ROLE_ENTITY_NOTATION_NAME; } return common(state, tok); } static int PTRCALL entity7(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ENTITY_NONE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { state->handler = entity9; return XML_ROLE_ENTITY_NONE; } if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { state->handler = entity8; return XML_ROLE_ENTITY_NONE; } break; case XML_TOK_LITERAL: state->handler = declClose; state->role_none = XML_ROLE_ENTITY_NONE; return XML_ROLE_ENTITY_VALUE; } return common(state, tok); } static int PTRCALL entity8(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ENTITY_NONE; case XML_TOK_LITERAL: state->handler = entity9; return XML_ROLE_ENTITY_PUBLIC_ID; } return common(state, tok); } static int PTRCALL entity9(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ENTITY_NONE; case XML_TOK_LITERAL: state->handler = entity10; return XML_ROLE_ENTITY_SYSTEM_ID; } return common(state, tok); } static int PTRCALL entity10(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ENTITY_NONE; case XML_TOK_DECL_CLOSE: setTopLevel(state); return XML_ROLE_ENTITY_COMPLETE; } return common(state, tok); } static int PTRCALL notation0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NOTATION_NONE; case XML_TOK_NAME: state->handler = notation1; return XML_ROLE_NOTATION_NAME; } return common(state, tok); } static int PTRCALL notation1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NOTATION_NONE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { state->handler = notation3; return XML_ROLE_NOTATION_NONE; } if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { state->handler = notation2; return XML_ROLE_NOTATION_NONE; } break; } return common(state, tok); } static int PTRCALL notation2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NOTATION_NONE; case XML_TOK_LITERAL: state->handler = notation4; return XML_ROLE_NOTATION_PUBLIC_ID; } return common(state, tok); } static int PTRCALL notation3(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NOTATION_NONE; case XML_TOK_LITERAL: state->handler = declClose; state->role_none = XML_ROLE_NOTATION_NONE; return XML_ROLE_NOTATION_SYSTEM_ID; } return common(state, tok); } static int PTRCALL notation4(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NOTATION_NONE; case XML_TOK_LITERAL: state->handler = declClose; state->role_none = XML_ROLE_NOTATION_NONE; return XML_ROLE_NOTATION_SYSTEM_ID; case XML_TOK_DECL_CLOSE: setTopLevel(state); return XML_ROLE_NOTATION_NO_SYSTEM_ID; } return common(state, tok); } static int PTRCALL attlist0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ATTLIST_NONE; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = attlist1; return XML_ROLE_ATTLIST_ELEMENT_NAME; } return common(state, tok); } static int PTRCALL attlist1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ATTLIST_NONE; case XML_TOK_DECL_CLOSE: setTopLevel(state); return XML_ROLE_ATTLIST_NONE; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = attlist2; return XML_ROLE_ATTRIBUTE_NAME; } return common(state, tok); } static int PTRCALL attlist2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ATTLIST_NONE; case XML_TOK_NAME: { static const char * const types[] = { KW_CDATA, KW_ID, KW_IDREF, KW_IDREFS, KW_ENTITY, KW_ENTITIES, KW_NMTOKEN, KW_NMTOKENS, }; int i; for (i = 0; i < (int)(sizeof(types)/sizeof(types[0])); i++) if (XmlNameMatchesAscii(enc, ptr, end, types[i])) { state->handler = attlist8; return XML_ROLE_ATTRIBUTE_TYPE_CDATA + i; } } if (XmlNameMatchesAscii(enc, ptr, end, KW_NOTATION)) { state->handler = attlist5; return XML_ROLE_ATTLIST_NONE; } break; case XML_TOK_OPEN_PAREN: state->handler = attlist3; return XML_ROLE_ATTLIST_NONE; } return common(state, tok); } static int PTRCALL attlist3(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ATTLIST_NONE; case XML_TOK_NMTOKEN: case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = attlist4; return XML_ROLE_ATTRIBUTE_ENUM_VALUE; } return common(state, tok); } static int PTRCALL attlist4(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ATTLIST_NONE; case XML_TOK_CLOSE_PAREN: state->handler = attlist8; return XML_ROLE_ATTLIST_NONE; case XML_TOK_OR: state->handler = attlist3; return XML_ROLE_ATTLIST_NONE; } return common(state, tok); } static int PTRCALL attlist5(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ATTLIST_NONE; case XML_TOK_OPEN_PAREN: state->handler = attlist6; return XML_ROLE_ATTLIST_NONE; } return common(state, tok); } static int PTRCALL attlist6(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ATTLIST_NONE; case XML_TOK_NAME: state->handler = attlist7; return XML_ROLE_ATTRIBUTE_NOTATION_VALUE; } return common(state, tok); } static int PTRCALL attlist7(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ATTLIST_NONE; case XML_TOK_CLOSE_PAREN: state->handler = attlist8; return XML_ROLE_ATTLIST_NONE; case XML_TOK_OR: state->handler = attlist6; return XML_ROLE_ATTLIST_NONE; } return common(state, tok); } /* default value */ static int PTRCALL attlist8(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ATTLIST_NONE; case XML_TOK_POUND_NAME: if (XmlNameMatchesAscii(enc, ptr + MIN_BYTES_PER_CHAR(enc), end, KW_IMPLIED)) { state->handler = attlist1; return XML_ROLE_IMPLIED_ATTRIBUTE_VALUE; } if (XmlNameMatchesAscii(enc, ptr + MIN_BYTES_PER_CHAR(enc), end, KW_REQUIRED)) { state->handler = attlist1; return XML_ROLE_REQUIRED_ATTRIBUTE_VALUE; } if (XmlNameMatchesAscii(enc, ptr + MIN_BYTES_PER_CHAR(enc), end, KW_FIXED)) { state->handler = attlist9; return XML_ROLE_ATTLIST_NONE; } break; case XML_TOK_LITERAL: state->handler = attlist1; return XML_ROLE_DEFAULT_ATTRIBUTE_VALUE; } return common(state, tok); } static int PTRCALL attlist9(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ATTLIST_NONE; case XML_TOK_LITERAL: state->handler = attlist1; return XML_ROLE_FIXED_ATTRIBUTE_VALUE; } return common(state, tok); } static int PTRCALL element0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ELEMENT_NONE; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = element1; return XML_ROLE_ELEMENT_NAME; } return common(state, tok); } static int PTRCALL element1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ELEMENT_NONE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, KW_EMPTY)) { state->handler = declClose; state->role_none = XML_ROLE_ELEMENT_NONE; return XML_ROLE_CONTENT_EMPTY; } if (XmlNameMatchesAscii(enc, ptr, end, KW_ANY)) { state->handler = declClose; state->role_none = XML_ROLE_ELEMENT_NONE; return XML_ROLE_CONTENT_ANY; } break; case XML_TOK_OPEN_PAREN: state->handler = element2; state->level = 1; return XML_ROLE_GROUP_OPEN; } return common(state, tok); } static int PTRCALL element2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ELEMENT_NONE; case XML_TOK_POUND_NAME: if (XmlNameMatchesAscii(enc, ptr + MIN_BYTES_PER_CHAR(enc), end, KW_PCDATA)) { state->handler = element3; return XML_ROLE_CONTENT_PCDATA; } break; case XML_TOK_OPEN_PAREN: state->level = 2; state->handler = element6; return XML_ROLE_GROUP_OPEN; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT; case XML_TOK_NAME_QUESTION: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT_OPT; case XML_TOK_NAME_ASTERISK: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT_REP; case XML_TOK_NAME_PLUS: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT_PLUS; } return common(state, tok); } static int PTRCALL element3(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ELEMENT_NONE; case XML_TOK_CLOSE_PAREN: state->handler = declClose; state->role_none = XML_ROLE_ELEMENT_NONE; return XML_ROLE_GROUP_CLOSE; case XML_TOK_CLOSE_PAREN_ASTERISK: state->handler = declClose; state->role_none = XML_ROLE_ELEMENT_NONE; return XML_ROLE_GROUP_CLOSE_REP; case XML_TOK_OR: state->handler = element4; return XML_ROLE_ELEMENT_NONE; } return common(state, tok); } static int PTRCALL element4(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ELEMENT_NONE; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = element5; return XML_ROLE_CONTENT_ELEMENT; } return common(state, tok); } static int PTRCALL element5(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ELEMENT_NONE; case XML_TOK_CLOSE_PAREN_ASTERISK: state->handler = declClose; state->role_none = XML_ROLE_ELEMENT_NONE; return XML_ROLE_GROUP_CLOSE_REP; case XML_TOK_OR: state->handler = element4; return XML_ROLE_ELEMENT_NONE; } return common(state, tok); } static int PTRCALL element6(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ELEMENT_NONE; case XML_TOK_OPEN_PAREN: state->level += 1; return XML_ROLE_GROUP_OPEN; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT; case XML_TOK_NAME_QUESTION: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT_OPT; case XML_TOK_NAME_ASTERISK: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT_REP; case XML_TOK_NAME_PLUS: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT_PLUS; } return common(state, tok); } static int PTRCALL element7(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_ELEMENT_NONE; case XML_TOK_CLOSE_PAREN: state->level -= 1; if (state->level == 0) { state->handler = declClose; state->role_none = XML_ROLE_ELEMENT_NONE; } return XML_ROLE_GROUP_CLOSE; case XML_TOK_CLOSE_PAREN_ASTERISK: state->level -= 1; if (state->level == 0) { state->handler = declClose; state->role_none = XML_ROLE_ELEMENT_NONE; } return XML_ROLE_GROUP_CLOSE_REP; case XML_TOK_CLOSE_PAREN_QUESTION: state->level -= 1; if (state->level == 0) { state->handler = declClose; state->role_none = XML_ROLE_ELEMENT_NONE; } return XML_ROLE_GROUP_CLOSE_OPT; case XML_TOK_CLOSE_PAREN_PLUS: state->level -= 1; if (state->level == 0) { state->handler = declClose; state->role_none = XML_ROLE_ELEMENT_NONE; } return XML_ROLE_GROUP_CLOSE_PLUS; case XML_TOK_COMMA: state->handler = element6; return XML_ROLE_GROUP_SEQUENCE; case XML_TOK_OR: state->handler = element6; return XML_ROLE_GROUP_CHOICE; } return common(state, tok); } #ifdef XML_DTD static int PTRCALL condSect0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, KW_INCLUDE)) { state->handler = condSect1; return XML_ROLE_NONE; } if (XmlNameMatchesAscii(enc, ptr, end, KW_IGNORE)) { state->handler = condSect2; return XML_ROLE_NONE; } break; } return common(state, tok); } static int PTRCALL condSect1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_OPEN_BRACKET: state->handler = externalSubset1; state->includeLevel += 1; return XML_ROLE_NONE; } return common(state, tok); } static int PTRCALL condSect2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_OPEN_BRACKET: state->handler = externalSubset1; return XML_ROLE_IGNORE_SECT; } return common(state, tok); } #endif /* XML_DTD */ static int PTRCALL declClose(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return state->role_none; case XML_TOK_DECL_CLOSE: setTopLevel(state); return state->role_none; } return common(state, tok); } static int PTRCALL error(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { return XML_ROLE_NONE; } static int FASTCALL common(PROLOG_STATE *state, int tok) { #ifdef XML_DTD if (!state->documentEntity && tok == XML_TOK_PARAM_ENTITY_REF) return XML_ROLE_INNER_PARAM_ENTITY_REF; #endif state->handler = error; return XML_ROLE_ERROR; } void XmlPrologStateInit(PROLOG_STATE *state) { state->handler = prolog0; #ifdef XML_DTD state->documentEntity = 1; state->includeLevel = 0; state->inEntityValue = 0; #endif /* XML_DTD */ } #ifdef XML_DTD void XmlPrologStateInitExternalEntity(PROLOG_STATE *state) { state->handler = externalSubset0; state->documentEntity = 0; state->includeLevel = 0; } #endif /* XML_DTD */ tDOM-0.8.3/expat/xmlparse.c0000644000175000017500000057261610653477534015736 0ustar ssobernissoberni/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ #include #include /* memset(), memcpy() */ #include #define XML_BUILDING_EXPAT 1 #ifdef COMPILED_FROM_DSP #include "winconfig.h" #elif defined(MACOS_CLASSIC) #include "macconfig.h" #elif defined(__amigaos4__) #include "amigaconfig.h" #elif defined(__WATCOMC__) #include "watcomconfig.h" #elif defined(HAVE_EXPAT_CONFIG_H) #include #endif /* ndef COMPILED_FROM_DSP */ #include "ascii.h" #include "expat.h" #ifdef XML_UNICODE #define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX #define XmlConvert XmlUtf16Convert #define XmlGetInternalEncoding XmlGetUtf16InternalEncoding #define XmlGetInternalEncodingNS XmlGetUtf16InternalEncodingNS #define XmlEncode XmlUtf16Encode /* Using pointer subtraction to convert to integer type. */ #define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || (((char *)(s) - (char *)NULL) & 1)) typedef unsigned short ICHAR; #else #define XML_ENCODE_MAX XML_UTF8_ENCODE_MAX #define XmlConvert XmlUtf8Convert #define XmlGetInternalEncoding XmlGetUtf8InternalEncoding #define XmlGetInternalEncodingNS XmlGetUtf8InternalEncodingNS #define XmlEncode XmlUtf8Encode #define MUST_CONVERT(enc, s) (!(enc)->isUtf8) typedef char ICHAR; #endif #ifndef XML_NS #define XmlInitEncodingNS XmlInitEncoding #define XmlInitUnknownEncodingNS XmlInitUnknownEncoding #undef XmlGetInternalEncodingNS #define XmlGetInternalEncodingNS XmlGetInternalEncoding #define XmlParseXmlDeclNS XmlParseXmlDecl #endif #ifdef XML_UNICODE #ifdef XML_UNICODE_WCHAR_T #define XML_T(x) (const wchar_t)x #define XML_L(x) L ## x #else #define XML_T(x) (const unsigned short)x #define XML_L(x) x #endif #else #define XML_T(x) x #define XML_L(x) x #endif /* Round up n to be a multiple of sz, where sz is a power of 2. */ #define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1)) /* Handle the case where memmove() doesn't exist. */ #ifndef HAVE_MEMMOVE #ifdef HAVE_BCOPY #define memmove(d,s,l) bcopy((s),(d),(l)) #else #error memmove does not exist on this platform, nor is a substitute available #endif /* HAVE_BCOPY */ #endif /* HAVE_MEMMOVE */ #include "internal.h" #include "xmltok.h" #include "xmlrole.h" typedef const XML_Char *KEY; typedef struct { KEY name; } NAMED; typedef struct { NAMED **v; unsigned char power; size_t size; size_t used; const XML_Memory_Handling_Suite *mem; } HASH_TABLE; /* Basic character hash algorithm, taken from Python's string hash: h = h * 1000003 ^ character, the constant being a prime number. */ #ifdef XML_UNICODE #define CHAR_HASH(h, c) \ (((h) * 0xF4243) ^ (unsigned short)(c)) #else #define CHAR_HASH(h, c) \ (((h) * 0xF4243) ^ (unsigned char)(c)) #endif /* For probing (after a collision) we need a step size relative prime to the hash table size, which is a power of 2. We use double-hashing, since we can calculate a second hash value cheaply by taking those bits of the first hash value that were discarded (masked out) when the table index was calculated: index = hash & mask, where mask = table->size - 1. We limit the maximum step size to table->size / 4 (mask >> 2) and make it odd, since odd numbers are always relative prime to a power of 2. */ #define SECOND_HASH(hash, mask, power) \ ((((hash) & ~(mask)) >> ((power) - 1)) & ((mask) >> 2)) #define PROBE_STEP(hash, mask, power) \ ((unsigned char)((SECOND_HASH(hash, mask, power)) | 1)) typedef struct { NAMED **p; NAMED **end; } HASH_TABLE_ITER; #define INIT_TAG_BUF_SIZE 32 /* must be a multiple of sizeof(XML_Char) */ #define INIT_DATA_BUF_SIZE 1024 #define INIT_ATTS_SIZE 16 #define INIT_ATTS_VERSION 0xFFFFFFFF #define INIT_BLOCK_SIZE 1024 #define INIT_BUFFER_SIZE 1024 #define EXPAND_SPARE 24 typedef struct binding { struct prefix *prefix; struct binding *nextTagBinding; struct binding *prevPrefixBinding; const struct attribute_id *attId; XML_Char *uri; int uriLen; int uriAlloc; } BINDING; typedef struct prefix { const XML_Char *name; BINDING *binding; } PREFIX; typedef struct { const XML_Char *str; const XML_Char *localPart; const XML_Char *prefix; int strLen; int uriLen; int prefixLen; } TAG_NAME; /* TAG represents an open element. The name of the element is stored in both the document and API encodings. The memory buffer 'buf' is a separately-allocated memory area which stores the name. During the XML_Parse()/ XMLParseBuffer() when the element is open, the memory for the 'raw' version of the name (in the document encoding) is shared with the document buffer. If the element is open across calls to XML_Parse()/XML_ParseBuffer(), the buffer is re-allocated to contain the 'raw' name as well. A parser re-uses these structures, maintaining a list of allocated TAG objects in a free list. */ typedef struct tag { struct tag *parent; /* parent of this element */ const char *rawName; /* tagName in the original encoding */ int rawNameLength; TAG_NAME name; /* tagName in the API encoding */ char *buf; /* buffer for name components */ char *bufEnd; /* end of the buffer */ BINDING *bindings; } TAG; typedef struct { const XML_Char *name; const XML_Char *textPtr; int textLen; /* length in XML_Chars */ int processed; /* # of processed bytes - when suspended */ const XML_Char *systemId; const XML_Char *base; const XML_Char *publicId; const XML_Char *notation; XML_Bool open; XML_Bool is_param; XML_Bool is_internal; /* true if declared in internal subset outside PE */ } ENTITY; typedef struct { enum XML_Content_Type type; enum XML_Content_Quant quant; const XML_Char * name; int firstchild; int lastchild; int childcnt; int nextsib; } CONTENT_SCAFFOLD; #define INIT_SCAFFOLD_ELEMENTS 32 typedef struct block { struct block *next; int size; XML_Char s[1]; } BLOCK; typedef struct { BLOCK *blocks; BLOCK *freeBlocks; const XML_Char *end; XML_Char *ptr; XML_Char *start; const XML_Memory_Handling_Suite *mem; } STRING_POOL; /* The XML_Char before the name is used to determine whether an attribute has been specified. */ typedef struct attribute_id { XML_Char *name; PREFIX *prefix; XML_Bool maybeTokenized; XML_Bool xmlns; } ATTRIBUTE_ID; typedef struct { const ATTRIBUTE_ID *id; XML_Bool isCdata; const XML_Char *value; } DEFAULT_ATTRIBUTE; typedef struct { unsigned long version; unsigned long hash; const XML_Char *uriName; } NS_ATT; typedef struct { const XML_Char *name; PREFIX *prefix; const ATTRIBUTE_ID *idAtt; int nDefaultAtts; int allocDefaultAtts; DEFAULT_ATTRIBUTE *defaultAtts; } ELEMENT_TYPE; typedef struct { HASH_TABLE generalEntities; HASH_TABLE elementTypes; HASH_TABLE attributeIds; HASH_TABLE prefixes; STRING_POOL pool; STRING_POOL entityValuePool; /* false once a parameter entity reference has been skipped */ XML_Bool keepProcessing; /* true once an internal or external PE reference has been encountered; this includes the reference to an external subset */ XML_Bool hasParamEntityRefs; XML_Bool standalone; #ifdef XML_DTD /* indicates if external PE has been read */ XML_Bool paramEntityRead; HASH_TABLE paramEntities; #endif /* XML_DTD */ PREFIX defaultPrefix; /* === scaffolding for building content model === */ XML_Bool in_eldecl; CONTENT_SCAFFOLD *scaffold; unsigned contentStringLen; unsigned scaffSize; unsigned scaffCount; int scaffLevel; int *scaffIndex; } DTD; typedef struct open_internal_entity { const char *internalEventPtr; const char *internalEventEndPtr; struct open_internal_entity *next; ENTITY *entity; int startTagLevel; XML_Bool betweenDecl; /* WFC: PE Between Declarations */ } OPEN_INTERNAL_ENTITY; typedef enum XML_Error PTRCALL Processor(XML_Parser parser, const char *start, const char *end, const char **endPtr); static Processor prologProcessor; static Processor prologInitProcessor; static Processor contentProcessor; static Processor cdataSectionProcessor; #ifdef XML_DTD static Processor ignoreSectionProcessor; static Processor externalParEntProcessor; static Processor externalParEntInitProcessor; static Processor entityValueProcessor; static Processor entityValueInitProcessor; #endif /* XML_DTD */ static Processor epilogProcessor; static Processor errorProcessor; static Processor externalEntityInitProcessor; static Processor externalEntityInitProcessor2; static Processor externalEntityInitProcessor3; static Processor externalEntityContentProcessor; static Processor internalEntityProcessor; static enum XML_Error handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName); static enum XML_Error processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *s, const char *next); static enum XML_Error initializeEncoding(XML_Parser parser); static enum XML_Error doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end, int tok, const char *next, const char **nextPtr, XML_Bool haveMore); static enum XML_Error processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl); static enum XML_Error doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, const char *start, const char *end, const char **endPtr, XML_Bool haveMore); static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr, XML_Bool haveMore); #ifdef XML_DTD static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr, XML_Bool haveMore); #endif /* XML_DTD */ static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *, const char *s, TAG_NAME *tagNamePtr, BINDING **bindingsPtr); static enum XML_Error addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr); static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata, XML_Bool isId, const XML_Char *dfltValue, XML_Parser parser); static enum XML_Error storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata, const char *, const char *, STRING_POOL *); static enum XML_Error appendAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata, const char *, const char *, STRING_POOL *); static ATTRIBUTE_ID * getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *); static enum XML_Error storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static int reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static int reportComment(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static void reportDefault(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static const XML_Char * getContext(XML_Parser parser); static XML_Bool setContext(XML_Parser parser, const XML_Char *context); static void FASTCALL normalizePublicId(XML_Char *s); static DTD * dtdCreate(const XML_Memory_Handling_Suite *ms); /* do not call if parentParser != NULL */ static void dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms); static void dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms); static int dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms); static int copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *); static NAMED * lookup(HASH_TABLE *table, KEY name, size_t createSize); static void FASTCALL hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms); static void FASTCALL hashTableClear(HASH_TABLE *); static void FASTCALL hashTableDestroy(HASH_TABLE *); static void FASTCALL hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *); static NAMED * FASTCALL hashTableIterNext(HASH_TABLE_ITER *); static void FASTCALL poolInit(STRING_POOL *, const XML_Memory_Handling_Suite *ms); static void FASTCALL poolClear(STRING_POOL *); static void FASTCALL poolDestroy(STRING_POOL *); static XML_Char * poolAppend(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end); static XML_Char * poolStoreString(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end); static XML_Bool FASTCALL poolGrow(STRING_POOL *pool); static const XML_Char * FASTCALL poolCopyString(STRING_POOL *pool, const XML_Char *s); static const XML_Char * poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n); static const XML_Char * FASTCALL poolAppendString(STRING_POOL *pool, const XML_Char *s); static int FASTCALL nextScaffoldPart(XML_Parser parser); static XML_Content * build_model(XML_Parser parser); static ELEMENT_TYPE * getElementType(XML_Parser parser, const ENCODING *enc, const char *ptr, const char *end); static XML_Parser parserCreate(const XML_Char *encodingName, const XML_Memory_Handling_Suite *memsuite, const XML_Char *nameSep, DTD *dtd); static void parserInit(XML_Parser parser, const XML_Char *encodingName); #define poolStart(pool) ((pool)->start) #define poolEnd(pool) ((pool)->ptr) #define poolLength(pool) ((pool)->ptr - (pool)->start) #define poolChop(pool) ((void)--(pool->ptr)) #define poolLastChar(pool) (((pool)->ptr)[-1]) #define poolDiscard(pool) ((pool)->ptr = (pool)->start) #define poolFinish(pool) ((pool)->start = (pool)->ptr) #define poolAppendChar(pool, c) \ (((pool)->ptr == (pool)->end && !poolGrow(pool)) \ ? 0 \ : ((*((pool)->ptr)++ = c), 1)) struct XML_ParserStruct { /* The first member must be userData so that the XML_GetUserData macro works. */ void *m_userData; void *m_handlerArg; char *m_buffer; const XML_Memory_Handling_Suite m_mem; /* first character to be parsed */ const char *m_bufferPtr; /* past last character to be parsed */ char *m_bufferEnd; /* allocated end of buffer */ const char *m_bufferLim; XML_Index m_parseEndByteIndex; const char *m_parseEndPtr; XML_Char *m_dataBuf; XML_Char *m_dataBufEnd; XML_StartElementHandler m_startElementHandler; XML_EndElementHandler m_endElementHandler; XML_CharacterDataHandler m_characterDataHandler; XML_ProcessingInstructionHandler m_processingInstructionHandler; XML_CommentHandler m_commentHandler; XML_StartCdataSectionHandler m_startCdataSectionHandler; XML_EndCdataSectionHandler m_endCdataSectionHandler; XML_DefaultHandler m_defaultHandler; XML_StartDoctypeDeclHandler m_startDoctypeDeclHandler; XML_EndDoctypeDeclHandler m_endDoctypeDeclHandler; XML_UnparsedEntityDeclHandler m_unparsedEntityDeclHandler; XML_NotationDeclHandler m_notationDeclHandler; XML_StartNamespaceDeclHandler m_startNamespaceDeclHandler; XML_EndNamespaceDeclHandler m_endNamespaceDeclHandler; XML_NotStandaloneHandler m_notStandaloneHandler; XML_ExternalEntityRefHandler m_externalEntityRefHandler; XML_Parser m_externalEntityRefHandlerArg; XML_SkippedEntityHandler m_skippedEntityHandler; XML_UnknownEncodingHandler m_unknownEncodingHandler; XML_ElementDeclHandler m_elementDeclHandler; XML_AttlistDeclHandler m_attlistDeclHandler; XML_EntityDeclHandler m_entityDeclHandler; XML_XmlDeclHandler m_xmlDeclHandler; const ENCODING *m_encoding; INIT_ENCODING m_initEncoding; const ENCODING *m_internalEncoding; const XML_Char *m_protocolEncodingName; XML_Bool m_ns; XML_Bool m_ns_triplets; void *m_unknownEncodingMem; void *m_unknownEncodingData; void *m_unknownEncodingHandlerData; void (XMLCALL *m_unknownEncodingRelease)(void *); PROLOG_STATE m_prologState; Processor *m_processor; enum XML_Error m_errorCode; const char *m_eventPtr; const char *m_eventEndPtr; const char *m_positionPtr; OPEN_INTERNAL_ENTITY *m_openInternalEntities; OPEN_INTERNAL_ENTITY *m_freeInternalEntities; XML_Bool m_defaultExpandInternalEntities; int m_tagLevel; ENTITY *m_declEntity; const XML_Char *m_doctypeName; const XML_Char *m_doctypeSysid; const XML_Char *m_doctypePubid; const XML_Char *m_declAttributeType; const XML_Char *m_declNotationName; const XML_Char *m_declNotationPublicId; ELEMENT_TYPE *m_declElementType; ATTRIBUTE_ID *m_declAttributeId; XML_Bool m_declAttributeIsCdata; XML_Bool m_declAttributeIsId; DTD *m_dtd; const XML_Char *m_curBase; TAG *m_tagStack; TAG *m_freeTagList; BINDING *m_inheritedBindings; BINDING *m_freeBindingList; int m_attsSize; int m_nSpecifiedAtts; int m_idAttIndex; ATTRIBUTE *m_atts; NS_ATT *m_nsAtts; unsigned long m_nsAttsVersion; unsigned char m_nsAttsPower; POSITION m_position; STRING_POOL m_tempPool; STRING_POOL m_temp2Pool; char *m_groupConnector; unsigned int m_groupSize; XML_Char m_namespaceSeparator; XML_Parser m_parentParser; XML_ParsingStatus m_parsingStatus; #ifdef XML_DTD XML_Bool m_isParamEntity; XML_Bool m_useForeignDTD; enum XML_ParamEntityParsing m_paramEntityParsing; #endif }; #define MALLOC(s) (parser->m_mem.malloc_fcn((s))) #define REALLOC(p,s) (parser->m_mem.realloc_fcn((p),(s))) #define FREE(p) (parser->m_mem.free_fcn((p))) #define userData (parser->m_userData) #define handlerArg (parser->m_handlerArg) #define startElementHandler (parser->m_startElementHandler) #define endElementHandler (parser->m_endElementHandler) #define characterDataHandler (parser->m_characterDataHandler) #define processingInstructionHandler \ (parser->m_processingInstructionHandler) #define commentHandler (parser->m_commentHandler) #define startCdataSectionHandler \ (parser->m_startCdataSectionHandler) #define endCdataSectionHandler (parser->m_endCdataSectionHandler) #define defaultHandler (parser->m_defaultHandler) #define startDoctypeDeclHandler (parser->m_startDoctypeDeclHandler) #define endDoctypeDeclHandler (parser->m_endDoctypeDeclHandler) #define unparsedEntityDeclHandler \ (parser->m_unparsedEntityDeclHandler) #define notationDeclHandler (parser->m_notationDeclHandler) #define startNamespaceDeclHandler \ (parser->m_startNamespaceDeclHandler) #define endNamespaceDeclHandler (parser->m_endNamespaceDeclHandler) #define notStandaloneHandler (parser->m_notStandaloneHandler) #define externalEntityRefHandler \ (parser->m_externalEntityRefHandler) #define externalEntityRefHandlerArg \ (parser->m_externalEntityRefHandlerArg) #define internalEntityRefHandler \ (parser->m_internalEntityRefHandler) #define skippedEntityHandler (parser->m_skippedEntityHandler) #define unknownEncodingHandler (parser->m_unknownEncodingHandler) #define elementDeclHandler (parser->m_elementDeclHandler) #define attlistDeclHandler (parser->m_attlistDeclHandler) #define entityDeclHandler (parser->m_entityDeclHandler) #define xmlDeclHandler (parser->m_xmlDeclHandler) #define encoding (parser->m_encoding) #define initEncoding (parser->m_initEncoding) #define internalEncoding (parser->m_internalEncoding) #define unknownEncodingMem (parser->m_unknownEncodingMem) #define unknownEncodingData (parser->m_unknownEncodingData) #define unknownEncodingHandlerData \ (parser->m_unknownEncodingHandlerData) #define unknownEncodingRelease (parser->m_unknownEncodingRelease) #define protocolEncodingName (parser->m_protocolEncodingName) #define ns (parser->m_ns) #define ns_triplets (parser->m_ns_triplets) #define prologState (parser->m_prologState) #define processor (parser->m_processor) #define errorCode (parser->m_errorCode) #define eventPtr (parser->m_eventPtr) #define eventEndPtr (parser->m_eventEndPtr) #define positionPtr (parser->m_positionPtr) #define position (parser->m_position) #define openInternalEntities (parser->m_openInternalEntities) #define freeInternalEntities (parser->m_freeInternalEntities) #define defaultExpandInternalEntities \ (parser->m_defaultExpandInternalEntities) #define tagLevel (parser->m_tagLevel) #define buffer (parser->m_buffer) #define bufferPtr (parser->m_bufferPtr) #define bufferEnd (parser->m_bufferEnd) #define parseEndByteIndex (parser->m_parseEndByteIndex) #define parseEndPtr (parser->m_parseEndPtr) #define bufferLim (parser->m_bufferLim) #define dataBuf (parser->m_dataBuf) #define dataBufEnd (parser->m_dataBufEnd) #define _dtd (parser->m_dtd) #define curBase (parser->m_curBase) #define declEntity (parser->m_declEntity) #define doctypeName (parser->m_doctypeName) #define doctypeSysid (parser->m_doctypeSysid) #define doctypePubid (parser->m_doctypePubid) #define declAttributeType (parser->m_declAttributeType) #define declNotationName (parser->m_declNotationName) #define declNotationPublicId (parser->m_declNotationPublicId) #define declElementType (parser->m_declElementType) #define declAttributeId (parser->m_declAttributeId) #define declAttributeIsCdata (parser->m_declAttributeIsCdata) #define declAttributeIsId (parser->m_declAttributeIsId) #define freeTagList (parser->m_freeTagList) #define freeBindingList (parser->m_freeBindingList) #define inheritedBindings (parser->m_inheritedBindings) #define tagStack (parser->m_tagStack) #define atts (parser->m_atts) #define attsSize (parser->m_attsSize) #define nSpecifiedAtts (parser->m_nSpecifiedAtts) #define idAttIndex (parser->m_idAttIndex) #define nsAtts (parser->m_nsAtts) #define nsAttsVersion (parser->m_nsAttsVersion) #define nsAttsPower (parser->m_nsAttsPower) #define tempPool (parser->m_tempPool) #define temp2Pool (parser->m_temp2Pool) #define groupConnector (parser->m_groupConnector) #define groupSize (parser->m_groupSize) #define namespaceSeparator (parser->m_namespaceSeparator) #define parentParser (parser->m_parentParser) #define ps_parsing (parser->m_parsingStatus.parsing) #define ps_finalBuffer (parser->m_parsingStatus.finalBuffer) #ifdef XML_DTD #define isParamEntity (parser->m_isParamEntity) #define useForeignDTD (parser->m_useForeignDTD) #define paramEntityParsing (parser->m_paramEntityParsing) #endif /* XML_DTD */ XML_Parser XMLCALL XML_ParserCreate(const XML_Char *encodingName) { return XML_ParserCreate_MM(encodingName, NULL, NULL); } XML_Parser XMLCALL XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep) { XML_Char tmp[2]; *tmp = nsSep; return XML_ParserCreate_MM(encodingName, NULL, tmp); } static const XML_Char implicitContext[] = { ASCII_x, ASCII_m, ASCII_l, ASCII_EQUALS, ASCII_h, ASCII_t, ASCII_t, ASCII_p, ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w, ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD, ASCII_o, ASCII_r, ASCII_g, ASCII_SLASH, ASCII_X, ASCII_M, ASCII_L, ASCII_SLASH, ASCII_1, ASCII_9, ASCII_9, ASCII_8, ASCII_SLASH, ASCII_n, ASCII_a, ASCII_m, ASCII_e, ASCII_s, ASCII_p, ASCII_a, ASCII_c, ASCII_e, '\0' }; XML_Parser XMLCALL XML_ParserCreate_MM(const XML_Char *encodingName, const XML_Memory_Handling_Suite *memsuite, const XML_Char *nameSep) { XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL); if (parser != NULL && ns) { /* implicit context only set for root parser, since child parsers (i.e. external entity parsers) will inherit it */ if (!setContext(parser, implicitContext)) { XML_ParserFree(parser); return NULL; } } return parser; } static XML_Parser parserCreate(const XML_Char *encodingName, const XML_Memory_Handling_Suite *memsuite, const XML_Char *nameSep, DTD *dtd) { XML_Parser parser; if (memsuite) { XML_Memory_Handling_Suite *mtemp; parser = (XML_Parser) memsuite->malloc_fcn(sizeof(struct XML_ParserStruct)); if (parser != NULL) { mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem); mtemp->malloc_fcn = memsuite->malloc_fcn; mtemp->realloc_fcn = memsuite->realloc_fcn; mtemp->free_fcn = memsuite->free_fcn; } } else { XML_Memory_Handling_Suite *mtemp; parser = (XML_Parser)malloc(sizeof(struct XML_ParserStruct)); if (parser != NULL) { mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem); mtemp->malloc_fcn = malloc; mtemp->realloc_fcn = realloc; mtemp->free_fcn = free; } } if (!parser) return parser; buffer = NULL; bufferLim = NULL; attsSize = INIT_ATTS_SIZE; atts = (ATTRIBUTE *)MALLOC(attsSize * sizeof(ATTRIBUTE)); if (atts == NULL) { FREE(parser); return NULL; } dataBuf = (XML_Char *)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); if (dataBuf == NULL) { FREE(atts); FREE(parser); return NULL; } dataBufEnd = dataBuf + INIT_DATA_BUF_SIZE; if (dtd) _dtd = dtd; else { _dtd = dtdCreate(&parser->m_mem); if (_dtd == NULL) { FREE(dataBuf); FREE(atts); FREE(parser); return NULL; } } freeBindingList = NULL; freeTagList = NULL; freeInternalEntities = NULL; groupSize = 0; groupConnector = NULL; unknownEncodingHandler = NULL; unknownEncodingHandlerData = NULL; namespaceSeparator = ASCII_EXCL; ns = XML_FALSE; ns_triplets = XML_FALSE; nsAtts = NULL; nsAttsVersion = 0; nsAttsPower = 0; poolInit(&tempPool, &(parser->m_mem)); poolInit(&temp2Pool, &(parser->m_mem)); parserInit(parser, encodingName); if (encodingName && !protocolEncodingName) { XML_ParserFree(parser); return NULL; } if (nameSep) { ns = XML_TRUE; internalEncoding = XmlGetInternalEncodingNS(); namespaceSeparator = *nameSep; } else { internalEncoding = XmlGetInternalEncoding(); } return parser; } static void parserInit(XML_Parser parser, const XML_Char *encodingName) { processor = prologInitProcessor; XmlPrologStateInit(&prologState); protocolEncodingName = (encodingName != NULL ? poolCopyString(&tempPool, encodingName) : NULL); curBase = NULL; XmlInitEncoding(&initEncoding, &encoding, 0); userData = NULL; handlerArg = NULL; startElementHandler = NULL; endElementHandler = NULL; characterDataHandler = NULL; processingInstructionHandler = NULL; commentHandler = NULL; startCdataSectionHandler = NULL; endCdataSectionHandler = NULL; defaultHandler = NULL; startDoctypeDeclHandler = NULL; endDoctypeDeclHandler = NULL; unparsedEntityDeclHandler = NULL; notationDeclHandler = NULL; startNamespaceDeclHandler = NULL; endNamespaceDeclHandler = NULL; notStandaloneHandler = NULL; externalEntityRefHandler = NULL; externalEntityRefHandlerArg = parser; skippedEntityHandler = NULL; elementDeclHandler = NULL; attlistDeclHandler = NULL; entityDeclHandler = NULL; xmlDeclHandler = NULL; bufferPtr = buffer; bufferEnd = buffer; parseEndByteIndex = 0; parseEndPtr = NULL; declElementType = NULL; declAttributeId = NULL; declEntity = NULL; doctypeName = NULL; doctypeSysid = NULL; doctypePubid = NULL; declAttributeType = NULL; declNotationName = NULL; declNotationPublicId = NULL; declAttributeIsCdata = XML_FALSE; declAttributeIsId = XML_FALSE; memset(&position, 0, sizeof(POSITION)); errorCode = XML_ERROR_NONE; eventPtr = NULL; eventEndPtr = NULL; positionPtr = NULL; openInternalEntities = NULL; defaultExpandInternalEntities = XML_TRUE; tagLevel = 0; tagStack = NULL; inheritedBindings = NULL; nSpecifiedAtts = 0; unknownEncodingMem = NULL; unknownEncodingRelease = NULL; unknownEncodingData = NULL; parentParser = NULL; ps_parsing = XML_INITIALIZED; #ifdef XML_DTD isParamEntity = XML_FALSE; useForeignDTD = XML_FALSE; paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; #endif } /* moves list of bindings to freeBindingList */ static void FASTCALL moveToFreeBindingList(XML_Parser parser, BINDING *bindings) { while (bindings) { BINDING *b = bindings; bindings = bindings->nextTagBinding; b->nextTagBinding = freeBindingList; freeBindingList = b; } } XML_Bool XMLCALL XML_ParserReset(XML_Parser parser, const XML_Char *encodingName) { TAG *tStk; OPEN_INTERNAL_ENTITY *openEntityList; if (parentParser) return XML_FALSE; /* move tagStack to freeTagList */ tStk = tagStack; while (tStk) { TAG *tag = tStk; tStk = tStk->parent; tag->parent = freeTagList; moveToFreeBindingList(parser, tag->bindings); tag->bindings = NULL; freeTagList = tag; } /* move openInternalEntities to freeInternalEntities */ openEntityList = openInternalEntities; while (openEntityList) { OPEN_INTERNAL_ENTITY *openEntity = openEntityList; openEntityList = openEntity->next; openEntity->next = freeInternalEntities; freeInternalEntities = openEntity; } moveToFreeBindingList(parser, inheritedBindings); FREE(unknownEncodingMem); if (unknownEncodingRelease) unknownEncodingRelease(unknownEncodingData); poolClear(&tempPool); poolClear(&temp2Pool); parserInit(parser, encodingName); dtdReset(_dtd, &parser->m_mem); return setContext(parser, implicitContext); } enum XML_Status XMLCALL XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName) { /* Block after XML_Parse()/XML_ParseBuffer() has been called. XXX There's no way for the caller to determine which of the XXX possible error cases caused the XML_STATUS_ERROR return. */ if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED) return XML_STATUS_ERROR; if (encodingName == NULL) protocolEncodingName = NULL; else { protocolEncodingName = poolCopyString(&tempPool, encodingName); if (!protocolEncodingName) return XML_STATUS_ERROR; } return XML_STATUS_OK; } XML_Parser XMLCALL XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context, const XML_Char *encodingName) { XML_Parser parser = oldParser; DTD *newDtd = NULL; DTD *oldDtd = _dtd; XML_StartElementHandler oldStartElementHandler = startElementHandler; XML_EndElementHandler oldEndElementHandler = endElementHandler; XML_CharacterDataHandler oldCharacterDataHandler = characterDataHandler; XML_ProcessingInstructionHandler oldProcessingInstructionHandler = processingInstructionHandler; XML_CommentHandler oldCommentHandler = commentHandler; XML_StartCdataSectionHandler oldStartCdataSectionHandler = startCdataSectionHandler; XML_EndCdataSectionHandler oldEndCdataSectionHandler = endCdataSectionHandler; XML_DefaultHandler oldDefaultHandler = defaultHandler; XML_UnparsedEntityDeclHandler oldUnparsedEntityDeclHandler = unparsedEntityDeclHandler; XML_NotationDeclHandler oldNotationDeclHandler = notationDeclHandler; XML_StartNamespaceDeclHandler oldStartNamespaceDeclHandler = startNamespaceDeclHandler; XML_EndNamespaceDeclHandler oldEndNamespaceDeclHandler = endNamespaceDeclHandler; XML_NotStandaloneHandler oldNotStandaloneHandler = notStandaloneHandler; XML_ExternalEntityRefHandler oldExternalEntityRefHandler = externalEntityRefHandler; XML_SkippedEntityHandler oldSkippedEntityHandler = skippedEntityHandler; XML_UnknownEncodingHandler oldUnknownEncodingHandler = unknownEncodingHandler; XML_ElementDeclHandler oldElementDeclHandler = elementDeclHandler; XML_AttlistDeclHandler oldAttlistDeclHandler = attlistDeclHandler; XML_EntityDeclHandler oldEntityDeclHandler = entityDeclHandler; XML_XmlDeclHandler oldXmlDeclHandler = xmlDeclHandler; ELEMENT_TYPE * oldDeclElementType = declElementType; void *oldUserData = userData; void *oldHandlerArg = handlerArg; XML_Bool oldDefaultExpandInternalEntities = defaultExpandInternalEntities; XML_Parser oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg; #ifdef XML_DTD enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing; int oldInEntityValue = prologState.inEntityValue; #endif XML_Bool oldns_triplets = ns_triplets; #ifdef XML_DTD if (!context) newDtd = oldDtd; #endif /* XML_DTD */ /* Note that the magical uses of the pre-processor to make field access look more like C++ require that `parser' be overwritten here. This makes this function more painful to follow than it would be otherwise. */ if (ns) { XML_Char tmp[2]; *tmp = namespaceSeparator; parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd); } else { parser = parserCreate(encodingName, &parser->m_mem, NULL, newDtd); } if (!parser) return NULL; startElementHandler = oldStartElementHandler; endElementHandler = oldEndElementHandler; characterDataHandler = oldCharacterDataHandler; processingInstructionHandler = oldProcessingInstructionHandler; commentHandler = oldCommentHandler; startCdataSectionHandler = oldStartCdataSectionHandler; endCdataSectionHandler = oldEndCdataSectionHandler; defaultHandler = oldDefaultHandler; unparsedEntityDeclHandler = oldUnparsedEntityDeclHandler; notationDeclHandler = oldNotationDeclHandler; startNamespaceDeclHandler = oldStartNamespaceDeclHandler; endNamespaceDeclHandler = oldEndNamespaceDeclHandler; notStandaloneHandler = oldNotStandaloneHandler; externalEntityRefHandler = oldExternalEntityRefHandler; skippedEntityHandler = oldSkippedEntityHandler; unknownEncodingHandler = oldUnknownEncodingHandler; elementDeclHandler = oldElementDeclHandler; attlistDeclHandler = oldAttlistDeclHandler; entityDeclHandler = oldEntityDeclHandler; xmlDeclHandler = oldXmlDeclHandler; declElementType = oldDeclElementType; userData = oldUserData; if (oldUserData == oldHandlerArg) handlerArg = userData; else handlerArg = parser; if (oldExternalEntityRefHandlerArg != oldParser) externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg; defaultExpandInternalEntities = oldDefaultExpandInternalEntities; ns_triplets = oldns_triplets; parentParser = oldParser; #ifdef XML_DTD paramEntityParsing = oldParamEntityParsing; prologState.inEntityValue = oldInEntityValue; if (context) { #endif /* XML_DTD */ if (!dtdCopy(_dtd, oldDtd, &parser->m_mem) || !setContext(parser, context)) { XML_ParserFree(parser); return NULL; } processor = externalEntityInitProcessor; #ifdef XML_DTD } else { /* The DTD instance referenced by _dtd is shared between the document's root parser and external PE parsers, therefore one does not need to call setContext. In addition, one also *must* not call setContext, because this would overwrite existing prefix->binding pointers in _dtd with ones that get destroyed with the external PE parser. This would leave those prefixes with dangling pointers. */ isParamEntity = XML_TRUE; XmlPrologStateInitExternalEntity(&prologState); processor = externalParEntInitProcessor; } #endif /* XML_DTD */ return parser; } static void FASTCALL destroyBindings(BINDING *bindings, XML_Parser parser) { for (;;) { BINDING *b = bindings; if (!b) break; bindings = b->nextTagBinding; FREE(b->uri); FREE(b); } } void XMLCALL XML_ParserFree(XML_Parser parser) { TAG *tagList; OPEN_INTERNAL_ENTITY *entityList; if (parser == NULL) return; /* free tagStack and freeTagList */ tagList = tagStack; for (;;) { TAG *p; if (tagList == NULL) { if (freeTagList == NULL) break; tagList = freeTagList; freeTagList = NULL; } p = tagList; tagList = tagList->parent; FREE(p->buf); destroyBindings(p->bindings, parser); FREE(p); } /* free openInternalEntities and freeInternalEntities */ entityList = openInternalEntities; for (;;) { OPEN_INTERNAL_ENTITY *openEntity; if (entityList == NULL) { if (freeInternalEntities == NULL) break; entityList = freeInternalEntities; freeInternalEntities = NULL; } openEntity = entityList; entityList = entityList->next; FREE(openEntity); } destroyBindings(freeBindingList, parser); destroyBindings(inheritedBindings, parser); poolDestroy(&tempPool); poolDestroy(&temp2Pool); #ifdef XML_DTD /* external parameter entity parsers share the DTD structure parser->m_dtd with the root parser, so we must not destroy it */ if (!isParamEntity && _dtd) #else if (_dtd) #endif /* XML_DTD */ dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem); FREE((void *)atts); FREE(groupConnector); FREE(buffer); FREE(dataBuf); FREE(nsAtts); FREE(unknownEncodingMem); if (unknownEncodingRelease) unknownEncodingRelease(unknownEncodingData); FREE(parser); } void XMLCALL XML_UseParserAsHandlerArg(XML_Parser parser) { handlerArg = parser; } enum XML_Error XMLCALL XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD) { #ifdef XML_DTD /* block after XML_Parse()/XML_ParseBuffer() has been called */ if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED) return XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING; useForeignDTD = useDTD; return XML_ERROR_NONE; #else return XML_ERROR_FEATURE_REQUIRES_XML_DTD; #endif } void XMLCALL XML_SetReturnNSTriplet(XML_Parser parser, int do_nst) { /* block after XML_Parse()/XML_ParseBuffer() has been called */ if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED) return; ns_triplets = do_nst ? XML_TRUE : XML_FALSE; } void XMLCALL XML_SetUserData(XML_Parser parser, void *p) { if (handlerArg == userData) handlerArg = userData = p; else userData = p; } enum XML_Status XMLCALL XML_SetBase(XML_Parser parser, const XML_Char *p) { if (p) { p = poolCopyString(&_dtd->pool, p); if (!p) return XML_STATUS_ERROR; curBase = p; } else curBase = NULL; return XML_STATUS_OK; } const XML_Char * XMLCALL XML_GetBase(XML_Parser parser) { return curBase; } int XMLCALL XML_GetSpecifiedAttributeCount(XML_Parser parser) { return nSpecifiedAtts; } int XMLCALL XML_GetIdAttributeIndex(XML_Parser parser) { return idAttIndex; } void XMLCALL XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end) { startElementHandler = start; endElementHandler = end; } void XMLCALL XML_SetStartElementHandler(XML_Parser parser, XML_StartElementHandler start) { startElementHandler = start; } void XMLCALL XML_SetEndElementHandler(XML_Parser parser, XML_EndElementHandler end) { endElementHandler = end; } void XMLCALL XML_SetCharacterDataHandler(XML_Parser parser, XML_CharacterDataHandler handler) { characterDataHandler = handler; } void XMLCALL XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler handler) { processingInstructionHandler = handler; } void XMLCALL XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler handler) { commentHandler = handler; } void XMLCALL XML_SetCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start, XML_EndCdataSectionHandler end) { startCdataSectionHandler = start; endCdataSectionHandler = end; } void XMLCALL XML_SetStartCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start) { startCdataSectionHandler = start; } void XMLCALL XML_SetEndCdataSectionHandler(XML_Parser parser, XML_EndCdataSectionHandler end) { endCdataSectionHandler = end; } void XMLCALL XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler) { defaultHandler = handler; defaultExpandInternalEntities = XML_FALSE; } void XMLCALL XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler) { defaultHandler = handler; defaultExpandInternalEntities = XML_TRUE; } void XMLCALL XML_SetDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start, XML_EndDoctypeDeclHandler end) { startDoctypeDeclHandler = start; endDoctypeDeclHandler = end; } void XMLCALL XML_SetStartDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start) { startDoctypeDeclHandler = start; } void XMLCALL XML_SetEndDoctypeDeclHandler(XML_Parser parser, XML_EndDoctypeDeclHandler end) { endDoctypeDeclHandler = end; } void XMLCALL XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler handler) { unparsedEntityDeclHandler = handler; } void XMLCALL XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler handler) { notationDeclHandler = handler; } void XMLCALL XML_SetNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start, XML_EndNamespaceDeclHandler end) { startNamespaceDeclHandler = start; endNamespaceDeclHandler = end; } void XMLCALL XML_SetStartNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start) { startNamespaceDeclHandler = start; } void XMLCALL XML_SetEndNamespaceDeclHandler(XML_Parser parser, XML_EndNamespaceDeclHandler end) { endNamespaceDeclHandler = end; } void XMLCALL XML_SetNotStandaloneHandler(XML_Parser parser, XML_NotStandaloneHandler handler) { notStandaloneHandler = handler; } void XMLCALL XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler handler) { externalEntityRefHandler = handler; } void XMLCALL XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg) { if (arg) externalEntityRefHandlerArg = (XML_Parser)arg; else externalEntityRefHandlerArg = parser; } void XMLCALL XML_SetSkippedEntityHandler(XML_Parser parser, XML_SkippedEntityHandler handler) { skippedEntityHandler = handler; } void XMLCALL XML_SetUnknownEncodingHandler(XML_Parser parser, XML_UnknownEncodingHandler handler, void *data) { unknownEncodingHandler = handler; unknownEncodingHandlerData = data; } void XMLCALL XML_SetElementDeclHandler(XML_Parser parser, XML_ElementDeclHandler eldecl) { elementDeclHandler = eldecl; } void XMLCALL XML_SetAttlistDeclHandler(XML_Parser parser, XML_AttlistDeclHandler attdecl) { attlistDeclHandler = attdecl; } void XMLCALL XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler) { entityDeclHandler = handler; } void XMLCALL XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler handler) { xmlDeclHandler = handler; } int XMLCALL XML_SetParamEntityParsing(XML_Parser parser, enum XML_ParamEntityParsing peParsing) { /* block after XML_Parse()/XML_ParseBuffer() has been called */ if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED) return 0; #ifdef XML_DTD paramEntityParsing = peParsing; return 1; #else return peParsing == XML_PARAM_ENTITY_PARSING_NEVER; #endif } enum XML_Status XMLCALL XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) { switch (ps_parsing) { case XML_SUSPENDED: errorCode = XML_ERROR_SUSPENDED; return XML_STATUS_ERROR; case XML_FINISHED: errorCode = XML_ERROR_FINISHED; return XML_STATUS_ERROR; default: ps_parsing = XML_PARSING; } if (len == 0) { ps_finalBuffer = (XML_Bool)isFinal; if (!isFinal) return XML_STATUS_OK; positionPtr = bufferPtr; parseEndPtr = bufferEnd; /* If data are left over from last buffer, and we now know that these data are the final chunk of input, then we have to check them again to detect errors based on that fact. */ errorCode = processor(parser, bufferPtr, parseEndPtr, &bufferPtr); if (errorCode == XML_ERROR_NONE) { switch (ps_parsing) { case XML_SUSPENDED: XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position); positionPtr = bufferPtr; return XML_STATUS_SUSPENDED; case XML_INITIALIZED: case XML_PARSING: ps_parsing = XML_FINISHED; /* fall through */ default: return XML_STATUS_OK; } } eventEndPtr = eventPtr; processor = errorProcessor; return XML_STATUS_ERROR; } #ifndef XML_CONTEXT_BYTES else if (bufferPtr == bufferEnd) { const char *end; int nLeftOver; enum XML_Error result; parseEndByteIndex += len; positionPtr = s; ps_finalBuffer = (XML_Bool)isFinal; errorCode = processor(parser, s, parseEndPtr = s + len, &end); if (errorCode != XML_ERROR_NONE) { eventEndPtr = eventPtr; processor = errorProcessor; return XML_STATUS_ERROR; } else { switch (ps_parsing) { case XML_SUSPENDED: result = XML_STATUS_SUSPENDED; break; case XML_INITIALIZED: case XML_PARSING: result = XML_STATUS_OK; if (isFinal) { ps_parsing = XML_FINISHED; return result; } } } XmlUpdatePosition(encoding, positionPtr, end, &position); nLeftOver = s + len - end; if (nLeftOver) { if (buffer == NULL || nLeftOver > bufferLim - buffer) { /* FIXME avoid integer overflow */ char *temp; temp = (buffer == NULL ? (char *)MALLOC(len * 2) : (char *)REALLOC(buffer, len * 2)); if (temp == NULL) { errorCode = XML_ERROR_NO_MEMORY; return XML_STATUS_ERROR; } buffer = temp; if (!buffer) { errorCode = XML_ERROR_NO_MEMORY; eventPtr = eventEndPtr = NULL; processor = errorProcessor; return XML_STATUS_ERROR; } bufferLim = buffer + len * 2; } memcpy(buffer, end, nLeftOver); } bufferPtr = buffer; bufferEnd = buffer + nLeftOver; positionPtr = bufferPtr; parseEndPtr = bufferEnd; eventPtr = bufferPtr; eventEndPtr = bufferPtr; return result; } #endif /* not defined XML_CONTEXT_BYTES */ else { void *buff = XML_GetBuffer(parser, len); if (buff == NULL) return XML_STATUS_ERROR; else { memcpy(buff, s, len); return XML_ParseBuffer(parser, len, isFinal); } } } enum XML_Status XMLCALL XML_ParseBuffer(XML_Parser parser, int len, int isFinal) { const char *start; enum XML_Status result = XML_STATUS_OK; switch (ps_parsing) { case XML_SUSPENDED: errorCode = XML_ERROR_SUSPENDED; return XML_STATUS_ERROR; case XML_FINISHED: errorCode = XML_ERROR_FINISHED; return XML_STATUS_ERROR; default: ps_parsing = XML_PARSING; } start = bufferPtr; positionPtr = start; bufferEnd += len; parseEndPtr = bufferEnd; parseEndByteIndex += len; ps_finalBuffer = (XML_Bool)isFinal; errorCode = processor(parser, start, parseEndPtr, &bufferPtr); if (errorCode != XML_ERROR_NONE) { eventEndPtr = eventPtr; processor = errorProcessor; return XML_STATUS_ERROR; } else { switch (ps_parsing) { case XML_SUSPENDED: result = XML_STATUS_SUSPENDED; break; case XML_INITIALIZED: case XML_PARSING: if (isFinal) { ps_parsing = XML_FINISHED; return result; } default: ; /* should not happen */ } } XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position); positionPtr = bufferPtr; return result; } void * XMLCALL XML_GetBuffer(XML_Parser parser, int len) { switch (ps_parsing) { case XML_SUSPENDED: errorCode = XML_ERROR_SUSPENDED; return NULL; case XML_FINISHED: errorCode = XML_ERROR_FINISHED; return NULL; default: ; } if (len > bufferLim - bufferEnd) { /* FIXME avoid integer overflow */ int neededSize = len + (int)(bufferEnd - bufferPtr); #ifdef XML_CONTEXT_BYTES int keep = (int)(bufferPtr - buffer); if (keep > XML_CONTEXT_BYTES) keep = XML_CONTEXT_BYTES; neededSize += keep; #endif /* defined XML_CONTEXT_BYTES */ if (neededSize <= bufferLim - buffer) { #ifdef XML_CONTEXT_BYTES if (keep < bufferPtr - buffer) { int offset = (int)(bufferPtr - buffer) - keep; memmove(buffer, &buffer[offset], bufferEnd - bufferPtr + keep); bufferEnd -= offset; bufferPtr -= offset; } #else memmove(buffer, bufferPtr, bufferEnd - bufferPtr); bufferEnd = buffer + (bufferEnd - bufferPtr); bufferPtr = buffer; #endif /* not defined XML_CONTEXT_BYTES */ } else { char *newBuf; int bufferSize = (int)(bufferLim - bufferPtr); if (bufferSize == 0) bufferSize = INIT_BUFFER_SIZE; do { bufferSize *= 2; } while (bufferSize < neededSize); newBuf = (char *)MALLOC(bufferSize); if (newBuf == 0) { errorCode = XML_ERROR_NO_MEMORY; return NULL; } bufferLim = newBuf + bufferSize; #ifdef XML_CONTEXT_BYTES if (bufferPtr) { int keep = (int)(bufferPtr - buffer); if (keep > XML_CONTEXT_BYTES) keep = XML_CONTEXT_BYTES; memcpy(newBuf, &bufferPtr[-keep], bufferEnd - bufferPtr + keep); FREE(buffer); buffer = newBuf; bufferEnd = buffer + (bufferEnd - bufferPtr) + keep; bufferPtr = buffer + keep; } else { bufferEnd = newBuf + (bufferEnd - bufferPtr); bufferPtr = buffer = newBuf; } #else if (bufferPtr) { memcpy(newBuf, bufferPtr, bufferEnd - bufferPtr); FREE(buffer); } bufferEnd = newBuf + (bufferEnd - bufferPtr); bufferPtr = buffer = newBuf; #endif /* not defined XML_CONTEXT_BYTES */ } } return bufferEnd; } enum XML_Status XMLCALL XML_StopParser(XML_Parser parser, XML_Bool resumable) { switch (ps_parsing) { case XML_SUSPENDED: if (resumable) { errorCode = XML_ERROR_SUSPENDED; return XML_STATUS_ERROR; } ps_parsing = XML_FINISHED; break; case XML_FINISHED: errorCode = XML_ERROR_FINISHED; return XML_STATUS_ERROR; default: if (resumable) { #ifdef XML_DTD if (isParamEntity) { errorCode = XML_ERROR_SUSPEND_PE; return XML_STATUS_ERROR; } #endif ps_parsing = XML_SUSPENDED; } else ps_parsing = XML_FINISHED; } return XML_STATUS_OK; } enum XML_Status XMLCALL XML_ResumeParser(XML_Parser parser) { enum XML_Status result = XML_STATUS_OK; if (ps_parsing != XML_SUSPENDED) { errorCode = XML_ERROR_NOT_SUSPENDED; return XML_STATUS_ERROR; } ps_parsing = XML_PARSING; errorCode = processor(parser, bufferPtr, parseEndPtr, &bufferPtr); if (errorCode != XML_ERROR_NONE) { eventEndPtr = eventPtr; processor = errorProcessor; return XML_STATUS_ERROR; } else { switch (ps_parsing) { case XML_SUSPENDED: result = XML_STATUS_SUSPENDED; break; case XML_INITIALIZED: case XML_PARSING: if (ps_finalBuffer) { ps_parsing = XML_FINISHED; return result; } default: ; } } XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position); positionPtr = bufferPtr; return result; } void XMLCALL XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status) { assert(status != NULL); *status = parser->m_parsingStatus; } enum XML_Error XMLCALL XML_GetErrorCode(XML_Parser parser) { return errorCode; } XML_Index XMLCALL XML_GetCurrentByteIndex(XML_Parser parser) { if (eventPtr) return parseEndByteIndex - (parseEndPtr - eventPtr); return -1; } int XMLCALL XML_GetCurrentByteCount(XML_Parser parser) { if (eventEndPtr && eventPtr) return (int)(eventEndPtr - eventPtr); return 0; } const char * XMLCALL XML_GetInputContext(XML_Parser parser, int *offset, int *size) { #ifdef XML_CONTEXT_BYTES if (eventPtr && buffer) { *offset = (int)(eventPtr - buffer); *size = (int)(bufferEnd - buffer); return buffer; } #endif /* defined XML_CONTEXT_BYTES */ return (char *) 0; } XML_Size XMLCALL XML_GetCurrentLineNumber(XML_Parser parser) { if (eventPtr && eventPtr >= positionPtr) { XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); positionPtr = eventPtr; } return position.lineNumber + 1; } XML_Size XMLCALL XML_GetCurrentColumnNumber(XML_Parser parser) { if (eventPtr && eventPtr >= positionPtr) { XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); positionPtr = eventPtr; } return position.columnNumber; } void XMLCALL XML_FreeContentModel(XML_Parser parser, XML_Content *model) { FREE(model); } void * XMLCALL XML_MemMalloc(XML_Parser parser, size_t size) { return MALLOC(size); } void * XMLCALL XML_MemRealloc(XML_Parser parser, void *ptr, size_t size) { return REALLOC(ptr, size); } void XMLCALL XML_MemFree(XML_Parser parser, void *ptr) { FREE(ptr); } void XMLCALL XML_DefaultCurrent(XML_Parser parser) { if (defaultHandler) { if (openInternalEntities) reportDefault(parser, internalEncoding, openInternalEntities->internalEventPtr, openInternalEntities->internalEventEndPtr); else reportDefault(parser, encoding, eventPtr, eventEndPtr); } } const XML_LChar * XMLCALL XML_ErrorString(enum XML_Error code) { static const XML_LChar* const message[] = { 0, XML_L("out of memory"), XML_L("syntax error"), XML_L("no element found"), XML_L("not well-formed (invalid token)"), XML_L("unclosed token"), XML_L("partial character"), XML_L("mismatched tag"), XML_L("duplicate attribute"), XML_L("junk after document element"), XML_L("illegal parameter entity reference"), XML_L("undefined entity"), XML_L("recursive entity reference"), XML_L("asynchronous entity"), XML_L("reference to invalid character number"), XML_L("reference to binary entity"), XML_L("reference to external entity in attribute"), XML_L("XML or text declaration not at start of entity"), XML_L("unknown encoding"), XML_L("encoding specified in XML declaration is incorrect"), XML_L("unclosed CDATA section"), XML_L("error in processing external entity reference"), XML_L("document is not standalone"), XML_L("unexpected parser state - please send a bug report"), XML_L("entity declared in parameter entity"), XML_L("requested feature requires XML_DTD support in Expat"), XML_L("cannot change setting once parsing has begun"), XML_L("unbound prefix"), XML_L("must not undeclare prefix"), XML_L("incomplete markup in parameter entity"), XML_L("XML declaration not well-formed"), XML_L("text declaration not well-formed"), XML_L("illegal character(s) in public id"), XML_L("parser suspended"), XML_L("parser not suspended"), XML_L("parsing aborted"), XML_L("parsing finished"), XML_L("cannot suspend in external parameter entity"), XML_L("reserved prefix (xml) must not be undeclared or bound to another namespace name"), XML_L("reserved prefix (xmlns) must not be declared or undeclared"), XML_L("prefix must not be bound to one of the reserved namespace names") }; if (code > 0 && code < sizeof(message)/sizeof(message[0])) return message[code]; return NULL; } const XML_LChar * XMLCALL XML_ExpatVersion(void) { /* V1 is used to string-ize the version number. However, it would string-ize the actual version macro *names* unless we get them substituted before being passed to V1. CPP is defined to expand a macro, then rescan for more expansions. Thus, we use V2 to expand the version macros, then CPP will expand the resulting V1() macro with the correct numerals. */ /* ### I'm assuming cpp is portable in this respect... */ #define V1(a,b,c) XML_L(#a)XML_L(".")XML_L(#b)XML_L(".")XML_L(#c) #define V2(a,b,c) XML_L("expat_")V1(a,b,c) return V2(XML_MAJOR_VERSION, XML_MINOR_VERSION, XML_MICRO_VERSION); #undef V1 #undef V2 } XML_Expat_Version XMLCALL XML_ExpatVersionInfo(void) { XML_Expat_Version version; version.major = XML_MAJOR_VERSION; version.minor = XML_MINOR_VERSION; version.micro = XML_MICRO_VERSION; return version; } const XML_Feature * XMLCALL XML_GetFeatureList(void) { static const XML_Feature features[] = { {XML_FEATURE_SIZEOF_XML_CHAR, XML_L("sizeof(XML_Char)"), sizeof(XML_Char)}, {XML_FEATURE_SIZEOF_XML_LCHAR, XML_L("sizeof(XML_LChar)"), sizeof(XML_LChar)}, #ifdef XML_UNICODE {XML_FEATURE_UNICODE, XML_L("XML_UNICODE"), 0}, #endif #ifdef XML_UNICODE_WCHAR_T {XML_FEATURE_UNICODE_WCHAR_T, XML_L("XML_UNICODE_WCHAR_T"), 0}, #endif #ifdef XML_DTD {XML_FEATURE_DTD, XML_L("XML_DTD"), 0}, #endif #ifdef XML_CONTEXT_BYTES {XML_FEATURE_CONTEXT_BYTES, XML_L("XML_CONTEXT_BYTES"), XML_CONTEXT_BYTES}, #endif #ifdef XML_MIN_SIZE {XML_FEATURE_MIN_SIZE, XML_L("XML_MIN_SIZE"), 0}, #endif #ifdef XML_NS {XML_FEATURE_NS, XML_L("XML_NS"), 0}, #endif #ifdef XML_LARGE_SIZE {XML_FEATURE_LARGE_SIZE, XML_L("XML_LARGE_SIZE"), 0}, #endif {XML_FEATURE_END, NULL, 0} }; return features; } /* Initially tag->rawName always points into the parse buffer; for those TAG instances opened while the current parse buffer was processed, and not yet closed, we need to store tag->rawName in a more permanent location, since the parse buffer is about to be discarded. */ static XML_Bool storeRawNames(XML_Parser parser) { TAG *tag = tagStack; while (tag) { int bufSize; int nameLen = sizeof(XML_Char) * (tag->name.strLen + 1); char *rawNameBuf = tag->buf + nameLen; /* Stop if already stored. Since tagStack is a stack, we can stop at the first entry that has already been copied; everything below it in the stack is already been accounted for in a previous call to this function. */ if (tag->rawName == rawNameBuf) break; /* For re-use purposes we need to ensure that the size of tag->buf is a multiple of sizeof(XML_Char). */ bufSize = nameLen + ROUND_UP(tag->rawNameLength, sizeof(XML_Char)); if (bufSize > tag->bufEnd - tag->buf) { char *temp = (char *)REALLOC(tag->buf, bufSize); if (temp == NULL) return XML_FALSE; /* if tag->name.str points to tag->buf (only when namespace processing is off) then we have to update it */ if (tag->name.str == (XML_Char *)tag->buf) tag->name.str = (XML_Char *)temp; /* if tag->name.localPart is set (when namespace processing is on) then update it as well, since it will always point into tag->buf */ if (tag->name.localPart) tag->name.localPart = (XML_Char *)temp + (tag->name.localPart - (XML_Char *)tag->buf); tag->buf = temp; tag->bufEnd = temp + bufSize; rawNameBuf = temp + nameLen; } memcpy(rawNameBuf, tag->rawName, tag->rawNameLength); tag->rawName = rawNameBuf; tag = tag->parent; } return XML_TRUE; } static enum XML_Error PTRCALL contentProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { enum XML_Error result = doContent(parser, 0, encoding, start, end, endPtr, (XML_Bool)!ps_finalBuffer); if (result == XML_ERROR_NONE) { if (!storeRawNames(parser)) return XML_ERROR_NO_MEMORY; } return result; } static enum XML_Error PTRCALL externalEntityInitProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { enum XML_Error result = initializeEncoding(parser); if (result != XML_ERROR_NONE) return result; processor = externalEntityInitProcessor2; return externalEntityInitProcessor2(parser, start, end, endPtr); } static enum XML_Error PTRCALL externalEntityInitProcessor2(XML_Parser parser, const char *start, const char *end, const char **endPtr) { const char *next = start; /* XmlContentTok doesn't always set the last arg */ int tok = XmlContentTok(encoding, start, end, &next); switch (tok) { case XML_TOK_BOM: /* If we are at the end of the buffer, this would cause the next stage, i.e. externalEntityInitProcessor3, to pass control directly to doContent (by detecting XML_TOK_NONE) without processing any xml text declaration - causing the error XML_ERROR_MISPLACED_XML_PI in doContent. */ if (next == end && !ps_finalBuffer) { *endPtr = next; return XML_ERROR_NONE; } start = next; break; case XML_TOK_PARTIAL: if (!ps_finalBuffer) { *endPtr = start; return XML_ERROR_NONE; } eventPtr = start; return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (!ps_finalBuffer) { *endPtr = start; return XML_ERROR_NONE; } eventPtr = start; return XML_ERROR_PARTIAL_CHAR; } processor = externalEntityInitProcessor3; return externalEntityInitProcessor3(parser, start, end, endPtr); } static enum XML_Error PTRCALL externalEntityInitProcessor3(XML_Parser parser, const char *start, const char *end, const char **endPtr) { int tok; const char *next = start; /* XmlContentTok doesn't always set the last arg */ eventPtr = start; tok = XmlContentTok(encoding, start, end, &next); eventEndPtr = next; switch (tok) { case XML_TOK_XML_DECL: { enum XML_Error result; result = processXmlDecl(parser, 1, start, next); if (result != XML_ERROR_NONE) return result; switch (ps_parsing) { case XML_SUSPENDED: *endPtr = next; return XML_ERROR_NONE; case XML_FINISHED: return XML_ERROR_ABORTED; default: start = next; } } break; case XML_TOK_PARTIAL: if (!ps_finalBuffer) { *endPtr = start; return XML_ERROR_NONE; } return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (!ps_finalBuffer) { *endPtr = start; return XML_ERROR_NONE; } return XML_ERROR_PARTIAL_CHAR; } processor = externalEntityContentProcessor; tagLevel = 1; return externalEntityContentProcessor(parser, start, end, endPtr); } static enum XML_Error PTRCALL externalEntityContentProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { enum XML_Error result = doContent(parser, 1, encoding, start, end, endPtr, (XML_Bool)!ps_finalBuffer); if (result == XML_ERROR_NONE) { if (!storeRawNames(parser)) return XML_ERROR_NO_MEMORY; } return result; } static enum XML_Error doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, const char *s, const char *end, const char **nextPtr, XML_Bool haveMore) { /* save one level of indirection */ DTD * const dtd = _dtd; const char **eventPP; const char **eventEndPP; if (enc == encoding) { eventPP = &eventPtr; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } *eventPP = s; for (;;) { const char *next = s; /* XmlContentTok doesn't always set the last arg */ int tok = XmlContentTok(enc, s, end, &next); *eventEndPP = next; switch (tok) { case XML_TOK_TRAILING_CR: if (haveMore) { *nextPtr = s; return XML_ERROR_NONE; } *eventEndPP = end; if (characterDataHandler) { XML_Char c = 0xA; characterDataHandler(handlerArg, &c, 1); } else if (defaultHandler) reportDefault(parser, enc, s, end); /* We are at the end of the final buffer, should we check for XML_SUSPENDED, XML_FINISHED? */ if (startTagLevel == 0) return XML_ERROR_NO_ELEMENTS; if (tagLevel != startTagLevel) return XML_ERROR_ASYNC_ENTITY; *nextPtr = end; return XML_ERROR_NONE; case XML_TOK_NONE: if (haveMore) { *nextPtr = s; return XML_ERROR_NONE; } if (startTagLevel > 0) { if (tagLevel != startTagLevel) return XML_ERROR_ASYNC_ENTITY; *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_NO_ELEMENTS; case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: if (haveMore) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (haveMore) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_PARTIAL_CHAR; case XML_TOK_ENTITY_REF: { const XML_Char *name; ENTITY *entity; XML_Char ch = (XML_Char) XmlPredefinedEntityName(enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (ch) { if (characterDataHandler) characterDataHandler(handlerArg, &ch, 1); else if (defaultHandler) reportDefault(parser, enc, s, next); break; } name = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!name) return XML_ERROR_NO_MEMORY; entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0); poolDiscard(&dtd->pool); /* First, determine if a check for an existing declaration is needed; if yes, check that the entity exists, and that it is internal, otherwise call the skipped entity or default handler. */ if (!dtd->hasParamEntityRefs || dtd->standalone) { if (!entity) return XML_ERROR_UNDEFINED_ENTITY; else if (!entity->is_internal) return XML_ERROR_ENTITY_DECLARED_IN_PE; } else if (!entity) { if (skippedEntityHandler) skippedEntityHandler(handlerArg, name, 0); else if (defaultHandler) reportDefault(parser, enc, s, next); break; } if (entity->open) return XML_ERROR_RECURSIVE_ENTITY_REF; if (entity->notation) return XML_ERROR_BINARY_ENTITY_REF; if (entity->textPtr) { enum XML_Error result; if (!defaultExpandInternalEntities) { if (skippedEntityHandler) skippedEntityHandler(handlerArg, entity->name, 0); else if (defaultHandler) reportDefault(parser, enc, s, next); break; } result = processInternalEntity(parser, entity, XML_FALSE); if (result != XML_ERROR_NONE) return result; } else if (externalEntityRefHandler) { const XML_Char *context; entity->open = XML_TRUE; context = getContext(parser); entity->open = XML_FALSE; if (!context) return XML_ERROR_NO_MEMORY; if (!externalEntityRefHandler(externalEntityRefHandlerArg, context, entity->base, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; poolDiscard(&tempPool); } else if (defaultHandler) reportDefault(parser, enc, s, next); break; } case XML_TOK_START_TAG_NO_ATTS: /* fall through */ case XML_TOK_START_TAG_WITH_ATTS: { TAG *tag; enum XML_Error result; XML_Char *toPtr; if (freeTagList) { tag = freeTagList; freeTagList = freeTagList->parent; } else { tag = (TAG *)MALLOC(sizeof(TAG)); if (!tag) return XML_ERROR_NO_MEMORY; tag->buf = (char *)MALLOC(INIT_TAG_BUF_SIZE); if (!tag->buf) { FREE(tag); return XML_ERROR_NO_MEMORY; } tag->bufEnd = tag->buf + INIT_TAG_BUF_SIZE; } tag->bindings = NULL; tag->parent = tagStack; tagStack = tag; tag->name.localPart = NULL; tag->name.prefix = NULL; tag->rawName = s + enc->minBytesPerChar; tag->rawNameLength = XmlNameLength(enc, tag->rawName); ++tagLevel; { const char *rawNameEnd = tag->rawName + tag->rawNameLength; const char *fromPtr = tag->rawName; toPtr = (XML_Char *)tag->buf; for (;;) { int bufSize; int convLen; XmlConvert(enc, &fromPtr, rawNameEnd, (ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1); convLen = (int)(toPtr - (XML_Char *)tag->buf); if (fromPtr == rawNameEnd) { tag->name.strLen = convLen; break; } bufSize = (int)(tag->bufEnd - tag->buf) << 1; { char *temp = (char *)REALLOC(tag->buf, bufSize); if (temp == NULL) return XML_ERROR_NO_MEMORY; tag->buf = temp; tag->bufEnd = temp + bufSize; toPtr = (XML_Char *)temp + convLen; } } } tag->name.str = (XML_Char *)tag->buf; *toPtr = XML_T('\0'); result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings)); if (result) return result; if (startElementHandler) startElementHandler(handlerArg, tag->name.str, (const XML_Char **)atts); else if (defaultHandler) reportDefault(parser, enc, s, next); poolClear(&tempPool); break; } case XML_TOK_EMPTY_ELEMENT_NO_ATTS: /* fall through */ case XML_TOK_EMPTY_ELEMENT_WITH_ATTS: { const char *rawName = s + enc->minBytesPerChar; enum XML_Error result; BINDING *bindings = NULL; XML_Bool noElmHandlers = XML_TRUE; TAG_NAME name; name.str = poolStoreString(&tempPool, enc, rawName, rawName + XmlNameLength(enc, rawName)); if (!name.str) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); result = storeAtts(parser, enc, s, &name, &bindings); if (result) return result; poolFinish(&tempPool); if (startElementHandler) { startElementHandler(handlerArg, name.str, (const XML_Char **)atts); noElmHandlers = XML_FALSE; } if (endElementHandler) { if (startElementHandler) *eventPP = *eventEndPP; endElementHandler(handlerArg, name.str); noElmHandlers = XML_FALSE; } if (noElmHandlers && defaultHandler) reportDefault(parser, enc, s, next); poolClear(&tempPool); while (bindings) { BINDING *b = bindings; if (endNamespaceDeclHandler) endNamespaceDeclHandler(handlerArg, b->prefix->name); bindings = bindings->nextTagBinding; b->nextTagBinding = freeBindingList; freeBindingList = b; b->prefix->binding = b->prevPrefixBinding; } } if (tagLevel == 0) return epilogProcessor(parser, next, end, nextPtr); break; case XML_TOK_END_TAG: if (tagLevel == startTagLevel) return XML_ERROR_ASYNC_ENTITY; else { int len; const char *rawName; TAG *tag = tagStack; tagStack = tag->parent; tag->parent = freeTagList; freeTagList = tag; rawName = s + enc->minBytesPerChar*2; len = XmlNameLength(enc, rawName); if (len != tag->rawNameLength || memcmp(tag->rawName, rawName, len) != 0) { *eventPP = rawName; return XML_ERROR_TAG_MISMATCH; } --tagLevel; if (endElementHandler) { const XML_Char *localPart; const XML_Char *prefix; XML_Char *uri; localPart = tag->name.localPart; if (ns && localPart) { /* localPart and prefix may have been overwritten in tag->name.str, since this points to the binding->uri buffer which gets re-used; so we have to add them again */ uri = (XML_Char *)tag->name.str + tag->name.uriLen; /* don't need to check for space - already done in storeAtts() */ while (*localPart) *uri++ = *localPart++; prefix = (XML_Char *)tag->name.prefix; if (ns_triplets && prefix) { *uri++ = namespaceSeparator; while (*prefix) *uri++ = *prefix++; } *uri = XML_T('\0'); } endElementHandler(handlerArg, tag->name.str); } else if (defaultHandler) reportDefault(parser, enc, s, next); while (tag->bindings) { BINDING *b = tag->bindings; if (endNamespaceDeclHandler) endNamespaceDeclHandler(handlerArg, b->prefix->name); tag->bindings = tag->bindings->nextTagBinding; b->nextTagBinding = freeBindingList; freeBindingList = b; b->prefix->binding = b->prevPrefixBinding; } if (tagLevel == 0) return epilogProcessor(parser, next, end, nextPtr); } break; case XML_TOK_CHAR_REF: { int n = XmlCharRefNumber(enc, s); if (n < 0) return XML_ERROR_BAD_CHAR_REF; if (characterDataHandler) { XML_Char buf[XML_ENCODE_MAX]; characterDataHandler(handlerArg, buf, XmlEncode(n, (ICHAR *)buf)); } else if (defaultHandler) reportDefault(parser, enc, s, next); } break; case XML_TOK_XML_DECL: return XML_ERROR_MISPLACED_XML_PI; case XML_TOK_DATA_NEWLINE: if (characterDataHandler) { XML_Char c = 0xA; characterDataHandler(handlerArg, &c, 1); } else if (defaultHandler) reportDefault(parser, enc, s, next); break; case XML_TOK_CDATA_SECT_OPEN: { enum XML_Error result; if (startCdataSectionHandler) startCdataSectionHandler(handlerArg); #if 0 /* Suppose you doing a transformation on a document that involves changing only the character data. You set up a defaultHandler and a characterDataHandler. The defaultHandler simply copies characters through. The characterDataHandler does the transformation and writes the characters out escaping them as necessary. This case will fail to work if we leave out the following two lines (because & and < inside CDATA sections will be incorrectly escaped). However, now we have a start/endCdataSectionHandler, so it seems easier to let the user deal with this. */ else if (characterDataHandler) characterDataHandler(handlerArg, dataBuf, 0); #endif else if (defaultHandler) reportDefault(parser, enc, s, next); result = doCdataSection(parser, enc, &next, end, nextPtr, haveMore); if (result != XML_ERROR_NONE) return result; else if (!next) { processor = cdataSectionProcessor; return result; } } break; case XML_TOK_TRAILING_RSQB: if (haveMore) { *nextPtr = s; return XML_ERROR_NONE; } if (characterDataHandler) { if (MUST_CONVERT(enc, s)) { ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); characterDataHandler(handlerArg, dataBuf, (int)(dataPtr - (ICHAR *)dataBuf)); } else characterDataHandler(handlerArg, (XML_Char *)s, (int)((XML_Char *)end - (XML_Char *)s)); } else if (defaultHandler) reportDefault(parser, enc, s, end); /* We are at the end of the final buffer, should we check for XML_SUSPENDED, XML_FINISHED? */ if (startTagLevel == 0) { *eventPP = end; return XML_ERROR_NO_ELEMENTS; } if (tagLevel != startTagLevel) { *eventPP = end; return XML_ERROR_ASYNC_ENTITY; } *nextPtr = end; return XML_ERROR_NONE; case XML_TOK_DATA_CHARS: { XML_CharacterDataHandler charDataHandler = characterDataHandler; if (charDataHandler) { if (MUST_CONVERT(enc, s)) { for (;;) { ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = s; charDataHandler(handlerArg, dataBuf, (int)(dataPtr - (ICHAR *)dataBuf)); if (s == next) break; *eventPP = s; } } else charDataHandler(handlerArg, (XML_Char *)s, (int)((XML_Char *)next - (XML_Char *)s)); } else if (defaultHandler) reportDefault(parser, enc, s, next); } break; case XML_TOK_PI: if (!reportProcessingInstruction(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_COMMENT: if (!reportComment(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; break; default: if (defaultHandler) reportDefault(parser, enc, s, next); break; } *eventPP = s = next; switch (ps_parsing) { case XML_SUSPENDED: *nextPtr = next; return XML_ERROR_NONE; case XML_FINISHED: return XML_ERROR_ABORTED; default: ; } } /* not reached */ } /* Precondition: all arguments must be non-NULL; Purpose: - normalize attributes - check attributes for well-formedness - generate namespace aware attribute names (URI, prefix) - build list of attributes for startElementHandler - default attributes - process namespace declarations (check and report them) - generate namespace aware element name (URI, prefix) */ static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr, TAG_NAME *tagNamePtr, BINDING **bindingsPtr) { DTD * const dtd = _dtd; /* save one level of indirection */ ELEMENT_TYPE *elementType; int nDefaultAtts; const XML_Char **appAtts; /* the attribute list for the application */ int attIndex = 0; int prefixLen; int i; int n; XML_Char *uri; int nPrefixes = 0; BINDING *binding; const XML_Char *localPart; /* lookup the element type name */ elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, tagNamePtr->str,0); if (!elementType) { const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str); if (!name) return XML_ERROR_NO_MEMORY; elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, name, sizeof(ELEMENT_TYPE)); if (!elementType) return XML_ERROR_NO_MEMORY; if (ns && !setElementTypePrefix(parser, elementType)) return XML_ERROR_NO_MEMORY; } nDefaultAtts = elementType->nDefaultAtts; /* get the attributes from the tokenizer */ n = XmlGetAttributes(enc, attStr, attsSize, atts); if (n + nDefaultAtts > attsSize) { int oldAttsSize = attsSize; ATTRIBUTE *temp; attsSize = n + nDefaultAtts + INIT_ATTS_SIZE; temp = (ATTRIBUTE *)REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE)); if (temp == NULL) return XML_ERROR_NO_MEMORY; atts = temp; if (n > oldAttsSize) XmlGetAttributes(enc, attStr, n, atts); } appAtts = (const XML_Char **)atts; for (i = 0; i < n; i++) { /* add the name and value to the attribute list */ ATTRIBUTE_ID *attId = getAttributeId(parser, enc, atts[i].name, atts[i].name + XmlNameLength(enc, atts[i].name)); if (!attId) return XML_ERROR_NO_MEMORY; /* Detect duplicate attributes by their QNames. This does not work when namespace processing is turned on and different prefixes for the same namespace are used. For this case we have a check further down. */ if ((attId->name)[-1]) { if (enc == encoding) eventPtr = atts[i].name; return XML_ERROR_DUPLICATE_ATTRIBUTE; } (attId->name)[-1] = 1; appAtts[attIndex++] = attId->name; if (!atts[i].normalized) { enum XML_Error result; XML_Bool isCdata = XML_TRUE; /* figure out whether declared as other than CDATA */ if (attId->maybeTokenized) { int j; for (j = 0; j < nDefaultAtts; j++) { if (attId == elementType->defaultAtts[j].id) { isCdata = elementType->defaultAtts[j].isCdata; break; } } } /* normalize the attribute value */ result = storeAttributeValue(parser, enc, isCdata, atts[i].valuePtr, atts[i].valueEnd, &tempPool); if (result) return result; appAtts[attIndex] = poolStart(&tempPool); poolFinish(&tempPool); } else { /* the value did not need normalizing */ appAtts[attIndex] = poolStoreString(&tempPool, enc, atts[i].valuePtr, atts[i].valueEnd); if (appAtts[attIndex] == 0) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); } /* handle prefixed attribute names */ if (attId->prefix) { if (attId->xmlns) { /* deal with namespace declarations here */ enum XML_Error result = addBinding(parser, attId->prefix, attId, appAtts[attIndex], bindingsPtr); if (result) return result; --attIndex; } else { /* deal with other prefixed names later */ attIndex++; nPrefixes++; (attId->name)[-1] = 2; } } else attIndex++; } /* set-up for XML_GetSpecifiedAttributeCount and XML_GetIdAttributeIndex */ nSpecifiedAtts = attIndex; if (elementType->idAtt && (elementType->idAtt->name)[-1]) { for (i = 0; i < attIndex; i += 2) if (appAtts[i] == elementType->idAtt->name) { idAttIndex = i; break; } } else idAttIndex = -1; /* do attribute defaulting */ for (i = 0; i < nDefaultAtts; i++) { const DEFAULT_ATTRIBUTE *da = elementType->defaultAtts + i; if (!(da->id->name)[-1] && da->value) { if (da->id->prefix) { if (da->id->xmlns) { enum XML_Error result = addBinding(parser, da->id->prefix, da->id, da->value, bindingsPtr); if (result) return result; } else { (da->id->name)[-1] = 2; nPrefixes++; appAtts[attIndex++] = da->id->name; appAtts[attIndex++] = da->value; } } else { (da->id->name)[-1] = 1; appAtts[attIndex++] = da->id->name; appAtts[attIndex++] = da->value; } } } appAtts[attIndex] = 0; /* expand prefixed attribute names, check for duplicates, and clear flags that say whether attributes were specified */ i = 0; if (nPrefixes) { int j; /* hash table index */ unsigned long version = nsAttsVersion; int nsAttsSize = (int)1 << nsAttsPower; /* size of hash table must be at least 2 * (# of prefixed attributes) */ if ((nPrefixes << 1) >> nsAttsPower) { /* true for nsAttsPower = 0 */ NS_ATT *temp; /* hash table size must also be a power of 2 and >= 8 */ while (nPrefixes >> nsAttsPower++); if (nsAttsPower < 3) nsAttsPower = 3; nsAttsSize = (int)1 << nsAttsPower; temp = (NS_ATT *)REALLOC(nsAtts, nsAttsSize * sizeof(NS_ATT)); if (!temp) return XML_ERROR_NO_MEMORY; nsAtts = temp; version = 0; /* force re-initialization of nsAtts hash table */ } /* using a version flag saves us from initializing nsAtts every time */ if (!version) { /* initialize version flags when version wraps around */ version = INIT_ATTS_VERSION; for (j = nsAttsSize; j != 0; ) nsAtts[--j].version = version; } nsAttsVersion = --version; /* expand prefixed names and check for duplicates */ for (; i < attIndex; i += 2) { const XML_Char *s = appAtts[i]; if (s[-1] == 2) { /* prefixed */ ATTRIBUTE_ID *id; const BINDING *b; unsigned long uriHash = 0; ((XML_Char *)s)[-1] = 0; /* clear flag */ id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, s, 0); b = id->prefix->binding; if (!b) return XML_ERROR_UNBOUND_PREFIX; /* as we expand the name we also calculate its hash value */ for (j = 0; j < b->uriLen; j++) { const XML_Char c = b->uri[j]; if (!poolAppendChar(&tempPool, c)) return XML_ERROR_NO_MEMORY; uriHash = CHAR_HASH(uriHash, c); } while (*s++ != XML_T(ASCII_COLON)) ; do { /* copies null terminator */ const XML_Char c = *s; if (!poolAppendChar(&tempPool, *s)) return XML_ERROR_NO_MEMORY; uriHash = CHAR_HASH(uriHash, c); } while (*s++); { /* Check hash table for duplicate of expanded name (uriName). Derived from code in lookup(HASH_TABLE *table, ...). */ unsigned char step = 0; unsigned long mask = nsAttsSize - 1; j = uriHash & mask; /* index into hash table */ while (nsAtts[j].version == version) { /* for speed we compare stored hash values first */ if (uriHash == nsAtts[j].hash) { const XML_Char *s1 = poolStart(&tempPool); const XML_Char *s2 = nsAtts[j].uriName; /* s1 is null terminated, but not s2 */ for (; *s1 == *s2 && *s1 != 0; s1++, s2++); if (*s1 == 0) return XML_ERROR_DUPLICATE_ATTRIBUTE; } if (!step) step = PROBE_STEP(uriHash, mask, nsAttsPower); j < step ? (j += nsAttsSize - step) : (j -= step); } } if (ns_triplets) { /* append namespace separator and prefix */ tempPool.ptr[-1] = namespaceSeparator; s = b->prefix->name; do { if (!poolAppendChar(&tempPool, *s)) return XML_ERROR_NO_MEMORY; } while (*s++); } /* store expanded name in attribute list */ s = poolStart(&tempPool); poolFinish(&tempPool); appAtts[i] = s; /* fill empty slot with new version, uriName and hash value */ nsAtts[j].version = version; nsAtts[j].hash = uriHash; nsAtts[j].uriName = s; if (!--nPrefixes) { i += 2; break; } } else /* not prefixed */ ((XML_Char *)s)[-1] = 0; /* clear flag */ } } /* clear flags for the remaining attributes */ for (; i < attIndex; i += 2) ((XML_Char *)(appAtts[i]))[-1] = 0; for (binding = *bindingsPtr; binding; binding = binding->nextTagBinding) binding->attId->name[-1] = 0; if (!ns) return XML_ERROR_NONE; /* expand the element type name */ if (elementType->prefix) { binding = elementType->prefix->binding; if (!binding) return XML_ERROR_UNBOUND_PREFIX; localPart = tagNamePtr->str; while (*localPart++ != XML_T(ASCII_COLON)) ; } else if (dtd->defaultPrefix.binding) { binding = dtd->defaultPrefix.binding; localPart = tagNamePtr->str; } else return XML_ERROR_NONE; prefixLen = 0; if (ns_triplets && binding->prefix->name) { for (; binding->prefix->name[prefixLen++];) ; /* prefixLen includes null terminator */ } tagNamePtr->localPart = localPart; tagNamePtr->uriLen = binding->uriLen; tagNamePtr->prefix = binding->prefix->name; tagNamePtr->prefixLen = prefixLen; for (i = 0; localPart[i++];) ; /* i includes null terminator */ n = i + binding->uriLen + prefixLen; if (n > binding->uriAlloc) { TAG *p; uri = (XML_Char *)MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char)); if (!uri) return XML_ERROR_NO_MEMORY; binding->uriAlloc = n + EXPAND_SPARE; memcpy(uri, binding->uri, binding->uriLen * sizeof(XML_Char)); for (p = tagStack; p; p = p->parent) if (p->name.str == binding->uri) p->name.str = uri; FREE(binding->uri); binding->uri = uri; } /* if namespaceSeparator != '\0' then uri includes it already */ uri = binding->uri + binding->uriLen; memcpy(uri, localPart, i * sizeof(XML_Char)); /* we always have a namespace separator between localPart and prefix */ if (prefixLen) { uri += i - 1; *uri = namespaceSeparator; /* replace null terminator */ memcpy(uri + 1, binding->prefix->name, prefixLen * sizeof(XML_Char)); } tagNamePtr->str = binding->uri; return XML_ERROR_NONE; } /* addBinding() overwrites the value of prefix->binding without checking. Therefore one must keep track of the old value outside of addBinding(). */ static enum XML_Error addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr) { static const XML_Char xmlNamespace[] = { ASCII_h, ASCII_t, ASCII_t, ASCII_p, ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w, ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD, ASCII_o, ASCII_r, ASCII_g, ASCII_SLASH, ASCII_X, ASCII_M, ASCII_L, ASCII_SLASH, ASCII_1, ASCII_9, ASCII_9, ASCII_8, ASCII_SLASH, ASCII_n, ASCII_a, ASCII_m, ASCII_e, ASCII_s, ASCII_p, ASCII_a, ASCII_c, ASCII_e, '\0' }; static const int xmlLen = (int)sizeof(xmlNamespace)/sizeof(XML_Char) - 1; static const XML_Char xmlnsNamespace[] = { ASCII_h, ASCII_t, ASCII_t, ASCII_p, ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w, ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD, ASCII_o, ASCII_r, ASCII_g, ASCII_SLASH, ASCII_2, ASCII_0, ASCII_0, ASCII_0, ASCII_SLASH, ASCII_x, ASCII_m, ASCII_l, ASCII_n, ASCII_s, ASCII_SLASH, '\0' }; static const int xmlnsLen = (int)sizeof(xmlnsNamespace)/sizeof(XML_Char) - 1; XML_Bool mustBeXML = XML_FALSE; XML_Bool isXML = XML_TRUE; XML_Bool isXMLNS = XML_TRUE; BINDING *b; int len; /* empty URI is only valid for default namespace per XML NS 1.0 (not 1.1) */ if (*uri == XML_T('\0') && prefix->name) return XML_ERROR_UNDECLARING_PREFIX; if (prefix->name && prefix->name[0] == XML_T(ASCII_x) && prefix->name[1] == XML_T(ASCII_m) && prefix->name[2] == XML_T(ASCII_l)) { /* Not allowed to bind xmlns */ if (prefix->name[3] == XML_T(ASCII_n) && prefix->name[4] == XML_T(ASCII_s) && prefix->name[5] == XML_T('\0')) return XML_ERROR_RESERVED_PREFIX_XMLNS; if (prefix->name[3] == XML_T('\0')) mustBeXML = XML_TRUE; } for (len = 0; uri[len]; len++) { if (isXML && (len > xmlLen || uri[len] != xmlNamespace[len])) isXML = XML_FALSE; if (!mustBeXML && isXMLNS && (len > xmlnsLen || uri[len] != xmlnsNamespace[len])) isXMLNS = XML_FALSE; } isXML = isXML && len == xmlLen; isXMLNS = isXMLNS && len == xmlnsLen; if (mustBeXML != isXML) return mustBeXML ? XML_ERROR_RESERVED_PREFIX_XML : XML_ERROR_RESERVED_NAMESPACE_URI; if (isXMLNS) return XML_ERROR_RESERVED_NAMESPACE_URI; if (namespaceSeparator) len++; if (freeBindingList) { b = freeBindingList; if (len > b->uriAlloc) { XML_Char *temp = (XML_Char *)REALLOC(b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE)); if (temp == NULL) return XML_ERROR_NO_MEMORY; b->uri = temp; b->uriAlloc = len + EXPAND_SPARE; } freeBindingList = b->nextTagBinding; } else { b = (BINDING *)MALLOC(sizeof(BINDING)); if (!b) return XML_ERROR_NO_MEMORY; b->uri = (XML_Char *)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE)); if (!b->uri) { FREE(b); return XML_ERROR_NO_MEMORY; } b->uriAlloc = len + EXPAND_SPARE; } b->uriLen = len; memcpy(b->uri, uri, len * sizeof(XML_Char)); if (namespaceSeparator) b->uri[len - 1] = namespaceSeparator; b->prefix = prefix; b->attId = attId; b->prevPrefixBinding = prefix->binding; /* NULL binding when default namespace undeclared */ if (*uri == XML_T('\0') && prefix == &_dtd->defaultPrefix) prefix->binding = NULL; else prefix->binding = b; b->nextTagBinding = *bindingsPtr; *bindingsPtr = b; /* if attId == NULL then we are not starting a namespace scope */ if (attId && startNamespaceDeclHandler) startNamespaceDeclHandler(handlerArg, prefix->name, prefix->binding ? uri : 0); return XML_ERROR_NONE; } /* The idea here is to avoid using stack for each CDATA section when the whole file is parsed with one call. */ static enum XML_Error PTRCALL cdataSectionProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { enum XML_Error result = doCdataSection(parser, encoding, &start, end, endPtr, (XML_Bool)!ps_finalBuffer); if (result != XML_ERROR_NONE) return result; if (start) { if (parentParser) { /* we are parsing an external entity */ processor = externalEntityContentProcessor; return externalEntityContentProcessor(parser, start, end, endPtr); } else { processor = contentProcessor; return contentProcessor(parser, start, end, endPtr); } } return result; } /* startPtr gets set to non-null if the section is closed, and to null if the section is not yet closed. */ static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr, const char *end, const char **nextPtr, XML_Bool haveMore) { const char *s = *startPtr; const char **eventPP; const char **eventEndPP; if (enc == encoding) { eventPP = &eventPtr; *eventPP = s; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } *eventPP = s; *startPtr = NULL; for (;;) { const char *next; int tok = XmlCdataSectionTok(enc, s, end, &next); *eventEndPP = next; switch (tok) { case XML_TOK_CDATA_SECT_CLOSE: if (endCdataSectionHandler) endCdataSectionHandler(handlerArg); #if 0 /* see comment under XML_TOK_CDATA_SECT_OPEN */ else if (characterDataHandler) characterDataHandler(handlerArg, dataBuf, 0); #endif else if (defaultHandler) reportDefault(parser, enc, s, next); *startPtr = next; *nextPtr = next; if (ps_parsing == XML_FINISHED) return XML_ERROR_ABORTED; else return XML_ERROR_NONE; case XML_TOK_DATA_NEWLINE: if (characterDataHandler) { XML_Char c = 0xA; characterDataHandler(handlerArg, &c, 1); } else if (defaultHandler) reportDefault(parser, enc, s, next); break; case XML_TOK_DATA_CHARS: { XML_CharacterDataHandler charDataHandler = characterDataHandler; if (charDataHandler) { if (MUST_CONVERT(enc, s)) { for (;;) { ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = next; charDataHandler(handlerArg, dataBuf, (int)(dataPtr - (ICHAR *)dataBuf)); if (s == next) break; *eventPP = s; } } else charDataHandler(handlerArg, (XML_Char *)s, (int)((XML_Char *)next - (XML_Char *)s)); } else if (defaultHandler) reportDefault(parser, enc, s, next); } break; case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL_CHAR: if (haveMore) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_PARTIAL_CHAR; case XML_TOK_PARTIAL: case XML_TOK_NONE: if (haveMore) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_UNCLOSED_CDATA_SECTION; default: *eventPP = next; return XML_ERROR_UNEXPECTED_STATE; } *eventPP = s = next; switch (ps_parsing) { case XML_SUSPENDED: *nextPtr = next; return XML_ERROR_NONE; case XML_FINISHED: return XML_ERROR_ABORTED; default: ; } } /* not reached */ } #ifdef XML_DTD /* The idea here is to avoid using stack for each IGNORE section when the whole file is parsed with one call. */ static enum XML_Error PTRCALL ignoreSectionProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { enum XML_Error result = doIgnoreSection(parser, encoding, &start, end, endPtr, (XML_Bool)!ps_finalBuffer); if (result != XML_ERROR_NONE) return result; if (start) { processor = prologProcessor; return prologProcessor(parser, start, end, endPtr); } return result; } /* startPtr gets set to non-null is the section is closed, and to null if the section is not yet closed. */ static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *enc, const char **startPtr, const char *end, const char **nextPtr, XML_Bool haveMore) { const char *next; int tok; const char *s = *startPtr; const char **eventPP; const char **eventEndPP; if (enc == encoding) { eventPP = &eventPtr; *eventPP = s; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } *eventPP = s; *startPtr = NULL; tok = XmlIgnoreSectionTok(enc, s, end, &next); *eventEndPP = next; switch (tok) { case XML_TOK_IGNORE_SECT: if (defaultHandler) reportDefault(parser, enc, s, next); *startPtr = next; *nextPtr = next; if (ps_parsing == XML_FINISHED) return XML_ERROR_ABORTED; else return XML_ERROR_NONE; case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL_CHAR: if (haveMore) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_PARTIAL_CHAR; case XML_TOK_PARTIAL: case XML_TOK_NONE: if (haveMore) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_SYNTAX; /* XML_ERROR_UNCLOSED_IGNORE_SECTION */ default: *eventPP = next; return XML_ERROR_UNEXPECTED_STATE; } /* not reached */ } #endif /* XML_DTD */ static enum XML_Error initializeEncoding(XML_Parser parser) { const char *s; #ifdef XML_UNICODE char encodingBuf[128]; if (!protocolEncodingName) s = NULL; else { int i; for (i = 0; protocolEncodingName[i]; i++) { if (i == sizeof(encodingBuf) - 1 || (protocolEncodingName[i] & ~0x7f) != 0) { encodingBuf[0] = '\0'; break; } encodingBuf[i] = (char)protocolEncodingName[i]; } encodingBuf[i] = '\0'; s = encodingBuf; } #else s = protocolEncodingName; #endif if ((ns ? XmlInitEncodingNS : XmlInitEncoding)(&initEncoding, &encoding, s)) return XML_ERROR_NONE; return handleUnknownEncoding(parser, protocolEncodingName); } static enum XML_Error processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *s, const char *next) { const char *encodingName = NULL; const XML_Char *storedEncName = NULL; const ENCODING *newEncoding = NULL; const char *version = NULL; const char *versionend; const XML_Char *storedversion = NULL; int standalone = -1; if (!(ns ? XmlParseXmlDeclNS : XmlParseXmlDecl)(isGeneralTextEntity, encoding, s, next, &eventPtr, &version, &versionend, &encodingName, &newEncoding, &standalone)) { if (isGeneralTextEntity) return XML_ERROR_TEXT_DECL; else return XML_ERROR_XML_DECL; } if (!isGeneralTextEntity && standalone == 1) { _dtd->standalone = XML_TRUE; #ifdef XML_DTD if (paramEntityParsing == XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE) paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; #endif /* XML_DTD */ } if (xmlDeclHandler) { if (encodingName != NULL) { storedEncName = poolStoreString(&temp2Pool, encoding, encodingName, encodingName + XmlNameLength(encoding, encodingName)); if (!storedEncName) return XML_ERROR_NO_MEMORY; poolFinish(&temp2Pool); } if (version) { storedversion = poolStoreString(&temp2Pool, encoding, version, versionend - encoding->minBytesPerChar); if (!storedversion) return XML_ERROR_NO_MEMORY; } xmlDeclHandler(handlerArg, storedversion, storedEncName, standalone); } else if (defaultHandler) reportDefault(parser, encoding, s, next); if (protocolEncodingName == NULL) { if (newEncoding) { if (newEncoding->minBytesPerChar != encoding->minBytesPerChar) { eventPtr = encodingName; return XML_ERROR_INCORRECT_ENCODING; } encoding = newEncoding; } else if (encodingName) { enum XML_Error result; if (!storedEncName) { storedEncName = poolStoreString( &temp2Pool, encoding, encodingName, encodingName + XmlNameLength(encoding, encodingName)); if (!storedEncName) return XML_ERROR_NO_MEMORY; } result = handleUnknownEncoding(parser, storedEncName); poolClear(&temp2Pool); if (result == XML_ERROR_UNKNOWN_ENCODING) eventPtr = encodingName; return result; } } if (storedEncName || storedversion) poolClear(&temp2Pool); return XML_ERROR_NONE; } static enum XML_Error handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName) { if (unknownEncodingHandler) { XML_Encoding info; int i; for (i = 0; i < 256; i++) info.map[i] = -1; info.convert = NULL; info.data = NULL; info.release = NULL; if (unknownEncodingHandler(unknownEncodingHandlerData, encodingName, &info)) { ENCODING *enc; unknownEncodingMem = MALLOC(XmlSizeOfUnknownEncoding()); if (!unknownEncodingMem) { if (info.release) info.release(info.data); return XML_ERROR_NO_MEMORY; } enc = (ns ? XmlInitUnknownEncodingNS : XmlInitUnknownEncoding)(unknownEncodingMem, info.map, info.convert, info.data); if (enc) { unknownEncodingData = info.data; unknownEncodingRelease = info.release; encoding = enc; return XML_ERROR_NONE; } } if (info.release != NULL) info.release(info.data); } return XML_ERROR_UNKNOWN_ENCODING; } static enum XML_Error PTRCALL prologInitProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { enum XML_Error result = initializeEncoding(parser); if (result != XML_ERROR_NONE) return result; processor = prologProcessor; return prologProcessor(parser, s, end, nextPtr); } #ifdef XML_DTD static enum XML_Error PTRCALL externalParEntInitProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { enum XML_Error result = initializeEncoding(parser); if (result != XML_ERROR_NONE) return result; /* we know now that XML_Parse(Buffer) has been called, so we consider the external parameter entity read */ _dtd->paramEntityRead = XML_TRUE; if (prologState.inEntityValue) { processor = entityValueInitProcessor; return entityValueInitProcessor(parser, s, end, nextPtr); } else { processor = externalParEntProcessor; return externalParEntProcessor(parser, s, end, nextPtr); } } static enum XML_Error PTRCALL entityValueInitProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { int tok; const char *start = s; const char *next = start; eventPtr = start; for (;;) { tok = XmlPrologTok(encoding, start, end, &next); eventEndPtr = next; if (tok <= 0) { if (!ps_finalBuffer && tok != XML_TOK_INVALID) { *nextPtr = s; return XML_ERROR_NONE; } switch (tok) { case XML_TOK_INVALID: return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; case XML_TOK_NONE: /* start == end */ default: break; } /* found end of entity value - can store it now */ return storeEntityValue(parser, encoding, s, end); } else if (tok == XML_TOK_XML_DECL) { enum XML_Error result; result = processXmlDecl(parser, 0, start, next); if (result != XML_ERROR_NONE) return result; switch (ps_parsing) { case XML_SUSPENDED: *nextPtr = next; return XML_ERROR_NONE; case XML_FINISHED: return XML_ERROR_ABORTED; default: *nextPtr = next; } /* stop scanning for text declaration - we found one */ processor = entityValueProcessor; return entityValueProcessor(parser, next, end, nextPtr); } /* If we are at the end of the buffer, this would cause XmlPrologTok to return XML_TOK_NONE on the next call, which would then cause the function to exit with *nextPtr set to s - that is what we want for other tokens, but not for the BOM - we would rather like to skip it; then, when this routine is entered the next time, XmlPrologTok will return XML_TOK_INVALID, since the BOM is still in the buffer */ else if (tok == XML_TOK_BOM && next == end && !ps_finalBuffer) { *nextPtr = next; return XML_ERROR_NONE; } start = next; eventPtr = start; } } static enum XML_Error PTRCALL externalParEntProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { const char *next = s; int tok; tok = XmlPrologTok(encoding, s, end, &next); if (tok <= 0) { if (!ps_finalBuffer && tok != XML_TOK_INVALID) { *nextPtr = s; return XML_ERROR_NONE; } switch (tok) { case XML_TOK_INVALID: return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; case XML_TOK_NONE: /* start == end */ default: break; } } /* This would cause the next stage, i.e. doProlog to be passed XML_TOK_BOM. However, when parsing an external subset, doProlog will not accept a BOM as valid, and report a syntax error, so we have to skip the BOM */ else if (tok == XML_TOK_BOM) { s = next; tok = XmlPrologTok(encoding, s, end, &next); } processor = prologProcessor; return doProlog(parser, encoding, s, end, tok, next, nextPtr, (XML_Bool)!ps_finalBuffer); } static enum XML_Error PTRCALL entityValueProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { const char *start = s; const char *next = s; const ENCODING *enc = encoding; int tok; for (;;) { tok = XmlPrologTok(enc, start, end, &next); if (tok <= 0) { if (!ps_finalBuffer && tok != XML_TOK_INVALID) { *nextPtr = s; return XML_ERROR_NONE; } switch (tok) { case XML_TOK_INVALID: return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; case XML_TOK_NONE: /* start == end */ default: break; } /* found end of entity value - can store it now */ return storeEntityValue(parser, enc, s, end); } start = next; } } #endif /* XML_DTD */ static enum XML_Error PTRCALL prologProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { const char *next = s; int tok = XmlPrologTok(encoding, s, end, &next); return doProlog(parser, encoding, s, end, tok, next, nextPtr, (XML_Bool)!ps_finalBuffer); } static enum XML_Error doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end, int tok, const char *next, const char **nextPtr, XML_Bool haveMore) { #ifdef XML_DTD static const XML_Char externalSubsetName[] = { ASCII_HASH , '\0' }; #endif /* XML_DTD */ static const XML_Char atypeCDATA[] = { ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; static const XML_Char atypeID[] = { ASCII_I, ASCII_D, '\0' }; static const XML_Char atypeIDREF[] = { ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, '\0' }; static const XML_Char atypeIDREFS[] = { ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, ASCII_S, '\0' }; static const XML_Char atypeENTITY[] = { ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_Y, '\0' }; static const XML_Char atypeENTITIES[] = { ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_I, ASCII_E, ASCII_S, '\0' }; static const XML_Char atypeNMTOKEN[] = { ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, '\0' }; static const XML_Char atypeNMTOKENS[] = { ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, ASCII_S, '\0' }; static const XML_Char notationPrefix[] = { ASCII_N, ASCII_O, ASCII_T, ASCII_A, ASCII_T, ASCII_I, ASCII_O, ASCII_N, ASCII_LPAREN, '\0' }; static const XML_Char enumValueSep[] = { ASCII_PIPE, '\0' }; static const XML_Char enumValueStart[] = { ASCII_LPAREN, '\0' }; /* save one level of indirection */ DTD * const dtd = _dtd; const char **eventPP; const char **eventEndPP; enum XML_Content_Quant quant; if (enc == encoding) { eventPP = &eventPtr; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } for (;;) { int role; XML_Bool handleDefault = XML_TRUE; *eventPP = s; *eventEndPP = next; if (tok <= 0) { if (haveMore && tok != XML_TOK_INVALID) { *nextPtr = s; return XML_ERROR_NONE; } switch (tok) { case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; case XML_TOK_NONE: #ifdef XML_DTD /* for internal PE NOT referenced between declarations */ if (enc != encoding && !openInternalEntities->betweenDecl) { *nextPtr = s; return XML_ERROR_NONE; } /* WFC: PE Between Declarations - must check that PE contains complete markup, not only for external PEs, but also for internal PEs if the reference occurs between declarations. */ if (isParamEntity || enc != encoding) { if (XmlTokenRole(&prologState, XML_TOK_NONE, end, end, enc) == XML_ROLE_ERROR) return XML_ERROR_INCOMPLETE_PE; *nextPtr = s; return XML_ERROR_NONE; } #endif /* XML_DTD */ return XML_ERROR_NO_ELEMENTS; default: tok = -tok; next = end; break; } } role = XmlTokenRole(&prologState, tok, s, next, enc); switch (role) { case XML_ROLE_XML_DECL: { enum XML_Error result = processXmlDecl(parser, 0, s, next); if (result != XML_ERROR_NONE) return result; enc = encoding; handleDefault = XML_FALSE; } break; case XML_ROLE_DOCTYPE_NAME: if (startDoctypeDeclHandler) { doctypeName = poolStoreString(&tempPool, enc, s, next); if (!doctypeName) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); doctypePubid = NULL; handleDefault = XML_FALSE; } doctypeSysid = NULL; /* always initialize to NULL */ break; case XML_ROLE_DOCTYPE_INTERNAL_SUBSET: if (startDoctypeDeclHandler) { startDoctypeDeclHandler(handlerArg, doctypeName, doctypeSysid, doctypePubid, 1); doctypeName = NULL; poolClear(&tempPool); handleDefault = XML_FALSE; } break; #ifdef XML_DTD case XML_ROLE_TEXT_DECL: { enum XML_Error result = processXmlDecl(parser, 1, s, next); if (result != XML_ERROR_NONE) return result; enc = encoding; handleDefault = XML_FALSE; } break; #endif /* XML_DTD */ case XML_ROLE_DOCTYPE_PUBLIC_ID: #ifdef XML_DTD useForeignDTD = XML_FALSE; declEntity = (ENTITY *)lookup(&dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; #endif /* XML_DTD */ dtd->hasParamEntityRefs = XML_TRUE; if (startDoctypeDeclHandler) { if (!XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_PUBLICID; doctypePubid = poolStoreString(&tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!doctypePubid) return XML_ERROR_NO_MEMORY; normalizePublicId((XML_Char *)doctypePubid); poolFinish(&tempPool); handleDefault = XML_FALSE; goto alreadyChecked; } /* fall through */ case XML_ROLE_ENTITY_PUBLIC_ID: if (!XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_PUBLICID; alreadyChecked: if (dtd->keepProcessing && declEntity) { XML_Char *tem = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!tem) return XML_ERROR_NO_MEMORY; normalizePublicId(tem); declEntity->publicId = tem; poolFinish(&dtd->pool); if (entityDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_DOCTYPE_CLOSE: if (doctypeName) { startDoctypeDeclHandler(handlerArg, doctypeName, doctypeSysid, doctypePubid, 0); poolClear(&tempPool); handleDefault = XML_FALSE; } /* doctypeSysid will be non-NULL in the case of a previous XML_ROLE_DOCTYPE_SYSTEM_ID, even if startDoctypeDeclHandler was not set, indicating an external subset */ #ifdef XML_DTD if (doctypeSysid || useForeignDTD) { XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs; dtd->hasParamEntityRefs = XML_TRUE; if (paramEntityParsing && externalEntityRefHandler) { ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (!entity) return XML_ERROR_NO_MEMORY; if (useForeignDTD) entity->base = curBase; dtd->paramEntityRead = XML_FALSE; if (!externalEntityRefHandler(externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; if (dtd->paramEntityRead) { if (!dtd->standalone && notStandaloneHandler && !notStandaloneHandler(handlerArg)) return XML_ERROR_NOT_STANDALONE; } /* if we didn't read the foreign DTD then this means that there is no external subset and we must reset dtd->hasParamEntityRefs */ else if (!doctypeSysid) dtd->hasParamEntityRefs = hadParamEntityRefs; /* end of DTD - no need to update dtd->keepProcessing */ } useForeignDTD = XML_FALSE; } #endif /* XML_DTD */ if (endDoctypeDeclHandler) { endDoctypeDeclHandler(handlerArg); handleDefault = XML_FALSE; } break; case XML_ROLE_INSTANCE_START: #ifdef XML_DTD /* if there is no DOCTYPE declaration then now is the last chance to read the foreign DTD */ if (useForeignDTD) { XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs; dtd->hasParamEntityRefs = XML_TRUE; if (paramEntityParsing && externalEntityRefHandler) { ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (!entity) return XML_ERROR_NO_MEMORY; entity->base = curBase; dtd->paramEntityRead = XML_FALSE; if (!externalEntityRefHandler(externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; if (dtd->paramEntityRead) { if (!dtd->standalone && notStandaloneHandler && !notStandaloneHandler(handlerArg)) return XML_ERROR_NOT_STANDALONE; } /* if we didn't read the foreign DTD then this means that there is no external subset and we must reset dtd->hasParamEntityRefs */ else dtd->hasParamEntityRefs = hadParamEntityRefs; /* end of DTD - no need to update dtd->keepProcessing */ } } #endif /* XML_DTD */ processor = contentProcessor; return contentProcessor(parser, s, end, nextPtr); case XML_ROLE_ATTLIST_ELEMENT_NAME: declElementType = getElementType(parser, enc, s, next); if (!declElementType) return XML_ERROR_NO_MEMORY; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_NAME: declAttributeId = getAttributeId(parser, enc, s, next); if (!declAttributeId) return XML_ERROR_NO_MEMORY; declAttributeIsCdata = XML_FALSE; declAttributeType = NULL; declAttributeIsId = XML_FALSE; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_CDATA: declAttributeIsCdata = XML_TRUE; declAttributeType = atypeCDATA; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_ID: declAttributeIsId = XML_TRUE; declAttributeType = atypeID; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_IDREF: declAttributeType = atypeIDREF; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_IDREFS: declAttributeType = atypeIDREFS; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_ENTITY: declAttributeType = atypeENTITY; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_ENTITIES: declAttributeType = atypeENTITIES; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN: declAttributeType = atypeNMTOKEN; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS: declAttributeType = atypeNMTOKENS; checkAttListDeclHandler: if (dtd->keepProcessing && attlistDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ATTRIBUTE_ENUM_VALUE: case XML_ROLE_ATTRIBUTE_NOTATION_VALUE: if (dtd->keepProcessing && attlistDeclHandler) { const XML_Char *prefix; if (declAttributeType) { prefix = enumValueSep; } else { prefix = (role == XML_ROLE_ATTRIBUTE_NOTATION_VALUE ? notationPrefix : enumValueStart); } if (!poolAppendString(&tempPool, prefix)) return XML_ERROR_NO_MEMORY; if (!poolAppend(&tempPool, enc, s, next)) return XML_ERROR_NO_MEMORY; declAttributeType = tempPool.start; handleDefault = XML_FALSE; } break; case XML_ROLE_IMPLIED_ATTRIBUTE_VALUE: case XML_ROLE_REQUIRED_ATTRIBUTE_VALUE: if (dtd->keepProcessing) { if (!defineAttribute(declElementType, declAttributeId, declAttributeIsCdata, declAttributeIsId, 0, parser)) return XML_ERROR_NO_MEMORY; if (attlistDeclHandler && declAttributeType) { if (*declAttributeType == XML_T(ASCII_LPAREN) || (*declAttributeType == XML_T(ASCII_N) && declAttributeType[1] == XML_T(ASCII_O))) { /* Enumerated or Notation type */ if (!poolAppendChar(&tempPool, XML_T(ASCII_RPAREN)) || !poolAppendChar(&tempPool, XML_T('\0'))) return XML_ERROR_NO_MEMORY; declAttributeType = tempPool.start; poolFinish(&tempPool); } *eventEndPP = s; attlistDeclHandler(handlerArg, declElementType->name, declAttributeId->name, declAttributeType, 0, role == XML_ROLE_REQUIRED_ATTRIBUTE_VALUE); poolClear(&tempPool); handleDefault = XML_FALSE; } } break; case XML_ROLE_DEFAULT_ATTRIBUTE_VALUE: case XML_ROLE_FIXED_ATTRIBUTE_VALUE: if (dtd->keepProcessing) { const XML_Char *attVal; enum XML_Error result = storeAttributeValue(parser, enc, declAttributeIsCdata, s + enc->minBytesPerChar, next - enc->minBytesPerChar, &dtd->pool); if (result) return result; attVal = poolStart(&dtd->pool); poolFinish(&dtd->pool); /* ID attributes aren't allowed to have a default */ if (!defineAttribute(declElementType, declAttributeId, declAttributeIsCdata, XML_FALSE, attVal, parser)) return XML_ERROR_NO_MEMORY; if (attlistDeclHandler && declAttributeType) { if (*declAttributeType == XML_T(ASCII_LPAREN) || (*declAttributeType == XML_T(ASCII_N) && declAttributeType[1] == XML_T(ASCII_O))) { /* Enumerated or Notation type */ if (!poolAppendChar(&tempPool, XML_T(ASCII_RPAREN)) || !poolAppendChar(&tempPool, XML_T('\0'))) return XML_ERROR_NO_MEMORY; declAttributeType = tempPool.start; poolFinish(&tempPool); } *eventEndPP = s; attlistDeclHandler(handlerArg, declElementType->name, declAttributeId->name, declAttributeType, attVal, role == XML_ROLE_FIXED_ATTRIBUTE_VALUE); poolClear(&tempPool); handleDefault = XML_FALSE; } } break; case XML_ROLE_ENTITY_VALUE: if (dtd->keepProcessing) { enum XML_Error result = storeEntityValue(parser, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (declEntity) { declEntity->textPtr = poolStart(&dtd->entityValuePool); declEntity->textLen = (int)(poolLength(&dtd->entityValuePool)); poolFinish(&dtd->entityValuePool); if (entityDeclHandler) { *eventEndPP = s; entityDeclHandler(handlerArg, declEntity->name, declEntity->is_param, declEntity->textPtr, declEntity->textLen, curBase, 0, 0, 0); handleDefault = XML_FALSE; } } else poolDiscard(&dtd->entityValuePool); if (result != XML_ERROR_NONE) return result; } break; case XML_ROLE_DOCTYPE_SYSTEM_ID: #ifdef XML_DTD useForeignDTD = XML_FALSE; #endif /* XML_DTD */ dtd->hasParamEntityRefs = XML_TRUE; if (startDoctypeDeclHandler) { doctypeSysid = poolStoreString(&tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (doctypeSysid == NULL) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); handleDefault = XML_FALSE; } #ifdef XML_DTD else /* use externalSubsetName to make doctypeSysid non-NULL for the case where no startDoctypeDeclHandler is set */ doctypeSysid = externalSubsetName; #endif /* XML_DTD */ if (!dtd->standalone #ifdef XML_DTD && !paramEntityParsing #endif /* XML_DTD */ && notStandaloneHandler && !notStandaloneHandler(handlerArg)) return XML_ERROR_NOT_STANDALONE; #ifndef XML_DTD break; #else /* XML_DTD */ if (!declEntity) { declEntity = (ENTITY *)lookup(&dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; declEntity->publicId = NULL; } /* fall through */ #endif /* XML_DTD */ case XML_ROLE_ENTITY_SYSTEM_ID: if (dtd->keepProcessing && declEntity) { declEntity->systemId = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!declEntity->systemId) return XML_ERROR_NO_MEMORY; declEntity->base = curBase; poolFinish(&dtd->pool); if (entityDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_ENTITY_COMPLETE: if (dtd->keepProcessing && declEntity && entityDeclHandler) { *eventEndPP = s; entityDeclHandler(handlerArg, declEntity->name, declEntity->is_param, 0,0, declEntity->base, declEntity->systemId, declEntity->publicId, 0); handleDefault = XML_FALSE; } break; case XML_ROLE_ENTITY_NOTATION_NAME: if (dtd->keepProcessing && declEntity) { declEntity->notation = poolStoreString(&dtd->pool, enc, s, next); if (!declEntity->notation) return XML_ERROR_NO_MEMORY; poolFinish(&dtd->pool); if (unparsedEntityDeclHandler) { *eventEndPP = s; unparsedEntityDeclHandler(handlerArg, declEntity->name, declEntity->base, declEntity->systemId, declEntity->publicId, declEntity->notation); handleDefault = XML_FALSE; } else if (entityDeclHandler) { *eventEndPP = s; entityDeclHandler(handlerArg, declEntity->name, 0,0,0, declEntity->base, declEntity->systemId, declEntity->publicId, declEntity->notation); handleDefault = XML_FALSE; } } break; case XML_ROLE_GENERAL_ENTITY_NAME: { if (XmlPredefinedEntityName(enc, s, next)) { declEntity = NULL; break; } if (dtd->keepProcessing) { const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next); if (!name) return XML_ERROR_NO_MEMORY; declEntity = (ENTITY *)lookup(&dtd->generalEntities, name, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; if (declEntity->name != name) { poolDiscard(&dtd->pool); declEntity = NULL; } else { poolFinish(&dtd->pool); declEntity->publicId = NULL; declEntity->is_param = XML_FALSE; /* if we have a parent parser or are reading an internal parameter entity, then the entity declaration is not considered "internal" */ declEntity->is_internal = !(parentParser || openInternalEntities); if (entityDeclHandler) handleDefault = XML_FALSE; } } else { poolDiscard(&dtd->pool); declEntity = NULL; } } break; case XML_ROLE_PARAM_ENTITY_NAME: #ifdef XML_DTD if (dtd->keepProcessing) { const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next); if (!name) return XML_ERROR_NO_MEMORY; declEntity = (ENTITY *)lookup(&dtd->paramEntities, name, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; if (declEntity->name != name) { poolDiscard(&dtd->pool); declEntity = NULL; } else { poolFinish(&dtd->pool); declEntity->publicId = NULL; declEntity->is_param = XML_TRUE; /* if we have a parent parser or are reading an internal parameter entity, then the entity declaration is not considered "internal" */ declEntity->is_internal = !(parentParser || openInternalEntities); if (entityDeclHandler) handleDefault = XML_FALSE; } } else { poolDiscard(&dtd->pool); declEntity = NULL; } #else /* not XML_DTD */ declEntity = NULL; #endif /* XML_DTD */ break; case XML_ROLE_NOTATION_NAME: declNotationPublicId = NULL; declNotationName = NULL; if (notationDeclHandler) { declNotationName = poolStoreString(&tempPool, enc, s, next); if (!declNotationName) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); handleDefault = XML_FALSE; } break; case XML_ROLE_NOTATION_PUBLIC_ID: if (!XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_PUBLICID; if (declNotationName) { /* means notationDeclHandler != NULL */ XML_Char *tem = poolStoreString(&tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!tem) return XML_ERROR_NO_MEMORY; normalizePublicId(tem); declNotationPublicId = tem; poolFinish(&tempPool); handleDefault = XML_FALSE; } break; case XML_ROLE_NOTATION_SYSTEM_ID: if (declNotationName && notationDeclHandler) { const XML_Char *systemId = poolStoreString(&tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!systemId) return XML_ERROR_NO_MEMORY; *eventEndPP = s; notationDeclHandler(handlerArg, declNotationName, curBase, systemId, declNotationPublicId); handleDefault = XML_FALSE; } poolClear(&tempPool); break; case XML_ROLE_NOTATION_NO_SYSTEM_ID: if (declNotationPublicId && notationDeclHandler) { *eventEndPP = s; notationDeclHandler(handlerArg, declNotationName, curBase, 0, declNotationPublicId); handleDefault = XML_FALSE; } poolClear(&tempPool); break; case XML_ROLE_ERROR: switch (tok) { case XML_TOK_PARAM_ENTITY_REF: /* PE references in internal subset are not allowed within declarations. */ return XML_ERROR_PARAM_ENTITY_REF; case XML_TOK_XML_DECL: return XML_ERROR_MISPLACED_XML_PI; default: return XML_ERROR_SYNTAX; } #ifdef XML_DTD case XML_ROLE_IGNORE_SECT: { enum XML_Error result; if (defaultHandler) reportDefault(parser, enc, s, next); handleDefault = XML_FALSE; result = doIgnoreSection(parser, enc, &next, end, nextPtr, haveMore); if (result != XML_ERROR_NONE) return result; else if (!next) { processor = ignoreSectionProcessor; return result; } } break; #endif /* XML_DTD */ case XML_ROLE_GROUP_OPEN: if (prologState.level >= groupSize) { if (groupSize) { char *temp = (char *)REALLOC(groupConnector, groupSize *= 2); if (temp == NULL) return XML_ERROR_NO_MEMORY; groupConnector = temp; if (dtd->scaffIndex) { int *temp = (int *)REALLOC(dtd->scaffIndex, groupSize * sizeof(int)); if (temp == NULL) return XML_ERROR_NO_MEMORY; dtd->scaffIndex = temp; } } else { groupConnector = (char *)MALLOC(groupSize = 32); if (!groupConnector) return XML_ERROR_NO_MEMORY; } } groupConnector[prologState.level] = 0; if (dtd->in_eldecl) { int myindex = nextScaffoldPart(parser); if (myindex < 0) return XML_ERROR_NO_MEMORY; dtd->scaffIndex[dtd->scaffLevel] = myindex; dtd->scaffLevel++; dtd->scaffold[myindex].type = XML_CTYPE_SEQ; if (elementDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_GROUP_SEQUENCE: if (groupConnector[prologState.level] == ASCII_PIPE) return XML_ERROR_SYNTAX; groupConnector[prologState.level] = ASCII_COMMA; if (dtd->in_eldecl && elementDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_GROUP_CHOICE: if (groupConnector[prologState.level] == ASCII_COMMA) return XML_ERROR_SYNTAX; if (dtd->in_eldecl && !groupConnector[prologState.level] && (dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type != XML_CTYPE_MIXED) ) { dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type = XML_CTYPE_CHOICE; if (elementDeclHandler) handleDefault = XML_FALSE; } groupConnector[prologState.level] = ASCII_PIPE; break; case XML_ROLE_PARAM_ENTITY_REF: #ifdef XML_DTD case XML_ROLE_INNER_PARAM_ENTITY_REF: dtd->hasParamEntityRefs = XML_TRUE; if (!paramEntityParsing) dtd->keepProcessing = dtd->standalone; else { const XML_Char *name; ENTITY *entity; name = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!name) return XML_ERROR_NO_MEMORY; entity = (ENTITY *)lookup(&dtd->paramEntities, name, 0); poolDiscard(&dtd->pool); /* first, determine if a check for an existing declaration is needed; if yes, check that the entity exists, and that it is internal, otherwise call the skipped entity handler */ if (prologState.documentEntity && (dtd->standalone ? !openInternalEntities : !dtd->hasParamEntityRefs)) { if (!entity) return XML_ERROR_UNDEFINED_ENTITY; else if (!entity->is_internal) return XML_ERROR_ENTITY_DECLARED_IN_PE; } else if (!entity) { dtd->keepProcessing = dtd->standalone; /* cannot report skipped entities in declarations */ if ((role == XML_ROLE_PARAM_ENTITY_REF) && skippedEntityHandler) { skippedEntityHandler(handlerArg, name, 1); handleDefault = XML_FALSE; } break; } if (entity->open) return XML_ERROR_RECURSIVE_ENTITY_REF; if (entity->textPtr) { enum XML_Error result; XML_Bool betweenDecl = (role == XML_ROLE_PARAM_ENTITY_REF ? XML_TRUE : XML_FALSE); result = processInternalEntity(parser, entity, betweenDecl); if (result != XML_ERROR_NONE) return result; handleDefault = XML_FALSE; break; } if (externalEntityRefHandler) { dtd->paramEntityRead = XML_FALSE; entity->open = XML_TRUE; if (!externalEntityRefHandler(externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) { entity->open = XML_FALSE; return XML_ERROR_EXTERNAL_ENTITY_HANDLING; } entity->open = XML_FALSE; handleDefault = XML_FALSE; if (!dtd->paramEntityRead) { dtd->keepProcessing = dtd->standalone; break; } } else { dtd->keepProcessing = dtd->standalone; break; } } #endif /* XML_DTD */ if (!dtd->standalone && notStandaloneHandler && !notStandaloneHandler(handlerArg)) return XML_ERROR_NOT_STANDALONE; break; /* Element declaration stuff */ case XML_ROLE_ELEMENT_NAME: if (elementDeclHandler) { declElementType = getElementType(parser, enc, s, next); if (!declElementType) return XML_ERROR_NO_MEMORY; dtd->scaffLevel = 0; dtd->scaffCount = 0; dtd->in_eldecl = XML_TRUE; handleDefault = XML_FALSE; } break; case XML_ROLE_CONTENT_ANY: case XML_ROLE_CONTENT_EMPTY: if (dtd->in_eldecl) { if (elementDeclHandler) { XML_Content * content = (XML_Content *) MALLOC(sizeof(XML_Content)); if (!content) return XML_ERROR_NO_MEMORY; content->quant = XML_CQUANT_NONE; content->name = NULL; content->numchildren = 0; content->children = NULL; content->type = ((role == XML_ROLE_CONTENT_ANY) ? XML_CTYPE_ANY : XML_CTYPE_EMPTY); *eventEndPP = s; elementDeclHandler(handlerArg, declElementType->name, content); handleDefault = XML_FALSE; } dtd->in_eldecl = XML_FALSE; } break; case XML_ROLE_CONTENT_PCDATA: if (dtd->in_eldecl) { dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type = XML_CTYPE_MIXED; if (elementDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_CONTENT_ELEMENT: quant = XML_CQUANT_NONE; goto elementContent; case XML_ROLE_CONTENT_ELEMENT_OPT: quant = XML_CQUANT_OPT; goto elementContent; case XML_ROLE_CONTENT_ELEMENT_REP: quant = XML_CQUANT_REP; goto elementContent; case XML_ROLE_CONTENT_ELEMENT_PLUS: quant = XML_CQUANT_PLUS; elementContent: if (dtd->in_eldecl) { ELEMENT_TYPE *el; const XML_Char *name; int nameLen; const char *nxt = (quant == XML_CQUANT_NONE ? next : next - enc->minBytesPerChar); int myindex = nextScaffoldPart(parser); if (myindex < 0) return XML_ERROR_NO_MEMORY; dtd->scaffold[myindex].type = XML_CTYPE_NAME; dtd->scaffold[myindex].quant = quant; el = getElementType(parser, enc, s, nxt); if (!el) return XML_ERROR_NO_MEMORY; name = el->name; dtd->scaffold[myindex].name = name; nameLen = 0; for (; name[nameLen++]; ); dtd->contentStringLen += nameLen; if (elementDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_GROUP_CLOSE: quant = XML_CQUANT_NONE; goto closeGroup; case XML_ROLE_GROUP_CLOSE_OPT: quant = XML_CQUANT_OPT; goto closeGroup; case XML_ROLE_GROUP_CLOSE_REP: quant = XML_CQUANT_REP; goto closeGroup; case XML_ROLE_GROUP_CLOSE_PLUS: quant = XML_CQUANT_PLUS; closeGroup: if (dtd->in_eldecl) { if (elementDeclHandler) handleDefault = XML_FALSE; dtd->scaffLevel--; dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel]].quant = quant; if (dtd->scaffLevel == 0) { if (!handleDefault) { XML_Content *model = build_model(parser); if (!model) return XML_ERROR_NO_MEMORY; *eventEndPP = s; elementDeclHandler(handlerArg, declElementType->name, model); } dtd->in_eldecl = XML_FALSE; dtd->contentStringLen = 0; } } break; /* End element declaration stuff */ case XML_ROLE_PI: if (!reportProcessingInstruction(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; handleDefault = XML_FALSE; break; case XML_ROLE_COMMENT: if (!reportComment(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; handleDefault = XML_FALSE; break; case XML_ROLE_NONE: switch (tok) { case XML_TOK_BOM: handleDefault = XML_FALSE; break; } break; case XML_ROLE_DOCTYPE_NONE: if (startDoctypeDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ENTITY_NONE: if (dtd->keepProcessing && entityDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_NOTATION_NONE: if (notationDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ATTLIST_NONE: if (dtd->keepProcessing && attlistDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ELEMENT_NONE: if (elementDeclHandler) handleDefault = XML_FALSE; break; } /* end of big switch */ if (handleDefault && defaultHandler) reportDefault(parser, enc, s, next); switch (ps_parsing) { case XML_SUSPENDED: *nextPtr = next; return XML_ERROR_NONE; case XML_FINISHED: return XML_ERROR_ABORTED; default: s = next; tok = XmlPrologTok(enc, s, end, &next); } } /* not reached */ } static enum XML_Error PTRCALL epilogProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { processor = epilogProcessor; eventPtr = s; for (;;) { const char *next = NULL; int tok = XmlPrologTok(encoding, s, end, &next); eventEndPtr = next; switch (tok) { /* report partial linebreak - it might be the last token */ case -XML_TOK_PROLOG_S: if (defaultHandler) { reportDefault(parser, encoding, s, next); if (ps_parsing == XML_FINISHED) return XML_ERROR_ABORTED; } *nextPtr = next; return XML_ERROR_NONE; case XML_TOK_NONE: *nextPtr = s; return XML_ERROR_NONE; case XML_TOK_PROLOG_S: if (defaultHandler) reportDefault(parser, encoding, s, next); break; case XML_TOK_PI: if (!reportProcessingInstruction(parser, encoding, s, next)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_COMMENT: if (!reportComment(parser, encoding, s, next)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_INVALID: eventPtr = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: if (!ps_finalBuffer) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (!ps_finalBuffer) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_PARTIAL_CHAR; default: return XML_ERROR_JUNK_AFTER_DOC_ELEMENT; } eventPtr = s = next; switch (ps_parsing) { case XML_SUSPENDED: *nextPtr = next; return XML_ERROR_NONE; case XML_FINISHED: return XML_ERROR_ABORTED; default: ; } } } static enum XML_Error processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) { const char *textStart, *textEnd; const char *next; enum XML_Error result; OPEN_INTERNAL_ENTITY *openEntity; if (freeInternalEntities) { openEntity = freeInternalEntities; freeInternalEntities = openEntity->next; } else { openEntity = (OPEN_INTERNAL_ENTITY *)MALLOC(sizeof(OPEN_INTERNAL_ENTITY)); if (!openEntity) return XML_ERROR_NO_MEMORY; } entity->open = XML_TRUE; entity->processed = 0; openEntity->next = openInternalEntities; openInternalEntities = openEntity; openEntity->entity = entity; openEntity->startTagLevel = tagLevel; openEntity->betweenDecl = betweenDecl; openEntity->internalEventPtr = NULL; openEntity->internalEventEndPtr = NULL; textStart = (char *)entity->textPtr; textEnd = (char *)(entity->textPtr + entity->textLen); #ifdef XML_DTD if (entity->is_param) { int tok = XmlPrologTok(internalEncoding, textStart, textEnd, &next); result = doProlog(parser, internalEncoding, textStart, textEnd, tok, next, &next, XML_FALSE); } else #endif /* XML_DTD */ result = doContent(parser, tagLevel, internalEncoding, textStart, textEnd, &next, XML_FALSE); if (result == XML_ERROR_NONE) { if (textEnd != next && ps_parsing == XML_SUSPENDED) { entity->processed = (int)(next - textStart); processor = internalEntityProcessor; } else { entity->open = XML_FALSE; openInternalEntities = openEntity->next; /* put openEntity back in list of free instances */ openEntity->next = freeInternalEntities; freeInternalEntities = openEntity; } } return result; } static enum XML_Error PTRCALL internalEntityProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { ENTITY *entity; const char *textStart, *textEnd; const char *next; enum XML_Error result; OPEN_INTERNAL_ENTITY *openEntity = openInternalEntities; if (!openEntity) return XML_ERROR_UNEXPECTED_STATE; entity = openEntity->entity; textStart = ((char *)entity->textPtr) + entity->processed; textEnd = (char *)(entity->textPtr + entity->textLen); #ifdef XML_DTD if (entity->is_param) { int tok = XmlPrologTok(internalEncoding, textStart, textEnd, &next); result = doProlog(parser, internalEncoding, textStart, textEnd, tok, next, &next, XML_FALSE); } else #endif /* XML_DTD */ result = doContent(parser, openEntity->startTagLevel, internalEncoding, textStart, textEnd, &next, XML_FALSE); if (result != XML_ERROR_NONE) return result; else if (textEnd != next && ps_parsing == XML_SUSPENDED) { entity->processed = (int)(next - (char *)entity->textPtr); return result; } else { entity->open = XML_FALSE; openInternalEntities = openEntity->next; /* put openEntity back in list of free instances */ openEntity->next = freeInternalEntities; freeInternalEntities = openEntity; } #ifdef XML_DTD if (entity->is_param) { int tok; processor = prologProcessor; tok = XmlPrologTok(encoding, s, end, &next); return doProlog(parser, encoding, s, end, tok, next, nextPtr, (XML_Bool)!ps_finalBuffer); } else #endif /* XML_DTD */ { processor = contentProcessor; /* see externalEntityContentProcessor vs contentProcessor */ return doContent(parser, parentParser ? 1 : 0, encoding, s, end, nextPtr, (XML_Bool)!ps_finalBuffer); } } static enum XML_Error PTRCALL errorProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { return errorCode; } static enum XML_Error storeAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, const char *ptr, const char *end, STRING_POOL *pool) { enum XML_Error result = appendAttributeValue(parser, enc, isCdata, ptr, end, pool); if (result) return result; if (!isCdata && poolLength(pool) && poolLastChar(pool) == 0x20) poolChop(pool); if (!poolAppendChar(pool, XML_T('\0'))) return XML_ERROR_NO_MEMORY; return XML_ERROR_NONE; } static enum XML_Error appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, const char *ptr, const char *end, STRING_POOL *pool) { DTD * const dtd = _dtd; /* save one level of indirection */ for (;;) { const char *next; int tok = XmlAttributeValueTok(enc, ptr, end, &next); switch (tok) { case XML_TOK_NONE: return XML_ERROR_NONE; case XML_TOK_INVALID: if (enc == encoding) eventPtr = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: if (enc == encoding) eventPtr = ptr; return XML_ERROR_INVALID_TOKEN; case XML_TOK_CHAR_REF: { XML_Char buf[XML_ENCODE_MAX]; int i; int n = XmlCharRefNumber(enc, ptr); if (n < 0) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_BAD_CHAR_REF; } if (!isCdata && n == 0x20 /* space */ && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20)) break; n = XmlEncode(n, (ICHAR *)buf); if (!n) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_BAD_CHAR_REF; } for (i = 0; i < n; i++) { if (!poolAppendChar(pool, buf[i])) return XML_ERROR_NO_MEMORY; } } break; case XML_TOK_DATA_CHARS: if (!poolAppend(pool, enc, ptr, next)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_TRAILING_CR: next = ptr + enc->minBytesPerChar; /* fall through */ case XML_TOK_ATTRIBUTE_VALUE_S: case XML_TOK_DATA_NEWLINE: if (!isCdata && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20)) break; if (!poolAppendChar(pool, 0x20)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_ENTITY_REF: { const XML_Char *name; ENTITY *entity; char checkEntityDecl; XML_Char ch = (XML_Char) XmlPredefinedEntityName(enc, ptr + enc->minBytesPerChar, next - enc->minBytesPerChar); if (ch) { if (!poolAppendChar(pool, ch)) return XML_ERROR_NO_MEMORY; break; } name = poolStoreString(&temp2Pool, enc, ptr + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!name) return XML_ERROR_NO_MEMORY; entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0); poolDiscard(&temp2Pool); /* First, determine if a check for an existing declaration is needed; if yes, check that the entity exists, and that it is internal. */ if (pool == &dtd->pool) /* are we called from prolog? */ checkEntityDecl = #ifdef XML_DTD prologState.documentEntity && #endif /* XML_DTD */ (dtd->standalone ? !openInternalEntities : !dtd->hasParamEntityRefs); else /* if (pool == &tempPool): we are called from content */ checkEntityDecl = !dtd->hasParamEntityRefs || dtd->standalone; if (checkEntityDecl) { if (!entity) return XML_ERROR_UNDEFINED_ENTITY; else if (!entity->is_internal) return XML_ERROR_ENTITY_DECLARED_IN_PE; } else if (!entity) { /* Cannot report skipped entity here - see comments on skippedEntityHandler. if (skippedEntityHandler) skippedEntityHandler(handlerArg, name, 0); */ /* Cannot call the default handler because this would be out of sync with the call to the startElementHandler. if ((pool == &tempPool) && defaultHandler) reportDefault(parser, enc, ptr, next); */ break; } if (entity->open) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_RECURSIVE_ENTITY_REF; } if (entity->notation) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_BINARY_ENTITY_REF; } if (!entity->textPtr) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF; } else { enum XML_Error result; const XML_Char *textEnd = entity->textPtr + entity->textLen; entity->open = XML_TRUE; result = appendAttributeValue(parser, internalEncoding, isCdata, (char *)entity->textPtr, (char *)textEnd, pool); entity->open = XML_FALSE; if (result) return result; } } break; default: if (enc == encoding) eventPtr = ptr; return XML_ERROR_UNEXPECTED_STATE; } ptr = next; } /* not reached */ } static enum XML_Error storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *entityTextPtr, const char *entityTextEnd) { DTD * const dtd = _dtd; /* save one level of indirection */ STRING_POOL *pool = &(dtd->entityValuePool); enum XML_Error result = XML_ERROR_NONE; #ifdef XML_DTD int oldInEntityValue = prologState.inEntityValue; prologState.inEntityValue = 1; #endif /* XML_DTD */ /* never return Null for the value argument in EntityDeclHandler, since this would indicate an external entity; therefore we have to make sure that entityValuePool.start is not null */ if (!pool->blocks) { if (!poolGrow(pool)) return XML_ERROR_NO_MEMORY; } for (;;) { const char *next; int tok = XmlEntityValueTok(enc, entityTextPtr, entityTextEnd, &next); switch (tok) { case XML_TOK_PARAM_ENTITY_REF: #ifdef XML_DTD if (isParamEntity || enc != encoding) { const XML_Char *name; ENTITY *entity; name = poolStoreString(&tempPool, enc, entityTextPtr + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!name) { result = XML_ERROR_NO_MEMORY; goto endEntityValue; } entity = (ENTITY *)lookup(&dtd->paramEntities, name, 0); poolDiscard(&tempPool); if (!entity) { /* not a well-formedness error - see XML 1.0: WFC Entity Declared */ /* cannot report skipped entity here - see comments on skippedEntityHandler if (skippedEntityHandler) skippedEntityHandler(handlerArg, name, 0); */ dtd->keepProcessing = dtd->standalone; goto endEntityValue; } if (entity->open) { if (enc == encoding) eventPtr = entityTextPtr; result = XML_ERROR_RECURSIVE_ENTITY_REF; goto endEntityValue; } if (entity->systemId) { if (externalEntityRefHandler) { dtd->paramEntityRead = XML_FALSE; entity->open = XML_TRUE; if (!externalEntityRefHandler(externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) { entity->open = XML_FALSE; result = XML_ERROR_EXTERNAL_ENTITY_HANDLING; goto endEntityValue; } entity->open = XML_FALSE; if (!dtd->paramEntityRead) dtd->keepProcessing = dtd->standalone; } else dtd->keepProcessing = dtd->standalone; } else { entity->open = XML_TRUE; result = storeEntityValue(parser, internalEncoding, (char *)entity->textPtr, (char *)(entity->textPtr + entity->textLen)); entity->open = XML_FALSE; if (result) goto endEntityValue; } break; } #endif /* XML_DTD */ /* In the internal subset, PE references are not legal within markup declarations, e.g entity values in this case. */ eventPtr = entityTextPtr; result = XML_ERROR_PARAM_ENTITY_REF; goto endEntityValue; case XML_TOK_NONE: result = XML_ERROR_NONE; goto endEntityValue; case XML_TOK_ENTITY_REF: case XML_TOK_DATA_CHARS: if (!poolAppend(pool, enc, entityTextPtr, next)) { result = XML_ERROR_NO_MEMORY; goto endEntityValue; } break; case XML_TOK_TRAILING_CR: next = entityTextPtr + enc->minBytesPerChar; /* fall through */ case XML_TOK_DATA_NEWLINE: if (pool->end == pool->ptr && !poolGrow(pool)) { result = XML_ERROR_NO_MEMORY; goto endEntityValue; } *(pool->ptr)++ = 0xA; break; case XML_TOK_CHAR_REF: { XML_Char buf[XML_ENCODE_MAX]; int i; int n = XmlCharRefNumber(enc, entityTextPtr); if (n < 0) { if (enc == encoding) eventPtr = entityTextPtr; result = XML_ERROR_BAD_CHAR_REF; goto endEntityValue; } n = XmlEncode(n, (ICHAR *)buf); if (!n) { if (enc == encoding) eventPtr = entityTextPtr; result = XML_ERROR_BAD_CHAR_REF; goto endEntityValue; } for (i = 0; i < n; i++) { if (pool->end == pool->ptr && !poolGrow(pool)) { result = XML_ERROR_NO_MEMORY; goto endEntityValue; } *(pool->ptr)++ = buf[i]; } } break; case XML_TOK_PARTIAL: if (enc == encoding) eventPtr = entityTextPtr; result = XML_ERROR_INVALID_TOKEN; goto endEntityValue; case XML_TOK_INVALID: if (enc == encoding) eventPtr = next; result = XML_ERROR_INVALID_TOKEN; goto endEntityValue; default: if (enc == encoding) eventPtr = entityTextPtr; result = XML_ERROR_UNEXPECTED_STATE; goto endEntityValue; } entityTextPtr = next; } endEntityValue: #ifdef XML_DTD prologState.inEntityValue = oldInEntityValue; #endif /* XML_DTD */ return result; } static void FASTCALL normalizeLines(XML_Char *s) { XML_Char *p; for (;; s++) { if (*s == XML_T('\0')) return; if (*s == 0xD) break; } p = s; do { if (*s == 0xD) { *p++ = 0xA; if (*++s == 0xA) s++; } else *p++ = *s++; } while (*s); *p = XML_T('\0'); } static int reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) { const XML_Char *target; XML_Char *data; const char *tem; if (!processingInstructionHandler) { if (defaultHandler) reportDefault(parser, enc, start, end); return 1; } start += enc->minBytesPerChar * 2; tem = start + XmlNameLength(enc, start); target = poolStoreString(&tempPool, enc, start, tem); if (!target) return 0; poolFinish(&tempPool); data = poolStoreString(&tempPool, enc, XmlSkipS(enc, tem), end - enc->minBytesPerChar*2); if (!data) return 0; normalizeLines(data); processingInstructionHandler(handlerArg, target, data); poolClear(&tempPool); return 1; } static int reportComment(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) { XML_Char *data; if (!commentHandler) { if (defaultHandler) reportDefault(parser, enc, start, end); return 1; } data = poolStoreString(&tempPool, enc, start + enc->minBytesPerChar * 4, end - enc->minBytesPerChar * 3); if (!data) return 0; normalizeLines(data); commentHandler(handlerArg, data); poolClear(&tempPool); return 1; } static void reportDefault(XML_Parser parser, const ENCODING *enc, const char *s, const char *end) { if (MUST_CONVERT(enc, s)) { const char **eventPP; const char **eventEndPP; if (enc == encoding) { eventPP = &eventPtr; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } do { ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = s; defaultHandler(handlerArg, dataBuf, (int)(dataPtr - (ICHAR *)dataBuf)); *eventPP = s; } while (s != end); } else defaultHandler(handlerArg, (XML_Char *)s, (int)((XML_Char *)end - (XML_Char *)s)); } static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, XML_Bool isCdata, XML_Bool isId, const XML_Char *value, XML_Parser parser) { DEFAULT_ATTRIBUTE *att; if (value || isId) { /* The handling of default attributes gets messed up if we have a default which duplicates a non-default. */ int i; for (i = 0; i < type->nDefaultAtts; i++) if (attId == type->defaultAtts[i].id) return 1; if (isId && !type->idAtt && !attId->xmlns) type->idAtt = attId; } if (type->nDefaultAtts == type->allocDefaultAtts) { if (type->allocDefaultAtts == 0) { type->allocDefaultAtts = 8; type->defaultAtts = (DEFAULT_ATTRIBUTE *)MALLOC(type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); if (!type->defaultAtts) return 0; } else { DEFAULT_ATTRIBUTE *temp; int count = type->allocDefaultAtts * 2; temp = (DEFAULT_ATTRIBUTE *) REALLOC(type->defaultAtts, (count * sizeof(DEFAULT_ATTRIBUTE))); if (temp == NULL) return 0; type->allocDefaultAtts = count; type->defaultAtts = temp; } } att = type->defaultAtts + type->nDefaultAtts; att->id = attId; att->value = value; att->isCdata = isCdata; if (!isCdata) attId->maybeTokenized = XML_TRUE; type->nDefaultAtts += 1; return 1; } static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType) { DTD * const dtd = _dtd; /* save one level of indirection */ const XML_Char *name; for (name = elementType->name; *name; name++) { if (*name == XML_T(ASCII_COLON)) { PREFIX *prefix; const XML_Char *s; for (s = elementType->name; s != name; s++) { if (!poolAppendChar(&dtd->pool, *s)) return 0; } if (!poolAppendChar(&dtd->pool, XML_T('\0'))) return 0; prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&dtd->pool), sizeof(PREFIX)); if (!prefix) return 0; if (prefix->name == poolStart(&dtd->pool)) poolFinish(&dtd->pool); else poolDiscard(&dtd->pool); elementType->prefix = prefix; } } return 1; } static ATTRIBUTE_ID * getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) { DTD * const dtd = _dtd; /* save one level of indirection */ ATTRIBUTE_ID *id; const XML_Char *name; if (!poolAppendChar(&dtd->pool, XML_T('\0'))) return NULL; name = poolStoreString(&dtd->pool, enc, start, end); if (!name) return NULL; /* skip quotation mark - its storage will be re-used (like in name[-1]) */ ++name; id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, name, sizeof(ATTRIBUTE_ID)); if (!id) return NULL; if (id->name != name) poolDiscard(&dtd->pool); else { poolFinish(&dtd->pool); if (!ns) ; else if (name[0] == XML_T(ASCII_x) && name[1] == XML_T(ASCII_m) && name[2] == XML_T(ASCII_l) && name[3] == XML_T(ASCII_n) && name[4] == XML_T(ASCII_s) && (name[5] == XML_T('\0') || name[5] == XML_T(ASCII_COLON))) { if (name[5] == XML_T('\0')) id->prefix = &dtd->defaultPrefix; else id->prefix = (PREFIX *)lookup(&dtd->prefixes, name + 6, sizeof(PREFIX)); id->xmlns = XML_TRUE; } else { int i; for (i = 0; name[i]; i++) { /* attributes without prefix are *not* in the default namespace */ if (name[i] == XML_T(ASCII_COLON)) { int j; for (j = 0; j < i; j++) { if (!poolAppendChar(&dtd->pool, name[j])) return NULL; } if (!poolAppendChar(&dtd->pool, XML_T('\0'))) return NULL; id->prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&dtd->pool), sizeof(PREFIX)); if (id->prefix->name == poolStart(&dtd->pool)) poolFinish(&dtd->pool); else poolDiscard(&dtd->pool); break; } } } } return id; } #define CONTEXT_SEP XML_T(ASCII_FF) static const XML_Char * getContext(XML_Parser parser) { DTD * const dtd = _dtd; /* save one level of indirection */ HASH_TABLE_ITER iter; XML_Bool needSep = XML_FALSE; if (dtd->defaultPrefix.binding) { int i; int len; if (!poolAppendChar(&tempPool, XML_T(ASCII_EQUALS))) return NULL; len = dtd->defaultPrefix.binding->uriLen; if (namespaceSeparator) len--; for (i = 0; i < len; i++) if (!poolAppendChar(&tempPool, dtd->defaultPrefix.binding->uri[i])) return NULL; needSep = XML_TRUE; } hashTableIterInit(&iter, &(dtd->prefixes)); for (;;) { int i; int len; const XML_Char *s; PREFIX *prefix = (PREFIX *)hashTableIterNext(&iter); if (!prefix) break; if (!prefix->binding) continue; if (needSep && !poolAppendChar(&tempPool, CONTEXT_SEP)) return NULL; for (s = prefix->name; *s; s++) if (!poolAppendChar(&tempPool, *s)) return NULL; if (!poolAppendChar(&tempPool, XML_T(ASCII_EQUALS))) return NULL; len = prefix->binding->uriLen; if (namespaceSeparator) len--; for (i = 0; i < len; i++) if (!poolAppendChar(&tempPool, prefix->binding->uri[i])) return NULL; needSep = XML_TRUE; } hashTableIterInit(&iter, &(dtd->generalEntities)); for (;;) { const XML_Char *s; ENTITY *e = (ENTITY *)hashTableIterNext(&iter); if (!e) break; if (!e->open) continue; if (needSep && !poolAppendChar(&tempPool, CONTEXT_SEP)) return NULL; for (s = e->name; *s; s++) if (!poolAppendChar(&tempPool, *s)) return 0; needSep = XML_TRUE; } if (!poolAppendChar(&tempPool, XML_T('\0'))) return NULL; return tempPool.start; } static XML_Bool setContext(XML_Parser parser, const XML_Char *context) { DTD * const dtd = _dtd; /* save one level of indirection */ const XML_Char *s = context; while (*context != XML_T('\0')) { if (*s == CONTEXT_SEP || *s == XML_T('\0')) { ENTITY *e; if (!poolAppendChar(&tempPool, XML_T('\0'))) return XML_FALSE; e = (ENTITY *)lookup(&dtd->generalEntities, poolStart(&tempPool), 0); if (e) e->open = XML_TRUE; if (*s != XML_T('\0')) s++; context = s; poolDiscard(&tempPool); } else if (*s == XML_T(ASCII_EQUALS)) { PREFIX *prefix; if (poolLength(&tempPool) == 0) prefix = &dtd->defaultPrefix; else { if (!poolAppendChar(&tempPool, XML_T('\0'))) return XML_FALSE; prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&tempPool), sizeof(PREFIX)); if (!prefix) return XML_FALSE; if (prefix->name == poolStart(&tempPool)) { prefix->name = poolCopyString(&dtd->pool, prefix->name); if (!prefix->name) return XML_FALSE; } poolDiscard(&tempPool); } for (context = s + 1; *context != CONTEXT_SEP && *context != XML_T('\0'); context++) if (!poolAppendChar(&tempPool, *context)) return XML_FALSE; if (!poolAppendChar(&tempPool, XML_T('\0'))) return XML_FALSE; if (addBinding(parser, prefix, NULL, poolStart(&tempPool), &inheritedBindings) != XML_ERROR_NONE) return XML_FALSE; poolDiscard(&tempPool); if (*context != XML_T('\0')) ++context; s = context; } else { if (!poolAppendChar(&tempPool, *s)) return XML_FALSE; s++; } } return XML_TRUE; } static void FASTCALL normalizePublicId(XML_Char *publicId) { XML_Char *p = publicId; XML_Char *s; for (s = publicId; *s; s++) { switch (*s) { case 0x20: case 0xD: case 0xA: if (p != publicId && p[-1] != 0x20) *p++ = 0x20; break; default: *p++ = *s; } } if (p != publicId && p[-1] == 0x20) --p; *p = XML_T('\0'); } static DTD * dtdCreate(const XML_Memory_Handling_Suite *ms) { DTD *p = (DTD *)ms->malloc_fcn(sizeof(DTD)); if (p == NULL) return p; poolInit(&(p->pool), ms); poolInit(&(p->entityValuePool), ms); hashTableInit(&(p->generalEntities), ms); hashTableInit(&(p->elementTypes), ms); hashTableInit(&(p->attributeIds), ms); hashTableInit(&(p->prefixes), ms); #ifdef XML_DTD p->paramEntityRead = XML_FALSE; hashTableInit(&(p->paramEntities), ms); #endif /* XML_DTD */ p->defaultPrefix.name = NULL; p->defaultPrefix.binding = NULL; p->in_eldecl = XML_FALSE; p->scaffIndex = NULL; p->scaffold = NULL; p->scaffLevel = 0; p->scaffSize = 0; p->scaffCount = 0; p->contentStringLen = 0; p->keepProcessing = XML_TRUE; p->hasParamEntityRefs = XML_FALSE; p->standalone = XML_FALSE; return p; } static void dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms) { HASH_TABLE_ITER iter; hashTableIterInit(&iter, &(p->elementTypes)); for (;;) { ELEMENT_TYPE *e = (ELEMENT_TYPE *)hashTableIterNext(&iter); if (!e) break; if (e->allocDefaultAtts != 0) ms->free_fcn(e->defaultAtts); } hashTableClear(&(p->generalEntities)); #ifdef XML_DTD p->paramEntityRead = XML_FALSE; hashTableClear(&(p->paramEntities)); #endif /* XML_DTD */ hashTableClear(&(p->elementTypes)); hashTableClear(&(p->attributeIds)); hashTableClear(&(p->prefixes)); poolClear(&(p->pool)); poolClear(&(p->entityValuePool)); p->defaultPrefix.name = NULL; p->defaultPrefix.binding = NULL; p->in_eldecl = XML_FALSE; ms->free_fcn(p->scaffIndex); p->scaffIndex = NULL; ms->free_fcn(p->scaffold); p->scaffold = NULL; p->scaffLevel = 0; p->scaffSize = 0; p->scaffCount = 0; p->contentStringLen = 0; p->keepProcessing = XML_TRUE; p->hasParamEntityRefs = XML_FALSE; p->standalone = XML_FALSE; } static void dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms) { HASH_TABLE_ITER iter; hashTableIterInit(&iter, &(p->elementTypes)); for (;;) { ELEMENT_TYPE *e = (ELEMENT_TYPE *)hashTableIterNext(&iter); if (!e) break; if (e->allocDefaultAtts != 0) ms->free_fcn(e->defaultAtts); } hashTableDestroy(&(p->generalEntities)); #ifdef XML_DTD hashTableDestroy(&(p->paramEntities)); #endif /* XML_DTD */ hashTableDestroy(&(p->elementTypes)); hashTableDestroy(&(p->attributeIds)); hashTableDestroy(&(p->prefixes)); poolDestroy(&(p->pool)); poolDestroy(&(p->entityValuePool)); if (isDocEntity) { ms->free_fcn(p->scaffIndex); ms->free_fcn(p->scaffold); } ms->free_fcn(p); } /* Do a deep copy of the DTD. Return 0 for out of memory, non-zero otherwise. The new DTD has already been initialized. */ static int dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms) { HASH_TABLE_ITER iter; /* Copy the prefix table. */ hashTableIterInit(&iter, &(oldDtd->prefixes)); for (;;) { const XML_Char *name; const PREFIX *oldP = (PREFIX *)hashTableIterNext(&iter); if (!oldP) break; name = poolCopyString(&(newDtd->pool), oldP->name); if (!name) return 0; if (!lookup(&(newDtd->prefixes), name, sizeof(PREFIX))) return 0; } hashTableIterInit(&iter, &(oldDtd->attributeIds)); /* Copy the attribute id table. */ for (;;) { ATTRIBUTE_ID *newA; const XML_Char *name; const ATTRIBUTE_ID *oldA = (ATTRIBUTE_ID *)hashTableIterNext(&iter); if (!oldA) break; /* Remember to allocate the scratch byte before the name. */ if (!poolAppendChar(&(newDtd->pool), XML_T('\0'))) return 0; name = poolCopyString(&(newDtd->pool), oldA->name); if (!name) return 0; ++name; newA = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), name, sizeof(ATTRIBUTE_ID)); if (!newA) return 0; newA->maybeTokenized = oldA->maybeTokenized; if (oldA->prefix) { newA->xmlns = oldA->xmlns; if (oldA->prefix == &oldDtd->defaultPrefix) newA->prefix = &newDtd->defaultPrefix; else newA->prefix = (PREFIX *)lookup(&(newDtd->prefixes), oldA->prefix->name, 0); } } /* Copy the element type table. */ hashTableIterInit(&iter, &(oldDtd->elementTypes)); for (;;) { int i; ELEMENT_TYPE *newE; const XML_Char *name; const ELEMENT_TYPE *oldE = (ELEMENT_TYPE *)hashTableIterNext(&iter); if (!oldE) break; name = poolCopyString(&(newDtd->pool), oldE->name); if (!name) return 0; newE = (ELEMENT_TYPE *)lookup(&(newDtd->elementTypes), name, sizeof(ELEMENT_TYPE)); if (!newE) return 0; if (oldE->nDefaultAtts) { newE->defaultAtts = (DEFAULT_ATTRIBUTE *) ms->malloc_fcn(oldE->nDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); if (!newE->defaultAtts) { ms->free_fcn(newE); return 0; } } if (oldE->idAtt) newE->idAtt = (ATTRIBUTE_ID *) lookup(&(newDtd->attributeIds), oldE->idAtt->name, 0); newE->allocDefaultAtts = newE->nDefaultAtts = oldE->nDefaultAtts; if (oldE->prefix) newE->prefix = (PREFIX *)lookup(&(newDtd->prefixes), oldE->prefix->name, 0); for (i = 0; i < newE->nDefaultAtts; i++) { newE->defaultAtts[i].id = (ATTRIBUTE_ID *) lookup(&(newDtd->attributeIds), oldE->defaultAtts[i].id->name, 0); newE->defaultAtts[i].isCdata = oldE->defaultAtts[i].isCdata; if (oldE->defaultAtts[i].value) { newE->defaultAtts[i].value = poolCopyString(&(newDtd->pool), oldE->defaultAtts[i].value); if (!newE->defaultAtts[i].value) return 0; } else newE->defaultAtts[i].value = NULL; } } /* Copy the entity tables. */ if (!copyEntityTable(&(newDtd->generalEntities), &(newDtd->pool), &(oldDtd->generalEntities))) return 0; #ifdef XML_DTD if (!copyEntityTable(&(newDtd->paramEntities), &(newDtd->pool), &(oldDtd->paramEntities))) return 0; newDtd->paramEntityRead = oldDtd->paramEntityRead; #endif /* XML_DTD */ newDtd->keepProcessing = oldDtd->keepProcessing; newDtd->hasParamEntityRefs = oldDtd->hasParamEntityRefs; newDtd->standalone = oldDtd->standalone; /* Don't want deep copying for scaffolding */ newDtd->in_eldecl = oldDtd->in_eldecl; newDtd->scaffold = oldDtd->scaffold; newDtd->contentStringLen = oldDtd->contentStringLen; newDtd->scaffSize = oldDtd->scaffSize; newDtd->scaffLevel = oldDtd->scaffLevel; newDtd->scaffIndex = oldDtd->scaffIndex; return 1; } /* End dtdCopy */ static int copyEntityTable(HASH_TABLE *newTable, STRING_POOL *newPool, const HASH_TABLE *oldTable) { HASH_TABLE_ITER iter; const XML_Char *cachedOldBase = NULL; const XML_Char *cachedNewBase = NULL; hashTableIterInit(&iter, oldTable); for (;;) { ENTITY *newE; const XML_Char *name; const ENTITY *oldE = (ENTITY *)hashTableIterNext(&iter); if (!oldE) break; name = poolCopyString(newPool, oldE->name); if (!name) return 0; newE = (ENTITY *)lookup(newTable, name, sizeof(ENTITY)); if (!newE) return 0; if (oldE->systemId) { const XML_Char *tem = poolCopyString(newPool, oldE->systemId); if (!tem) return 0; newE->systemId = tem; if (oldE->base) { if (oldE->base == cachedOldBase) newE->base = cachedNewBase; else { cachedOldBase = oldE->base; tem = poolCopyString(newPool, cachedOldBase); if (!tem) return 0; cachedNewBase = newE->base = tem; } } if (oldE->publicId) { tem = poolCopyString(newPool, oldE->publicId); if (!tem) return 0; newE->publicId = tem; } } else { const XML_Char *tem = poolCopyStringN(newPool, oldE->textPtr, oldE->textLen); if (!tem) return 0; newE->textPtr = tem; newE->textLen = oldE->textLen; } if (oldE->notation) { const XML_Char *tem = poolCopyString(newPool, oldE->notation); if (!tem) return 0; newE->notation = tem; } newE->is_param = oldE->is_param; newE->is_internal = oldE->is_internal; } return 1; } #define INIT_POWER 6 static XML_Bool FASTCALL keyeq(KEY s1, KEY s2) { for (; *s1 == *s2; s1++, s2++) if (*s1 == 0) return XML_TRUE; return XML_FALSE; } static unsigned long FASTCALL hash(KEY s) { unsigned long h = 0; while (*s) h = CHAR_HASH(h, *s++); return h; } static NAMED * lookup(HASH_TABLE *table, KEY name, size_t createSize) { size_t i; if (table->size == 0) { size_t tsize; if (!createSize) return NULL; table->power = INIT_POWER; /* table->size is a power of 2 */ table->size = (size_t)1 << INIT_POWER; tsize = table->size * sizeof(NAMED *); table->v = (NAMED **)table->mem->malloc_fcn(tsize); if (!table->v) { table->size = 0; return NULL; } memset(table->v, 0, tsize); i = hash(name) & ((unsigned long)table->size - 1); } else { unsigned long h = hash(name); unsigned long mask = (unsigned long)table->size - 1; unsigned char step = 0; i = h & mask; while (table->v[i]) { if (keyeq(name, table->v[i]->name)) return table->v[i]; if (!step) step = PROBE_STEP(h, mask, table->power); i < step ? (i += table->size - step) : (i -= step); } if (!createSize) return NULL; /* check for overflow (table is half full) */ if (table->used >> (table->power - 1)) { unsigned char newPower = table->power + 1; size_t newSize = (size_t)1 << newPower; unsigned long newMask = (unsigned long)newSize - 1; size_t tsize = newSize * sizeof(NAMED *); NAMED **newV = (NAMED **)table->mem->malloc_fcn(tsize); if (!newV) return NULL; memset(newV, 0, tsize); for (i = 0; i < table->size; i++) if (table->v[i]) { unsigned long newHash = hash(table->v[i]->name); size_t j = newHash & newMask; step = 0; while (newV[j]) { if (!step) step = PROBE_STEP(newHash, newMask, newPower); j < step ? (j += newSize - step) : (j -= step); } newV[j] = table->v[i]; } table->mem->free_fcn(table->v); table->v = newV; table->power = newPower; table->size = newSize; i = h & newMask; step = 0; while (table->v[i]) { if (!step) step = PROBE_STEP(h, newMask, newPower); i < step ? (i += newSize - step) : (i -= step); } } } table->v[i] = (NAMED *)table->mem->malloc_fcn(createSize); if (!table->v[i]) return NULL; memset(table->v[i], 0, createSize); table->v[i]->name = name; (table->used)++; return table->v[i]; } static void FASTCALL hashTableClear(HASH_TABLE *table) { size_t i; for (i = 0; i < table->size; i++) { table->mem->free_fcn(table->v[i]); table->v[i] = NULL; } table->used = 0; } static void FASTCALL hashTableDestroy(HASH_TABLE *table) { size_t i; for (i = 0; i < table->size; i++) table->mem->free_fcn(table->v[i]); table->mem->free_fcn(table->v); } static void FASTCALL hashTableInit(HASH_TABLE *p, const XML_Memory_Handling_Suite *ms) { p->power = 0; p->size = 0; p->used = 0; p->v = NULL; p->mem = ms; } static void FASTCALL hashTableIterInit(HASH_TABLE_ITER *iter, const HASH_TABLE *table) { iter->p = table->v; iter->end = iter->p + table->size; } static NAMED * FASTCALL hashTableIterNext(HASH_TABLE_ITER *iter) { while (iter->p != iter->end) { NAMED *tem = *(iter->p)++; if (tem) return tem; } return NULL; } static void FASTCALL poolInit(STRING_POOL *pool, const XML_Memory_Handling_Suite *ms) { pool->blocks = NULL; pool->freeBlocks = NULL; pool->start = NULL; pool->ptr = NULL; pool->end = NULL; pool->mem = ms; } static void FASTCALL poolClear(STRING_POOL *pool) { if (!pool->freeBlocks) pool->freeBlocks = pool->blocks; else { BLOCK *p = pool->blocks; while (p) { BLOCK *tem = p->next; p->next = pool->freeBlocks; pool->freeBlocks = p; p = tem; } } pool->blocks = NULL; pool->start = NULL; pool->ptr = NULL; pool->end = NULL; } static void FASTCALL poolDestroy(STRING_POOL *pool) { BLOCK *p = pool->blocks; while (p) { BLOCK *tem = p->next; pool->mem->free_fcn(p); p = tem; } p = pool->freeBlocks; while (p) { BLOCK *tem = p->next; pool->mem->free_fcn(p); p = tem; } } static XML_Char * poolAppend(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end) { if (!pool->ptr && !poolGrow(pool)) return NULL; for (;;) { XmlConvert(enc, &ptr, end, (ICHAR **)&(pool->ptr), (ICHAR *)pool->end); if (ptr == end) break; if (!poolGrow(pool)) return NULL; } return pool->start; } static const XML_Char * FASTCALL poolCopyString(STRING_POOL *pool, const XML_Char *s) { do { if (!poolAppendChar(pool, *s)) return NULL; } while (*s++); s = pool->start; poolFinish(pool); return s; } static const XML_Char * poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n) { if (!pool->ptr && !poolGrow(pool)) return NULL; for (; n > 0; --n, s++) { if (!poolAppendChar(pool, *s)) return NULL; } s = pool->start; poolFinish(pool); return s; } static const XML_Char * FASTCALL poolAppendString(STRING_POOL *pool, const XML_Char *s) { while (*s) { if (!poolAppendChar(pool, *s)) return NULL; s++; } return pool->start; } static XML_Char * poolStoreString(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end) { if (!poolAppend(pool, enc, ptr, end)) return NULL; if (pool->ptr == pool->end && !poolGrow(pool)) return NULL; *(pool->ptr)++ = 0; return pool->start; } static XML_Bool FASTCALL poolGrow(STRING_POOL *pool) { if (pool->freeBlocks) { if (pool->start == 0) { pool->blocks = pool->freeBlocks; pool->freeBlocks = pool->freeBlocks->next; pool->blocks->next = NULL; pool->start = pool->blocks->s; pool->end = pool->start + pool->blocks->size; pool->ptr = pool->start; return XML_TRUE; } if (pool->end - pool->start < pool->freeBlocks->size) { BLOCK *tem = pool->freeBlocks->next; pool->freeBlocks->next = pool->blocks; pool->blocks = pool->freeBlocks; pool->freeBlocks = tem; memcpy(pool->blocks->s, pool->start, (pool->end - pool->start) * sizeof(XML_Char)); pool->ptr = pool->blocks->s + (pool->ptr - pool->start); pool->start = pool->blocks->s; pool->end = pool->start + pool->blocks->size; return XML_TRUE; } } if (pool->blocks && pool->start == pool->blocks->s) { int blockSize = (int)(pool->end - pool->start)*2; pool->blocks = (BLOCK *) pool->mem->realloc_fcn(pool->blocks, (offsetof(BLOCK, s) + blockSize * sizeof(XML_Char))); if (pool->blocks == NULL) return XML_FALSE; pool->blocks->size = blockSize; pool->ptr = pool->blocks->s + (pool->ptr - pool->start); pool->start = pool->blocks->s; pool->end = pool->start + blockSize; } else { BLOCK *tem; int blockSize = (int)(pool->end - pool->start); if (blockSize < INIT_BLOCK_SIZE) blockSize = INIT_BLOCK_SIZE; else blockSize *= 2; tem = (BLOCK *)pool->mem->malloc_fcn(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); if (!tem) return XML_FALSE; tem->size = blockSize; tem->next = pool->blocks; pool->blocks = tem; if (pool->ptr != pool->start) memcpy(tem->s, pool->start, (pool->ptr - pool->start) * sizeof(XML_Char)); pool->ptr = tem->s + (pool->ptr - pool->start); pool->start = tem->s; pool->end = tem->s + blockSize; } return XML_TRUE; } static int FASTCALL nextScaffoldPart(XML_Parser parser) { DTD * const dtd = _dtd; /* save one level of indirection */ CONTENT_SCAFFOLD * me; int next; if (!dtd->scaffIndex) { dtd->scaffIndex = (int *)MALLOC(groupSize * sizeof(int)); if (!dtd->scaffIndex) return -1; dtd->scaffIndex[0] = 0; } if (dtd->scaffCount >= dtd->scaffSize) { CONTENT_SCAFFOLD *temp; if (dtd->scaffold) { temp = (CONTENT_SCAFFOLD *) REALLOC(dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD)); if (temp == NULL) return -1; dtd->scaffSize *= 2; } else { temp = (CONTENT_SCAFFOLD *)MALLOC(INIT_SCAFFOLD_ELEMENTS * sizeof(CONTENT_SCAFFOLD)); if (temp == NULL) return -1; dtd->scaffSize = INIT_SCAFFOLD_ELEMENTS; } dtd->scaffold = temp; } next = dtd->scaffCount++; me = &dtd->scaffold[next]; if (dtd->scaffLevel) { CONTENT_SCAFFOLD *parent = &dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel-1]]; if (parent->lastchild) { dtd->scaffold[parent->lastchild].nextsib = next; } if (!parent->childcnt) parent->firstchild = next; parent->lastchild = next; parent->childcnt++; } me->firstchild = me->lastchild = me->childcnt = me->nextsib = 0; return next; } static void build_node(XML_Parser parser, int src_node, XML_Content *dest, XML_Content **contpos, XML_Char **strpos) { DTD * const dtd = _dtd; /* save one level of indirection */ dest->type = dtd->scaffold[src_node].type; dest->quant = dtd->scaffold[src_node].quant; if (dest->type == XML_CTYPE_NAME) { const XML_Char *src; dest->name = *strpos; src = dtd->scaffold[src_node].name; for (;;) { *(*strpos)++ = *src; if (!*src) break; src++; } dest->numchildren = 0; dest->children = NULL; } else { unsigned int i; int cn; dest->numchildren = dtd->scaffold[src_node].childcnt; dest->children = *contpos; *contpos += dest->numchildren; for (i = 0, cn = dtd->scaffold[src_node].firstchild; i < dest->numchildren; i++, cn = dtd->scaffold[cn].nextsib) { build_node(parser, cn, &(dest->children[i]), contpos, strpos); } dest->name = NULL; } } static XML_Content * build_model (XML_Parser parser) { DTD * const dtd = _dtd; /* save one level of indirection */ XML_Content *ret; XML_Content *cpos; XML_Char * str; int allocsize = (dtd->scaffCount * sizeof(XML_Content) + (dtd->contentStringLen * sizeof(XML_Char))); ret = (XML_Content *)MALLOC(allocsize); if (!ret) return NULL; str = (XML_Char *) (&ret[dtd->scaffCount]); cpos = &ret[1]; build_node(parser, 0, ret, &cpos, &str); return ret; } static ELEMENT_TYPE * getElementType(XML_Parser parser, const ENCODING *enc, const char *ptr, const char *end) { DTD * const dtd = _dtd; /* save one level of indirection */ const XML_Char *name = poolStoreString(&dtd->pool, enc, ptr, end); ELEMENT_TYPE *ret; if (!name) return NULL; ret = (ELEMENT_TYPE *) lookup(&dtd->elementTypes, name, sizeof(ELEMENT_TYPE)); if (!ret) return NULL; if (ret->name != name) poolDiscard(&dtd->pool); else { poolFinish(&dtd->pool); if (!setElementTypePrefix(parser, ret)) return NULL; } return ret; } tDOM-0.8.3/expat/COPYING0000644000175000017500000000227010653477534014752 0ustar ssobernissoberniCopyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. tDOM-0.8.3/expat/xmltok.h0000644000175000017500000002566010653477535015417 0ustar ssobernissoberni/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ #ifndef XmlTok_INCLUDED #define XmlTok_INCLUDED 1 #ifdef __cplusplus extern "C" { #endif /* The following token may be returned by XmlContentTok */ #define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be start of illegal ]]> sequence */ /* The following tokens may be returned by both XmlPrologTok and XmlContentTok. */ #define XML_TOK_NONE -4 /* The string to be scanned is empty */ #define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan; might be part of CRLF sequence */ #define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */ #define XML_TOK_PARTIAL -1 /* only part of a token */ #define XML_TOK_INVALID 0 /* The following tokens are returned by XmlContentTok; some are also returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok. */ #define XML_TOK_START_TAG_WITH_ATTS 1 #define XML_TOK_START_TAG_NO_ATTS 2 #define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag */ #define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4 #define XML_TOK_END_TAG 5 #define XML_TOK_DATA_CHARS 6 #define XML_TOK_DATA_NEWLINE 7 #define XML_TOK_CDATA_SECT_OPEN 8 #define XML_TOK_ENTITY_REF 9 #define XML_TOK_CHAR_REF 10 /* numeric character reference */ /* The following tokens may be returned by both XmlPrologTok and XmlContentTok. */ #define XML_TOK_PI 11 /* processing instruction */ #define XML_TOK_XML_DECL 12 /* XML decl or text decl */ #define XML_TOK_COMMENT 13 #define XML_TOK_BOM 14 /* Byte order mark */ /* The following tokens are returned only by XmlPrologTok */ #define XML_TOK_PROLOG_S 15 #define XML_TOK_DECL_OPEN 16 /* */ #define XML_TOK_NAME 18 #define XML_TOK_NMTOKEN 19 #define XML_TOK_POUND_NAME 20 /* #name */ #define XML_TOK_OR 21 /* | */ #define XML_TOK_PERCENT 22 #define XML_TOK_OPEN_PAREN 23 #define XML_TOK_CLOSE_PAREN 24 #define XML_TOK_OPEN_BRACKET 25 #define XML_TOK_CLOSE_BRACKET 26 #define XML_TOK_LITERAL 27 #define XML_TOK_PARAM_ENTITY_REF 28 #define XML_TOK_INSTANCE_START 29 /* The following occur only in element type declarations */ #define XML_TOK_NAME_QUESTION 30 /* name? */ #define XML_TOK_NAME_ASTERISK 31 /* name* */ #define XML_TOK_NAME_PLUS 32 /* name+ */ #define XML_TOK_COND_SECT_OPEN 33 /* */ #define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */ #define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */ #define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */ #define XML_TOK_COMMA 38 /* The following token is returned only by XmlAttributeValueTok */ #define XML_TOK_ATTRIBUTE_VALUE_S 39 /* The following token is returned only by XmlCdataSectionTok */ #define XML_TOK_CDATA_SECT_CLOSE 40 /* With namespace processing this is returned by XmlPrologTok for a name with a colon. */ #define XML_TOK_PREFIXED_NAME 41 #ifdef XML_DTD #define XML_TOK_IGNORE_SECT 42 #endif /* XML_DTD */ #ifdef XML_DTD #define XML_N_STATES 4 #else /* not XML_DTD */ #define XML_N_STATES 3 #endif /* not XML_DTD */ #define XML_PROLOG_STATE 0 #define XML_CONTENT_STATE 1 #define XML_CDATA_SECTION_STATE 2 #ifdef XML_DTD #define XML_IGNORE_SECTION_STATE 3 #endif /* XML_DTD */ #define XML_N_LITERAL_TYPES 2 #define XML_ATTRIBUTE_VALUE_LITERAL 0 #define XML_ENTITY_VALUE_LITERAL 1 /* The size of the buffer passed to XmlUtf8Encode must be at least this. */ #define XML_UTF8_ENCODE_MAX 4 /* The size of the buffer passed to XmlUtf16Encode must be at least this. */ #define XML_UTF16_ENCODE_MAX 2 typedef struct position { /* first line and first column are 0 not 1 */ XML_Size lineNumber; XML_Size columnNumber; } POSITION; typedef struct { const char *name; const char *valuePtr; const char *valueEnd; char normalized; } ATTRIBUTE; struct encoding; typedef struct encoding ENCODING; typedef int (PTRCALL *SCANNER)(const ENCODING *, const char *, const char *, const char **); struct encoding { SCANNER scanners[XML_N_STATES]; SCANNER literalScanners[XML_N_LITERAL_TYPES]; int (PTRCALL *sameName)(const ENCODING *, const char *, const char *); int (PTRCALL *nameMatchesAscii)(const ENCODING *, const char *, const char *, const char *); int (PTRFASTCALL *nameLength)(const ENCODING *, const char *); const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *); int (PTRCALL *getAtts)(const ENCODING *enc, const char *ptr, int attsMax, ATTRIBUTE *atts); int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr); int (PTRCALL *predefinedEntityName)(const ENCODING *, const char *, const char *); void (PTRCALL *updatePosition)(const ENCODING *, const char *ptr, const char *end, POSITION *); int (PTRCALL *isPublicId)(const ENCODING *enc, const char *ptr, const char *end, const char **badPtr); void (PTRCALL *utf8Convert)(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim); void (PTRCALL *utf16Convert)(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim); int minBytesPerChar; char isUtf8; char isUtf16; }; /* Scan the string starting at ptr until the end of the next complete token, but do not scan past eptr. Return an integer giving the type of token. Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set. Return XML_TOK_PARTIAL when the string does not contain a complete token; nextTokPtr will not be set. Return XML_TOK_INVALID when the string does not start a valid token; nextTokPtr will be set to point to the character which made the token invalid. Otherwise the string starts with a valid token; nextTokPtr will be set to point to the character following the end of that token. Each data character counts as a single token, but adjacent data characters may be returned together. Similarly for characters in the prolog outside literals, comments and processing instructions. */ #define XmlTok(enc, state, ptr, end, nextTokPtr) \ (((enc)->scanners[state])(enc, ptr, end, nextTokPtr)) #define XmlPrologTok(enc, ptr, end, nextTokPtr) \ XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr) #define XmlContentTok(enc, ptr, end, nextTokPtr) \ XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr) #define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \ XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr) #ifdef XML_DTD #define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \ XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr) #endif /* XML_DTD */ /* This is used for performing a 2nd-level tokenization on the content of a literal that has already been returned by XmlTok. */ #define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \ (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr)) #define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \ XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr) #define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \ XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr) #define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2)) #define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \ (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2)) #define XmlNameLength(enc, ptr) \ (((enc)->nameLength)(enc, ptr)) #define XmlSkipS(enc, ptr) \ (((enc)->skipS)(enc, ptr)) #define XmlGetAttributes(enc, ptr, attsMax, atts) \ (((enc)->getAtts)(enc, ptr, attsMax, atts)) #define XmlCharRefNumber(enc, ptr) \ (((enc)->charRefNumber)(enc, ptr)) #define XmlPredefinedEntityName(enc, ptr, end) \ (((enc)->predefinedEntityName)(enc, ptr, end)) #define XmlUpdatePosition(enc, ptr, end, pos) \ (((enc)->updatePosition)(enc, ptr, end, pos)) #define XmlIsPublicId(enc, ptr, end, badPtr) \ (((enc)->isPublicId)(enc, ptr, end, badPtr)) #define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \ (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim)) #define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \ (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim)) typedef struct { ENCODING initEnc; const ENCODING **encPtr; } INIT_ENCODING; int XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **versionEndPtr, const char **encodingNamePtr, const ENCODING **namedEncodingPtr, int *standalonePtr); int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); const ENCODING *XmlGetUtf8InternalEncoding(void); const ENCODING *XmlGetUtf16InternalEncoding(void); int FASTCALL XmlUtf8Encode(int charNumber, char *buf); int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf); int XmlSizeOfUnknownEncoding(void); typedef int (XMLCALL *CONVERTER) (void *userData, const char *p); ENCODING * XmlInitUnknownEncoding(void *mem, int *table, CONVERTER convert, void *userData); int XmlParseXmlDeclNS(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **versionEndPtr, const char **encodingNamePtr, const ENCODING **namedEncodingPtr, int *standalonePtr); int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name); const ENCODING *XmlGetUtf8InternalEncodingNS(void); const ENCODING *XmlGetUtf16InternalEncodingNS(void); ENCODING * XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert, void *userData); #ifdef __cplusplus } #endif #endif /* not XmlTok_INCLUDED */ tDOM-0.8.3/expat/winconfig.h0000644000175000017500000000130510653477534016051 0ustar ssobernissoberni/*================================================================ ** Copyright 2000, Clark Cooper ** All rights reserved. ** ** This is free software. You are permitted to copy, distribute, or modify ** it under the terms of the MIT/X license (contained in the COPYING file ** with this distribution.) */ #ifndef WINCONFIG_H #define WINCONFIG_H #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN #include #include #define XML_NS 1 #define XML_DTD 1 #define XML_CONTEXT_BYTES 1024 /* we will assume all Windows platforms are little endian */ #define BYTEORDER 1234 /* Windows has memmove() available. */ #define HAVE_MEMMOVE #endif /* ndef WINCONFIG_H */ tDOM-0.8.3/expat/ascii.h0000644000175000017500000000370110653477535015161 0ustar ssobernissoberni/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ #define ASCII_A 0x41 #define ASCII_B 0x42 #define ASCII_C 0x43 #define ASCII_D 0x44 #define ASCII_E 0x45 #define ASCII_F 0x46 #define ASCII_G 0x47 #define ASCII_H 0x48 #define ASCII_I 0x49 #define ASCII_J 0x4A #define ASCII_K 0x4B #define ASCII_L 0x4C #define ASCII_M 0x4D #define ASCII_N 0x4E #define ASCII_O 0x4F #define ASCII_P 0x50 #define ASCII_Q 0x51 #define ASCII_R 0x52 #define ASCII_S 0x53 #define ASCII_T 0x54 #define ASCII_U 0x55 #define ASCII_V 0x56 #define ASCII_W 0x57 #define ASCII_X 0x58 #define ASCII_Y 0x59 #define ASCII_Z 0x5A #define ASCII_a 0x61 #define ASCII_b 0x62 #define ASCII_c 0x63 #define ASCII_d 0x64 #define ASCII_e 0x65 #define ASCII_f 0x66 #define ASCII_g 0x67 #define ASCII_h 0x68 #define ASCII_i 0x69 #define ASCII_j 0x6A #define ASCII_k 0x6B #define ASCII_l 0x6C #define ASCII_m 0x6D #define ASCII_n 0x6E #define ASCII_o 0x6F #define ASCII_p 0x70 #define ASCII_q 0x71 #define ASCII_r 0x72 #define ASCII_s 0x73 #define ASCII_t 0x74 #define ASCII_u 0x75 #define ASCII_v 0x76 #define ASCII_w 0x77 #define ASCII_x 0x78 #define ASCII_y 0x79 #define ASCII_z 0x7A #define ASCII_0 0x30 #define ASCII_1 0x31 #define ASCII_2 0x32 #define ASCII_3 0x33 #define ASCII_4 0x34 #define ASCII_5 0x35 #define ASCII_6 0x36 #define ASCII_7 0x37 #define ASCII_8 0x38 #define ASCII_9 0x39 #define ASCII_TAB 0x09 #define ASCII_SPACE 0x20 #define ASCII_EXCL 0x21 #define ASCII_QUOT 0x22 #define ASCII_AMP 0x26 #define ASCII_APOS 0x27 #define ASCII_MINUS 0x2D #define ASCII_PERIOD 0x2E #define ASCII_COLON 0x3A #define ASCII_SEMI 0x3B #define ASCII_LT 0x3C #define ASCII_EQUALS 0x3D #define ASCII_GT 0x3E #define ASCII_LSQB 0x5B #define ASCII_RSQB 0x5D #define ASCII_UNDERSCORE 0x5F #define ASCII_LPAREN 0x28 #define ASCII_RPAREN 0x29 #define ASCII_FF 0x0C #define ASCII_SLASH 0x2F #define ASCII_HASH 0x23 #define ASCII_PIPE 0x7C #define ASCII_COMMA 0x2C tDOM-0.8.3/expat/xmltok_ns.c0000644000175000017500000000611010653477535016077 0ustar ssobernissoberni/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ /* This file is included! */ #ifdef XML_TOK_NS_C const ENCODING * NS(XmlGetUtf8InternalEncoding)(void) { return &ns(internal_utf8_encoding).enc; } const ENCODING * NS(XmlGetUtf16InternalEncoding)(void) { #if BYTEORDER == 1234 return &ns(internal_little2_encoding).enc; #elif BYTEORDER == 4321 return &ns(internal_big2_encoding).enc; #else const short n = 1; return (*(const char *)&n ? &ns(internal_little2_encoding).enc : &ns(internal_big2_encoding).enc); #endif } static const ENCODING * const NS(encodings)[] = { &ns(latin1_encoding).enc, &ns(ascii_encoding).enc, &ns(utf8_encoding).enc, &ns(big2_encoding).enc, &ns(big2_encoding).enc, &ns(little2_encoding).enc, &ns(utf8_encoding).enc /* NO_ENC */ }; static int PTRCALL NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_PROLOG_STATE, ptr, end, nextTokPtr); } static int PTRCALL NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_CONTENT_STATE, ptr, end, nextTokPtr); } int NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr, const char *name) { int i = getEncodingIndex(name); if (i == UNKNOWN_ENC) return 0; SET_INIT_ENC_INDEX(p, i); p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog); p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent); p->initEnc.updatePosition = initUpdatePosition; p->encPtr = encPtr; *encPtr = &(p->initEnc); return 1; } static const ENCODING * NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) { #define ENCODING_MAX 128 char buf[ENCODING_MAX]; char *p = buf; int i; XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); if (ptr != end) return 0; *p = 0; if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2) return enc; i = getEncodingIndex(buf); if (i == UNKNOWN_ENC) return 0; return NS(encodings)[i]; } int NS(XmlParseXmlDecl)(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **versionEndPtr, const char **encodingName, const ENCODING **encoding, int *standalone) { return doParseXmlDecl(NS(findEncoding), isGeneralTextEntity, enc, ptr, end, badPtr, versionPtr, versionEndPtr, encodingName, encoding, standalone); } #endif /* XML_TOK_NS_C */ tDOM-0.8.3/expat/xmltok.c0000644000175000017500000012070010653477535015401 0ustar ssobernissoberni/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ #include #ifdef COMPILED_FROM_DSP #include "winconfig.h" #elif defined(MACOS_CLASSIC) #include "macconfig.h" #elif defined(__amigaos4__) #include "amigaconfig.h" #elif defined(__WATCOMC__) #include "watcomconfig.h" #else #ifdef HAVE_EXPAT_CONFIG_H #include #endif #endif /* ndef COMPILED_FROM_DSP */ #include "expat_external.h" #include "internal.h" #include "xmltok.h" #include "nametab.h" #ifdef XML_DTD #define IGNORE_SECTION_TOK_VTABLE , PREFIX(ignoreSectionTok) #else #define IGNORE_SECTION_TOK_VTABLE /* as nothing */ #endif #define VTABLE1 \ { PREFIX(prologTok), PREFIX(contentTok), \ PREFIX(cdataSectionTok) IGNORE_SECTION_TOK_VTABLE }, \ { PREFIX(attributeValueTok), PREFIX(entityValueTok) }, \ PREFIX(sameName), \ PREFIX(nameMatchesAscii), \ PREFIX(nameLength), \ PREFIX(skipS), \ PREFIX(getAtts), \ PREFIX(charRefNumber), \ PREFIX(predefinedEntityName), \ PREFIX(updatePosition), \ PREFIX(isPublicId) #define VTABLE VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16) #define UCS2_GET_NAMING(pages, hi, lo) \ (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1 << ((lo) & 0x1F))) /* A 2 byte UTF-8 representation splits the characters 11 bits between the bottom 5 and 6 bits of the bytes. We need 8 bits to index into pages, 3 bits to add to that index and 5 bits to generate the mask. */ #define UTF8_GET_NAMING2(pages, byte) \ (namingBitmap[((pages)[(((byte)[0]) >> 2) & 7] << 3) \ + ((((byte)[0]) & 3) << 1) \ + ((((byte)[1]) >> 5) & 1)] \ & (1 << (((byte)[1]) & 0x1F))) /* A 3 byte UTF-8 representation splits the characters 16 bits between the bottom 4, 6 and 6 bits of the bytes. We need 8 bits to index into pages, 3 bits to add to that index and 5 bits to generate the mask. */ #define UTF8_GET_NAMING3(pages, byte) \ (namingBitmap[((pages)[((((byte)[0]) & 0xF) << 4) \ + ((((byte)[1]) >> 2) & 0xF)] \ << 3) \ + ((((byte)[1]) & 3) << 1) \ + ((((byte)[2]) >> 5) & 1)] \ & (1 << (((byte)[2]) & 0x1F))) #define UTF8_GET_NAMING(pages, p, n) \ ((n) == 2 \ ? UTF8_GET_NAMING2(pages, (const unsigned char *)(p)) \ : ((n) == 3 \ ? UTF8_GET_NAMING3(pages, (const unsigned char *)(p)) \ : 0)) /* Detection of invalid UTF-8 sequences is based on Table 3.1B of Unicode 3.2: http://www.unicode.org/unicode/reports/tr28/ with the additional restriction of not allowing the Unicode code points 0xFFFF and 0xFFFE (sequences EF,BF,BF and EF,BF,BE). Implementation details: (A & 0x80) == 0 means A < 0x80 and (A & 0xC0) == 0xC0 means A > 0xBF */ #define UTF8_INVALID2(p) \ ((*p) < 0xC2 || ((p)[1] & 0x80) == 0 || ((p)[1] & 0xC0) == 0xC0) #define UTF8_INVALID3(p) \ (((p)[2] & 0x80) == 0 \ || \ ((*p) == 0xEF && (p)[1] == 0xBF \ ? \ (p)[2] > 0xBD \ : \ ((p)[2] & 0xC0) == 0xC0) \ || \ ((*p) == 0xE0 \ ? \ (p)[1] < 0xA0 || ((p)[1] & 0xC0) == 0xC0 \ : \ ((p)[1] & 0x80) == 0 \ || \ ((*p) == 0xED ? (p)[1] > 0x9F : ((p)[1] & 0xC0) == 0xC0))) #define UTF8_INVALID4(p) \ (((p)[3] & 0x80) == 0 || ((p)[3] & 0xC0) == 0xC0 \ || \ ((p)[2] & 0x80) == 0 || ((p)[2] & 0xC0) == 0xC0 \ || \ ((*p) == 0xF0 \ ? \ (p)[1] < 0x90 || ((p)[1] & 0xC0) == 0xC0 \ : \ ((p)[1] & 0x80) == 0 \ || \ ((*p) == 0xF4 ? (p)[1] > 0x8F : ((p)[1] & 0xC0) == 0xC0))) static int PTRFASTCALL isNever(const ENCODING *enc, const char *p) { return 0; } static int PTRFASTCALL utf8_isName2(const ENCODING *enc, const char *p) { return UTF8_GET_NAMING2(namePages, (const unsigned char *)p); } static int PTRFASTCALL utf8_isName3(const ENCODING *enc, const char *p) { return UTF8_GET_NAMING3(namePages, (const unsigned char *)p); } #define utf8_isName4 isNever static int PTRFASTCALL utf8_isNmstrt2(const ENCODING *enc, const char *p) { return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p); } static int PTRFASTCALL utf8_isNmstrt3(const ENCODING *enc, const char *p) { return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p); } #define utf8_isNmstrt4 isNever static int PTRFASTCALL utf8_isInvalid2(const ENCODING *enc, const char *p) { return UTF8_INVALID2((const unsigned char *)p); } static int PTRFASTCALL utf8_isInvalid3(const ENCODING *enc, const char *p) { return UTF8_INVALID3((const unsigned char *)p); } static int PTRFASTCALL utf8_isInvalid4(const ENCODING *enc, const char *p) { return UTF8_INVALID4((const unsigned char *)p); } struct normal_encoding { ENCODING enc; unsigned char type[256]; #ifdef XML_MIN_SIZE int (PTRFASTCALL *byteType)(const ENCODING *, const char *); int (PTRFASTCALL *isNameMin)(const ENCODING *, const char *); int (PTRFASTCALL *isNmstrtMin)(const ENCODING *, const char *); int (PTRFASTCALL *byteToAscii)(const ENCODING *, const char *); int (PTRCALL *charMatches)(const ENCODING *, const char *, int); #endif /* XML_MIN_SIZE */ int (PTRFASTCALL *isName2)(const ENCODING *, const char *); int (PTRFASTCALL *isName3)(const ENCODING *, const char *); int (PTRFASTCALL *isName4)(const ENCODING *, const char *); int (PTRFASTCALL *isNmstrt2)(const ENCODING *, const char *); int (PTRFASTCALL *isNmstrt3)(const ENCODING *, const char *); int (PTRFASTCALL *isNmstrt4)(const ENCODING *, const char *); int (PTRFASTCALL *isInvalid2)(const ENCODING *, const char *); int (PTRFASTCALL *isInvalid3)(const ENCODING *, const char *); int (PTRFASTCALL *isInvalid4)(const ENCODING *, const char *); }; #define AS_NORMAL_ENCODING(enc) ((const struct normal_encoding *) (enc)) #ifdef XML_MIN_SIZE #define STANDARD_VTABLE(E) \ E ## byteType, \ E ## isNameMin, \ E ## isNmstrtMin, \ E ## byteToAscii, \ E ## charMatches, #else #define STANDARD_VTABLE(E) /* as nothing */ #endif #define NORMAL_VTABLE(E) \ E ## isName2, \ E ## isName3, \ E ## isName4, \ E ## isNmstrt2, \ E ## isNmstrt3, \ E ## isNmstrt4, \ E ## isInvalid2, \ E ## isInvalid3, \ E ## isInvalid4 static int FASTCALL checkCharRefNumber(int); #include "xmltok_impl.h" #include "ascii.h" #ifdef XML_MIN_SIZE #define sb_isNameMin isNever #define sb_isNmstrtMin isNever #endif #ifdef XML_MIN_SIZE #define MINBPC(enc) ((enc)->minBytesPerChar) #else /* minimum bytes per character */ #define MINBPC(enc) 1 #endif #define SB_BYTE_TYPE(enc, p) \ (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)]) #ifdef XML_MIN_SIZE static int PTRFASTCALL sb_byteType(const ENCODING *enc, const char *p) { return SB_BYTE_TYPE(enc, p); } #define BYTE_TYPE(enc, p) \ (AS_NORMAL_ENCODING(enc)->byteType(enc, p)) #else #define BYTE_TYPE(enc, p) SB_BYTE_TYPE(enc, p) #endif #ifdef XML_MIN_SIZE #define BYTE_TO_ASCII(enc, p) \ (AS_NORMAL_ENCODING(enc)->byteToAscii(enc, p)) static int PTRFASTCALL sb_byteToAscii(const ENCODING *enc, const char *p) { return *p; } #else #define BYTE_TO_ASCII(enc, p) (*(p)) #endif #define IS_NAME_CHAR(enc, p, n) \ (AS_NORMAL_ENCODING(enc)->isName ## n(enc, p)) #define IS_NMSTRT_CHAR(enc, p, n) \ (AS_NORMAL_ENCODING(enc)->isNmstrt ## n(enc, p)) #define IS_INVALID_CHAR(enc, p, n) \ (AS_NORMAL_ENCODING(enc)->isInvalid ## n(enc, p)) #ifdef XML_MIN_SIZE #define IS_NAME_CHAR_MINBPC(enc, p) \ (AS_NORMAL_ENCODING(enc)->isNameMin(enc, p)) #define IS_NMSTRT_CHAR_MINBPC(enc, p) \ (AS_NORMAL_ENCODING(enc)->isNmstrtMin(enc, p)) #else #define IS_NAME_CHAR_MINBPC(enc, p) (0) #define IS_NMSTRT_CHAR_MINBPC(enc, p) (0) #endif #ifdef XML_MIN_SIZE #define CHAR_MATCHES(enc, p, c) \ (AS_NORMAL_ENCODING(enc)->charMatches(enc, p, c)) static int PTRCALL sb_charMatches(const ENCODING *enc, const char *p, int c) { return *p == c; } #else /* c is an ASCII character */ #define CHAR_MATCHES(enc, p, c) (*(p) == c) #endif #define PREFIX(ident) normal_ ## ident #define XML_TOK_IMPL_C #include "xmltok_impl.c" #undef XML_TOK_IMPL_C #undef MINBPC #undef BYTE_TYPE #undef BYTE_TO_ASCII #undef CHAR_MATCHES #undef IS_NAME_CHAR #undef IS_NAME_CHAR_MINBPC #undef IS_NMSTRT_CHAR #undef IS_NMSTRT_CHAR_MINBPC #undef IS_INVALID_CHAR enum { /* UTF8_cvalN is value of masked first byte of N byte sequence */ UTF8_cval1 = 0x00, UTF8_cval2 = 0xc0, UTF8_cval3 = 0xe0, UTF8_cval4 = 0xf0 }; static void PTRCALL utf8_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim) { char *to; const char *from; if (fromLim - *fromP > toLim - *toP) { /* Avoid copying partial characters. */ for (fromLim = *fromP + (toLim - *toP); fromLim > *fromP; fromLim--) if (((unsigned char)fromLim[-1] & 0xc0) != 0x80) break; } for (to = *toP, from = *fromP; from != fromLim; from++, to++) *to = *from; *fromP = from; *toP = to; } static void PTRCALL utf8_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim) { unsigned short *to = *toP; const char *from = *fromP; while (from != fromLim && to != toLim) { switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) { case BT_LEAD2: *to++ = (unsigned short)(((from[0] & 0x1f) << 6) | (from[1] & 0x3f)); from += 2; break; case BT_LEAD3: *to++ = (unsigned short)(((from[0] & 0xf) << 12) | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f)); from += 3; break; case BT_LEAD4: { unsigned long n; if (to + 1 == toLim) goto after; n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12) | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f); n -= 0x10000; to[0] = (unsigned short)((n >> 10) | 0xD800); to[1] = (unsigned short)((n & 0x3FF) | 0xDC00); to += 2; from += 4; } break; default: *to++ = *from++; break; } } after: *fromP = from; *toP = to; } #ifdef XML_NS static const struct normal_encoding utf8_encoding_ns = { { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, { #include "asciitab.h" #include "utf8tab.h" }, STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) }; #endif static const struct normal_encoding utf8_encoding = { { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, { #define BT_COLON BT_NMSTRT #include "asciitab.h" #undef BT_COLON #include "utf8tab.h" }, STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) }; #ifdef XML_NS static const struct normal_encoding internal_utf8_encoding_ns = { { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, { #include "iasciitab.h" #include "utf8tab.h" }, STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) }; #endif static const struct normal_encoding internal_utf8_encoding = { { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, { #define BT_COLON BT_NMSTRT #include "iasciitab.h" #undef BT_COLON #include "utf8tab.h" }, STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) }; static void PTRCALL latin1_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim) { for (;;) { unsigned char c; if (*fromP == fromLim) break; c = (unsigned char)**fromP; if (c & 0x80) { if (toLim - *toP < 2) break; *(*toP)++ = (char)((c >> 6) | UTF8_cval2); *(*toP)++ = (char)((c & 0x3f) | 0x80); (*fromP)++; } else { if (*toP == toLim) break; *(*toP)++ = *(*fromP)++; } } } static void PTRCALL latin1_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim) { while (*fromP != fromLim && *toP != toLim) *(*toP)++ = (unsigned char)*(*fromP)++; } #ifdef XML_NS static const struct normal_encoding latin1_encoding_ns = { { VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 }, { #include "asciitab.h" #include "latin1tab.h" }, STANDARD_VTABLE(sb_) }; #endif static const struct normal_encoding latin1_encoding = { { VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 }, { #define BT_COLON BT_NMSTRT #include "asciitab.h" #undef BT_COLON #include "latin1tab.h" }, STANDARD_VTABLE(sb_) }; static void PTRCALL ascii_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim) { while (*fromP != fromLim && *toP != toLim) *(*toP)++ = *(*fromP)++; } #ifdef XML_NS static const struct normal_encoding ascii_encoding_ns = { { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 }, { #include "asciitab.h" /* BT_NONXML == 0 */ }, STANDARD_VTABLE(sb_) }; #endif static const struct normal_encoding ascii_encoding = { { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 }, { #define BT_COLON BT_NMSTRT #include "asciitab.h" #undef BT_COLON /* BT_NONXML == 0 */ }, STANDARD_VTABLE(sb_) }; static int PTRFASTCALL unicode_byte_type(char hi, char lo) { switch ((unsigned char)hi) { case 0xD8: case 0xD9: case 0xDA: case 0xDB: return BT_LEAD4; case 0xDC: case 0xDD: case 0xDE: case 0xDF: return BT_TRAIL; case 0xFF: switch ((unsigned char)lo) { case 0xFF: case 0xFE: return BT_NONXML; } break; } return BT_NONASCII; } #define DEFINE_UTF16_TO_UTF8(E) \ static void PTRCALL \ E ## toUtf8(const ENCODING *enc, \ const char **fromP, const char *fromLim, \ char **toP, const char *toLim) \ { \ const char *from; \ for (from = *fromP; from != fromLim; from += 2) { \ int plane; \ unsigned char lo2; \ unsigned char lo = GET_LO(from); \ unsigned char hi = GET_HI(from); \ switch (hi) { \ case 0: \ if (lo < 0x80) { \ if (*toP == toLim) { \ *fromP = from; \ return; \ } \ *(*toP)++ = lo; \ break; \ } \ /* fall through */ \ case 0x1: case 0x2: case 0x3: \ case 0x4: case 0x5: case 0x6: case 0x7: \ if (toLim - *toP < 2) { \ *fromP = from; \ return; \ } \ *(*toP)++ = ((lo >> 6) | (hi << 2) | UTF8_cval2); \ *(*toP)++ = ((lo & 0x3f) | 0x80); \ break; \ default: \ if (toLim - *toP < 3) { \ *fromP = from; \ return; \ } \ /* 16 bits divided 4, 6, 6 amongst 3 bytes */ \ *(*toP)++ = ((hi >> 4) | UTF8_cval3); \ *(*toP)++ = (((hi & 0xf) << 2) | (lo >> 6) | 0x80); \ *(*toP)++ = ((lo & 0x3f) | 0x80); \ break; \ case 0xD8: case 0xD9: case 0xDA: case 0xDB: \ if (toLim - *toP < 4) { \ *fromP = from; \ return; \ } \ plane = (((hi & 0x3) << 2) | ((lo >> 6) & 0x3)) + 1; \ *(*toP)++ = ((plane >> 2) | UTF8_cval4); \ *(*toP)++ = (((lo >> 2) & 0xF) | ((plane & 0x3) << 4) | 0x80); \ from += 2; \ lo2 = GET_LO(from); \ *(*toP)++ = (((lo & 0x3) << 4) \ | ((GET_HI(from) & 0x3) << 2) \ | (lo2 >> 6) \ | 0x80); \ *(*toP)++ = ((lo2 & 0x3f) | 0x80); \ break; \ } \ } \ *fromP = from; \ } #define DEFINE_UTF16_TO_UTF16(E) \ static void PTRCALL \ E ## toUtf16(const ENCODING *enc, \ const char **fromP, const char *fromLim, \ unsigned short **toP, const unsigned short *toLim) \ { \ /* Avoid copying first half only of surrogate */ \ if (fromLim - *fromP > ((toLim - *toP) << 1) \ && (GET_HI(fromLim - 2) & 0xF8) == 0xD8) \ fromLim -= 2; \ for (; *fromP != fromLim && *toP != toLim; *fromP += 2) \ *(*toP)++ = (GET_HI(*fromP) << 8) | GET_LO(*fromP); \ } #define SET2(ptr, ch) \ (((ptr)[0] = ((ch) & 0xff)), ((ptr)[1] = ((ch) >> 8))) #define GET_LO(ptr) ((unsigned char)(ptr)[0]) #define GET_HI(ptr) ((unsigned char)(ptr)[1]) DEFINE_UTF16_TO_UTF8(little2_) DEFINE_UTF16_TO_UTF16(little2_) #undef SET2 #undef GET_LO #undef GET_HI #define SET2(ptr, ch) \ (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch) & 0xFF))) #define GET_LO(ptr) ((unsigned char)(ptr)[1]) #define GET_HI(ptr) ((unsigned char)(ptr)[0]) DEFINE_UTF16_TO_UTF8(big2_) DEFINE_UTF16_TO_UTF16(big2_) #undef SET2 #undef GET_LO #undef GET_HI #define LITTLE2_BYTE_TYPE(enc, p) \ ((p)[1] == 0 \ ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \ : unicode_byte_type((p)[1], (p)[0])) #define LITTLE2_BYTE_TO_ASCII(enc, p) ((p)[1] == 0 ? (p)[0] : -1) #define LITTLE2_CHAR_MATCHES(enc, p, c) ((p)[1] == 0 && (p)[0] == c) #define LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) \ UCS2_GET_NAMING(namePages, (unsigned char)p[1], (unsigned char)p[0]) #define LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p) \ UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[1], (unsigned char)p[0]) #ifdef XML_MIN_SIZE static int PTRFASTCALL little2_byteType(const ENCODING *enc, const char *p) { return LITTLE2_BYTE_TYPE(enc, p); } static int PTRFASTCALL little2_byteToAscii(const ENCODING *enc, const char *p) { return LITTLE2_BYTE_TO_ASCII(enc, p); } static int PTRCALL little2_charMatches(const ENCODING *enc, const char *p, int c) { return LITTLE2_CHAR_MATCHES(enc, p, c); } static int PTRFASTCALL little2_isNameMin(const ENCODING *enc, const char *p) { return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p); } static int PTRFASTCALL little2_isNmstrtMin(const ENCODING *enc, const char *p) { return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p); } #undef VTABLE #define VTABLE VTABLE1, little2_toUtf8, little2_toUtf16 #else /* not XML_MIN_SIZE */ #undef PREFIX #define PREFIX(ident) little2_ ## ident #define MINBPC(enc) 2 /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ #define BYTE_TYPE(enc, p) LITTLE2_BYTE_TYPE(enc, p) #define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p) #define CHAR_MATCHES(enc, p, c) LITTLE2_CHAR_MATCHES(enc, p, c) #define IS_NAME_CHAR(enc, p, n) 0 #define IS_NAME_CHAR_MINBPC(enc, p) LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) #define IS_NMSTRT_CHAR(enc, p, n) (0) #define IS_NMSTRT_CHAR_MINBPC(enc, p) LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p) #define XML_TOK_IMPL_C #include "xmltok_impl.c" #undef XML_TOK_IMPL_C #undef MINBPC #undef BYTE_TYPE #undef BYTE_TO_ASCII #undef CHAR_MATCHES #undef IS_NAME_CHAR #undef IS_NAME_CHAR_MINBPC #undef IS_NMSTRT_CHAR #undef IS_NMSTRT_CHAR_MINBPC #undef IS_INVALID_CHAR #endif /* not XML_MIN_SIZE */ #ifdef XML_NS static const struct normal_encoding little2_encoding_ns = { { VTABLE, 2, 0, #if BYTEORDER == 1234 1 #else 0 #endif }, { #include "asciitab.h" #include "latin1tab.h" }, STANDARD_VTABLE(little2_) }; #endif static const struct normal_encoding little2_encoding = { { VTABLE, 2, 0, #if BYTEORDER == 1234 1 #else 0 #endif }, { #define BT_COLON BT_NMSTRT #include "asciitab.h" #undef BT_COLON #include "latin1tab.h" }, STANDARD_VTABLE(little2_) }; #if BYTEORDER != 4321 #ifdef XML_NS static const struct normal_encoding internal_little2_encoding_ns = { { VTABLE, 2, 0, 1 }, { #include "iasciitab.h" #include "latin1tab.h" }, STANDARD_VTABLE(little2_) }; #endif static const struct normal_encoding internal_little2_encoding = { { VTABLE, 2, 0, 1 }, { #define BT_COLON BT_NMSTRT #include "iasciitab.h" #undef BT_COLON #include "latin1tab.h" }, STANDARD_VTABLE(little2_) }; #endif #define BIG2_BYTE_TYPE(enc, p) \ ((p)[0] == 0 \ ? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \ : unicode_byte_type((p)[0], (p)[1])) #define BIG2_BYTE_TO_ASCII(enc, p) ((p)[0] == 0 ? (p)[1] : -1) #define BIG2_CHAR_MATCHES(enc, p, c) ((p)[0] == 0 && (p)[1] == c) #define BIG2_IS_NAME_CHAR_MINBPC(enc, p) \ UCS2_GET_NAMING(namePages, (unsigned char)p[0], (unsigned char)p[1]) #define BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) \ UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[0], (unsigned char)p[1]) #ifdef XML_MIN_SIZE static int PTRFASTCALL big2_byteType(const ENCODING *enc, const char *p) { return BIG2_BYTE_TYPE(enc, p); } static int PTRFASTCALL big2_byteToAscii(const ENCODING *enc, const char *p) { return BIG2_BYTE_TO_ASCII(enc, p); } static int PTRCALL big2_charMatches(const ENCODING *enc, const char *p, int c) { return BIG2_CHAR_MATCHES(enc, p, c); } static int PTRFASTCALL big2_isNameMin(const ENCODING *enc, const char *p) { return BIG2_IS_NAME_CHAR_MINBPC(enc, p); } static int PTRFASTCALL big2_isNmstrtMin(const ENCODING *enc, const char *p) { return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p); } #undef VTABLE #define VTABLE VTABLE1, big2_toUtf8, big2_toUtf16 #else /* not XML_MIN_SIZE */ #undef PREFIX #define PREFIX(ident) big2_ ## ident #define MINBPC(enc) 2 /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ #define BYTE_TYPE(enc, p) BIG2_BYTE_TYPE(enc, p) #define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p) #define CHAR_MATCHES(enc, p, c) BIG2_CHAR_MATCHES(enc, p, c) #define IS_NAME_CHAR(enc, p, n) 0 #define IS_NAME_CHAR_MINBPC(enc, p) BIG2_IS_NAME_CHAR_MINBPC(enc, p) #define IS_NMSTRT_CHAR(enc, p, n) (0) #define IS_NMSTRT_CHAR_MINBPC(enc, p) BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) #define XML_TOK_IMPL_C #include "xmltok_impl.c" #undef XML_TOK_IMPL_C #undef MINBPC #undef BYTE_TYPE #undef BYTE_TO_ASCII #undef CHAR_MATCHES #undef IS_NAME_CHAR #undef IS_NAME_CHAR_MINBPC #undef IS_NMSTRT_CHAR #undef IS_NMSTRT_CHAR_MINBPC #undef IS_INVALID_CHAR #endif /* not XML_MIN_SIZE */ #ifdef XML_NS static const struct normal_encoding big2_encoding_ns = { { VTABLE, 2, 0, #if BYTEORDER == 4321 1 #else 0 #endif }, { #include "asciitab.h" #include "latin1tab.h" }, STANDARD_VTABLE(big2_) }; #endif static const struct normal_encoding big2_encoding = { { VTABLE, 2, 0, #if BYTEORDER == 4321 1 #else 0 #endif }, { #define BT_COLON BT_NMSTRT #include "asciitab.h" #undef BT_COLON #include "latin1tab.h" }, STANDARD_VTABLE(big2_) }; #if BYTEORDER != 1234 #ifdef XML_NS static const struct normal_encoding internal_big2_encoding_ns = { { VTABLE, 2, 0, 1 }, { #include "iasciitab.h" #include "latin1tab.h" }, STANDARD_VTABLE(big2_) }; #endif static const struct normal_encoding internal_big2_encoding = { { VTABLE, 2, 0, 1 }, { #define BT_COLON BT_NMSTRT #include "iasciitab.h" #undef BT_COLON #include "latin1tab.h" }, STANDARD_VTABLE(big2_) }; #endif #undef PREFIX static int FASTCALL streqci(const char *s1, const char *s2) { for (;;) { char c1 = *s1++; char c2 = *s2++; if (ASCII_a <= c1 && c1 <= ASCII_z) c1 += ASCII_A - ASCII_a; if (ASCII_a <= c2 && c2 <= ASCII_z) c2 += ASCII_A - ASCII_a; if (c1 != c2) return 0; if (!c1) break; } return 1; } static void PTRCALL initUpdatePosition(const ENCODING *enc, const char *ptr, const char *end, POSITION *pos) { normal_updatePosition(&utf8_encoding.enc, ptr, end, pos); } static int toAscii(const ENCODING *enc, const char *ptr, const char *end) { char buf[1]; char *p = buf; XmlUtf8Convert(enc, &ptr, end, &p, p + 1); if (p == buf) return -1; else return buf[0]; } static int FASTCALL isSpace(int c) { switch (c) { case 0x20: case 0xD: case 0xA: case 0x9: return 1; } return 0; } /* Return 1 if there's just optional white space or there's an S followed by name=val. */ static int parsePseudoAttribute(const ENCODING *enc, const char *ptr, const char *end, const char **namePtr, const char **nameEndPtr, const char **valPtr, const char **nextTokPtr) { int c; char open; if (ptr == end) { *namePtr = NULL; return 1; } if (!isSpace(toAscii(enc, ptr, end))) { *nextTokPtr = ptr; return 0; } do { ptr += enc->minBytesPerChar; } while (isSpace(toAscii(enc, ptr, end))); if (ptr == end) { *namePtr = NULL; return 1; } *namePtr = ptr; for (;;) { c = toAscii(enc, ptr, end); if (c == -1) { *nextTokPtr = ptr; return 0; } if (c == ASCII_EQUALS) { *nameEndPtr = ptr; break; } if (isSpace(c)) { *nameEndPtr = ptr; do { ptr += enc->minBytesPerChar; } while (isSpace(c = toAscii(enc, ptr, end))); if (c != ASCII_EQUALS) { *nextTokPtr = ptr; return 0; } break; } ptr += enc->minBytesPerChar; } if (ptr == *namePtr) { *nextTokPtr = ptr; return 0; } ptr += enc->minBytesPerChar; c = toAscii(enc, ptr, end); while (isSpace(c)) { ptr += enc->minBytesPerChar; c = toAscii(enc, ptr, end); } if (c != ASCII_QUOT && c != ASCII_APOS) { *nextTokPtr = ptr; return 0; } open = (char)c; ptr += enc->minBytesPerChar; *valPtr = ptr; for (;; ptr += enc->minBytesPerChar) { c = toAscii(enc, ptr, end); if (c == open) break; if (!(ASCII_a <= c && c <= ASCII_z) && !(ASCII_A <= c && c <= ASCII_Z) && !(ASCII_0 <= c && c <= ASCII_9) && c != ASCII_PERIOD && c != ASCII_MINUS && c != ASCII_UNDERSCORE) { *nextTokPtr = ptr; return 0; } } *nextTokPtr = ptr + enc->minBytesPerChar; return 1; } static const char KW_version[] = { ASCII_v, ASCII_e, ASCII_r, ASCII_s, ASCII_i, ASCII_o, ASCII_n, '\0' }; static const char KW_encoding[] = { ASCII_e, ASCII_n, ASCII_c, ASCII_o, ASCII_d, ASCII_i, ASCII_n, ASCII_g, '\0' }; static const char KW_standalone[] = { ASCII_s, ASCII_t, ASCII_a, ASCII_n, ASCII_d, ASCII_a, ASCII_l, ASCII_o, ASCII_n, ASCII_e, '\0' }; static const char KW_yes[] = { ASCII_y, ASCII_e, ASCII_s, '\0' }; static const char KW_no[] = { ASCII_n, ASCII_o, '\0' }; static int doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *, const char *, const char *), int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **versionEndPtr, const char **encodingName, const ENCODING **encoding, int *standalone) { const char *val = NULL; const char *name = NULL; const char *nameEnd = NULL; ptr += 5 * enc->minBytesPerChar; end -= 2 * enc->minBytesPerChar; if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr) || !name) { *badPtr = ptr; return 0; } if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_version)) { if (!isGeneralTextEntity) { *badPtr = name; return 0; } } else { if (versionPtr) *versionPtr = val; if (versionEndPtr) *versionEndPtr = ptr; if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) { *badPtr = ptr; return 0; } if (!name) { if (isGeneralTextEntity) { /* a TextDecl must have an EncodingDecl */ *badPtr = ptr; return 0; } return 1; } } if (XmlNameMatchesAscii(enc, name, nameEnd, KW_encoding)) { int c = toAscii(enc, val, end); if (!(ASCII_a <= c && c <= ASCII_z) && !(ASCII_A <= c && c <= ASCII_Z)) { *badPtr = val; return 0; } if (encodingName) *encodingName = val; if (encoding) *encoding = encodingFinder(enc, val, ptr - enc->minBytesPerChar); if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) { *badPtr = ptr; return 0; } if (!name) return 1; } if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_standalone) || isGeneralTextEntity) { *badPtr = name; return 0; } if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_yes)) { if (standalone) *standalone = 1; } else if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_no)) { if (standalone) *standalone = 0; } else { *badPtr = val; return 0; } while (isSpace(toAscii(enc, ptr, end))) ptr += enc->minBytesPerChar; if (ptr != end) { *badPtr = ptr; return 0; } return 1; } static int FASTCALL checkCharRefNumber(int result) { switch (result >> 8) { case 0xD8: case 0xD9: case 0xDA: case 0xDB: case 0xDC: case 0xDD: case 0xDE: case 0xDF: return -1; case 0: if (latin1_encoding.type[result] == BT_NONXML) return -1; break; case 0xFF: if (result == 0xFFFE || result == 0xFFFF) return -1; break; } return result; } int FASTCALL XmlUtf8Encode(int c, char *buf) { enum { /* minN is minimum legal resulting value for N byte sequence */ min2 = 0x80, min3 = 0x800, min4 = 0x10000 }; if (c < 0) return 0; if (c < min2) { buf[0] = (char)(c | UTF8_cval1); return 1; } if (c < min3) { buf[0] = (char)((c >> 6) | UTF8_cval2); buf[1] = (char)((c & 0x3f) | 0x80); return 2; } if (c < min4) { buf[0] = (char)((c >> 12) | UTF8_cval3); buf[1] = (char)(((c >> 6) & 0x3f) | 0x80); buf[2] = (char)((c & 0x3f) | 0x80); return 3; } if (c < 0x110000) { buf[0] = (char)((c >> 18) | UTF8_cval4); buf[1] = (char)(((c >> 12) & 0x3f) | 0x80); buf[2] = (char)(((c >> 6) & 0x3f) | 0x80); buf[3] = (char)((c & 0x3f) | 0x80); return 4; } return 0; } int FASTCALL XmlUtf16Encode(int charNum, unsigned short *buf) { if (charNum < 0) return 0; if (charNum < 0x10000) { buf[0] = (unsigned short)charNum; return 1; } if (charNum < 0x110000) { charNum -= 0x10000; buf[0] = (unsigned short)((charNum >> 10) + 0xD800); buf[1] = (unsigned short)((charNum & 0x3FF) + 0xDC00); return 2; } return 0; } struct unknown_encoding { struct normal_encoding normal; CONVERTER convert; void *userData; unsigned short utf16[256]; char utf8[256][4]; }; #define AS_UNKNOWN_ENCODING(enc) ((const struct unknown_encoding *) (enc)) int XmlSizeOfUnknownEncoding(void) { return sizeof(struct unknown_encoding); } static int PTRFASTCALL unknown_isName(const ENCODING *enc, const char *p) { const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); int c = uenc->convert(uenc->userData, p); if (c & ~0xFFFF) return 0; return UCS2_GET_NAMING(namePages, c >> 8, c & 0xFF); } static int PTRFASTCALL unknown_isNmstrt(const ENCODING *enc, const char *p) { const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); int c = uenc->convert(uenc->userData, p); if (c & ~0xFFFF) return 0; return UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xFF); } static int PTRFASTCALL unknown_isInvalid(const ENCODING *enc, const char *p) { const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); int c = uenc->convert(uenc->userData, p); return (c & ~0xFFFF) || checkCharRefNumber(c) < 0; } static void PTRCALL unknown_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim) { const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); char buf[XML_UTF8_ENCODE_MAX]; for (;;) { const char *utf8; int n; if (*fromP == fromLim) break; utf8 = uenc->utf8[(unsigned char)**fromP]; n = *utf8++; if (n == 0) { int c = uenc->convert(uenc->userData, *fromP); n = XmlUtf8Encode(c, buf); if (n > toLim - *toP) break; utf8 = buf; *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP] - (BT_LEAD2 - 2)); } else { if (n > toLim - *toP) break; (*fromP)++; } do { *(*toP)++ = *utf8++; } while (--n != 0); } } static void PTRCALL unknown_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim) { const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); while (*fromP != fromLim && *toP != toLim) { unsigned short c = uenc->utf16[(unsigned char)**fromP]; if (c == 0) { c = (unsigned short) uenc->convert(uenc->userData, *fromP); *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP] - (BT_LEAD2 - 2)); } else (*fromP)++; *(*toP)++ = c; } } ENCODING * XmlInitUnknownEncoding(void *mem, int *table, CONVERTER convert, void *userData) { int i; struct unknown_encoding *e = (struct unknown_encoding *)mem; for (i = 0; i < (int)sizeof(struct normal_encoding); i++) ((char *)mem)[i] = ((char *)&latin1_encoding)[i]; for (i = 0; i < 128; i++) if (latin1_encoding.type[i] != BT_OTHER && latin1_encoding.type[i] != BT_NONXML && table[i] != i) return 0; for (i = 0; i < 256; i++) { int c = table[i]; if (c == -1) { e->normal.type[i] = BT_MALFORM; /* This shouldn't really get used. */ e->utf16[i] = 0xFFFF; e->utf8[i][0] = 1; e->utf8[i][1] = 0; } else if (c < 0) { if (c < -4) return 0; e->normal.type[i] = (unsigned char)(BT_LEAD2 - (c + 2)); e->utf8[i][0] = 0; e->utf16[i] = 0; } else if (c < 0x80) { if (latin1_encoding.type[c] != BT_OTHER && latin1_encoding.type[c] != BT_NONXML && c != i) return 0; e->normal.type[i] = latin1_encoding.type[c]; e->utf8[i][0] = 1; e->utf8[i][1] = (char)c; e->utf16[i] = (unsigned short)(c == 0 ? 0xFFFF : c); } else if (checkCharRefNumber(c) < 0) { e->normal.type[i] = BT_NONXML; /* This shouldn't really get used. */ e->utf16[i] = 0xFFFF; e->utf8[i][0] = 1; e->utf8[i][1] = 0; } else { if (c > 0xFFFF) return 0; if (UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xff)) e->normal.type[i] = BT_NMSTRT; else if (UCS2_GET_NAMING(namePages, c >> 8, c & 0xff)) e->normal.type[i] = BT_NAME; else e->normal.type[i] = BT_OTHER; e->utf8[i][0] = (char)XmlUtf8Encode(c, e->utf8[i] + 1); e->utf16[i] = (unsigned short)c; } } e->userData = userData; e->convert = convert; if (convert) { e->normal.isName2 = unknown_isName; e->normal.isName3 = unknown_isName; e->normal.isName4 = unknown_isName; e->normal.isNmstrt2 = unknown_isNmstrt; e->normal.isNmstrt3 = unknown_isNmstrt; e->normal.isNmstrt4 = unknown_isNmstrt; e->normal.isInvalid2 = unknown_isInvalid; e->normal.isInvalid3 = unknown_isInvalid; e->normal.isInvalid4 = unknown_isInvalid; } e->normal.enc.utf8Convert = unknown_toUtf8; e->normal.enc.utf16Convert = unknown_toUtf16; return &(e->normal.enc); } /* If this enumeration is changed, getEncodingIndex and encodings must also be changed. */ enum { UNKNOWN_ENC = -1, ISO_8859_1_ENC = 0, US_ASCII_ENC, UTF_8_ENC, UTF_16_ENC, UTF_16BE_ENC, UTF_16LE_ENC, /* must match encodingNames up to here */ NO_ENC }; static const char KW_ISO_8859_1[] = { ASCII_I, ASCII_S, ASCII_O, ASCII_MINUS, ASCII_8, ASCII_8, ASCII_5, ASCII_9, ASCII_MINUS, ASCII_1, '\0' }; static const char KW_US_ASCII[] = { ASCII_U, ASCII_S, ASCII_MINUS, ASCII_A, ASCII_S, ASCII_C, ASCII_I, ASCII_I, '\0' }; static const char KW_UTF_8[] = { ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_8, '\0' }; static const char KW_UTF_16[] = { ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, '\0' }; static const char KW_UTF_16BE[] = { ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_B, ASCII_E, '\0' }; static const char KW_UTF_16LE[] = { ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_L, ASCII_E, '\0' }; static int FASTCALL getEncodingIndex(const char *name) { static const char * const encodingNames[] = { KW_ISO_8859_1, KW_US_ASCII, KW_UTF_8, KW_UTF_16, KW_UTF_16BE, KW_UTF_16LE, }; int i; if (name == NULL) return NO_ENC; for (i = 0; i < (int)(sizeof(encodingNames)/sizeof(encodingNames[0])); i++) if (streqci(name, encodingNames[i])) return i; return UNKNOWN_ENC; } /* For binary compatibility, we store the index of the encoding specified at initialization in the isUtf16 member. */ #define INIT_ENC_INDEX(enc) ((int)(enc)->initEnc.isUtf16) #define SET_INIT_ENC_INDEX(enc, i) ((enc)->initEnc.isUtf16 = (char)i) /* This is what detects the encoding. encodingTable maps from encoding indices to encodings; INIT_ENC_INDEX(enc) is the index of the external (protocol) specified encoding; state is XML_CONTENT_STATE if we're parsing an external text entity, and XML_PROLOG_STATE otherwise. */ static int initScan(const ENCODING * const *encodingTable, const INIT_ENCODING *enc, int state, const char *ptr, const char *end, const char **nextTokPtr) { const ENCODING **encPtr; if (ptr == end) return XML_TOK_NONE; encPtr = enc->encPtr; if (ptr + 1 == end) { /* only a single byte available for auto-detection */ #ifndef XML_DTD /* FIXME */ /* a well-formed document entity must have more than one byte */ if (state != XML_CONTENT_STATE) return XML_TOK_PARTIAL; #endif /* so we're parsing an external text entity... */ /* if UTF-16 was externally specified, then we need at least 2 bytes */ switch (INIT_ENC_INDEX(enc)) { case UTF_16_ENC: case UTF_16LE_ENC: case UTF_16BE_ENC: return XML_TOK_PARTIAL; } switch ((unsigned char)*ptr) { case 0xFE: case 0xFF: case 0xEF: /* possibly first byte of UTF-8 BOM */ if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC && state == XML_CONTENT_STATE) break; /* fall through */ case 0x00: case 0x3C: return XML_TOK_PARTIAL; } } else { switch (((unsigned char)ptr[0] << 8) | (unsigned char)ptr[1]) { case 0xFEFF: if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC && state == XML_CONTENT_STATE) break; *nextTokPtr = ptr + 2; *encPtr = encodingTable[UTF_16BE_ENC]; return XML_TOK_BOM; /* 00 3C is handled in the default case */ case 0x3C00: if ((INIT_ENC_INDEX(enc) == UTF_16BE_ENC || INIT_ENC_INDEX(enc) == UTF_16_ENC) && state == XML_CONTENT_STATE) break; *encPtr = encodingTable[UTF_16LE_ENC]; return XmlTok(*encPtr, state, ptr, end, nextTokPtr); case 0xFFFE: if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC && state == XML_CONTENT_STATE) break; *nextTokPtr = ptr + 2; *encPtr = encodingTable[UTF_16LE_ENC]; return XML_TOK_BOM; case 0xEFBB: /* Maybe a UTF-8 BOM (EF BB BF) */ /* If there's an explicitly specified (external) encoding of ISO-8859-1 or some flavour of UTF-16 and this is an external text entity, don't look for the BOM, because it might be a legal data. */ if (state == XML_CONTENT_STATE) { int e = INIT_ENC_INDEX(enc); if (e == ISO_8859_1_ENC || e == UTF_16BE_ENC || e == UTF_16LE_ENC || e == UTF_16_ENC) break; } if (ptr + 2 == end) return XML_TOK_PARTIAL; if ((unsigned char)ptr[2] == 0xBF) { *nextTokPtr = ptr + 3; *encPtr = encodingTable[UTF_8_ENC]; return XML_TOK_BOM; } break; default: if (ptr[0] == '\0') { /* 0 isn't a legal data character. Furthermore a document entity can only start with ASCII characters. So the only way this can fail to be big-endian UTF-16 if it it's an external parsed general entity that's labelled as UTF-16LE. */ if (state == XML_CONTENT_STATE && INIT_ENC_INDEX(enc) == UTF_16LE_ENC) break; *encPtr = encodingTable[UTF_16BE_ENC]; return XmlTok(*encPtr, state, ptr, end, nextTokPtr); } else if (ptr[1] == '\0') { /* We could recover here in the case: - parsing an external entity - second byte is 0 - no externally specified encoding - no encoding declaration by assuming UTF-16LE. But we don't, because this would mean when presented just with a single byte, we couldn't reliably determine whether we needed further bytes. */ if (state == XML_CONTENT_STATE) break; *encPtr = encodingTable[UTF_16LE_ENC]; return XmlTok(*encPtr, state, ptr, end, nextTokPtr); } break; } } *encPtr = encodingTable[INIT_ENC_INDEX(enc)]; return XmlTok(*encPtr, state, ptr, end, nextTokPtr); } #define NS(x) x #define ns(x) x #define XML_TOK_NS_C #include "xmltok_ns.c" #undef XML_TOK_NS_C #undef NS #undef ns #ifdef XML_NS #define NS(x) x ## NS #define ns(x) x ## _ns #define XML_TOK_NS_C #include "xmltok_ns.c" #undef XML_TOK_NS_C #undef NS #undef ns ENCODING * XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert, void *userData) { ENCODING *enc = XmlInitUnknownEncoding(mem, table, convert, userData); if (enc) ((struct normal_encoding *)enc)->type[ASCII_COLON] = BT_COLON; return enc; } #endif /* XML_NS */ tDOM-0.8.3/expat/iasciitab.h0000644000175000017500000000344607530547656016031 0ustar ssobernissoberni/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ /* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, /* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, tDOM-0.8.3/expat/expat.h0000644000175000017500000011662310653477535015222 0ustar ssobernissoberni/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ #ifndef Expat_INCLUDED #define Expat_INCLUDED 1 #ifdef __VMS /* 0 1 2 3 0 1 2 3 1234567890123456789012345678901 1234567890123456789012345678901 */ #define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler #define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler #define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler #define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg #endif #include #include "expat_external.h" #ifdef __cplusplus extern "C" { #endif struct XML_ParserStruct; typedef struct XML_ParserStruct *XML_Parser; /* Should this be defined using stdbool.h when C99 is available? */ typedef unsigned char XML_Bool; #define XML_TRUE ((XML_Bool) 1) #define XML_FALSE ((XML_Bool) 0) /* The XML_Status enum gives the possible return values for several API functions. The preprocessor #defines are included so this stanza can be added to code that still needs to support older versions of Expat 1.95.x: #ifndef XML_STATUS_OK #define XML_STATUS_OK 1 #define XML_STATUS_ERROR 0 #endif Otherwise, the #define hackery is quite ugly and would have been dropped. */ enum XML_Status { XML_STATUS_ERROR = 0, #define XML_STATUS_ERROR XML_STATUS_ERROR XML_STATUS_OK = 1, #define XML_STATUS_OK XML_STATUS_OK XML_STATUS_SUSPENDED = 2 #define XML_STATUS_SUSPENDED XML_STATUS_SUSPENDED }; enum XML_Error { XML_ERROR_NONE, XML_ERROR_NO_MEMORY, XML_ERROR_SYNTAX, XML_ERROR_NO_ELEMENTS, XML_ERROR_INVALID_TOKEN, XML_ERROR_UNCLOSED_TOKEN, XML_ERROR_PARTIAL_CHAR, XML_ERROR_TAG_MISMATCH, XML_ERROR_DUPLICATE_ATTRIBUTE, XML_ERROR_JUNK_AFTER_DOC_ELEMENT, XML_ERROR_PARAM_ENTITY_REF, XML_ERROR_UNDEFINED_ENTITY, XML_ERROR_RECURSIVE_ENTITY_REF, XML_ERROR_ASYNC_ENTITY, XML_ERROR_BAD_CHAR_REF, XML_ERROR_BINARY_ENTITY_REF, XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, XML_ERROR_MISPLACED_XML_PI, XML_ERROR_UNKNOWN_ENCODING, XML_ERROR_INCORRECT_ENCODING, XML_ERROR_UNCLOSED_CDATA_SECTION, XML_ERROR_EXTERNAL_ENTITY_HANDLING, XML_ERROR_NOT_STANDALONE, XML_ERROR_UNEXPECTED_STATE, XML_ERROR_ENTITY_DECLARED_IN_PE, XML_ERROR_FEATURE_REQUIRES_XML_DTD, XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING, /* Added in 1.95.7. */ XML_ERROR_UNBOUND_PREFIX, /* Added in 1.95.8. */ XML_ERROR_UNDECLARING_PREFIX, XML_ERROR_INCOMPLETE_PE, XML_ERROR_XML_DECL, XML_ERROR_TEXT_DECL, XML_ERROR_PUBLICID, XML_ERROR_SUSPENDED, XML_ERROR_NOT_SUSPENDED, XML_ERROR_ABORTED, XML_ERROR_FINISHED, XML_ERROR_SUSPEND_PE, /* Added in 2.0. */ XML_ERROR_RESERVED_PREFIX_XML, XML_ERROR_RESERVED_PREFIX_XMLNS, XML_ERROR_RESERVED_NAMESPACE_URI }; enum XML_Content_Type { XML_CTYPE_EMPTY = 1, XML_CTYPE_ANY, XML_CTYPE_MIXED, XML_CTYPE_NAME, XML_CTYPE_CHOICE, XML_CTYPE_SEQ }; enum XML_Content_Quant { XML_CQUANT_NONE, XML_CQUANT_OPT, XML_CQUANT_REP, XML_CQUANT_PLUS }; /* If type == XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be XML_CQUANT_NONE, and the other fields will be zero or NULL. If type == XML_CTYPE_MIXED, then quant will be NONE or REP and numchildren will contain number of elements that may be mixed in and children point to an array of XML_Content cells that will be all of XML_CTYPE_NAME type with no quantification. If type == XML_CTYPE_NAME, then the name points to the name, and the numchildren field will be zero and children will be NULL. The quant fields indicates any quantifiers placed on the name. CHOICE and SEQ will have name NULL, the number of children in numchildren and children will point, recursively, to an array of XML_Content cells. The EMPTY, ANY, and MIXED types will only occur at top level. */ typedef struct XML_cp XML_Content; struct XML_cp { enum XML_Content_Type type; enum XML_Content_Quant quant; XML_Char * name; unsigned int numchildren; XML_Content * children; }; /* This is called for an element declaration. See above for description of the model argument. It's the caller's responsibility to free model when finished with it. */ typedef void (XMLCALL *XML_ElementDeclHandler) (void *userData, const XML_Char *name, XML_Content *model); XMLPARSEAPI(void) XML_SetElementDeclHandler(XML_Parser parser, XML_ElementDeclHandler eldecl); /* The Attlist declaration handler is called for *each* attribute. So a single Attlist declaration with multiple attributes declared will generate multiple calls to this handler. The "default" parameter may be NULL in the case of the "#IMPLIED" or "#REQUIRED" keyword. The "isrequired" parameter will be true and the default value will be NULL in the case of "#REQUIRED". If "isrequired" is true and default is non-NULL, then this is a "#FIXED" default. */ typedef void (XMLCALL *XML_AttlistDeclHandler) ( void *userData, const XML_Char *elname, const XML_Char *attname, const XML_Char *att_type, const XML_Char *dflt, int isrequired); XMLPARSEAPI(void) XML_SetAttlistDeclHandler(XML_Parser parser, XML_AttlistDeclHandler attdecl); /* The XML declaration handler is called for *both* XML declarations and text declarations. The way to distinguish is that the version parameter will be NULL for text declarations. The encoding parameter may be NULL for XML declarations. The standalone parameter will be -1, 0, or 1 indicating respectively that there was no standalone parameter in the declaration, that it was given as no, or that it was given as yes. */ typedef void (XMLCALL *XML_XmlDeclHandler) (void *userData, const XML_Char *version, const XML_Char *encoding, int standalone); XMLPARSEAPI(void) XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler xmldecl); typedef struct { void *(*malloc_fcn)(size_t size); void *(*realloc_fcn)(void *ptr, size_t size); void (*free_fcn)(void *ptr); } XML_Memory_Handling_Suite; /* Constructs a new parser; encoding is the encoding specified by the external protocol or NULL if there is none specified. */ XMLPARSEAPI(XML_Parser) XML_ParserCreate(const XML_Char *encoding); /* Constructs a new parser and namespace processor. Element type names and attribute names that belong to a namespace will be expanded; unprefixed attribute names are never expanded; unprefixed element type names are expanded only if there is a default namespace. The expanded name is the concatenation of the namespace URI, the namespace separator character, and the local part of the name. If the namespace separator is '\0' then the namespace URI and the local part will be concatenated without any separator. It is a programming error to use the separator '\0' with namespace triplets (see XML_SetReturnNSTriplet). */ XMLPARSEAPI(XML_Parser) XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); /* Constructs a new parser using the memory management suite referred to by memsuite. If memsuite is NULL, then use the standard library memory suite. If namespaceSeparator is non-NULL it creates a parser with namespace processing as described above. The character pointed at will serve as the namespace separator. All further memory operations used for the created parser will come from the given suite. */ XMLPARSEAPI(XML_Parser) XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite, const XML_Char *namespaceSeparator); /* Prepare a parser object to be re-used. This is particularly valuable when memory allocation overhead is disproportionatly high, such as when a large number of small documnents need to be parsed. All handlers are cleared from the parser, except for the unknownEncodingHandler. The parser's external state is re-initialized except for the values of ns and ns_triplets. Added in Expat 1.95.3. */ XMLPARSEAPI(XML_Bool) XML_ParserReset(XML_Parser parser, const XML_Char *encoding); /* atts is array of name/value pairs, terminated by 0; names and values are 0 terminated. */ typedef void (XMLCALL *XML_StartElementHandler) (void *userData, const XML_Char *name, const XML_Char **atts); typedef void (XMLCALL *XML_EndElementHandler) (void *userData, const XML_Char *name); /* s is not 0 terminated. */ typedef void (XMLCALL *XML_CharacterDataHandler) (void *userData, const XML_Char *s, int len); /* target and data are 0 terminated */ typedef void (XMLCALL *XML_ProcessingInstructionHandler) ( void *userData, const XML_Char *target, const XML_Char *data); /* data is 0 terminated */ typedef void (XMLCALL *XML_CommentHandler) (void *userData, const XML_Char *data); typedef void (XMLCALL *XML_StartCdataSectionHandler) (void *userData); typedef void (XMLCALL *XML_EndCdataSectionHandler) (void *userData); /* This is called for any characters in the XML document for which there is no applicable handler. This includes both characters that are part of markup which is of a kind that is not reported (comments, markup declarations), or characters that are part of a construct which could be reported but for which no handler has been supplied. The characters are passed exactly as they were in the XML document except that they will be encoded in UTF-8 or UTF-16. Line boundaries are not normalized. Note that a byte order mark character is not passed to the default handler. There are no guarantees about how characters are divided between calls to the default handler: for example, a comment might be split between multiple calls. */ typedef void (XMLCALL *XML_DefaultHandler) (void *userData, const XML_Char *s, int len); /* This is called for the start of the DOCTYPE declaration, before any DTD or internal subset is parsed. */ typedef void (XMLCALL *XML_StartDoctypeDeclHandler) ( void *userData, const XML_Char *doctypeName, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset); /* This is called for the start of the DOCTYPE declaration when the closing > is encountered, but after processing any external subset. */ typedef void (XMLCALL *XML_EndDoctypeDeclHandler)(void *userData); /* This is called for entity declarations. The is_parameter_entity argument will be non-zero if the entity is a parameter entity, zero otherwise. For internal entities (), value will be non-NULL and systemId, publicID, and notationName will be NULL. The value string is NOT nul-terminated; the length is provided in the value_length argument. Since it is legal to have zero-length values, do not use this argument to test for internal entities. For external entities, value will be NULL and systemId will be non-NULL. The publicId argument will be NULL unless a public identifier was provided. The notationName argument will have a non-NULL value only for unparsed entity declarations. Note that is_parameter_entity can't be changed to XML_Bool, since that would break binary compatibility. */ typedef void (XMLCALL *XML_EntityDeclHandler) ( void *userData, const XML_Char *entityName, int is_parameter_entity, const XML_Char *value, int value_length, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); XMLPARSEAPI(void) XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler); /* OBSOLETE -- OBSOLETE -- OBSOLETE This handler has been superceded by the EntityDeclHandler above. It is provided here for backward compatibility. This is called for a declaration of an unparsed (NDATA) entity. The base argument is whatever was set by XML_SetBase. The entityName, systemId and notationName arguments will never be NULL. The other arguments may be. */ typedef void (XMLCALL *XML_UnparsedEntityDeclHandler) ( void *userData, const XML_Char *entityName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); /* This is called for a declaration of notation. The base argument is whatever was set by XML_SetBase. The notationName will never be NULL. The other arguments can be. */ typedef void (XMLCALL *XML_NotationDeclHandler) ( void *userData, const XML_Char *notationName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId); /* When namespace processing is enabled, these are called once for each namespace declaration. The call to the start and end element handlers occur between the calls to the start and end namespace declaration handlers. For an xmlns attribute, prefix will be NULL. For an xmlns="" attribute, uri will be NULL. */ typedef void (XMLCALL *XML_StartNamespaceDeclHandler) ( void *userData, const XML_Char *prefix, const XML_Char *uri); typedef void (XMLCALL *XML_EndNamespaceDeclHandler) ( void *userData, const XML_Char *prefix); /* This is called if the document is not standalone, that is, it has an external subset or a reference to a parameter entity, but does not have standalone="yes". If this handler returns XML_STATUS_ERROR, then processing will not continue, and the parser will return a XML_ERROR_NOT_STANDALONE error. If parameter entity parsing is enabled, then in addition to the conditions above this handler will only be called if the referenced entity was actually read. */ typedef int (XMLCALL *XML_NotStandaloneHandler) (void *userData); /* This is called for a reference to an external parsed general entity. The referenced entity is not automatically parsed. The application can parse it immediately or later using XML_ExternalEntityParserCreate. The parser argument is the parser parsing the entity containing the reference; it can be passed as the parser argument to XML_ExternalEntityParserCreate. The systemId argument is the system identifier as specified in the entity declaration; it will not be NULL. The base argument is the system identifier that should be used as the base for resolving systemId if systemId was relative; this is set by XML_SetBase; it may be NULL. The publicId argument is the public identifier as specified in the entity declaration, or NULL if none was specified; the whitespace in the public identifier will have been normalized as required by the XML spec. The context argument specifies the parsing context in the format expected by the context argument to XML_ExternalEntityParserCreate; context is valid only until the handler returns, so if the referenced entity is to be parsed later, it must be copied. context is NULL only when the entity is a parameter entity. The handler should return XML_STATUS_ERROR if processing should not continue because of a fatal error in the handling of the external entity. In this case the calling parser will return an XML_ERROR_EXTERNAL_ENTITY_HANDLING error. Note that unlike other handlers the first argument is the parser, not userData. */ typedef int (XMLCALL *XML_ExternalEntityRefHandler) ( XML_Parser parser, const XML_Char *context, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId); /* This is called in two situations: 1) An entity reference is encountered for which no declaration has been read *and* this is not an error. 2) An internal entity reference is read, but not expanded, because XML_SetDefaultHandler has been called. Note: skipped parameter entities in declarations and skipped general entities in attribute values cannot be reported, because the event would be out of sync with the reporting of the declarations or attribute values */ typedef void (XMLCALL *XML_SkippedEntityHandler) ( void *userData, const XML_Char *entityName, int is_parameter_entity); /* This structure is filled in by the XML_UnknownEncodingHandler to provide information to the parser about encodings that are unknown to the parser. The map[b] member gives information about byte sequences whose first byte is b. If map[b] is c where c is >= 0, then b by itself encodes the Unicode scalar value c. If map[b] is -1, then the byte sequence is malformed. If map[b] is -n, where n >= 2, then b is the first byte of an n-byte sequence that encodes a single Unicode scalar value. The data member will be passed as the first argument to the convert function. The convert function is used to convert multibyte sequences; s will point to a n-byte sequence where map[(unsigned char)*s] == -n. The convert function must return the Unicode scalar value represented by this byte sequence or -1 if the byte sequence is malformed. The convert function may be NULL if the encoding is a single-byte encoding, that is if map[b] >= -1 for all bytes b. When the parser is finished with the encoding, then if release is not NULL, it will call release passing it the data member; once release has been called, the convert function will not be called again. Expat places certain restrictions on the encodings that are supported using this mechanism. 1. Every ASCII character that can appear in a well-formed XML document, other than the characters $@\^`{}~ must be represented by a single byte, and that byte must be the same byte that represents that character in ASCII. 2. No character may require more than 4 bytes to encode. 3. All characters encoded must have Unicode scalar values <= 0xFFFF, (i.e., characters that would be encoded by surrogates in UTF-16 are not allowed). Note that this restriction doesn't apply to the built-in support for UTF-8 and UTF-16. 4. No Unicode character may be encoded by more than one distinct sequence of bytes. */ typedef struct { int map[256]; void *data; int (XMLCALL *convert)(void *data, const char *s); void (XMLCALL *release)(void *data); } XML_Encoding; /* This is called for an encoding that is unknown to the parser. The encodingHandlerData argument is that which was passed as the second argument to XML_SetUnknownEncodingHandler. The name argument gives the name of the encoding as specified in the encoding declaration. If the callback can provide information about the encoding, it must fill in the XML_Encoding structure, and return XML_STATUS_OK. Otherwise it must return XML_STATUS_ERROR. If info does not describe a suitable encoding, then the parser will return an XML_UNKNOWN_ENCODING error. */ typedef int (XMLCALL *XML_UnknownEncodingHandler) ( void *encodingHandlerData, const XML_Char *name, XML_Encoding *info); XMLPARSEAPI(void) XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end); XMLPARSEAPI(void) XML_SetStartElementHandler(XML_Parser parser, XML_StartElementHandler handler); XMLPARSEAPI(void) XML_SetEndElementHandler(XML_Parser parser, XML_EndElementHandler handler); XMLPARSEAPI(void) XML_SetCharacterDataHandler(XML_Parser parser, XML_CharacterDataHandler handler); XMLPARSEAPI(void) XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler handler); XMLPARSEAPI(void) XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler handler); XMLPARSEAPI(void) XML_SetCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start, XML_EndCdataSectionHandler end); XMLPARSEAPI(void) XML_SetStartCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start); XMLPARSEAPI(void) XML_SetEndCdataSectionHandler(XML_Parser parser, XML_EndCdataSectionHandler end); /* This sets the default handler and also inhibits expansion of internal entities. These entity references will be passed to the default handler, or to the skipped entity handler, if one is set. */ XMLPARSEAPI(void) XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler); /* This sets the default handler but does not inhibit expansion of internal entities. The entity reference will not be passed to the default handler. */ XMLPARSEAPI(void) XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler); XMLPARSEAPI(void) XML_SetDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start, XML_EndDoctypeDeclHandler end); XMLPARSEAPI(void) XML_SetStartDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start); XMLPARSEAPI(void) XML_SetEndDoctypeDeclHandler(XML_Parser parser, XML_EndDoctypeDeclHandler end); XMLPARSEAPI(void) XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler handler); XMLPARSEAPI(void) XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler handler); XMLPARSEAPI(void) XML_SetNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start, XML_EndNamespaceDeclHandler end); XMLPARSEAPI(void) XML_SetStartNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start); XMLPARSEAPI(void) XML_SetEndNamespaceDeclHandler(XML_Parser parser, XML_EndNamespaceDeclHandler end); XMLPARSEAPI(void) XML_SetNotStandaloneHandler(XML_Parser parser, XML_NotStandaloneHandler handler); XMLPARSEAPI(void) XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler handler); /* If a non-NULL value for arg is specified here, then it will be passed as the first argument to the external entity ref handler instead of the parser object. */ XMLPARSEAPI(void) XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg); XMLPARSEAPI(void) XML_SetSkippedEntityHandler(XML_Parser parser, XML_SkippedEntityHandler handler); XMLPARSEAPI(void) XML_SetUnknownEncodingHandler(XML_Parser parser, XML_UnknownEncodingHandler handler, void *encodingHandlerData); /* This can be called within a handler for a start element, end element, processing instruction or character data. It causes the corresponding markup to be passed to the default handler. */ XMLPARSEAPI(void) XML_DefaultCurrent(XML_Parser parser); /* If do_nst is non-zero, and namespace processing is in effect, and a name has a prefix (i.e. an explicit namespace qualifier) then that name is returned as a triplet in a single string separated by the separator character specified when the parser was created: URI + sep + local_name + sep + prefix. If do_nst is zero, then namespace information is returned in the default manner (URI + sep + local_name) whether or not the name has a prefix. Note: Calling XML_SetReturnNSTriplet after XML_Parse or XML_ParseBuffer has no effect. */ XMLPARSEAPI(void) XML_SetReturnNSTriplet(XML_Parser parser, int do_nst); /* This value is passed as the userData argument to callbacks. */ XMLPARSEAPI(void) XML_SetUserData(XML_Parser parser, void *userData); /* Returns the last value set by XML_SetUserData or NULL. */ #define XML_GetUserData(parser) (*(void **)(parser)) /* This is equivalent to supplying an encoding argument to XML_ParserCreate. On success XML_SetEncoding returns non-zero, zero otherwise. Note: Calling XML_SetEncoding after XML_Parse or XML_ParseBuffer has no effect and returns XML_STATUS_ERROR. */ XMLPARSEAPI(enum XML_Status) XML_SetEncoding(XML_Parser parser, const XML_Char *encoding); /* If this function is called, then the parser will be passed as the first argument to callbacks instead of userData. The userData will still be accessible using XML_GetUserData. */ XMLPARSEAPI(void) XML_UseParserAsHandlerArg(XML_Parser parser); /* If useDTD == XML_TRUE is passed to this function, then the parser will assume that there is an external subset, even if none is specified in the document. In such a case the parser will call the externalEntityRefHandler with a value of NULL for the systemId argument (the publicId and context arguments will be NULL as well). Note: For the purpose of checking WFC: Entity Declared, passing useDTD == XML_TRUE will make the parser behave as if the document had a DTD with an external subset. Note: If this function is called, then this must be done before the first call to XML_Parse or XML_ParseBuffer, since it will have no effect after that. Returns XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING. Note: If the document does not have a DOCTYPE declaration at all, then startDoctypeDeclHandler and endDoctypeDeclHandler will not be called, despite an external subset being parsed. Note: If XML_DTD is not defined when Expat is compiled, returns XML_ERROR_FEATURE_REQUIRES_XML_DTD. */ XMLPARSEAPI(enum XML_Error) XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD); /* Sets the base to be used for resolving relative URIs in system identifiers in declarations. Resolving relative identifiers is left to the application: this value will be passed through as the base argument to the XML_ExternalEntityRefHandler, XML_NotationDeclHandler and XML_UnparsedEntityDeclHandler. The base argument will be copied. Returns XML_STATUS_ERROR if out of memory, XML_STATUS_OK otherwise. */ XMLPARSEAPI(enum XML_Status) XML_SetBase(XML_Parser parser, const XML_Char *base); XMLPARSEAPI(const XML_Char *) XML_GetBase(XML_Parser parser); /* Returns the number of the attribute/value pairs passed in last call to the XML_StartElementHandler that were specified in the start-tag rather than defaulted. Each attribute/value pair counts as 2; thus this correspondds to an index into the atts array passed to the XML_StartElementHandler. */ XMLPARSEAPI(int) XML_GetSpecifiedAttributeCount(XML_Parser parser); /* Returns the index of the ID attribute passed in the last call to XML_StartElementHandler, or -1 if there is no ID attribute. Each attribute/value pair counts as 2; thus this correspondds to an index into the atts array passed to the XML_StartElementHandler. */ XMLPARSEAPI(int) XML_GetIdAttributeIndex(XML_Parser parser); /* Parses some input. Returns XML_STATUS_ERROR if a fatal error is detected. The last call to XML_Parse must have isFinal true; len may be zero for this call (or any other). Though the return values for these functions has always been described as a Boolean value, the implementation, at least for the 1.95.x series, has always returned exactly one of the XML_Status values. */ XMLPARSEAPI(enum XML_Status) XML_Parse(XML_Parser parser, const char *s, int len, int isFinal); XMLPARSEAPI(void *) XML_GetBuffer(XML_Parser parser, int len); XMLPARSEAPI(enum XML_Status) XML_ParseBuffer(XML_Parser parser, int len, int isFinal); /* Stops parsing, causing XML_Parse() or XML_ParseBuffer() to return. Must be called from within a call-back handler, except when aborting (resumable = 0) an already suspended parser. Some call-backs may still follow because they would otherwise get lost. Examples: - endElementHandler() for empty elements when stopped in startElementHandler(), - endNameSpaceDeclHandler() when stopped in endElementHandler(), and possibly others. Can be called from most handlers, including DTD related call-backs, except when parsing an external parameter entity and resumable != 0. Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise. Possible error codes: - XML_ERROR_SUSPENDED: when suspending an already suspended parser. - XML_ERROR_FINISHED: when the parser has already finished. - XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE. When resumable != 0 (true) then parsing is suspended, that is, XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer() return XML_STATUS_ERROR with error code XML_ERROR_ABORTED. *Note*: This will be applied to the current parser instance only, that is, if there is a parent parser then it will continue parsing when the externalEntityRefHandler() returns. It is up to the implementation of the externalEntityRefHandler() to call XML_StopParser() on the parent parser (recursively), if one wants to stop parsing altogether. When suspended, parsing can be resumed by calling XML_ResumeParser(). */ XMLPARSEAPI(enum XML_Status) XML_StopParser(XML_Parser parser, XML_Bool resumable); /* Resumes parsing after it has been suspended with XML_StopParser(). Must not be called from within a handler call-back. Returns same status codes as XML_Parse() or XML_ParseBuffer(). Additional error code XML_ERROR_NOT_SUSPENDED possible. *Note*: This must be called on the most deeply nested child parser instance first, and on its parent parser only after the child parser has finished, to be applied recursively until the document entity's parser is restarted. That is, the parent parser will not resume by itself and it is up to the application to call XML_ResumeParser() on it at the appropriate moment. */ XMLPARSEAPI(enum XML_Status) XML_ResumeParser(XML_Parser parser); enum XML_Parsing { XML_INITIALIZED, XML_PARSING, XML_FINISHED, XML_SUSPENDED }; typedef struct { enum XML_Parsing parsing; XML_Bool finalBuffer; } XML_ParsingStatus; /* Returns status of parser with respect to being initialized, parsing, finished, or suspended and processing the final buffer. XXX XML_Parse() and XML_ParseBuffer() should return XML_ParsingStatus, XXX with XML_FINISHED_OK or XML_FINISHED_ERROR replacing XML_FINISHED */ XMLPARSEAPI(void) XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status); /* Creates an XML_Parser object that can parse an external general entity; context is a '\0'-terminated string specifying the parse context; encoding is a '\0'-terminated string giving the name of the externally specified encoding, or NULL if there is no externally specified encoding. The context string consists of a sequence of tokens separated by formfeeds (\f); a token consisting of a name specifies that the general entity of the name is open; a token of the form prefix=uri specifies the namespace for a particular prefix; a token of the form =uri specifies the default namespace. This can be called at any point after the first call to an ExternalEntityRefHandler so longer as the parser has not yet been freed. The new parser is completely independent and may safely be used in a separate thread. The handlers and userData are initialized from the parser argument. Returns NULL if out of memory. Otherwise returns a new XML_Parser object. */ XMLPARSEAPI(XML_Parser) XML_ExternalEntityParserCreate(XML_Parser parser, const XML_Char *context, const XML_Char *encoding); enum XML_ParamEntityParsing { XML_PARAM_ENTITY_PARSING_NEVER, XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE, XML_PARAM_ENTITY_PARSING_ALWAYS }; /* Controls parsing of parameter entities (including the external DTD subset). If parsing of parameter entities is enabled, then references to external parameter entities (including the external DTD subset) will be passed to the handler set with XML_SetExternalEntityRefHandler. The context passed will be 0. Unlike external general entities, external parameter entities can only be parsed synchronously. If the external parameter entity is to be parsed, it must be parsed during the call to the external entity ref handler: the complete sequence of XML_ExternalEntityParserCreate, XML_Parse/XML_ParseBuffer and XML_ParserFree calls must be made during this call. After XML_ExternalEntityParserCreate has been called to create the parser for the external parameter entity (context must be 0 for this call), it is illegal to make any calls on the old parser until XML_ParserFree has been called on the newly created parser. If the library has been compiled without support for parameter entity parsing (ie without XML_DTD being defined), then XML_SetParamEntityParsing will return 0 if parsing of parameter entities is requested; otherwise it will return non-zero. Note: If XML_SetParamEntityParsing is called after XML_Parse or XML_ParseBuffer, then it has no effect and will always return 0. */ XMLPARSEAPI(int) XML_SetParamEntityParsing(XML_Parser parser, enum XML_ParamEntityParsing parsing); /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then XML_GetErrorCode returns information about the error. */ XMLPARSEAPI(enum XML_Error) XML_GetErrorCode(XML_Parser parser); /* These functions return information about the current parse location. They may be called from any callback called to report some parse event; in this case the location is the location of the first of the sequence of characters that generated the event. When called from callbacks generated by declarations in the document prologue, the location identified isn't as neatly defined, but will be within the relevant markup. When called outside of the callback functions, the position indicated will be just past the last parse event (regardless of whether there was an associated callback). They may also be called after returning from a call to XML_Parse or XML_ParseBuffer. If the return value is XML_STATUS_ERROR then the location is the location of the character at which the error was detected; otherwise the location is the location of the last parse event, as described above. */ XMLPARSEAPI(XML_Size) XML_GetCurrentLineNumber(XML_Parser parser); XMLPARSEAPI(XML_Size) XML_GetCurrentColumnNumber(XML_Parser parser); XMLPARSEAPI(XML_Index) XML_GetCurrentByteIndex(XML_Parser parser); /* Return the number of bytes in the current event. Returns 0 if the event is in an internal entity. */ XMLPARSEAPI(int) XML_GetCurrentByteCount(XML_Parser parser); /* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets the integer pointed to by offset to the offset within this buffer of the current parse position, and sets the integer pointed to by size to the size of this buffer (the number of input bytes). Otherwise returns a NULL pointer. Also returns a NULL pointer if a parse isn't active. NOTE: The character pointer returned should not be used outside the handler that makes the call. */ XMLPARSEAPI(const char *) XML_GetInputContext(XML_Parser parser, int *offset, int *size); /* For backwards compatibility with previous versions. */ #define XML_GetErrorLineNumber XML_GetCurrentLineNumber #define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber #define XML_GetErrorByteIndex XML_GetCurrentByteIndex /* Frees the content model passed to the element declaration handler */ XMLPARSEAPI(void) XML_FreeContentModel(XML_Parser parser, XML_Content *model); /* Exposing the memory handling functions used in Expat */ XMLPARSEAPI(void *) XML_MemMalloc(XML_Parser parser, size_t size); XMLPARSEAPI(void *) XML_MemRealloc(XML_Parser parser, void *ptr, size_t size); XMLPARSEAPI(void) XML_MemFree(XML_Parser parser, void *ptr); /* Frees memory used by the parser. */ XMLPARSEAPI(void) XML_ParserFree(XML_Parser parser); /* Returns a string describing the error. */ XMLPARSEAPI(const XML_LChar *) XML_ErrorString(enum XML_Error code); /* Return a string containing the version number of this expat */ XMLPARSEAPI(const XML_LChar *) XML_ExpatVersion(void); typedef struct { int major; int minor; int micro; } XML_Expat_Version; /* Return an XML_Expat_Version structure containing numeric version number information for this version of expat. */ XMLPARSEAPI(XML_Expat_Version) XML_ExpatVersionInfo(void); /* Added in Expat 1.95.5. */ enum XML_FeatureEnum { XML_FEATURE_END = 0, XML_FEATURE_UNICODE, XML_FEATURE_UNICODE_WCHAR_T, XML_FEATURE_DTD, XML_FEATURE_CONTEXT_BYTES, XML_FEATURE_MIN_SIZE, XML_FEATURE_SIZEOF_XML_CHAR, XML_FEATURE_SIZEOF_XML_LCHAR, XML_FEATURE_NS, XML_FEATURE_LARGE_SIZE /* Additional features must be added to the end of this enum. */ }; typedef struct { enum XML_FeatureEnum feature; const XML_LChar *name; long int value; } XML_Feature; XMLPARSEAPI(const XML_Feature *) XML_GetFeatureList(void); /* Expat follows the GNU/Linux convention of odd number minor version for beta/development releases and even number minor version for stable releases. Micro is bumped with each release, and set to 0 with each change to major or minor version. */ #define XML_MAJOR_VERSION 2 #define XML_MINOR_VERSION 0 #define XML_MICRO_VERSION 1 #ifdef __cplusplus } #endif #endif /* not Expat_INCLUDED */ tDOM-0.8.3/expat/CVS/0000755000175000017500000000000011004674367014343 5ustar ssobernissobernitDOM-0.8.3/expat/CVS/Root0000644000175000017500000000006211004674366015206 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/expat/CVS/Entries0000644000175000017500000000200311004674367015672 0ustar ssobernissoberni/COPYING/1.4/Tue Jul 31 00:16:28 2007// /Changes/1.6/Tue Jul 31 00:16:29 2007// /README/1.7/Tue Jul 31 00:16:29 2007// /VERSION/1.9/Tue Jul 31 00:16:29 2007// /amigaconfig.h/1.1/Tue Jul 31 00:16:29 2007// /ascii.h/1.4/Tue Jul 31 00:16:29 2007// /asciitab.h/1.2/Tue Aug 20 23:24:30 2002// /expat.h/1.9/Tue Jul 31 00:16:29 2007// /expat_external.h/1.2/Tue Jul 31 00:16:29 2007// /iasciitab.h/1.2/Tue Aug 20 23:24:30 2002// /internal.h/1.6/Tue Jul 31 00:16:29 2007// /latin1tab.h/1.2/Tue Aug 20 23:24:30 2002// /macconfig.h/1.1/Sat Aug 21 03:23:43 2004// /nametab.h/1.1/Sun Jul 28 08:09:03 2002// /utf8tab.h/1.2/Tue Aug 20 23:24:30 2002// /winconfig.h/1.3/Tue Jul 31 00:16:28 2007// /xmlparse.c/1.7/Tue Jul 31 00:16:28 2007// /xmlrole.c/1.7/Tue Jul 31 00:16:29 2007// /xmlrole.h/1.4/Sun Feb 9 16:31:05 2003// /xmltok.c/1.7/Tue Jul 31 00:16:29 2007// /xmltok.h/1.6/Tue Jul 31 00:16:29 2007// /xmltok_impl.c/1.6/Tue Jul 31 00:16:29 2007// /xmltok_impl.h/1.1/Sun Jul 28 08:09:03 2002// /xmltok_ns.c/1.5/Tue Jul 31 00:16:29 2007// D tDOM-0.8.3/expat/CVS/Repository0000644000175000017500000000001311004674366016436 0ustar ssobernissobernitdom/expat tDOM-0.8.3/expat/README0000644000175000017500000001310510653477535014577 0ustar ssobernissoberni Expat, Release 2.0.1 This is Expat, a C library for parsing XML, written by James Clark. Expat is a stream-oriented XML parser. This means that you register handlers with the parser before starting the parse. These handlers are called when the parser discovers the associated structures in the document being parsed. A start tag is an example of the kind of structures for which you may register handlers. Windows users should use the expat_win32bin package, which includes both precompiled libraries and executables, and source code for developers. Expat is free software. You may copy, distribute, and modify it under the terms of the License contained in the file COPYING distributed with this package. This license is the same as the MIT/X Consortium license. Versions of Expat that have an odd minor version (the middle number in the release above), are development releases and should be considered as beta software. Releases with even minor version numbers are intended to be production grade software. If you are building Expat from a check-out from the CVS repository, you need to run a script that generates the configure script using the GNU autoconf and libtool tools. To do this, you need to have autoconf 2.52 or newer and libtool 1.4 or newer (1.5 or newer preferred). Run the script like this: ./buildconf.sh Once this has been done, follow the same instructions as for building from a source distribution. To build Expat from a source distribution, you first run the configuration shell script in the top level distribution directory: ./configure There are many options which you may provide to configure (which you can discover by running configure with the --help option). But the one of most interest is the one that sets the installation directory. By default, the configure script will set things up to install libexpat into /usr/local/lib, expat.h into /usr/local/include, and xmlwf into /usr/local/bin. If, for example, you'd prefer to install into /home/me/mystuff/lib, /home/me/mystuff/include, and /home/me/mystuff/bin, you can tell configure about that with: ./configure --prefix=/home/me/mystuff Another interesting option is to enable 64-bit integer support for line and column numbers and the over-all byte index: ./configure CPPFLAGS=-DXML_LARGE_SIZE However, such a modification would be a breaking change to the ABI and is therefore not recommended for general use - e.g. as part of a Linux distribution - but rather for builds with special requirements. After running the configure script, the "make" command will build things and "make install" will install things into their proper location. Have a look at the "Makefile" to learn about additional "make" options. Note that you need to have write permission into the directories into which things will be installed. If you are interested in building Expat to provide document information in UTF-16 rather than the default UTF-8, follow these instructions (after having run "make distclean"): 1. For UTF-16 output as unsigned short (and version/error strings as char), run: ./configure CPPFLAGS=-DXML_UNICODE For UTF-16 output as wchar_t (incl. version/error strings), run: ./configure CFLAGS="-g -O2 -fshort-wchar" \ CPPFLAGS=-DXML_UNICODE_WCHAR_T 2. Edit the MakeFile, changing: LIBRARY = libexpat.la to: LIBRARY = libexpatw.la (Note the additional "w" in the library name.) 3. Run "make buildlib" (which builds the library only). Or, to save step 2, run "make buildlib LIBRARY=libexpatw.la". 4. Run "make installlib" (which installs the library only). Or, if step 2 was omitted, run "make installlib LIBRARY=libexpatw.la". Using DESTDIR or INSTALL_ROOT is enabled, with INSTALL_ROOT being the default value for DESTDIR, and the rest of the make file using only DESTDIR. It works as follows: $ make install DESTDIR=/path/to/image overrides the in-makefile set DESTDIR, while both $ INSTALL_ROOT=/path/to/image make install $ make install INSTALL_ROOT=/path/to/image use DESTDIR=$(INSTALL_ROOT), even if DESTDIR eventually is defined in the environment, because variable-setting priority is 1) commandline 2) in-makefile 3) environment Note for Solaris users: The "ar" command is usually located in "/usr/ccs/bin", which is not in the default PATH. You will need to add this to your path for the "make" command, and probably also switch to GNU make (the "make" found in /usr/ccs/bin does not seem to work properly -- appearantly it does not understand .PHONY directives). If you're using ksh or bash, use this command to build: PATH=/usr/ccs/bin:$PATH make When using Expat with a project using autoconf for configuration, you can use the probing macro in conftools/expat.m4 to determine how to include Expat. See the comments at the top of that file for more information. A reference manual is available in the file doc/reference.html in this distribution. The homepage for this project is http://www.libexpat.org/. There are links there to connect you to the bug reports page. If you need to report a bug when you don't have access to a browser, you may also send a bug report by email to expat-bugs@mail.libexpat.org. Discussion related to the direction of future expat development takes place on expat-discuss@mail.libexpat.org. Archives of this list and other Expat-related lists may be found at: http://mail.libexpat.org/mailman/listinfo/ tDOM-0.8.3/expat/Changes0000644000175000017500000002176410653477535015224 0ustar ssobernissoberniRelease 2.0.1 Tue June 5 2007 - Fixed bugs #1515266, 1515600: The character data handler's calling of XML_StopParser() was not handled properly; if the parser was stopped and the handler set to NULL, the parser would segfault. - Fixed bug #1690883: Expat failed on EBCDIC systems as it assumed some character constants to be ASCII encoded. - Minor cleanups of the test harness. - Fixed xmlwf bug #1513566: "out of memory" error on file size zero. - Fixed outline.c bug #1543233: missing a final XML_ParserFree() call. - Fixes and improvements for Windows platform: bugs #1409451, #1476160, 1548182, 1602769, 1717322. - Build fixes for various platforms: HP-UX, Tru64, Solaris 9: patch #1437840, bug #1196180. All Unix: #1554618 (refreshed config.sub/config.guess). #1490371, #1613457: support both, DESTDIR and INSTALL_ROOT, without relying on GNU-Make specific features. #1647805: Patched configure.in to work better with Intel compiler. - Fixes to Makefile.in to have make check work correctly: bugs #1408143, #1535603, #1536684. - Added Open Watcom support: patch #1523242. Release 2.0.0 Wed Jan 11 2006 - We no longer use the "check" library for C unit testing; we always use the (partial) internal implementation of the API. - Report XML_NS setting via XML_GetFeatureList(). - Fixed headers for use from C++. - XML_GetCurrentLineNumber() and XML_GetCurrentColumnNumber() now return unsigned integers. - Added XML_LARGE_SIZE switch to enable 64-bit integers for byte indexes and line/column numbers. - Updated to use libtool 1.5.22 (the most recent). - Added support for AmigaOS. - Some mostly minor bug fixes. SF issues include: 1006708, 1021776, 1023646, 1114960, 1156398, 1221160, 1271642. Release 1.95.8 Fri Jul 23 2004 - Major new feature: suspend/resume. Handlers can now request that a parse be suspended for later resumption or aborted altogether. See "Temporarily Stopping Parsing" in the documentation for more details. - Some mostly minor bug fixes, but compilation should no longer generate warnings on most platforms. SF issues include: 827319, 840173, 846309, 888329, 896188, 923913, 928113, 961698, 985192. Release 1.95.7 Mon Oct 20 2003 - Fixed enum XML_Status issue (reported on SourceForge many times), so compilers that are properly picky will be happy. - Introduced an XMLCALL macro to control the calling convention used by the Expat API; this macro should be used to annotate prototypes and definitions of callback implementations in code compiled with a calling convention other than the default convention for the host platform. - Improved ability to build without the configure-generated expat_config.h header. This is useful for applications which embed Expat rather than linking in the library. - Fixed a variety of bugs: see SF issues 458907, 609603, 676844, 679754, 692878, 692964, 695401, 699323, 699487, 820946. - Improved hash table lookups. - Added more regression tests and improved documentation. Release 1.95.6 Tue Jan 28 2003 - Added XML_FreeContentModel(). - Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree(). - Fixed a variety of bugs: see SF issues 615606, 616863, 618199, 653180, 673791. - Enhanced the regression test suite. - Man page improvements: includes SF issue 632146. Release 1.95.5 Fri Sep 6 2002 - Added XML_UseForeignDTD() for improved SAX2 support. - Added XML_GetFeatureList(). - Defined XML_Bool type and the values XML_TRUE and XML_FALSE. - Use an incomplete struct instead of a void* for the parser (may not retain). - Fixed UTF-8 decoding bug that caused legal UTF-8 to be rejected. - Finally fixed bug where default handler would report DTD events that were already handled by another handler. Initial patch contributed by Darryl Miles. - Removed unnecessary DllMain() function that caused static linking into a DLL to be difficult. - Added VC++ projects for building static libraries. - Reduced line-length for all source code and headers to be no longer than 80 characters, to help with AS/400 support. - Reduced memory copying during parsing (SF patch #600964). - Fixed a variety of bugs: see SF issues 580793, 434664, 483514, 580503, 581069, 584041, 584183, 584832, 585537, 596555, 596678, 598352, 598944, 599715, 600479, 600971. Release 1.95.4 Fri Jul 12 2002 - Added support for VMS, contributed by Craig Berry. See vms/README.vms for more information. - Added Mac OS (classic) support, with a makefile for MPW, contributed by Thomas Wegner and Daryle Walker. - Added Borland C++ Builder 5 / BCC 5.5 support, contributed by Patrick McConnell (SF patch #538032). - Fixed a variety of bugs: see SF issues 441449, 563184, 564342, 566334, 566901, 569461, 570263, 575168, 579196. - Made skippedEntityHandler conform to SAX2 (see source comment) - Re-implemented WFC: Entity Declared from XML 1.0 spec and added a new error "entity declared in parameter entity": see SF bug report 569461 and SF patch 578161 - Re-implemented section 5.1 from XML 1.0 spec: see SF bug report 570263 and SF patch 578161 Release 1.95.3 Mon Jun 3 2002 - Added a project to the MSVC workspace to create a wchar_t version of the library; the DLLs are named libexpatw.dll. - Changed the name of the Windows DLLs from expat.dll to libexpat.dll; this fixes SF bug #432456. - Added the XML_ParserReset() API function. - Fixed XML_SetReturnNSTriplet() to work for element names. - Made the XML_UNICODE builds usable (thanks, Karl!). - Allow xmlwf to read from standard input. - Install a man page for xmlwf on Unix systems. - Fixed many bugs; see SF bug reports 231864, 461380, 464837, 466885, 469226, 477667, 484419, 487840, 494749, 496505, 547350. Other bugs which we can't test as easily may also have been fixed, especially in the area of build support. Release 1.95.2 Fri Jul 27 2001 - More changes to make MSVC happy with the build; add a single workspace to support both the library and xmlwf application. - Added a Windows installer for Windows users; includes xmlwf.exe. - Added compile-time constants that can be used to determine the Expat version - Removed a lot of GNU-specific dependencies to aide portability among the various Unix flavors. - Fix the UTF-8 BOM bug. - Cleaned up warning messages for several compilers. - Added the -Wall, -Wstrict-prototypes options for GCC. Release 1.95.1 Sun Oct 22 15:11:36 EDT 2000 - Changes to get expat to build under Microsoft compiler - Removed all aborts and instead return an UNEXPECTED_STATE error. - Fixed a bug where a stray '%' in an entity value would cause an abort. - Defined XML_SetEndNamespaceDeclHandler. Thanks to Darryl Miles for finding this oversight. - Changed default patterns in lib/Makefile.in to fit non-GNU makes Thanks to robin@unrated.net for reporting and providing an account to test on. - The reference had the wrong label for XML_SetStartNamespaceDecl. Reported by an anonymous user. Release 1.95.0 Fri Sep 29 2000 - XML_ParserCreate_MM Allows you to set a memory management suite to replace the standard malloc,realloc, and free. - XML_SetReturnNSTriplet If you turn this feature on when namespace processing is in effect, then qualified, prefixed element and attribute names are returned as "uri|name|prefix" where '|' is whatever separator character is used in namespace processing. - Merged in features from perl-expat o XML_SetElementDeclHandler o XML_SetAttlistDeclHandler o XML_SetXmlDeclHandler o XML_SetEntityDeclHandler o StartDoctypeDeclHandler takes 3 additional parameters: sysid, pubid, has_internal_subset o Many paired handler setters (like XML_SetElementHandler) now have corresponding individual handler setters o XML_GetInputContext for getting the input context of the current parse position. - Added reference material - Packaged into a distribution that builds a sharable library tDOM-0.8.3/expat/xmltok_impl.c0000644000175000017500000012701410653477535016427 0ustar ssobernissoberni/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ /* This file is included! */ #ifdef XML_TOK_IMPL_C #ifndef IS_INVALID_CHAR #define IS_INVALID_CHAR(enc, ptr, n) (0) #endif #define INVALID_LEAD_CASE(n, ptr, nextTokPtr) \ case BT_LEAD ## n: \ if (end - ptr < n) \ return XML_TOK_PARTIAL_CHAR; \ if (IS_INVALID_CHAR(enc, ptr, n)) { \ *(nextTokPtr) = (ptr); \ return XML_TOK_INVALID; \ } \ ptr += n; \ break; #define INVALID_CASES(ptr, nextTokPtr) \ INVALID_LEAD_CASE(2, ptr, nextTokPtr) \ INVALID_LEAD_CASE(3, ptr, nextTokPtr) \ INVALID_LEAD_CASE(4, ptr, nextTokPtr) \ case BT_NONXML: \ case BT_MALFORM: \ case BT_TRAIL: \ *(nextTokPtr) = (ptr); \ return XML_TOK_INVALID; #define CHECK_NAME_CASE(n, enc, ptr, end, nextTokPtr) \ case BT_LEAD ## n: \ if (end - ptr < n) \ return XML_TOK_PARTIAL_CHAR; \ if (!IS_NAME_CHAR(enc, ptr, n)) { \ *nextTokPtr = ptr; \ return XML_TOK_INVALID; \ } \ ptr += n; \ break; #define CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) \ case BT_NONASCII: \ if (!IS_NAME_CHAR_MINBPC(enc, ptr)) { \ *nextTokPtr = ptr; \ return XML_TOK_INVALID; \ } \ case BT_NMSTRT: \ case BT_HEX: \ case BT_DIGIT: \ case BT_NAME: \ case BT_MINUS: \ ptr += MINBPC(enc); \ break; \ CHECK_NAME_CASE(2, enc, ptr, end, nextTokPtr) \ CHECK_NAME_CASE(3, enc, ptr, end, nextTokPtr) \ CHECK_NAME_CASE(4, enc, ptr, end, nextTokPtr) #define CHECK_NMSTRT_CASE(n, enc, ptr, end, nextTokPtr) \ case BT_LEAD ## n: \ if (end - ptr < n) \ return XML_TOK_PARTIAL_CHAR; \ if (!IS_NMSTRT_CHAR(enc, ptr, n)) { \ *nextTokPtr = ptr; \ return XML_TOK_INVALID; \ } \ ptr += n; \ break; #define CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) \ case BT_NONASCII: \ if (!IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { \ *nextTokPtr = ptr; \ return XML_TOK_INVALID; \ } \ case BT_NMSTRT: \ case BT_HEX: \ ptr += MINBPC(enc); \ break; \ CHECK_NMSTRT_CASE(2, enc, ptr, end, nextTokPtr) \ CHECK_NMSTRT_CASE(3, enc, ptr, end, nextTokPtr) \ CHECK_NMSTRT_CASE(4, enc, ptr, end, nextTokPtr) #ifndef PREFIX #define PREFIX(ident) ident #endif /* ptr points to character following " */ switch (BYTE_TYPE(enc, ptr + MINBPC(enc))) { case BT_S: case BT_CR: case BT_LF: case BT_PERCNT: *nextTokPtr = ptr; return XML_TOK_INVALID; } /* fall through */ case BT_S: case BT_CR: case BT_LF: *nextTokPtr = ptr; return XML_TOK_DECL_OPEN; case BT_NMSTRT: case BT_HEX: ptr += MINBPC(enc); break; default: *nextTokPtr = ptr; return XML_TOK_INVALID; } } return XML_TOK_PARTIAL; } static int PTRCALL PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end, int *tokPtr) { int upper = 0; *tokPtr = XML_TOK_PI; if (end - ptr != MINBPC(enc)*3) return 1; switch (BYTE_TO_ASCII(enc, ptr)) { case ASCII_x: break; case ASCII_X: upper = 1; break; default: return 1; } ptr += MINBPC(enc); switch (BYTE_TO_ASCII(enc, ptr)) { case ASCII_m: break; case ASCII_M: upper = 1; break; default: return 1; } ptr += MINBPC(enc); switch (BYTE_TO_ASCII(enc, ptr)) { case ASCII_l: break; case ASCII_L: upper = 1; break; default: return 1; } if (upper) return 0; *tokPtr = XML_TOK_XML_DECL; return 1; } /* ptr points to character following " 1) { size_t n = end - ptr; if (n & (MINBPC(enc) - 1)) { n &= ~(MINBPC(enc) - 1); if (n == 0) return XML_TOK_PARTIAL; end = ptr + n; } } switch (BYTE_TYPE(enc, ptr)) { case BT_RSQB: ptr += MINBPC(enc); if (ptr == end) return XML_TOK_PARTIAL; if (!CHAR_MATCHES(enc, ptr, ASCII_RSQB)) break; ptr += MINBPC(enc); if (ptr == end) return XML_TOK_PARTIAL; if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { ptr -= MINBPC(enc); break; } *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_CDATA_SECT_CLOSE; case BT_CR: ptr += MINBPC(enc); if (ptr == end) return XML_TOK_PARTIAL; if (BYTE_TYPE(enc, ptr) == BT_LF) ptr += MINBPC(enc); *nextTokPtr = ptr; return XML_TOK_DATA_NEWLINE; case BT_LF: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_DATA_NEWLINE; INVALID_CASES(ptr, nextTokPtr) default: ptr += MINBPC(enc); break; } while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ *nextTokPtr = ptr; \ return XML_TOK_DATA_CHARS; \ } \ ptr += n; \ break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_NONXML: case BT_MALFORM: case BT_TRAIL: case BT_CR: case BT_LF: case BT_RSQB: *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; default: ptr += MINBPC(enc); break; } } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; } /* ptr points to character following " 1) { size_t n = end - ptr; if (n & (MINBPC(enc) - 1)) { n &= ~(MINBPC(enc) - 1); if (n == 0) return XML_TOK_PARTIAL; end = ptr + n; } } switch (BYTE_TYPE(enc, ptr)) { case BT_LT: return PREFIX(scanLt)(enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_AMP: return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_CR: ptr += MINBPC(enc); if (ptr == end) return XML_TOK_TRAILING_CR; if (BYTE_TYPE(enc, ptr) == BT_LF) ptr += MINBPC(enc); *nextTokPtr = ptr; return XML_TOK_DATA_NEWLINE; case BT_LF: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_DATA_NEWLINE; case BT_RSQB: ptr += MINBPC(enc); if (ptr == end) return XML_TOK_TRAILING_RSQB; if (!CHAR_MATCHES(enc, ptr, ASCII_RSQB)) break; ptr += MINBPC(enc); if (ptr == end) return XML_TOK_TRAILING_RSQB; if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { ptr -= MINBPC(enc); break; } *nextTokPtr = ptr; return XML_TOK_INVALID; INVALID_CASES(ptr, nextTokPtr) default: ptr += MINBPC(enc); break; } while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ *nextTokPtr = ptr; \ return XML_TOK_DATA_CHARS; \ } \ ptr += n; \ break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_RSQB: if (ptr + MINBPC(enc) != end) { if (!CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_RSQB)) { ptr += MINBPC(enc); break; } if (ptr + 2*MINBPC(enc) != end) { if (!CHAR_MATCHES(enc, ptr + 2*MINBPC(enc), ASCII_GT)) { ptr += MINBPC(enc); break; } *nextTokPtr = ptr + 2*MINBPC(enc); return XML_TOK_INVALID; } } /* fall through */ case BT_AMP: case BT_LT: case BT_NONXML: case BT_MALFORM: case BT_TRAIL: case BT_CR: case BT_LF: *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; default: ptr += MINBPC(enc); break; } } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; } /* ptr points to character following "%" */ static int PTRCALL PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { if (ptr == end) return -XML_TOK_PERCENT; switch (BYTE_TYPE(enc, ptr)) { CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) case BT_S: case BT_LF: case BT_CR: case BT_PERCNT: *nextTokPtr = ptr; return XML_TOK_PERCENT; default: *nextTokPtr = ptr; return XML_TOK_INVALID; } while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) case BT_SEMI: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_PARAM_ENTITY_REF; default: *nextTokPtr = ptr; return XML_TOK_INVALID; } } return XML_TOK_PARTIAL; } static int PTRCALL PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { if (ptr == end) return XML_TOK_PARTIAL; switch (BYTE_TYPE(enc, ptr)) { CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) default: *nextTokPtr = ptr; return XML_TOK_INVALID; } while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) case BT_CR: case BT_LF: case BT_S: case BT_RPAR: case BT_GT: case BT_PERCNT: case BT_VERBAR: *nextTokPtr = ptr; return XML_TOK_POUND_NAME; default: *nextTokPtr = ptr; return XML_TOK_INVALID; } } return -XML_TOK_POUND_NAME; } static int PTRCALL PREFIX(scanLit)(int open, const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { while (ptr != end) { int t = BYTE_TYPE(enc, ptr); switch (t) { INVALID_CASES(ptr, nextTokPtr) case BT_QUOT: case BT_APOS: ptr += MINBPC(enc); if (t != open) break; if (ptr == end) return -XML_TOK_LITERAL; *nextTokPtr = ptr; switch (BYTE_TYPE(enc, ptr)) { case BT_S: case BT_CR: case BT_LF: case BT_GT: case BT_PERCNT: case BT_LSQB: return XML_TOK_LITERAL; default: return XML_TOK_INVALID; } default: ptr += MINBPC(enc); break; } } return XML_TOK_PARTIAL; } static int PTRCALL PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { int tok; if (ptr == end) return XML_TOK_NONE; if (MINBPC(enc) > 1) { size_t n = end - ptr; if (n & (MINBPC(enc) - 1)) { n &= ~(MINBPC(enc) - 1); if (n == 0) return XML_TOK_PARTIAL; end = ptr + n; } } switch (BYTE_TYPE(enc, ptr)) { case BT_QUOT: return PREFIX(scanLit)(BT_QUOT, enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_APOS: return PREFIX(scanLit)(BT_APOS, enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_LT: { ptr += MINBPC(enc); if (ptr == end) return XML_TOK_PARTIAL; switch (BYTE_TYPE(enc, ptr)) { case BT_EXCL: return PREFIX(scanDecl)(enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_QUEST: return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_NMSTRT: case BT_HEX: case BT_NONASCII: case BT_LEAD2: case BT_LEAD3: case BT_LEAD4: *nextTokPtr = ptr - MINBPC(enc); return XML_TOK_INSTANCE_START; } *nextTokPtr = ptr; return XML_TOK_INVALID; } case BT_CR: if (ptr + MINBPC(enc) == end) { *nextTokPtr = end; /* indicate that this might be part of a CR/LF pair */ return -XML_TOK_PROLOG_S; } /* fall through */ case BT_S: case BT_LF: for (;;) { ptr += MINBPC(enc); if (ptr == end) break; switch (BYTE_TYPE(enc, ptr)) { case BT_S: case BT_LF: break; case BT_CR: /* don't split CR/LF pair */ if (ptr + MINBPC(enc) != end) break; /* fall through */ default: *nextTokPtr = ptr; return XML_TOK_PROLOG_S; } } *nextTokPtr = ptr; return XML_TOK_PROLOG_S; case BT_PERCNT: return PREFIX(scanPercent)(enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_COMMA: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_COMMA; case BT_LSQB: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_OPEN_BRACKET; case BT_RSQB: ptr += MINBPC(enc); if (ptr == end) return -XML_TOK_CLOSE_BRACKET; if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) { if (ptr + MINBPC(enc) == end) return XML_TOK_PARTIAL; if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_GT)) { *nextTokPtr = ptr + 2*MINBPC(enc); return XML_TOK_COND_SECT_CLOSE; } } *nextTokPtr = ptr; return XML_TOK_CLOSE_BRACKET; case BT_LPAR: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_OPEN_PAREN; case BT_RPAR: ptr += MINBPC(enc); if (ptr == end) return -XML_TOK_CLOSE_PAREN; switch (BYTE_TYPE(enc, ptr)) { case BT_AST: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_CLOSE_PAREN_ASTERISK; case BT_QUEST: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_CLOSE_PAREN_QUESTION; case BT_PLUS: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_CLOSE_PAREN_PLUS; case BT_CR: case BT_LF: case BT_S: case BT_GT: case BT_COMMA: case BT_VERBAR: case BT_RPAR: *nextTokPtr = ptr; return XML_TOK_CLOSE_PAREN; } *nextTokPtr = ptr; return XML_TOK_INVALID; case BT_VERBAR: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_OR; case BT_GT: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_DECL_CLOSE; case BT_NUM: return PREFIX(scanPoundName)(enc, ptr + MINBPC(enc), end, nextTokPtr); #define LEAD_CASE(n) \ case BT_LEAD ## n: \ if (end - ptr < n) \ return XML_TOK_PARTIAL_CHAR; \ if (IS_NMSTRT_CHAR(enc, ptr, n)) { \ ptr += n; \ tok = XML_TOK_NAME; \ break; \ } \ if (IS_NAME_CHAR(enc, ptr, n)) { \ ptr += n; \ tok = XML_TOK_NMTOKEN; \ break; \ } \ *nextTokPtr = ptr; \ return XML_TOK_INVALID; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_NMSTRT: case BT_HEX: tok = XML_TOK_NAME; ptr += MINBPC(enc); break; case BT_DIGIT: case BT_NAME: case BT_MINUS: #ifdef XML_NS case BT_COLON: #endif tok = XML_TOK_NMTOKEN; ptr += MINBPC(enc); break; case BT_NONASCII: if (IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { ptr += MINBPC(enc); tok = XML_TOK_NAME; break; } if (IS_NAME_CHAR_MINBPC(enc, ptr)) { ptr += MINBPC(enc); tok = XML_TOK_NMTOKEN; break; } /* fall through */ default: *nextTokPtr = ptr; return XML_TOK_INVALID; } while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) case BT_GT: case BT_RPAR: case BT_COMMA: case BT_VERBAR: case BT_LSQB: case BT_PERCNT: case BT_S: case BT_CR: case BT_LF: *nextTokPtr = ptr; return tok; #ifdef XML_NS case BT_COLON: ptr += MINBPC(enc); switch (tok) { case XML_TOK_NAME: if (ptr == end) return XML_TOK_PARTIAL; tok = XML_TOK_PREFIXED_NAME; switch (BYTE_TYPE(enc, ptr)) { CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) default: tok = XML_TOK_NMTOKEN; break; } break; case XML_TOK_PREFIXED_NAME: tok = XML_TOK_NMTOKEN; break; } break; #endif case BT_PLUS: if (tok == XML_TOK_NMTOKEN) { *nextTokPtr = ptr; return XML_TOK_INVALID; } *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_NAME_PLUS; case BT_AST: if (tok == XML_TOK_NMTOKEN) { *nextTokPtr = ptr; return XML_TOK_INVALID; } *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_NAME_ASTERISK; case BT_QUEST: if (tok == XML_TOK_NMTOKEN) { *nextTokPtr = ptr; return XML_TOK_INVALID; } *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_NAME_QUESTION; default: *nextTokPtr = ptr; return XML_TOK_INVALID; } } return -tok; } static int PTRCALL PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { const char *start; if (ptr == end) return XML_TOK_NONE; start = ptr; while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: ptr += n; break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_AMP: if (ptr == start) return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; case BT_LT: /* this is for inside entity references */ *nextTokPtr = ptr; return XML_TOK_INVALID; case BT_LF: if (ptr == start) { *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_DATA_NEWLINE; } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; case BT_CR: if (ptr == start) { ptr += MINBPC(enc); if (ptr == end) return XML_TOK_TRAILING_CR; if (BYTE_TYPE(enc, ptr) == BT_LF) ptr += MINBPC(enc); *nextTokPtr = ptr; return XML_TOK_DATA_NEWLINE; } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; case BT_S: if (ptr == start) { *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_ATTRIBUTE_VALUE_S; } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; default: ptr += MINBPC(enc); break; } } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; } static int PTRCALL PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { const char *start; if (ptr == end) return XML_TOK_NONE; start = ptr; while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: ptr += n; break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_AMP: if (ptr == start) return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; case BT_PERCNT: if (ptr == start) { int tok = PREFIX(scanPercent)(enc, ptr + MINBPC(enc), end, nextTokPtr); return (tok == XML_TOK_PERCENT) ? XML_TOK_INVALID : tok; } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; case BT_LF: if (ptr == start) { *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_DATA_NEWLINE; } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; case BT_CR: if (ptr == start) { ptr += MINBPC(enc); if (ptr == end) return XML_TOK_TRAILING_CR; if (BYTE_TYPE(enc, ptr) == BT_LF) ptr += MINBPC(enc); *nextTokPtr = ptr; return XML_TOK_DATA_NEWLINE; } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; default: ptr += MINBPC(enc); break; } } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; } #ifdef XML_DTD static int PTRCALL PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { int level = 0; if (MINBPC(enc) > 1) { size_t n = end - ptr; if (n & (MINBPC(enc) - 1)) { n &= ~(MINBPC(enc) - 1); end = ptr + n; } } while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { INVALID_CASES(ptr, nextTokPtr) case BT_LT: if ((ptr += MINBPC(enc)) == end) return XML_TOK_PARTIAL; if (CHAR_MATCHES(enc, ptr, ASCII_EXCL)) { if ((ptr += MINBPC(enc)) == end) return XML_TOK_PARTIAL; if (CHAR_MATCHES(enc, ptr, ASCII_LSQB)) { ++level; ptr += MINBPC(enc); } } break; case BT_RSQB: if ((ptr += MINBPC(enc)) == end) return XML_TOK_PARTIAL; if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) { if ((ptr += MINBPC(enc)) == end) return XML_TOK_PARTIAL; if (CHAR_MATCHES(enc, ptr, ASCII_GT)) { ptr += MINBPC(enc); if (level == 0) { *nextTokPtr = ptr; return XML_TOK_IGNORE_SECT; } --level; } } break; default: ptr += MINBPC(enc); break; } } return XML_TOK_PARTIAL; } #endif /* XML_DTD */ static int PTRCALL PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, const char **badPtr) { ptr += MINBPC(enc); end -= MINBPC(enc); for (; ptr != end; ptr += MINBPC(enc)) { switch (BYTE_TYPE(enc, ptr)) { case BT_DIGIT: case BT_HEX: case BT_MINUS: case BT_APOS: case BT_LPAR: case BT_RPAR: case BT_PLUS: case BT_COMMA: case BT_SOL: case BT_EQUALS: case BT_QUEST: case BT_CR: case BT_LF: case BT_SEMI: case BT_EXCL: case BT_AST: case BT_PERCNT: case BT_NUM: #ifdef XML_NS case BT_COLON: #endif break; case BT_S: if (CHAR_MATCHES(enc, ptr, ASCII_TAB)) { *badPtr = ptr; return 0; } break; case BT_NAME: case BT_NMSTRT: if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f)) break; default: switch (BYTE_TO_ASCII(enc, ptr)) { case 0x24: /* $ */ case 0x40: /* @ */ break; default: *badPtr = ptr; return 0; } break; } } return 1; } /* This must only be called for a well-formed start-tag or empty element tag. Returns the number of attributes. Pointers to the first attsMax attributes are stored in atts. */ static int PTRCALL PREFIX(getAtts)(const ENCODING *enc, const char *ptr, int attsMax, ATTRIBUTE *atts) { enum { other, inName, inValue } state = inName; int nAtts = 0; int open = 0; /* defined when state == inValue; initialization just to shut up compilers */ for (ptr += MINBPC(enc);; ptr += MINBPC(enc)) { switch (BYTE_TYPE(enc, ptr)) { #define START_NAME \ if (state == other) { \ if (nAtts < attsMax) { \ atts[nAtts].name = ptr; \ atts[nAtts].normalized = 1; \ } \ state = inName; \ } #define LEAD_CASE(n) \ case BT_LEAD ## n: START_NAME ptr += (n - MINBPC(enc)); break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_NONASCII: case BT_NMSTRT: case BT_HEX: START_NAME break; #undef START_NAME case BT_QUOT: if (state != inValue) { if (nAtts < attsMax) atts[nAtts].valuePtr = ptr + MINBPC(enc); state = inValue; open = BT_QUOT; } else if (open == BT_QUOT) { state = other; if (nAtts < attsMax) atts[nAtts].valueEnd = ptr; nAtts++; } break; case BT_APOS: if (state != inValue) { if (nAtts < attsMax) atts[nAtts].valuePtr = ptr + MINBPC(enc); state = inValue; open = BT_APOS; } else if (open == BT_APOS) { state = other; if (nAtts < attsMax) atts[nAtts].valueEnd = ptr; nAtts++; } break; case BT_AMP: if (nAtts < attsMax) atts[nAtts].normalized = 0; break; case BT_S: if (state == inName) state = other; else if (state == inValue && nAtts < attsMax && atts[nAtts].normalized && (ptr == atts[nAtts].valuePtr || BYTE_TO_ASCII(enc, ptr) != ASCII_SPACE || BYTE_TO_ASCII(enc, ptr + MINBPC(enc)) == ASCII_SPACE || BYTE_TYPE(enc, ptr + MINBPC(enc)) == open)) atts[nAtts].normalized = 0; break; case BT_CR: case BT_LF: /* This case ensures that the first attribute name is counted Apart from that we could just change state on the quote. */ if (state == inName) state = other; else if (state == inValue && nAtts < attsMax) atts[nAtts].normalized = 0; break; case BT_GT: case BT_SOL: if (state != inValue) return nAtts; break; default: break; } } /* not reached */ } static int PTRFASTCALL PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr) { int result = 0; /* skip &# */ ptr += 2*MINBPC(enc); if (CHAR_MATCHES(enc, ptr, ASCII_x)) { for (ptr += MINBPC(enc); !CHAR_MATCHES(enc, ptr, ASCII_SEMI); ptr += MINBPC(enc)) { int c = BYTE_TO_ASCII(enc, ptr); switch (c) { case ASCII_0: case ASCII_1: case ASCII_2: case ASCII_3: case ASCII_4: case ASCII_5: case ASCII_6: case ASCII_7: case ASCII_8: case ASCII_9: result <<= 4; result |= (c - ASCII_0); break; case ASCII_A: case ASCII_B: case ASCII_C: case ASCII_D: case ASCII_E: case ASCII_F: result <<= 4; result += 10 + (c - ASCII_A); break; case ASCII_a: case ASCII_b: case ASCII_c: case ASCII_d: case ASCII_e: case ASCII_f: result <<= 4; result += 10 + (c - ASCII_a); break; } if (result >= 0x110000) return -1; } } else { for (; !CHAR_MATCHES(enc, ptr, ASCII_SEMI); ptr += MINBPC(enc)) { int c = BYTE_TO_ASCII(enc, ptr); result *= 10; result += (c - ASCII_0); if (result >= 0x110000) return -1; } } return checkCharRefNumber(result); } static int PTRCALL PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, const char *end) { switch ((end - ptr)/MINBPC(enc)) { case 2: if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_t)) { switch (BYTE_TO_ASCII(enc, ptr)) { case ASCII_l: return ASCII_LT; case ASCII_g: return ASCII_GT; } } break; case 3: if (CHAR_MATCHES(enc, ptr, ASCII_a)) { ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, ASCII_m)) { ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, ASCII_p)) return ASCII_AMP; } } break; case 4: switch (BYTE_TO_ASCII(enc, ptr)) { case ASCII_q: ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, ASCII_u)) { ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, ASCII_o)) { ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, ASCII_t)) return ASCII_QUOT; } } break; case ASCII_a: ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, ASCII_p)) { ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, ASCII_o)) { ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, ASCII_s)) return ASCII_APOS; } } break; } } return 0; } static int PTRCALL PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2) { for (;;) { switch (BYTE_TYPE(enc, ptr1)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ if (*ptr1++ != *ptr2++) \ return 0; LEAD_CASE(4) LEAD_CASE(3) LEAD_CASE(2) #undef LEAD_CASE /* fall through */ if (*ptr1++ != *ptr2++) return 0; break; case BT_NONASCII: case BT_NMSTRT: #ifdef XML_NS case BT_COLON: #endif case BT_HEX: case BT_DIGIT: case BT_NAME: case BT_MINUS: if (*ptr2++ != *ptr1++) return 0; if (MINBPC(enc) > 1) { if (*ptr2++ != *ptr1++) return 0; if (MINBPC(enc) > 2) { if (*ptr2++ != *ptr1++) return 0; if (MINBPC(enc) > 3) { if (*ptr2++ != *ptr1++) return 0; } } } break; default: if (MINBPC(enc) == 1 && *ptr1 == *ptr2) return 1; switch (BYTE_TYPE(enc, ptr2)) { case BT_LEAD2: case BT_LEAD3: case BT_LEAD4: case BT_NONASCII: case BT_NMSTRT: #ifdef XML_NS case BT_COLON: #endif case BT_HEX: case BT_DIGIT: case BT_NAME: case BT_MINUS: return 0; default: return 1; } } } /* not reached */ } static int PTRCALL PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1, const char *end1, const char *ptr2) { for (; *ptr2; ptr1 += MINBPC(enc), ptr2++) { if (ptr1 == end1) return 0; if (!CHAR_MATCHES(enc, ptr1, *ptr2)) return 0; } return ptr1 == end1; } static int PTRFASTCALL PREFIX(nameLength)(const ENCODING *enc, const char *ptr) { const char *start = ptr; for (;;) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: ptr += n; break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_NONASCII: case BT_NMSTRT: #ifdef XML_NS case BT_COLON: #endif case BT_HEX: case BT_DIGIT: case BT_NAME: case BT_MINUS: ptr += MINBPC(enc); break; default: return (int)(ptr - start); } } } static const char * PTRFASTCALL PREFIX(skipS)(const ENCODING *enc, const char *ptr) { for (;;) { switch (BYTE_TYPE(enc, ptr)) { case BT_LF: case BT_CR: case BT_S: ptr += MINBPC(enc); break; default: return ptr; } } } static void PTRCALL PREFIX(updatePosition)(const ENCODING *enc, const char *ptr, const char *end, POSITION *pos) { while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ ptr += n; \ break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_LF: pos->columnNumber = (XML_Size)-1; pos->lineNumber++; ptr += MINBPC(enc); break; case BT_CR: pos->lineNumber++; ptr += MINBPC(enc); if (ptr != end && BYTE_TYPE(enc, ptr) == BT_LF) ptr += MINBPC(enc); pos->columnNumber = (XML_Size)-1; break; default: ptr += MINBPC(enc); break; } pos->columnNumber++; } } #undef DO_LEAD_CASE #undef MULTIBYTE_CASES #undef INVALID_CASES #undef CHECK_NAME_CASE #undef CHECK_NAME_CASES #undef CHECK_NMSTRT_CASE #undef CHECK_NMSTRT_CASES #endif /* XML_TOK_IMPL_C */ tDOM-0.8.3/expat/latin1tab.h0000644000175000017500000000342507530547656015755 0ustar ssobernissoberni/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ /* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, /* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, /* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, /* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, tDOM-0.8.3/expat/amigaconfig.h0000644000175000017500000000143510653477535016337 0ustar ssobernissoberni#ifndef AMIGACONFIG_H #define AMIGACONFIG_H /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ #define BYTEORDER 4321 /* Define to 1 if you have the `bcopy' function. */ #define HAVE_BCOPY 1 /* Define to 1 if you have the header file. */ #undef HAVE_CHECK_H /* Define to 1 if you have the `memmove' function. */ #define HAVE_MEMMOVE 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* whether byteorder is bigendian */ #define WORDS_BIGENDIAN /* Define to specify how much context to retain around the current parse point. */ #define XML_CONTEXT_BYTES 1024 /* Define to make parameter entity parsing functionality available. */ #define XML_DTD /* Define to make XML Namespaces functionality available. */ #define XML_NS #endif /* AMIGACONFIG_H */ tDOM-0.8.3/expat/internal.h0000644000175000017500000000375410653477535015715 0ustar ssobernissoberni/* internal.h Internal definitions used by Expat. This is not needed to compile client code. The following calling convention macros are defined for frequently called functions: FASTCALL - Used for those internal functions that have a simple body and a low number of arguments and local variables. PTRCALL - Used for functions called though function pointers. PTRFASTCALL - Like PTRCALL, but for low number of arguments. inline - Used for selected internal functions for which inlining may improve performance on some platforms. Note: Use of these macros is based on judgement, not hard rules, and therefore subject to change. */ #if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__) /* We'll use this version by default only where we know it helps. regparm() generates warnings on Solaris boxes. See SF bug #692878. Instability reported with egcs on a RedHat Linux 7.3. Let's comment out: #define FASTCALL __attribute__((stdcall, regparm(3))) and let's try this: */ #define FASTCALL __attribute__((regparm(3))) #define PTRFASTCALL __attribute__((regparm(3))) #endif /* Using __fastcall seems to have an unexpected negative effect under MS VC++, especially for function pointers, so we won't use it for now on that platform. It may be reconsidered for a future release if it can be made more effective. Likely reason: __fastcall on Windows is like stdcall, therefore the compiler cannot perform stack optimizations for call clusters. */ /* Make sure all of these are defined if they aren't already. */ #ifndef FASTCALL #define FASTCALL #endif #ifndef PTRCALL #define PTRCALL #endif #ifndef PTRFASTCALL #define PTRFASTCALL #endif #ifndef XML_MIN_SIZE #if !defined(__cplusplus) && !defined(inline) #ifdef __GNUC__ #define inline __inline #endif /* __GNUC__ */ #endif #endif /* XML_MIN_SIZE */ #ifdef __cplusplus #define inline inline #else #ifndef inline #define inline #endif #endif tDOM-0.8.3/expat/xmltok_impl.h0000644000175000017500000000122507520723237016417 0ustar ssobernissoberni/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ enum { BT_NONXML, BT_MALFORM, BT_LT, BT_AMP, BT_RSQB, BT_LEAD2, BT_LEAD3, BT_LEAD4, BT_TRAIL, BT_CR, BT_LF, BT_GT, BT_QUOT, BT_APOS, BT_EQUALS, BT_QUEST, BT_EXCL, BT_SOL, BT_SEMI, BT_NUM, BT_LSQB, BT_S, BT_NMSTRT, BT_COLON, BT_HEX, BT_DIGIT, BT_NAME, BT_MINUS, BT_OTHER, /* known not to be a name or name start character */ BT_NONASCII, /* might be a name or name start character */ BT_PERCNT, BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, BT_COMMA, BT_VERBAR }; #include tDOM-0.8.3/expat/nametab.h0000644000175000017500000001561207520723237015474 0ustar ssobernissobernistatic const unsigned namingBitmap[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE, 0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF, 0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF, 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, 0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, 0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF, 0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000, 0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060, 0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003, 0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003, 0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000, 0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001, 0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003, 0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000, 0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003, 0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003, 0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000, 0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF, 0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB, 0x40000000, 0xF580C900, 0x00000007, 0x02010800, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF, 0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF, 0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, 0x00000000, 0x00004C40, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF, 0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF, 0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000, 0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE, 0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF, 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003, 0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, 0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, 0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF, 0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF, 0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF, 0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF, 0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF, 0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0, 0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1, 0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3, 0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80, 0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3, 0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3, 0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000, 0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000, 0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF, 0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x1FFF0000, 0x00000002, 0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF, 0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF, }; static const unsigned char nmstrtPages[] = { 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; static const unsigned char namePages[] = { 0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00, 0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; tDOM-0.8.3/expat/asciitab.h0000644000175000017500000000334007530547656015651 0ustar ssobernissoberni/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, tDOM-0.8.3/expat/VERSION0000644000175000017500000000001410653477535014762 0ustar ssobernissoberniexpat-2.0.1 tDOM-0.8.3/expat/utf8tab.h0000644000175000017500000000334307530547656015452 0ustar ssobernissoberni/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ /* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, /* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, /* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, tDOM-0.8.3/expat/macconfig.h0000644000175000017500000000245510111540077016001 0ustar ssobernissoberni/*================================================================ ** Copyright 2000, Clark Cooper ** All rights reserved. ** ** This is free software. You are permitted to copy, distribute, or modify ** it under the terms of the MIT/X license (contained in the COPYING file ** with this distribution.) ** */ #ifndef MACCONFIG_H #define MACCONFIG_H /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ #define BYTEORDER 4321 /* Define to 1 if you have the `bcopy' function. */ #undef HAVE_BCOPY /* Define to 1 if you have the `memmove' function. */ #define HAVE_MEMMOVE /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* whether byteorder is bigendian */ #define WORDS_BIGENDIAN /* Define to specify how much context to retain around the current parse point. */ #undef XML_CONTEXT_BYTES /* Define to make parameter entity parsing functionality available. */ #define XML_DTD /* Define to make XML Namespaces functionality available. */ #define XML_NS /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `long' if does not define. */ #define off_t long /* Define to `unsigned' if does not define. */ #undef size_t #endif /* ifndef MACCONFIG_H */ tDOM-0.8.3/expat-1.95.1/0000755000175000017500000000000011004674367014441 5ustar ssobernissobernitDOM-0.8.3/expat-1.95.1/CVS/0000755000175000017500000000000011004674367015074 5ustar ssobernissobernitDOM-0.8.3/expat-1.95.1/CVS/Root0000644000175000017500000000006211004674367015740 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/expat-1.95.1/CVS/Entries0000644000175000017500000000000211004674367016420 0ustar ssobernissoberniD tDOM-0.8.3/expat-1.95.1/CVS/Repository0000644000175000017500000000002211004674367017170 0ustar ssobernissobernitdom/expat-1.95.1 tDOM-0.8.3/README.AOL0000644000175000017500000000371010660663715014064 0ustar ssobernissoberni tDOM - a XML/DOM/XPath/XSLT implementation for Tcl (Version 0.8.3) Jochen Loewer (loewerj@hotmail.com) Rolf Ade (rolf@pointsman.de) with some contributions by: Zoran Vasiljevic (zv@archiware.com) This file contains some remarks about using tDOM package under the AOLserver, a webserver from America Online. For general information, look in the "README" file in this directory. COMPILING tDOM -------------- Change to "unix" directory, edit the CONFIG file to select the correct configuration defaults and then do: sh CONFIG make INSTALLING tDOM --------------- Depending on whether you use the AOLserver 3.x or 4.x series, you need to install the library in a different way. For AOLserver 3.x: The tDOM is build as AOLserver module. Please consult the AOLserver documentation how to setup the server to load AOLserver module(s). For AOLserver 4.x: You can build tDOM as a regular AOLserver module or Tcl loadable extension. There are examples in the CONFIG file how to do either. When building the tDOM as AOLserver module, you will have to manually setup the servers's startup script to load the module. Please consult the AOLserver documentation how to do this. When building the tDOM as Tcl loadable extension, there is nothing special related to the AOLserver itself, except for the target directory/ies where the tDOM files will be installed when you do: make install All you need to do then is to use "ns_eval package require tdom" to load the library. This will make sure the tDOM is loaded in every connection (or other) thread. You should add this command to some of the Tcl startup files in modules/tcl, so it loads the library on every server startup. - EOF - tDOM-0.8.3/NPL-1_1Final.html0000644000175000017500000007224307522573657015460 0ustar ssobernissoberni Netscape Public License version 1.1
MOZILLA PUBLIC LICENSE
Version 1.1


1. Definitions.

    1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party.

    1.1. ''Contributor'' means each entity that creates or contributes to the creation of Modifications.

    1.2. ''Contributor Version'' means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.

    1.3. ''Covered Code'' means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.

    1.4. ''Electronic Distribution Mechanism'' means a mechanism generally accepted in the software development community for the electronic transfer of data.

    1.5. ''Executable'' means Covered Code in any form other than Source Code.

    1.6. ''Initial Developer'' means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.

    1.7. ''Larger Work'' means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.

    1.8. ''License'' means this document.

    1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.

    1.9. ''Modifications'' means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:

      A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.

      B. Any new file that contains any part of the Original Code or previous Modifications.
       

    1.10. ''Original Code'' means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.

    1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation,  method, process, and apparatus claims, in any patent Licensable by grantor.

    1.11. ''Source Code'' means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.

    1.12. "You'' (or "Your")  means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You'' includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control'' means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.

2. Source Code License.
    2.1. The Initial Developer Grant.
    The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
      (a)  under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and

      (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).

           
      (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.

      (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code;  or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.
       

    2.2. Contributor Grant.
    Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
       
      (a)  under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and

      (b) under Patent Claims infringed by the making, using, or selling of  Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of  Modifications made by that Contributor with its Contributor Version (or portions of such combination).

      (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code.

      (d)    Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2)  separate from the Contributor Version;  3)  for infringements caused by: i) third party modifications of Contributor Version or ii)  the combination of Modifications made by that Contributor with other software  (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.


3. Distribution Obligations.

    3.1. Application of License.
    The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.

    3.2. Availability of Source Code.
    Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.

    3.3. Description of Modifications.
    You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.

    3.4. Intellectual Property Matters

      (a) Third Party Claims.
      If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL'' which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.

      (b) Contributor APIs.
      If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
       

              (c)    Representations.
      Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.


    3.5. Required Notices.
    You must duplicate the notice in Exhibit A in each file of the Source Code.  If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice.  If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A.  You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code.  You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.

    3.6. Distribution of Executable Versions.
    You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.

    3.7. Larger Works.
    You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.

4. Inability to Comply Due to Statute or Regulation.
    If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
5. Application of this License.
    This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
6. Versions of the License.
    6.1. New Versions.
    Netscape Communications Corporation (''Netscape'') may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.

    6.2. Effect of New Versions.
    Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License.

    6.3. Derivative Works.
    If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases ''Mozilla'', ''MOZILLAPL'', ''MOZPL'', ''Netscape'', "MPL", ''NPL'' or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)

7. DISCLAIMER OF WARRANTY.
    COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
8. TERMINATION.
    8.1.  This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.

    8.2.  If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant")  alleging that:

    (a)  such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i)  agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant.  If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.

    (b)  any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.

    8.3.  If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.

    8.4.  In the event of termination under Sections 8.1 or 8.2 above,  all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.

9. LIMITATION OF LIABILITY.
    UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
10. U.S. GOVERNMENT END USERS.
    The Covered Code is a ''commercial item,'' as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ''commercial computer software'' and ''commercial computer software documentation,'' as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
11. MISCELLANEOUS.
    This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
12. RESPONSIBILITY FOR CLAIMS.
    As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
13. MULTIPLE-LICENSED CODE.
    Initial Developer may designate portions of the Covered Code as “Multiple-Licensed”.  “Multiple-Licensed” means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the NPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.


EXHIBIT A -Mozilla Public License.

    ``The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
    http://www.mozilla.org/MPL/

    Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
    ANY KIND, either express or implied. See the License for the specific language governing rights and
    limitations under the License.

    The Original Code is ______________________________________.

    The Initial Developer of the Original Code is ________________________. Portions created by
     ______________________ are Copyright (C) ______ _______________________. All Rights
    Reserved.

    Contributor(s): ______________________________________.

    Alternatively, the contents of this file may be used under the terms of the _____ license (the  “[___] License”), in which case the provisions of [______] License are applicable  instead of those above.  If you wish to allow use of your version of this file only under the terms of the [____] License and not to allow others to use your version of this file under the MPL, indicate your decision by deleting  the provisions above and replace  them with the notice and other provisions required by the [___] License.  If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the [___] License."

    [NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.]



    AMENDMENTS

    The Netscape Public License Version 1.1 ("NPL") consists of the Mozilla Public License Version 1.1 with the following Amendments, including Exhibit A-Netscape Public License.  Files identified with "Exhibit A-Netscape Public License" are governed by the Netscape Public License Version 1.1.

    Additional Terms applicable to the Netscape Public License.

      I. Effect.
      These additional terms described in this Netscape Public License -- Amendments shall apply to the Mozilla Communicator client code and to all Covered Code under this License.

      II. ''Netscape's Branded Code'' means Covered Code that Netscape distributes and/or permits others to distribute under one or more trademark(s) which are controlled by Netscape but which are not licensed for use under this License.

      III. Netscape and logo.
      This License does not grant any rights to use the trademarks "Netscape'', the "Netscape N and horizon'' logo or the "Netscape lighthouse" logo, "Netcenter", "Gecko", "Java" or "JavaScript", "Smart Browsing" even if such marks are included in the Original Code or Modifications.

      IV. Inability to Comply Due to Contractual Obligation.
      Prior to licensing the Original Code under this License, Netscape has licensed third party code for use in Netscape's Branded Code. To the extent that Netscape is limited contractually from making such third party code available under this License, Netscape may choose to reintegrate such code into Covered Code without being required to distribute such code in Source Code form, even if such code would otherwise be considered ''Modifications'' under this License.

      V. Use of Modifications and Covered Code by Initial Developer.

        V.1. In General.
        The obligations of Section 3 apply to Netscape, except to the extent specified in this Amendment, Section V.2 and V.3.

        V.2. Other Products.
        Netscape may include Covered Code in products other than the Netscape's Branded Code which are released by Netscape during the two (2) years following the release date of the Original Code, without such additional products becoming subject to the terms of this License, and may license such additional products on different terms from those contained in this License.

        V.3. Alternative Licensing.
        Netscape may license the Source Code of Netscape's Branded Code, including Modifications incorporated therein, without such Netscape Branded Code becoming subject to the terms of this License, and may license such Netscape Branded Code on different terms from those contained in this License.
         

      VI. Litigation.
      Notwithstanding the limitations of Section 11 above, the provisions regarding litigation in Section 11(a), (b) and (c) of the License shall apply to all disputes relating to this License.


    EXHIBIT A-Netscape Public License.

       
      ''The contents of this file are subject to the Netscape Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/NPL/

      Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

      The Original Code is Mozilla Communicator client code, released March 31, 1998.

      The Initial Developer of the Original Code is Netscape Communications Corporation. Portions created by Netscape are Copyright (C) 1998-1999 Netscape Communications Corporation. All Rights Reserved.

      Contributor(s): ______________________________________.

       
      Alternatively, the contents of this file may be used under the terms of the _____ license (the  “[___] License”), in which case the provisions of [______] License are applicable  instead of those above.  If you wish to allow use of your version of this file only under the terms of the [____] License and not to allow others to use your version of this file under the NPL, indicate your decision by deleting  the provisions above and replace  them with the notice and other provisions required by the [___] License.  If you do not delete the provisions above, a recipient may use your version of this file under either the NPL or the [___] License."
tDOM-0.8.3/configure0000755000175000017500000121576710660671273014521 0ustar ssobernissoberni#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for tdom 0.8.3. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='tdom' PACKAGE_TARNAME='tdom' PACKAGE_VERSION='0.8.3' PACKAGE_STRING='tdom 0.8.3' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS LD_LIBRARY_PATH_VAR TDOM_LD_SEARCH_FLAGS TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG TDOMSHELL PKG_BUILD_STUB_LIB_SPEC PKG_STUB_LIB_SPEC PKG_BUILD_STUB_LIB_PATH PKG_STUB_LIB_PATH LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures tdom 0.8.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of tdom 0.8.3:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-threads build with threads --enable-shared build and link with shared libraries (default: on) --enable-64bit enable 64bit support (default: off) --enable-64bit-vis enable 64bit Sparc VIS support (default: off) --enable-wince enable Win/CE support (where applicable) --enable-load allow dynamic loading and "load" command (default: on) --enable-symbols build with debugging symbols (default: off) --enable-dtd build with dtd support (default: on) --enable-ns build with XML namespace support (default: on) --enable-unknown enable built-in unknown command (default: off) --enable-tdomalloc build with the tDOM allocator (default: off) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-tcl directory containing tcl configuration (tclConfig.sh) --with-aolserver directory with AOLserver distribution --with-tclinclude directory containing the public Tcl header files --with-celib=DIR use Windows/CE support library from DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF tdom configure 0.8.3 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by tdom $as_me 0.8.3, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- # TEA extensions pass this us the version of TEA they think they # are compatible with. TEA_VERSION="3.6" echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 if test x"${PACKAGE_NAME}" = x ; then { { echo "$as_me:$LINENO: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 echo "$as_me: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} { (exit 1); exit 1; }; } fi if test x"3.6" = x ; then { { echo "$as_me:$LINENO: error: TEA version not specified." >&5 echo "$as_me: error: TEA version not specified." >&2;} { (exit 1); exit 1; }; } elif test "3.6" != "${TEA_VERSION}" ; then echo "$as_me:$LINENO: result: warning: requested TEA version \"3.6\", have \"${TEA_VERSION}\"" >&5 echo "${ECHO_T}warning: requested TEA version \"3.6\", have \"${TEA_VERSION}\"" >&6 else echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 fi case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CYGPATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -w" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then echo "$as_me:$LINENO: result: $CYGPATH" >&5 echo "${ECHO_T}$CYGPATH" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac # Check if exec_prefix is set. If not use fall back to prefix. # Note when adjusted, so that TEA_PREFIX can correct for this. # This is needed for recursive configures, since autoconf propagates # $prefix, but not $exec_prefix (doh!). if test x$exec_prefix = xNONE ; then exec_prefix_default=yes exec_prefix=$prefix fi # This package name must be replaced statically for AC_SUBST to work # Substitute STUB_LIB_FILE in case package creates a stub library too. # We AC_SUBST these here to ensure they are subst'ed, # in case the user doesn't call TEA_ADD_... ac_aux_dir= for ac_dir in tclconfig $srcdir/tclconfig; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in tclconfig $srcdir/tclconfig" >&5 echo "$as_me: error: cannot find install-sh or install.sh in tclconfig $srcdir/tclconfig" >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" with_tclconfig=${withval} fi; echo "$as_me:$LINENO: checking for Tcl configuration" >&5 echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 if test "${ac_cv_c_tclconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case ${with_tclconfig} in */tclConfig.sh ) if test -f ${with_tclconfig}; then { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` break fi done fi # on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 fi fi echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . "${TCL_BIN_DIR}/tclConfig.sh" else echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TCL_BIN_DIR}/Makefile" ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} elif test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tcl.framework installed in an arbitary location. case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then for i in "`cd ${TCL_BIN_DIR}; pwd`" \ "`cd ${TCL_BIN_DIR}/../..; pwd`"; do if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" break fi done fi if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" fi ;; esac fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- #TEA_PATH_TKCONFIG #TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} prefix=${TCL_PREFIX} else { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 echo "$as_me: --prefix defaulting to /usr/local" >&6;} prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ -o x"${exec_prefix_default}" = x"yes" ; then if test x"${TCL_EXEC_PREFIX}" != x; then { echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} exec_prefix=${TCL_EXEC_PREFIX} else { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} exec_prefix=$prefix fi fi #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) # in this macro, they need to go into TEA_SETUP_COMPILER instead. # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 if test "${tcl_cv_cc_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_cc_pipe=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_cc_pipe=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 echo "${ECHO_T}$tcl_cv_cc_pipe" >&6 if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi fi #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac if test "${TEA_PLATFORM}" = "unix" ; then #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for sin" >&5 echo $ECHO_N "checking for sin... $ECHO_C" >&6 if test "${ac_cv_func_sin+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define sin to an innocuous variant, in case declares sin. For example, HP-UX 11i declares gettimeofday. */ #define sin innocuous_sin /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sin (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef sin /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sin (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_sin) || defined (__stub___sin) choke me #else char (*f) () = sin; #endif #ifdef __cplusplus } #endif int main () { return f != sin; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_sin=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_sin=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 echo "${ECHO_T}$ac_cv_func_sin" >&6 if test $ac_cv_func_sin = yes; then MATH_LIBS="" else MATH_LIBS="-lm" fi echo "$as_me:$LINENO: checking for main in -lieee" >&5 echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 if test "${ac_cv_lib_ieee_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ieee_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ieee_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 if test $ac_cv_lib_ieee_main = yes; then MATH_LIBS="-lieee $MATH_LIBS" fi #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for main in -linet" >&5 echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 if test "${ac_cv_lib_inet_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_inet_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_inet_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 if test $ac_cv_lib_inet_main = yes; then LIBS="$LIBS -linet" fi if test "${ac_cv_header_net_errno_h+set}" = set; then echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking net/errno.h usability" >&5 echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking net/errno.h presence" >&5 echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the tdom lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_net_errno_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 fi if test $ac_cv_header_net_errno_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_ERRNO_H 1 _ACEOF fi #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6 if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_connect) || defined (__stub___connect) choke me #else char (*f) () = connect; #endif #ifdef __cplusplus } #endif int main () { return f != connect; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = yes; then tcl_checkSocket=0 else tcl_checkSocket=1 fi if test "$tcl_checkSocket" = 1; then echo "$as_me:$LINENO: checking for setsockopt" >&5 echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 if test "${ac_cv_func_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define setsockopt to an innocuous variant, in case declares setsockopt. For example, HP-UX 11i declares gettimeofday. */ #define setsockopt innocuous_setsockopt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char setsockopt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef setsockopt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setsockopt (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_setsockopt) || defined (__stub___setsockopt) choke me #else char (*f) () = setsockopt; #endif #ifdef __cplusplus } #endif int main () { return f != setsockopt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 if test $ac_cv_func_setsockopt = yes; then : else echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setsockopt (); int main () { setsockopt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 if test $ac_cv_lib_socket_setsockopt = yes; then LIBS="$LIBS -lsocket" else tcl_checkBoth=1 fi fi fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" echo "$as_me:$LINENO: checking for accept" >&5 echo $ECHO_N "checking for accept... $ECHO_C" >&6 if test "${ac_cv_func_accept+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define accept to an innocuous variant, in case declares accept. For example, HP-UX 11i declares gettimeofday. */ #define accept innocuous_accept /* System header to define __stub macros and hopefully few prototypes, which can conflict with char accept (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef accept /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char accept (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_accept) || defined (__stub___accept) choke me #else char (*f) () = accept; #endif #ifdef __cplusplus } #endif int main () { return f != accept; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_accept=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_accept=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 echo "${ECHO_T}$ac_cv_func_accept" >&6 if test $ac_cv_func_accept = yes; then tcl_checkNsl=0 else LIBS=$tk_oldLibs fi fi echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) choke me #else char (*f) () = gethostbyname; #endif #ifdef __cplusplus } #endif int main () { return f != gethostbyname; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = yes; then : else echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then LIBS="$LIBS -lnsl" fi fi # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call TEA_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' echo "$as_me:$LINENO: checking dirent.h" >&5 echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 if test "${tcl_cv_dirent_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #ifndef _POSIX_SOURCE # ifdef __Lynx__ /* * Generate compilation error to make the test fail: Lynx headers * are only valid if really in the POSIX environment. */ missing_procedure(); # endif #endif DIR *d; struct dirent *entryPtr; char *p; d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_dirent_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_dirent_h=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 echo "${ECHO_T}$tcl_cv_dirent_h" >&6 if test $tcl_cv_dirent_h = no; then cat >>confdefs.h <<\_ACEOF #define NO_DIRENT_H 1 _ACEOF fi if test "${ac_cv_header_errno_h+set}" = set; then echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking errno.h usability" >&5 echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking errno.h presence" >&5 echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the tdom lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_errno_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6 fi if test $ac_cv_header_errno_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_ERRNO_H 1 _ACEOF fi if test "${ac_cv_header_float_h+set}" = set; then echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6 if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking float.h usability" >&5 echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking float.h presence" >&5 echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the tdom lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6 if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_float_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6 fi if test $ac_cv_header_float_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_FLOAT_H 1 _ACEOF fi if test "${ac_cv_header_values_h+set}" = set; then echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6 if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking values.h usability" >&5 echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking values.h presence" >&5 echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the tdom lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6 if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_values_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6 fi if test $ac_cv_header_values_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_VALUES_H 1 _ACEOF fi if test "${ac_cv_header_limits_h+set}" = set; then echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking limits.h usability" >&5 echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking limits.h presence" >&5 echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the tdom lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_limits_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6 fi if test $ac_cv_header_limits_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIMITS_H 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define NO_LIMITS_H 1 _ACEOF fi if test "${ac_cv_header_stdlib_h+set}" = set; then echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking stdlib.h usability" >&5 echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking stdlib.h presence" >&5 echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the tdom lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_stdlib_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 fi if test $ac_cv_header_stdlib_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtol" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtoul" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtod" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STDLIB_H 1 _ACEOF fi if test "${ac_cv_header_string_h+set}" = set; then echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6 if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking string.h usability" >&5 echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking string.h presence" >&5 echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the tdom lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6 if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_string_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6 fi if test $ac_cv_header_string_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strstr" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strerror" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* # See also memmove check below for a place where NO_STRING_H can be # set and why. if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STRING_H 1 _ACEOF fi if test "${ac_cv_header_sys_wait_h+set}" = set; then echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the tdom lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_wait_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 fi if test $ac_cv_header_sys_wait_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_SYS_WAIT_H 1 _ACEOF fi if test "${ac_cv_header_dlfcn_h+set}" = set; then echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the tdom lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 fi if test $ac_cv_header_dlfcn_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_DLFCN_H 1 _ACEOF fi # OS/390 lacks sys/param.h (and doesn't need it, by chance). for ac_header in sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the tdom lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Let the user call this, because if it triggers, they will # need a compat/strtod.c that is correct. Users can also # use Tcl_GetDouble(FromObj) instead. #TEA_BUGGY_STRTOD fi #----------------------------------------------------------------------- # Those two are needed for compiling expat. #----------------------------------------------------------------------- for ac_func in memmove bcopy do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done #-------------------------------------------------------------------- # Add optional AOLserver includes #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for AOLserver configuration" >&5 echo $ECHO_N "checking for AOLserver configuration... $ECHO_C" >&6 # Check whether --with-aol or --without-aol was given. if test "${with_aol+set}" = set; then withval="$with_aol" with_aolserver=${withval} fi; if test "${ac_cv_c_aolserver+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test x"${with_aolserver}" != x ; then if test -f "${with_aolserver}/include/ns.h" ; then ac_cv_c_aolserver=`(cd ${with_aolserver}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_aolserver} directory doesn't contain ns.h" >&5 echo "$as_me: error: ${with_aolserver} directory doesn't contain ns.h" >&2;} { (exit 1); exit 1; }; } fi fi fi if test x"${ac_cv_c_aolserver}" = x ; then echo "$as_me:$LINENO: result: none found" >&5 echo "${ECHO_T}none found" >&6 else AOL_DIR=${ac_cv_c_aolserver} AOL_INCLUDES="-I\"${AOL_DIR}/include\"" if test "`uname -s`" = Darwin ; then aollibs=`ls ${AOL_DIR}/lib/libns* 2>/dev/null` if test x"$aollibs" != x ; then AOL_LIBS="-L\"${AOL_DIR}/lib\" -lnsd -lnsthread" fi fi echo "$as_me:$LINENO: result: found AOLserver in $AOL_DIR" >&5 echo "${ECHO_T}found AOLserver in $AOL_DIR" >&6 cat >>confdefs.h <<\_ACEOF #define NS_AOLSERVER 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define USE_NORMAL_ALLOCATOR 1 _ACEOF fi #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- vars="expat/xmlrole.c \ expat/xmltok.c \ expat/xmlparse.c \ generic/xmlsimple.c \ generic/utf8conv.c \ generic/dom.c \ generic/domhtml.c \ generic/domxpath.c \ generic/domxslt.c \ generic/domlock.c \ generic/tcldom.c \ generic/nodecmd.c \ generic/tdominit.c \ generic/tclexpat.c \ generic/tdomStubInit.c" for i in $vars; do case $i in \$*) # allow $-var names PKG_SOURCES="$PKG_SOURCES $i" PKG_OBJECTS="$PKG_OBJECTS $i" ;; *) # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 echo "$as_me: error: could not find source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_OBJECTS="$PKG_OBJECTS $j" ;; esac done vars="generic/tdom.h" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_HEADERS="$PKG_HEADERS $i" done vars="-I${srcdir}/generic -I${srcdir}/expat ${AOL_INCLUDES}" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done vars="${AOL_LIBS}" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done PKG_CFLAGS="$PKG_CFLAGS " vars="generic/tdomStubLib.c" for i in $vars; do # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 echo "$as_me: error: could not find stub source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" done vars="lib/tdom.tcl" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then cat >>confdefs.h <<\_ACEOF #define BUILD_tdom 1 _ACEOF CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="pkgIndex.tcl tcldomsh" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for Tcl public headers" >&5 echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" with_tclinclude=${withval} fi; if test "${ac_cv_c_tclh+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} { (exit 1); exit 1; }; } fi else if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers directory case ${TCL_DEFS} in *TCL_FRAMEWORK*) list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" ;; esac fi # Look in the source dir only if Tcl is not installed, # and in that situation, look there before installed locations. if test -f "${TCL_BIN_DIR}/Makefile" ; then list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TCL_INCLUDE_SPEC}" != x ; then d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then { { echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 echo "${ECHO_T}${ac_cv_c_tclh}" >&6 fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" #TEA_PRIVATE_TCL_HEADERS #TEA_PUBLIC_TK_HEADERS #TEA_PRIVATE_TK_HEADERS #TEA_PATH_X #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then TCL_THREADS=1 if test "${TEA_PLATFORM}" != "windows" ; then # We are always OK on Windows, so check what this platform wants: # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention cat >>confdefs.h <<\_ACEOF #define USE_THREAD_ALLOC 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF if test "`uname -s`" = "SunOS" ; then cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF fi cat >>confdefs.h <<\_ACEOF #define _THREAD_SAFE 1 _ACEOF echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the same # library, as some systems hide it there until pthread.h is # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __pthread_mutex_init (); int main () { __pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread___pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread___pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthreads_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 if test $ac_cv_lib_c_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_r_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 { echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} fi fi fi fi fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output echo "$as_me:$LINENO: checking for building with threads" >&5 echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 if test "${TCL_THREADS}" = 1; then cat >>confdefs.h <<\_ACEOF #define TCL_THREADS 1 _ACEOF echo "$as_me:$LINENO: result: yes (default)" >&5 echo "${ECHO_T}yes (default)" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then { echo "$as_me:$LINENO: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&5 echo "$as_me: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&2;} fi ;; *) if test "${TCL_THREADS}" = "1"; then { echo "$as_me:$LINENO: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&5 echo "$as_me: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&2;} fi ;; esac #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking how to build libraries" >&5 echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then echo "$as_me:$LINENO: result: shared" >&5 echo "${ECHO_T}shared" >&6 SHARED_BUILD=1 else echo "$as_me:$LINENO: result: static" >&5 echo "${ECHO_T}static" >&6 SHARED_BUILD=0 cat >>confdefs.h <<\_ACEOF #define STATIC_BUILD 1 _ACEOF fi #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- # Step 0.a: Enable 64 bit support? echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" do64bit=$enableval else do64bit=no fi; echo "$as_me:$LINENO: result: $do64bit" >&5 echo "${ECHO_T}$do64bit" >&6 # Step 0.b: Enable Solaris 64 bit VIS support? echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 # Check whether --enable-64bit-vis or --disable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then enableval="$enable_64bit_vis" do64bitVIS=$enableval else do64bitVIS=no fi; echo "$as_me:$LINENO: result: $do64bitVIS" >&5 echo "${ECHO_T}$do64bitVIS" >&6 if test "$do64bitVIS" = "yes"; then # Force 64bit on with VIS do64bit=yes fi # Step 0.c: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = "windows" ; then echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 # Check whether --enable-wince or --disable-wince was given. if test "${enable_wince+set}" = set; then enableval="$enable_wince" doWince=$enableval else doWince=no fi; echo "$as_me:$LINENO: result: $doWince" >&5 echo "${ECHO_T}$doWince" >&6 fi # Step 1: set the variable "system" to hold the name and version number # for the system. echo "$as_me:$LINENO: checking system version" >&5 echo $ECHO_N "checking system version... $ECHO_C" >&6 if test "${tcl_cv_sys_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows elif test -f /usr/lib/NextStep/software_version; then tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 echo "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi fi fi fi echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 echo "${ECHO_T}$tcl_cv_sys_version" >&6 system=$tcl_cv_sys_version # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then have_dl=yes else have_dl=no fi # Require ranlib early so we can override it in special cases below. # Step 3: set configuration options based on system name and version. # This is similar to Tcl's unix/tcl.m4 except that we've added a # "windows" case. do64bit_ok=no LDFLAGS_ORIG="$LDFLAGS" # When ld needs options to work in 64-bit mode, put them in # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] # is disabled by the user. [Bug 1016796] LDFLAGS_ARCH="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O if test "$GCC" = "yes" ; then CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wno-implicit-int" else CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" case $system in windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|ia64. MACHINE="X86" if test "$do64bit" != "no" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft Platform SDK" fi MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # default to AMD64 64-bit build PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" PATH64="${MSSDK}/Bin/Win64" ;; esac if test ! -d "${PATH64}" ; then { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} do64bit="no" else echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} { (exit 1); exit 1; }; } fi if test "$GCC" = "yes" ; then { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} { (exit 1); exit 1; }; } fi # First, look for one uninstalled. # the alternative search directory is invoked by --with-celib if test x"${no_celib}" = x ; then # we reset no_celib in case something fails here no_celib=true # Check whether --with-celib or --without-celib was given. if test "${with_celib+set}" = set; then withval="$with_celib" with_celibconfig=${withval} fi; echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 if test "${ac_cv_c_celibconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-celibconfig was specified. if test x"${with_celibconfig}" != x ; then if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a celib library if test x"${ac_cv_c_celibconfig}" = x ; then for i in \ ../celib-palm-3.0 \ ../celib \ ../../celib-palm-3.0 \ ../../celib \ `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ ${srcdir}/../celib-palm-3.0 \ ${srcdir}/../celib \ `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ ; do if test -d "$i/inc" ; then ac_cv_c_celibconfig=`(cd $i; pwd)` break fi done fi fi if test x"${ac_cv_c_celibconfig}" = x ; then { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 echo "$as_me: error: Cannot find celib support library directory" >&2;} { (exit 1); exit 1; }; } else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 echo "${ECHO_T}found $CELIB_DIR" >&6 fi fi # Set defaults for common evc4/PPC2003 setup # Currently Tcl requires 300+, possibly 420+ for sockets CEVERSION=420; # could be 211 300 301 400 420 ... TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... ARCH=ARM; # could be ARM MIPS X86EM ... PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" if test "$doWince" != "yes"; then # If !yes then the user specified something # Reset ARCH to allow user to skip specifying it ARCH= eval `echo $doWince | awk -F, '{ \ if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ }'` if test "x${ARCH}" = "x" ; then ARCH=$TARGETCPU; fi fi OSVERSION=WCE$CEVERSION; if test "x${WCEROOT}" = "x" ; then WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" if test ! -d "${WCEROOT}" ; then WCEROOT="C:/Program Files/Microsoft eMbedded Tools" fi fi if test "x${SDKROOT}" = "x" ; then SDKROOT="C:/Program Files/Windows CE Tools" if test ! -d "${SDKROOT}" ; then SDKROOT="C:/Windows CE Tools" fi fi WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} { (exit 1); exit 1; }; } doWince="no" else # We could PATH_NOSPACE these, but that's not important, # as long as we quote them when used. CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" if test -d "${CEINCLUDE}/${TARGETCPU}" ; then CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" fi CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" fi fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" != "no" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs CC="\"${PATH64}/cl.exe\"" CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" RC="\"${MSSDK}/bin/rc.exe\"" lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" # Avoid 'unresolved external symbol __security_cookie' # errors, c.f. http://support.microsoft.com/?id=894573 vars="bufferoverflowU.lib" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done elif test "$doWince" != "no" ; then CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" if test "${TARGETCPU}" = "X86"; then CC="\"${CEBINROOT}/cl.exe\"" else CC="\"${CEBINROOT}/cl${ARCH}.exe\"" fi CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" arch=`echo ${ARCH} | awk '{print tolower($0)}'` defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" if test "${SHARED_BUILD}" = "1" ; then # Static CE builds require static celib as well defs="${defs} _DLL" fi for i in $defs ; do cat >>confdefs.h <<_ACEOF #define $i 1 _ACEOF done cat >>confdefs.h <<_ACEOF #define _WIN32_WCE $CEVERSION _ACEOF cat >>confdefs.h <<_ACEOF #define UNDER_CE $CEVERSION _ACEOF CFLAGS_DEBUG="-nologo -Zi -Od" CFLAGS_OPTIMIZE="-nologo -Ox" lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" else RC="rc" lflags="-nologo" LINKBIN="link" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode RC="windres" CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" SHLIB_LD="$CC -shared" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" else SHLIB_LD="${LINKBIN} -dll ${lflags}" # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # This essentially turns it all on. LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" LDFLAGS_OPTIMIZE="-release" if test "$doWince" != "no" ; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots # Bogus to avoid getting this turned off DL_OBJS="tclLoadNone.obj" ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r) # ok ... ;; *) CC=${CC}_r ;; esac echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 echo "${ECHO_T}Using $CC for compiling with threads" >&6 fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker on AIX 4+ if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS_ARCH="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi if test "`uname -m`" = "ia64" ; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = "yes" ; then CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else if test "$GCC" = "yes" ; then SHLIB_LD="gcc -shared" else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" fi SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' fi # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then case $LIBOBJS in "tclLoadAix.$ac_objext" | \ *" tclLoadAix.$ac_objext" | \ "tclLoadAix.$ac_objext "* | \ *" tclLoadAix.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; esac DL_LIBS="-lld" fi # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gettimeofday (); int main () { gettimeofday (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gettimeofday=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gettimeofday=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 if test $ac_cv_lib_bsd_gettimeofday = yes; then libbsd=yes else libbsd=no fi if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" cat >>confdefs.h <<\_ACEOF #define USE_DELTA_FOR_TZ 1 _ACEOF fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CC} -nostart" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" #----------------------------------------------------------- # Check for inet_ntoa in -lbind, for BeOS (which also needs # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6 if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char inet_ntoa (); int main () { inet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bind_inet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bind_inet_ntoa=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6 if test $ac_cv_lib_bind_inet_ntoa = yes; then LIBS="$LIBS -lbind -lsocket" fi ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD="cc -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE_EXTENDED 1 _ACEOF # Needed by Tcl, but not most extensions #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) #LIBS="$LIBS -lxnet" # Use the XOPEN network library if test "`uname -m`" = "ia64" ; then SHLIB_SUFFIX=".so" else SHLIB_SUFFIX=".sl" fi echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = "yes" ; then SHLIB_LD="gcc -shared" SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then hpux_arch=`${CC} -dumpmachine` case $hpux_arch in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD="${CC} -shared" SHLIB_LD_LIBS='${LIBS}' CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} ;; esac else do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS_ARCH="+DD64" fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS_ARCH="-64" fi fi ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi if test $do64bit = yes; then echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 if test "${tcl_cv_cc_m64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_cc_m64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_cc_m64=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 echo "${ECHO_T}$tcl_cv_cc_m64" >&6 if test $tcl_cv_cc_m64 = yes; then CFLAGS="$CFLAGS -m64" do64bit_ok=yes fi fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The # -fno-builtin flag should address this problem # but it does not work. The -fno-inline flag # is kind of overkill but it works. # Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x ; then CFLAGS="$CFLAGS -fno-inline" fi ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" SHLIB_LD="${CC} -shared" DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 SHLIB_LD="${CC} -shared " DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,-Bexport" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[1-2].*) # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6 if test "${tcl_cv_ld_elf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then tcl_cv_ld_elf=yes else tcl_cv_ld_elf=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 echo "${ECHO_T}$tcl_cv_ld_elf" >&6 if test $tcl_cv_ld_elf = yes; then SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' else SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' fi # Ancient FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. case `machine` in sparc|sparc64) SHLIB_CFLAGS="-fPIC";; *) SHLIB_CFLAGS="-fpic";; esac SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6 if test "${tcl_cv_ld_elf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then tcl_cv_ld_elf=yes else tcl_cv_ld_elf=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 echo "${ECHO_T}$tcl_cv_ld_elf" >&6 if test $tcl_cv_ld_elf = yes; then LDFLAGS=-Wl,-export-dynamic else LDFLAGS="" fi # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; FreeBSD-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "${TCL_THREADS}" = "1" ; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Darwin-*) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" # To avoid discrepancies between what headers configure sees during # preprocessing tests and compiling tests, move any -isysroot and # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" if test $do64bit = yes; then case `arch` in ppc) echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6 if test "${tcl_cv_cc_arch_ppc64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_cc_arch_ppc64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_cc_arch_ppc64=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6 if test $tcl_cv_cc_arch_ppc64 = yes; then CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes fi;; i386) echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6 if test "${tcl_cv_cc_arch_x86_64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_cc_arch_x86_64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_cc_arch_x86_64=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 if test $tcl_cv_cc_arch_x86_64 = yes; then CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes fi;; *) { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; esac else # Check for combined 32-bit and 64-bit fat build echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ fat_32_64=yes fi # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 if test "${tcl_cv_ld_single_module+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_single_module=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_single_module=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 if test $tcl_cv_ld_single_module = yes; then SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" # Don't use -prebind when building for Mac OS X 10.4 or later only: test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4 && \ LDFLAGS="$LDFLAGS -prebind" LDFLAGS="$LDFLAGS -headerpad_max_install_names" echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 if test "${tcl_cv_ld_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_search_paths_first=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_search_paths_first=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 if test $tcl_cv_ld_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" # TEA specific: for Tk extensions, remove 64-bit arch flags from # CFLAGS et al. for combined 32 & 64 bit fat builds as neither # TkAqua nor TkX11 can be built for 64-bit at present. test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD="cc -nostdlib -r" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy cat >>confdefs.h <<\_ACEOF #define _OE_SOCKETS 1 _ACEOF ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export :' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD='ld -shared -expect_unresolved "*"' else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = "1" ; then CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = "yes" ; then LIBS="$LIBS -lpthread -lmach -lexc" else CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[0-6]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF SHLIB_CFLAGS="-KPIC" # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_LD="$CC -shared" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" SHLIB_CFLAGS="-fPIC" fi else do64bit_ok=yes if test "$do64bitVIS" = "yes" ; then CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" else CFLAGS="$CFLAGS -xarch=v9" LDFLAGS_ARCH="-xarch=v9" fi # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi elif test "$arch" = "amd64 i386" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64" fi else { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_LD="$CC -shared" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "$do64bit_ok" = "yes" ; then # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" fi else SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 if test "${tcl_cv_ld_Bexport+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_Bexport=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_Bexport=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 if test $tcl_cv_ld_Bexport = yes; then LDFLAGS="$LDFLAGS -Wl,-Bexport" fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi # Step 4: disable dynamic loading if requested via a command-line switch. # Check whether --enable-load or --disable-load was given. if test "${enable_load+set}" = set; then enableval="$enable_load" tcl_ok=$enableval else tcl_ok=yes fi; if test "$tcl_ok" = "no"; then DL_OBJS="" fi if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" echo "on this system." SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then if test "$GCC" = "yes" ; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*) ;; Darwin-*) ;; SCO_SV-3.2*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary echo "$as_me:$LINENO: checking for required early compiler flags" >&5 echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 tcl_flags="" if test "${tcl_cv_flag__isoc99_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__isoc99_source=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _ISOC99_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _ISOC99_SOURCE" fi if test "${tcl_cv_flag__largefile64_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile64_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile64_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__largefile64_source=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi if test "${tcl_cv_flag__largefile_source64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *)open64; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile_source64=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE_SOURCE64 1 #include int main () { char *p = (char *)open64; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile_source64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__largefile_source64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _LARGEFILE_SOURCE64 1 _ACEOF tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" fi if test "x${tcl_flags}" = "x" ; then echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 else echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 echo "${ECHO_T}${tcl_flags}" >&6 fi echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 if test "${tcl_cv_type_64bit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { __int64 value = (__int64) 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_type_64bit=__int64 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_type_64bit="long long" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { switch (0) { case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; } ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_type_64bit=${tcl_type_64bit} else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then cat >>confdefs.h <<\_ACEOF #define TCL_WIDE_INT_IS_LONG 1 _ACEOF echo "$as_me:$LINENO: result: using long" >&5 echo "${ECHO_T}using long" >&6 elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # We actually want to use the default tcl.h checks in this # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 echo "${ECHO_T}using Tcl header defaults" >&6 else cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 # Now check for auxiliary declarations echo "$as_me:$LINENO: checking for struct dirent64" >&5 echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 if test "${tcl_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct dirent64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_struct_dirent64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_dirent64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6 if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_DIRENT64 1 _ACEOF fi echo "$as_me:$LINENO: checking for struct stat64" >&5 echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 if test "${tcl_cv_struct_stat64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_struct_stat64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_stat64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 echo "${ECHO_T}$tcl_cv_struct_stat64" >&6 if test "x${tcl_cv_struct_stat64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_STAT64 1 _ACEOF fi for ac_func in open64 lseek64 do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for off64_t" >&5 echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 if test "${tcl_cv_type_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { off64_t offset; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_type_off64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_type_off64_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_TYPE_OFF64_T 1 _ACEOF echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi TDOM_LD_SEARCH_FLAGS=${LD_SEARCH_FLAGS} #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for build with symbols" >&5 echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" tcl_ok=$enableval else tcl_ok=no fi; DBGX="" if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 echo "${ECHO_T}yes (standard debugging)" >&6 fi fi if test "${TEA_PLATFORM}" != "windows" ; then LDFLAGS_DEFAULT="${LDFLAGS}" fi if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then cat >>confdefs.h <<\_ACEOF #define TCL_MEM_DEBUG 1 _ACEOF fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 echo "${ECHO_T}enabled symbols mem debugging" >&6 else echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 echo "${ECHO_T}enabled $tcl_ok debugging" >&6 fi fi #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- cat >>confdefs.h <<\_ACEOF #define USE_TCL_STUBS 1 _ACEOF #AC_DEFINE(USE_TK_STUBS) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure any variables in the suffix is # substituted. (@@@ Might not be necessary anymore) #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" fi eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" if test "$GCC" = "yes"; then PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} fi # These aren't needed on Windows (either MSVC or gcc) RANLIB=: RANLIB_STUB=: else RANLIB_STUB="${RANLIB}" if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" fi eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" fi # These are escaped so that only CFLAGS is picked up at configure time. # The other values will be substituted at make time. CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" if test "${SHARED_BUILD}" = "1" ; then CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" fi #-------------------------------------------------------------------- # Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl # file during the install process. Don't run the TCLSH_PROG through # ${CYGPATH} because it's being used directly by make. # Require that we use a tclsh shell version 8.2 or later since earlier # versions have bugs in the pkg_mkIndex routine. # Add WISH as well if this is a Tk extension. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for tclsh" >&5 echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="${TCL_BIN_DIR}/tclsh" fi else # tclConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" fi list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" for i in $list ; do if test -f "$i/${TCLSH_PROG}" ; then REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" break fi done TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" fi echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 echo "${ECHO_T}${TCLSH_PROG}" >&6 #TEA_PROG_WISH #-------------------------------------------------------------------- # Add some private preprocessor options #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether to enable dtd support" >&5 echo $ECHO_N "checking whether to enable dtd support... $ECHO_C" >&6 # Check whether --enable-dtd or --disable-dtd was given. if test "${enable_dtd+set}" = set; then enableval="$enable_dtd" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_dtd+set}" = set; then enableval="$enable_dtd" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define XML_DTD 1 _ACEOF else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi echo "$as_me:$LINENO: checking whether to enable namespace support" >&5 echo $ECHO_N "checking whether to enable namespace support... $ECHO_C" >&6 # Check whether --enable-ns or --disable-ns was given. if test "${enable_ns+set}" = set; then enableval="$enable_ns" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_ns+set}" = set; then enableval="$enable_ns" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define XML_NS 1 _ACEOF else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi echo "$as_me:$LINENO: checking whether to enable built-in unknown command" >&5 echo $ECHO_N "checking whether to enable built-in unknown command... $ECHO_C" >&6 # Check whether --enable-ucmd or --disable-ucmd was given. if test "${enable_ucmd+set}" = set; then enableval="$enable_ucmd" tcl_ok=$enableval else tcl_ok=no fi; if test "${enable_unknown+set}" = set; then enableval="$enable_unknown" tcl_ok=$enableval else tcl_ok=no fi if test "$tcl_ok" = "no" ; then echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 cat >>confdefs.h <<\_ACEOF #define TDOM_NO_UNKNOWN_CMD 1 _ACEOF else echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 fi echo "$as_me:$LINENO: checking whether to enable tDOMs block allocator" >&5 echo $ECHO_N "checking whether to enable tDOMs block allocator... $ECHO_C" >&6 # Check whether --enable-tdomalloc or --disable-tdomalloc was given. if test "${enable_tdomalloc+set}" = set; then enableval="$enable_tdomalloc" tcl_ok=$enableval else tcl_ok=no fi; if test "${enable_tdomalloc+set}" = set; then enableval="$enable_tdomalloc" tcl_ok=$enableval else tcl_ok=no fi if test "$tcl_ok" = "yes" ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 vars="generic/domalloc.c" for i in $vars; do case $i in \$*) # allow $-var names PKG_SOURCES="$PKG_SOURCES $i" PKG_OBJECTS="$PKG_OBJECTS $i" ;; *) # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 echo "$as_me: error: could not find source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_OBJECTS="$PKG_OBJECTS $j" ;; esac done else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 cat >>confdefs.h <<\_ACEOF #define USE_NORMAL_ALLOCATOR 1 _ACEOF fi TDOMSHELL=tcldomsh #-------------------------------------------------------------------- # These are for ${PACKAGE_NAME}Config.sh #-------------------------------------------------------------------- # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib) eval pkglibdir="${libdir}/${PACKAGE_NAME}${PACKAGE_VERSION}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval PKG_STUB_LIB_FLAG="-l${PACKAGE_NAME}stub${PACKAGE_VERSION}" else eval PKG_STUB_LIB_FLAG="-l${PACKAGE_NAME}stub`echo ${PACKAGE_VERSION} | tr -d .`" fi PKG_BUILD_STUB_LIB_SPEC="-L`pwd` ${PKG_STUB_LIB_FLAG}" PKG_STUB_LIB_SPEC="-L${pkglibdir} ${PKG_STUB_LIB_FLAG}" PKG_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}" PKG_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}" #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- ac_config_files="$ac_config_files Makefile tdomConfig.sh" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by tdom $as_me 0.8.3, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ tdom config.status 0.8.3 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "tdomConfig.sh" ) CONFIG_FILES="$CONFIG_FILES tdomConfig.sh" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CYGPATH@,$CYGPATH,;t t s,@EXEEXT@,$EXEEXT,;t t s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t s,@PKG_HEADERS@,$PKG_HEADERS,;t t s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t s,@PKG_LIBS@,$PKG_LIBS,;t t s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t s,@TCL_VERSION@,$TCL_VERSION,;t t s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t s,@TCL_LIBS@,$TCL_LIBS,;t t s,@TCL_DEFS@,$TCL_DEFS,;t t s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@EGREP@,$EGREP,;t t s,@MATH_LIBS@,$MATH_LIBS,;t t s,@PKG_SOURCES@,$PKG_SOURCES,;t t s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t s,@CLEANFILES@,$CLEANFILES,;t t s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t s,@TCL_THREADS@,$TCL_THREADS,;t t s,@SHARED_BUILD@,$SHARED_BUILD,;t t s,@AR@,$AR,;t t s,@CELIB_DIR@,$CELIB_DIR,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@DL_LIBS@,$DL_LIBS,;t t s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t s,@STLIB_LD@,$STLIB_LD,;t t s,@SHLIB_LD@,$SHLIB_LD,;t t s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t s,@TDOM_LD_SEARCH_FLAGS@,$TDOM_LD_SEARCH_FLAGS,;t t s,@TCL_DBGX@,$TCL_DBGX,;t t s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t s,@MAKE_LIB@,$MAKE_LIB,;t t s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t s,@RANLIB_STUB@,$RANLIB_STUB,;t t s,@TCLSH_PROG@,$TCLSH_PROG,;t t s,@TDOMSHELL@,$TDOMSHELL,;t t s,@PKG_BUILD_STUB_LIB_SPEC@,$PKG_BUILD_STUB_LIB_SPEC,;t t s,@PKG_STUB_LIB_SPEC@,$PKG_STUB_LIB_SPEC,;t t s,@PKG_BUILD_STUB_LIB_PATH@,$PKG_BUILD_STUB_LIB_PATH,;t t s,@PKG_STUB_LIB_PATH@,$PKG_STUB_LIB_PATH,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi tDOM-0.8.3/apps/0000755000175000017500000000000011004674365013530 5ustar ssobernissobernitDOM-0.8.3/apps/CVS/0000755000175000017500000000000011004674365014163 5ustar ssobernissobernitDOM-0.8.3/apps/CVS/Root0000644000175000017500000000006211004674365015027 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/apps/CVS/Entries0000644000175000017500000000005411004674365015516 0ustar ssobernissoberni/xslt.tcl/1.13/Mon Apr 11 01:43:54 2005// D tDOM-0.8.3/apps/CVS/Repository0000644000175000017500000000001211004674365016256 0ustar ssobernissobernitdom/apps tDOM-0.8.3/apps/xslt.tcl0000644000175000017500000000711510226353132015221 0ustar ssobernissoberni#---------------------------------------------------------------------------- # Copyright (c) 1999-2001 Jochen Loewer (loewerj@hotmail.com) #---------------------------------------------------------------------------- # # $Id: xslt.tcl,v 1.13 2005/04/11 01:43:54 rolf Exp $ # # # A simple command line XSLT processor using tDOMs XSLT engine. # # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://www.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the # License for the specific language governing rights and limitations # under the License. # # The Original Code is tDOM. # # The Initial Developer of the Original Code is Jochen Loewer # Portions created by Jochen Loewer are Copyright (C) 1998, 1999 # Jochen Loewer. All Rights Reserved. # # Contributor(s): # # # # written by Rolf Ade # August, 2001 # #---------------------------------------------------------------------------- package require tdom 0.8.1 # The following is not needed, given, that tDOM is correctly # installed. This code only ensures, that the tDOM script library gets # sourced, if the script is called with a tcldomsh out of the build # dir of a complete tDOM source installation. if {[lsearch [namespace children] ::tDOM] == -1} { # tcldomsh without the script library. Source the lib. source [file join [file dir [info script]] ../lib tdom.tcl] } # Import the tDOM helper procs namespace import tDOM::* # Argument check if {[llength $argv] != 2 && [llength $argv] != 3} { puts stderr "usage: $argv0 \ ?output_method (asHTML|asXML|asText)?" exit 1 } foreach { xmlFile xsltFile outputOpt } $argv break # This is the callback proc for xslt:message elements. This proc is # called once every time an xslt:message element is encountered during # processing the stylesheet. The callback proc simply sends the text # message to stderr. proc xsltmsgcmd {msg terminate} { puts stderr "xslt message: $msg" } #set ::tDOM::extRefHandlerDebug 1 set xmldoc [dom parse -baseurl [baseURL $xmlFile] \ -externalentitycommand extRefHandler \ -keepEmpties \ [xmlReadFile $xmlFile] ] dom setStoreLineColumn 1 set xsltdoc [dom parse -baseurl [baseURL $xsltFile] \ -externalentitycommand extRefHandler \ -keepEmpties \ [xmlReadFile $xsltFile] ] dom setStoreLineColumn 0 if {[catch {$xmldoc xslt -xsltmessagecmd xsltmsgcmd $xsltdoc resultDoc} \ errMsg]} { puts stderr $errMsg exit 1 } if {$outputOpt == ""} { set outputOpt [$resultDoc getDefaultOutputMethod] } set doctypeDeclaration 0 if {[$resultDoc systemId] != ""} { set doctypeDeclaration 1 } switch $outputOpt { asXML - xml { if {[$resultDoc indent]} { set indent 4 } else { set indent no } puts [$resultDoc asXML -indent $indent -escapeNonASCII \ -doctypeDeclaration $doctypeDeclaration] } asHTML - html { puts [$resultDoc asHTML -escapeNonASCII -htmlEntities \ -doctypeDeclaration $doctypeDeclaration] } asText - text { puts [$resultDoc asText] } default { puts stderr "Unknown output method '$outputOpt'!" exit 1 } } tDOM-0.8.3/Makefile.in0000644000175000017500000004073110572133271014632 0ustar ssobernissoberni# Makefile.in -- # # This file is a Makefile for Sample TEA Extension. If it has the name # "Makefile.in" then it is a template for a Makefile; to generate the # actual Makefile, run "./configure", which is a configuration script # generated by the "autoconf" program (constructs like "@foo@" will get # replaced in the actual Makefile. # # Copyright (c) 1999 Scriptics Corporation. # Copyright (c) 2002-2005 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: Makefile.in,v 1.25 2007/03/02 23:43:53 rolf Exp $ #======================================================================== # Add additional lines to handle any additional AC_SUBST cases that # have been added in a customized configure script. #======================================================================== AOL_DIR = @AOL_DIR@ TDOMSHELL = @TDOMSHELL@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ LIB_RUNTIME_DIR = $(libdir) TDOM_LD_SEARCH_FLAGS = @TDOM_LD_SEARCH_FLAGS@ #======================================================================== # This are additional flags to be appended to the test suite run #======================================================================== TESTFLAGS = -constraints longRunning #======================================================================== # Nothing of the variables below this line should need to be changed. # Please check the TARGETS section below to make sure the make targets # are correct. #======================================================================== #======================================================================== # The names of the source files is defined in the configure script. # The object files are used for linking into the final library. # This will be used when a dist target is added to the Makefile. # It is not important to specify the directory, as long as it is the # $(srcdir) or in the generic, win or unix subdirectory. #======================================================================== PKG_SOURCES = @PKG_SOURCES@ PKG_OBJECTS = @PKG_OBJECTS@ PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ #======================================================================== # PKG_TCL_SOURCES identifies Tcl runtime files that are associated with # this package that need to be installed, if any. #======================================================================== PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ #======================================================================== # This is a list of public header files to be installed, if any. #======================================================================== PKG_HEADERS = @PKG_HEADERS@ #======================================================================== # "PKG_LIB_FILE" refers to the library (dynamic or static as per # configuration options) composed of the named objects. #======================================================================== PKG_LIB_FILE = @PKG_LIB_FILE@ PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ lib_BINARIES = $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE) BINARIES = $(lib_BINARIES) SHELL = @SHELL@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ datadir = @datadir@ mandir = @mandir@ includedir = @includedir@ DESTDIR = PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) pkgdatadir = $(datadir)/$(PKG_DIR) pkglibdir = $(libdir)/$(PKG_DIR) pkgincludedir = $(includedir)/$(PKG_DIR) top_builddir = . INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ CC = @CC@ CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ CFLAGS_WARNING = @CFLAGS_WARNING@ CLEANFILES = @CLEANFILES@ EXEEXT = @EXEEXT@ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ MAKE_LIB = @MAKE_LIB@ MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ MAKE_STUB_LIB = @MAKE_STUB_LIB@ OBJEXT = @OBJEXT@ RANLIB = @RANLIB@ RANLIB_STUB = @RANLIB_STUB@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ STLIB_LD = @STLIB_LD@ #TCL_DEFS = @TCL_DEFS@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_SRC_DIR = @TCL_SRC_DIR@ #TK_BIN_DIR = @TK_BIN_DIR@ #TK_SRC_DIR = @TK_SRC_DIR@ # Not used, but retained for reference of what libs Tcl required #TCL_LIBS = @TCL_LIBS@ #======================================================================== # TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our # package without installing. The other environment variables allow us # to test against an uninstalled Tcl. Add special env vars that you # require for testing here (like TCLX_LIBRARY). #======================================================================== EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) #EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR) TCLLIBPATH = $(top_builddir) TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ PATH="$(EXTRA_PATH):$(PATH)" \ TCLLIBPATH="$(TCLLIBPATH)" # TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` TCLSH_PROG = @TCLSH_PROG@ TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) #WISH_PROG = @WISH_PROG@ #WISH = $(TCLSH_ENV) $(WISH_PROG) SHARED_BUILD = @SHARED_BUILD@ INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ #INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ PKG_CFLAGS = @PKG_CFLAGS@ # TCL_DEFS is not strictly need here, but if you remove it, then you # must make sure that configure.in checks for the necessary components # that your library may use. TCL_DEFS can actually be a problem if # you do not compile with a similar machine setup as the Tcl core was # compiled with. #DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) DEFS = @DEFS@ $(PKG_CFLAGS) CONFIG_CLEAN_FILES = Makefile tdomConfig.sh tdom.tcl CPPFLAGS = @CPPFLAGS@ LIBS = @PKG_LIBS@ @LIBS@ AR = @AR@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) #======================================================================== # Start of user-definable TARGETS section #======================================================================== #======================================================================== # TEA TARGETS. Please note that the "libraries:" target refers to platform # independent files, and the "binaries:" target inclues executable programs and # platform-dependent libraries. Modify these targets so that they install # the various pieces of your package. The make and install rules # for the BINARIES that you specified above have already been done. #======================================================================== all: binaries libraries doc #======================================================================== # TDOM enabled shell is build as an extra directive, since non TEA. #======================================================================== $(TDOMSHELL): $(PKG_OBJECTS) $(COMPILE) -c `@CYGPATH@ $(srcdir)/unix/tclAppInit.c` $(CC) @LDFLAGS@ -o $@ tclAppInit.$(OBJEXT) $(PKG_OBJECTS) \ $(TCL_LIBS) $(TCL_LIB_SPEC) $(LIBS) $(TDOM_LD_SEARCH_FLAGS) #======================================================================== # The binaries target builds executable programs, Windows .dll's, unix # shared/static libraries, and any other platform-dependent files. # The list of targets to build for "binaries:" is specified at the top # of the Makefile, in the "BINARIES" variable. #======================================================================== binaries: $(BINARIES) pkgIndex.tcl-hand libraries: #======================================================================== # Your doc target should differentiate from doc builds (by the developer) # and doc installs (see install-doc), which just install the docs on the # end user machine when building from source. #======================================================================== doc: install: all install-binaries install-libraries install-doc install-binaries: binaries install-lib-binaries install-bin-binaries #======================================================================== # This rule installs platform-independent files, such as header files. # The list=...; for p in $$list handles the empty list case x-platform. #======================================================================== install-libraries: libraries @mkdir -p $(DESTDIR)$(includedir) @echo "Installing header files in $(DESTDIR)$(includedir)" @list='$(PKG_HEADERS)'; for i in $$list; do \ echo "Installing $(srcdir)/$$i" ; \ $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ done; #======================================================================== # Install documentation. Unix manpages should go in the $(mandir) # directory. #======================================================================== install-doc: doc @mkdir -p $(DESTDIR)$(mandir)/mann @echo "Installing documentation in $(DESTDIR)$(mandir)" @list='$(srcdir)/doc/*.n'; for i in $$list; do \ echo "Installing $$i"; \ rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ done test: binaries libraries @cp $(srcdir)/lib/tdom.tcl . $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) shell: binaries libraries @$(TCLSH) $(SCRIPT) gdb: $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) depend: #======================================================================== # $(PKG_LIB_FILE) should be listed as part of the BINARIES variable # mentioned above. That will ensure that this target is built when you # run "make binaries". # # The $(PKG_OBJECTS) objects are created and linked into the final # library. In most cases these object files will correspond to the # source files above. #======================================================================== $(PKG_LIB_FILE): $(PKG_OBJECTS) -rm -f $(PKG_LIB_FILE) ${MAKE_LIB} $(RANLIB) $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) -rm -f $(PKG_STUB_LIB_FILE) ${MAKE_STUB_LIB} $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) #======================================================================== # We need to enumerate the list of .c to .o lines here. # # In the following lines, $(srcdir) refers to the toplevel directory # containing your extension. If your sources are in a subdirectory, # you will have to modify the paths to reflect this: # # sample.$(OBJEXT): $(srcdir)/generic/sample.c # $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@ # # Setting the VPATH variable to a list of paths will cause the makefile # to look into these paths when resolving .c to .obj dependencies. # As necessary, add $(srcdir):$(srcdir)/compat:.... #======================================================================== VPATH = $(srcdir):$(srcdir)/expat:$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win .c.@OBJEXT@: $(COMPILE) -c `@CYGPATH@ $<` -o $@ #======================================================================== # Create the pkgIndex.tcl file. #======================================================================== pkgIndex.tcl-hand: @(echo 'package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION)\ "load [list [file join $$dir $(PKG_LIB_FILE)]];\ source [list [file join $$dir tdom.tcl]]"'\ ) > pkgIndex.tcl #======================================================================== # Distribution creation # You may need to tweak this target to make it work correctly. #======================================================================== #COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) DIST_ROOT = /tmp/dist DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) dist-clean: rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* dist: dist-clean mkdir -p $(DIST_DIR) cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ $(DIST_DIR)/ chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in for i in $(srcdir)/*.[ch]; do \ if [ -f $$i ]; then \ cp -p $$i $(DIST_DIR)/ ; \ fi; \ done; mkdir $(DIST_DIR)/tclconfig cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ $(DIST_DIR)/tclconfig/ chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 chmod +x $(DIST_DIR)/tclconfig/install-sh list='demos doc generic library mac tests unix win'; \ for p in $$list; do \ if test -d $(srcdir)/$$p ; then \ mkdir $(DIST_DIR)/$$p; \ cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ fi; \ done (cd $(DIST_ROOT); $(COMPRESS);) #======================================================================== # End of user-definable section #======================================================================== #======================================================================== # Don't modify the file to clean here. Instead, set the "CLEANFILES" # variable in configure.in #======================================================================== clean: -test -z "$(BINARIES)" || rm -f $(BINARIES) -rm -f *.$(OBJEXT) core *.core -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean: clean -rm -f *.tab.c -rm -f $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log config.status #======================================================================== # Install binary object libraries. On Windows this includes both .dll and # .lib files. Because the .lib files are not explicitly listed anywhere, # we need to deduce their existence from the .dll file of the same name. # Library files go into the lib directory. # In addition, this will generate the pkgIndex.tcl # file in the install location (assuming it can find a usable tclsh shell) # # You should not have to modify this target. #======================================================================== install-lib-binaries: binaries @mkdir -p $(DESTDIR)$(pkglibdir) @list='$(lib_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ if test "x$$stub" = "xstub"; then \ echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ else \ echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ fi; \ ext=`echo $$p|sed -e "s/.*\.//"`; \ if test "x$$ext" = "xdll"; then \ lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ if test -f $$lib; then \ echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \ $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \ fi; \ fi; \ fi; \ done @list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ destp=`basename $$p`; \ echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \ fi; \ done @if test "x$(SHARED_BUILD)" = "x1"; then \ echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ fi $(INSTALL_DATA) tdomConfig.sh $(DESTDIR)$(libdir) #======================================================================== # Install binary executables (e.g. .exe files and dependent .dll files) # This is for files that must go in the bin directory (located next to # wish and tclsh), like dependent .dll files on Windows. # # You should not have to modify this target, except to define bin_BINARIES # above if necessary. #======================================================================== install-bin-binaries: binaries @mkdir -p $(DESTDIR)$(bindir) @list='$(bin_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ fi; \ done .SUFFIXES: .c .$(OBJEXT) Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status uninstall-binaries: list='$(lib_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ p=`basename $$p`; \ rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done list='$(bin_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/$$p; \ done .PHONY: all binaries clean depend distclean doc install libraries test # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: tDOM-0.8.3/CVS/0000755000175000017500000000000011004674365013220 5ustar ssobernissobernitDOM-0.8.3/CVS/Root0000644000175000017500000000006211004674364014063 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/CVS/Entries.Log0000644000175000017500000000033411004674376015276 0ustar ssobernissoberniA D/apps//// A D/doc//// A D/encodings//// A D/expat//// A D/expat-1.95.1//// A D/extensions//// A D/generic//// A D/lib//// A D/mac//// A D/macosx//// A D/tclconfig//// A D/tests//// A D/unix//// A D/win//// A D/xe//// tDOM-0.8.3/CVS/Entries0000644000175000017500000000110311004674365014547 0ustar ssobernissoberni/CHANGES/1.31/Wed Aug 15 21:06:43 2007// /ChangeLog/1.293/Tue Mar 4 21:04:00 2008// /LICENSE/1.1/Fri Aug 2 21:19:59 2002// /Makefile.in/1.25/Fri Mar 2 23:43:53 2007// /NPL-1_1Final.html/1.1/Fri Aug 2 21:20:47 2002// /README/1.15/Wed Aug 15 20:53:09 2007// /README.AOL/1.10/Wed Aug 15 20:53:33 2007// /aclocal.m4/1.3/Mon Sep 12 22:07:58 2005// /configure/1.30/Wed Aug 15 21:40:11 2007// /configure-tcl8.0.5/1.8/Wed Aug 15 20:55:08 2007// /configure.in/1.26/Wed Aug 15 21:40:12 2007// /tdom.m4/1.11/Mon Sep 24 23:31:07 2007// /tdomConfig.sh.in/1.3/Mon Sep 12 22:07:58 2005// D tDOM-0.8.3/CVS/Repository0000644000175000017500000000000511004674364015314 0ustar ssobernissobernitdom tDOM-0.8.3/doc/0000755000175000017500000000000011004674366013333 5ustar ssobernissobernitDOM-0.8.3/doc/expat.n0000644000175000017500000005627210156370675014652 0ustar ssobernissoberni'\" '\" Generated from expat.xml '\" '\" BEGIN man.macros .if t .wh -1.3i ^B .nr ^l \n(.l .ad b .de AP .ie !"\\$4"" .TP \\$4 .el \{\ . ie !"\\$2"" .TP \\n()Cu . el .TP 15 .\} .ta \\n()Au \\n()Bu .ie !"\\$3"" \{\ \&\\$1 \\fI\\$2\\fP (\\$3) .\".b .\} .el \{\ .br .ie !"\\$2"" \{\ \&\\$1 \\fI\\$2\\fP .\} .el \{\ \&\\fI\\$1\\fP .\} .\} .. .de AS .nr )A 10n .if !"\\$1"" .nr )A \\w'\\$1'u+3n .nr )B \\n()Au+15n .\" .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n .nr )C \\n()Bu+\\w'(in/out)'u+2n .. .AS Tcl_Interp Tcl_CreateInterp in/out .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. .de BE .nf .ti 0 .mk ^t .ie n \l'\\n(^lu\(ul' .el \{\ .\" Draw four-sided box normally, but don't draw top of .\" box if the box started on an earlier page. .ie !\\n(^b-1 \{\ \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .el \}\ \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .\} .fi .br .nr ^b 0 .. .de VS .if !"\\$2"" .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. .de VE .ie n 'mc .el \{\ .ev 2 .nf .ti 0 .mk ^t \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' .sp -1 .fi .ev .\} .nr ^v 0 .. .de ^B .ev 2 'ti 0 'nf .mk ^t .if \\n(^b \{\ .\" Draw three-sided box if this is the box's first page, .\" draw two sides but no top otherwise. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .\} .if \\n(^v \{\ .nr ^x \\n(^tu+1v-\\n(^Yu \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c .\} .bp 'fi .ev .if \\n(^b \{\ .mk ^y .nr ^b 2 .\} .if \\n(^v \{\ .mk ^Y .\} .. .de DS .RS .nf .sp .. .de DE .fi .RE .sp .. .de SO .SH "STANDARD OPTIONS" .LP .nf .ta 5.5c 11c .ft B .. .de SE .fi .ft R .LP See the \\fBoptions\\fR manual entry for details on the standard options. .. .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. .de CS .RS .nf .ta .25i .5i .75i 1i .if t .ft C .. .de CE .fi .if t .ft R .RE .. .de UL \\$1\l'|0\(ul'\\$2 .. '\" END man.macros .TH expat n "" Tcl "" .BS .SH NAME expat \- Creates an instance of an expat parser object .SH SYNOPSIS .nf \&\fBpackage require tdom\fP \&\fBexpat\fP ?\fIparsername\fR? ?\fI-namespace\fR? ?\fIarg arg ..\fR \&\fBxml::parser\fP ?\fIparsername\fR? ?\fI-namespace\fR? ?\fIarg arg ..\fR .fi .BE .SH DESCRIPTION .PP The parser created with \fIexpat\fR or \fIxml::parser\fR (which is just another name for the same command in an own namespace) are able to parse any kind of well-formed XML. The parsers are stream oriented XML parser. This means that you register handler scripts with the parser prior to starting the parse. These handler scripts are called when the parser discovers the associated structures in the document being parsed. A start tag is an example of the kind of structures for which you may register a handler script. .PP The parsers do not validate the XML document. They do parse the internal DTD and, at request, external DTD and external entities, if you resolve the identifier of the external entities with the -externalentitycommand script (see there). .PP Additionly, the Tcl extension code that implements this command provides an API for adding C level coded handlers. Up to now, there exists the parser extension command "tdom". The handler set installed by this extension build an in memory "tDOM" DOM tree, while the parser is parsing the input. .PP It is possible to register an arbitrary amount of different handler scripts and C level handlers for most of the events. If the event occurs, they are called in turn. .SH "COMMAND OPTIONS" .IP "\fB-namespace\fR" .RS .PP Enables namespace parsing. You must use this option while creating the parser with the \fBexpat\fR or \fBxml::parser\fR command. You can't enable (nor disable) namespace parsing with \&\fB configure ...\fR. .RE .IP "\fB-final \fIboolean\fP\fR" .RS .PP This option indicates whether the document data next presented to the parse method is the final part of the document. A value of "0" indicates that more data is expected. A value of "1" indicates that no more is expected. The default value is "1". .PP If this option is set to "0" then the parser will not report certain errors if the XML data is not well-formed upon end of input, such as unclosed or unbalanced start or end tags. Instead some data may be saved by the parser until the next call to the parse method, thus delaying the reporting of some of the data. .PP If this option is set to "1" then documents which are not well-formed upon end of input will generate an error. .RE .IP "\fB-baseurl \fIurl\fP\fR" .RS .PP Reports the base url of the document to the parser. .RE .IP "\fB-elementstartcommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with the start tag of an element. The actual command consists of this option followed by at least two arguments: the element type name and the attribute list. .PP The attribute list is a Tcl list consisting of name/value pairs, suitable for passing to the array set Tcl command. .PP Example: .CS proc HandleStart {name attlist} { puts stderr "Element start ==> $name has attributes $attlist" } $parser configure -elementstartcommand HandleStart $parser parse {} .CE .PP This would result in the following command being invoked: .CS HandleStart text {id 123} .CE .RE .IP "\fB-elementendcommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with the end tag of an element. The actual command consists of this option followed by at least one argument: the element type name. In addition, if the -reportempty option is set then the command may be invoked with the -empty configuration option to indicate whether it is an empty element. See the description of the -reportempty option for an example. .PP Example: .CS proc HandleEnd {name} { puts stderr "Element end ==> $name" } $parser configure -elementendcommand HandleEnd $parser parse {} .CE .PP This would result in the following command being invoked: .CS HandleEnd test .CE .RE .IP "\fB-characterdatacommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with character data in the document, ie. text. The actual command consists of this option followed by one argument: the text. .PP It is not guaranteed that character data will be passed to the application in a single call to this command. That is, the application should be prepared to receive multiple invocations of this callback with no intervening callbacks from other features. .PP Example: .CS proc HandleText {data} { puts stderr "Character data ==> $data" } $parser configure -characterdatacommand HandleText $parser parse {this is a test document} .CE .PP This would result in the following command being invoked: .CS HandleText {this is a test document} .CE .RE .IP "\fB-processinginstructioncommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with processing instructions in the document. The actual command consists of this option followed by two arguments: the PI target and the PI data. .PP Example: .CS proc HandlePI {target data} { puts stderr "Processing instruction ==> $target $data" } $parser configure -processinginstructioncommand HandlePI $parser parse {} .CE .PP This would result in the following command being invoked: .CS HandlePI special {this is a processing instruction} .CE .RE .IP "\fB -notationdeclcommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with notation declaration in the document. The actual command consists of this option followed by four arguments: the notation name, the base uri of the document (this means, whatever was set by the -baseurl option), the system identifier and the public identifier. The notation name is never empty, the other arguments may be. .RE .IP "\fB -externalentitycommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with references to external entities in the document. The actual command consists of this option followed by three arguments: the base uri, the system identifier of the entity and the public identifier of the entity. The base uri and the public identifier may be the empty list. .PP This handler script has to return a tcl list consisting of three elements. The first element of this list signals, how the external entity is returned to the processor. At the moment, the three allowed types are "string", "channel" and "filename". The second element of the list has to be the (absolute) base URI of the external entity to be parsed. The third element of the list are data, either the already read data out of the external entity as string in the case of type "string", or the name of a tcl channel, in the case of type "channel", or the path to the external entity to be read in case of type "filename". Behind the scene, the external entity referenced by the returned Tcl channel, string or file name will be parsed with an expat external entity parser with the same handler sets as the main parser. If parsing of the external entity fails, the whole parsing is stopped with an error message. If a Tcl command registered as externalentitycommand isn't able to resolve an external entity it is allowed to return TCL_CONTINUE. In this case, the wrapper give the next registered externalentitycommand a try. If no externalentitycommand is able to handle the external entity parsing stops with an error. .PP Example: .CS proc externalEntityRefHandler {base systemId publicId} { if {![regexp {^[a-zA-Z]+:/} $systemId]} { regsub {^[a-zA-Z]+:} $base {} base set basedir [file dirname $base] set systemId "[set basedir]/[set systemId]" } else { regsub {^[a-zA-Z]+:} $systemId systemId } if {[catch {set fd [open $systemId]}]} { return -code error \e -errorinfo "Failed to open external entity $systemId" } return [list channel $systemId $fd] } set parser [expat -externalentitycommand externalEntityRefHandler \e -baseurl "file:///local/doc/doc.xml" \e -paramentityparsing notstandalone] $parser parse { } .CE .PP This would result in the following command being invoked: .CS externalEntityRefHandler file:///local/doc/doc.xml test.dtd {} .CE .PP External entities are only tried to resolve via this handler script, if necessary. This means, external parameter entities triggers this handler only, if -paramentityparsing is used with argument "always" or if -paramentityparsing is used with argument "notstandalone" and the document isn't marked as standalone. .RE .IP "\fB -unknownencodingcommand \fIscript\fP\fR" .RS .PP Not implemented at Tcl level. .RE .IP "\fB-startnamespacedeclcommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with start scope of namespace declarations in the document. The actual command consists of this option followed by two arguments: the namespace prefix and the namespace URI. For an xmlns attribute, prefix will be the empty list. For an xmlns="" attribute, uri will be the empty list. The call to the start and end element handlers occur between the calls to the start and end namespace declaration handlers. .RE .IP "\fB -endnamespacedeclcommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with end scope of namespace declarations in the document. The actual command consists of this option followed by the namespace prefix as argument. In case of an xmlns attribute, prefix will be the empty list. The call to the start and end element handlers occur between the calls to the start and end namespace declaration handlers. .RE .IP "\fB -commentcommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with comments in the document. The actual command consists of this option followed by one argument: the comment data. .PP Example: .CS proc HandleComment {data} { puts stderr "Comment ==> $data" } $parser configure -commentcommand HandleComment $parser parse {} .CE .PP This would result in the following command being invoked: .CS HandleComment { this is a comment } .CE .RE .IP "\fB -notstandalonecommand \fIscript\fP\fR" .RS .PP This Tcl command is called, if the document is not standalone (it has an external subset or a reference to a parameter entity, but does not have standalone="yes"). It is called with no additional arguments. .RE .IP "\fB -startcdatasectioncommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with the start of a CDATA section. It is called with no additional arguments. .RE .IP "\fB -endcdatasectioncommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with the end of a CDATA section. It is called with no additional arguments. .RE .IP "\fB -elementdeclcommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with element declarations. The actual command consists of this option followed by two arguments: the name of the element and the content model. The content model arg is a tcl list of four elements. The first list element specifies the type of the XML element; the six different possible types are reported as "MIXED", "NAME", "EMPTY", "CHOICE", "SEQ" or "ANY". The second list element reports the quantifier to the content model in XML Syntax ("?", "*" or "+") or is the empty list. If the type is "MIXED", then the quantifier will be "{}", indicating an PCDATA only element, or "*", with the allowed elements to intermix with PCDATA as tcl list as the fourth argument. If the type is "NAME", the name is the third arg; otherwise the third argument is the empty list. If the type is "CHOICE" or "SEQ" the fourth argument will contain a list of content models build like this one. The "EMPTY", "ANY", and "MIXED" types will only occur at top level. .PP Examples: .CS proc elDeclHandler {name content} { puts "$name $content" } set parser [expat -elementdeclcommand elDeclHandler] $parser parse { ]> foo} .CE .PP This would result in the following command being invoked: .CS test {MIXED {} {} {}} $parser reset $parser parse { ]> } .CE .PP This would result in the following command being invoked: .CS elDeclHandler test {CHOICE {} {} {{NAME {} a {}} {NAME {} b {}}}} .CE .RE .IP "\fB -attlistdeclcommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with attlist declarations. The actual command consists of this option followed by five arguments. The Attlist declaration handler is called for *each* attribute. So a single Attlist declaration with multiple attributes declared will generate multiple calls to this handler. The arguments are the element name this attribute belongs to, the name of the attribute, the type of the attribute, the default value (may be the empty list) and a required flag. If this flag is true and the default value is not the empty list, then this is a "#FIXED" default. .PP Example: .CS proc attlistHandler {elname name type default isRequired} { puts "$elname $name $type $default $isRequired" } set parser [expat -attlistdeclcommand attlistHandler] $parser parse { ]> } .CE .PP This would result in the following commands being invoked: .CS attlistHandler test id ID {} 1 attlistHandler test name CDATA {} 0 .CE .RE .IP "\fB -startdoctypedeclcommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with the start of the DOCTYPE declaration. This command is called before any DTD or internal subset is parsed. The actual command consists of this option followed by four arguments: the doctype name, the system identifier, the public identifier and a boolean, that shows if the DOCTYPE has an internal subset. .RE .IP "\fB -enddoctypedeclcommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with the end of the DOCTYPE declaration. This command is called after processing any external subset. It is called with no additional arguments. .RE .IP "\fB -paramentityparsing \fInever|notstandalone|always\fP\fR" .RS .PP "never" disables expansion of parameter entities, "always" expands always and "notstandalone" only, if the document isn't "standalone='no'". The default ist "never" .RE .IP "\fB -entitydeclcommand \fIscript\fP\fR" .RS .PP Specifies a Tcl command to associate with any entity declaration. The actual command consists of this option followed by seven arguments: the entity name, a boolean identifying parameter entities, the value of the entity, the base uri, the system identifier, the public identifier and the notation name. According to the type of entity declaration some of this arguments may be the empty list. .RE .IP "\fB -ignorewhitecdata \fIboolean\fP\fR" .RS .PP If this flag is set, element content which contain only whitespaces isn't reported with the \&\fB-characterdatacommand\fR. .RE .IP "\fB -ignorewhitespace \fIboolean\fP\fR" Another name for \fI -ignorewhitecdata\fR; see there. .IP "\fB -handlerset \fIname\fP\fR" .RS .PP This option sets the Tcl handler set scope for the configure options. Any option value pair following this option in the same call to the parser are modifying the named Tcl handler set. If you don't use this option, you are modifying the default Tcl handler set, named "default". .RE .IP "\fB -noexpand \fIboolean\fP\fR" .RS .PP Normally, the parser will try to expand references to entities defined in the internal subset. If this option is set to a true value this entities are not expanded, but reported literal via the default handler. \fBWarning:\fR If you set this option to true and doesn't install a default handler (with the -defaultcommand option) for every handler set of the parser all internal entities are silent lost for the handler sets without a default handler. .RE .IP "\fB-useForeignDTD \fI\fP\fR" If is true and the document does not have an external subset, the parser will call the -externalentitycommand script with empty values for the systemId and publicID arguments. This option must be set, before the first piece of data is parsed. Setting this option, after the parsing has started has no effect. The default is not to use a foreign DTD. The default is restored, after reseting the parser. Pleace notice, that a -paramentityparsing value of "never" (which is the default) suppresses any call to the -externalentitycommand script. Pleace notice, that, if the document also doesn't have an internal subset, the -startdoctypedeclcommand and enddoctypedeclcommand scripts, if set, are not called. .SH " COMMAND METHODS " .TP \&\fB\fBparser\fP \fBconfigure\fP \fIoption value ?option value?\fB \&\fR .RS .PP Sets configuration options for the parser. Every command option, except \fI-namespace\fR can be set or modified with this method. .RE .TP \&\fB\fBparser\fP \fBcget \fI?-handlerset name? option\fB\fP \&\fR .RS .PP Return the current configuration value option for the parser. .PP If the -handlerset option is used, the configuration for the named handler set is returned. .RE .TP \&\fB\fBparser\fP \fBfree\fP \&\fR .RS .PP Deletes the parser and the parser command. A parser cannot be freed from within one of its handler callbacks (neither directly nor indirectly) and will raise a tcl error in this case. .RE .TP \&\fB\fBparser\fP \fBget\fP \fI-specifiedattributecount|-idattributeindex|-currentbytecount|-currentlinenumber|-currentcolumnnumber|-currentbyteindex\fB \&\fR .RS .IP "\fB-specifiedattributecount\fR" .RS .PP Returns the number of the attribute/value pairs passed in last call to the elementstartcommand that were specified in the start-tag rather than defaulted. Each attribute/value pair counts as 2; thus this corresponds to an index into the attribute list passed to the elementstartcommand. .RE .IP "\fB-idattributeindex\fR" .RS .PP Returns the index of the ID attribute passed in the last call to XML_StartElementHandler, or -1 if there is no ID attribute. Each attribute/value pair counts as 2; thus this corresponds to an index into the attributes list passed to the elementstartcommand. .RE .IP "\fB-currentbytecount\fR" .RS .PP Return the number of bytes in the current event. Returns 0 if the event is in an internal entity. .RE .IP "\fB-currentlinenumber\fR" .RS .PP Returns the line number of the current parse location. .RE .IP "\fB-currentcolumnnumber\fR" .RS .PP Returns the column number of the current parse location. .RE .IP "\fB-currentbyteindex\fR" .RS .PP Returns the byte index of the current parse location. .RE .PP Only one value may be requested at a time. .RE .TP \&\fB\fBparser\fP \fBparse\fP \fIdata\fB \&\fR .RS .PP Parses the XML string \fIdata\fR. The event callback scripts will be called, as there triggering events happens. This method cannot be used from within a callback (neither directly nor indirectly) of the parser to be used and will raise an error in this case. .RE .TP \&\fB\fBparser\fP \fBparsechannel\fP \fIchannelID\fB \&\fR .RS .PP Reads the XML data out of the tcl channel \fIchannelID\fR (starting at the current access position, without any seek) up to the end of file condition and parses that data. The channel encoding is respected. Use the helper proc tDOM::xmlOpenFile out of the tDOM script library to open a file, if you want to use this method. This method cannot be used from within a callback (neither directly nor indirectly) of the parser to be used and will raise an error in this case. .RE .TP \&\fB\fBparser\fP \fBparsefile\fP \fIfilename\fB \&\fR .RS .PP Reads the XML data directly out of the file with the filename \fIfilename\fR and parses that data. This is done with low level file operations. The XML data must be in US-ASCII, ISO-8859-1, UTF-8 or UTF-16 encoding. If applicable, this is the fastest way, to parse XML data. This method cannot be used from within a callback (neither directly nor indirectly) of the parser to be used and will raise an error in this case. .RE .TP \&\fB\fBparser\fP \fBreset\fP \&\fR .RS .PP Resets the parser in preparation for parsing another document. A parser cannot be reseted from within one of its handler callbacks (neither directly nor indirectly) and will raise a tcl error in this cases. .RE .SH "Callback Command Return Codes" .PP A script invoked for any of the parser callback commands, such as -elementstartcommand, -elementendcommand, etc, may return an error code other than "ok" or "error". All callbacks may in addition return "break" or "continue". .PP If a callback script returns an "error" error code then processing of the document is terminated and the error is propagated in the usual fashion. .PP If a callback script returns a "break" error code then all further processing of every handler script out of this Tcl handler set is suppressed for the further parsing. This does not influence any other handler set. .PP If a callback script returns a "continue" error code then processing of the current element, and its children, ceases for every handler script out of this Tcl handler set and processing continues with the next (sibling) element. This does not influence any other handler set. .SH "SEE ALSO" expatapi, tdom .SH KEYWORDS SAX tDOM-0.8.3/doc/expat.xml0000644000175000017500000006527210156370627015212 0ustar ssobernissoberni expat Creates an instance of an expat parser object package require tdom expat ?parsername? ?-namespace? ?arg arg .. xml::parser ?parsername? ?-namespace? ?arg arg ..
DESCRIPTION

The parser created with expat or xml::parser (which is just another name for the same command in an own namespace) are able to parse any kind of well-formed XML. The parsers are stream oriented XML parser. This means that you register handler scripts with the parser prior to starting the parse. These handler scripts are called when the parser discovers the associated structures in the document being parsed. A start tag is an example of the kind of structures for which you may register a handler script.

The parsers do not validate the XML document. They do parse the internal DTD and, at request, external DTD and external entities, if you resolve the identifier of the external entities with the -externalentitycommand script (see there).

Additionly, the Tcl extension code that implements this command provides an API for adding C level coded handlers. Up to now, there exists the parser extension command "tdom". The handler set installed by this extension build an in memory "tDOM" DOM tree, while the parser is parsing the input.

It is possible to register an arbitrary amount of different handler scripts and C level handlers for most of the events. If the event occurs, they are called in turn.

COMMAND OPTIONS -namespace

Enables namespace parsing. You must use this option while creating the parser with the expat or xml::parser command. You can't enable (nor disable) namespace parsing with <parserobj> configure ....

-final boolean

This option indicates whether the document data next presented to the parse method is the final part of the document. A value of "0" indicates that more data is expected. A value of "1" indicates that no more is expected. The default value is "1".

If this option is set to "0" then the parser will not report certain errors if the XML data is not well-formed upon end of input, such as unclosed or unbalanced start or end tags. Instead some data may be saved by the parser until the next call to the parse method, thus delaying the reporting of some of the data.

If this option is set to "1" then documents which are not well-formed upon end of input will generate an error.

-baseurl url

Reports the base url of the document to the parser.

-elementstartcommand script

Specifies a Tcl command to associate with the start tag of an element. The actual command consists of this option followed by at least two arguments: the element type name and the attribute list.

The attribute list is a Tcl list consisting of name/value pairs, suitable for passing to the array set Tcl command.

Example:

proc HandleStart {name attlist} { puts stderr "Element start ==> $name has attributes $attlist" } $parser configure -elementstartcommand HandleStart $parser parse {<test id="123"></test>}

This would result in the following command being invoked:

HandleStart text {id 123}
-elementendcommand script

Specifies a Tcl command to associate with the end tag of an element. The actual command consists of this option followed by at least one argument: the element type name. In addition, if the -reportempty option is set then the command may be invoked with the -empty configuration option to indicate whether it is an empty element. See the description of the -reportempty option for an example.

Example:

proc HandleEnd {name} { puts stderr "Element end ==> $name" } $parser configure -elementendcommand HandleEnd $parser parse {<test id="123"></test>}

This would result in the following command being invoked:

HandleEnd test
-characterdatacommand script

Specifies a Tcl command to associate with character data in the document, ie. text. The actual command consists of this option followed by one argument: the text.

It is not guaranteed that character data will be passed to the application in a single call to this command. That is, the application should be prepared to receive multiple invocations of this callback with no intervening callbacks from other features.

Example:

proc HandleText {data} { puts stderr "Character data ==> $data" } $parser configure -characterdatacommand HandleText $parser parse {<test>this is a test document</test>}

This would result in the following command being invoked:

HandleText {this is a test document}
-processinginstructioncommand script

Specifies a Tcl command to associate with processing instructions in the document. The actual command consists of this option followed by two arguments: the PI target and the PI data.

Example:

proc HandlePI {target data} { puts stderr "Processing instruction ==> $target $data" } $parser configure -processinginstructioncommand HandlePI $parser parse {<test><?special this is a processing instruction?></test>}

This would result in the following command being invoked:

HandlePI special {this is a processing instruction}
-notationdeclcommand script

Specifies a Tcl command to associate with notation declaration in the document. The actual command consists of this option followed by four arguments: the notation name, the base uri of the document (this means, whatever was set by the -baseurl option), the system identifier and the public identifier. The notation name is never empty, the other arguments may be.

-externalentitycommand script

Specifies a Tcl command to associate with references to external entities in the document. The actual command consists of this option followed by three arguments: the base uri, the system identifier of the entity and the public identifier of the entity. The base uri and the public identifier may be the empty list.

This handler script has to return a tcl list consisting of three elements. The first element of this list signals, how the external entity is returned to the processor. At the moment, the three allowed types are "string", "channel" and "filename". The second element of the list has to be the (absolute) base URI of the external entity to be parsed. The third element of the list are data, either the already read data out of the external entity as string in the case of type "string", or the name of a tcl channel, in the case of type "channel", or the path to the external entity to be read in case of type "filename". Behind the scene, the external entity referenced by the returned Tcl channel, string or file name will be parsed with an expat external entity parser with the same handler sets as the main parser. If parsing of the external entity fails, the whole parsing is stopped with an error message. If a Tcl command registered as externalentitycommand isn't able to resolve an external entity it is allowed to return TCL_CONTINUE. In this case, the wrapper give the next registered externalentitycommand a try. If no externalentitycommand is able to handle the external entity parsing stops with an error.

Example:

proc externalEntityRefHandler {base systemId publicId} { if {![regexp {^[a-zA-Z]+:/} $systemId]} { regsub {^[a-zA-Z]+:} $base {} base set basedir [file dirname $base] set systemId "[set basedir]/[set systemId]" } else { regsub {^[a-zA-Z]+:} $systemId systemId } if {[catch {set fd [open $systemId]}]} { return -code error \ -errorinfo "Failed to open external entity $systemId" } return [list channel $systemId $fd] } set parser [expat -externalentitycommand externalEntityRefHandler \ -baseurl "file:///local/doc/doc.xml" \ -paramentityparsing notstandalone] $parser parse {<?xml version='1.0'?> <!DOCTYPE test SYSTEM "test.dtd"> <test/>}

This would result in the following command being invoked:

externalEntityRefHandler file:///local/doc/doc.xml test.dtd {}

External entities are only tried to resolve via this handler script, if necessary. This means, external parameter entities triggers this handler only, if -paramentityparsing is used with argument "always" or if -paramentityparsing is used with argument "notstandalone" and the document isn't marked as standalone.

-unknownencodingcommand script

Not implemented at Tcl level.

-startnamespacedeclcommand script

Specifies a Tcl command to associate with start scope of namespace declarations in the document. The actual command consists of this option followed by two arguments: the namespace prefix and the namespace URI. For an xmlns attribute, prefix will be the empty list. For an xmlns="" attribute, uri will be the empty list. The call to the start and end element handlers occur between the calls to the start and end namespace declaration handlers.

-endnamespacedeclcommand script

Specifies a Tcl command to associate with end scope of namespace declarations in the document. The actual command consists of this option followed by the namespace prefix as argument. In case of an xmlns attribute, prefix will be the empty list. The call to the start and end element handlers occur between the calls to the start and end namespace declaration handlers.

-commentcommand script

Specifies a Tcl command to associate with comments in the document. The actual command consists of this option followed by one argument: the comment data.

Example:

proc HandleComment {data} { puts stderr "Comment ==> $data" } $parser configure -commentcommand HandleComment $parser parse {<test><!-- this is <obviously> a comment --></test>}

This would result in the following command being invoked:

HandleComment { this is <obviously> a comment }
-notstandalonecommand script

This Tcl command is called, if the document is not standalone (it has an external subset or a reference to a parameter entity, but does not have standalone="yes"). It is called with no additional arguments.

-startcdatasectioncommand script

Specifies a Tcl command to associate with the start of a CDATA section. It is called with no additional arguments.

-endcdatasectioncommand script

Specifies a Tcl command to associate with the end of a CDATA section. It is called with no additional arguments.

-elementdeclcommand script

Specifies a Tcl command to associate with element declarations. The actual command consists of this option followed by two arguments: the name of the element and the content model. The content model arg is a tcl list of four elements. The first list element specifies the type of the XML element; the six different possible types are reported as "MIXED", "NAME", "EMPTY", "CHOICE", "SEQ" or "ANY". The second list element reports the quantifier to the content model in XML Syntax ("?", "*" or "+") or is the empty list. If the type is "MIXED", then the quantifier will be "{}", indicating an PCDATA only element, or "*", with the allowed elements to intermix with PCDATA as tcl list as the fourth argument. If the type is "NAME", the name is the third arg; otherwise the third argument is the empty list. If the type is "CHOICE" or "SEQ" the fourth argument will contain a list of content models build like this one. The "EMPTY", "ANY", and "MIXED" types will only occur at top level.

Examples:

proc elDeclHandler {name content} { puts "$name $content" } set parser [expat -elementdeclcommand elDeclHandler] $parser parse {<?xml version='1.0'?> <!DOCTYPE test [ <!ELEMENT test (#PCDATA)> ]> <test>foo</test>}

This would result in the following command being invoked:

test {MIXED {} {} {}} $parser reset $parser parse {<?xml version='1.0'?> <!DOCTYPE test [ <!ELEMENT test (a|b)> ]> <test><a/></test>}

This would result in the following command being invoked:

elDeclHandler test {CHOICE {} {} {{NAME {} a {}} {NAME {} b {}}}}
-attlistdeclcommand script

Specifies a Tcl command to associate with attlist declarations. The actual command consists of this option followed by five arguments. The Attlist declaration handler is called for *each* attribute. So a single Attlist declaration with multiple attributes declared will generate multiple calls to this handler. The arguments are the element name this attribute belongs to, the name of the attribute, the type of the attribute, the default value (may be the empty list) and a required flag. If this flag is true and the default value is not the empty list, then this is a "#FIXED" default.

Example:

proc attlistHandler {elname name type default isRequired} { puts "$elname $name $type $default $isRequired" } set parser [expat -attlistdeclcommand attlistHandler] $parser parse {<?xml version='1.0'?> <!DOCTYPE test [ <!ELEMENT test EMPTY> <!ATTLIST test id ID #REQUIRED name CDATA #IMPLIED> ]> <test/>}

This would result in the following commands being invoked:

attlistHandler test id ID {} 1 attlistHandler test name CDATA {} 0
-startdoctypedeclcommand script

Specifies a Tcl command to associate with the start of the DOCTYPE declaration. This command is called before any DTD or internal subset is parsed. The actual command consists of this option followed by four arguments: the doctype name, the system identifier, the public identifier and a boolean, that shows if the DOCTYPE has an internal subset.

-enddoctypedeclcommand script

Specifies a Tcl command to associate with the end of the DOCTYPE declaration. This command is called after processing any external subset. It is called with no additional arguments.

-paramentityparsing never|notstandalone|always

"never" disables expansion of parameter entities, "always" expands always and "notstandalone" only, if the document isn't "standalone='no'". The default ist "never"

-entitydeclcommand script

Specifies a Tcl command to associate with any entity declaration. The actual command consists of this option followed by seven arguments: the entity name, a boolean identifying parameter entities, the value of the entity, the base uri, the system identifier, the public identifier and the notation name. According to the type of entity declaration some of this arguments may be the empty list.

-ignorewhitecdata boolean

If this flag is set, element content which contain only whitespaces isn't reported with the -characterdatacommand.

-ignorewhitespace boolean Another name for -ignorewhitecdata; see there. -handlerset name

This option sets the Tcl handler set scope for the configure options. Any option value pair following this option in the same call to the parser are modifying the named Tcl handler set. If you don't use this option, you are modifying the default Tcl handler set, named "default".

-noexpand boolean

Normally, the parser will try to expand references to entities defined in the internal subset. If this option is set to a true value this entities are not expanded, but reported literal via the default handler. Warning: If you set this option to true and doesn't install a default handler (with the -defaultcommand option) for every handler set of the parser all internal entities are silent lost for the handler sets without a default handler.

-useForeignDTD <boolen> If <boolen> is true and the document does not have an external subset, the parser will call the -externalentitycommand script with empty values for the systemId and publicID arguments. This option must be set, before the first piece of data is parsed. Setting this option, after the parsing has started has no effect. The default is not to use a foreign DTD. The default is restored, after reseting the parser. Pleace notice, that a -paramentityparsing value of "never" (which is the default) suppresses any call to the -externalentitycommand script. Pleace notice, that, if the document also doesn't have an internal subset, the -startdoctypedeclcommand and enddoctypedeclcommand scripts, if set, are not called.
COMMAND METHODS parser configure option value ?option value?

Sets configuration options for the parser. Every command option, except -namespace can be set or modified with this method.

parser cget ?-handlerset name? option

Return the current configuration value option for the parser.

If the -handlerset option is used, the configuration for the named handler set is returned.

parser free

Deletes the parser and the parser command. A parser cannot be freed from within one of its handler callbacks (neither directly nor indirectly) and will raise a tcl error in this case.

parser get -specifiedattributecount|-idattributeindex|-currentbytecount|-currentlinenumber|-currentcolumnnumber|-currentbyteindex -specifiedattributecount

Returns the number of the attribute/value pairs passed in last call to the elementstartcommand that were specified in the start-tag rather than defaulted. Each attribute/value pair counts as 2; thus this corresponds to an index into the attribute list passed to the elementstartcommand.

-idattributeindex

Returns the index of the ID attribute passed in the last call to XML_StartElementHandler, or -1 if there is no ID attribute. Each attribute/value pair counts as 2; thus this corresponds to an index into the attributes list passed to the elementstartcommand.

-currentbytecount

Return the number of bytes in the current event. Returns 0 if the event is in an internal entity.

-currentlinenumber

Returns the line number of the current parse location.

-currentcolumnnumber

Returns the column number of the current parse location.

-currentbyteindex

Returns the byte index of the current parse location.

Only one value may be requested at a time.

parser parse data

Parses the XML string data. The event callback scripts will be called, as there triggering events happens. This method cannot be used from within a callback (neither directly nor indirectly) of the parser to be used and will raise an error in this case.

parser parsechannel channelID

Reads the XML data out of the tcl channel channelID (starting at the current access position, without any seek) up to the end of file condition and parses that data. The channel encoding is respected. Use the helper proc tDOM::xmlOpenFile out of the tDOM script library to open a file, if you want to use this method. This method cannot be used from within a callback (neither directly nor indirectly) of the parser to be used and will raise an error in this case.

parser parsefile filename

Reads the XML data directly out of the file with the filename filename and parses that data. This is done with low level file operations. The XML data must be in US-ASCII, ISO-8859-1, UTF-8 or UTF-16 encoding. If applicable, this is the fastest way, to parse XML data. This method cannot be used from within a callback (neither directly nor indirectly) of the parser to be used and will raise an error in this case.

parser reset

Resets the parser in preparation for parsing another document. A parser cannot be reseted from within one of its handler callbacks (neither directly nor indirectly) and will raise a tcl error in this cases.

Callback Command Return Codes

A script invoked for any of the parser callback commands, such as -elementstartcommand, -elementendcommand, etc, may return an error code other than "ok" or "error". All callbacks may in addition return "break" or "continue".

If a callback script returns an "error" error code then processing of the document is terminated and the error is propagated in the usual fashion.

If a callback script returns a "break" error code then all further processing of every handler script out of this Tcl handler set is suppressed for the further parsing. This does not influence any other handler set.

If a callback script returns a "continue" error code then processing of the current element, and its children, ceases for every handler script out of this Tcl handler set and processing continues with the next (sibling) element. This does not influence any other handler set.

expatapi tdom SAX
tDOM-0.8.3/doc/index.html0000644000175000017500000000337110114755302015323 0ustar ssobernissoberni tDOM manual
tDOM-0.8.3/doc/domNode.n0000644000175000017500000005251210711427572015103 0ustar ssobernissoberni'\" '\" Generated from domNode.xml '\" '\" BEGIN man.macros .if t .wh -1.3i ^B .nr ^l \n(.l .ad b .de AP .ie !"\\$4"" .TP \\$4 .el \{\ . ie !"\\$2"" .TP \\n()Cu . el .TP 15 .\} .ta \\n()Au \\n()Bu .ie !"\\$3"" \{\ \&\\$1 \\fI\\$2\\fP (\\$3) .\".b .\} .el \{\ .br .ie !"\\$2"" \{\ \&\\$1 \\fI\\$2\\fP .\} .el \{\ \&\\fI\\$1\\fP .\} .\} .. .de AS .nr )A 10n .if !"\\$1"" .nr )A \\w'\\$1'u+3n .nr )B \\n()Au+15n .\" .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n .nr )C \\n()Bu+\\w'(in/out)'u+2n .. .AS Tcl_Interp Tcl_CreateInterp in/out .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. .de BE .nf .ti 0 .mk ^t .ie n \l'\\n(^lu\(ul' .el \{\ .\" Draw four-sided box normally, but don't draw top of .\" box if the box started on an earlier page. .ie !\\n(^b-1 \{\ \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .el \}\ \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .\} .fi .br .nr ^b 0 .. .de VS .if !"\\$2"" .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. .de VE .ie n 'mc .el \{\ .ev 2 .nf .ti 0 .mk ^t \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' .sp -1 .fi .ev .\} .nr ^v 0 .. .de ^B .ev 2 'ti 0 'nf .mk ^t .if \\n(^b \{\ .\" Draw three-sided box if this is the box's first page, .\" draw two sides but no top otherwise. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .\} .if \\n(^v \{\ .nr ^x \\n(^tu+1v-\\n(^Yu \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c .\} .bp 'fi .ev .if \\n(^b \{\ .mk ^y .nr ^b 2 .\} .if \\n(^v \{\ .mk ^Y .\} .. .de DS .RS .nf .sp .. .de DE .fi .RE .sp .. .de SO .SH "STANDARD OPTIONS" .LP .nf .ta 5.5c 11c .ft B .. .de SE .fi .ft R .LP See the \\fBoptions\\fR manual entry for details on the standard options. .. .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. .de CS .RS .nf .ta .25i .5i .75i 1i .if t .ft C .. .de CE .fi .if t .ft R .RE .. .de UL \\$1\l'|0\(ul'\\$2 .. '\" END man.macros .TH domNode n "" Tcl "" .BS .SH NAME domNode \- Manipulates an instance of a DOM node object .SH SYNOPSIS .nf $nodeObject \fImethod\fR \fIarg arg ...\fR .fi .BE .SH " DESCRIPTION " .PP This command manipulates one particular instance of a DOM node object. \&\fImethod\fR indicates a specific method of the node class. These methods should closely conform to the W3C recommendation "Document Object Model (Core) Level 1" (http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html) as well to parts of the W3C draft "XML Pointer Language (XPointer)" (http://www.w3.org/TR/1998/WD-xptr-19980303). Please note, that the XPointer methods are deprecated. Use DOM methods or XPath expressions instead of them. .PP The selectNodes method implements the "XML Path Language (XPath) Version 1.0" W3C recommendation 16 November 1999 (http://www.w3.org/TR/1999/REC-xpath-19991116). Look at these documents for a deeper understanding of the functionality. .PP The valid methods are: .TP \&\fB\fBnodeType\fP \&\fRReturns the node type of that node object. This can be: ELEMENT_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE or PROCESSING_INSTRUCTION_NODE. .TP \&\fB\fBnodeName\fP \&\fRReturns the node name of that node object. This is the element (tag) name for element nodes (type ELEMENT_NODE), the processing-instruction target for processing-instructions, "#text" for text node, "#comment" for comment nodes or "#cdata" for cdata section nodes. .TP \&\fB\fBnodeValue\fP \fI?newValue?\fB \&\fRReturns the value of that node object. This is the the text or the data for element nodes of type TEXT_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE or CDATA_SECTION_NODE). Otherwise it is empty. If the node is a TEXT_NODE, COMMENT_NODE or PROCESSING_INSTRUCTION_NODE and the optional argument \fInewValue\fR is given, the node is set to that value. .TP \&\fB\fBhasChildNodes\fP \&\fRReturns 1 if the has children. Otherwise 0 is returned. .TP \&\fB\fBparentNode\fP \fB?objVar?\fP \&\fRReturns the parent node. .TP \&\fB\fBchildNodes\fP \&\fRReturns a list of direct children node objects. .TP \&\fB\fBchildNodesLive\fP \&\fRReturns a "live" nodeList object of the child nodes of the node in the sense of the DOM recommendation. This nodeList object is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the NodeList accessors; it is not a static snapshot of the content of the node. The both accessors know by the nodeList object are "item ", which returns the indexth item in the collection, and "length", which returns the number of nodes in the list. .TP \&\fB\fBfirstChild\fP \fB?objVar?\fP \&\fRReturns the first child as a node object. .TP \&\fB\fBlastChild\fP \fB?objVar?\fP \&\fRReturns the last child as a node object. .TP \&\fB\fBnextSibling\fP \fB?objVar?\fP \&\fRReturns the next sibling relativ to the current node as a node object. .TP \&\fB\fBpreviousSibling\fP \fB?objVar?\fP \&\fRReturns the next sibling relativ to the current node as a node object. .TP \&\fB\fBgetElementsByTagName\fP \fIname\fB \&\fRReturns a list of all elements in the subtree matching (glob style) \fIname\fR. .TP \&\fB\fBgetElementsByTagNameNS\fP \fIuri\fB \fIlocalname\fB \&\fRReturns a list of all elements in the subtree matching (glob style) \fIlocalname\fR and having the given namespace \&\fIuri\fR. .TP \&\fB\fBgetElementById\fP \fIid\fB \&\fRReturns the node having a id attribute with value \&\fIid\fR or the emtpy string, if no node has an id attribute with that value. .TP \&\fB\fBhasAttribute\fP \fIattributeName\fB \&\fRReturns 1 if the object node contains an attribute with name \&\fIattributeName\fR . Otherwise 0 is returned. .TP \&\fB\fBgetAttribute\fP \fIattributeName ?defaultValue?\fB \&\fRReturns the value of the attribute \fIattributeName\fR. If attribute is not available \fIdefaultValue\fR is returned. .TP \&\fB\fBsetAttribute\fP \fIattributeName newValue ?attributeName newValue ...?\fB \&\fRSets the value for one or more attributes. Every \&\fIattributeName\fR is set to the corresponding \fInewValue\fR. If there isn't an attribute for one or more of the \fIattributeName\fR this will create that attribute. .TP \&\fB\fBremoveAttribute\fP \fIattributeName\fB \&\fRRemoves the attribute \fIattributeName\fR. .TP \&\fB\fBhasAttributeNS\fP \fIuri\fB \fIlocalName\fB \&\fRReturns 1 if the object node contains an attribute with the local name \fIlocalName\fR within the namespace \fIuri\fR. Otherwise 0 is returned. .TP \&\fB\fBgetAttributeNS\fP \fIuri\fB \fIlocalName ?defaultValue?\fB \&\fRReturns the value of the attribute with the local name \&\fIlocalName\fR within the namespace URI \fIuri\fR. If the node dosn't have that attribute the \fIdefaultValue\fR is returned. .TP \&\fB\fBsetAttributeNS\fP \fIuri qualifiedName newValue ?uri qualifiedName newValue ...?\fB \&\fR .RS .PP Sets the value for one or more full qualified attributes. Every attribute \fIqualifiedName\fR with the namespace URI \&\fIuri\fR will be set to \fInewValue\fR. This will create a new attribute, if it wasn't avialble before. If you want to set an attribute within a namespace you must specify the attribute name with prefix, even if you want to set an already existing attribute to a new value. While searching, if the attribute already exists, only the given \fIuri\fR and the localname of the \&\fIqualifiedName\fR is used. .CS $node setAttributeNS "http://some.uri.com/wow" prefix:attr1 attrValue .CE .PP If the uri is the empty string and the attribute name hasn't a prefix, this method has the same effect as the method \fBsetAttribute\fR. .CS $node setAttributeNS "" attri "some Value" .CE .PP XML namespace nodes are not in any namespace. Set them this way: .CS $node setAttributeNS "" xmlns:myprefix "myNamespaceURI" $node setAttributeNS "" xmlns "newDefaultNamespace" .CE .PP If your \fIqualifiedName\fR has the prefix "xml" and you give the empty string as \fIuri\fR, the namespace of the attribute defaults to "http://www.w3.org/XML/1998/namespace", as the DOM 2 recommendation requests. With the exceptions of the special prefixes "xmlns" and "xml" you always must provide a non emtpy \fIuri\fR, if your \fIqualifiedName\fR has a prefix. .RE .TP \&\fB\fBremoveAttributeNS\fP \fIuri\fB \fIlocalName\fB \&\fRRemoves the attribute with the local name \fIlocalName\fR within the namespace \fIuri\fR. .TP \&\fB\fBattributes\fP \fB?attributeNamePattern?\fP \&\fRReturns all attributes matching the \fIattributeNamePattern\fR. If \fIattributeNamePattern\fR isn't given all attributes are returned as a Tcl list. .TP \&\fB\fBappendChild\fP \fInewChild\fB \&\fRAppend \fInewChild\fR to the end of the child list of the node. .TP \&\fB\fBinsertBefore\fP \fInewChild\fB \fIrefChild\fB \&\fRInsert \fInewChild\fR before the \fIrefChild\fR into the list of children of node. If \fIrefChild\fR is the empty string, insert \&\fInewChild\fR at the end of the child nodes list of that node. .TP \&\fB\fBreplaceChild\fP \fInewChild\fB \fIoldChild\fB \&\fRReplace \fIoldChild\fR with \fInewChild\fR in the list of children of that node. The \fIoldChild\fR node will be part of the document fragment list after this operation. .TP \&\fB\fBremoveChild\fP \fIchild\fB \&\fRRemoves \fIchild\fR from the list of children of that node \&\fIchild\fR will be part of the document fragment list after this operation. It is not physically deleted. .TP \&\fB\fBdelete\fP \&\fRDeletes the given node and its complete child tree and frees the complete internal memory. The affected nodes are not accessible through the document fragment list. .TP \&\fB\fBcloneNode\fP \fB?-deep?\fP \&\fRClones this node and adds the new create node into the document fragment list. If the \fI-deep\fR option is specified, all descendant nodes are also cloned. .TP \&\fB\fBownerDocument\fP \fB?domObjVar?\fP \&\fRReturns the document object of the document this node belongs to. .TP \&\fB\fBfind\fP \fIattrName\fB \fIattrVal\fB \fB?objVar?\fP \&\fRFinds the node with the attribute name \fIattrName\fR, and attribute value \fIattrVal\fR in the subtree starting the current node. .TP \&\fB\fBchild\fP \fInumber|all\fB \fBtype\fP \fBattrName attrValue\fP \&\fR(XPointer) child .TP \&\fB\fBdescendant\fP \fInumber|all\fB \fBtype\fP \fBattrName attrValue\fP \&\fR(XPointer) descendant .TP \&\fB\fBancestor\fP \fInumber|all\fB \fBtype\fP \fBattrName attrValue\fP \&\fR(XPointer) ancestor .TP \&\fB\fBfsibling\fP \fInumber|all\fB \fBtype\fP \fBattrName attrValue\fP \&\fR(XPointer) fsibling .TP \&\fB\fBpsibling\fP \fInumber|all\fB \fBtype\fP \fBattrName attrValue\fP \&\fR(XPointer) psibling .TP \&\fB\fBroot\fP \fBobjVar\fP \&\fR(XPointer) root .TP \&\fB\fBtext\fP \&\fRReturns all text node children of that current node combined, i.e. appended into one string. .TP \&\fB\fBtarget\fP \&\fRFor a processing instruction node the target part is returned. Otherwise an error is generated. .TP \&\fB\fBdata\fP \&\fRFor a processing instruction node the data part is returned. For a text node, comment node or cdata section node the value is returned. Otherwise an error is generated. .TP \&\fB\fBprefix\fP \&\fRReturns the namespace prefix. .TP \&\fB\fBnamespaceURI\fP \&\fRReturns the namespace URI. .TP \&\fB\fBlocalName\fP \&\fRReturns the localName from the tag name of the given node. .TP \&\fB\fBselectNodes\fP \fB?-namespaces prefixUriList?\fP \fB?-cache ?\fP \fIxpathQuery\fB \fB?typeVar?\fP \&\fR .RS .PP Returns the result of applying the XPath query \&\fIxpathQuery\fR to the subtree. This can be a string/value, a list of strings, a list of nodes or a list of attribute name / value pairs. If \fItypeVar\fR is given the result type name is stored into that variable (empty, bool, number, string, nodes, attrnodes or mixed). .PP The argument \fIxpathQuery\fR has to be a valid XPath expression. However, there is one exception to that rule. Tcl variable names can appear in the XPath statement at any position where it is legal according to the rules of the XPath syntax to put an XPath variable. The value of the variable is substituted for the variable name. Ignoring the syntax rules of XPath the Tcl variable name may be any legal Tcl var name: local variables, global variables, array entries and so on. .PP The option \fI-namespaces\fR expects a tcl list with prefix / namespace pairs as argument. If this option is not given, then any namespace prefix within the xpath expression will be first resolved against the list of prefix / namespace pairs set with the selectNodesNamespaces method for the document, the node belongs to. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix. If this option is given, any namespace prefix within the xpath expression will be first resolved against that given list (and ignoring the document global prefix / namespace list). If the list bind the same prefix to different namespaces, then the first binding will win. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix, as usual. .PP If the \fI-cache\fR option is used with a true value, then the \&\fIxpathQuery\fR will be looked up in a document specific cache. If the query is found, then the stored pre-compiled query will be used. If the query isn't found, it will be pre-compiled and stored in the cache, for use in further calls. Please notice, that the \fIxpathQuery\fR as given as string is used as key for the cache. This means, that equal XPath expressions, which differ only in white space are treated as different cache entries. Special care is needed, if the XPath expression includes namespace prefixes. During pre-compilation, the prefixes will be resolved first to the prefix / namespace pairs of the \fI-namespaces\fR option, if given, and to the namespaces in scope of the context node at pre-compilation time. If the XPath is found in the cache, neither the \fI-namespaces\fR option nor the namespaces in scope of the context node will be taken in account but the already resolved (stored) namespaces will be used for the query. .PP Examples: .CS set paragraphNodes [$node selectNodes {chapter[3]//para[@type='warning' or @type='error'} ] foreach paragraph $paragraphNodes { lappend values [$paragraph selectNodes attribute::type] } set doc [dom parse {}] set root [$doc documentElement] set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child] .CE .RE .TP \&\fB\fBgetLine\fP \&\fRReturns the line number of that node in the orignal parsed XML. .TP \&\fB\fBgetColumn\fP \&\fRReturns the column number of that node in the orignal parsed XML. .TP \&\fB\fBasList\fP \&\fRReturns the DOM substree starting form the current node as a nested Tcl list. .TP \&\fB\fBasXML\fP \fB?-indent none/1..8?\fP \fB?-channel channelId?\fP \fB?-escapeNonASCII?\fP\fB?-escapeAllQuot?\fP \&\fRReturns the DOM substree starting from the current node as the root node of the result as an (optional indented) XML string or sends the output directly to the given channelId. If the option \&\fI-escapeNonASCII\fR is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation. If the option \&\fI-escapeAllQuot\fR is given, quotation marks will be escaped with " even in text content of elements. .TP \&\fB\fBasHTML\fP \fB?-channel channelId?\fP \fB?-escapeNonASCII?\fP \fB?-htmlEntities?\fP \&\fRReturns the DOM substree starting from the current node as the root node of the result serialized acording to HTML rules (HTML elements are recognized regardless of case, without end tags for emtpy HTML elements etc.), as string or sends the output directly to the given channelId. If the option \&\fI-escapeNonASCII\fR is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation. If the option \fI-htmlEntities\fR is given, a character is outputed using a HTML 4.01 character entity reference, if one is defined for it. .TP \&\fB\fBasText\fP \&\fRFor ELEMENT_NODEs, the asText method outputs the string-value of every text node descendant of node in document order without any escaping. For every other node type, this method outputs the the XPath string value of that node. .TP \&\fB\fBappendFromList\fP \fIlist\fB \&\fRParses \fIlist\fR , creates an according DOM subtree and appends this subtree to the current node. .TP \&\fB\fBappendFromScript\fP \fItclScript\fB \&\fRAppends the nodes created in the \fItclScript\fR by Tcl functions, which have been built using \fIdom createNodeCmd\fR, to the given node. .TP \&\fB\fBinsertBeforeFromScript\fP \fItclScript\fB \fIrefChild\fB \&\fRInserts the nodes created in the \fItclScript\fR by Tcl functions, which have been built using \fIdom createNodeCmd\fR, before the \&\fIrefChild\fR into to the list of children of node. If \fIrefChild\fR is the empty string, the new nodes will be appended. .TP \&\fB\fBappendXML\fP \fIXMLstring\fB \&\fRParses \fIXMLstring\fR, creates an according DOM subtree and appends this subtree to the current node. .TP \&\fB\fBsimpleTranslate\fP \fIoutputVar\fB \fIspecifications\fB \&\fRTranslate the subtree starting at the object node according to the specifications in \fIspecifications\fR and outputs the result in the variable \fIoutputVar\fR . The translation is very similar to Cost Simple mode. .TP \&\fB\fBtoXPath\fP \&\fRReturns an XPath, which exactly addresses the given node in its document. This XPath is only valid as there are no changes to DOM tree made later one. .TP \&\fB\fBgetBaseURI\fP \&\fRReturns the baseURI of the node. This method is deprecated in favor of the \fIbaseURI\fR method. .TP \&\fB\fBbaseURI \fI?URI?\fB\fP \&\fRReturns the present baseURI of the node. If the optional argument URI is given, sets the base URI of the node and of all of its child nodes out of the same enitity as node to the given URI. .TP \&\fB\fBdisableOutputEscaping\fP \fI?boolean?\fB \&\fRThis method works only for text nodes; for every other nodes it returns error. Without the optional argument it returns, if disabling output escaping is on. The return value 0 means, the characters of the text node will be escaped, to generate valid XML, if serialized. This is the default for every parsed or created text node (with the exception of that text nodes in a result tree of an XSLT transformation, for which disabling output escaping was requested explicitely in the stylesheet). The return value 1 means, that output escaping is disabled for this text node. If such a text node is serialized (with asXML or asHTML), it is literarily written, without escaping of the special XML characters. If the optional boolean value \fIboolean\fR is given, the flag is set accordingly. You should not set this flag to 1, until you really know, what you do. .TP \&\fB\fBprecedes\fP \fIrefnode\fB \&\fRCompares the relative order of the node and \fIrefnode\fR. Both nodes must be part of the same documents and not out of the fragment list of the document. Returns true, if node is in document order (in the sense of the XPath 1.0 recommendation) before \fIrefnode\fR and false otherwise. .TP \&\fB\fBnormalize\fP \fI?-forXPath?\fB \&\fRPuts all Text nodes in the full depth of the sub-tree underneath this Node into a "normal" form where only structure (e.g., elements, comments, processing instructions and CDATA sections) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes. If the option \&\fI-forXPath\fR is given, all CDATA sections in the nodes are converted to text nodes, as a first step before the normalization. .TP \&\fB\fBxslt\fP \fB?-parameters parameterList?\fP \fB?-ignoreUndeclaredParameters?\fP \fB?-xsltmessagecmd script?\fP \fIstylesheet\fB \fI?outputVar?\fB \&\fRApplies an XSLT transformation on the document using the XSLT \&\fIstylesheet\fR (given as domDoc). Returns a document object containing the result document of that transformation and stores it in the optional \&\fIoutputVar\fR. .RS .PP The optional \fI-parameters\fR option sets top level to string values. The \fIparameterList\fR has to be a tcl list consisting of parameter name and value pairs. .PP If the option \fI-ignoreUndeclaredParameters\fR is given, then parameter names in the \fIparameterList\fR given to the \fI-parameters\fR options that are not declared as top-level parameters in the stylesheet are silently ignored. Without this option, an error is raised, if the user tries to set a top-level parameter, which is not declared in the stylesheet. .PP The \fI-xsltmessagecmd\fR option sets a callback for xslt:message elements in the stylesheet. The actual command consists of the script, given as argument to the option, appended with the XML Fragment from instantiating the xsl:message element content as string (as if the XPath string() function would have been applied to the XML Fragment) and a flag, which indicates, if the xsl:message has an attribute "terminate" with the value "yes". .RE .TP \&\fB\fI@attrName\fB \&\fRReturns the value of the attribute \fIattrName\fR. Short cut for \fIgetAttribute\fR. .PP Otherwise, if an unknown method name is given, the command with the same name as the given method within the namespace \fB::dom::domNode\fR is tried to be executed. This allows quick method additions on Tcl level. .SH "SEE ALSO" dom, domDoc .SH KEYWORDS XML, DOM, document, node, parsing tDOM-0.8.3/doc/tdomcmd.html0000644000175000017500000000742307557625655015675 0ustar ssobernissoberni tDOM manual: tdom

NAME

tdom -
tdom is an expat parser object extension to create an in-memory DOM tree from the input while parsing.

SYNOPSIS

package require tdom

set parser [expat]

tdom $parser enable

DESCRIPTION

tdom adds the C handler set "tdom" to an tcl expat parser obj. This handler set builds an in-memory DOM tree out of the input, parsed by the parser. A DOM tree created this way behave exactly like a DOM tree created by the "dom" command (see there). In fact, tdom is only another interface to the same functionality; it uses the code behind the dom code for building the DOM tree.

tdom parserObj enable

Adds the tdom C handler set to a Tcl expat parser object. Next time, the parser parses input, the tdom C handler functions create an in-memory DOM tree.

tdom parserObj getdoc

Returns the DOM tree as domDoc (see there) object.

tdom parserObj setResultEncoding

See the method setResultEncoding of the dom command.

tdom parserObj setStoreLineColumn ?boolean?

See the method setStoreLineColumn of the dom command.

tdom parserObj remove

Removes the tdom C handler set from the parser object.

tdom parserObj keepEmpties

See the option -keepEmpties of the dom command.

tdom parserObj setExternalEntityResolver script

SEE ALSO

dom, expat

KEYWORDS

DOM, SAX, C handler set

tDOM-0.8.3/doc/tmml.dtd0000644000175000017500000002206007513407620014776 0ustar ssobernissoberni ]]> ]]> tDOM-0.8.3/doc/domDoc.n0000644000175000017500000005316710711427572014732 0ustar ssobernissoberni'\" '\" Generated from domDoc.xml '\" '\" BEGIN man.macros .if t .wh -1.3i ^B .nr ^l \n(.l .ad b .de AP .ie !"\\$4"" .TP \\$4 .el \{\ . ie !"\\$2"" .TP \\n()Cu . el .TP 15 .\} .ta \\n()Au \\n()Bu .ie !"\\$3"" \{\ \&\\$1 \\fI\\$2\\fP (\\$3) .\".b .\} .el \{\ .br .ie !"\\$2"" \{\ \&\\$1 \\fI\\$2\\fP .\} .el \{\ \&\\fI\\$1\\fP .\} .\} .. .de AS .nr )A 10n .if !"\\$1"" .nr )A \\w'\\$1'u+3n .nr )B \\n()Au+15n .\" .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n .nr )C \\n()Bu+\\w'(in/out)'u+2n .. .AS Tcl_Interp Tcl_CreateInterp in/out .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. .de BE .nf .ti 0 .mk ^t .ie n \l'\\n(^lu\(ul' .el \{\ .\" Draw four-sided box normally, but don't draw top of .\" box if the box started on an earlier page. .ie !\\n(^b-1 \{\ \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .el \}\ \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .\} .fi .br .nr ^b 0 .. .de VS .if !"\\$2"" .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. .de VE .ie n 'mc .el \{\ .ev 2 .nf .ti 0 .mk ^t \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' .sp -1 .fi .ev .\} .nr ^v 0 .. .de ^B .ev 2 'ti 0 'nf .mk ^t .if \\n(^b \{\ .\" Draw three-sided box if this is the box's first page, .\" draw two sides but no top otherwise. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .\} .if \\n(^v \{\ .nr ^x \\n(^tu+1v-\\n(^Yu \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c .\} .bp 'fi .ev .if \\n(^b \{\ .mk ^y .nr ^b 2 .\} .if \\n(^v \{\ .mk ^Y .\} .. .de DS .RS .nf .sp .. .de DE .fi .RE .sp .. .de SO .SH "STANDARD OPTIONS" .LP .nf .ta 5.5c 11c .ft B .. .de SE .fi .ft R .LP See the \\fBoptions\\fR manual entry for details on the standard options. .. .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. .de CS .RS .nf .ta .25i .5i .75i 1i .if t .ft C .. .de CE .fi .if t .ft R .RE .. .de UL \\$1\l'|0\(ul'\\$2 .. '\" END man.macros .TH domDoc n "" Tcl "" .BS .SH NAME domDoc \- Manipulates an instance of a DOM document object .SH SYNOPSIS .nf \&\fBdomDocObjCmd\fP \fImethod\fR ?\fIarg arg ...\fR? .fi .BE .SH "DESCRIPTION " .PP This command manipulates one particular instance of a document object. \fImethod\fR indicates a specific method of the document class. These methods should closely conform to the W3C recommendation "Document Object Model (Core) Level 1" (http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html). Look at these documents for a deeper understanding of the functionality. .PP The valid methods are: .TP \&\fB\fBdocumentElement\fP ?\fIobjVar\fB? \&\fRReturns the top most element in the document (the root element). .TP \&\fB\fBgetElementsByTagName\fP \fIname\fB \&\fRReturns a list of all elements in the document matching (glob style) \fIname\fR. .TP \&\fB\fBgetElementsByTagNameNS\fP \fIuri\fB \fIlocalname\fB \&\fR Returns a list of all elements in the subtree matching (glob style) \fIlocalname\fR and having the given namespace \&\fIuri\fR. .TP \&\fB\fBcreateElement\fP \fItagName\fB ?\fIobjVar\fB? \&\fRCreates (allocates) a new element node with node name \&\fItagName\fR, append it to the hidden fragment list in the document object and returns the node object. If \fIobjVar\fR is given the new node object store in this variable. .TP \&\fB\fBcreateElementNS\fP \fIurl\fB \fItagName\fB ?\fIobjVar\fB? \&\fRCreates (allocates) a new element node within a namespace having \fIuri\fR as the URI and node name \fItagName\fR, which could include the namespace prefix, append it to the hidden fragment list in the document object and returns the node object. If \fIobjVar\fR is given the new node object store in this variable. .TP \&\fB\fBcreateTextNode\fP \fItext\fB ?\fIobjVar\fB? \&\fRCreates (allocates) a new text node with node value \&\fItext\fR, appends it to the hidden fragment list in the document object and returns the node object. If \fIobjVar\fR is given, the new node object is stored in this variable. .TP \&\fB\fBcreateComment\fP \fItext\fB ?\fIobjVar\fB? \&\fRCreates (allocates) a new comment node with value \&\fItext\fR, appends it to the hidden fragment list in the document object and returns the node object. If \fIobjVar\fR is given, the new comment node object is stored in this variable. .TP \&\fB\fBcreateCDATASection\fP \fIdata\fB ?\fIobjVar\fB? \&\fRCreates (allocates) a new CDATA node with node value \&\fIdata\fR, appends it to the hidden fragment list in the document object and returns the node object. If \fIobjVar\fR is given, the new node object is stored in this variable. .TP \&\fB\fBcreateProcessingInstruction\fP \fItarget\fB \fIdata\fB ?\fIobjVar\fB? \&\fRCreates a process instruction, appends it to the hidden fragment list in the document object and returns the node object. If \&\fIobjVar\fR is given, the new node object is stored in this variable. .TP \&\fB\fBdelete\fP \&\fRExplicitly deletes the document, including the associated Tcl object commands (for nodes, fragment/new nodes, the document object itself) and the underlying DOM tree. .TP \&\fB\fBgetDefaultOutputMethod\fP \&\fRReturns the default output method of the document. This is usually a result of a XSLT transformation. .TP \&\fB\fBasXML\fP \fB?-indent none/1..8?\fP \fB?-channel channelId?\fP \fB?-escapeNonASCII?\fP \fB?-doctypeDeclaration ?\fP \fB?-escapeAllQuot?\fP \&\fRReturns the DOM tree as an (optional indented) XML string or sends the output directly to the given channelId. If the option \fI-escapeNonASCII\fR is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation. The flag \&\fI-doctypeDeclaration\fR determines, whether there will be a DOCTYPE declaration emitted before the first node of the document. The default is, to do not. The DOCTYPE name will always be the element name of the document element. An external entity declaration of the external subset is only emitted, if the document has a system identifier. If the option \fI-escapeAllQuot\fR is given, quotation marks will be escaped with " even in text content of elements. .TP \&\fB\fBasHTML\fP \fB?-channel channelId?\fP \fB?-escapeNonASCII?\fP \fB?-htmlEntities?\fP \fB?-doctypeDeclaration ?\fP \&\fRReturns the DOM tree serialized acording to HTML rules (HTML elements are recognized regardless of case, without end tags for emtpy HTML elements etc.), as string or sends the output directly to the given channelId. If the option \fI-escapeNonASCII\fR is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation. If the option \&\fI-htmlEntities\fR is given, a character is outputed using a HTML 4.01 character entity reference, if one is defined for it. The flag \&\fI-doctypeDeclaration\fR determines, whether there will be a DOCTYPE declaration emitted before the first node of the document. The default is, to do not. The DOCTYPE name will always be the element name of the document element without case normalization. An external entity declaration of the external subset is only emitted, if the document has a system identifier. The doctype declaration will be written from the avaliable informations, without check, if this is a known (w3c) HTML version information or if the document confirms to the given HTML version. .TP \&\fB\fBasText\fP \&\fRThe asText method outputs the result tree by outputting the string-value of every text node in the result tree in document order without any escaping. In effect, this is what the xslt output method "text" (XSLT 1.0 recommendation, section 16.3) does. .TP \&\fB\fBpublicId\fP \fI?publicId?\fB \&\fRReturns the public identifier of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the public identifier of the document is set to this value. .TP \&\fB\fBsystemId\fP \fI?systemId?\fB \&\fRReturns the system identifier of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the system identifier of the document is set to this value. .TP \&\fB\fBinternalSubset \fI?internalSubset?\fB\fP \&\fRReturns the internal subset of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the internal subset of the document is set to this value. Note, that none of the parsing methods preserve the internal subset of a document; a freshly parsed document will always have an empty internal subset. Also note, that the method doesen't do any syntactical check on a given internal subset. .TP \&\fB\fBcdataSectionElements\fP \fI(?URI:?localname|*) ??\fB \&\fRThis method allows to control, for which element nodes the text node childs will be serialized as CDATA sections (this affects only serialization with the asXML method, no text node is altered in any way by this method). IF the method is called with an element name as first argument and a boolean with value true as second argument, every text node child of every element node in the document with the same name as the first argument will be serialized as CDATA section. If the second argument is a boolean with value false, all text nodes of all elements with the same name as the first argument will be serialized as usual. Namespaced element names have to given in the form namespace_URI:localname, not in the otherwise usual prefix:localname form. With two arguments called, the method returns the used boolean value. If the method is called with only an element name, it will return a boolean value, indicating, if the text nodes childs of all elements with that name in the document will be serialized as CDATA section elements (return value 1) or not (return value 0). If the method is called with only one argument and that argument is an asterisk ('*'), then the method returns an unordered list of all element names of the document, for which the text node childs will be serialized as CDATA section nodes. .TP \&\fB\fBselectNodesNamespaces\fP \fB?prefixUriList?\fP \&\fRThis method allows to control a document global prefix to namespace URI mapping, which will be used for selectNodes method calls (on document as well as on all nodes, which belongs to the document), if it is not overwritten by using the -namespaces option of the selectNodes method. Any namespace prefix within an xpath expression will be first resolved against this list. If the list bind the same prefix to different namespaces, then the first binding will win. If a prefix could not resolved against the document global prefix / namespaces list, then the namespace definitions in scope of the context node will be used to resolve the prefix, as usual. If the optional argument \fIprefixUriList\fR is given, then the global prefix / namespace list is set to this list and returns it. Without the optional argument the method returns the current list. The default is the empty list. .TP \&\fB\fBxslt\fP \fB?-parameters parameterList?\fP \fB?-ignoreUndeclaredParameters?\fP \fB?-xsltmessagecmd script?\fP \fIstylesheet\fB \fI?outputVar?\fB \&\fRApplies an XSLT transformation on the whole document of the node object using the XSLT \fIstylesheet\fR (given as domDoc). Returns a document object containing the result document of the transformation and stores that document object in the optional \fIoutputVar\fR, if that was given. .RS .PP The optional \fI-parameters\fR option sets top level to string values. The \fIparameterList\fR has to be a tcl list consisting of parameter name and value pairs. .PP If the option \fI-ignoreUndeclaredParameters\fR is given, then parameter names in the \fIparameterList\fR given to the \fI-parameters\fR options that are not declared as top-level parameters in the stylesheet are silently ignored. Without this option, an error is raised, if the user tries to set a top-level parameter, which is not declared in the stylesheet. .PP The \fI-xsltmessagecmd\fR option sets a callback for xslt:message elements in the stylesheet. The actual command consists of the script, given as argument to the option, appended with the XML Fragment from instantiating the xsl:message element content as string (as if the XPath string() function would have been applied to the XML Fragment) and a flag, which indicates, if the xsl:message has an attribute "terminate" with the value "yes". .RE .TP \&\fB\fBtoXSLTcmd\fP ?\fIobjVar\fB? \&\fRIf the DOM tree represents a valid XSLT stylesheet, this method transforms the DOM tree into an xslt command, otherwise it returns error. The created xsltCmd is returnd and stored in the \fIobjVar\fR, if a var name was given. A successful transformation of the DOM tree to an xsltCmd removes the domDoc cmd and all nodeCmds of the document. .RS .PP The syntax of the created xsltCmd is: .CS \&\fBxsltCmd\fP \fBmethod\fP \fB?arg ...?\fP .CE .PP The valid methods are: .TP \&\fB\fBtransform\fP \fB?-parameters parameterList?\fP \fB?-ignoreUndeclaredParameters?\fP \fB?-xsltmessagecmd script?\fP \fIdomDoc\fB \fI?outputVar?\fB \&\fRApplies XSLT transformation on the document \&\fIdomDoc\fR. Returns a document object containing the result document of that transformation and stores it in the optional \&\fIoutputVar\fR. .RS .PP The optional \fI-parameters\fR option sets top level to string values. The \fIparameterList\fR has to be a tcl list consisting of parameter name and value pairs. .PP If the option \fI-ignoreUndeclaredParameters\fR is given, then parameter names in the \fIparameterList\fR given to the \fI-parameters\fR options that are not declared as top-level parameters in the stylesheet are silently ignored. Without this option, an error is raised, if the user tries to set a top-level parameter, which is not declared in the stylesheet. .PP The \fI-xsltmessagecmd\fR option sets a callback for xslt:message elements in the stylesheet. The actual command consists of the script, given as argument to the option, appended with the XML Fragment from instantiating the xsl:message element content as string (as if the XPath string() function would have been applied to the XML Fragment) and a flag, which indicates, if the xsl:message has an attribute "terminate" with the value "yes". .RE .TP \&\fB\fBdelete\fP \&\fRDeletes the xsltCmd and cleans up all used recourses .PP If the first argument to an xsltCmd is a domDoc or starts with a "-", then the command is processed in the same way as \&\fI transform\fR. .RE .TP \&\fB\fBnormalize\fP \fI?-forXPath?\fB \&\fRPuts all Text nodes in the document into a "normal" form where only structure (e.g., elements, comments, processing instructions and CDATA sections) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes. If the option \&\fI-forXPath\fR is given, all CDATA sections in the nodes are converted to text nodes, as a first step before the normalization. .TP \&\fB\fBnodeType\fP \&\fRReturns the node type of the document node. This is always DOCUMENT_NODE. .TP \&\fB\fBgetElementById\fP \fIid\fB \&\fRReturns the node having a id attribute with value \&\fIid\fR or the emtpy string, if no node has an id attribute with that value. .TP \&\fB\fBfirstChild\fP \fB?objVar?\fP \&\fRReturns the first top level node of the document. .TP \&\fB\fBlastChild\fP \fB?objVar?\fP \&\fRReturns the last top level node of the document. .TP \&\fB\fBappendChild\fP \fInewChild\fB \&\fRAppend \fInewChild\fR to the end of the list of top level nodes of the document. .TP \&\fB\fBremoveChild\fP \fIchild\fB \&\fRRemoves \fIchild\fR from the list of top level nodes of the document. \fIchild\fR will be part of the document fragment list after this operation. It is not physically deleted. .TP \&\fB\fBhasChildNodes\fP \&\fRReturns 1 if the document has any nodes in the tree. Otherwise 0 is returned. .TP \&\fB\fBchildNodes\fP \&\fRReturns a list of the top level nodes of the document. .TP \&\fB\fBownerDocument\fP \fB?domObjVar?\fP \&\fRReturns the document itself. .TP \&\fB\fBinsertBefore\fP \fInewChild\fB \fIrefChild\fB \&\fRInsert \fInewChild\fR before the \fIrefChild\fR into the list of top level nodes of the document. If \fIrefChild\fR is the empty string, insert \&\fInewChild\fR at the end of the top level nodes. .TP \&\fB\fBreplaceChild\fP \fInewChild\fB \fIoldChild\fB \&\fRReplace \fIoldChild\fR with \fInewChild\fR in the list of children of that node. The \fIoldChild\fR node will be part of the document fragment list after this operation. .TP \&\fB\fBappendFromList\fP \fIlist\fB \&\fRParses \fIlist\fR , creates an according DOM subtree and appends this subtree at the end of the current list of top level nodes of the document. .TP \&\fB\fBappendXML\fP \fIXMLstring\fB \&\fRParses \fIXMLstring\fR, creates an according DOM subtree and appends this subtree at the end of the current list of top level nodes of the document. .TP \&\fB\fBselectNodes\fP \fB?-namespaces prefixUriList?\fP \fB?-cache ?\fP \fIxpathQuery\fB \fB?typeVar?\fP \&\fR .RS .PP Returns the result of applying the XPath query \&\fIxpathQuery\fR to the document. The context node of the query is the root node in the sense of the XPath recommendation (not the document element). The result can be a string/value, a list of strings, a list of nodes or a list of attribute name / value pairs. If \fItypeVar\fR is given the result type name is stored into that variable (empty, bool, number, string, nodes, attrnodes or mixed). .PP The argument \fIxpathQuery\fR has to be a valid XPath expression. However, there is one exception to that rule. Tcl variable names can appear in the XPath statement at any position where it is legal according to the rules of the XPath syntax to put an XPath variable. The value of the variable is substituted for the variable name. Ignoring the syntax rules of XPath the Tcl variable name may be any legal Tcl var name: local variables, global variables, array entries and so on. .PP The option \fI-namespaces\fR expects a tcl list with prefix / namespace pairs as argument. If this option is not given, then any namespace prefix within the xpath expression will be first resolved against the list of prefix / namespace pairs set with the selectNodesNamespaces method for the document, the node belongs to. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix. If this option is given, any namespace prefix within the xpath expression will be first resolved against that given list (and ignoring the document global prefix / namespace list). If the list bind the same prefix to different namespaces, then the first binding will win. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix, as usual. .PP If the \fI-cache\fR option is used with a true value, then the \&\fIxpathQuery\fR will be looked up in a document specific cache. If the query is found, then the stored pre-compiled query will be used. If the query isn't found, it will be pre-compiled and stored in the cache, for use in further calls. Please notice, that the \fIxpathQuery\fR as given as string is used as key for the cache. This means, that equal XPath expressions, which differ only in white space are treated as different cache entries. Special care is needed, if the XPath expression includes namespace prefixes. During pre-compilation, the prefixes will be resolved first to the prefix / namespace pairs of the \fI-namespaces\fR option, if given, and to the namespaces in scope of the context node at pre-compilation time. If the XPath is found in the cache, neither the \fI-namespaces\fR option nor the namespaces in scope of the context node will be taken in account but the already resolved (stored) namespaces will be used for the query. .PP Examples: .CS set paragraphNodes [$node selectNodes {chapter[3]//para[@type='warning' or @type='error'} ] foreach paragraph $paragraphNodes { lappend values [$paragraph selectNodes attribute::type] } set doc [dom parse {}] set root [$doc documentElement] set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child] .CE .RE .TP \&\fB\fBbaseURI \fI?URI?\fB\fP \&\fRReturns the present baseURI of the document. If the optional argument URI is given, sets the base URI of the document to the given URI. .TP \&\fB\fBappendFromScript\fP \fItclScript\fB \&\fRAppends the nodes created by the \fItclScript\fR by Tcl functions, which have been built using \fIdom createNodeCmd\fR, at the end of the current list of top level nodes of the document. .TP \&\fB\fBinsertBeforeFromScript\fP \fItclScript\fB \fIrefChild\fB \&\fRInserts the nodes created in the \fItclScript\fR by Tcl functions, which have been built using \fIdom createNodeCmd\fR, before the \fIrefChild\fR into to the list of top level nodes of the document. If \fIrefChild\fR is the empty string, the new nodes will be appended. .TP \&\fB\fBdeleteXPathCache\fP \fI?xpathQuery?\fB \&\fRIf called without the optional argument, all cached XPath expressions of the document are freed. If called with the optional argument \fIxpathQuery\fR, this single XPath query will be removed from the cache, if it is there. The method always returns an empty string. .PP Otherwise, if an unknown method name is given, the command with the same name as the given metho within the namespace \fB::dom::domDoc\fR is tried to be executed. This allows quick method additions on Tcl level. .PP Newly created nodes are appended to a hidden fragment list. If they are not moved into the tree they are automaticaly deleted, when the whole document gets deleted. .SH "SEE ALSO" dom, domNode .SH KEYWORDS DOM node creation, document element tDOM-0.8.3/doc/domDoc.xml0000644000175000017500000006037210711427571015270 0ustar ssobernissoberni domDoc Manipulates an instance of a DOM document object domDocObjCmd method ?arg arg ...?
DESCRIPTION

This command manipulates one particular instance of a document object. method indicates a specific method of the document class. These methods should closely conform to the W3C recommendation "Document Object Model (Core) Level 1" (http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html). Look at these documents for a deeper understanding of the functionality.

The valid methods are:

documentElement ?objVar? Returns the top most element in the document (the root element). getElementsByTagName name Returns a list of all elements in the document matching (glob style) name. getElementsByTagNameNS uri localname Returns a list of all elements in the subtree matching (glob style) localname and having the given namespace uri. createElement tagName ?objVar? Creates (allocates) a new element node with node name tagName, append it to the hidden fragment list in the document object and returns the node object. If objVar is given the new node object store in this variable. createElementNS url tagName ?objVar? Creates (allocates) a new element node within a namespace having uri as the URI and node name tagName, which could include the namespace prefix, append it to the hidden fragment list in the document object and returns the node object. If objVar is given the new node object store in this variable. createTextNode text ?objVar? Creates (allocates) a new text node with node value text, appends it to the hidden fragment list in the document object and returns the node object. If objVar is given, the new node object is stored in this variable. createComment text ?objVar? Creates (allocates) a new comment node with value text, appends it to the hidden fragment list in the document object and returns the node object. If objVar is given, the new comment node object is stored in this variable. createCDATASection data ?objVar? Creates (allocates) a new CDATA node with node value data, appends it to the hidden fragment list in the document object and returns the node object. If objVar is given, the new node object is stored in this variable. createProcessingInstruction target data ?objVar? Creates a process instruction, appends it to the hidden fragment list in the document object and returns the node object. If objVar is given, the new node object is stored in this variable. delete Explicitly deletes the document, including the associated Tcl object commands (for nodes, fragment/new nodes, the document object itself) and the underlying DOM tree. getDefaultOutputMethod Returns the default output method of the document. This is usually a result of a XSLT transformation. asXML Returns the DOM tree as an (optional indented) XML string or sends the output directly to the given channelId. If the option -escapeNonASCII is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation. The flag -doctypeDeclaration determines, whether there will be a DOCTYPE declaration emitted before the first node of the document. The default is, to do not. The DOCTYPE name will always be the element name of the document element. An external entity declaration of the external subset is only emitted, if the document has a system identifier. If the option -escapeAllQuot is given, quotation marks will be escaped with &quot; even in text content of elements. asHTML Returns the DOM tree serialized acording to HTML rules (HTML elements are recognized regardless of case, without end tags for emtpy HTML elements etc.), as string or sends the output directly to the given channelId. If the option -escapeNonASCII is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation. If the option -htmlEntities is given, a character is outputed using a HTML 4.01 character entity reference, if one is defined for it. The flag -doctypeDeclaration determines, whether there will be a DOCTYPE declaration emitted before the first node of the document. The default is, to do not. The DOCTYPE name will always be the element name of the document element without case normalization. An external entity declaration of the external subset is only emitted, if the document has a system identifier. The doctype declaration will be written from the avaliable informations, without check, if this is a known (w3c) HTML version information or if the document confirms to the given HTML version. asText The asText method outputs the result tree by outputting the string-value of every text node in the result tree in document order without any escaping. In effect, this is what the xslt output method "text" (XSLT 1.0 recommendation, section 16.3) does. publicId ?publicId? Returns the public identifier of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the public identifier of the document is set to this value. systemId ?systemId? Returns the system identifier of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the system identifier of the document is set to this value. internalSubset ?internalSubset? Returns the internal subset of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the internal subset of the document is set to this value. Note, that none of the parsing methods preserve the internal subset of a document; a freshly parsed document will always have an empty internal subset. Also note, that the method doesen't do any syntactical check on a given internal subset. cdataSectionElements (?URI:?localname|*) ?<boolean>? This method allows to control, for which element nodes the text node childs will be serialized as CDATA sections (this affects only serialization with the asXML method, no text node is altered in any way by this method). IF the method is called with an element name as first argument and a boolean with value true as second argument, every text node child of every element node in the document with the same name as the first argument will be serialized as CDATA section. If the second argument is a boolean with value false, all text nodes of all elements with the same name as the first argument will be serialized as usual. Namespaced element names have to given in the form namespace_URI:localname, not in the otherwise usual prefix:localname form. With two arguments called, the method returns the used boolean value. If the method is called with only an element name, it will return a boolean value, indicating, if the text nodes childs of all elements with that name in the document will be serialized as CDATA section elements (return value 1) or not (return value 0). If the method is called with only one argument and that argument is an asterisk ('*'), then the method returns an unordered list of all element names of the document, for which the text node childs will be serialized as CDATA section nodes. selectNodesNamespaces This method allows to control a document global prefix to namespace URI mapping, which will be used for selectNodes method calls (on document as well as on all nodes, which belongs to the document), if it is not overwritten by using the -namespaces option of the selectNodes method. Any namespace prefix within an xpath expression will be first resolved against this list. If the list bind the same prefix to different namespaces, then the first binding will win. If a prefix could not resolved against the document global prefix / namespaces list, then the namespace definitions in scope of the context node will be used to resolve the prefix, as usual. If the optional argument prefixUriList is given, then the global prefix / namespace list is set to this list and returns it. Without the optional argument the method returns the current list. The default is the empty list. xslt stylesheet ?outputVar? Applies an XSLT transformation on the whole document of the node object using the XSLT stylesheet (given as domDoc). Returns a document object containing the result document of the transformation and stores that document object in the optional outputVar, if that was given.

The optional -parameters option sets top level <xsl:param> to string values. The parameterList has to be a tcl list consisting of parameter name and value pairs.

If the option -ignoreUndeclaredParameters is given, then parameter names in the parameterList given to the -parameters options that are not declared as top-level parameters in the stylesheet are silently ignored. Without this option, an error is raised, if the user tries to set a top-level parameter, which is not declared in the stylesheet.

The -xsltmessagecmd option sets a callback for xslt:message elements in the stylesheet. The actual command consists of the script, given as argument to the option, appended with the XML Fragment from instantiating the xsl:message element content as string (as if the XPath string() function would have been applied to the XML Fragment) and a flag, which indicates, if the xsl:message has an attribute "terminate" with the value "yes".

toXSLTcmd ?objVar? If the DOM tree represents a valid XSLT stylesheet, this method transforms the DOM tree into an xslt command, otherwise it returns error. The created xsltCmd is returnd and stored in the objVar, if a var name was given. A successful transformation of the DOM tree to an xsltCmd removes the domDoc cmd and all nodeCmds of the document.

The syntax of the created xsltCmd is:

xsltCmd

The valid methods are:

transform domDoc ?outputVar? Applies XSLT transformation on the document domDoc. Returns a document object containing the result document of that transformation and stores it in the optional outputVar.

The optional -parameters option sets top level <xsl:param> to string values. The parameterList has to be a tcl list consisting of parameter name and value pairs.

If the option -ignoreUndeclaredParameters is given, then parameter names in the parameterList given to the -parameters options that are not declared as top-level parameters in the stylesheet are silently ignored. Without this option, an error is raised, if the user tries to set a top-level parameter, which is not declared in the stylesheet.

The -xsltmessagecmd option sets a callback for xslt:message elements in the stylesheet. The actual command consists of the script, given as argument to the option, appended with the XML Fragment from instantiating the xsl:message element content as string (as if the XPath string() function would have been applied to the XML Fragment) and a flag, which indicates, if the xsl:message has an attribute "terminate" with the value "yes".

delete Deletes the xsltCmd and cleans up all used recourses

If the first argument to an xsltCmd is a domDoc or starts with a "-", then the command is processed in the same way as <xsltCmd> transform.

normalize ?-forXPath? Puts all Text nodes in the document into a "normal" form where only structure (e.g., elements, comments, processing instructions and CDATA sections) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes. If the option -forXPath is given, all CDATA sections in the nodes are converted to text nodes, as a first step before the normalization. nodeType Returns the node type of the document node. This is always DOCUMENT_NODE. getElementById id Returns the node having a id attribute with value id or the emtpy string, if no node has an id attribute with that value. firstChild ?objVar? Returns the first top level node of the document. lastChild ?objVar? Returns the last top level node of the document. appendChild newChild Append newChild to the end of the list of top level nodes of the document. removeChild child Removes child from the list of top level nodes of the document. child will be part of the document fragment list after this operation. It is not physically deleted. hasChildNodes Returns 1 if the document has any nodes in the tree. Otherwise 0 is returned. childNodes Returns a list of the top level nodes of the document. ownerDocument ?domObjVar? Returns the document itself. insertBefore newChild refChild Insert newChild before the refChild into the list of top level nodes of the document. If refChild is the empty string, insert newChild at the end of the top level nodes. replaceChild newChild oldChild Replace oldChild with newChild in the list of children of that node. The oldChild node will be part of the document fragment list after this operation. appendFromList list Parses list , creates an according DOM subtree and appends this subtree at the end of the current list of top level nodes of the document. appendXML XMLstring Parses XMLstring, creates an according DOM subtree and appends this subtree at the end of the current list of top level nodes of the document. selectNodes xpathQuery

Returns the result of applying the XPath query xpathQuery to the document. The context node of the query is the root node in the sense of the XPath recommendation (not the document element). The result can be a string/value, a list of strings, a list of nodes or a list of attribute name / value pairs. If typeVar is given the result type name is stored into that variable (empty, bool, number, string, nodes, attrnodes or mixed).

The argument xpathQuery has to be a valid XPath expression. However, there is one exception to that rule. Tcl variable names can appear in the XPath statement at any position where it is legal according to the rules of the XPath syntax to put an XPath variable. The value of the variable is substituted for the variable name. Ignoring the syntax rules of XPath the Tcl variable name may be any legal Tcl var name: local variables, global variables, array entries and so on.

The option -namespaces expects a tcl list with prefix / namespace pairs as argument. If this option is not given, then any namespace prefix within the xpath expression will be first resolved against the list of prefix / namespace pairs set with the selectNodesNamespaces method for the document, the node belongs to. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix. If this option is given, any namespace prefix within the xpath expression will be first resolved against that given list (and ignoring the document global prefix / namespace list). If the list bind the same prefix to different namespaces, then the first binding will win. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix, as usual.

If the -cache option is used with a true value, then the xpathQuery will be looked up in a document specific cache. If the query is found, then the stored pre-compiled query will be used. If the query isn't found, it will be pre-compiled and stored in the cache, for use in further calls. Please notice, that the xpathQuery as given as string is used as key for the cache. This means, that equal XPath expressions, which differ only in white space are treated as different cache entries. Special care is needed, if the XPath expression includes namespace prefixes. During pre-compilation, the prefixes will be resolved first to the prefix / namespace pairs of the -namespaces option, if given, and to the namespaces in scope of the context node at pre-compilation time. If the XPath is found in the cache, neither the -namespaces option nor the namespaces in scope of the context node will be taken in account but the already resolved (stored) namespaces will be used for the query.

Examples:

set paragraphNodes [$node selectNodes {chapter[3]//para[@type='warning' or @type='error'} ] foreach paragraph $paragraphNodes { lappend values [$paragraph selectNodes attribute::type] } set doc [dom parse {<doc xmlns="http://www.defaultnamespace.org"><child/></doc>}] set root [$doc documentElement] set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child]
baseURI ?URI? Returns the present baseURI of the document. If the optional argument URI is given, sets the base URI of the document to the given URI. appendFromScript tclScript Appends the nodes created by the tclScript by Tcl functions, which have been built using dom createNodeCmd, at the end of the current list of top level nodes of the document. insertBeforeFromScript tclScript refChild Inserts the nodes created in the tclScript by Tcl functions, which have been built using dom createNodeCmd, before the refChild into to the list of top level nodes of the document. If refChild is the empty string, the new nodes will be appended. deleteXPathCache ?xpathQuery? If called without the optional argument, all cached XPath expressions of the document are freed. If called with the optional argument xpathQuery, this single XPath query will be removed from the cache, if it is there. The method always returns an empty string.

Otherwise, if an unknown method name is given, the command with the same name as the given metho within the namespace ::dom::domDoc is tried to be executed. This allows quick method additions on Tcl level.

Newly created nodes are appended to a hidden fragment list. If they are not moved into the tree they are automaticaly deleted, when the whole document gets deleted.

dom domNode DOM node creation document element
tDOM-0.8.3/doc/tdomcmd.n0000644000175000017500000000743607521023757015154 0ustar ssobernissoberni'\" '\" Generated from tdomcmd.xml '\" '\" BEGIN man.macros .if t .wh -1.3i ^B .nr ^l \n(.l .ad b .de AP .ie !"\\$4"" .TP \\$4 .el \{\ . ie !"\\$2"" .TP \\n()Cu . el .TP 15 .\} .ta \\n()Au \\n()Bu .ie !"\\$3"" \{\ \&\\$1 \\fI\\$2\\fP (\\$3) .\".b .\} .el \{\ .br .ie !"\\$2"" \{\ \&\\$1 \\fI\\$2\\fP .\} .el \{\ \&\\fI\\$1\\fP .\} .\} .. .de AS .nr )A 10n .if !"\\$1"" .nr )A \\w'\\$1'u+3n .nr )B \\n()Au+15n .\" .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n .nr )C \\n()Bu+\\w'(in/out)'u+2n .. .AS Tcl_Interp Tcl_CreateInterp in/out .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. .de BE .nf .ti 0 .mk ^t .ie n \l'\\n(^lu\(ul' .el \{\ .\" Draw four-sided box normally, but don't draw top of .\" box if the box started on an earlier page. .ie !\\n(^b-1 \{\ \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .el \}\ \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .\} .fi .br .nr ^b 0 .. .de VS .if !"\\$2"" .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. .de VE .ie n 'mc .el \{\ .ev 2 .nf .ti 0 .mk ^t \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' .sp -1 .fi .ev .\} .nr ^v 0 .. .de ^B .ev 2 'ti 0 'nf .mk ^t .if \\n(^b \{\ .\" Draw three-sided box if this is the box's first page, .\" draw two sides but no top otherwise. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .\} .if \\n(^v \{\ .nr ^x \\n(^tu+1v-\\n(^Yu \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c .\} .bp 'fi .ev .if \\n(^b \{\ .mk ^y .nr ^b 2 .\} .if \\n(^v \{\ .mk ^Y .\} .. .de DS .RS .nf .sp .. .de DE .fi .RE .sp .. .de SO .SH "STANDARD OPTIONS" .LP .nf .ta 5.5c 11c .ft B .. .de SE .fi .ft R .LP See the \\fBoptions\\fR manual entry for details on the standard options. .. .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. .de CS .RS .nf .ta .25i .5i .75i 1i .if t .ft C .. .de CE .fi .if t .ft R .RE .. .de UL \\$1\l'|0\(ul'\\$2 .. '\" END man.macros .TH tdom n "" Tcl "" .BS .SH NAME tdom \- tdom is an expat parser object extension to create an in-memory DOM tree from the input while parsing. .SH SYNOPSIS .nf package require tdom set parser [expat] tdom $parser enable .fi .BE .SH DESCRIPTION .PP \&\fItdom\fR adds the C handler set "tdom" to an tcl expat parser obj. This handler set builds an in-memory DOM tree out of the input, parsed by the parser. A DOM tree created this way behave exactly like a DOM tree created by the "dom" command (see there). In fact, tdom is only another interface to the same functionality; it uses the code behind the \&\fBdom\fR code for building the DOM tree. .TP \&\fB\fBtdom\fP \fIparserObj\fB \fBenable\fP \&\fR .RS .PP Adds the tdom C handler set to a Tcl expat parser object. Next time, the parser parses input, the tdom C handler functions create an in-memory DOM tree. .RE .TP \&\fB\fBtdom\fP \fIparserObj\fB \fBgetdoc\fP \&\fR .RS .PP Returns the DOM tree as domDoc (see there) object. .RE .TP \&\fB\fBtdom\fP \fIparserObj\fB \fBsetResultEncoding\fP \&\fR .RS .PP See the method \fBsetResultEncoding\fR of the \&\fBdom\fP command. .RE .TP \&\fB\fBtdom\fP \fIparserObj\fB \fBsetStoreLineColumn\fP ?\fIboolean\fB? \&\fR .RS .PP See the method \fBsetStoreLineColumn\fR of the \&\fBdom\fP command. .RE .TP \&\fB\fBtdom\fP \fIparserObj\fB \fBremove\fP \&\fR .RS .PP Removes the tdom C handler set from the parser object. .RE .TP \&\fB\fBtdom\fP \fIparserObj\fB \fBkeepEmpties\fP \&\fR .RS .PP See the option \fB-keepEmpties\fR of the \fBdom\fP command. .RE .TP \&\fB\fBtdom\fP \fIparserObj\fB \fBsetExternalEntityResolver\fP \fIscript\fB \&\fR .SH "SEE ALSO" dom, expat .SH KEYWORDS DOM, SAX, C handler set tDOM-0.8.3/doc/dom.xml0000644000175000017500000004447610170564412014644 0ustar ssobernissoberni dom Create an in-memory DOM tree from XML package require tdom dom method ?arg arg ...?
DESCRIPTION

This command provides the creation of complete DOM trees in memory. In the usual case a string containing a XML information is parsed and converted into a DOM tree. method indicates a specific subcommand.

The valid methods are:

dom parse ?options? ?data? Parses the XML information and builds up the DOM tree in memory providing a Tcl object command to this DOM document object. Example: dom parse $xml doc $doc documentElement root

parses the XML in the variable xml, creates the DOM tree in memory, make a reference to the document object, visible in Tcl as a document object command, and assigns this new object name to the variable doc. When doc gets freed, the DOM tree and the associated Tcl command object (document and all node objects) are freed automatically.

set document [dom parse $xml] set root [$document documentElement]

parses the XML in the variable xml, creates the DOM tree in memory, make a reference to the document object, visible in Tcl as a document object command, and returns this new object name, which is then stored in document. To free the underlying DOM tree and the associative Tcl object commands (document + nodes + fragment nodes) the document object command has to be explicitly deleted by:

$document delete or rename $document ""

The valid options are:

-simple If -simple is specified, a simple but fast parser is used (conforms not fully to XML recommendation). That should double parsing and DOM generation speed. The encoding of the data is not transformed inside the parser. The simple parser does not respect any encoding information in the XML declaration. It skips over the internal DTD subset and ignores any information in it. Therefor it doesn't include defaulted attribute values into the tree, even if the according attribute declaration is in the internal subset. It also doesn't expand internal or external entity references other than the predefined entities and character references. -html If -html is specified, a fast HTML parser is used, which tries to even parse badly formed HTML into a DOM tree. -keepEmpties If -keepEmpties is specified, text nodes, which contain only whitespaces, will be part of the resulting DOM tree. In default case (-keepEmpties not given) those empty text nodes are removed at parsing time. -channel <channel-ID> If -channel <channel-ID> is specified, the input to be parsed is read from the specified channel. The encoding setting of the channel (via fconfigure -encoding) is respected, ie the data read from the channel are converted to UTF-8 according to the encoding settings, befor the data is parsed. -baseurl <baseURI> If -baseurl <baseURI> is specified, the baseURI is used as the base URI of the document. External entities referenced in the document are resolved relative to this base URI. This base URI is also stored within the DOM tree. -feedbackAfter <#bytes> If -feedbackAfter <#bytes> is specified, the tcl command ::dom::domParseFeedback is evaluated after parsing every #bytes. If you use this option, you have to create a tcl proc named ::dom::domParseFeedback, otherwise you will get an error. Please notice, that the calls of ::dom::domParseFeedback are not done exactly every #bytes, but always at the first element start after every #bytes. -externalentitycommand <script> If -externalentitycommand <script> is specified, the specified tcl script is called to resolve any external entities of the document. The actual evaluated command consists of this option followed by three arguments: the base uri, the system identifier of the entity and the public identifier of the entity. The base uri and the public identifier may be the empty list. The script has to return a tcl list consisting of three elements. The first element of this list signals, how the external entity is returned to the processor. At the moment, the two allowed types are "string" and "channel". The second element of the list has to be the (absolute) base URI of the external entity to be parsed. The third element of the list are data, either the already read data out of the external entity as string in the case of type "string", or the name of a tcl channel, in the case of type "channel". Note that if the script returns a tcl channel, it will not be closed by the processor. It must be closed separately if it is no longer required. -useForeignDTD <boolean> If <boolean> is true and the document does not have an external subset, the parser will call the -externalentitycommand script with empty values for the systemId and publicID arguments. Pleace notice, that, if the document also doesn't have an internal subset, the -startdoctypedeclcommand and -enddoctypedeclcommand scripts, if set, are not called. The -useForeignDTD respects -paramentityparsing <always|never|notstandalone> The -paramentityparsing option controls, if the parser tries to resolve the external entities (including the external DTD subset) of the document, while building the DOM tree. -paramentityparsing requires an argument, which must be either "always", "never", or "notstandalone". The value "always" means, that the parser tries to resolves (recursively) all external entities of the XML source. This is the default, in case -paramentityparsing is omitted. The value "never" means, that only the given XML source is parsed and no external entity (including the external subset) will be resolved and parsed. The value "notstandalone" means, that all external entities will be resolved and parsed, with the execption of documents, which explicitly states standalone="yes" in their XML declaration.

dom createDocument docElemName ?objVar? Creates a new DOM document object with one element node with node name docElemName. The objVar controls the memory handling as explained above. dom createDocumentNS uri docElemName ?objVar? Creates a new DOM document object with one element node with node name docElemName. Uri gives the namespace of the document element to create. The objVar controls the memory handling as explained above. dom createDocumentNode ?objVar? Creates a new, 'empty' DOM document object without any element node. objVar controls the memory handling as explained above. dom setResultEncoding ?encodingName? If encodingName is not given the current global result encoding is returned. Otherwise the global result encoding is set to encodingName. All character data, attribute values, etc. will then be converted from UTF-8, which is delivered from the Expat XML parser, to the given 8 bit encoding at XML/DOM parse time. Valid values for encodingName are: utf-8, ascii, cp1250, cp1251, cp1252, cp1253, cp1254, cp1255, cp1256, cp437, cp850, en, iso8859-1, iso8859-2, iso8859-3, iso8859-4, iso8859-5, iso8859-6, iso8859-7, iso8859-8, iso8859-9, koi8-r. dom createNodeCmd ?-returnNodeCmd? (element|comment|text|cdata|pi)Node commandName This method creates Tcl commands, which in turn create tDOM nodes. Tcl commands created by this command are only avaliable inside a script given to the domNode method appendFromScript. If a command created with createNodeCmd is invoked in any other context, it will return error. The created command commandName replaces any existing command or procedure with that name. If the commandName includes any namespace qualifiers, it is created in the specified namespace.

If such command is invoked inside a script given as argument to the domNode method appendFromScript, it creates a new node and appends this node at the end of the child list of the invoking element node. If the option -returnNodeCmd was given, the command returns the created node as Tcl command. If this option was omitted, the command returns nothing. Each command creates always the same type of node. Which type of node is created by the command is determined by the first argument to the createNodeCmd. The syntax of the created command depends on the type of the node it creates.

If the first argument of the method is elementNode, the created command will create an element node. The tag name of the created node is commandName without namespace qualifiers. The syntax of the created command is:

elementNodeCmd ?attributeName attributeValue ...? ?script? elementNodeCmd ?-attributeName attributeValue ...? ?script? elementNodeCmd name_value_list script

The command syntax allows three different ways to specify the attributes of the resulting element. These could be specified with attributeName attributeValue argument pairs, in an "option style" way with -attriubteName attributeValue argument pairs (the '-' character is only syntactical sugar and will be stripped off) or as a Tcl list with elements interpreted as attribute name and the corresponding attribute value. The attribute name elements in the list may have a leading '-' character, which will be stripped off.

Every elementNodeCmd accepts an optional Tcl script as last argument. This script is evaluated as recursive appendFromScript script with the node created by the elementNodeCmd as parent of all nodes created by the script.

If the first argument of the method is textNode, the command will create a text node. The syntax of the created command is:

textNodeCmd ?-disableOutputEscaping? data

If the optional flag -disableOutputEscaping is given, the escaping of the ampersand character (&) and the left angle bracket (<) inside the data is disabled. You should use this flag carefully.

If the first argument of the method is commentNode, or cdataNode, the command will create an comment node or CDATA section node. The syntax of the created command is:

nodeCmd data

If the first argument of the method is piNode, the command will create a processing instruction node. The syntax of the created command is:

piNodeCmd target data
dom setStoreLineColumn ?boolean? If switched on, the DOM nodes will contain line and column position information for the original XML document after parsing. The default is, not to store line and column position information. dom setNameCheck ?boolean? If NameCheck is true, every method which expects an XML Name, a full qualified name or a processing instructing target will check, if the given string is valid according to his production rule. For commands created with the createNodeCmd method to be used in the context of appendFromScript the status of the flag at creation time decides. If NameCheck is true at creation time, the command will check his arguments, otherwise not. The setNameCheck set this flag. It returns the current NameCheck flag state. The default state for NameCheck is true. dom setTextCheck ?boolean? If TextCheck is true, every command which expects XML Chars, a comment, a CDATA section value or a processing instructing value will check, if the given string is valid according to his production rule. For commands created with the createNodeCmd method to be used in the context of appendFromScript the status of the flag at creation time decides. If TextCheck is true at creation time, the command will check his arguments, otherwise not.The setTextCheck method set this flag. It returns the current TextCheck flag state. The default state for TextCheck is true. dom setObjectCommands ?(automatic|token|command)? Controls, if documents and nodes are created as tcl commands or as token to be used with the domNode and domDoc commands. If the mode is 'automatic', then methods used at tcl commands will create tcl commands and methods used at doc or node tokes will create tokens. If the mode is 'command' then always tcl commands will be created. If the mode is 'token', then always token will be created. The method returns the current mode. This method is an experimental interface. dom isName name Returns 1, if name is a valid XML Name according to production 5 of the XML 1.0 recommendation. This means, that name is a valid XML element or attribute name. Otherwise it returns 0. dom isPIName name Returns 1, if name is a valid XML processing instruction target according to production 17 of the XML 1.0 recommendation. Otherwise it returns 0. dom isNCName name Returns 1, if name is a valid NCName according to production 4 of the of the Namespaces in XML recommendation. Otherwise it returns 0. dom isQName name Returns 1, if name is a valid QName according to production 6 of the of the Namespaces in XML recommendation. Otherwise it returns 0. dom isCharData string Returns 1, if every character in string is a valid XML Char according to production 2 of the XML 1.0 recommendation. Otherwise it returns 0. dom isComment string Returns 1, if string is a valid comment according to production 15 of the XML 1.0 recommendation. Otherwise it returns 0. dom isCDATA string Returns 1, if string is valid according to production 20 of the XML 1.0 recommendation. Otherwise it returns 0. dom isPIValue string Returns 1, if string is valid according to production 16 of the XML 1.0 recommendation. Otherwise it returns 0.
XML DOM document node parsing
tDOM-0.8.3/doc/manpage.css0000644000175000017500000000726107504214756015466 0ustar ssobernissoberni/* * $Id: manpage.css,v 1.2 2002/06/19 23:55:26 rolf Exp $ * Author: Joe English, * Created: 26 Jun 2000 * Description: CSS stylesheet for TCL man pages */ HTML { background: #FFFFFF; color: black; } BODY { background: #FFFFFF; color: black; } DIV.body { margin-left: 10%; margin-right: 10%; } DIV.header,DIV.footer { width: 100%; margin-left: 0%; margin-right: 0%; } DIV.body H1,DIV.body H2 { margin-left: -5%; } /* Navigation material: */ DIV.navbar { width: 100%; margin-top: 5pt; margin-bottom: 5pt; margin-left: 0%; margin-right: 0%; padding-top: 5pt; padding-bottom: 5pt; background: #DDDDDD; color: black; border: 1px solid black; text-align: center; font-size: small; font-family: sans-serif; } P.navaid { text-align: center; } .navaid { font-size: small; font-family: sans-serif; } A.navaid:link { color: green; background: transparent; } A.navaid:visited { color: green; background: transparent; } A.navaid:active { color: yellow; background: transparent; } /* For most anchors, we should leave colors up to the user's preferences. */ /*-- A:link { color: blue; background: transparent; } A:visited { color: purple; background: transparent; } A:active { color: red; background: transparent; } --*/ H1, H2, H3, H4 { margin-top: 1em; font-family: sans-serif; font-size: large; color: #005A9C; background: transparent; text-align: left; } H1.title { text-align: center; } UL,OL { margin-right: 0em; margin-top: 3pt; margin-bottom: 3pt; } UL LI { list-style: disc; } OL LI { list-style: decimal; } DT { padding-top: 1ex; } DL.toc { font: normal 12pt/16pt sans-serif; margin-left: 10%; } UL.toc,UL.toc UL, UL.toc UL UL { font: normal 12pt/14pt serif; list-style: none; } LI.tocentry,LI.tocheading { list-style: none; margin-left: 0em; text-indent: 0em; padding: 0em; } .tocheading { font-family: sans-serif; font-weight: bold; color: #005A9C; background: transparent; } PRE { display: block; font-family: monospace; white-space: pre; margin: 0%; padding-top: 0.5ex; padding-bottom: 0.5ex; padding-left: 1ex; padding-right: 1ex; width: 100%; } PRE.syntax { color: black; background: #80ffff; border: 1px solid black; font-family: serif; } PRE.example { color: black; background: #f5dcb3; border: 1px solid black; } DIV.arglist { border: 1px solid black; width: 100%; } TH, THEAD TR, TR.heading { color: #005A9C; background: #DDDDDD; text-align: center; font-family: sans-serif; font-weight: bold; } TR.syntax { color: black; background: #80ffff; } TR.desc { color: black; background: #f5dcb3; } /* TR.row[01] are used to get alternately colored table rows. * Could probably choose better colors here... */ TR.row0 { color: black; background: #efffef; } TR.row1 { color: black; background: #efefff; } /* Workaround for Netscape bugs: * Netscape doesn't seem to compute table widths properly. * unless they're wrapped inside a DIV. (Additionally, * it appears to require a non-zero border-width.) */ DIV.table { border-width: 1px; border-color: white; width: 100%; } DIV.menu { /* Wrapper for TABLE class="menu" */ margin-top: 10px; margin-bottom: 10px; border: thin solid #005A9C; width: 100%; margin-left: 5%; } VAR { font-style: italic; } /* For debugging: highlight unrecognized elements: */ .unrecognized { color: red; background: green; } /* EOF */ tDOM-0.8.3/doc/tnc.n0000644000175000017500000001466007625770004014305 0ustar ssobernissoberni'\" '\" Generated from tnc.xml '\" '\" BEGIN man.macros .if t .wh -1.3i ^B .nr ^l \n(.l .ad b .de AP .ie !"\\$4"" .TP \\$4 .el \{\ . ie !"\\$2"" .TP \\n()Cu . el .TP 15 .\} .ta \\n()Au \\n()Bu .ie !"\\$3"" \{\ \&\\$1 \\fI\\$2\\fP (\\$3) .\".b .\} .el \{\ .br .ie !"\\$2"" \{\ \&\\$1 \\fI\\$2\\fP .\} .el \{\ \&\\fI\\$1\\fP .\} .\} .. .de AS .nr )A 10n .if !"\\$1"" .nr )A \\w'\\$1'u+3n .nr )B \\n()Au+15n .\" .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n .nr )C \\n()Bu+\\w'(in/out)'u+2n .. .AS Tcl_Interp Tcl_CreateInterp in/out .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. .de BE .nf .ti 0 .mk ^t .ie n \l'\\n(^lu\(ul' .el \{\ .\" Draw four-sided box normally, but don't draw top of .\" box if the box started on an earlier page. .ie !\\n(^b-1 \{\ \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .el \}\ \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .\} .fi .br .nr ^b 0 .. .de VS .if !"\\$2"" .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. .de VE .ie n 'mc .el \{\ .ev 2 .nf .ti 0 .mk ^t \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' .sp -1 .fi .ev .\} .nr ^v 0 .. .de ^B .ev 2 'ti 0 'nf .mk ^t .if \\n(^b \{\ .\" Draw three-sided box if this is the box's first page, .\" draw two sides but no top otherwise. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .\} .if \\n(^v \{\ .nr ^x \\n(^tu+1v-\\n(^Yu \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c .\} .bp 'fi .ev .if \\n(^b \{\ .mk ^y .nr ^b 2 .\} .if \\n(^v \{\ .mk ^Y .\} .. .de DS .RS .nf .sp .. .de DE .fi .RE .sp .. .de SO .SH "STANDARD OPTIONS" .LP .nf .ta 5.5c 11c .ft B .. .de SE .fi .ft R .LP See the \\fBoptions\\fR manual entry for details on the standard options. .. .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. .de CS .RS .nf .ta .25i .5i .75i 1i .if t .ft C .. .de CE .fi .if t .ft R .RE .. .de UL \\$1\l'|0\(ul'\\$2 .. '\" END man.macros .TH tnc n "" Tcl "" .BS .SH NAME tnc \- tnc is an expat parser object extension, that validates the XML stream against the document DTD while parsing. .SH SYNOPSIS .nf package require tdom package require tnc set parser [expat] tnc $parser enable .fi .BE .SH DESCRIPTION .PP \&\fItnc\fR adds the C handler set "tnc" to a tcl expat parser obj. This handler set is a simple DTD validator. If the validator detects a validation error, it sets the interp result, signals error and stops parsing. There isn't any validation error recovering. As a consequence, only valid documents are completely parsed. .PP This handler set has only three methods: .TP \&\fB\fBtnc\fP \fIparserObj\fB \fBenable\fP \&\fR .RS .PP Adds the tnc C handler set to a Tcl expat parser object. .RE .TP \&\fB\fBtnc\fP \fIparserObj\fB \fBremove\fP \&\fR .RS .PP Removes the tnc validatore from the parser \fIparserObj\fR and frees all information, stored by it. .RE .TP \&\fB\fBtnc\fP \fIparserObj\fB \fBgetValidateCmd\fP \fB?validateCmdName?\fP \&\fR .RS .PP Returns a new created validation command, if one is avaliable from the parser command, otherwise it signals error. The name of the validation command is the \fIvalidateCmdName\fR, if this optional argument was given, or a random choosen name. A validation command is avaliable in a parser command, if the parser with tnc enabled was previously used, to parse an XML document with a valid doctype declaration, a valid external subset, if one was given by the doctype declaration, and a valid internal subset. The further document doesn't need to be valid, to make the validation command avaliable. The validation command can only get received one time from the parser command. The created validation command has this syntax: .CS \&\fBvalidationCmd\fP \fImethod\fR \fI?args?\fR .CE .PP The valid methods are: .TP \&\fB\fBvalidateDocument\fP \fIdomDocument\fB \fI?varName?\fB \&\fRChecks, if the given domDocument is valid against the DTD information represented by the validation command. Returns 1, if the document ist valid, 0 otherwise. If the \fIvarName\fR argument is given, then the variable it names is set to the detected reason for the validation error or to the empty string in case of a valid document. .TP \&\fB\fBvalidateTree\fP \fIelementNode\fB \fI?varName?\fB \&\fRChecks, if the given subtree with \fIdomNode\fR as root element is a posible valid subtree of a document conforming to the DTD information represented by teh validation command. IDREF could not checked, while validating only a subtree, but it is checked, that every known ID attribute in the subtree is unique. Returns 1, if the subtree is OK, 0 otherwise. If the \&\fIvarName\fR argument is given, then the variable it names is set to the detected reason for the validation error or to the empty string in case of a valid subtree. .TP \&\fB\fBvalidateAttributes\fP \fIelementNode\fB \fI?varName?\fB \&\fRChecks, if there is an element declaration for the name of the \&\fIelementNode\fR in the DTD represented by the validation command and, if yes, if the attributes of the \fIelementNode\fR are conform to the ATTLIST declarations for that element in the DTD. Returns 1, if the attributes and there value types are OK, 0 otherwise. If the \fIvarName\fR argument is given, then the variable it names is set to the detected reason for the validation error or to the empty string in case the element has all its required attributes, only declared attributes and the values of the attributes matches there type. .TP \&\fB\fBdelete\fP \&\fRDeletes the validation command and frees the memory used by it. Returns the empty string. .RE .SH BUGS .PP The validation error reports could be much more informative and user-friendly. .PP The validator doesn't detect ambiguous content models (see XML recomendation Section 3.2.1 and Appendix E). Most Java validators also doesn't, but handle such content models right anyhow. Tnc does not; if your DTD has such ambiguous content models, tnc can not used to validate documents against such (not completely XML spec compliant) DTDs. .PP It isn't possible to validate XML documents with standalone="yes" in the XML Declaration .PP Violations of the validity constraints Proper Group/PE Nesting and Proper Conditional Section/PE Nesting are not detected. They could only happen inside a invalid DTD, not in the content of a document. .SH KEYWORDS Validation, DTD tDOM-0.8.3/doc/tnc.html0000644000175000017500000001431007625770000015000 0ustar ssobernissoberni tDOM manual: tnc

NAME

tnc -
tnc is an expat parser object extension, that validates the XML stream against the document DTD while parsing.

SYNOPSIS

package require tdom
package require tnc

set parser [expat]

tnc $parser enable

DESCRIPTION

tnc adds the C handler set "tnc" to a tcl expat parser obj. This handler set is a simple DTD validator. If the validator detects a validation error, it sets the interp result, signals error and stops parsing. There isn't any validation error recovering. As a consequence, only valid documents are completely parsed.

This handler set has only three methods:

tnc parserObj enable

Adds the tnc C handler set to a Tcl expat parser object.

tnc parserObj remove

Removes the tnc validatore from the parser parserObj and frees all information, stored by it.

tnc parserObj getValidateCmd ?validateCmdName?

Returns a new created validation command, if one is avaliable from the parser command, otherwise it signals error. The name of the validation command is the validateCmdName, if this optional argument was given, or a random choosen name. A validation command is avaliable in a parser command, if the parser with tnc enabled was previously used, to parse an XML document with a valid doctype declaration, a valid external subset, if one was given by the doctype declaration, and a valid internal subset. The further document doesn't need to be valid, to make the validation command avaliable. The validation command can only get received one time from the parser command. The created validation command has this syntax:

validationCmd method ?args?

The valid methods are:

validateDocument domDocument ?varName?
Checks, if the given domDocument is valid against the DTD information represented by the validation command. Returns 1, if the document ist valid, 0 otherwise. If the varName argument is given, then the variable it names is set to the detected reason for the validation error or to the empty string in case of a valid document.
validateTree elementNode ?varName?
Checks, if the given subtree with domNode as root element is a posible valid subtree of a document conforming to the DTD information represented by teh validation command. IDREF could not checked, while validating only a subtree, but it is checked, that every known ID attribute in the subtree is unique. Returns 1, if the subtree is OK, 0 otherwise. If the varName argument is given, then the variable it names is set to the detected reason for the validation error or to the empty string in case of a valid subtree.
validateAttributes elementNode ?varName?
Checks, if there is an element declaration for the name of the elementNode in the DTD represented by the validation command and, if yes, if the attributes of the elementNode are conform to the ATTLIST declarations for that element in the DTD. Returns 1, if the attributes and there value types are OK, 0 otherwise. If the varName argument is given, then the variable it names is set to the detected reason for the validation error or to the empty string in case the element has all its required attributes, only declared attributes and the values of the attributes matches there type.
delete
Deletes the validation command and frees the memory used by it. Returns the empty string.

BUGS

The validation error reports could be much more informative and user-friendly.

The validator doesn't detect ambiguous content models (see XML recomendation Section 3.2.1 and Appendix E). Most Java validators also doesn't, but handle such content models right anyhow. Tnc does not; if your DTD has such ambiguous content models, tnc can not used to validate documents against such (not completely XML spec compliant) DTDs.

It isn't possible to validate XML documents with standalone="yes" in the XML Declaration

Violations of the validity constraints Proper Group/PE Nesting and Proper Conditional Section/PE Nesting are not detected. They could only happen inside a invalid DTD, not in the content of a document.

KEYWORDS

Validation, DTD

tDOM-0.8.3/doc/keyword-index.html0000644000175000017500000001172310114755302017005 0ustar ssobernissoberni tDOM manual: Keyword Index

tDOM manual: Keywords

tDOM-0.8.3/doc/expatapi.html0000644000175000017500000003113007557625506016044 0ustar ssobernissoberni tDOM manual: expatapi

NAME

CheckExpatParserObj, CHandlerSetInstall, CHandlerSetRemove, CHandlerSetCreate, CHandlerSetGetUserData, GetExpatInfo -
Functions to create, install and remove expat parser object extensions.

SYNOPSIS

#include <tclexpat.h>

int 
CheckExpatParserObj (interp, nameObj)  

int
CHandlerSetInstall (interp, expatObj, handlerSet)

int 
CHandlerSetRemove (interp, expatObj, handlerSetName)

CHandlerSet*
CHandlerSetCreate (handlerSetName)

CHandlerSet*
CHandlerSetGet (interp, expatObj, handlerSetName)

void*
CHandlerSetGetUserData (interp, expatObj, handlerSetName)

TclGenExpatInfo*
GetExpatInfo (interp, expatObj)

ARGUMENTS

TypeNameMode
Tcl_Interp*interpin
 Interpreter with the expat parser object.
Tcl_Obj*expatObjin
 A Tcl Object containing the command name of the expat parser object to be queried or modified.
char*handlerSetNamein
 Identifier of the handler set.
CHandlerSet*handlerSetin
 Pointer to a C handler set.
Tcl_Obj*nameObj
 A Tcl Object containing the name of a expat parser object

DESCRIPTION

The functions described in this manual allows to add C level coded event handler to an tDOM Tcl expat parser objects. A tDOM Tcl expat parser object is able to have several Tcl scripts and C functions associated with an specific event. If the event occurs, first the Tcl scripts then the C functions associated with the event are called in turn.

A tDOM Tcl expat parser extension is an ordinary Tcl extension and loaded like every other Tcl extension. It must install at least one new Tcl Level command, that manipulates a tDOM Tcl expat parser object.

A C level handler set is a data structure like this:

typedef struct CHandlerSet {
    struct CHandlerSet *nextHandlerSet;
    char *name;                     /* refname of the handler set */
    int ignoreWhiteCDATAs;          /* ignore 'white' CDATA sections */

    void *userData;                 /* Handler set specific Data Structure;
                                       the C handler set extention has to
                                       malloc the needed structure in his
                                       init func and has to provide a
                                       cleanup func (to free it). */

    CHandlerSet_userDataReset        resetProc;
    CHandlerSet_userDataFree         freeProc;

    /* C func for element start */
    XML_StartElementHandler          elementstartcommand;
    /* C func for element end */
    XML_EndElementHandler            elementendcommand;
    /* C func for character data */
    XML_CharacterDataHandler         datacommand;
    /* C func for namespace decl start */
    XML_StartNamespaceDeclHandler    startnsdeclcommand;
    /* C func for namespace decl end */
    XML_EndNamespaceDeclHandler      endnsdeclcommand;
    /* C func for processing instruction */
    XML_ProcessingInstructionHandler picommand;
    /* C func for default data */
    XML_DefaultHandler               defaultcommand;
    /* C func for unparsed entity declaration */
    XML_NotationDeclHandler          notationcommand;
    /* C func for external entity */
    XML_ExternalEntityRefHandler     externalentitycommand;
    /* C func for unknown encoding */
    XML_UnknownEncodingHandler       unknownencodingcommand;
    /* C func for comments */
    XML_CommentHandler               commentCommand;
    /* C func for "not standalone" docs */
    XML_NotStandaloneHandler         notStandaloneCommand;
    /* C func for CDATA section start */
    XML_StartCdataSectionHandler     startCdataSectionCommand;
    /* C func for CDATA section end */
    XML_EndCdataSectionHandler       endCdataSectionCommand;
    /* C func for !ELEMENT decl's */
    XML_ElementDeclHandler           elementDeclCommand;
    /* C func for !ATTLIST decl's */
    XML_AttlistDeclHandler           attlistDeclCommand;
    /* C func for !DOCTYPE decl's */
    XML_StartDoctypeDeclHandler      startDoctypeDeclCommand;
    /* C func for !DOCTYPE decl ends */
    XML_EndDoctypeDeclHandler        endDoctypeDeclCommand;
    /* C func for !ENTITY decls's */
    XML_EntityDeclHandler            entityDeclCommand;
} CHandlerSet;

The types and the arguments of the event functions (XML_*) are exactly the same like the expat lib handler functions and described in detail in expat.h, see there. The extension has only to provided the handler functions needed; it's perfectly OK to leave unused handler slots as the are (they are initialized to NULL by CHandlerSetCreate).

The name of this structure is used to identify the handler set.

If the flag ignoreWhiteCDATAs is set, element content which contain only whitespace isn't reported with the datacommand.

The userData element points to the handler set specific data. The event handler functions are called with this pointer as userData argument.

resetProc and freeProc must have arguments that match the type

void (Tcl_Interp *interp, void *userData)

resetProc is called in case the parser is reseted with <parserObj> reset and should do any necessary cleanup and reinitializing to prepare the C handler set for a new XML document. The freeProc is called, if the parser is deleted and should do memory cleanup etc.

CHandlerSetCreate create a C handler set, gives it the name name and initializes any other element with NULL.

CHandlerSetInstall adds the handlerSet to the parser expatObj. The parser has to be a tDOM Tcl expat parser object in the interpreter interp. The name of the C handler set has to be unique for the parser. Returns 0 in case of success. Returns 1 if expatObj isn't a parser object in the interpreter interp. Returns 2 if this parser has already a C handler set with the handlerSet name.

CHandlerSetRemove removes the C handler set referenced by the handlerSetName from the parser expatObj. The parser has to be a tDOM Tcl expat parser object in the interpreter interp. CHandlerSetRemove calls the freeProc function of the C handler set structure, removes the handler set from the C handler set list and frees the handler structure. Returns 0 in case of success. Returns 1 if expatObj isn't a parser object in the interpreter interp. Returns 2 if this parser hasn't a C handler set named handlerSetName.

CheckExpatParserObj returns 1, if nameObj is a tDOM Tcl expat parser object in the interpreter interp, otherwise it returns 0. Example:

int
TclExampleObjCmd(dummy, interp, objc, objv)
     ClientData dummy;
     Tcl_Interp *interp;
     int objc;
     Tcl_Obj *CONST objv[];
{
    char          *method;
    CHandlerSet   *handlerSet;
    int            methodIndex, result;
    simpleCounter *counter;
    

    static char *exampleMethods[] = {
        "enable", "getresult", "remove",
        NULL
    };
    enum exampleMethod {
        m_enable, m_getresult, m_remove
    };

    if (objc != 3) {
        Tcl_WrongNumArgs (interp, 1, objv, example_usage);
        return TCL_ERROR;
    }

    if (!CheckExpatParserObj (interp, objv[1])) {
        Tcl_SetResult (interp, "First argument has to be a expat parser object", NULL);
        return TCL_ERROR;
    }
    /* ... */

CHandlerSetGet returns a pointer to the C handler Set referenced by the name handlerSetName of the parser object expatObj. expatObj has to be an expat parser object in the interpreter interp. Returns NULL in case of error.

CHandlerSetGetUserData returns a pointer to the userData of the C handler set referenced by the name handlerSetName of the parser object expatObj. expatObj has to be an expat parser object in the interpreter interp. Returns NULL in case of error.

GetExpatInfo Is a helper function that returns a pointer to the TclGenExpatInfo structure of the tDOM Tcl expat parser object expatObj. The expatObj has to be a tDOM Tcl expat parser object in the interpreter interp. This is most useful, to set the application status of the parser object.

See the simple but full functionally example in the extensions/example dir or the more complex example tnc in the extensions/tnc dir (a simple DTD validation extension).

SEE ALSO

expat

KEYWORDS

C handler set

tDOM-0.8.3/doc/expatapi.n0000644000175000017500000002512607521023757015334 0ustar ssobernissoberni'\" '\" Generated from expatapi.xml '\" '\" BEGIN man.macros .if t .wh -1.3i ^B .nr ^l \n(.l .ad b .de AP .ie !"\\$4"" .TP \\$4 .el \{\ . ie !"\\$2"" .TP \\n()Cu . el .TP 15 .\} .ta \\n()Au \\n()Bu .ie !"\\$3"" \{\ \&\\$1 \\fI\\$2\\fP (\\$3) .\".b .\} .el \{\ .br .ie !"\\$2"" \{\ \&\\$1 \\fI\\$2\\fP .\} .el \{\ \&\\fI\\$1\\fP .\} .\} .. .de AS .nr )A 10n .if !"\\$1"" .nr )A \\w'\\$1'u+3n .nr )B \\n()Au+15n .\" .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n .nr )C \\n()Bu+\\w'(in/out)'u+2n .. .AS Tcl_Interp Tcl_CreateInterp in/out .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. .de BE .nf .ti 0 .mk ^t .ie n \l'\\n(^lu\(ul' .el \{\ .\" Draw four-sided box normally, but don't draw top of .\" box if the box started on an earlier page. .ie !\\n(^b-1 \{\ \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .el \}\ \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .\} .fi .br .nr ^b 0 .. .de VS .if !"\\$2"" .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. .de VE .ie n 'mc .el \{\ .ev 2 .nf .ti 0 .mk ^t \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' .sp -1 .fi .ev .\} .nr ^v 0 .. .de ^B .ev 2 'ti 0 'nf .mk ^t .if \\n(^b \{\ .\" Draw three-sided box if this is the box's first page, .\" draw two sides but no top otherwise. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .\} .if \\n(^v \{\ .nr ^x \\n(^tu+1v-\\n(^Yu \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c .\} .bp 'fi .ev .if \\n(^b \{\ .mk ^y .nr ^b 2 .\} .if \\n(^v \{\ .mk ^Y .\} .. .de DS .RS .nf .sp .. .de DE .fi .RE .sp .. .de SO .SH "STANDARD OPTIONS" .LP .nf .ta 5.5c 11c .ft B .. .de SE .fi .ft R .LP See the \\fBoptions\\fR manual entry for details on the standard options. .. .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. .de CS .RS .nf .ta .25i .5i .75i 1i .if t .ft C .. .de CE .fi .if t .ft R .RE .. .de UL \\$1\l'|0\(ul'\\$2 .. '\" END man.macros .TH expatapi 3 "" Tcl "" .BS .SH NAME CheckExpatParserObj, CHandlerSetInstall, CHandlerSetRemove, CHandlerSetCreate, CHandlerSetGetUserData, GetExpatInfo \- Functions to create, install and remove expat parser object extensions. .SH SYNOPSIS .nf #include int \&\fBCheckExpatParserObj\fP (\fIinterp\fR, \fInameObj\fR) int \&\fBCHandlerSetInstall\fP (\fIinterp\fR, \fIexpatObj\fR, \fIhandlerSet\fR) int \&\fBCHandlerSetRemove\fP (\fIinterp\fR, \fIexpatObj\fR, \fIhandlerSetName\fR) CHandlerSet* \&\fBCHandlerSetCreate\fP (\fIhandlerSetName\fR) CHandlerSet* \&\fBCHandlerSetGet\fP (\fIinterp\fR, \fIexpatObj\fR, \fIhandlerSetName\fR) void* \&\fBCHandlerSetGetUserData\fP (\fIinterp\fR, \fIexpatObj\fR, \fIhandlerSetName\fR) TclGenExpatInfo* \&\fBGetExpatInfo\fP (\fIinterp\fR, \fIexpatObj\fR) .fi .SH ARGUMENTS .AS "unsigned long" clientData .AP Tcl_Interp "*interp" in Interpreter with the expat parser object. .AP Tcl_Obj "*expatObj" in A Tcl Object containing the command name of the expat parser object to be queried or modified. .AP char "*handlerSetName" in Identifier of the handler set. .AP CHandlerSet "*handlerSet" in Pointer to a C handler set. .AP Tcl_Obj "*nameObj" "" A Tcl Object containing the name of a expat parser object .BE .SH DESCRIPTION .PP The functions described in this manual allows to add C level coded event handler to an tDOM Tcl expat parser objects. A tDOM Tcl expat parser object is able to have several Tcl scripts and C functions associated with an specific event. If the event occurs, first the Tcl scripts then the C functions associated with the event are called in turn. .PP A tDOM Tcl expat parser extension is an ordinary Tcl extension and loaded like every other Tcl extension. It must install at least one new Tcl Level command, that manipulates a tDOM Tcl expat parser object. .PP A C level handler set is a data structure like this: .CS typedef struct CHandlerSet { struct CHandlerSet *nextHandlerSet; char *name; /* refname of the handler set */ int ignoreWhiteCDATAs; /* ignore 'white' CDATA sections */ void *userData; /* Handler set specific Data Structure; the C handler set extention has to malloc the needed structure in his init func and has to provide a cleanup func (to free it). */ CHandlerSet_userDataReset resetProc; CHandlerSet_userDataFree freeProc; /* C func for element start */ XML_StartElementHandler elementstartcommand; /* C func for element end */ XML_EndElementHandler elementendcommand; /* C func for character data */ XML_CharacterDataHandler datacommand; /* C func for namespace decl start */ XML_StartNamespaceDeclHandler startnsdeclcommand; /* C func for namespace decl end */ XML_EndNamespaceDeclHandler endnsdeclcommand; /* C func for processing instruction */ XML_ProcessingInstructionHandler picommand; /* C func for default data */ XML_DefaultHandler defaultcommand; /* C func for unparsed entity declaration */ XML_NotationDeclHandler notationcommand; /* C func for external entity */ XML_ExternalEntityRefHandler externalentitycommand; /* C func for unknown encoding */ XML_UnknownEncodingHandler unknownencodingcommand; /* C func for comments */ XML_CommentHandler commentCommand; /* C func for "not standalone" docs */ XML_NotStandaloneHandler notStandaloneCommand; /* C func for CDATA section start */ XML_StartCdataSectionHandler startCdataSectionCommand; /* C func for CDATA section end */ XML_EndCdataSectionHandler endCdataSectionCommand; /* C func for !ELEMENT decl's */ XML_ElementDeclHandler elementDeclCommand; /* C func for !ATTLIST decl's */ XML_AttlistDeclHandler attlistDeclCommand; /* C func for !DOCTYPE decl's */ XML_StartDoctypeDeclHandler startDoctypeDeclCommand; /* C func for !DOCTYPE decl ends */ XML_EndDoctypeDeclHandler endDoctypeDeclCommand; /* C func for !ENTITY decls's */ XML_EntityDeclHandler entityDeclCommand; } CHandlerSet; .CE .PP The types and the arguments of the event functions (XML_*) are exactly the same like the expat lib handler functions and described in detail in expat.h, see there. The extension has only to provided the handler functions needed; it's perfectly OK to leave unused handler slots as the are (they are initialized to NULL by CHandlerSetCreate). .PP The \fIname\fR of this structure is used to identify the handler set. .PP If the flag \fIignoreWhiteCDATAs\fR is set, element content which contain only whitespace isn't reported with the datacommand. .PP The \fIuserData\fR element points to the handler set specific data. The event handler functions are called with this pointer as userData argument. .PP \&\fIresetProc\fR and \fIfreeProc\fR must have arguments that match the type .CS void (Tcl_Interp *interp, void *userData) .CE .PP \&\fIresetProc\fR is called in case the parser is reseted with \&\fB reset\fR and should do any necessary cleanup and reinitializing to prepare the C handler set for a new XML document. The \&\fIfreeProc\fR is called, if the parser is deleted and should do memory cleanup etc. .PP \&\fICHandlerSetCreate\fR create a C handler set, gives it the name \&\fIname\fR and initializes any other element with NULL. .PP \&\fICHandlerSetInstall\fR adds the \fIhandlerSet\fR to the parser \&\fIexpatObj\fR. The parser has to be a tDOM Tcl expat parser object in the interpreter \fIinterp\fR. The name of the C handler set has to be unique for the parser. Returns 0 in case of success. Returns 1 if \fIexpatObj\fR isn't a parser object in the interpreter \fIinterp\fR. Returns 2 if this parser has already a C handler set with the handlerSet name. .PP \&\fICHandlerSetRemove\fR removes the C handler set referenced by the \&\fIhandlerSetName\fR from the parser \fIexpatObj\fR. The parser has to be a tDOM Tcl expat parser object in the interpreter \&\fIinterp\fR. \fICHandlerSetRemove\fR calls the freeProc function of the C handler set structure, removes the handler set from the C handler set list and frees the handler structure. Returns 0 in case of success. Returns 1 if \&\fIexpatObj\fR isn't a parser object in the interpreter \fIinterp\fR. Returns 2 if this parser hasn't a C handler set named \fIhandlerSetName\fR. .PP \&\fICheckExpatParserObj\fR returns 1, if \fInameObj\fR is a tDOM Tcl expat parser object in the interpreter \fIinterp\fR, otherwise it returns 0. Example: .CS int TclExampleObjCmd(dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { char *method; CHandlerSet *handlerSet; int methodIndex, result; simpleCounter *counter; static char *exampleMethods[] = { "enable", "getresult", "remove", NULL }; enum exampleMethod { m_enable, m_getresult, m_remove }; if (objc != 3) { Tcl_WrongNumArgs (interp, 1, objv, example_usage); return TCL_ERROR; } if (!CheckExpatParserObj (interp, objv[1])) { Tcl_SetResult (interp, "First argument has to be a expat parser object", NULL); return TCL_ERROR; } /* ... */ .CE .PP \&\fICHandlerSetGet\fR returns a pointer to the C handler Set referenced by the name \fIhandlerSetName\fR of the parser object \&\fIexpatObj\fR. \fIexpatObj\fR has to be an expat parser object in the interpreter \fIinterp\fR. Returns NULL in case of error. .PP \&\fICHandlerSetGetUserData\fR returns a pointer to the userData of the C handler set referenced by the name \fIhandlerSetName\fR of the parser object \&\fIexpatObj\fR. \fIexpatObj\fR has to be an expat parser object in the interpreter \fIinterp\fR. Returns NULL in case of error. .PP \&\fIGetExpatInfo\fR Is a helper function that returns a pointer to the TclGenExpatInfo structure of the tDOM Tcl expat parser object \&\fIexpatObj\fR. The \fIexpatObj\fR has to be a tDOM Tcl expat parser object in the interpreter \fIinterp\fR. This is most useful, to set the application status of the parser object. .PP See the simple but full functionally example in the extensions/example dir or the more complex example tnc in the extensions/tnc dir (a simple DTD validation extension). .SH "SEE ALSO" expat .SH KEYWORDS C handler set tDOM-0.8.3/doc/CVS/0000755000175000017500000000000011004674366013766 5ustar ssobernissobernitDOM-0.8.3/doc/CVS/Root0000644000175000017500000000006211004674365014631 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/doc/CVS/Entries0000644000175000017500000000236211004674366015325 0ustar ssobernissoberni/README/1.2/Fri Jul 12 17:19:39 2002// /category-index.html/1.2/Tue Aug 31 01:56:18 2004// /dom.html/1.13/Mon Jan 10 20:43:54 2005// /dom.n/1.14/Mon Jan 10 20:43:54 2005// /dom.xml/1.14/Mon Jan 10 20:43:54 2005// /domDoc.html/1.20/Mon Oct 29 19:07:37 2007// /domDoc.n/1.21/Mon Oct 29 19:07:38 2007// /domDoc.xml/1.20/Mon Oct 29 19:07:37 2007// /domNode.html/1.24/Mon Oct 29 19:07:38 2007// /domNode.n/1.24/Mon Oct 29 19:07:38 2007// /domNode.xml/1.25/Mon Oct 29 19:07:38 2007// /expat.html/1.8/Fri Dec 10 18:57:44 2004// /expat.n/1.9/Fri Dec 10 18:58:05 2004// /expat.xml/1.8/Fri Dec 10 18:57:27 2004// /expatapi.html/1.2/Wed Oct 30 00:43:50 2002// /expatapi.n/1.2/Sun Jul 28 17:20:47 2002// /expatapi.xml/1.1.1.1/Fri Feb 22 01:05:34 2002// /index.html/1.2/Tue Aug 31 01:56:18 2004// /keyword-index.html/1.2/Tue Aug 31 01:56:18 2004// /manpage.css/1.2/Wed Jun 19 23:55:26 2002// /tDOM.xml/1.1.1.1/Fri Feb 22 01:05:34 2002// /tdomcmd.html/1.2/Wed Oct 30 00:45:33 2002// /tdomcmd.n/1.2/Sun Jul 28 17:20:47 2002// /tdomcmd.xml/1.1.1.1/Fri Feb 22 01:05:34 2002// /tmml.dtd/1.3/Thu Jul 11 23:06:56 2002// /tmml.options/1.2/Mon Jul 22 13:28:13 2002// /tnc.html/1.6/Sat Feb 22 21:47:44 2003// /tnc.n/1.6/Sat Feb 22 21:47:48 2003// /tnc.xml/1.5/Sat Feb 22 21:47:52 2003// D tDOM-0.8.3/doc/CVS/Repository0000644000175000017500000000001111004674365016057 0ustar ssobernissobernitdom/doc tDOM-0.8.3/doc/tdomcmd.xml0000644000175000017500000000521307435314536015510 0ustar ssobernissoberni tdom tdom is an expat parser object extension to create an in-memory DOM tree from the input while parsing. package require tdom set parser [expat] tdom $parser enable
DESCRIPTION

tdom adds the C handler set "tdom" to an tcl expat parser obj. This handler set builds an in-memory DOM tree out of the input, parsed by the parser. A DOM tree created this way behave exactly like a DOM tree created by the "dom" command (see there). In fact, tdom is only another interface to the same functionality; it uses the code behind the dom code for building the DOM tree.

tdom parserObj enable

Adds the tdom C handler set to a Tcl expat parser object. Next time, the parser parses input, the tdom C handler functions create an in-memory DOM tree.

tdom parserObj getdoc

Returns the DOM tree as domDoc (see there) object.

tdom parserObj setResultEncoding

See the method setResultEncoding of the dom command.

tdom parserObj setStoreLineColumn ?boolean?

See the method setStoreLineColumn of the dom command.

tdom parserObj remove

Removes the tdom C handler set from the parser object.

tdom parserObj keepEmpties

See the option -keepEmpties of the dom command.

tdom parserObj setExternalEntityResolver script
dom expat DOM SAX C handler set
tDOM-0.8.3/doc/dom.html0000644000175000017500000004704710170564412015005 0ustar ssobernissoberni tDOM manual: dom

NAME

dom -
Create an in-memory DOM tree from XML

SYNOPSIS

package require tdom

dom method ?arg arg ...?

DESCRIPTION

This command provides the creation of complete DOM trees in memory. In the usual case a string containing a XML information is parsed and converted into a DOM tree. method indicates a specific subcommand.

The valid methods are:

dom parse ?options? ?data?
Parses the XML information and builds up the DOM tree in memory providing a Tcl object command to this DOM document object. Example:
dom parse $xml doc
$doc documentElement root

parses the XML in the variable xml, creates the DOM tree in memory, make a reference to the document object, visible in Tcl as a document object command, and assigns this new object name to the variable doc. When doc gets freed, the DOM tree and the associated Tcl command object (document and all node objects) are freed automatically.

set document [dom parse $xml]
set root     [$document documentElement]

parses the XML in the variable xml, creates the DOM tree in memory, make a reference to the document object, visible in Tcl as a document object command, and returns this new object name, which is then stored in document. To free the underlying DOM tree and the associative Tcl object commands (document + nodes + fragment nodes) the document object command has to be explicitly deleted by:

$document delete
or
rename $document ""

The valid options are:

-simple
If -simple is specified, a simple but fast parser is used (conforms not fully to XML recommendation). That should double parsing and DOM generation speed. The encoding of the data is not transformed inside the parser. The simple parser does not respect any encoding information in the XML declaration. It skips over the internal DTD subset and ignores any information in it. Therefor it doesn't include defaulted attribute values into the tree, even if the according attribute declaration is in the internal subset. It also doesn't expand internal or external entity references other than the predefined entities and character references.
-html
If -html is specified, a fast HTML parser is used, which tries to even parse badly formed HTML into a DOM tree.
-keepEmpties
If -keepEmpties is specified, text nodes, which contain only whitespaces, will be part of the resulting DOM tree. In default case (-keepEmpties not given) those empty text nodes are removed at parsing time.
-channel <channel-ID>
If -channel <channel-ID> is specified, the input to be parsed is read from the specified channel. The encoding setting of the channel (via fconfigure -encoding) is respected, ie the data read from the channel are converted to UTF-8 according to the encoding settings, befor the data is parsed.
-baseurl <baseURI>
If -baseurl <baseURI> is specified, the baseURI is used as the base URI of the document. External entities referenced in the document are resolved relative to this base URI. This base URI is also stored within the DOM tree.
-feedbackAfter <#bytes>
If -feedbackAfter <#bytes> is specified, the tcl command ::dom::domParseFeedback is evaluated after parsing every #bytes. If you use this option, you have to create a tcl proc named ::dom::domParseFeedback, otherwise you will get an error. Please notice, that the calls of ::dom::domParseFeedback are not done exactly every #bytes, but always at the first element start after every #bytes.
-externalentitycommand <script>
If -externalentitycommand <script> is specified, the specified tcl script is called to resolve any external entities of the document. The actual evaluated command consists of this option followed by three arguments: the base uri, the system identifier of the entity and the public identifier of the entity. The base uri and the public identifier may be the empty list. The script has to return a tcl list consisting of three elements. The first element of this list signals, how the external entity is returned to the processor. At the moment, the two allowed types are "string" and "channel". The second element of the list has to be the (absolute) base URI of the external entity to be parsed. The third element of the list are data, either the already read data out of the external entity as string in the case of type "string", or the name of a tcl channel, in the case of type "channel". Note that if the script returns a tcl channel, it will not be closed by the processor. It must be closed separately if it is no longer required.
-useForeignDTD <boolean>
If <boolean> is true and the document does not have an external subset, the parser will call the -externalentitycommand script with empty values for the systemId and publicID arguments. Pleace notice, that, if the document also doesn't have an internal subset, the -startdoctypedeclcommand and -enddoctypedeclcommand scripts, if set, are not called. The -useForeignDTD respects
-paramentityparsing <always|never|notstandalone>
The -paramentityparsing option controls, if the parser tries to resolve the external entities (including the external DTD subset) of the document, while building the DOM tree. -paramentityparsing requires an argument, which must be either "always", "never", or "notstandalone". The value "always" means, that the parser tries to resolves (recursively) all external entities of the XML source. This is the default, in case -paramentityparsing is omitted. The value "never" means, that only the given XML source is parsed and no external entity (including the external subset) will be resolved and parsed. The value "notstandalone" means, that all external entities will be resolved and parsed, with the execption of documents, which explicitly states standalone="yes" in their XML declaration.

dom createDocument docElemName ?objVar?
Creates a new DOM document object with one element node with node name docElemName. The objVar controls the memory handling as explained above.
dom createDocumentNS uri docElemName ?objVar?
Creates a new DOM document object with one element node with node name docElemName. Uri gives the namespace of the document element to create. The objVar controls the memory handling as explained above.
dom createDocumentNode ?objVar?
Creates a new, 'empty' DOM document object without any element node. objVar controls the memory handling as explained above.
dom setResultEncoding ?encodingName?
If encodingName is not given the current global result encoding is returned. Otherwise the global result encoding is set to encodingName. All character data, attribute values, etc. will then be converted from UTF-8, which is delivered from the Expat XML parser, to the given 8 bit encoding at XML/DOM parse time. Valid values for encodingName are: utf-8, ascii, cp1250, cp1251, cp1252, cp1253, cp1254, cp1255, cp1256, cp437, cp850, en, iso8859-1, iso8859-2, iso8859-3, iso8859-4, iso8859-5, iso8859-6, iso8859-7, iso8859-8, iso8859-9, koi8-r.
dom createNodeCmd ?-returnNodeCmd? (element|comment|text|cdata|pi)Node commandName
This method creates Tcl commands, which in turn create tDOM nodes. Tcl commands created by this command are only avaliable inside a script given to the domNode method appendFromScript. If a command created with createNodeCmd is invoked in any other context, it will return error. The created command commandName replaces any existing command or procedure with that name. If the commandName includes any namespace qualifiers, it is created in the specified namespace.

If such command is invoked inside a script given as argument to the domNode method appendFromScript, it creates a new node and appends this node at the end of the child list of the invoking element node. If the option -returnNodeCmd was given, the command returns the created node as Tcl command. If this option was omitted, the command returns nothing. Each command creates always the same type of node. Which type of node is created by the command is determined by the first argument to the createNodeCmd. The syntax of the created command depends on the type of the node it creates.

If the first argument of the method is elementNode, the created command will create an element node. The tag name of the created node is commandName without namespace qualifiers. The syntax of the created command is:

elementNodeCmd ?attributeName attributeValue ...? ?script?
elementNodeCmd ?-attributeName attributeValue ...? ?script?
elementNodeCmd name_value_list script

The command syntax allows three different ways to specify the attributes of the resulting element. These could be specified with attributeName attributeValue argument pairs, in an "option style" way with -attriubteName attributeValue argument pairs (the '-' character is only syntactical sugar and will be stripped off) or as a Tcl list with elements interpreted as attribute name and the corresponding attribute value. The attribute name elements in the list may have a leading '-' character, which will be stripped off.

Every elementNodeCmd accepts an optional Tcl script as last argument. This script is evaluated as recursive appendFromScript script with the node created by the elementNodeCmd as parent of all nodes created by the script.

If the first argument of the method is textNode, the command will create a text node. The syntax of the created command is:

textNodeCmd ?-disableOutputEscaping? data

If the optional flag -disableOutputEscaping is given, the escaping of the ampersand character (&) and the left angle bracket (<) inside the data is disabled. You should use this flag carefully.

If the first argument of the method is commentNode, or cdataNode, the command will create an comment node or CDATA section node. The syntax of the created command is:

nodeCmd data

If the first argument of the method is piNode, the command will create a processing instruction node. The syntax of the created command is:

piNodeCmd target data
dom setStoreLineColumn ?boolean?
If switched on, the DOM nodes will contain line and column position information for the original XML document after parsing. The default is, not to store line and column position information.
dom setNameCheck ?boolean?
If NameCheck is true, every method which expects an XML Name, a full qualified name or a processing instructing target will check, if the given string is valid according to his production rule. For commands created with the createNodeCmd method to be used in the context of appendFromScript the status of the flag at creation time decides. If NameCheck is true at creation time, the command will check his arguments, otherwise not. The setNameCheck set this flag. It returns the current NameCheck flag state. The default state for NameCheck is true.
dom setTextCheck ?boolean?
If TextCheck is true, every command which expects XML Chars, a comment, a CDATA section value or a processing instructing value will check, if the given string is valid according to his production rule. For commands created with the createNodeCmd method to be used in the context of appendFromScript the status of the flag at creation time decides. If TextCheck is true at creation time, the command will check his arguments, otherwise not.The setTextCheck method set this flag. It returns the current TextCheck flag state. The default state for TextCheck is true.
dom setObjectCommands ?(automatic|token|command)?
Controls, if documents and nodes are created as tcl commands or as token to be used with the domNode and domDoc commands. If the mode is 'automatic', then methods used at tcl commands will create tcl commands and methods used at doc or node tokes will create tokens. If the mode is 'command' then always tcl commands will be created. If the mode is 'token', then always token will be created. The method returns the current mode. This method is an experimental interface.
dom isName name
Returns 1, if name is a valid XML Name according to production 5 of the XML 1.0 recommendation. This means, that name is a valid XML element or attribute name. Otherwise it returns 0.
dom isPIName name
Returns 1, if name is a valid XML processing instruction target according to production 17 of the XML 1.0 recommendation. Otherwise it returns 0.
dom isNCName name
Returns 1, if name is a valid NCName according to production 4 of the of the Namespaces in XML recommendation. Otherwise it returns 0.
dom isQName name
Returns 1, if name is a valid QName according to production 6 of the of the Namespaces in XML recommendation. Otherwise it returns 0.
dom isCharData string
Returns 1, if every character in string is a valid XML Char according to production 2 of the XML 1.0 recommendation. Otherwise it returns 0.
dom isComment string
Returns 1, if string is a valid comment according to production 15 of the XML 1.0 recommendation. Otherwise it returns 0.
dom isCDATA string
Returns 1, if string is valid according to production 20 of the XML 1.0 recommendation. Otherwise it returns 0.
dom isPIValue string
Returns 1, if string is valid according to production 16 of the XML 1.0 recommendation. Otherwise it returns 0.

KEYWORDS

XML, DOM, document, node, parsing

tDOM-0.8.3/doc/domDoc.html0000644000175000017500000006161210711427571015432 0ustar ssobernissoberni tDOM manual: domDoc

NAME

domDoc -
Manipulates an instance of a DOM document object

SYNOPSIS

domDocObjCmd method ?arg arg ...?

DESCRIPTION

This command manipulates one particular instance of a document object. method indicates a specific method of the document class. These methods should closely conform to the W3C recommendation "Document Object Model (Core) Level 1" (http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html). Look at these documents for a deeper understanding of the functionality.

The valid methods are:

documentElement ?objVar?
Returns the top most element in the document (the root element).
getElementsByTagName name
Returns a list of all elements in the document matching (glob style) name.
getElementsByTagNameNS uri localname
Returns a list of all elements in the subtree matching (glob style) localname and having the given namespace uri.
createElement tagName ?objVar?
Creates (allocates) a new element node with node name tagName, append it to the hidden fragment list in the document object and returns the node object. If objVar is given the new node object store in this variable.
createElementNS url tagName ?objVar?
Creates (allocates) a new element node within a namespace having uri as the URI and node name tagName, which could include the namespace prefix, append it to the hidden fragment list in the document object and returns the node object. If objVar is given the new node object store in this variable.
createTextNode text ?objVar?
Creates (allocates) a new text node with node value text, appends it to the hidden fragment list in the document object and returns the node object. If objVar is given, the new node object is stored in this variable.
createComment text ?objVar?
Creates (allocates) a new comment node with value text, appends it to the hidden fragment list in the document object and returns the node object. If objVar is given, the new comment node object is stored in this variable.
createCDATASection data ?objVar?
Creates (allocates) a new CDATA node with node value data, appends it to the hidden fragment list in the document object and returns the node object. If objVar is given, the new node object is stored in this variable.
createProcessingInstruction target data ?objVar?
Creates a process instruction, appends it to the hidden fragment list in the document object and returns the node object. If objVar is given, the new node object is stored in this variable.
delete
Explicitly deletes the document, including the associated Tcl object commands (for nodes, fragment/new nodes, the document object itself) and the underlying DOM tree.
getDefaultOutputMethod
Returns the default output method of the document. This is usually a result of a XSLT transformation.
asXML ?-indent none/1..8? ?-channel channelId? ?-escapeNonASCII? ?-doctypeDeclaration <boolean>? ?-escapeAllQuot?
Returns the DOM tree as an (optional indented) XML string or sends the output directly to the given channelId. If the option -escapeNonASCII is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation. The flag -doctypeDeclaration determines, whether there will be a DOCTYPE declaration emitted before the first node of the document. The default is, to do not. The DOCTYPE name will always be the element name of the document element. An external entity declaration of the external subset is only emitted, if the document has a system identifier. If the option -escapeAllQuot is given, quotation marks will be escaped with &quot; even in text content of elements.
asHTML ?-channel channelId? ?-escapeNonASCII? ?-htmlEntities? ?-doctypeDeclaration <boolean>?
Returns the DOM tree serialized acording to HTML rules (HTML elements are recognized regardless of case, without end tags for emtpy HTML elements etc.), as string or sends the output directly to the given channelId. If the option -escapeNonASCII is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation. If the option -htmlEntities is given, a character is outputed using a HTML 4.01 character entity reference, if one is defined for it. The flag -doctypeDeclaration determines, whether there will be a DOCTYPE declaration emitted before the first node of the document. The default is, to do not. The DOCTYPE name will always be the element name of the document element without case normalization. An external entity declaration of the external subset is only emitted, if the document has a system identifier. The doctype declaration will be written from the avaliable informations, without check, if this is a known (w3c) HTML version information or if the document confirms to the given HTML version.
asText
The asText method outputs the result tree by outputting the string-value of every text node in the result tree in document order without any escaping. In effect, this is what the xslt output method "text" (XSLT 1.0 recommendation, section 16.3) does.
publicId ?publicId?
Returns the public identifier of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the public identifier of the document is set to this value.
systemId ?systemId?
Returns the system identifier of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the system identifier of the document is set to this value.
internalSubset ?internalSubset?
Returns the internal subset of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the internal subset of the document is set to this value. Note, that none of the parsing methods preserve the internal subset of a document; a freshly parsed document will always have an empty internal subset. Also note, that the method doesen't do any syntactical check on a given internal subset.
cdataSectionElements (?URI:?localname|*) ?<boolean>?
This method allows to control, for which element nodes the text node childs will be serialized as CDATA sections (this affects only serialization with the asXML method, no text node is altered in any way by this method). IF the method is called with an element name as first argument and a boolean with value true as second argument, every text node child of every element node in the document with the same name as the first argument will be serialized as CDATA section. If the second argument is a boolean with value false, all text nodes of all elements with the same name as the first argument will be serialized as usual. Namespaced element names have to given in the form namespace_URI:localname, not in the otherwise usual prefix:localname form. With two arguments called, the method returns the used boolean value. If the method is called with only an element name, it will return a boolean value, indicating, if the text nodes childs of all elements with that name in the document will be serialized as CDATA section elements (return value 1) or not (return value 0). If the method is called with only one argument and that argument is an asterisk ('*'), then the method returns an unordered list of all element names of the document, for which the text node childs will be serialized as CDATA section nodes.
selectNodesNamespaces ?prefixUriList?
This method allows to control a document global prefix to namespace URI mapping, which will be used for selectNodes method calls (on document as well as on all nodes, which belongs to the document), if it is not overwritten by using the -namespaces option of the selectNodes method. Any namespace prefix within an xpath expression will be first resolved against this list. If the list bind the same prefix to different namespaces, then the first binding will win. If a prefix could not resolved against the document global prefix / namespaces list, then the namespace definitions in scope of the context node will be used to resolve the prefix, as usual. If the optional argument prefixUriList is given, then the global prefix / namespace list is set to this list and returns it. Without the optional argument the method returns the current list. The default is the empty list.
xslt ?-parameters parameterList? ?-ignoreUndeclaredParameters? ?-xsltmessagecmd script? stylesheet ?outputVar?
Applies an XSLT transformation on the whole document of the node object using the XSLT stylesheet (given as domDoc). Returns a document object containing the result document of the transformation and stores that document object in the optional outputVar, if that was given.

The optional -parameters option sets top level <xsl:param> to string values. The parameterList has to be a tcl list consisting of parameter name and value pairs.

If the option -ignoreUndeclaredParameters is given, then parameter names in the parameterList given to the -parameters options that are not declared as top-level parameters in the stylesheet are silently ignored. Without this option, an error is raised, if the user tries to set a top-level parameter, which is not declared in the stylesheet.

The -xsltmessagecmd option sets a callback for xslt:message elements in the stylesheet. The actual command consists of the script, given as argument to the option, appended with the XML Fragment from instantiating the xsl:message element content as string (as if the XPath string() function would have been applied to the XML Fragment) and a flag, which indicates, if the xsl:message has an attribute "terminate" with the value "yes".

toXSLTcmd ?objVar?
If the DOM tree represents a valid XSLT stylesheet, this method transforms the DOM tree into an xslt command, otherwise it returns error. The created xsltCmd is returnd and stored in the objVar, if a var name was given. A successful transformation of the DOM tree to an xsltCmd removes the domDoc cmd and all nodeCmds of the document.

The syntax of the created xsltCmd is:

xsltCmd method ?arg ...?

The valid methods are:

transform ?-parameters parameterList? ?-ignoreUndeclaredParameters? ?-xsltmessagecmd script? domDoc ?outputVar?
Applies XSLT transformation on the document domDoc. Returns a document object containing the result document of that transformation and stores it in the optional outputVar.

The optional -parameters option sets top level <xsl:param> to string values. The parameterList has to be a tcl list consisting of parameter name and value pairs.

If the option -ignoreUndeclaredParameters is given, then parameter names in the parameterList given to the -parameters options that are not declared as top-level parameters in the stylesheet are silently ignored. Without this option, an error is raised, if the user tries to set a top-level parameter, which is not declared in the stylesheet.

The -xsltmessagecmd option sets a callback for xslt:message elements in the stylesheet. The actual command consists of the script, given as argument to the option, appended with the XML Fragment from instantiating the xsl:message element content as string (as if the XPath string() function would have been applied to the XML Fragment) and a flag, which indicates, if the xsl:message has an attribute "terminate" with the value "yes".

delete
Deletes the xsltCmd and cleans up all used recourses

If the first argument to an xsltCmd is a domDoc or starts with a "-", then the command is processed in the same way as <xsltCmd> transform.

normalize ?-forXPath?
Puts all Text nodes in the document into a "normal" form where only structure (e.g., elements, comments, processing instructions and CDATA sections) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes. If the option -forXPath is given, all CDATA sections in the nodes are converted to text nodes, as a first step before the normalization.
nodeType
Returns the node type of the document node. This is always DOCUMENT_NODE.
getElementById id
Returns the node having a id attribute with value id or the emtpy string, if no node has an id attribute with that value.
firstChild ?objVar?
Returns the first top level node of the document.
lastChild ?objVar?
Returns the last top level node of the document.
appendChild newChild
Append newChild to the end of the list of top level nodes of the document.
removeChild child
Removes child from the list of top level nodes of the document. child will be part of the document fragment list after this operation. It is not physically deleted.
hasChildNodes
Returns 1 if the document has any nodes in the tree. Otherwise 0 is returned.
childNodes
Returns a list of the top level nodes of the document.
ownerDocument ?domObjVar?
Returns the document itself.
insertBefore newChild refChild
Insert newChild before the refChild into the list of top level nodes of the document. If refChild is the empty string, insert newChild at the end of the top level nodes.
replaceChild newChild oldChild
Replace oldChild with newChild in the list of children of that node. The oldChild node will be part of the document fragment list after this operation.
appendFromList list
Parses list , creates an according DOM subtree and appends this subtree at the end of the current list of top level nodes of the document.
appendXML XMLstring
Parses XMLstring, creates an according DOM subtree and appends this subtree at the end of the current list of top level nodes of the document.
selectNodes ?-namespaces prefixUriList? ?-cache <boolean>? xpathQuery ?typeVar?

Returns the result of applying the XPath query xpathQuery to the document. The context node of the query is the root node in the sense of the XPath recommendation (not the document element). The result can be a string/value, a list of strings, a list of nodes or a list of attribute name / value pairs. If typeVar is given the result type name is stored into that variable (empty, bool, number, string, nodes, attrnodes or mixed).

The argument xpathQuery has to be a valid XPath expression. However, there is one exception to that rule. Tcl variable names can appear in the XPath statement at any position where it is legal according to the rules of the XPath syntax to put an XPath variable. The value of the variable is substituted for the variable name. Ignoring the syntax rules of XPath the Tcl variable name may be any legal Tcl var name: local variables, global variables, array entries and so on.

The option -namespaces expects a tcl list with prefix / namespace pairs as argument. If this option is not given, then any namespace prefix within the xpath expression will be first resolved against the list of prefix / namespace pairs set with the selectNodesNamespaces method for the document, the node belongs to. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix. If this option is given, any namespace prefix within the xpath expression will be first resolved against that given list (and ignoring the document global prefix / namespace list). If the list bind the same prefix to different namespaces, then the first binding will win. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix, as usual.

If the -cache option is used with a true value, then the xpathQuery will be looked up in a document specific cache. If the query is found, then the stored pre-compiled query will be used. If the query isn't found, it will be pre-compiled and stored in the cache, for use in further calls. Please notice, that the xpathQuery as given as string is used as key for the cache. This means, that equal XPath expressions, which differ only in white space are treated as different cache entries. Special care is needed, if the XPath expression includes namespace prefixes. During pre-compilation, the prefixes will be resolved first to the prefix / namespace pairs of the -namespaces option, if given, and to the namespaces in scope of the context node at pre-compilation time. If the XPath is found in the cache, neither the -namespaces option nor the namespaces in scope of the context node will be taken in account but the already resolved (stored) namespaces will be used for the query.

Examples:

set paragraphNodes [$node selectNodes {chapter[3]//para[@type='warning' or @type='error'} ]
foreach paragraph $paragraphNodes {
    lappend  values [$paragraph selectNodes attribute::type]
}

set doc [dom parse {<doc xmlns="http://www.defaultnamespace.org"><child/></doc>}]
set root [$doc documentElement]
set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child]
baseURI ?URI?
Returns the present baseURI of the document. If the optional argument URI is given, sets the base URI of the document to the given URI.
appendFromScript tclScript
Appends the nodes created by the tclScript by Tcl functions, which have been built using dom createNodeCmd, at the end of the current list of top level nodes of the document.
insertBeforeFromScript tclScript refChild
Inserts the nodes created in the tclScript by Tcl functions, which have been built using dom createNodeCmd, before the refChild into to the list of top level nodes of the document. If refChild is the empty string, the new nodes will be appended.
deleteXPathCache ?xpathQuery?
If called without the optional argument, all cached XPath expressions of the document are freed. If called with the optional argument xpathQuery, this single XPath query will be removed from the cache, if it is there. The method always returns an empty string.

Otherwise, if an unknown method name is given, the command with the same name as the given metho within the namespace ::dom::domDoc is tried to be executed. This allows quick method additions on Tcl level.

Newly created nodes are appended to a hidden fragment list. If they are not moved into the tree they are automaticaly deleted, when the whole document gets deleted.

SEE ALSO

dom, domNode

KEYWORDS

DOM node creation, document element

tDOM-0.8.3/doc/domNode.html0000644000175000017500000006414110711427572015613 0ustar ssobernissoberni tDOM manual: domNode

NAME

domNode -
Manipulates an instance of a DOM node object

SYNOPSIS

 $nodeObject method  arg arg ...

DESCRIPTION

This command manipulates one particular instance of a DOM node object. method indicates a specific method of the node class. These methods should closely conform to the W3C recommendation "Document Object Model (Core) Level 1" (http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html) as well to parts of the W3C draft "XML Pointer Language (XPointer)" (http://www.w3.org/TR/1998/WD-xptr-19980303). Please note, that the XPointer methods are deprecated. Use DOM methods or XPath expressions instead of them.

The selectNodes method implements the "XML Path Language (XPath) Version 1.0" W3C recommendation 16 November 1999 (http://www.w3.org/TR/1999/REC-xpath-19991116). Look at these documents for a deeper understanding of the functionality.

The valid methods are:

nodeType
Returns the node type of that node object. This can be: ELEMENT_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE or PROCESSING_INSTRUCTION_NODE.
nodeName
Returns the node name of that node object. This is the element (tag) name for element nodes (type ELEMENT_NODE), the processing-instruction target for processing-instructions, "#text" for text node, "#comment" for comment nodes or "#cdata" for cdata section nodes.
nodeValue ?newValue?
Returns the value of that node object. This is the the text or the data for element nodes of type TEXT_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE or CDATA_SECTION_NODE). Otherwise it is empty. If the node is a TEXT_NODE, COMMENT_NODE or PROCESSING_INSTRUCTION_NODE and the optional argument newValue is given, the node is set to that value.
hasChildNodes
Returns 1 if the has children. Otherwise 0 is returned.
parentNode ?objVar?
Returns the parent node.
childNodes
Returns a list of direct children node objects.
childNodesLive
Returns a "live" nodeList object of the child nodes of the node in the sense of the DOM recommendation. This nodeList object is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the NodeList accessors; it is not a static snapshot of the content of the node. The both accessors know by the nodeList object are "item <index>", which returns the indexth item in the collection, and "length", which returns the number of nodes in the list.
firstChild ?objVar?
Returns the first child as a node object.
lastChild ?objVar?
Returns the last child as a node object.
nextSibling ?objVar?
Returns the next sibling relativ to the current node as a node object.
previousSibling ?objVar?
Returns the next sibling relativ to the current node as a node object.
getElementsByTagName name
Returns a list of all elements in the subtree matching (glob style) name.
getElementsByTagNameNS uri localname
Returns a list of all elements in the subtree matching (glob style) localname and having the given namespace uri.
getElementById id
Returns the node having a id attribute with value id or the emtpy string, if no node has an id attribute with that value.
hasAttribute attributeName
Returns 1 if the object node contains an attribute with name attributeName . Otherwise 0 is returned.
getAttribute attributeName ?defaultValue?
Returns the value of the attribute attributeName. If attribute is not available defaultValue is returned.
setAttribute attributeName newValue ?attributeName newValue ...?
Sets the value for one or more attributes. Every attributeName is set to the corresponding newValue. If there isn't an attribute for one or more of the attributeName this will create that attribute.
removeAttribute attributeName
Removes the attribute attributeName.
hasAttributeNS uri localName
Returns 1 if the object node contains an attribute with the local name localName within the namespace uri. Otherwise 0 is returned.
getAttributeNS uri localName ?defaultValue?
Returns the value of the attribute with the local name localName within the namespace URI uri. If the node dosn't have that attribute the defaultValue is returned.
setAttributeNS uri qualifiedName newValue ?uri qualifiedName newValue ...?

Sets the value for one or more full qualified attributes. Every attribute qualifiedName with the namespace URI uri will be set to newValue. This will create a new attribute, if it wasn't avialble before. If you want to set an attribute within a namespace you must specify the attribute name with prefix, even if you want to set an already existing attribute to a new value. While searching, if the attribute already exists, only the given uri and the localname of the qualifiedName is used.

$node setAttributeNS "http://some.uri.com/wow" prefix:attr1 attrValue

If the uri is the empty string and the attribute name hasn't a prefix, this method has the same effect as the method setAttribute.

$node setAttributeNS "" attri "some Value"

XML namespace nodes are not in any namespace. Set them this way:

$node setAttributeNS "" xmlns:myprefix "myNamespaceURI"
$node setAttributeNS "" xmlns "newDefaultNamespace"

If your qualifiedName has the prefix "xml" and you give the empty string as uri, the namespace of the attribute defaults to "http://www.w3.org/XML/1998/namespace", as the DOM 2 recommendation requests. With the exceptions of the special prefixes "xmlns" and "xml" you always must provide a non emtpy uri, if your qualifiedName has a prefix.

removeAttributeNS uri localName
Removes the attribute with the local name localName within the namespace uri.
attributes ?attributeNamePattern?
Returns all attributes matching the attributeNamePattern. If attributeNamePattern isn't given all attributes are returned as a Tcl list.
appendChild newChild
Append newChild to the end of the child list of the node.
insertBefore newChild refChild
Insert newChild before the refChild into the list of children of node. If refChild is the empty string, insert newChild at the end of the child nodes list of that node.
replaceChild newChild oldChild
Replace oldChild with newChild in the list of children of that node. The oldChild node will be part of the document fragment list after this operation.
removeChild child
Removes child from the list of children of that node child will be part of the document fragment list after this operation. It is not physically deleted.
delete
Deletes the given node and its complete child tree and frees the complete internal memory. The affected nodes are not accessible through the document fragment list.
cloneNode ?-deep?
Clones this node and adds the new create node into the document fragment list. If the -deep option is specified, all descendant nodes are also cloned.
ownerDocument ?domObjVar?
Returns the document object of the document this node belongs to.
find attrName attrVal ?objVar?
Finds the node with the attribute name attrName, and attribute value attrVal in the subtree starting the current node.
child number|all type attrName attrValue
(XPointer) child
descendant number|all type attrName attrValue
(XPointer) descendant
ancestor number|all type attrName attrValue
(XPointer) ancestor
fsibling number|all type attrName attrValue
(XPointer) fsibling
psibling number|all type attrName attrValue
(XPointer) psibling
root objVar
(XPointer) root
text
Returns all text node children of that current node combined, i.e. appended into one string.
target
For a processing instruction node the target part is returned. Otherwise an error is generated.
data
For a processing instruction node the data part is returned. For a text node, comment node or cdata section node the value is returned. Otherwise an error is generated.
prefix
Returns the namespace prefix.
namespaceURI
Returns the namespace URI.
localName
Returns the localName from the tag name of the given node.
selectNodes ?-namespaces prefixUriList? ?-cache <boolean>? xpathQuery ?typeVar?

Returns the result of applying the XPath query xpathQuery to the subtree. This can be a string/value, a list of strings, a list of nodes or a list of attribute name / value pairs. If typeVar is given the result type name is stored into that variable (empty, bool, number, string, nodes, attrnodes or mixed).

The argument xpathQuery has to be a valid XPath expression. However, there is one exception to that rule. Tcl variable names can appear in the XPath statement at any position where it is legal according to the rules of the XPath syntax to put an XPath variable. The value of the variable is substituted for the variable name. Ignoring the syntax rules of XPath the Tcl variable name may be any legal Tcl var name: local variables, global variables, array entries and so on.

The option -namespaces expects a tcl list with prefix / namespace pairs as argument. If this option is not given, then any namespace prefix within the xpath expression will be first resolved against the list of prefix / namespace pairs set with the selectNodesNamespaces method for the document, the node belongs to. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix. If this option is given, any namespace prefix within the xpath expression will be first resolved against that given list (and ignoring the document global prefix / namespace list). If the list bind the same prefix to different namespaces, then the first binding will win. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix, as usual.

If the -cache option is used with a true value, then the xpathQuery will be looked up in a document specific cache. If the query is found, then the stored pre-compiled query will be used. If the query isn't found, it will be pre-compiled and stored in the cache, for use in further calls. Please notice, that the xpathQuery as given as string is used as key for the cache. This means, that equal XPath expressions, which differ only in white space are treated as different cache entries. Special care is needed, if the XPath expression includes namespace prefixes. During pre-compilation, the prefixes will be resolved first to the prefix / namespace pairs of the -namespaces option, if given, and to the namespaces in scope of the context node at pre-compilation time. If the XPath is found in the cache, neither the -namespaces option nor the namespaces in scope of the context node will be taken in account but the already resolved (stored) namespaces will be used for the query.

Examples:

set paragraphNodes [$node selectNodes {chapter[3]//para[@type='warning' or @type='error'} ]
foreach paragraph $paragraphNodes {
    lappend  values [$paragraph selectNodes attribute::type]
}

set doc [dom parse {<doc xmlns="http://www.defaultnamespace.org"><child/></doc>}]
set root [$doc documentElement]
set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child]
getLine
Returns the line number of that node in the orignal parsed XML.
getColumn
Returns the column number of that node in the orignal parsed XML.
asList
Returns the DOM substree starting form the current node as a nested Tcl list.
asXML ?-indent none/1..8? ?-channel channelId? ?-escapeNonASCII??-escapeAllQuot?
Returns the DOM substree starting from the current node as the root node of the result as an (optional indented) XML string or sends the output directly to the given channelId. If the option -escapeNonASCII is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation. If the option -escapeAllQuot is given, quotation marks will be escaped with &quot; even in text content of elements.
asHTML ?-channel channelId? ?-escapeNonASCII? ?-htmlEntities?
Returns the DOM substree starting from the current node as the root node of the result serialized acording to HTML rules (HTML elements are recognized regardless of case, without end tags for emtpy HTML elements etc.), as string or sends the output directly to the given channelId. If the option -escapeNonASCII is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation. If the option -htmlEntities is given, a character is outputed using a HTML 4.01 character entity reference, if one is defined for it.
asText
For ELEMENT_NODEs, the asText method outputs the string-value of every text node descendant of node in document order without any escaping. For every other node type, this method outputs the the XPath string value of that node.
appendFromList list
Parses list , creates an according DOM subtree and appends this subtree to the current node.
appendFromScript tclScript
Appends the nodes created in the tclScript by Tcl functions, which have been built using dom createNodeCmd, to the given node.
insertBeforeFromScript tclScript refChild
Inserts the nodes created in the tclScript by Tcl functions, which have been built using dom createNodeCmd, before the refChild into to the list of children of node. If refChild is the empty string, the new nodes will be appended.
appendXML XMLstring
Parses XMLstring, creates an according DOM subtree and appends this subtree to the current node.
simpleTranslate outputVar specifications
Translate the subtree starting at the object node according to the specifications in specifications and outputs the result in the variable outputVar . The translation is very similar to Cost Simple mode.
toXPath
Returns an XPath, which exactly addresses the given node in its document. This XPath is only valid as there are no changes to DOM tree made later one.
getBaseURI
Returns the baseURI of the node. This method is deprecated in favor of the baseURI method.
baseURI ?URI?
Returns the present baseURI of the node. If the optional argument URI is given, sets the base URI of the node and of all of its child nodes out of the same enitity as node to the given URI.
disableOutputEscaping ?boolean?
This method works only for text nodes; for every other nodes it returns error. Without the optional argument it returns, if disabling output escaping is on. The return value 0 means, the characters of the text node will be escaped, to generate valid XML, if serialized. This is the default for every parsed or created text node (with the exception of that text nodes in a result tree of an XSLT transformation, for which disabling output escaping was requested explicitely in the stylesheet). The return value 1 means, that output escaping is disabled for this text node. If such a text node is serialized (with asXML or asHTML), it is literarily written, without escaping of the special XML characters. If the optional boolean value boolean is given, the flag is set accordingly. You should not set this flag to 1, until you really know, what you do.
precedes refnode
Compares the relative order of the node and refnode. Both nodes must be part of the same documents and not out of the fragment list of the document. Returns true, if node is in document order (in the sense of the XPath 1.0 recommendation) before refnode and false otherwise.
normalize ?-forXPath?
Puts all Text nodes in the full depth of the sub-tree underneath this Node into a "normal" form where only structure (e.g., elements, comments, processing instructions and CDATA sections) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes. If the option -forXPath is given, all CDATA sections in the nodes are converted to text nodes, as a first step before the normalization.
xslt ?-parameters parameterList? ?-ignoreUndeclaredParameters? ?-xsltmessagecmd script? stylesheet ?outputVar?
Applies an XSLT transformation on the document using the XSLT stylesheet (given as domDoc). Returns a document object containing the result document of that transformation and stores it in the optional outputVar.

The optional -parameters option sets top level <xsl:param> to string values. The parameterList has to be a tcl list consisting of parameter name and value pairs.

If the option -ignoreUndeclaredParameters is given, then parameter names in the parameterList given to the -parameters options that are not declared as top-level parameters in the stylesheet are silently ignored. Without this option, an error is raised, if the user tries to set a top-level parameter, which is not declared in the stylesheet.

The -xsltmessagecmd option sets a callback for xslt:message elements in the stylesheet. The actual command consists of the script, given as argument to the option, appended with the XML Fragment from instantiating the xsl:message element content as string (as if the XPath string() function would have been applied to the XML Fragment) and a flag, which indicates, if the xsl:message has an attribute "terminate" with the value "yes".

@attrName
Returns the value of the attribute attrName. Short cut for getAttribute.

Otherwise, if an unknown method name is given, the command with the same name as the given method within the namespace ::dom::domNode is tried to be executed. This allows quick method additions on Tcl level.

SEE ALSO

dom, domDoc

KEYWORDS

XML, DOM, document, node, parsing

tDOM-0.8.3/doc/README0000644000175000017500000000320207513607653014215 0ustar ssobernissoberni The documentation is written in TMML (developed by Joe English). See http://tmml.sourceforge.net/ for informations about TMML. The HTML files and man pages are created from the TMML sources. To process the TMML files you need: o tDOM tDOM must be already successfully installed. o TMML VERY IMPORTANT: Make sure, you have the current CVS HEAD of TMML. The latest TMML distribution dates from August 2000 and could not used for the steps, described below. Informations about how to get TMML CVS HEAD could be found at http://sourceforge.net/cvs/?group_id=16386 You only need to check out the actual version of TMML, no further installation or modification is needed. o tcllib The TMML tools uses a module out of tcllib. Any recent distribution should do. If you really don't have it already, it's worth to install it, regardless of this TMML stuff. Installation should be completely painless. Find it at http://sourceforge.net/project/showfiles.php?group_id=12883 If you have all requirements in place, just do: tclsh path/to/your/tmml/tools/tmml.tcl toman dom.xml ?domDoc.xml ...? This creates nroff man pages of the accordingly documentation in the sub dir man (which will be automatically created, if it doesn't exist.) The next command creates the HTML pages: tclsh path/to/your/tmml/tools/tmml.tcl tohtml dom.xml ?domDoc.xml ...? This creates the HTML pages in the html sub dir (also, will be created, if needed). And you may do tclsh path/to/your/tmml/tools/tmml.tcl navpages This will create an index.html, the category-index.html and the keyword-index.html for the HTML version of the documentation. tDOM-0.8.3/doc/tDOM.xml0000644000175000017500000000070707435314536014667 0ustar ssobernissoberni ]> tDOM manual &dom; &domDoc; &domNode; &expat; &expatapi; &tdomcmd; &tnc; tDOM-0.8.3/doc/expat.html0000644000175000017500000006442610156370650015352 0ustar ssobernissoberni tDOM manual: expat

NAME

expat -
Creates an instance of an expat parser object

SYNOPSIS

package require tdom

expat ?parsername? ?-namespace? ?arg arg ..

xml::parser ?parsername? ?-namespace? ?arg arg ..

DESCRIPTION

The parser created with expat or xml::parser (which is just another name for the same command in an own namespace) are able to parse any kind of well-formed XML. The parsers are stream oriented XML parser. This means that you register handler scripts with the parser prior to starting the parse. These handler scripts are called when the parser discovers the associated structures in the document being parsed. A start tag is an example of the kind of structures for which you may register a handler script.

The parsers do not validate the XML document. They do parse the internal DTD and, at request, external DTD and external entities, if you resolve the identifier of the external entities with the -externalentitycommand script (see there).

Additionly, the Tcl extension code that implements this command provides an API for adding C level coded handlers. Up to now, there exists the parser extension command "tdom". The handler set installed by this extension build an in memory "tDOM" DOM tree, while the parser is parsing the input.

It is possible to register an arbitrary amount of different handler scripts and C level handlers for most of the events. If the event occurs, they are called in turn.

COMMAND OPTIONS

-namespace

Enables namespace parsing. You must use this option while creating the parser with the expat or xml::parser command. You can't enable (nor disable) namespace parsing with <parserobj> configure ....

-final boolean

This option indicates whether the document data next presented to the parse method is the final part of the document. A value of "0" indicates that more data is expected. A value of "1" indicates that no more is expected. The default value is "1".

If this option is set to "0" then the parser will not report certain errors if the XML data is not well-formed upon end of input, such as unclosed or unbalanced start or end tags. Instead some data may be saved by the parser until the next call to the parse method, thus delaying the reporting of some of the data.

If this option is set to "1" then documents which are not well-formed upon end of input will generate an error.

-baseurl url

Reports the base url of the document to the parser.

-elementstartcommand script

Specifies a Tcl command to associate with the start tag of an element. The actual command consists of this option followed by at least two arguments: the element type name and the attribute list.

The attribute list is a Tcl list consisting of name/value pairs, suitable for passing to the array set Tcl command.

Example:

proc HandleStart {name attlist} {
    puts stderr "Element start ==> $name has attributes $attlist"
}

$parser configure -elementstartcommand HandleStart

$parser parse {<test id="123"></test>}

This would result in the following command being invoked:

HandleStart text {id 123}
-elementendcommand script

Specifies a Tcl command to associate with the end tag of an element. The actual command consists of this option followed by at least one argument: the element type name. In addition, if the -reportempty option is set then the command may be invoked with the -empty configuration option to indicate whether it is an empty element. See the description of the -reportempty option for an example.

Example:

proc HandleEnd {name} {
    puts stderr "Element end ==> $name"
}

$parser configure -elementendcommand HandleEnd

$parser parse {<test id="123"></test>}

This would result in the following command being invoked:

HandleEnd test
-characterdatacommand script

Specifies a Tcl command to associate with character data in the document, ie. text. The actual command consists of this option followed by one argument: the text.

It is not guaranteed that character data will be passed to the application in a single call to this command. That is, the application should be prepared to receive multiple invocations of this callback with no intervening callbacks from other features.

Example:

proc HandleText {data} {
    puts stderr "Character data ==> $data"
}

$parser configure -characterdatacommand HandleText

$parser parse {<test>this is a test document</test>}

This would result in the following command being invoked:

HandleText {this is a test document}
-processinginstructioncommand script

Specifies a Tcl command to associate with processing instructions in the document. The actual command consists of this option followed by two arguments: the PI target and the PI data.

Example:

proc HandlePI {target data} {
    puts stderr "Processing instruction ==> $target $data"
}

$parser configure -processinginstructioncommand HandlePI

$parser parse {<test><?special this is a processing instruction?></test>}

This would result in the following command being invoked:

HandlePI special {this is a processing instruction}
-notationdeclcommand script

Specifies a Tcl command to associate with notation declaration in the document. The actual command consists of this option followed by four arguments: the notation name, the base uri of the document (this means, whatever was set by the -baseurl option), the system identifier and the public identifier. The notation name is never empty, the other arguments may be.

-externalentitycommand script

Specifies a Tcl command to associate with references to external entities in the document. The actual command consists of this option followed by three arguments: the base uri, the system identifier of the entity and the public identifier of the entity. The base uri and the public identifier may be the empty list.

This handler script has to return a tcl list consisting of three elements. The first element of this list signals, how the external entity is returned to the processor. At the moment, the three allowed types are "string", "channel" and "filename". The second element of the list has to be the (absolute) base URI of the external entity to be parsed. The third element of the list are data, either the already read data out of the external entity as string in the case of type "string", or the name of a tcl channel, in the case of type "channel", or the path to the external entity to be read in case of type "filename". Behind the scene, the external entity referenced by the returned Tcl channel, string or file name will be parsed with an expat external entity parser with the same handler sets as the main parser. If parsing of the external entity fails, the whole parsing is stopped with an error message. If a Tcl command registered as externalentitycommand isn't able to resolve an external entity it is allowed to return TCL_CONTINUE. In this case, the wrapper give the next registered externalentitycommand a try. If no externalentitycommand is able to handle the external entity parsing stops with an error.

Example:

proc externalEntityRefHandler {base systemId publicId} {
    if {![regexp {^[a-zA-Z]+:/} $systemId]}  {
        regsub {^[a-zA-Z]+:} $base {} base
        set basedir [file dirname $base]
        set systemId "[set basedir]/[set systemId]"
    } else {
        regsub {^[a-zA-Z]+:} $systemId systemId
    }
    if {[catch {set fd [open $systemId]}]} {
        return -code error \
                -errorinfo "Failed to open external entity $systemId"
    }
    return [list channel $systemId $fd]
}

set parser [expat -externalentitycommand externalEntityRefHandler \
                  -baseurl "file:///local/doc/doc.xml" \
                  -paramentityparsing notstandalone]
$parser parse {<?xml version='1.0'?>
<!DOCTYPE test SYSTEM "test.dtd">
<test/>}

This would result in the following command being invoked:

externalEntityRefHandler file:///local/doc/doc.xml test.dtd {}

External entities are only tried to resolve via this handler script, if necessary. This means, external parameter entities triggers this handler only, if -paramentityparsing is used with argument "always" or if -paramentityparsing is used with argument "notstandalone" and the document isn't marked as standalone.

-unknownencodingcommand script

Not implemented at Tcl level.

-startnamespacedeclcommand script

Specifies a Tcl command to associate with start scope of namespace declarations in the document. The actual command consists of this option followed by two arguments: the namespace prefix and the namespace URI. For an xmlns attribute, prefix will be the empty list. For an xmlns="" attribute, uri will be the empty list. The call to the start and end element handlers occur between the calls to the start and end namespace declaration handlers.

-endnamespacedeclcommand script

Specifies a Tcl command to associate with end scope of namespace declarations in the document. The actual command consists of this option followed by the namespace prefix as argument. In case of an xmlns attribute, prefix will be the empty list. The call to the start and end element handlers occur between the calls to the start and end namespace declaration handlers.

-commentcommand script

Specifies a Tcl command to associate with comments in the document. The actual command consists of this option followed by one argument: the comment data.

Example:

proc HandleComment {data} {
    puts stderr "Comment ==> $data"
}

$parser configure -commentcommand HandleComment

$parser parse {<test><!-- this is <obviously> a comment --></test>}

This would result in the following command being invoked:

HandleComment { this is <obviously> a comment }
-notstandalonecommand script

This Tcl command is called, if the document is not standalone (it has an external subset or a reference to a parameter entity, but does not have standalone="yes"). It is called with no additional arguments.

-startcdatasectioncommand script

Specifies a Tcl command to associate with the start of a CDATA section. It is called with no additional arguments.

-endcdatasectioncommand script

Specifies a Tcl command to associate with the end of a CDATA section. It is called with no additional arguments.

-elementdeclcommand script

Specifies a Tcl command to associate with element declarations. The actual command consists of this option followed by two arguments: the name of the element and the content model. The content model arg is a tcl list of four elements. The first list element specifies the type of the XML element; the six different possible types are reported as "MIXED", "NAME", "EMPTY", "CHOICE", "SEQ" or "ANY". The second list element reports the quantifier to the content model in XML Syntax ("?", "*" or "+") or is the empty list. If the type is "MIXED", then the quantifier will be "{}", indicating an PCDATA only element, or "*", with the allowed elements to intermix with PCDATA as tcl list as the fourth argument. If the type is "NAME", the name is the third arg; otherwise the third argument is the empty list. If the type is "CHOICE" or "SEQ" the fourth argument will contain a list of content models build like this one. The "EMPTY", "ANY", and "MIXED" types will only occur at top level.

Examples:

proc elDeclHandler {name content} {
     puts "$name $content"
}

set parser [expat -elementdeclcommand elDeclHandler]
$parser parse {<?xml version='1.0'?>
<!DOCTYPE test [
<!ELEMENT test (#PCDATA)> 
]>
<test>foo</test>}

This would result in the following command being invoked:

test {MIXED {} {} {}}

$parser reset
$parser parse {<?xml version='1.0'?>
<!DOCTYPE test [
<!ELEMENT test (a|b)>
]>
<test><a/></test>}

This would result in the following command being invoked:

elDeclHandler test {CHOICE {} {} {{NAME {} a {}} {NAME {} b {}}}}
-attlistdeclcommand script

Specifies a Tcl command to associate with attlist declarations. The actual command consists of this option followed by five arguments. The Attlist declaration handler is called for *each* attribute. So a single Attlist declaration with multiple attributes declared will generate multiple calls to this handler. The arguments are the element name this attribute belongs to, the name of the attribute, the type of the attribute, the default value (may be the empty list) and a required flag. If this flag is true and the default value is not the empty list, then this is a "#FIXED" default.

Example:

proc attlistHandler {elname name type default isRequired} {
    puts "$elname $name $type $default $isRequired"
}

set parser [expat -attlistdeclcommand attlistHandler]
$parser parse {<?xml version='1.0'?>
<!DOCTYPE test [
<!ELEMENT test EMPTY>
<!ATTLIST test
          id      ID      #REQUIRED
          name    CDATA   #IMPLIED>
]>
<test/>}

This would result in the following commands being invoked:

attlistHandler test id ID {} 1
attlistHandler test name CDATA {} 0
-startdoctypedeclcommand script

Specifies a Tcl command to associate with the start of the DOCTYPE declaration. This command is called before any DTD or internal subset is parsed. The actual command consists of this option followed by four arguments: the doctype name, the system identifier, the public identifier and a boolean, that shows if the DOCTYPE has an internal subset.

-enddoctypedeclcommand script

Specifies a Tcl command to associate with the end of the DOCTYPE declaration. This command is called after processing any external subset. It is called with no additional arguments.

-paramentityparsing never|notstandalone|always

"never" disables expansion of parameter entities, "always" expands always and "notstandalone" only, if the document isn't "standalone='no'". The default ist "never"

-entitydeclcommand script

Specifies a Tcl command to associate with any entity declaration. The actual command consists of this option followed by seven arguments: the entity name, a boolean identifying parameter entities, the value of the entity, the base uri, the system identifier, the public identifier and the notation name. According to the type of entity declaration some of this arguments may be the empty list.

-ignorewhitecdata boolean

If this flag is set, element content which contain only whitespaces isn't reported with the -characterdatacommand.

-ignorewhitespace boolean
Another name for -ignorewhitecdata; see there.
-handlerset name

This option sets the Tcl handler set scope for the configure options. Any option value pair following this option in the same call to the parser are modifying the named Tcl handler set. If you don't use this option, you are modifying the default Tcl handler set, named "default".

-noexpand boolean

Normally, the parser will try to expand references to entities defined in the internal subset. If this option is set to a true value this entities are not expanded, but reported literal via the default handler. Warning: If you set this option to true and doesn't install a default handler (with the -defaultcommand option) for every handler set of the parser all internal entities are silent lost for the handler sets without a default handler.

-useForeignDTD <boolen>
If <boolen> is true and the document does not have an external subset, the parser will call the -externalentitycommand script with empty values for the systemId and publicID arguments. This option must be set, before the first piece of data is parsed. Setting this option, after the parsing has started has no effect. The default is not to use a foreign DTD. The default is restored, after reseting the parser. Pleace notice, that a -paramentityparsing value of "never" (which is the default) suppresses any call to the -externalentitycommand script. Pleace notice, that, if the document also doesn't have an internal subset, the -startdoctypedeclcommand and enddoctypedeclcommand scripts, if set, are not called.

COMMAND METHODS

parser configure option value ?option value?

Sets configuration options for the parser. Every command option, except -namespace can be set or modified with this method.

parser cget ?-handlerset name? option

Return the current configuration value option for the parser.

If the -handlerset option is used, the configuration for the named handler set is returned.

parser free

Deletes the parser and the parser command. A parser cannot be freed from within one of its handler callbacks (neither directly nor indirectly) and will raise a tcl error in this case.

parser get -specifiedattributecount|-idattributeindex|-currentbytecount|-currentlinenumber|-currentcolumnnumber|-currentbyteindex
-specifiedattributecount

Returns the number of the attribute/value pairs passed in last call to the elementstartcommand that were specified in the start-tag rather than defaulted. Each attribute/value pair counts as 2; thus this corresponds to an index into the attribute list passed to the elementstartcommand.

-idattributeindex

Returns the index of the ID attribute passed in the last call to XML_StartElementHandler, or -1 if there is no ID attribute. Each attribute/value pair counts as 2; thus this corresponds to an index into the attributes list passed to the elementstartcommand.

-currentbytecount

Return the number of bytes in the current event. Returns 0 if the event is in an internal entity.

-currentlinenumber

Returns the line number of the current parse location.

-currentcolumnnumber

Returns the column number of the current parse location.

-currentbyteindex

Returns the byte index of the current parse location.

Only one value may be requested at a time.

parser parse data

Parses the XML string data. The event callback scripts will be called, as there triggering events happens. This method cannot be used from within a callback (neither directly nor indirectly) of the parser to be used and will raise an error in this case.

parser parsechannel channelID

Reads the XML data out of the tcl channel channelID (starting at the current access position, without any seek) up to the end of file condition and parses that data. The channel encoding is respected. Use the helper proc tDOM::xmlOpenFile out of the tDOM script library to open a file, if you want to use this method. This method cannot be used from within a callback (neither directly nor indirectly) of the parser to be used and will raise an error in this case.

parser parsefile filename

Reads the XML data directly out of the file with the filename filename and parses that data. This is done with low level file operations. The XML data must be in US-ASCII, ISO-8859-1, UTF-8 or UTF-16 encoding. If applicable, this is the fastest way, to parse XML data. This method cannot be used from within a callback (neither directly nor indirectly) of the parser to be used and will raise an error in this case.

parser reset

Resets the parser in preparation for parsing another document. A parser cannot be reseted from within one of its handler callbacks (neither directly nor indirectly) and will raise a tcl error in this cases.

Callback Command Return Codes

A script invoked for any of the parser callback commands, such as -elementstartcommand, -elementendcommand, etc, may return an error code other than "ok" or "error". All callbacks may in addition return "break" or "continue".

If a callback script returns an "error" error code then processing of the document is terminated and the error is propagated in the usual fashion.

If a callback script returns a "break" error code then all further processing of every handler script out of this Tcl handler set is suppressed for the further parsing. This does not influence any other handler set.

If a callback script returns a "continue" error code then processing of the current element, and its children, ceases for every handler script out of this Tcl handler set and processing continues with the next (sibling) element. This does not influence any other handler set.

SEE ALSO

expatapi, tdom

KEYWORDS

SAX

tDOM-0.8.3/doc/expatapi.xml0000644000175000017500000002320307435314536015673 0ustar ssobernissoberni CheckExpatParserObj, CHandlerSetInstall, CHandlerSetRemove, CHandlerSetCreate, CHandlerSetGetUserData, GetExpatInfo Functions to create, install and remove expat parser object extensions. #include <tclexpat.h> int CheckExpatParserObj (interp, nameObj) int CHandlerSetInstall (interp, expatObj, handlerSet) int CHandlerSetRemove (interp, expatObj, handlerSetName) CHandlerSet* CHandlerSetCreate (handlerSetName) CHandlerSet* CHandlerSetGet (interp, expatObj, handlerSetName) void* CHandlerSetGetUserData (interp, expatObj, handlerSetName) TclGenExpatInfo* GetExpatInfo (interp, expatObj)
ARGUMENTS Tcl_Interp *interp in Interpreter with the expat parser object. Tcl_Obj *expatObj in A Tcl Object containing the command name of the expat parser object to be queried or modified. char *handlerSetName in Identifier of the handler set. CHandlerSet *handlerSet in Pointer to a C handler set. Tcl_Obj *nameObj A Tcl Object containing the name of a expat parser object
DESCRIPTION

The functions described in this manual allows to add C level coded event handler to an tDOM Tcl expat parser objects. A tDOM Tcl expat parser object is able to have several Tcl scripts and C functions associated with an specific event. If the event occurs, first the Tcl scripts then the C functions associated with the event are called in turn.

A tDOM Tcl expat parser extension is an ordinary Tcl extension and loaded like every other Tcl extension. It must install at least one new Tcl Level command, that manipulates a tDOM Tcl expat parser object.

A C level handler set is a data structure like this:

typedef struct CHandlerSet { struct CHandlerSet *nextHandlerSet; char *name; /* refname of the handler set */ int ignoreWhiteCDATAs; /* ignore 'white' CDATA sections */ void *userData; /* Handler set specific Data Structure; the C handler set extention has to malloc the needed structure in his init func and has to provide a cleanup func (to free it). */ CHandlerSet_userDataReset resetProc; CHandlerSet_userDataFree freeProc; /* C func for element start */ XML_StartElementHandler elementstartcommand; /* C func for element end */ XML_EndElementHandler elementendcommand; /* C func for character data */ XML_CharacterDataHandler datacommand; /* C func for namespace decl start */ XML_StartNamespaceDeclHandler startnsdeclcommand; /* C func for namespace decl end */ XML_EndNamespaceDeclHandler endnsdeclcommand; /* C func for processing instruction */ XML_ProcessingInstructionHandler picommand; /* C func for default data */ XML_DefaultHandler defaultcommand; /* C func for unparsed entity declaration */ XML_NotationDeclHandler notationcommand; /* C func for external entity */ XML_ExternalEntityRefHandler externalentitycommand; /* C func for unknown encoding */ XML_UnknownEncodingHandler unknownencodingcommand; /* C func for comments */ XML_CommentHandler commentCommand; /* C func for "not standalone" docs */ XML_NotStandaloneHandler notStandaloneCommand; /* C func for CDATA section start */ XML_StartCdataSectionHandler startCdataSectionCommand; /* C func for CDATA section end */ XML_EndCdataSectionHandler endCdataSectionCommand; /* C func for !ELEMENT decl's */ XML_ElementDeclHandler elementDeclCommand; /* C func for !ATTLIST decl's */ XML_AttlistDeclHandler attlistDeclCommand; /* C func for !DOCTYPE decl's */ XML_StartDoctypeDeclHandler startDoctypeDeclCommand; /* C func for !DOCTYPE decl ends */ XML_EndDoctypeDeclHandler endDoctypeDeclCommand; /* C func for !ENTITY decls's */ XML_EntityDeclHandler entityDeclCommand; } CHandlerSet;

The types and the arguments of the event functions (XML_*) are exactly the same like the expat lib handler functions and described in detail in expat.h, see there. The extension has only to provided the handler functions needed; it's perfectly OK to leave unused handler slots as the are (they are initialized to NULL by CHandlerSetCreate).

The name of this structure is used to identify the handler set.

If the flag ignoreWhiteCDATAs is set, element content which contain only whitespace isn't reported with the datacommand.

The userData element points to the handler set specific data. The event handler functions are called with this pointer as userData argument.

resetProc and freeProc must have arguments that match the type

void (Tcl_Interp *interp, void *userData)

resetProc is called in case the parser is reseted with <parserObj> reset and should do any necessary cleanup and reinitializing to prepare the C handler set for a new XML document. The freeProc is called, if the parser is deleted and should do memory cleanup etc.

CHandlerSetCreate create a C handler set, gives it the name name and initializes any other element with NULL.

CHandlerSetInstall adds the handlerSet to the parser expatObj. The parser has to be a tDOM Tcl expat parser object in the interpreter interp. The name of the C handler set has to be unique for the parser. Returns 0 in case of success. Returns 1 if expatObj isn't a parser object in the interpreter interp. Returns 2 if this parser has already a C handler set with the handlerSet name.

CHandlerSetRemove removes the C handler set referenced by the handlerSetName from the parser expatObj. The parser has to be a tDOM Tcl expat parser object in the interpreter interp. CHandlerSetRemove calls the freeProc function of the C handler set structure, removes the handler set from the C handler set list and frees the handler structure. Returns 0 in case of success. Returns 1 if expatObj isn't a parser object in the interpreter interp. Returns 2 if this parser hasn't a C handler set named handlerSetName.

CheckExpatParserObj returns 1, if nameObj is a tDOM Tcl expat parser object in the interpreter interp, otherwise it returns 0. Example:

int TclExampleObjCmd(dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { char *method; CHandlerSet *handlerSet; int methodIndex, result; simpleCounter *counter; static char *exampleMethods[] = { "enable", "getresult", "remove", NULL }; enum exampleMethod { m_enable, m_getresult, m_remove }; if (objc != 3) { Tcl_WrongNumArgs (interp, 1, objv, example_usage); return TCL_ERROR; } if (!CheckExpatParserObj (interp, objv[1])) { Tcl_SetResult (interp, "First argument has to be a expat parser object", NULL); return TCL_ERROR; } /* ... */

CHandlerSetGet returns a pointer to the C handler Set referenced by the name handlerSetName of the parser object expatObj. expatObj has to be an expat parser object in the interpreter interp. Returns NULL in case of error.

CHandlerSetGetUserData returns a pointer to the userData of the C handler set referenced by the name handlerSetName of the parser object expatObj. expatObj has to be an expat parser object in the interpreter interp. Returns NULL in case of error.

GetExpatInfo Is a helper function that returns a pointer to the TclGenExpatInfo structure of the tDOM Tcl expat parser object expatObj. The expatObj has to be a tDOM Tcl expat parser object in the interpreter interp. This is most useful, to set the application status of the parser object.

See the simple but full functionally example in the extensions/example dir or the more complex example tnc in the extensions/tnc dir (a simple DTD validation extension).

expat C handler set
tDOM-0.8.3/doc/tnc.xml0000644000175000017500000001251207625770010014637 0ustar ssobernissoberni tnc tnc is an expat parser object extension, that validates the XML stream against the document DTD while parsing. package require tdom package require tnc set parser [expat] tnc $parser enable
DESCRIPTION

tnc adds the C handler set "tnc" to a tcl expat parser obj. This handler set is a simple DTD validator. If the validator detects a validation error, it sets the interp result, signals error and stops parsing. There isn't any validation error recovering. As a consequence, only valid documents are completely parsed.

This handler set has only three methods:

tnc parserObj enable

Adds the tnc C handler set to a Tcl expat parser object.

tnc parserObj remove

Removes the tnc validatore from the parser parserObj and frees all information, stored by it.

tnc parserObj getValidateCmd

Returns a new created validation command, if one is avaliable from the parser command, otherwise it signals error. The name of the validation command is the validateCmdName, if this optional argument was given, or a random choosen name. A validation command is avaliable in a parser command, if the parser with tnc enabled was previously used, to parse an XML document with a valid doctype declaration, a valid external subset, if one was given by the doctype declaration, and a valid internal subset. The further document doesn't need to be valid, to make the validation command avaliable. The validation command can only get received one time from the parser command. The created validation command has this syntax:

validationCmd method ?args?

The valid methods are:

validateDocument domDocument ?varName? Checks, if the given domDocument is valid against the DTD information represented by the validation command. Returns 1, if the document ist valid, 0 otherwise. If the varName argument is given, then the variable it names is set to the detected reason for the validation error or to the empty string in case of a valid document. validateTree elementNode ?varName? Checks, if the given subtree with domNode as root element is a posible valid subtree of a document conforming to the DTD information represented by teh validation command. IDREF could not checked, while validating only a subtree, but it is checked, that every known ID attribute in the subtree is unique. Returns 1, if the subtree is OK, 0 otherwise. If the varName argument is given, then the variable it names is set to the detected reason for the validation error or to the empty string in case of a valid subtree. validateAttributes elementNode ?varName? Checks, if there is an element declaration for the name of the elementNode in the DTD represented by the validation command and, if yes, if the attributes of the elementNode are conform to the ATTLIST declarations for that element in the DTD. Returns 1, if the attributes and there value types are OK, 0 otherwise. If the varName argument is given, then the variable it names is set to the detected reason for the validation error or to the empty string in case the element has all its required attributes, only declared attributes and the values of the attributes matches there type. delete Deletes the validation command and frees the memory used by it. Returns the empty string.
BUGS

The validation error reports could be much more informative and user-friendly.

The validator doesn't detect ambiguous content models (see XML recomendation Section 3.2.1 and Appendix E). Most Java validators also doesn't, but handle such content models right anyhow. Tnc does not; if your DTD has such ambiguous content models, tnc can not used to validate documents against such (not completely XML spec compliant) DTDs.

It isn't possible to validate XML documents with standalone="yes" in the XML Declaration

Violations of the validity constraints Proper Group/PE Nesting and Proper Conditional Section/PE Nesting are not detected. They could only happen inside a invalid DTD, not in the content of a document.

Validation DTD
tDOM-0.8.3/doc/category-index.html0000644000175000017500000000270210114755302017133 0ustar ssobernissoberni tDOM manual: Index

tDOM manual: Index

tDOM-0.8.3/doc/dom.n0000644000175000017500000004042210170564412014264 0ustar ssobernissoberni'\" '\" Generated from dom.xml '\" '\" BEGIN man.macros .if t .wh -1.3i ^B .nr ^l \n(.l .ad b .de AP .ie !"\\$4"" .TP \\$4 .el \{\ . ie !"\\$2"" .TP \\n()Cu . el .TP 15 .\} .ta \\n()Au \\n()Bu .ie !"\\$3"" \{\ \&\\$1 \\fI\\$2\\fP (\\$3) .\".b .\} .el \{\ .br .ie !"\\$2"" \{\ \&\\$1 \\fI\\$2\\fP .\} .el \{\ \&\\fI\\$1\\fP .\} .\} .. .de AS .nr )A 10n .if !"\\$1"" .nr )A \\w'\\$1'u+3n .nr )B \\n()Au+15n .\" .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n .nr )C \\n()Bu+\\w'(in/out)'u+2n .. .AS Tcl_Interp Tcl_CreateInterp in/out .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. .de BE .nf .ti 0 .mk ^t .ie n \l'\\n(^lu\(ul' .el \{\ .\" Draw four-sided box normally, but don't draw top of .\" box if the box started on an earlier page. .ie !\\n(^b-1 \{\ \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .el \}\ \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .\} .fi .br .nr ^b 0 .. .de VS .if !"\\$2"" .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. .de VE .ie n 'mc .el \{\ .ev 2 .nf .ti 0 .mk ^t \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' .sp -1 .fi .ev .\} .nr ^v 0 .. .de ^B .ev 2 'ti 0 'nf .mk ^t .if \\n(^b \{\ .\" Draw three-sided box if this is the box's first page, .\" draw two sides but no top otherwise. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .\} .if \\n(^v \{\ .nr ^x \\n(^tu+1v-\\n(^Yu \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c .\} .bp 'fi .ev .if \\n(^b \{\ .mk ^y .nr ^b 2 .\} .if \\n(^v \{\ .mk ^Y .\} .. .de DS .RS .nf .sp .. .de DE .fi .RE .sp .. .de SO .SH "STANDARD OPTIONS" .LP .nf .ta 5.5c 11c .ft B .. .de SE .fi .ft R .LP See the \\fBoptions\\fR manual entry for details on the standard options. .. .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. .de CS .RS .nf .ta .25i .5i .75i 1i .if t .ft C .. .de CE .fi .if t .ft R .RE .. .de UL \\$1\l'|0\(ul'\\$2 .. '\" END man.macros .TH dom n "" Tcl "" .BS .SH NAME dom \- Create an in-memory DOM tree from XML .SH SYNOPSIS .nf package require tdom \&\fBdom\fP \fImethod\fR ?\fIarg arg ...\fR? .fi .BE .SH "DESCRIPTION " .PP This command provides the creation of complete DOM trees in memory. In the usual case a string containing a XML information is parsed and converted into a DOM tree. \fImethod\fR indicates a specific subcommand. .PP The valid methods are: .TP \&\fB\fBdom\fP \fBparse\fP ?\fIoptions\fB? ?\fIdata\fB? \&\fRParses the XML information and builds up the DOM tree in memory providing a Tcl object command to this DOM document object. Example: .RS .CS dom parse $xml doc $doc documentElement root .CE .PP parses the XML in the variable xml, creates the DOM tree in memory, make a reference to the document object, visible in Tcl as a document object command, and assigns this new object name to the variable doc. When doc gets freed, the DOM tree and the associated Tcl command object (document and all node objects) are freed automatically. .CS set document [dom parse $xml] set root [$document documentElement] .CE .PP parses the XML in the variable xml, creates the DOM tree in memory, make a reference to the document object, visible in Tcl as a document object command, and returns this new object name, which is then stored in \&\fIdocument\fR. To free the underlying DOM tree and the associative Tcl object commands (document + nodes + fragment nodes) the document object command has to be explicitly deleted by: .CS $document delete .CE or .CS rename $document "" .CE .PP The valid options are: .IP "\fB-simple\fR" If \fI-simple\fR is specified, a simple but fast parser is used (conforms not fully to XML recommendation). That should double parsing and DOM generation speed. The encoding of the data is not transformed inside the parser. The simple parser does not respect any encoding information in the XML declaration. It skips over the internal DTD subset and ignores any information in it. Therefor it doesn't include defaulted attribute values into the tree, even if the according attribute declaration is in the internal subset. It also doesn't expand internal or external entity references other than the predefined entities and character references. .IP "\fB-html\fR" If \fI-html\fR is specified, a fast HTML parser is used, which tries to even parse badly formed HTML into a DOM tree. .IP "\fB-keepEmpties\fR" If \fI-keepEmpties\fR is specified, text nodes, which contain only whitespaces, will be part of the resulting DOM tree. In default case (\fI-keepEmpties\fR not given) those empty text nodes are removed at parsing time. .IP "\fB-channel \fI\fP\fR" If \fI-channel \fR is specified, the input to be parsed is read from the specified channel. The encoding setting of the channel (via fconfigure -encoding) is respected, ie the data read from the channel are converted to UTF-8 according to the encoding settings, befor the data is parsed. .IP "\fB-baseurl \fI\fP\fR" If \fI-baseurl \fR is specified, the baseURI is used as the base URI of the document. External entities referenced in the document are resolved relative to this base URI. This base URI is also stored within the DOM tree. .IP "\fB-feedbackAfter \fI<#bytes>\fP\fR" If \fI-feedbackAfter <#bytes>\fR is specified, the tcl command ::dom::domParseFeedback is evaluated after parsing every #bytes. If you use this option, you have to create a tcl proc named ::dom::domParseFeedback, otherwise you will get an error. Please notice, that the calls of ::dom::domParseFeedback are not done exactly every #bytes, but always at the first element start after every #bytes. .IP "\fB-externalentitycommand \fI]]>

or

]]>

should be output as

if (a < b) foo()]]>

The html output method should not escape < characters occurring in attribute values.

If the indent attribute has the value yes, then the html output method may add or remove whitespace as it outputs the result tree, so long as it does not change how an HTML user agent would render the output. The default value is yes.

The html output method should escape non-ASCII characters in URI attribute values using the method recommended in Section B.2.1 of the HTML 4.0 Recommendation.

The html output method may output a character using a character entity reference, if one is defined for it in the version of HTML that the output method is using.

The html output method should terminate processing instructions with > rather than ?>.

The html output method should output boolean attributes (that is attributes with only a single allowed value that is equal to the name of the attribute) in minimized form. For example, a start-tag written in the stylesheet as

]]>

should be output as

]]>

The html output method should not escape a & character occurring in an attribute value immediately followed by a { character (see Section B.7.1 of the HTML 4.0 Recommendation). For example, a start-tag written in the stylesheet as

]]>

should be output as

]]>

The encoding attribute specifies the preferred encoding to be used. If there is a HEAD element, then the html output method should add a META element immediately after the start-tag of the HEAD element specifying the character encoding actually used. For example,

...]]>

It is possible that the result tree will contain a character that cannot be represented in the encoding that the XSLT processor is using for output. In this case, if the character occurs in a context where HTML recognizes character references, then the character should be output as a character entity reference or decimal numeric character reference; otherwise (for example, in a script or style element or in a comment), the XSLT processor should signal an error.

If the doctype-public or doctype-system attributes are specified, then the html output method should output a document type declaration immediately before the first element. The name following <!DOCTYPE should be HTML or html. If the doctype-public attribute is specified, then the output method should output PUBLIC followed by the specified public identifier; if the doctype-system attribute is also specified, it should also output the specified system identifier following the public identifier. If the doctype-system attribute is specified but the doctype-public attribute is not specified, then the output method should output SYSTEM followed by the specified system identifier.

The media-type attribute is applicable for the html output method. The default value is text/html.

Text Output Method

The text output method outputs the result tree by outputting the string-value of every text node in the result tree in document order without any escaping.

The media-type attribute is applicable for the text output method. The default value for the media-type attribute is text/plain.

The encoding attribute identifies the encoding that the text output method should use to convert sequences of characters to sequences of bytes. The default is system-dependent. If the result tree contains a character that cannot be represented in the encoding that the XSLT processor is using for output, the XSLT processor should signal an error.

Disabling Output Escaping

Normally, the xml output method escapes & and < (and possibly other characters) when outputting text nodes. This ensures that the output is well-formed XML. However, it is sometimes convenient to be able to produce output that is almost, but not quite well-formed XML; for example, the output may include ill-formed sections which are intended to be transformed into well-formed XML by a subsequent non-XML aware process. For this reason, XSLT provides a mechanism for disabling output escaping. An xsl:value-of or xsl:text element may have a disable-output-escaping attribute; the allowed values are yes or no; the default is no; if the value is yes, then a text node generated by instantiating the xsl:value-of or xsl:text element should be output without any escaping. For example,

<]]>

should generate the single character <.

It is an error for output escaping to be disabled for a text node that is used for something other than a text node in the result tree. Thus, it is an error to disable output escaping for an xsl:value-of or xsl:text element that is used to generate the string-value of a comment, processing instruction or attribute node; it is also an error to convert a result tree fragment to a number or a string if the result tree fragment contains a text node for which escaping was disabled. In both cases, an XSLT processor may signal the error; if it does not signal the error, it must recover by ignoring the disable-output-escaping attribute.

The disable-output-escaping attribute may be used with the html output method as well as with the xml output method. The text output method ignores the disable-output-escaping attribute, since it does not perform any output escaping.

An XSLT processor will only be able to disable output escaping if it controls how the result tree is output. This may not always be the case. For example, the result tree may be used as the source tree for another XSLT transformation instead of being output. An XSLT processor is not required to support disabling output escaping. If an xsl:value-of or xsl:text specifies that output escaping should be disabled and the XSLT processor does not support this, the XSLT processor may signal an error; if it does not signal an error, it must recover by not disabling output escaping.

If output escaping is disabled for a character that is not representable in the encoding that the XSLT processor is using for output, then the XSLT processor may signal an error; if it does not signal an error, it must recover by not disabling output escaping.

Since disabling output escaping may not work with all XSLT processors and can result in XML that is not well-formed, it should be used only when there is no alternative.

Conformance

A conforming XSLT processor must be able to use a stylesheet to transform a source tree into a result tree as specified in this document. A conforming XSLT processor need not be able to output the result in XML or in any other form.

Vendors of XSLT processors are strongly encouraged to provide a way to verify that their processor is behaving conformingly by allowing the result tree to be output as XML or by providing access to the result tree through a standard API such as the DOM or SAX.

A conforming XSLT processor must signal any errors except for those that this document specifically allows an XSLT processor not to signal. A conforming XSLT processor may but need not recover from any errors that it signals.

A conforming XSLT processor may impose limits on the processing resources consumed by the processing of a stylesheet.

Notation

The specification of each XSLT-defined element type is preceded by a summary of its syntax in the form of a model for elements of that element type. The meaning of syntax summary notation is as follows:

An attribute is required if and only if its name is in bold.

The string that occurs in the place of an attribute value specifies the allowed values of the attribute. If this is surrounded by curly braces, then the attribute value is treated as an attribute value template, and the string occurring within curly braces specifies the allowed values of the result of instantiating the attribute value template. Alternative allowed values are separated by |. A quoted string indicates a value equal to that specific string. An unquoted, italicized name specifies a particular type of value.

If the element is allowed not to be empty, then the element contains a comment specifying the allowed content. The allowed content is specified in a similar way to an element type declaration in XML; template means that any mixture of text nodes, literal result elements, extension elements, and XSLT elements from the instruction category is allowed; top-level-elements means that any mixture of XSLT elements from the top-level-element category is allowed.

The element is prefaced by comments indicating if it belongs to the instruction category or top-level-element category or both. The category of an element just affects whether it is allowed in the content of elements that allow a template or top-level-elements.

References Normative References World Wide Web Consortium. Extensible Markup Language (XML) 1.0. W3C Recommendation. See http://www.w3.org/TR/1998/REC-xml-19980210 World Wide Web Consortium. Namespaces in XML. W3C Recommendation. See http://www.w3.org/TR/REC-xml-names World Wide Web Consortium. XML Path Language. W3C Recommendation. See http://www.w3.org/TR/xpath Other References World Wide Web Consortium. Cascading Style Sheets, level 2 (CSS2). W3C Recommendation. See http://www.w3.org/TR/1998/REC-CSS2-19980512 International Organization for Standardization, International Electrotechnical Commission. ISO/IEC 10179:1996. Document Style Semantics and Specification Language (DSSSL). International Standard. World Wide Web Consortium. HTML 4.0 specification. W3C Recommendation. See http://www.w3.org/TR/REC-html40 Internet Assigned Numbers Authority. Character Sets. See ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets. N. Freed, J. Postel. IANA Charset Registration Procedures. IETF RFC 2278. See http://www.ietf.org/rfc/rfc2278.txt. E. Whitehead, M. Murata. XML Media Types. IETF RFC 2376. See http://www.ietf.org/rfc/rfc2376.txt. T. Berners-Lee, R. Fielding, and L. Masinter. Uniform Resource Identifiers (URI): Generic Syntax. IETF RFC 2396. See http://www.ietf.org/rfc/rfc2396.txt. Unicode Consortium. Unicode Technical Report #10. Unicode Collation Algorithm. Unicode Technical Report. See http://www.unicode.org/unicode/reports/tr10/index.html. World Wide Web Consortium. XHTML 1.0: The Extensible HyperText Markup Language. W3C Proposed Recommendation. See http://www.w3.org/TR/xhtml1 World Wide Web Consortium. XML Pointer Language (XPointer). W3C Working Draft. See http://www.w3.org/TR/xptr World Wide Web Consortium. Associating stylesheets with XML documents. W3C Recommendation. See http://www.w3.org/TR/xml-stylesheet World Wide Web Consortium. Extensible Stylesheet Language (XSL). W3C Working Draft. See http://www.w3.org/TR/WD-xsl Element Syntax Summary DTD Fragment for XSLT Stylesheets

This DTD Fragment is not normative because XML 1.0 DTDs do not support XML Namespaces and thus cannot correctly describe the allowed structure of an XSLT stylesheet.

The following entity can be used to construct a DTD for XSLT stylesheets that create instances of a particular result DTD. Before referencing the entity, the stylesheet DTD must define a result-elements parameter entity listing the allowed result element types. For example:

]]>

Such result elements should be declared to have xsl:use-attribute-sets and xsl:extension-element-prefixes attributes. The following entity declares the result-element-atts parameter for this purpose. The content that XSLT allows for result elements is the same as it allows for the XSLT elements that are declared in the following entity with a content model of %template;. The DTD may use a more restrictive content model than %template; to reflect the constraints of the result DTD.

The DTD may define the non-xsl-top-level parameter entity to allow additional top-level elements from namespaces other than the XSLT namespace.

The use of the xsl: prefix in this DTD does not imply that XSLT stylesheets are required to use this prefix. Any of the elements declared in this DTD may have attributes whose name starts with xmlns: or is equal to xmlns in addition to the attributes declared in this DTD.

&XSLT.ns; ]]>
Examples Document Example

This example is a stylesheet for transforming documents that conform to a simple DTD into XHTML . The DTD is:

]]>

The stylesheet is:

<xsl:stylesheet version="1.0" xmlns:xsl="&XSLT.ns;" xmlns="&XHTML.ns;"> <xsl:value-of select="title"/>

NOTE:

]]>

With the following input document

Document Title Chapter Title
Section Title This is a test. This is a note.
Another Section Title This is another test. This is another note.
]]>

it would produce the following result

<?xml version="1.0" encoding="iso-8859-1"?> <html xmlns="&XHTML.ns;"> Document Title

Document Title

Chapter Title

Section Title

This is a test.

NOTE: This is a note.

Another Section Title

This is another test.

NOTE: This is another note.

]]>
Data Example

This is an example of transforming some data represented in XML using three different XSLT stylesheets to produce three different representations of the data, HTML, SVG and VRML.

The input data is:

10 9 7 4 3 4 6 -1.5 2 ]]>

The following stylesheet, which uses the simplified syntax described in , transforms the data into HTML:

<html xsl:version="1.0" xmlns:xsl="&XSLT.ns;" Sales Results By Division
Division Revenue Growth Bonus
color:red
]]>

The HTML output is:

Sales Results By Division
DivisionRevenueGrowthBonus
North1097
West6-1.52
South434
]]>

The following stylesheet transforms the data into SVG:

<xsl:stylesheet version="1.0" xmlns:xsl="&XSLT.ns;" Revenue Division ]]>

The SVG output is:

Revenue Division North 10 South 4 West 6 ]]>

The following stylesheet transforms the data into VRML:

<xsl:stylesheet version="1.0" xmlns:xsl="&XSLT.ns;"> #VRML V2.0 utf8 # externproto definition of a single bar element EXTERNPROTO bar [ field SFInt32 x field SFInt32 y field SFInt32 z field SFString name ] "http://www.vrml.org/WorkingGroups/dbwork/barProto.wrl" # inline containing the graph axes Inline { url "http://www.vrml.org/WorkingGroups/dbwork/barAxes.wrl" } bar { x y z name "" } ]]>

The VRML output is:

Acknowledgements

The following have contributed to authoring this draft:

Daniel Lipkin, Saba Jonathan Marsh, Microsoft Henry Thompson, University of Edinburgh Norman Walsh, Arbortext Steve Zilles, Adobe

This specification was developed and approved for publication by the W3C XSL Working Group (WG). WG approval of this specification does not necessarily imply that all WG members voted for its approval. The current members of the XSL WG are:

Sharon Adler IBM Co-Chair Anders Berglund IBM Perin Blanchard Novell Scott Boag Lotus Larry Cable Sun Jeff Caruso Bitstream James Clark Peter Danielsen Bell Labs Don Day IBM Stephen Deach Adobe Dwayne Dicks SoftQuad Andrew Greene Bitstream Paul Grosso Arbortext Eduardo Gutentag Sun Juliane Harbarth Software AG Mickey Kimchi Enigma Chris Lilley W3C Chris Maden Exemplary Technologies Jonathan Marsh Microsoft Alex Milowski Lexica Steve Muench Oracle Scott Parnell Xerox Vincent Quint W3C Dan Rapp Novell Gregg Reynolds Datalogics Jonathan Robie Software AG Mark Scardina Oracle Henry Thompson University of Edinburgh Philip Wadler Bell Labs Norman Walsh Arbortext Sanjiva Weerawarana IBM Steve Zilles Adobe Co-Chair
Changes from Proposed Recommendation

The following are the changes since the Proposed Recommendation:

The xsl:version attribute is required on a literal result element used as a stylesheet (see ).

The data-type attribute on xsl:sort can use a prefixed name to specify a data-type not defined by XSLT (see ).

Features under Consideration for Future Versions of XSLT

The following features are under consideration for versions of XSLT after XSLT 1.0:

a conditional expression;

support for XML Schema datatypes and archetypes;

support for something like style rules in the original XSL submission;

an attribute to control the default namespace for names occurring in XSLT attributes;

support for entity references;

support for DTDs in the data model;

support for notations in the data model;

a way to get back from an element to the elements that reference it (e.g. by IDREF attributes);

an easier way to get an ID or key in another document;

support for regular expressions for matching against any or all of text nodes, attribute values, attribute names, element type names;

case-insensitive comparisons;

normalization of strings before comparison, for example for compatibility characters;

a function string resolve(node-set) function that treats the value of the argument as a relative URI and turns it into an absolute URI using the base URI of the node;

multiple result documents;

defaulting the select attribute on xsl:value-of to the current node;

an attribute on xsl:attribute to control how the attribute value is normalized;

additional attributes on xsl:sort to provide further control over sorting, such as relative order of scripts;

a way to put the text of a resource identified by a URI into the result tree;

allow unions in steps (e.g. foo/(bar|baz));

allow for result tree fragments all operations that are allowed for node-sets;

a way to group together consecutive nodes having duplicate subelements or attributes;

features to make handling of the HTML style attribute more convenient.

tDOM-0.8.3/tests/data/dtd-6.2.dtd0000644000175000017500000000001707521076274016415 0ustar ssobernissoberni tDOM-0.8.3/tests/data/books.xml0000644000175000017500000000361607440273106016502 0ustar ssobernissoberni Seven Years in Trenton Joe Bob Trenton Literary Review Honorable Mention 12 History of Trenton Mary Bob Selected Short Stories of Mary Bob 55 Tracking Trenton 2.50 Trenton Today, Trenton Tomorrow Toni Bob B.A. Ph.D. Pulizer Still in Trenton Trenton Forever 6.50

It was a dark and stormy night.

But then all nights in Trenton seem dark and stormy to someone who has gone through what I have.

Trenton misery
Who's Who in Trenton Robert Bob
tDOM-0.8.3/tests/data/dtd-5.1.dtd0000644000175000017500000000003207521076274016410 0ustar ssobernissoberni tDOM-0.8.3/tests/data/dtd-6.3.dtd0000644000175000017500000000002007521076274016410 0ustar ssobernissoberni tDOM-0.8.3/tests/data/CVS/0000755000175000017500000000000011004674376015275 5ustar ssobernissobernitDOM-0.8.3/tests/data/CVS/Root0000644000175000017500000000006211004674375016140 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/tests/data/CVS/Entries0000644000175000017500000000131611004674376016632 0ustar ssobernissoberni/REC-xslt-19991116.xml/1.1/Sun Mar 3 01:03:02 2002// /books.xml/1.1/Sun Mar 3 01:03:02 2002// /domCmd1.dtd/1.1/Wed Mar 19 14:02:12 2003// /domCmd2.dtd/1.1/Wed Mar 19 14:02:13 2003// /dtd-5.1.dtd/1.1/Sun Jul 28 23:22:36 2002// /dtd-5.2.dtd/1.1/Sun Jul 28 23:22:36 2002// /dtd-6.1.dtd/1.1/Sun Jul 28 23:22:36 2002// /dtd-6.2.dtd/1.1/Sun Jul 28 23:22:36 2002// /dtd-6.3.dtd/1.1/Sun Jul 28 23:22:36 2002// /dtd-6.4.dtd/1.1/Sun Jul 28 23:22:36 2002// /dtd-6.5.dtd/1.1/Sun Jul 28 23:22:36 2002// /dtd-6.6.dtd/1.1/Sun Jul 28 23:22:36 2002// /i18n_1.xml/1.1/Sun Mar 3 01:03:02 2002// /i18n_2.xml/1.1/Wed Nov 6 12:41:43 2002// /mondial-europe.xml/1.1/Wed Mar 19 14:03:27 2003// /xslt_1.xsl/1.1/Sun Mar 3 01:03:02 2002// D tDOM-0.8.3/tests/data/CVS/Repository0000644000175000017500000000002011004674375017366 0ustar ssobernissobernitdom/tests/data tDOM-0.8.3/tests/data/domCmd1.dtd0000644000175000017500000000005407636074144016625 0ustar ssobernissoberni tDOM-0.8.3/tests/data/dtd-6.1.dtd0000644000175000017500000000005207521076274016413 0ustar ssobernissoberni ]]> tDOM-0.8.3/tests/data/i18n_1.xml0000644000175000017500000000004207440273106016352 0ustar ssobernissoberniабвгдежзий tDOM-0.8.3/tests/data/dtd-5.2.dtd0000644000175000017500000000007207521076274016415 0ustar ssobernissoberni tDOM-0.8.3/tests/data/domCmd2.dtd0000644000175000017500000000005407636074145016627 0ustar ssobernissoberni tDOM-0.8.3/tests/data/i18n_2.xml0000644000175000017500000000027707562207007016367 0ustar ssobernissoberni german umlauts: äöüß tDOM-0.8.3/tests/data/mondial-europe.xml0000644000175000017500000132414007636074257020321 0ustar ssobernissoberni Albania AL 28750 3249136 1.34 49.2 4100 55 16 28 11 1912 emerging democracy 100 3 95 70 10 20 282 151 287 Tirane 10.7 46.2 192000 Shkoder 19.2 42.2 62000 Durres 19.3 41.2 60000 Vlore 19.3 40.3 56000 Elbasan 20.1 41.1 53000 Korce 20.5 40.4 52000 Greece GR 131940 10538594 0.42 7.4 101700 11.8 22.2 66 8.1 01 01 1829 parliamentary republic 100 98 1.3 98 282 228 494 206 Anatoliki Makedhonia kai Thraki 14157 574308 Attiki 3808 3522769 Athens 23.7167 37.9667 885737 Dhytiki Ellas 11350 702027 Dhytiki Makedhonia 9451 292751 Ionioi Nisoi 2307 191003 Ipiros 9203 339210 Kedriki Makedhonia 19147 1729581 Kriti 8336 537183 Notion Aiyaion 5286 262522 Peloponnisos 15490 605663 Sterea Ellas 15549 578876 Thessalia 14037 731030 Voreion Aiyaion 3836 189541 Macedonia MK 25333 2104035 0.46 29.7 1900 24 44 32 14.8 17 09 1991 emerging democracy 100 22 2 65 4 3 30 67 21 70 3 3 151 228 221 148 Skopje Serbia and Montenegro YU 102350 10614558 20600 20 11 04 1992 republic 100 63 14 6 4 19 4 1 65 5 95 287 221 151 527 266 318 476 Belgrade 20.4667 44.8 1407073 Andorra AND 450 72766 2.96 2.2 1000 parliamentary democracy that retains as its heads of state a coprincipality 100 6 61 30 100 60 65 Andorra la Vella 1.3 42.3 15600 France F 547030 58317450 0.34 5.3 1173000 2.4 26.5 71.1 1.7 republic 100 1 1 90 2 100 60 623 451 488 573 620 73 4.4 Alsace 8280 1624000 Strasbourg 7.76667 48.5833 252338 Mulhouse 108357 Aquitaine 41309 2796000 Bordeaux -0.4 44.51 210336 Auvergne 26013 1321000 Clermont Ferrand 3.4 45.5 136181 Basse Normandie 17589 1391000 Caen -0.2 49.3 112846 Bretagne 27209 2796000 Rennes -1.4 48.1 197536 Brest 147956 Bourgogne 31582 1609000 Dijon 5.2 47.2 146703 Centre 39151 2371000 Orleans 1.5 47.5 105111 Tours 129509 Champagne Ardenne 25606 1348000 Reims 180620 Chalons sur Marne Corse 8680 250000 Ajaccio 8.4 41.4 53500 Franche Comte 16202 1097000 Besancon 6.2 47.1 113828 Haute Normandie 12318 1737000 Rouen 1.5 49.3 102723 Le Havre 195854 Ile de France 12011 10660000 Paris 2.48333 48.8167 2152423 Boulogne Billancourt 101743 Languedoc Rousillon 27376 2115000 Montpellier 3.5 43.3 207996 Nimes 128471 Perpignan 105983 Limousin 16942 723000 Limoges 1.2 45.5 133464 Lorraine 23547 2306000 Metz 119594 Nancy 6.1 48.4 99351 Midi Pyrenees 45349 2431000 Toulouse 1.2 43.4 358688 Nord Pas de Calais 12413 3965000 Lille 3.3 50.37 172142 Pays de la Loire 32082 3059000 Nantes -1.56667 47.25 244995 Angers 141404 Le Mans 145502 Picardie 19399 1811000 Amiens 2.19 49.55 131872 Poitou Charentes 25809 1595000 Poitiers 0.2 46.4 79300 Provence Cote dAzur 31400 4258000 Marseille 5.2 43.2 800550 Nice 7.26667 43.7 342439 Toulon 167619 Aix en Provence 123842 Rhone Alpes 43698 5351000 Lyon 4.78333 45.7 415487 Grenoble 150758 Saint Etienne 199396 Villeurbanne 116872 Spain E 504750 39181114 0.16 6.3 565000 3.6 33.6 62.8 4.3 01 01 1492 parliamentary monarchy 100 100 99 null 17 7 2 65 623 1214 Andalusia 87600 7053043 Sevilla 714148 Almeria 167361 Cadiz -6.2 36.3 155438 Cordoba 315948 Granada 271180 Huelva 145049 Malaga 531443 Jerez de la Frontera 190390 Jaen 112772 Algeciras 103787 Aragon 47720 1183576 Zaragoza 606620 Asturias 10604 1083388 Oviedo 201712 Gijon 269644 Balearic Islands 4992 736865 Palma de Mallorca 322008 Basque Country 7235 2075561 Vitoria Gasteiz 214148 Bilbao 371876 Donostia 177929 Canary Islands 7447 1534897 Santa Cruz de Tenerife 203929 Las Palmas de Gran Canaria 371787 La Laguna 125183 Cantabria 5321 526090 Santander 194822 Castile and Leon 94224 2504371 Valladolid 336917 Albacete 141179 Burgos 166251 Leon 147311 Salamanca 167382 Castile La Mancha 79462 1656179 Toledo Catalonia 32113 6090107 Barcelona 2.15 41.4 1630867 Lleida 114234 Tarragona 114630 Hospitalet de Llobregat 266242 Badalona 219340 Sabadell 189006 Terrassa 161428 Santa Coloma de Gramanet 131764 Baracaldo 103594 Mataro 102117 Estremadura 41635 1050590 Badajoz 130153 Merida Galicia 29574 2720761 La Coruna 255087 Vigo 288573 Orense 108547 Santiago de Compostella Madrid 8028 5034548 Madrid -3.68333 40.4167 3041101 Mostoles 199141 Leganes 178162 Alcala de Henares 166250 Fuenlabrada 158212 Getafe 144368 Alcorcon 142165 Murcia 11314 1070401 Murcia 341531 Cartagena 179659 Navarre 10391 523614 Pamplona 182465 Rioja 5045 263437 Logrono 124823 Valencia 23255 3909047 Valencia -0.383333 39.4667 764293 Alacant 274964 Elx 191305 Castellon de la Plana 139094 Austria A 83850 8023244 0.41 6.2 152000 2 34 64 2.3 12 11 1918 federal republic 100 99.4 0.2 0.3 85 6 100 362 784 366 430 37 91 324 164 Burgenland 3965 273000 Eisenstadt 16 48 10102 Carinthia 9533 559000 Klagenfurt 14.21 46.38 87321 Vorarlberg 2601 341000 Bregenz 9.45 47.3 Vienna 415 1583000 Vienna 16.3667 48.25 1583000 Upper Austria 11979 1373000 Linz 14.18 48.18 203000 Tyrol 12647 649000 Innsbruck 11.22 47.17 118000 Styria 16386 1203000 Graz 15.26 47.4 238000 Salzburg 7154 501000 Salzburg 13.2 47.49 144000 Lower Austria 19170 1507000 St. Polten 15.38 48.13 51102 Czech Republic CZ 78703 10321120 -0.03 8.4 106200 5.8 40.7 53.5 9.1 01 01 1993 parliamentary democracy 100 0.5 0.6 0.3 0.2 94.4 3 39.2 4.6 3 362 646 214 658 Jihocesky 11345 702000 Ceske Budejovice 174000 Jihomoravsky 15028 2059000 Brno 393000 Zlin 198000 Severocesky 7819 1190000 Liberec 160000 Usti nad Labem Severomoravsky 11067 1976000 Ostrava 332000 Olomouc 225000 Praha 11490 2329000 Prague 14.4167 50.0833 1215000 Vychodocesky 11240 1240000 Hradec Kralove 164000 Pardubice 163000 Zapadocesky 10875 869000 Plzen 175000 Germany D 356910 83536115 0.67 6 1452200 1 34.2 64.8 18 01 1871 federal republic 100 0.4 2.3 95.1 0.7 0.4 37 45 100 451 784 646 334 456 167 138 577 68 Baden Wurttemberg 35742 10272069 Stuttgart 9.1 48.7 588482 Mannheim 8.46667 49.5667 316223 Karlsruhe 277011 Freiburg im Breisgau 198496 Heidelberg 138964 Heilbronn 122253 Pforzheim 117960 Ulm 115123 Reutlingen 107782 Bayern 70546 11921944 Munich 11.5667 48.15 1244676 Nurnberg 495845 Augsburg 262110 Oberhausen 225443 Wurzburg 127946 Regensburg 125608 Ingolstadt 110910 Furth 107799 Erlangen 101450 Berlin 889 3472009 Berlin 13.3 52.45 3472009 Brandenburg 29480 2536747 Potsdam 138268 Cottbus 125643 Bremen 404 680000 Bremen 8.5 53.7 549182 Bremerhaven 130847 Hamburg 755 1705872 Hamburg 9.96667 53.55 1705872 Hessen 21115 5980693 Wiesbaden 8.17 50.07 266081 Frankfurt am Main 652412 Kassel 201789 Darmstadt 139063 Offenbach am Main 116482 Mecklenburg Vorpommern 23170 1832298 Schwerin 118291 Rostock 232634 Niedersachsen 47609 7715363 Hannover 9.66667 52.4 525763 Braunschweig 254130 Osnabruck 168050 Oldenburg 149691 Gottingen 127519 Wolfsburg 126965 Salzgitter 117842 Hildesheim 106095 Nordrhein Westfalen 34077 17816079 Dusseldorf 572638 Koln 963817 Essen 617955 Dortmund 600918 Duisburg 536106 Bochum 401129 Wuppertal 383776 Bielefeld 324067 Gelsenkirchen 293542 Bonn 293072 Monchengladbach 266073 Munster 264887 Krefeld 249662 Aachen 247113 Hagen 213747 Hamm 184020 Herne 180029 Mulheim an der Ruhr 176513 Solingen 165973 Leverkusen 161832 Neuss 148870 Paderborn 131513 Recklinghausen 127139 Remscheid 123069 Bottrop 119669 Siegen 111541 Moers 107011 Witten 105423 Bergisch Gladbach 105122 Rheinland Pfalz 19851 3951573 Mainz 8.1 50 184627 Ludwigshafen 167883 Koblenz 109550 Kaiserslautern 101910 Saarland 2570 1084201 Saarbrucken 6.6 49.1 189012 Sachsen 18412 4584345 Dresden 474443 Leipzig 481121 Chemnitz 274162 Zwickau 104921 Sachsen Anhalt 20446 2759213 Magdeburg 265379 Halle 290051 Schleswig Holstein 15738 2708392 Kiel 10.7 54.2 246586 Lubeck 216854 Thuringen 16171 2517776 Erfurt 213472 Gera 126035 Jena 102204 Hungary H 93030 10002541 -0.68 12.3 72500 7.3 37.5 55.2 28.3 01 01 1001 republic 100 2 2.6 4 89.9 0.8 0.7 67.5 5 20 98.2 151 366 515 102 103 329 443 Baranya 4487 417100 Bacs Kiskun 8363 540800 Kecskemet 105000 Bekes 5632 404000 Bekescaba Borsod Abauj Zemplen 7248 749100 Csongrad 4263 437600 Hodmezovasarhely Fejer 4374 422500 Szekesfehervar 109000 Gyor Sopron 4012 426800 Hajdu Bihar 6212 549700 Heves 3637 330200 Eger Komarom Esztergom 2250 312900 Tatabanya Nograd 2544 222700 Salgotarjan Pest 6394 957900 Somogy 6035 340000 Kaposvar Szabolcs Szatmar 5938 563500 Nyiregyhaza 115000 Szolnok 5608 420900 Szolnok Tolna 3702 251000 Szekszard Vas 3337 273900 Szombathely Veszprem 4689 378300 Veszprem Zala 3786 302600 Zalaegerszeg Budapest (munic.) 525 2008500 Budapest 19.0333 47.5167 2016000 Debrecen (munic.) 446 217300 Debrecen 216000 Gyor (munic.) 175 130600 Gyor 130000 Miskolc (munic.) 224 191000 Miskolc 192000 Pecs (munic.) 113 171600 Pecs 171000 Szeged (munic.) 145 178500 Szeged 178000 Italy I 301230 57460274 0.13 6.9 1088600 2.9 31.6 65.5 5.4 17 03 1861 republic 100 98 488 430 235 740 3.2 39 Piemonte 25399 4307000 Novara 103349 Turin 7.39 45.5 991870 Valle dAosta 3262 118000 Aosta 7.22 45.45 Lombardia 23857 8901000 Bergamo 117886 Brescia 196766 Milan 9.28333 45.45 1432184 Monza 123188 Trentino Alto Adige 13618 904000 Bolzano 100380 Trento 102124 Veneto 18364 4415000 Padova 218186 Verona 258946 Vicenza 109333 Venice 12.2 45.27 317837 Friuli Venezia Giulia 7845 1193000 Trieste 231047 Liguria 5418 1663000 La Spezia 103008 Genua 8.58 44.25 701032 Emilia Romagna 22123 3924000 Bologna 11.22 44.3 411803 Ferrara 140600 Modena 177501 Parma 173991 Piacenza 103536 Ravenna 136724 Reggio nellEmilia 131880 Rimini 130896 Toscana 22992 3528000 Livorno 171265 Pisa 101500 Firenze 11.17 43.48 408403 Prato 166688 Umbria 8456 819000 Perugia 12.2 43.1 150576 Terni 109809 Marche 9693 1438000 Ancona 13.28 43.38 103268 Lazio 17203 5185000 Rome 12.6 41.8 2791354 Latina 103630 Abruzzo 10794 1263000 Pescara 128553 LAquila 13.2 42.24 Molise 4438 332000 Campobasso 14.5 41.5 Campania 13595 5709000 Salerno 151374 Napoli 14.15 40.5 1206013 Torre del Greco 102647 Puglia 19348 4066000 Bari 16.5 41.8 353032 Foggia 159541 Lecce 102344 Taranto 244033 Basilicata 9992 611000 Potenza 15.47 40.4 Calabria 15080 2080000 Catanzaro 16.35 38.55 103802 Cosenza 104483 Messina 274846 Reggio di Calabria 178496 Sicilia 25709 5025000 Palermo 13.2 38.1 734238 Catania 364176 Siracusa 125444 Sardegna 24090 1657000 Cagliari 9.5 39.15 211719 Sassari 120011 Liechtenstein FL 160 31122 1.08 5.3 630 5.4 23 01 1719 hereditary constitutional monarchy 100 5 95 87.3 8.3 37 41 Vaduz 9.3 47.08 27714 Slovakia SK 48845 5374362 0.34 10.7 39000 6.7 47.6 45.7 7.5 01 01 1993 parliamentary democracy 100 0.1 0.1 1.5 10.7 1 85.7 0.3 0.3 60.3 8.4 4.1 91 215 515 444 90 Bratislava Slovenia SLO 20256 1951443 -0.27 7.3 22600 5.3 39.9 54.8 8 25 06 1991 emerging democracy 100 2 91 1 3 1 96 91 7 324 102 235 546 Ljubljana Switzerland CH 41290 7207060 0.59 5.4 158500 3 33.5 63.5 1.8 federal republic 100 47.6 44.3 18 65 12 1 573 164 334 740 41 AG 1403 528887 Aarau AR 242 54104 Herisau AI 172 14750 Appenzell BL 517 252331 Liestal BS 37 195759 Basel 172768 BE 5960 941952 Bern 7.3 46.6 134393 Biel 53308 FR 1670 224552 Fribourg GE 282 395466 Geneva 6.9 46.12 167697 GL 685 39410 Glarus GR 7105 185063 Chur JU 836 69188 Delemont LU 1493 340536 Luzern 59811 NE 803 165258 Neuchatel NW 276 36466 Stans OW 490 31310 Sarnen SG 2025 442350 Sankt Gallen 74106 SH 298 74035 Schaffhausen SZ 908 122409 Schwyz SO 790 239264 Solothurn TG 990 223372 Frauenfeld TI 2812 305199 Bellinzona UR 1076 35876 Altdorf VS 5224 271291 Sion VD 3211 605677 Lausanne 123149 ZG 238 92392 Zug ZH 1728 1175457 Zurich 343106 Winterthur 86340 Belarus BY 207600 10415973 0.2 13.4 49200 21 49 30 244 25 08 1991 republic 100 4.1 2.9 13.2 77.9 60 141 502 605 891 959 Minsk 27.55 53.9 1540000 Latvia LV 64100 2468982 -1.39 21.2 14700 9 31 60 20 06 09 1991 republic 100 2.3 3.4 33.8 4.5 51.8 141 453 217 267 Riga 14.1 57 900000 Lithuania LT 65200 3646041 -0.35 17 13300 20 42 38 35 06 09 1991 republic 100 7.7 8.6 1.5 80.1 502 453 91 227 Vilnius 25.3 54.4 566000 Poland PL 312683 38642565 0.14 12.4 226700 7 38 55 21.6 11 11 1918 democratic state 100 1.3 97.6 0.6 0.5 95 100 658 456 444 605 91 428 206 Warszwaskie 3788 2421000 Warsaw 21.0333 52.2167 1655000 Bialskopodlaskie 5348 306700 Biala Podlaska Bialostockie 10055 697000 Bialystok 268000 Bielskie 3704 911500 Bielsko Biala 180000 Bydgoskie 10349 1120300 Bydgoszcz 380000 Chelmskie 3866 248500 Chelm Ciechanowskie 6362 431400 Ciechanow Czestochowskie 6182 748000 Czestochowa 258000 Elblaskie 6103 483200 Elblag 125000 Gdanskie 7394 1445000 Gdansk 465000 Gdynia 251000 Gorzowskie 8484 505600 Gorzow Wielkopolski 123000 Gorzow Wielkopolskie Jeleniogorskie 4379 519200 Jelenia Gora Kaliskie 6512 715600 Kalisz 106000 Katowickie 6650 4013200 Katowice 367000 Sosnowiec 259000 Bytom 230000 Gliwice 216000 Zabrze 203000 Tychy 190000 Ruda Slaska 170000 Rybnik 143000 Chorzow 133000 Wodzilaw Slaski 111000 Kieleckie 9211 1127700 Kielce 213000 Koninskie 5139 472400 Konin Koszalinskie 8470 513700 Koszalin 108000 Krakowskie 3254 1238100 Krakow 19.95 50.0667 748000 Krosnienskie 5702 500700 Krosno Legnickie 4037 521500 Legnica 104000 Leszczynskie 4154 391500 Leszno Lubelskie 6792 1022600 Lublin 350000 Lomzynskie 6684 349000 Lomza Lodzkie 1523 1132400 Lodz 852000 Nowosadeckie 5576 709500 Nowy Sacz Olsztynskie 12327 761300 Olsztyn 161000 Opolskie 8535 1023800 Opole 128000 Ostroleckie 6498 400500 Ostroleka Pilskie 8205 485700 Pila Piotrkowskie 6266 644200 Piottrkow Trybunalski Plockie 5117 518600 Plock 122000 Poznanskie 8151 1344200 Poznan 589000 Przemyskie 4437 409600 Przemysl Radomskie 7294 755500 Radom 226000 Rzeszowskie 4397 734100 Rzeszow 151000 Siedleckie 8499 655300 Siedlce Sieradzkie 4869 408700 Sieradz Skierniewickie 3960 421700 Skierniewice Slupskie 7453 419300 Slupsk Suwalskie 10490 477100 Suwalki Szczecinskie 9982 979500 Szczecin 412000 Tarnobrzeskie 6283 604300 Tarnobrzeg Tarnowskie 4151 678400 Tarnow 120000 Torunskie 5348 662600 Torun 201000 Grudziadz 101000 Walbrzyskie 4168 740000 Walbrzych 141000 Wloclawskie 4402 430800 Wloclawek 121000 Wroclawskie 6287 1132800 Wroclaw 642000 Zamojskie 6980 490800 Zamosc Zielonogorskie 8868 664700 Zielona Gora 113000 Ukraine UA 603700 50864009 -0.4 22.5 174600 31 43 26 9 01 12 1991 republic 100 73 22 1 103 90 891 428 1576 531 939 Cherkaska 20900 1530900 Cherkasy 297000 Chernihivska 31900 938600 Chernihiv 301000 Chernivetska 8100 1405800 Chernivtsi 257000 Dnipropetrovska 31900 3908700 Dnipropetrovsk 1187000 Kryvyy Rih 717000 Dniprodzerzhynsk 284000 Donetska 26500 5346700 Donetsk 1117000 Mariupol 520000 Makiyivka 427000 Horlivka 338000 Ivano Frankivska 13900 1442900 Ivano Frankivsk 220000 Kharkivska 31400 3194800 Kharkiv 36.2333 50 1618000 Khersonska 28500 1258700 Kherson 361000 Khmelnytska 20600 1520600 Khmelnytskyy 241000 Kyyivska 28900 4589800 Kiev 30.5 50.45 2616000 Kirovohradska 24600 1245300 Kirovohrad 274000 Luhanska 26700 2871100 Luhansk 501000 Lvivska 21800 2764400 Lviv 798000 Mykolayivska 24600 1342400 Mykolayiv 508000 Odeska 33300 2635300 Odesa 30.7333 46.4833 1106000 Poltavska 28800 1756900 Poltava 317000 Kremenchuk 238000 Rivnenska 20100 1176800 Rivne 233000 Sumska 23800 1430200 Sumy 296000 Ternopilska 13800 1175100 Ternopil 212000 Vinnytska 26500 1914400 Vinnytsya 379000 Volynska 20200 1069000 Lutsk 204000 Zakarpatska 12800 1265900 Uzhhorod Zaporizka 27200 2099600 Zaporizhzhya 891000 Zhytomyrska 29900 1510700 Zhytomyr 296000 Krym 27000 2549800 Simferopol 349000 Sevastopol 361000 Russia R 17075200 148178487 -0.07 24.7 796000 6 41 53 7 24 08 1991 federation 20 3 81.5 0.8 3.8 1.2 0.9 0.7 100 959 217 227 206 1576 290 1313 167 Rep. of Karelia 172400 785000 Petrozavodsk 280000 Rep. of Komi 415900 1185500 Syktyvkar 229000 Ukhta 106000 Vorkuta 104000 Arkhangelskaya oblast 587400 1520800 Arkhangelsk 40.5333 64.55 374000 Severodvinsk 241000 Vologodskaya oblast 145700 1349800 Vologda 299000 Cherepovets 320000 Murmanskaya oblast 144900 1048000 Murmansk 407000 Kaliningradskaya oblast 15100 932200 Kaliningrad 20.5 54.7167 419000 Sankt Peterburg 0 4801500 Sankt Peterburg 4838000 Leningradskaya oblast 85900 1675900 Kolpino 143000 Novgorodskaya oblast 55300 742600 Novgorod 233000 Pskovskaya oblast 55300 832300 Pskov 207000 Velikiye Luki 116000 Bryanskaya oblast 34900 1479700 Bryansk 462000 Vladimirskaya oblast 29000 1644700 Vladimir 339000 Kovrov 162000 Murom 126000 Ivanovskaya oblast 23900 1266400 Ivanovo 474000 Kineshma 103000 Kaluzhskaya oblast 29900 1097300 Kaluga 347000 Obninsk 108000 Kostromskaya oblast 60100 805700 Kostroma 285000 Moskva 0 8664400 Moscow 37.6667 55.7667 8717000 Moskovskaya oblast 47000 6596600 Podolsk 202000 Zelenograd 191000 Lyubertsy 166000 Kolomna 154000 Mytishchi 152000 Elektrostal 150000 Serpukhov 139000 Balashikha 136000 Khimki 134000 Odintsovo 129000 Orekhovo Zuyevo 126000 Noginsk 119000 Shchyolkovo 108000 Orlovskaya oblast 24700 914000 Orel 348000 Ryazanskaya oblast 39600 1325300 Ryazan 536000 Smolenskaya oblast 49800 1172400 Smolensk 355000 Tverskaya oblast 84100 1650600 Tver 455000 Tulskaya oblast 25700 1814500 Tula 532000 Novomoskovsk 144000 Yaroslavskaya oblast 36400 1451400 Yaroslavl 629000 Rybinsk 248000 Rep. of Mariy El 23200 766300 Yoshkar Ola 251000 Rep. of Mordovia 26200 955800 Saransk 320000 Chuvash Republic 18300 1360800 Cheboksary 450000 Novocheboksarsk 123000 Kirovskaya oblast 120800 1634500 Kirov 464000 Nizhegorodskaya oblast 74800 3726400 Nizhniy Novgorod 1383000 Dzerzhinsk 285000 Arzamas 112000 Belgorodskaya oblast 27100 1469100 Belgorod 322000 Stary Oskol 198000 Voronezhskaya oblast 52400 2503800 Voronezh 908000 Kurskaya oblast 29800 1346900 Kursk 442000 Lipetskaya oblast 24100 1250200 Lipetsk 474000 Yelets 119000 Tambovskaya oblast 34300 1310600 Tambov 316000 Michurinsk 108000 Rep. of Kalmykiya 76100 318500 Elista Rep. of Tatarstan 68000 3760500 Kazan 1085000 Naberezhnye Chelny 526000 Nizhnekamsk 210000 Almetyevsk 138000 Zelenodolysk 101000 Astrakhanskaya oblast 44100 1028900 Astrakhan 486000 Volgogradskaya oblast 113900 2703700 Volgograd 44.5167 48.7 1003000 Volzhsky 288000 Kamyshin 128000 Penzenskaya oblast 43200 1562300 Penza 534000 Kuznetsk 100000 Samarskaya oblast 53600 3311500 Samara 1184000 Tolyatti 702000 Syzran 177000 Novokuybyshevsk 115000 Saratovskaya oblast 100200 2739500 Saratov 895000 Balakovo 206000 Engels 186000 Ulyanovskaya oblast 37300 1495200 Simbirsk 678000 Dimitrovgrad 135000 Rostovskaya oblast 100800 4426400 Rostov na Donu 1026000 Taganrog 292000 Shakhty 230000 Novocherkassk 190000 Volgodonsk 183000 Novoshakhtinsk 107000 Rostov no Donu Rep. of Bashkortostan 143600 4096600 Ufa 1094000 Sterlitamak 259000 Salavat 156000 Oktyabrsky 110000 Udmurt Republic 42100 1639100 Izhevsk 654000 Sarapul 109000 Glazov 107000 Votkinsk 104000 Orenburgskaya oblast 124000 2228600 Orenburg 532000 Orsk 275000 Novotroitsk 110000 Permskaya oblast 160600 3009400 Perm 1032000 Berezniki 184000 Solikamsk 108000 Rep. of Adygeya 7600 450500 Maykop 165000 Rep. of Dagestan 50300 2097500 Makhachkala 339000 Rep. of Ingushetiya 3750 299700 Nazran Kabardino Balkar Rep. 12500 789900 Nalchik 239000 Karachayevo Cherkessk Rep. 14100 436300 Cherkessk 119000 Rep. of North Ossetiya 8000 662600 Vladikavkaz 312000 Chechen Rep. 12300 865100 Grozny 364000 Krasnodarsky kray 76000 5043900 Krasnodar 646000 Sochi 355000 Novorossiysk 202000 Armavir 164000 Stavropolsky kray 66500 2667000 Stavropol 342000 Pyatigorsk 133000 Nevinnomyssk 131000 Kislovodsk 120000 Neftekamsk 117000 Kurganskaya oblast 71000 1112200 Kurgan 363000 Sverdlovskaya oblast 194300 4686300 Yekaterinburg 1280000 Nizhniy Tagil 409000 Kamensk Uralskiy 197000 Pervouralsk 137000 Serov 100000 Chelyabinskaya oblast 87900 3688700 Chelyabinsk 1086000 Magnitogorsk 427000 Zlatoust 203000 Miass 167000 Rep. of Altay 92600 201600 Gorno Altaysk Altayskiy kray 169100 2690100 Barnaul 596000 Biysk 228000 Rubtsovsk 170000 Kemerovskaya oblast 95500 3063500 Kemerovo 503000 Novokuznetsk 572000 Prokopyevsk 253000 Leninsk Kuznetskiy 121000 Kiselyovsk 116000 Mezhdurechensk 105000 Anzhero Sudzhensk 101000 Novosibirskaya oblast 178200 2748600 Novosibirsk 1369000 Omskaya oblast 139700 2176400 Omsk 1163000 Tomskaya oblast 316900 1077600 Tomsk 470000 Tyumenskaya oblast 1435200 3169900 Tyumen 494000 Surgut 263000 Nizhnevartovsk 238000 Rep. of Buryatiya 351300 1052500 Ulan Ude 366000 Rep. of Tyva 170500 309700 Kyzyl Rep. of Khakassiya 61900 585800 Abakan 161000 Krasnoyarskiy kray 2339700 3105900 Krasnoyarsk 92.95 56.0167 869000 Norilsk 159000 Achinsk 123000 Kansk 109000 Irkutskaya oblast 767900 2795200 Irkutsk 585000 Angarsk 267000 Bratsk 257000 Ust Ilimsk 110000 Usolye Sibirskoye 106000 Chitinskaya oblast 431500 1295000 Chita 322000 Rep. of Sakha 3103200 1022800 Yakutsk 192000 Yevreyskaya avt. oblast 36000 209900 Birobidzhan Chukotsky ao 737700 90500 Anadyr Primorsky kray 165900 2255400 Vladivostok 131.917 43.1167 632000 Nakhodka 163000 Ussuriysk 162000 Khabarovskiy kray 752600 1571200 Khabarovsk 618000 Komsomolsk na Amure 309000 Amurskaya oblast 363700 1037800 Blagoveshchensk 214000 Kamchatskaya oblast 472300 411100 Petropavlovsk Kamchatsky 210000 Magadanskaya oblast 461400 258200 Magadan 128000 Sakhalinskaya oblast 87100 647800 Yuzhno Sakhalinsk 160000 Belgium B 30510 10170241 0.33 6.4 197000 2 28 70 1.6 04 10 1830 constitutional monarchy 100 55 33 75 25 32 1 56 620 167 148 450 Antwerp 2867 1610695 Antwerp 4.23 51.1 459072 Brabant 3358 2253794 Brussels 4.35 50.8 951580 East Flanders 2982 1340056 Ghent 3.5 51.4 227483 Hainaut 3787 1283252 Charleroi 206491 Mons 3.6 50.3 90720 Liege 3862 1006081 Liege 5.5 50.5 192393 Limburg 2422 755593 Hasselt 5.2 50.7 65348 Luxembourg 4441 234664 Arlon 5.5 49.4 23150 Namur 3665 426305 Namur 4.5 50.3 105014 West Flanders 3134 1111557 Bruges 116273 Brugge 2.08 51.1 117799 Luxembourg L 2586 415870 1.57 4.7 10000 1.4 33.7 64.9 3.6 constitutional monarchy 100 97 3 73 138 148 Luxembourg 6.08 49.4 76600 Netherlands NL 37330 15568034 0.56 4.9 301900 3.4 26.9 69.7 2.25 01 01 1579 constitutional monarchy 100 96 3 34 25 100 577 450 Groningen 2344 557995 Groningen 210708 Friesland 3361 609579 Leeuwarden Drenthe 2652 454864 Assen Overijssel 3337 1050389 Enschede 254480 Zwolle Flevoland 1425 262325 Lelystad Gelderland 4995 1864732 Arnhem 314159 Nijmegen 249490 Utrecht 1356 1063460 Utrecht 547070 Noord Holland 265978 2463611 Amsterdam 4.91667 52.3833 1101407 Haarlem 212631 Zaanstreek 147917 Velsen 134973 Hilversum 102023 Zuid Holland 2859 3325064 s Gravenhage 694249 Rotterdam 1078747 Dordrecht 213963 Leiden 194935 Zeeland 1791 365846 Middelburg Noord Brabant 4938 2276207 s Hertogenbosch 199127 Eindhoven 395612 Tilburg 237958 Breda 166616 Limburg 2167 1130050 Maastricht 164701 Heerlen 270952 Geleen 186011 Bosnia and Herzegovina BIH 51233 2656240 -2.84 43.2 1000 01 04 1992 emerging democracy 100 40 38 22 40 4 31 15 99 527 932 Sarajevo Croatia HR 56538 5004112 0.58 10.2 20100 12.7 30.6 56.7 3.7 25 06 1991 parliamentary democracy 100 12 0.5 0.9 78 0.5 0.4 11.1 76.5 1.2 96 266 329 546 932 Zagreb Bulgaria BG 110910 8612757 0.46 15.7 43200 12 36 52 35 22 09 1908 emerging democracy 100 2.5 2.6 0.2 8.5 85.3 0.3 13 0.8 0.5 85 0.2 100 494 148 318 608 240 Sofia 23.3333 42.7 1300000 Romania RO 237500 21657162 -1.21 23.2 105700 19.6 36.3 44.1 25 01 01 1881 republic 100 0.4 1.6 8.9 89.1 6 6 70 476 443 531 608 450 Alba 6231 428000 Alba Iulia Arad 7652 507000 Arad 191000 Arges 6801 678000 Pitesti 162000 Bacau 6606 731000 Bacau 193000 Bihor 7535 660000 Oradea 225000 Bistrita Nasaud 5305 328000 Bistrita Botosani 4965 468000 Botosani Braila 4724 404000 Braila 243000 Brasov 5351 695000 Brasov 353000 Bucuresti 1521 2319000 Bucharest 26.1 44.4167 2037000 Buzau 6072 524000 Buzau 145000 Calarasi 5075 351000 Calarasi Caras Severin 8503 408000 Resita Cluj 6650 743000 Cluj Napoca 318000 Constanta 7055 737000 Constanta 316000 Covasha 3705 238000 Sfintu Gheorghe Dimbovita 4035 570000 Tirgoviste Dolj 7413 772000 Craiova 300000 Galati 4425 642000 Galati 307000 Giurgiu 3810 325000 Giurgiu Gorj 5641 388000 Tirgu Jiu Harghita 6610 363000 Miercurea Ciuc Hunedoara 7016 567000 Deva Ialomita 4449 309000 Slobozia Iasi 5469 810000 Iasi 330000 Maramures 6215 556000 Baia Mare 150000 Mehedinti 4900 329000 Drobeta Turnu Severin Mures 6696 621000 Tirgu Mures 165000 Neamt 5890 580000 Piatra Neamt Olt 5507 535000 Slatina Prahova 4694 877000 Ploiesti Salaj 3850 269000 Zalau Satu Mare 4405 417000 Satu Mare 137000 Sibiu 5422 509000 Sibiu 184000 Suceava 8555 699000 Suceava Teleorman 5760 504000 Alexandria Timis 8692 726000 Timisoara 333000 Tulcea 8430 275000 Tulcea Vaslui 5297 468000 Vaslui Vilcea 5705 430000 Rimnicu Vilcea Vrancea 4863 394000 Focsani Turkey TR 780580 62484478 1.67 43.2 345700 15.5 33.2 51.3 94 29 10 1923 republican parliamentary democracy 32 80 20 99.8 206 240 Adana 17253 1934907 Adana 35.3 36.9833 1047300 Osmaniye 138000 Adiyaman 7614 513131 Adiyaman 128000 Afyon 14230 739223 Afyon Agri 11376 437093 Agri Aksaray 7626 326399 Aksaray Amasya 5520 357191 Amasya Ankara 25706 3236626 Ankara 32.8833 39.95 2782200 Antalya 20591 1132211 Antalya 497200 Artvin 7436 212833 Artvin Aydin 8007 824816 Aydin 121200 Balikesir 14292 973314 Balikesir 187600 Batman 4694 344669 Batman 182800 Bayburt 3652 107330 Bayburt Bilecik 4307 175526 Bilecik Bingol 8125 250966 Bingol Bitlis 6707 330115 Bitlis Bolu 11051 536869 Bolu Burdur 6887 254899 Burdur Bursa 11043 1603137 Bursa 996600 Canakkale 9737 432263 Canakkale Cankiri 8454 279129 Cankiri Corum 12820 609863 Corum Denizli 11868 750882 Denizli 234500 Diyarbakir 15355 1094996 Diyarbakir 448300 Edirne 6276 404599 Edirne 115500 Elazig 9153 498225 Elazig 222800 Erzincan 11903 299251 Erzincan Erzurum 25066 848201 Erzurum 250100 Eskisehir 13652 641057 Eskisehir 451000 Gaziantep 7642 1140594 Gaziantep 716000 Giresun 6934 499087 Giresun Gumushane 6575 169375 Gumushane Hakkari 7121 172479 Hakkari Hatay 5403 1109754 Iskenderun 156800 Antakya 137200 Icel 15853 1266995 Mersin 523000 Tarsus 225000 Isparta 8933 434771 Isparta 120900 Istanbul 5712 7309190 Istanbul 28.8333 40.9667 7615500 Izmir 11973 2694770 Izmir 27.1667 38.4333 1985300 Karaman 9163 217536 Karaman Karamanmaras 14327 892952 Karaman Maras 242200 Kars 18557 662155 Kars Kastamonu 13108 423611 Kastamonu Kayseri 16917 943484 Kayseri 454000 Kirikkale 4365 349396 Kirikkale 170300 Kirklareli 6550 309512 Kirklareli Kirsehir 6570 256862 Kirsehir Kocaeli 3626 936163 Izmit 275800 Kocaeli 256882 Gebze 237300 Adapazari 186000 Konya 38257 1750303 Konya 576000 Kutahya 11875 578020 Kutahya 140700 Malatya 12313 702055 Malatya 319700 Manisa 13810 1154418 Manisa 187500 Mardin 8891 557727 Mardin Mugla 13338 562809 Mugla Mus 8196 376543 Mus Nevsehir 5467 289509 Nevsehir Nigde 7312 305861 Nigde Ordu 6001 830105 Ordu 121300 Rize 3920 348776 Rize Sakarya 4817 683061 Sakarya Samsun 9579 1158400 Samsun 326900 Sanliurfa 18584 1001455 Urfa 357900 Siirt 5406 243435 Siirt Sinop 5862 265153 Sinop Sirnak 7172 262006 Sirnak Sivas 28488 767481 Sivas 240100 Tekirdag 6218 468842 Tekirdag Tokat 9958 719251 Tokat Trabzon 4685 795849 Trabzon 145400 Tunceli 7774 133143 Tunceli Usak 5341 290283 Usak 119900 Van 19069 637433 Van 194600 Yozgat 14123 579150 Yozgat Zonguldak 8629 1073560 Zonguldak 115900 Karabuk 113900 Denmark DK 43070 5249632 0.38 4.8 112800 3 23.5 73.5 2.4 constitutional monarchy 100 91 2 68 Copenhagen 12.55 55.6833 1358540 Aarhus 10.1 56.1 194345 Odense 10.2 55.3 136803 Aalborg 10 57 113865 Esbjerg 8.3 55.3 70975 Randers 10 56.3 55780 Estonia EW 45100 1459428 -1.13 17.4 12300 10 37 53 29 06 09 1991 republic 100 3.2 30.3 1.8 1.1 61.5 267 290 Tallinn 25 59.3 478000 Finland SF 337030 5105230 0.1 4.9 92400 4.6 28 67.4 2 06 12 1917 republic 100 1 89 6.3 93.5 1313 729 586 Aland 23000 Mariehamn 19.5 60.1 9500 Haeme 662000 Haemeenlinna 24.3 61 42000 Tampere 23.5 61.3 170097 Lahti 25.2 60.5 94234 Kuopio 252000 Kuopio 27.4 62.5 78571 Kymi 345000 Kotka 26.5 60.3 58345 Lappeenrenta 26.5 60.5 53922 Lappia 195000 Rovaniemi 24.4 66.3 31000 Mikkeli 209000 Mikkeli 27.2 61.4 28000 Suomi 242000 Jyvaeskylae 25.2 62.1 65511 Pohjols-Karjala 177000 Joensuu 29.5 62.4 44000 Oulu 415000 Oulu 25.2 65.3 97898 Turku-Pori 702000 Turku 22.1 60.3 161292 Pori 21.2 61.3 77763 Uusimaa 1119000 Helsinki 24.95 60.1667 487428 Espoo 24.3 60.2 160480 Vaasa 430000 Vaasa 21.3 63 54275 Norway N 324220 4383807 0.48 4.9 106200 2.9 34.7 62.4 2.5 26 10 1905 constitutional monarchy 100 87.8 3.8 100 167 729 1619 Oslo 449337 Oslo 10.7333 59.9333 449337 Akershus 393217 Oestfold 234941 Moss 10.4 59.3 24517 Hedmark 186355 Hamar 11.5 60.5 15685 Oppland 181791 Lillehammer 10.3 61.1 22118 Buskerud 219967 Drammen 10.1 59.4 50855 Vestfold 191600 Toensberg 10.2 59.2 8984 Telemark 162547 Skien 9.4 59.1 47010 Aust Agder 94688 Arendal 8.4 58.3 12174 Vest Agder 140232 Kristiansand 8 58.1 62640 Rogaland 323365 Stavanger 5.5 59 95089 Hordaland 399702 Bergen 5.2 60.2 207916 Sogn og Fjordane 106116 Hermannsverk 6.5 61.1 706 Moere og Romsdal 237290 Molde 7.1 62.5 21448 Soer Trondelag 246824 Trondheim 10.2 63.3 134426 Nord Trondelag 126692 Steinkjer 11.3 64 20480 Nordland 242268 Bodoe 14.2 67.2 34479 Svolvaer 14.3 68.2 4500 Narvik 17.3 68.3 18754 Troms 146736 Tromsoe 19 69.4 48109 Finnmark 75667 Vadsoe 29.5 70.5 5961 Hammerfest 23.4 70.4 7089 Sweden S 449964 8900954 0.56 4.5 177300 2 27 71 2.6 constitutional monarchy 100 12 1.5 94 1 100 586 1619 Ĭvsborg 11395 444259 Vanersborg Blekinge 2941 151168 Karlskrona 15.3 56.1 59007 Gavleborg 18191 289339 Gavle Goteborg och Bohus 5141 742550 Goteborg 449189 Gotland 3140 57383 Visby 18.2 57.3 20000 Halland 5454 257874 Halmstad 13 56.4 77601 Jamtland 49443 136009 Ostersund Jonkoping 9944 309738 Jonkoping 115429 Kalmar 11170 241883 Kalmar 16.3 56.4 54554 Kopparberg 28194 290388 Falun 15.3 60.3 51900 Kristianstad 6087 291468 Kristianstad 14 56 69941 Kronoberg 8458 178612 Vaxjo Malmohus 4938 786757 Malmo 245699 Helsingborg 114339 Norrbotten 98913 264834 Lulea Orebro 8519 273608 Orebro 119635 Ostergotland 10562 406100 Linkoping 131370 Norrkoping 123795 Skaraborg 7937 278162 Mariestad 13.5 58.4 24255 Sodermanland 6060 256818 Nykoping Stockholm 6488 1654511 Stockholm 18.0667 59.35 711119 Uppsala 6989 273918 Uppsala 17.4 59.5 183472 Varmland 17584 284187 Karlstad 13.3 59.3 74669 Vasterbotten 55401 253835 Umea Vasternorrland 21678 261280 Harnosand Vastmanland 6302 259438 Vasteras 123728 Monaco MC 1.9 31719 0.59 6.9 788 01 01 1419 constitutional monarchy 100 47 16 16 95 4.4 Monaco 7.2 43.7 1234 Holy See V 0.44 840 11 02 1929 monarchical sacerdotal state 100 100 3.2 Vatican City 12.3 41.5 392 Iceland IS 103000 270292 0.83 4.3 5000 9.6 22.1 68.3 2.5 17 06 1944 republic 100 100 96 3 100 Reykjavik 21.9333 64.1333 84000 Keflavik -22.5 64 6600 Hafnarfjoerdur -22 64 12000 Akureyri 18.3 65.4 13000 Ireland IRL 70280 3566833 -0.22 6.4 54600 6.8 35.3 57.9 2.8 06 12 1921 republic 100 93 3 Dublin -6.35 53.3667 502337 San Marino RSM 60 24521 0.82 5.5 380 5.5 01 01 0301 republic 100 100 100 39 San Marino 12.2 43.5 4416 Malta M 320 375576 1.01 6.9 4400 5 21 09 1964 parliamentary democracy 100 98 Valletta 14.2 35.08 9302 Moldova MD 33700 4463847 0.18 47.6 10400 33 36 31 24 27 08 1991 republic 100 13.8 13 1.5 2 3.5 64.5 1.5 98.5 null 939 450 Chisinau 28.1 47.2 663000 Portugal P 92080 9865114 0.02 7.6 116200 6 35.8 58.2 4.6 01 01 1140 republic 100 97 1 100 1214 Aveiro 2808 656000 Beja 10225 167900 Braga 2673 746100 Braga 63033 Braganca 6608 158300 Castelo Branco 6675 214700 Coimbra 3947 427600 Coimbra 74616 Evora 7393 173500 Faro 4960 340100 Guarda 5518 187800 Leiria 3515 427800 Lisbon 2761 2063800 Lisbon -9.13333 38.7167 807937 Amadora 95518 Barreiro 50863 Almada 42607 Portalegre 6065 134300 Porto 2395 1622300 Porto 327368 Vila Nova de Gaia 62468 Santarem 6747 442700 Setubal 5064 713700 Setubal 77885 Viana do Castelo 2255 248700 Vila Real 4328 237100 Viseu 5007 401000 Azores, The 2247 236700 Madeira 794 253000 Funchal 44111 United Kingdom GB 244820 58489975 0.22 6.4 1138400 1.7 27.7 70.6 3.1 01 01 1801 constitutional monarchy 100 81.5 2.4 1.9 9.6 1.8 360 Avon 1346 962000 Bristol 399200 Bedfordshire 1235 534300 Bedford 137300 Luton 178600 Berkshire 1259 752500 Reading 137700 Wokingham 142900 Newbury 141000 Windsor 136700 Slough 103500 Bracknell 101900 Buckinghamshire 1883 640200 Aylesbury 151600 Milton Keynes 184400 Wycombe 161400 Cambridgeshire 3409 669900 Cambridge 113800 Peterborough 156400 Huntingdon 148800 Cheshire 2329 966500 Chester 120800 Warrington 185000 Macclesfield 151400 Crewe 109500 Cleveland 583 557500 Middlesbrough 145800 Stockton on Tees 177800 Cornwall _ Isles of Scilly 3564 475200 Truro Cumbria 6810 489700 Carlisle 102900 Derbyshire 2631 938800 Derby 230500 Sutton in Ashfield 109800 Chesterfield 101200 Matlock Devon 6711 1040000 Plymouth 255800 Exeter 105100 Dorset 2654 662900 Bournemouth 159900 Poole 137200 Dorchester Durham 2436 604300 Darlington 100200 Durham East Sussex 1795 716500 Brighton 154400 Lewes Essex 3672 1548800 Chelmsford 155700 Southend on Sea 167500 Basildon 161700 Colchester 149100 Braintree 121800 Epping Forest 118200 Gloucestershire 2643 538800 Cheltenham 106700 Stroud 105400 Gloucester 104800 Glouchester Greater London 1579 6803100 London 0 51.4833 6967500 Greater Manchester 1287 2561600 Manchester 431100 Wigan 310000 Stockport 291400 Bolton 265200 Salford 230700 Tameside 221800 Oldham 220400 Trafford 218100 Rochdale 207100 Bury 181400 Hampshire 3777 1578700 Winchester 100500 Southampton 211700 Portsmouth 189100 Basingstoke 146500 Havant 117500 Eastleigh 109600 Fareham 101000 Hereford and Worcester 3927 696000 Worcester Hertfordshire 1634 989500 Saint Albans 127700 Hertford Humberside 3512 874400 Kingston upon Hull 269100 Beverley 115800 Hull Isle of Wight 381 126600 Kent 3731 1538800 Maidstone 138500 Rochester upon Medway 148200 Canterbury 132400 Swale 117200 Sevenoaks 109400 Dover 106100 Tonbridge 102100 Tunbridge Wells 101800 Lancashire 3064 1408300 Preston 132200 Blackpool 153600 Blackburn 139500 Lancaster 133600 Leicestershire 2553 890800 Leicester 293400 Leichester Lincolnshire 5915 592600 Lincoln Merseyside 652 1441100 Liverpool 474000 Wiral 331100 Sefton 292400 Saint Helens 180200 Knowsley 155300 Norfolk 5368 759400 Norwich 128100 Kings Lynn 131600 Northamptonshire 2367 587100 Northampton 187200 Northumberland 5032 307100 North Yorkshire 8309 720900 Harrogate 146500 Scarborough 108700 York 104000 Northallerton Nottinghamshire 2164 1015500 Nottingham 282400 Newark on Trent 104400 Mansfield 102100 Oxfordshire 2608 597700 Oxford 132000 Shropshire 3490 412500 Shrewsbury Somerset 3451 469400 Taunton South Yorkshire 1560 1292700 Barnsley 226500 Sheffield 530100 Doncaster 292500 Rotherham 256300 Staffordshire 2716 1047400 Stafford 121500 Stoke on Trent 254200 Newcastle under Lyme 123000 Suffolk 3797 661900 Ipswich 114800 Surrey 1679 1035500 Guildford 126200 Reigate 118800 Elmbridge 117300 Kingston Tyne and Wear 540 1125600 Sunderland 292200 Newcastle upon Tyne 283600 Gateshead 202400 Newcastle Warwickshire 1981 489900 Warwick 118600 Nuneaton 118500 Stratford on Avon 108600 West Midlands 899 2619000 Birmingham -1.93333 52.4833 1008400 Dudley 312200 Coventry 302500 Walsall 263900 Wolverhampton 245100 Solihull 202000 West Bromwich 154500 West Sussex 1989 713600 Chichester 102500 Horsham 112300 West Yorkshire 2039 2066200 Wakefield 317300 Leeds 724400 Bradford 481700 Kirklees 386900 Huddersfield 148500 Wiltshire 3480 575100 Salisbury 109800 Trowbridge Borders 4698 105700 Newtown St. Boswells Central 2700 273400 Stirling Dumfries and Galloway 6425 147800 Dumfries Fife 1319 352100 Glenrothes Grampian 8752 532500 Aberdeen 219100 Highland 26137 207500 Inverness Lothian 1770 758600 Edinburgh -3.18333 55.9167 447600 Strathclyde 13773 2287800 Glasgow -4.28333 55.8667 674800 Renfrew 201700 Tayside 7643 395000 Dundee 167600 Island Areas (munic.) 5566 72000 Island Areas Aberconwy and Colwyn 1130 110700 Colwyn Bay Anglesey 719 68500 Llangefni Blaenau Gwent 109 73300 Ebbw Vale Bridgend 246 130900 Bridgend Caerphilly 279 171000 Ystrad Fawr Cardiff 139 306600 Cardiff -3.16667 51.4667 300000 Carmarthenshire 2398 169000 Carmarthen Ceredigion 1797 69700 Aberystwyth Denbighshire 844 91300 Ruthin Flintshire 437 145300 Mold Gwynedd 2548 117000 Caernarfon Merthyr Tydfil 111 59500 Merthyr Tydfil Monmouthshire 851 84200 Cwmbran Neath and Port Talbot 441 140100 Port Talbot Newport 191 137400 Newport 137000 Pembrokeshire 1590 113600 Haverfordwest Powys 5204 121800 Llandrindod Wells Rhondda Cynon Taff 424 239000 Rhondda Swansea 378 230900 Swansea 189300 Torfaen 126 90600 Pontypool Vale of Glamorgan 337 119200 Rhymney Valley 104300 Barry Wrexham 499 123500 Wrexham Northern Ireland 14120 1594400 Belfast -5.91667 54.6 297100 Cyprus CY 9250 744609 1.11 8.4 7800 5.6 24.9 69.5 16 08 1960 republic 100 18 78 Nicosia 33.2 35.4 161100 Europe 9562488 Agency for Cultural and Technical Cooperation ACCT 21 03 1970 Bank for International Settlements BIS 20 01 1930 Benelux Economic Union Benelux 03 02 1958 Central European Initiative CEI 27 07 1991 Commonwealth C 31 12 1931 Commonwealth of Independent States CIS 08 12 1991 Council of Europe CE 05 05 1949 Customs Cooperation Council CCC 15 12 1950 Economic Commission for Europe ECE 28 03 1947 European Bank for Reconstruction and Development EBRD 15 04 1991 European Free Trade Association EFTA 04 01 1960 European Investment Bank EIB 25 03 1957 European Organization for Nuclear Research CERN 01 07 1953 European Space Agency ESA 31 07 1973 European Union EU 07 02 1992 Food and Agriculture Organization FAO 16 10 1945 Franc Zone FZ 20 12 1945 Group of 10 G-10 01 10 1962 International Atomic Energy Agency IAEA 26 10 1956 International Chamber of Commerce ICC 01 01 1919 International Confederation of Free Trade Unions ICFTU 01 12 1949 International Criminal Police Organization Interpol 13 06 1956 International Energy Agency IEA 15 11 1974 International Federation of Red Cross and Red Crescent Societies IFRCS 05 05 1919 International Fund for Agricultural Development IFAD 01 11 1974 International Labor Organization ILO 11 04 1919 International Maritime Organization IMO 17 03 1958 International Mobile Satellite Organization Inmarsat 03 09 1976 International Olympic Committee IOC 23 06 1894 International Organization for Migration IOM 05 12 1951 International Organization for Standardization ISO 01 02 1947 International Red Cross and Red Crescent Movement ICRM 01 01 1928 International Telecommunication Union ITU 09 12 1932 Nordic Council NC 16 03 1952 Nordic Investment Bank NIB 04 12 1975 North Atlantic Cooperation Council ANC 08 11 1991 North Atlantic Treaty Organization NATO 17 09 1949 Nuclear Suppliers Group NSG Organization for Economic Cooperation and Development OECD 14 12 1960 Organization for Security and Cooperation in Europe OSCE 01 01 1995 United Nations Conference on Trade and Development UNCTAD 30 12 1964 United Nations Educational, Scientific, and Cultural Organization UNESCO 16 11 1945 United Nations Industrial Development Organization UNIDO 17 11 1966 United Nations Office of the High Commissioner for Refugees UNHCR 03 12 1949 United Nations Relief and Works Agency for Palestine Refugees in the Near East UNRWA 08 12 1949 Universal Postal Union UPU 09 10 1874 Western European Union WEU 23 10 1954 World Confederation of Labor WCL 19 06 1920 World Federation of Trade Unions WFTU 03 10 1945 World Health Organization WHO 22 07 1946 World Intellectual Property Organization WIPO 14 07 1967 World Meteorological Organization WMO 11 10 1947 World Tourism Organization WToO 02 01 1975 Jezerce 19.4 42.3 2694 Korab 20.3 41.4 2751 Kebnekaise 18.3 67.5 2114 Sarektjokko 17.4 67.3 2090 Portefjaellen 17.4 67.1 2021 Tarrekaise 17.3 67 1850 Sulitjelma 16.2 67.1 1914 Galdhoeppig 8 61.4 2469 Jostedalsbre 5.5 61.4 2083 Glittertind 8.1 61.4 2452 Joekul 7.2 60.3 1876 Snoehetta 9 62.1 2286 Elbrus 42.26 43.21 5642 Kasbek 44.31 42.42 5033 Bjelucha 86.4 49.48 4506 Oeraefajoekull -17 64.1 2119 Snoefell -15.2 64.5 1833 Haltiatunturi 21.4 67 1328 Feldberg 7.5 47.5 1493 Grosser Arber 13 49.1 1456 Zugspitze 11.1 47.3 2963 Grossglockner 12.5 47 3797 Montblanc 6 45 4807 776 Seine North Sea 200 2850 Donau Black Sea 2211 1020 Western Dwina Baltic Sea 459 1068 Weichsel 2201 Dnepr 346 Thames 1364 Kura Caspian Sea 424200 1010 Loire Atlantic Ocean 9219 650 Garonne 812 Rhone Mediterranean Sea 5121 477 Weser 1144 Elbe 1320 Rhein Bodensee 538.5 347 Klaraelv Vaenern 5546 435 Moldau 93 Goetaaelv Umeaelv Ounasjoki 520 Kemijoki Oulujoki 169 Kokemaeenjoki 740 Northern Dwina Arctic Ocean 5220 4130 Jenissej 3531 Volga 74 Neva White Drin Drin 133 Black Drin 230 Thjorsa 206 Joekulsa a Fjoellum Norwegian Sea 3860 Oesterdalaelv 520 Dalaelv Vaesterdalaelv 375 Torneaelv 598 Gloma 4400 Lena 3680 Ob 2918 Amur 1809 Petschora 2513 Kolyma 1636 Chatanga 688 Bija 306 Katun 4248 Irtysch 1591 Tobol 2450 Ischim 560 Schilka 1620 Argun 708 Ingoda 1032 Onon 200 Ajan-Jurjach 300 Kulu 605 Grosser Jenissej 680 Kleiner Jenissej 562 Suchona 574 Jug 1480 Oka 1870 Don Sea of Azov 100 2428 Ural 292 Werra 218 Fulda Pacific Ocean 11034 Irish Sea 272 Sea of Japan 4036 Maelaren 1140 Vaettern 1900 Lake Kalla 900 Lake Saima 1460 Paeijaenne 1090 Lake Ori 200 Mjoesen 368 Lake Naesi 250 Lake Skutari 300 Ozero Baikal 31500 Lake Prespa 285 Lake Ohrid 367 Ozero Ladoga 18400 Ozero Onega 9610 Ozero Taimyr 4560 Ozero Chanka 4400 Ozero Pskovskoje 3550 Ozero Tschany 2500 Inari 1085 Lago di Garda 370 Arresee 40.2 Lac Leman 581 Lago Maggiore 216 Lago di Como 146 tDOM-0.8.3/tests/domDoc.test0000644000175000017500000012130410701223546016030 0ustar ssobernissoberni# Features covered: domDoc and docObj command # # This file contains a collection of tests for the two interfaces to # DOM docs, the token interface (the domDoc command) and the tcl # command interface ([$docObj method ...]). # # domDoc-1.*: asXML, asHTML # domDoc-2.*: publicId, systemId # domDoc-3.*: toXSLTcmd # domDoc-4.*: asText # domDoc-5.*: normalize # domDoc-6.*: nodetype # domDoc-7.*: insertBefore # domDoc-8.*: insertBeforeFromScript # domDoc-9.*: replaceChild # domDoc-10.*: getElementById # domDoc-11.*: firstChild # domDoc-12.*: lastChild # domDoc-13.*: appendChild # domDoc-14.*: removeChild # domDoc-15.*: hasChildNodes # domDoc-16.*: childNodes # domDoc-17.*: ownerDocument # domDoc-18.*: appendFromList # domDoc-19.*: appendXML # domDoc-20.*: selectNodes # domDoc-21.*: baseURI # domDoc-22.*: appendFromScript # domDoc-23.*: getElementsByTagNameNS # domDoc-24.*: cdataSectionElements # domDoc-25.*: selectNodesNamespaces # domDoc-26.*: fragments list # domDoc-27.*: deleteXPathCache # # Copyright (c) 2004 - 2007 Rolf Ade. source [file join [file dir [info script]] loadtdom.tcl] test domDoc-1.1 {asXML -escapeNonASCII} {need_i18n} { set doc [dom parse [tDOM::xmlReadFile \ [file join [file dir [info script]] data/i18n_1.xml]]] set result [$doc asXML -escapeNonASCII] $doc delete set result } {абвгдежзий } test domDoc-1.2 {asXML -escapeNonASCII; comments and PI's are not altered} {need_i18n} { set doc [dom parse [tDOM::xmlReadFile \ [file join [file dir [info script]] data/i18n_2.xml]]] set result [$doc asXML -indent none -escapeNonASCII] $doc delete set result } " german umlauts: äöüß " test domDoc-1.3 {asHTML -escapeNonASCII -htmlEntities} {need_i18n} { set doc [dom parse {äü„‟†}] set result [$doc asHTML -escapeNonASCII -htmlEntities] $doc delete set result } {äü„‟†} set doc [dom parse ] test domDoc-1.4 {asXML -doctypeDeclaration} { $doc asXML -doctypeDeclaration 1 } { } test domDoc-1.5 {asXML -doctypeDeclaration without boolean value (error)} { set errMsg "" catch {$doc asXML -doctypeDeclaration} errMsg set errMsg } {-doctypeDeclaration must have a boolean value as argument} test domDoc-1.6 {asXML -doctypeDeclaration 0} { $doc asXML -doctypeDeclaration 0 } { } $doc delete test domDoc-1.7 {asXML -doctypeDeclaration} { set doc [dom parse {}] set result [$doc asXML -doctypeDeclaration 1] $doc delete set result } { } test domDoc-1.8 {asXML -doctypeDeclaration} { set doc [dom parse {}] set result [$doc asXML -doctypeDeclaration 1] $doc delete set result } { } test domDoc-1.9 {asXML -doctypeDeclaration} { set doc [dom parse {}] set result [$doc asXML -doctypeDeclaration true] $doc delete set result } { } test domDoc-1.10 {asXML - unknown option} { set doc [dom parse {}] set errMsg "" catch {$doc asXML -fooOption 1} errMsg $doc delete set errMsg } {bad option "-fooOption": must be -indent, -channel, -escapeNonASCII, -doctypeDeclaration, or -escapeAllQuot} test domDoc-1.11 {asXML - non boolean value to -doctypeDeclaration} { set doc [dom parse {}] set errMsg "" catch {$doc asXML -doctypeDeclaration foo} errMsg $doc delete set errMsg } {expected boolean value but got "foo"} test domDoc-1.12 {asXML - shortened option} { set doc [dom parse {}] set result [$doc asXML -doctype 1] $doc delete set result } { } test domDoc-1.13 {asHTML -doctypeDeclaration} { set doc [dom createDocument HTML] set result [$doc asHTML -doctypeDeclaration 1] $doc delete set result } { } test domDoc-1.14 {asHTML -doctypeDeclaration} { set doc [dom parse {

boo

}] set result [$doc asHTML -doctypeDeclaration 1] $doc delete set result } {

boo

} test domDoc-1.15 {asXML - processing-instruction without pi value} { set doc [dom parse {}] set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-1.16 {asXML - processing-instruction without pi value} { set doc [dom parse {}] set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-1.17 {asHTML - content of script/style tags} { set doc [dom parse { }] set result [$doc asHTML] $doc delete set result } { } test domDoc-1.18 {asXML -escapeAllQuot} { set doc [dom parse {This is "strange"}] set result [$doc asXML -escapeAllQuot] $doc delete set result } {This is "strange" } test domDoc-1.19 {asXML -escapeAllQuot} { set doc [dom parse {This is "strange"}] set result [$doc asXML] $doc delete set result } {This is "strange" } test domDoc-1.20 {asXML - indentation of comments} { set doc [dom parse { }] set result [$doc asXML -indent 4] $doc delete set result } { } set doc [dom parse ] test domDoc-2.1 {publicId - no publicId there} { $doc publicId } {} test domDoc-2.2 {systemId - no systemId there} { $doc systemId } {} $doc delete set doc [dom parse {}] test domDoc-2.3 {publicId from parsed document} { $doc publicId } {-//foo//DTD bar x.y//EN} test domDoc-2.4 {systemId from parsed document} { $doc systemId } {file:///boo.baz} $doc delete set doc [dom parse {}] test domDoc-2.5 {publicId but document has only SYSTEM} { $doc publicId } {} test domDoc-2.6 {systemId, document has only SYSTEM} { $doc systemId } {file:///boo.baz} test domDoc-2.7 {publicId - set public identifier} { set result [$doc publicId "file:///woo.hoo"] append result " [$doc publicId]" } { file:///woo.hoo} test domDoc-2.8 {publicId - set public identifier} { $doc publicId "http://www.tdom.org" $doc asXML -indent no -doctypeDeclaration 1 } { } test domDoc-2.9 {systemId - set system identifier} { set result [$doc systemId "file:///woo.hoo"] append result " [$doc systemId]" } {file:///boo.baz file:///woo.hoo} test domDoc-2.10 {systemId - set system identifier} { $doc systemId "file:///whooze.moo" $doc asXML -indent no -doctypeDeclaration 1 } { } test domDoc-2.11 {publicId - set to empty string} { $doc publicId "" $doc asXML -indent no -doctypeDeclaration 1 } { } test domDoc-2.12 {systemId - set to empty string} { $doc systemId "" $doc asXML -indent no -doctypeDeclaration 1 } { } $doc delete set doc [dom parse ] set xslt1 { } test domDoc-3.1 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] $xsltCmd -parameters {param2 newValue param3 "this Value"} $doc resultDoc set result [$resultDoc asXML -indent none] $resultDoc delete $xsltCmd -parameters {param1 "that Value"} $doc resultDoc append result [$resultDoc asXML -indent none] $resultDoc delete $xsltCmd -parameters {param3 "another" param1 "and this"} $doc resultDoc append result [$resultDoc asXML -indent none] $resultDoc delete rename $xsltCmd {} set result } {param1Default newValue this Value that Value param2Default param3Default and this param2Default another } set xslt2 { dummy result This is from xsl:message } proc msgCmd1 {msg terminate} { global result append result "msgCmd1: $msg " } proc msgCmd2 {msg terminate} { global result append result "msgCmd2: $msg" } test domDoc-3.2 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt2] set xsltCmd [$xslt toXSLTcmd] set result "" $xsltCmd -xsltmessagecmd msgCmd1 $doc resultDoc $resultDoc delete $xsltCmd -xsltmessagecmd msgCmd2 $doc resultDoc $resultDoc delete rename $xsltCmd {} set result } {msgCmd1: This is from xsl:message msgCmd2: This is from xsl:message} test domDoc-3.3 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd -bogusOption foo $doc resultDoc} errMsg] lappend result $errMsg lappend result [catch {$xsltCmd $doc resultDoc}] lappend result [$resultDoc asXML -indent none] $resultDoc delete rename $xsltCmd {} set result } {1 {bad option "-bogusOption": must be -parameters, -ignoreUndeclaredParameters, or -xsltmessagecmd} 0 {param1Default param2Default param3Default }} test domDoc-3.4 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd -xsltmessagecmd msgCmd1} errMsg] rename $xsltCmd {} lappend result $errMsg } {1 {wrong # args: should be "?-parameters parameterList? ?-ignoreUndeclaredParameters? ?-xsltmessagecmd cmd? ?objVar?"}} test domDoc-3.5 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd $doc resultDoc bogus} errMsg] rename $xsltCmd {} lappend result $errMsg } {1 {wrong # args: should be "?-parameters parameterList? ?-ignoreUndeclaredParameters? ?-xsltmessagecmd cmd? ?objVar?"}} test domDoc-3.6 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd -parameters {param1 foo} -parameters {param2 foo} $doc resultDoc} errMsg] rename $xsltCmd {} lappend result $errMsg } {1 {only one -parameters option allowed}} test domDoc-3.7 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd}] $xsltCmd delete set result } {1} test domDoc-3.8 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd delete bogus}] $xsltCmd delete set result } {1} test domDoc-3.9 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd transform} errMsg] $xsltCmd delete set result } {1} test domDoc-3.10 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] $xsltCmd transform $doc resultDoc set result [$resultDoc asXML -indent none] $resultDoc delete $xsltCmd delete set result } {param1Default param2Default param3Default } set xslt3 { mixed element this is more text } test domDoc-3.11 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt3] set xsltCmd [$xslt toXSLTcmd] set result [list] for {set x 0} {$x < 2} {incr x} { $xsltCmd $doc resultDoc lappend result [lsort [$resultDoc cdataSectionElements *]] lappend result [$resultDoc asXML -indent none] $resultDoc delete } $xsltCmd delete set result } {{b bar doc foo} {} {b bar doc foo} {}} $doc delete test domDoc-4.1 {asText - syntax check} { dom parse doc set result [catch {$doc asText foo}] $doc delete set result } {1} test domDoc-4.2 {asText} { dom parse {pcdata foo bar grill} doc set result [$doc asText] $doc delete set result } {pcdata foo bar grill} test domDoc-4.3 {asText} { dom parse {pcdata Hello, world!]]> more pcdata} doc set result [$doc asText] $doc delete set result } {pcdata Hello, world! more pcdata} test domDoc-4.4 {asText} { dom parse {pcdata} doc $doc documentElement root set newCDATAnode \ [$doc createCDATASection "Hello, world!"] $root appendChild $newCDATAnode set result [$doc asText] $doc delete set result } {pcdata} test domDoc-4.5 {asText} { dom parse {encoded chars: > < & " '} doc set result [$doc asText] $doc delete set result } {encoded chars: > < & " '} # emacs: " test domDoc-5.1 {normalize} { set doc [dom parse text] $doc documentElement root set cdataNode [$doc createCDATASection "cdata section text"] set child [$root firstChild] $child appendChild $cdataNode $doc normalize set result [llength [$child childNodes]] lappend result [[$child firstChild] data] $doc delete set result } {2 text} test domDoc-5.2 {normalize} { set doc [dom parse text] $doc documentElement root set cdataNode [$doc createCDATASection "cdata section text"] set child [$root firstChild] $child appendChild $cdataNode $doc normalize -forXPath set result [llength [$child childNodes]] lappend result [[$child firstChild] data] $doc delete set result } {1 {textcdata section text}} test domDoc-5.3 {normalize} { set doc [dom parse ] $doc documentElement root set cdataNode [$doc createCDATASection "cdata section text"] set textNode [$doc createTextNode text] set child [$root firstChild] $child appendChild $cdataNode $child appendChild $textNode set result [llength [$child childNodes]] $doc normalize -forXPath lappend result [llength [$child childNodes]] lappend result [[$child firstChild] data] $doc delete set result } {2 1 {cdata section texttext}} test domDoc-5.4 {normalize} { set doc [dom parse ] $doc documentElement root set cdataNode [$doc createCDATASection "cdata section text"] set child [$root firstChild] $child appendChild $cdataNode $doc normalize set result [$cdataNode nodeType] $doc normalize -forXPath lappend result [$cdataNode nodeType] $doc delete set result } {CDATA_SECTION_NODE TEXT_NODE} test domDoc-5.5 {normalize} { set doc [dom parse ] $doc documentElement root set textNode [$doc createTextNode ""] set child [$root firstChild] $child appendChild $textNode set result [llength [$child childNodes]] $doc normalize lappend result [llength [$child childNodes]] $doc delete set result } {1 0} test domDoc-5.6 {normalize} { set doc [dom parse ] $doc documentElement root set cdataNode [$doc createCDATASection ""] set child [$root firstChild] $child appendChild $cdataNode $doc normalize set result [llength [$child childNodes]] $doc normalize -forXPath lappend result [llength [$child childNodes]] $doc delete set result } {1 0} test domDoc-6.1 {nodeType} { set doc [dom parse ] set result [$doc nodeType] $doc delete set result } {DOCUMENT_NODE} test domDoc-6.2 {nodeType} { set doc [dom parse ] set result [catch {$doc nodeType foo}] $doc delete set result } {1} test domDoc-7.1 {insertBefore} { set doc [dom parse {}] set root [$doc documentElement] set newPI [$doc createProcessingInstruction myPI pivalue] $doc insertBefore $newPI $root set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-7.2 {insertBefore} { set doc [dom parse {}] set newPI [$doc createProcessingInstruction myPI pivalue] $doc insertBefore $newPI "" set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-7.3 {insertBefore} { set doc [dom parse {}] set newPI [$doc createProcessingInstruction myPI pivalue] set root [$doc documentElement] set child [$root firstChild] set result [catch {$doc insertBefore $newPI $child} errMsg] lappend result $errMsg $doc delete set result } {1 NOT_FOUND_ERR} namespace eval nodeCmds { dom createNodeCmd elementNode e1 dom createNodeCmd elementNode e2 dom createNodeCmd commentNode c dom createNodeCmd textNode t dom createNodeCmd cdataNode cdata dom createNodeCmd piNode pi dom createNodeCmd parserNode parser } test domDoc-8.1 {insertBeforeFromScript} { set doc [dom parse {}] $doc documentElement root $doc insertBeforeFromScript { nodeCmds::e1 } $root set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-8.2 {insertBeforeFromScript} { set doc [dom parse {}] $doc insertBeforeFromScript { nodeCmds::e1 } "" set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-8.3 {insertBeforeFromScript} { set doc [dom parse {}] $doc documentElement root set result [catch {$root insertBeforeFromScript { nodeCmds::e1 nodeCmds::e1 { # This is intentionally wrong set foo 1 + 1 } } $root}] lappend result [$doc asXML -indent none] $doc delete set result } {1 } test domDoc-9.1 {replaceChild} { set doc [dom parse {}] set root [$doc documentElement] set newNode [$doc createElement newNode] $doc replaceChild $newNode $root set result [$doc asXML -indent none] lappend result [[$doc documentElement] nodeName] $doc delete set result } { newNode} set getElementByIdSetup { set doc [dom parse { ]> }] } test domDoc-10.1 {getElementById} -setup $getElementByIdSetup -body { set result [[$doc getElementById "4a"] @name] lappend result [$doc getElementById "dontexists"] } -cleanup { $doc delete } -result {that {}} test domDoc-10.2 {getElementById - only IDs at parsing time will be found} \ -setup $getElementByIdSetup -body { set root [$doc documentElement] set elemNode [$root selectNodes {elem[3]}] if {[$elemNode hasAttribute id]} { error "error in the test code" } $elemNode setAttribute id "new" $doc getElementById "new" } -cleanup { $doc delete } -result {} test domDoc-10.3 {getElementById} -setup $getElementByIdSetup -body { set root [$doc documentElement] set elemNode [$root selectNodes {elem[2]}] if {![$elemNode hasAttribute id]} { error "error in the test code" } $elemNode setAttribute id "new" [$doc getElementById "new"] getAttribute name } -cleanup { $doc delete } -result that test domDoc-10.3 {getElementById} -setup $getElementByIdSetup -body { set root [$doc documentElement] set elemNode [$root selectNodes {elem[2]}] if {![$elemNode hasAttribute id]} { error "error in the test code" } $elemNode setAttribute id "new" [$doc getElementById "new"] getAttribute name } -cleanup { $doc delete } -result that test domDoc-10.4 {getElementById} -setup $getElementByIdSetup -body { set root [$doc documentElement] set elemNode [$root selectNodes {elem[2]}] if {![$elemNode hasAttribute id]} { error "error in the test code" } $root removeChild $elemNode [$doc getElementById "4a"] getAttribute name } -cleanup { $doc delete } -result that test domDoc-10.5 {getElementById} -setup $getElementByIdSetup -body { set root [$doc documentElement] set elemNode [$root selectNodes {elem[2]}] if {![$elemNode hasAttribute id]} { error "error in the test code" } $elemNode removeAttribute id $doc getElementById "4a" } -cleanup { $doc delete } -result {} test domDoc-11.1 {firstChild} { set doc [dom createDocumentNode] set result [$doc firstChild] $doc delete set result } {} test domDoc-11.2 {firstChild} { set doc [dom parse ] set result [[$doc firstChild] nodeName] $doc delete set result } {root} test domDoc-11.3 {firstChild} { set doc [dom parse {}] set result [[$doc firstChild] nodeName] $doc delete set result } {beforeRoot} test domDoc-11.4 {firstChild} { set doc [dom parse {}] set node [$doc firstChild] set newNode [$doc createElement newNode] $doc insertBefore $newNode $node set result [[$doc firstChild] nodeName] $doc delete set result } {newNode} test domDoc-11.5 {Delete top level node} { set doc [dom parse {}] [$doc firstChild] delete set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-11.6 {Delete top level node} { set doc [dom parse {}] [$doc documentElement] delete set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-12.1 {lastChild} { set doc [dom createDocumentNode] set result [$doc lastChild] $doc delete set result } {} test domDoc-12.2 {lastChild} { set doc [dom parse ] set result [[$doc lastChild] nodeName] $doc delete set result } {root} test domDoc-12.3 {lastChild} { set doc [dom parse {}] set result [[$doc lastChild] nodeName] $doc delete set result } {afterRoot} test domDoc-12.4 {lastChild} { set doc [dom parse {}] set newNode [$doc createElement newNode] $doc appendChild $newNode set result [[$doc lastChild] nodeName] lappend result [[$doc lastChild] parentNode] $doc delete set result } {newNode {}} test domDoc-13.1 {appendChild} { set doc [dom parse {}] set newNode [$doc createElement newNode] $doc appendChild $newNode set newNode [$doc createComment "a comment"] $doc appendChild $newNode set newNode [$doc createProcessingInstruction this that] $doc appendChild $newNode set newNode [$doc createTextNode "text"] $doc appendChild $newNode set result [$doc asXML -indent none] $doc delete set result } {text} test domDoc-13.2 {appendChild} { set doc [dom createDocumentNode] set newNode [$doc createElement newNode] $doc appendChild $newNode set result [[$doc documentElement] nodeName] $doc delete set result } {newNode} test domDoc-13.3 {appendChild} { set doc [dom createDocumentNode] set newNode [$doc createElement newNode] $doc appendChild $newNode set result [[$doc documentElement] parentNode] $doc delete set result } {} test domDoc-14.1 {removeChild} { set doc [dom parse {}] $doc removeChild [$doc firstChild] set result [$doc documentElement] $doc delete set result } {} test domDoc-14.2 {removeChild} { set doc [dom parse {}] $doc removeChild [$doc firstChild] set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-14.3 {removeChild} { set doc [dom createDocumentNode] set result [catch {$doc removeChild [$doc firstChild]}] $doc delete set result } {1} test domDoc-15.1 {hasChildNodes} { set doc [dom createDocumentNode] set result [$doc hasChildNodes] set newNode [$doc createElement newNode] $doc appendChild $newNode lappend result [$doc hasChildNodes] $doc delete set result } {0 1} test domDoc-16.1 {childNodes} { set doc [dom parse {}] set result {} foreach node [$doc childNodes] { lappend result [$node nodeName] } $doc delete set result } {beforeRoot root afterRoot} test domDoc-17.1 {ownerDocument} { set doc [dom parse ] set result [expr {$doc == [$doc ownerDocument]}] $doc delete set result } {1} test domDoc-18.1 {appendFromList} { set doc [dom createDocumentNode] $doc appendFromList {elem {} {}} set node [$doc documentElement] set result [list [$node nodeName] [$node parentNode]] $doc delete set result } {elem {}} test domDoc-19.1 {appendXML} { set doc [dom createDocumentNode] $doc appendXML footext set result [$doc asXML -indent none] $doc delete set result } {footext} test domDoc-19.2 {appendXML} { set doc [dom createDocumentNode] $doc appendXML footext set result [[$doc documentElement] nodeName] lappend result [[$doc documentElement] parentNode] lappend result [expr {$doc == [[$doc documentElement] ownerDocument]}] $doc delete set result } {test {} 1} test domDoc-19.3 {appendXML} { set doc [dom createDocument foo] $doc appendXML footext set result [[$doc documentElement] nodeName] set result [$doc asXML -indent none] $doc delete set result } {footext} test domDoc-20.1 {selectNodes} { set doc [dom parse {}] set result [[$doc selectNodes {root/child[2]}] getAttribute id] $doc delete set result } {2} test domDoc-20.2 {selectNodes} { set doc [dom parse {}] set result [[$doc selectNodes {/root/child[2]}] getAttribute id] $doc delete set result } {2} test domDoc-20.3 {selectNodes} { set doc [dom parse {}] set result [list] foreach node [$doc selectNodes *] { lappend result [$node nodeName] } set result } {root} test domDoc-20.4 {selectNodes} { set doc [dom parse {}] set result [list] foreach node [$doc selectNodes node()] { lappend result [$node nodeType] } set result } {COMMENT_NODE ELEMENT_NODE PROCESSING_INSTRUCTION_NODE} test domDoc-20.5 {selectNodes with -namespaces option} { set doc [dom createDocumentNS "http://tdom.org" tdom:doc] set node [$doc selectNodes \ -namespaces {tdom http://tdom.org} \ tdom:doc] set result [$node nodeName] set node [$doc selectNodes \ -namespaces {myPrefix http://tdom.org} \ myPrefix:doc] lappend result [$node nodeName] lappend result [$doc selectNodes -namespaces {} doc typeVar] lappend result $typeVar $doc delete set result } [list tdom:doc tdom:doc "" empty] test domDoc-21.1 {baseURI} { set doc [dom createDocumentNode] set result [$doc baseURI] $doc delete set result } {} test domDoc-21.2 {baseURI} { set doc [dom parse -baseurl file://foo ] set result [$doc baseURI] $doc baseURI http://that.this lappend result [$doc baseURI] $doc delete set result } {file://foo http://that.this} namespace eval nodeCmds { dom createNodeCmd elementNode e1 dom createNodeCmd elementNode e2 dom createNodeCmd commentNode c dom createNodeCmd textNode t dom createNodeCmd cdataNode cdata dom createNodeCmd piNode pi dom createNodeCmd parserNode parser } test domDoc-22.1 {appendFromScript} { set doc [dom createDocumentNode] $doc appendFromScript nodeCmds::e1 set result [$doc asXML -indent none] lappend result [[$doc documentElement] nodeName] $doc delete set result } { e1} test domDoc-22.2 {appendFromScript} { set doc [dom parse ] namespace eval nodeCmds { $doc appendFromScript { e1 e2 } } set result [$doc asXML -indent none] foreach node [$doc selectNodes *] { lappend result [$node parentNode] lappend result [expr {$doc == [$node ownerDocument]}] } $doc delete set result } { {} 1 {} 1 {} 1} test domDoc-22.3 {appendFromScript} { set doc [dom createDocumentNode] set nrOfNodeCmdsBefore [info commands domNode*] $doc appendFromScript { nodeCmds::e1 } $doc delete set nrOfNodeCmdsAfter [info commands domNode*] expr {$nrOfNodeCmdsBefore == $nrOfNodeCmdsAfter} } {1} test domDoc-23.1 {getElementsByTagNameNS} { dom createNodeCmd elementNode child set doc [dom createDocument root] $doc documentElement root $root appendFromScript { for {set x 0} {$x < 250} {incr x} { child [list xmlns ns$x] {} } } set xml [$doc asXML] $doc delete set doc [dom parse $xml] set result 1 for {set x 0} {$x < 250} {incr x} { set nodes [$doc getElementsByTagNameNS ns$x *] if {[llength $nodes] != 1} { set result 0 } } $doc delete set result } {1} test domDoc-24.1 {cdataSectionElements} { set doc [dom parse {Some Text}] set result [catch {$doc cdataSectionElements} errMsg] lappend result $errMsg $doc delete set result } {1 {wrong # args: should be " cdataSectionElements ?URI:?localname ?boolean?"}} test domDoc-24.2 {cdataSectionElements} { set doc [dom parse {Some Text}] set result [catch {$doc cdataSectionElements foo bar grill} errMsg] lappend result $errMsg $doc delete set result } {1 {wrong # args: should be " cdataSectionElements ?URI:?localname ?boolean?"}} test domDoc-24.3 {cdataSectionElements} { set doc [dom parse {Some Text}] set result [catch {$doc cdataSectionElements root foo} errMsg] lappend result $errMsg $doc delete set result } {1 {expected boolean value but got "foo"}} test domDoc-24.4 {cdataSectionElements} { set doc [dom parse {Some Text}] set result [$doc cdataSectionElements root] $doc delete set result } {0} test domDoc-24.5 {cdataSectionElements} { set doc [dom parse {Some Text}] set result [$doc cdataSectionElements root 0] lappend result [$doc cdataSectionElements root 1] lappend result [$doc cdataSectionElements root 0] $doc delete set result } {0 1 0} test domDoc-24.6 {cdataSectionElements} { set doc [dom parse {Some Text}] set result [$doc cdataSectionElements root 1] lappend result [$doc asXML -indent none] $doc delete set result } {1 {}} test domDoc-24.7 {cdataSectionElements} { set doc [dom parse {<foo>}] foreach element {foo root bar grill} { $doc cdataSectionElements $element 1 } set result [$doc asXML -indent none] $doc delete set result } {]]>} test domDoc-24.8 {cdataSectionElements} { set doc [dom parse {text ]}] $doc cdataSectionElements root 1 set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-24.9 {cdataSectionElements} { set doc [dom parse {text ]]}] $doc cdataSectionElements root 1 set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-24.10 {cdataSectionElements} { set doc [dom parse {text ]]>}] $doc cdataSectionElements root 1 set result [$doc asXML -indent none] $doc delete set result } {]]>} test domDoc-24.11 {cdataSectionElements} { set doc [dom parse {text ]]> text]]>text}] $doc cdataSectionElements root 1 set result [$doc asXML -indent none] $doc delete set result } { text]]]]>text]]>} test domDoc-24.12 {cdataSectionElements} { set doc [dom parse {text}] $doc cdataSectionElements http://foo.bar:root 1 set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-24.13 {cdataSectionElements} { set doc [dom parse {text}] set result [$doc cdataSectionElements ""] $doc delete set result } {0} test domDoc-24.14 {cdataSectionElements} { set doc [dom parse {text}] set result [$doc cdataSectionElements *] $doc delete set result } {} test domDoc-24.15 {cdataSectionElements} { set doc [dom parse {text}] foreach elem {foo bar grill root http://www.foo.org:baz} { $doc cdataSectionElements $elem 1 } foreach elem {foo grill} { $doc cdataSectionElements $elem 0 } set result [lsort [$doc cdataSectionElements *]] $doc delete set result } {bar http://www.foo.org:baz root} test domDoc-24.16 {cdataSectionElements} { set doc [dom parse {some text}] $doc documentElement root set node [$root firstChild] $doc cdataSectionElements child 1 set result [$node asXML -indent none] $doc delete set result } {} test domDoc-25.1 {selectNodesNamespaces} { set doc [dom createDocument foo] set result [$doc selectNodesNamespaces] $doc delete set result } {} test domDoc-25.2 {selectNodesNamespaces} { set doc [dom createDocument foo] set result [list [$doc selectNodesNamespaces] \ [$doc selectNodesNamespaces {}] \ [$doc selectNodesNamespaces]] $doc delete set result } {{} {} {}} test domDoc-25.3 {selectNodesNamespaces} { set doc [dom createDocument foo] set result [list [$doc selectNodesNamespaces] \ [$doc selectNodesNamespaces {prefix http://foo.org/uri}] \ [$doc selectNodesNamespaces] \ [$doc selectNodesNamespaces {}]] $doc delete set result } {{} {prefix http://foo.org/uri} {prefix http://foo.org/uri} {}} test domDoc-25.4 {selectNodesNamespaces} { set doc [dom createDocument foo] set result [catch {$doc selectNodesNamespaces wrong} errMsg] lappend result $errMsg $doc delete set result } {1 {The optional argument to the selectNodesNamespaces method must be a 'prefix namespace' pairs list}} test domDoc-25.5 {selectNodesNamespaces} { set doc [dom parse { }] $doc selectNodesNamespaces {default1 rootdefaultNS} set node [$doc selectNodes default1:root] set result [list [$node prefix] [$node localName]] $doc delete set result } {{} root} test domDoc-25.6 {selectNodesNamespaces} { set doc [dom parse { }] $doc selectNodesNamespaces {default2 elem1NS default1 rootdefaultNS} set node [$doc selectNodes default1:root/default2:elem1] set result [list [$node prefix] [$node localName]] set node [$doc selectNodes default1:root/default2:elem1/default2:elem11] lappend result [$node nodeName] [$node namespaceURI] $doc delete set result } {{} elem1 elem11 elem1NS} test domDoc-25.7 {selectNodesNamespaces} { set doc [dom parse { }] $doc selectNodesNamespaces {default2 elem1NS default1 rootdefaultNS} set node [$doc selectNodes default1:root/default2:elem1] set result [list [$node prefix] [$node localName]] set node [$doc selectNodes default1:root/default2:elem1/elem11] lappend result [$node nodeName] [$node namespaceURI] $doc delete set result } {{} elem1 elem11 {}} test domDoc-25.8 {selectNodesNamespaces} { set doc [dom parse { }] $doc selectNodesNamespaces {default2 elem1NS default1 rootdefaultNS} set result [catch {set node [$doc selectNodes \ -namespaces { dflt1 elem1NS dflt2 rootdefaultNS } \ default1:root/dflt1:elem1/elem11]} errMsg] lappend result $errMsg $doc delete set result } {1 {Prefix doesn't resolve}} test domDoc-25.9 {selectNodesNamespaces} { set doc [dom parse { }] $doc selectNodesNamespaces {default2 elem1NS default1 rootdefaultNS} set node [$doc selectNodes default1:root/default2:elem1] set result [list [$node prefix] [$node localName]] set node [$doc selectNodes \ -namespaces {dflt1 elem1NS dflt2 rootdefaultNS} \ dflt2:root/dflt1:elem1/elem11] lappend result [$node nodeName] [$node namespaceURI] $doc delete set result } {{} elem1 elem11 {}} test domDoc-26.1 {Fragment list} { set doc [dom parse { text1text2text3}] $doc removeChild [$doc firstChild] $doc documentElement root for {set i 1} {$i < 4} {incr i} { set removedNode$i [$root removeChild [$root firstChild]] } $removedNode2 delete $root appendChild $removedNode3 $root appendChild $removedNode1 set result [$doc asXML -indent none] $doc delete set result } {text3text1} test domDoc-27.1 {deleteXPathCache} { set doc [dom createDocument doc] set result [list] lappend result [$doc deleteXPathCache foo/bar] $doc selectNodes -cache 1 2+2 lappend result [$doc deleteXPathCache foo/bar] lappend result [$doc deleteXPathCache 2+2] lappend result [$doc deleteXPathCache] $doc selectNodes -cache 1 2+2 $doc delete set result } {{} {} {} {}} # cleanup ::tcltest::cleanupTests return tDOM-0.8.3/tests/loadtdom.tcl0000644000175000017500000000146610660664313016244 0ustar ssobernissoberni# loadtdom.tcl -- # # This file is [source]d by all.tcl and all test files, to ensure, that # the tcltest package and the lastest tdom build is present. # # RCS: @(#) $Id: loadtdom.tcl,v 1.9 2007/08/15 20:57:47 rolf Exp $ # if {[lsearch [namespace children] ::tcltest] == -1} { if {$tcl_version < 8.2} { puts stderr "sourcing def.tcl" source [file join [file dir [info script]] defs.tcl] set auto_path [pwd] } else { package require tcltest namespace import ::tcltest::* } } if {[catch {package present -exact tdom 0.8.3}]} { package require -exact tdom 0.8.3 } else { if {[lsearch [namespace children] ::tDOM] == -1} { # tcldomsh without the script library. Source the lib. source [file join [file dir [info script]] ../lib tdom.tcl] } } tDOM-0.8.3/tests/tdomcmd.test0000644000175000017500000001062610054773345016266 0ustar ssobernissoberni# Features covered: tdom cmd # # This file contains a collection of tests for the tdom cmd. # # Copyright (c) 2003 Rolf Ade. # # RCS: @(#) $Id: tdomcmd.test,v 1.3 2004/05/26 01:46:13 rolf Exp $ source [file join [file dir [info script]] loadtdom.tcl] # To test, that DOM trees generated with a tdom enabled parser behaves # the same way, as the one generated with the [dom parse] cmd, we # rename the dom cmd and use instead a dom proc, which partly rebuilds # the [dom parse] interface with a tdom enabled parser. Then we just # [source] some of the test files, which heavily use [dom parse]. rename dom _dom set _main_parser [expat] tdom $_main_parser enable set parse_in_chunks 0 proc dom {args} { switch [lindex $args 0] { "parse" { set parseMethod "parse" set haveData 0 set uplevelVar "" tdom $::_main_parser keepEmpties 0 for {set x 1} {$x < [llength $args]} {incr x} { switch -- [lindex $args $x] { "-channel" { set parseMethod "parsechannel" incr x set data [lindex $args $x] set haveData 1 } "-keepEmpties" { tdom $::_main_parser keepEmpties 1 } "-baseurl" { incr x $::_main_parser configure -baseurl [lindex $args $x] } "-externalentitycommand" { incr x $::_main_parser configure -externalentitycommand \ [lindex $args $x] tdom $::_main_parser setExternalEntityResolver \ [lindex $args $x] } default { if {$haveData} { set uplevelVar [lindex $args $x] } else { set data [lindex $args $x] set haveData 1 } } } } if {$::parse_in_chunks && ($parseMethod == "parse")} { $::_main_parser configure -final 0 for {set x 0} {$x < [string length $data]} {incr x} { $::_main_parser parse [string index $data $x] } $::_main_parser configure -final 1 $::_main_parser parse "" } else { $::_main_parser $parseMethod $data } if {$uplevelVar != ""} { uplevel 1 set $uplevelVar [tdom $::_main_parser getdoc] } else { return [tdom $::_main_parser getdoc] } } "setStoreLineColumn" { tdom $::_main_parser setStoreLineColumn [lindex $args 1] } default { # Because the original command may be executed within a # namespace eval, we do an uplevel, to get the same context return [uplevel 1 [linsert $args 0 _dom]] } } } source [file join [file dir [info script]] i18n.test] source [file join [file dir [info script]] domNode.test] source [file join [file dir [info script]] xslt.test] # Un-comment this, to test tdom cmd together with expat parsing in chunks # set parse_in_chunks 1 # source [file join [file dir [info script]] i18n.test] # source [file join [file dir [info script]] domNode.test] # source [file join [file dir [info script]] xslt.test] rename dom {} rename _dom dom $_main_parser free test tdomcmd-1.1 {no doc avaliable} { set parser [expat] tdom $parser enable set result [catch {tdom $parser getdoc} errMsg] $parser free lappend result $errMsg } {1 {No DOM tree avaliable.}} test tdomcmd-1.2 {request dom tree in the middle of parsing} { set parser [expat -final 0] tdom $parser enable $parser parse {} set result [catch {tdom $parser getdoc} errMsg] lappend result $errMsg $parser parse {foo} lappend result [catch {tdom $parser getdoc} errMsg] lappend result $errMsg $parser configure -final 1 $parser parse {} lappend result [catch {set doc [tdom $parser getdoc]} errMsg] $doc delete $parser free set result } {1 {No DOM tree avaliable.} 1 {No DOM tree avaliable.} 0} # cleanup ::tcltest::cleanupTests return tDOM-0.8.3/LICENSE0000644000175000017500000000042707522573577013612 0ustar ssobernissoberni The tDOM specific source files come with the Mozilla Public License Version 1.1. If you want to distribute/use tDOM under a different license please feel free to contact the author (loewerj@hotmail.com). For Expat XML parser package license look into the directory expat. tDOM-0.8.3/configure-tcl8.0.50000755000175000017500000036476210660664054015670 0ustar ssobernissoberni#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --with-tcl directory containing tcl configuration (tclConfig.sh)" ac_help="$ac_help --with-tclinclude directory containing the public Tcl header files" ac_help="$ac_help --enable-threads build with threads" ac_help="$ac_help --enable-shared build and link with shared libraries [--enable-shared]" ac_help="$ac_help --enable-64bit enable 64bit support (where applicable)" ac_help="$ac_help --enable-64bit-vis enable 64bit Sparc VIS support" ac_help="$ac_help --disable-load disallow dynamic loading and "load" command" ac_help="$ac_help --enable-symbols build with debugging symbols [--disable-symbols]" ac_help="$ac_help --with-aolserver directory with AOLserver distribution" ac_help="$ac_help --enable-dtd build with the dtd support [--enable-dtd]" ac_help="$ac_help --enable-ns build with the namespace support [--enable-ns]" ac_help="$ac_help --enable-unknown enable built-in unknown command [--disable-unknown]" ac_help="$ac_help --enable-tdomalloc build with the tDOM allocator [--enable-tdomalloc]" # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=generic/tcldom.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi #----------------------------------------------------------------------- # Be sure we're invoked from the platform directory. #----------------------------------------------------------------------- if test ${srcdir} = "." ; then echo "" echo "Please cd to the platform-specific dir (unix or win) and invoke:" echo " ../configure" echo "" exit 1 fi #----------------------------------------------------------------------- # These are needed for the expat compilation. Do this early so we # do not step over some CFLAGS which will confuse the compiler. #----------------------------------------------------------------------- for ac_func in memmove bcopy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:572: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done #----------------------------------------------------------------------- # Where is the tcl.m4 and brothers? #----------------------------------------------------------------------- ac_aux_dir= for ac_dir in tclconfig $srcdir/tclconfig; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in tclconfig $srcdir/tclconfig" 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. CONFIGDIR=${srcdir}/tclconfig #---------------------------------------------------------------------- # __CHANGE__ # Set your package name and version numbers here. The NODOT_VERSION is # required for constructing the library name on systems that don't like # dots in library names (Windows). The VERSION variable is used on the # other systems. Note that we substitute the VERSIN later down, after # we have initialized TEA so we know which platform we're dealing with. #---------------------------------------------------------------------- PACKAGE=tdom TDOMSHELL=tcldomsh MAJOR_VERSION=0 MINOR_VERSION=8 PATCHLEVEL=3 # This package name must be replaced statically for AC_SUBST to work # Substitute stub_LIB_FILE if your package creates a stub library too. #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows". #-------------------------------------------------------------------- echo $ac_n "checking for correct TEA configuration""... $ac_c" 1>&6 echo "configure:688: checking for correct TEA configuration" >&5 if test x"${PACKAGE}" = x ; then { echo "configure: error: The PACKAGE variable must be defined by your TEA configure.in" 1>&2; exit 1; } fi echo "$ac_t""ok" 1>&6 TEA_INITED=ok case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_98*|*CYGWIN_95*|*CYGWIN_ME*|*MINGW32_*) # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:700: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CYGPATH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CYGPATH="cygpath -w" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH="$ac_cv_prog_CYGPATH" if test -n "$CYGPATH"; then echo "$ac_t""$CYGPATH" 1>&6 else echo "$ac_t""no" 1>&6 fi EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- if test x"${TEA_INITED}" = x ; then # Can't refer to exact macro name or it will be substituted { echo "configure: error: Must call TEA INIT before PATH_TCLCONFIG" 1>&2; exit 1; } fi # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" with_tclconfig=${withval} fi echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 echo "configure:766: checking for Tcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else { echo "configure: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" 1>&2; exit 1; } fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" echo "configure: warning: "Cannot find Tcl configuration definitions"" 1>&2 exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} echo "$ac_t""found $TCL_BIN_DIR/tclConfig.sh" 1>&6 fi fi echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6 echo "configure:839: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then echo "$ac_t""loading" 1>&6 . $TCL_BIN_DIR/tclConfig.sh else echo "$ac_t""file not found" 1>&6 fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TCL_DBGX substitution # eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" #AC_SUBST(TCL_DBGX) #AC_SUBST(TCL_BUILD_LIB_SPEC) #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- #TEA_PATH_TKCONFIG #TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- # Should be AC_MSG_NOTICE, but that requires autoconf 2.50 if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then echo "configure: warning: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" 1>&2 prefix=${TCL_PREFIX} else prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" ; then if test x"${TCL_EXEC_PREFIX}" != x; then echo "configure: warning: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" 1>&2 exec_prefix=${TCL_EXEC_PREFIX} else exec_prefix=$prefix fi fi #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 echo "configure:938: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cygwin=no fi rm -f conftest* rm -f conftest* fi echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 echo "configure:971: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_mingw32=no fi rm -f conftest* rm -f conftest* fi echo "$ac_t""$ac_cv_mingw32" 1>&6 MINGW32= test "$ac_cv_mingw32" = yes && MINGW32=yes # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1009: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1039: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_save_ifs" if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then case "`uname -s`" in *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1090: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; esac fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:1122: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 1133 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:1138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:1164: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:1169: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:1197: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then echo $ac_n "checking if the compiler understands -pipe""... $ac_c" 1>&6 echo "configure:1236: checking if the compiler understands -pipe" >&5 OLDCC="$CC" CC="$CC -pipe" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CC="$OLDCC" echo "$ac_t""no" 1>&6 fi rm -f conftest* fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:1272: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:1330: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1364: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" fi fi RANLIB="$ac_cv_prog_RANLIB" if test -n "$RANLIB"; then echo "$ac_t""$RANLIB" 1>&6 else echo "$ac_t""no" 1>&6 fi #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- echo $ac_n "checking for object suffix""... $ac_c" 1>&6 echo "configure:1397: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext if { (eval echo configure:1403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; esac done else { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } fi rm -f conftest* fi echo "$ac_t""$ac_cv_objext" 1>&6 OBJEXT=$ac_cv_objext ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 echo "configure:1423: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$CYGWIN" = yes || test "$MINGW32" = yes; then ac_cv_exeext=.exe else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= if { (eval echo configure:1433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done else { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } fi rm -f conftest* test x"${ac_cv_exeext}" = x && ac_cv_exeext=no fi fi EXEEXT="" test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} echo "$ac_t""${ac_cv_exeext}" 1>&6 ac_exeext=$EXEEXT #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- echo $ac_n "checking for Tcl public headers""... $ac_c" 1>&6 echo "configure:1466: checking for Tcl public headers" >&5 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" with_tclinclude=${withval} fi if eval "test \"`echo '$''{'ac_cv_c_tclh'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else { echo "configure: error: ${with_tclinclude} directory does not contain tcl.h" 1>&2; exit 1; } fi else # Check order: pkg --prefix location, Tcl's --prefix location, # directory of tclConfig.sh, and Tcl source directory. # Looking in the source dir is not ideal, but OK. eval "temp_includedir=${includedir}" list="`ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then { echo "configure: error: tcl.h not found. Please specify its location with --with-tclinclude" 1>&2; exit 1; } else echo "$ac_t""${ac_cv_c_tclh}" 1>&6 fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" #TEA_PRIVATE_TCL_HEADERS #TEA_PUBLIC_TK_HEADERS #TEA_PRIVATE_TK_HEADERS #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. See sha1.h on how # to use this. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # Define any extra compiler flags in the PACKAGE_CFLAGS variable. # These will be appended to the current set of compiler flags for # your system. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then cat >> confdefs.h <<\EOF #define BUILD_tdom 1 EOF CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" EXTRA_SOURCES='$(WIN_SOURCES)' VERSION=${MAJOR_VERSION}${MINOR_VERSION}${PATCHLEVEL} else CLEANFILES="pkgIndex.tcl" EXTRA_SOURCES='$(UNIX_SOURCES)' VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCHLEVEL} fi #-------------------------------------------------------------------- # We put this here so that you can compile with -DVERSION="1.2" to # encode the package version directly into the source files. #-------------------------------------------------------------------- eval cat >> confdefs.h <> confdefs.h <<\EOF #define USE_THREAD_ALLOC 1 EOF cat >> confdefs.h <<\EOF #define _REENTRANT 1 EOF cat >> confdefs.h <<\EOF #define _THREAD_SAFE 1 EOF echo $ac_n "checking for pthread_mutex_init in -lpthread""... $ac_c" 1>&6 echo "configure:1628: checking for pthread_mutex_init in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 tcl_ok=yes else echo "$ac_t""no" 1>&6 tcl_ok=no fi if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the # same library, as some systems hide it there until # pthread.h is defined. We could alternatively do an # AC_TRY_COMPILE with pthread.h, but that will work with # libpthread really doesn't exist, like AIX 4.2. # [Bug: 4359] echo $ac_n "checking for __pthread_mutex_init in -lpthread""... $ac_c" 1>&6 echo "configure:1676: checking for __pthread_mutex_init in -lpthread" >&5 ac_lib_var=`echo pthread'_'__pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 tcl_ok=yes else echo "$ac_t""no" 1>&6 tcl_ok=no fi fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else echo $ac_n "checking for pthread_mutex_init in -lpthreads""... $ac_c" 1>&6 echo "configure:1723: checking for pthread_mutex_init in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 tcl_ok=yes else echo "$ac_t""no" 1>&6 tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else echo $ac_n "checking for pthread_mutex_init in -lc""... $ac_c" 1>&6 echo "configure:1768: checking for pthread_mutex_init in -lc" >&5 ac_lib_var=`echo c'_'pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 tcl_ok=yes else echo "$ac_t""no" 1>&6 tcl_ok=no fi if test "$tcl_ok" = "no"; then echo $ac_n "checking for pthread_mutex_init in -lc_r""... $ac_c" 1>&6 echo "configure:1810: checking for pthread_mutex_init in -lc_r" >&5 ac_lib_var=`echo c_r'_'pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 tcl_ok=yes else echo "$ac_t""no" 1>&6 tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 echo "configure: warning: "Don t know how to find pthread lib on your system - thread support disabled"" 1>&2 fi fi fi fi # Does the pthread-implementation provide # 'pthread_attr_setstacksize' ? for ac_func in pthread_attr_setstacksize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:1866: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:1894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output echo $ac_n "checking for building with threads""... $ac_c" 1>&6 echo "configure:1924: checking for building with threads" >&5 if test "${TCL_THREADS}" = "1"; then cat >> confdefs.h <<\EOF #define TCL_THREADS 1 EOF echo "$ac_t""yes" 1>&6 else echo "$ac_t""no (default)" 1>&6 fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then echo "configure: warning: Building ${PACKAGE} without threads enabled, but building against a Tcl that IS thread-enabled." 1>&2 fi ;; *) if test "${TCL_THREADS}" = "1"; then echo "configure: warning: --enable-threads requested, but attempting building against a Tcl that is NOT thread-enabled." 1>&2 fi ;; esac #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- echo $ac_n "checking how to build libraries""... $ac_c" 1>&6 echo "configure:1962: checking how to build libraries" >&5 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then echo "$ac_t""shared" 1>&6 SHARED_BUILD=1 else echo "$ac_t""static" 1>&6 SHARED_BUILD=0 cat >> confdefs.h <<\EOF #define STATIC_BUILD 1 EOF fi #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:1999: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 if test x"${TEA_INITED}" = x ; then # Can't refer to exact macro name or it will be substituted { echo "configure: error: Must call TEA INIT before CONFIG_CFLAGS" 1>&2; exit 1; } fi # Step 0: Enable 64 bit support? echo $ac_n "checking if 64bit support is enabled""... $ac_c" 1>&6 echo "configure:2087: checking if 64bit support is enabled" >&5 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" do64bit=$enableval else do64bit=no fi echo "$ac_t""$do64bit" 1>&6 # Step 0.b: Enable Solaris 64 bit VIS support? echo $ac_n "checking if 64bit Sparc VIS support is requested""... $ac_c" 1>&6 echo "configure:2101: checking if 64bit Sparc VIS support is requested" >&5 # Check whether --enable-64bit-vis or --disable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then enableval="$enable_64bit_vis" do64bitVIS=$enableval else do64bitVIS=no fi echo "$ac_t""$do64bitVIS" 1>&6 if test "$do64bitVIS" = "yes"; then # Force 64bit on with VIS do64bit=yes fi # Step 1: set the variable "system" to hold the name and version number # for the system. This can usually be done via the "uname" command, but # there are a few systems, like Next, where this doesn't work. echo $ac_n "checking system version (for dynamic loading)""... $ac_c" 1>&6 echo "configure:2122: checking system version (for dynamic loading)" >&5 if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then echo "$ac_t""unknown (can't find uname command)" 1>&6 system=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then system=MP-RAS-`awk '{print }' /etc/.relid'` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi if test "${TEA_PLATFORM}" = "windows" ; then system=windows fi echo "$ac_t""$system" 1>&6 fi fi # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo "configure:2151: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 have_dl=yes else echo "$ac_t""no" 1>&6 have_dl=no fi # Step 3: set configuration options based on system name and version. do64bit_ok=no EXTRA_CFLAGS="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`' ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O if test "$GCC" = "yes" ; then CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int" else CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2214: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_AR="ar" break fi done IFS="$ac_save_ifs" fi fi AR="$ac_cv_prog_AR" if test -n "$AR"; then echo "$ac_t""$AR" 1>&6 else echo "$ac_t""no" 1>&6 fi STLIB_LD='${AR} cr' case $system in windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. if test "$do64bit" = "yes" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft SDK" fi # In order to work in the tortured autoconf environment, # we need to ensure that this path has no spaces MSSDK=`cygpath -w -s "$MSSDK" | sed -e 's!\\\!/!g'` if test ! -d "${MSSDK}/bin/win64" ; then echo "configure: warning: "could not find 64-bit SDK to enable 64bit mode"" 1>&2 do64bit="no" else do64bit_ok="yes" fi fi if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" = "yes" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs export CC="${MSSDK}/Bin/Win64/cl.exe \ -I${MSSDK}/Include/prerelease -I${MSSDK}/Include/Win64/crt \ -I${MSSDK}/Include" export RC="${MSSDK}/bin/rc.exe" export lflags="-MACHINE:IA64 -LIBPATH:${MSSDK}/Lib/IA64 \ -LIBPATH:${MSSDK}/Lib/Prerelease/IA64" export STLIB_LD="${MSSDK}/bin/win64/lib.exe -nologo ${lflags}" export LINKBIN="${MSSDK}/bin/win64/link.exe ${lflags}" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -Gs -W2 ${runtime}" else RC="rc" STLIB_LD="lib -nologo" LINKBIN="link -link50compat" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -Gs -GD -W2 ${runtime}" fi if test "$MINGW32" = "yes"; then # mingw gcc mode CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2" SHLIB_LD="gcc -shared" STLIB_LD='${AR} cr' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" else SHLIB_LD="${LINKBIN} -dll -nologo" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.lib' EXTRA_CFLAGS="-YX" # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # This essentially turns it all on. LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" LDFLAGS_OPTIMIZE="-release" LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" PATHTYPE=-w fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.dll' TCL_LIB_VERSIONS_OK=nodots # Bogus to avoid getting this turned off DL_OBJS="tclLoadNone.obj" ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used if test "${CC}" != "cc_r" ; then CC=${CC}_r fi echo "$ac_t""Using $CC for compiling with threads" 1>&6 fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" SHLIB_LD_LIBS='${LIBS}' if test "`uname -m`" = "ia64" ; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = "yes" ; then LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi else SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" DL_LIBS="-ldl" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' fi DL_OBJS="tclLoadDl.o" LDFLAGS="" # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then LIBOBJS="$LIBOBJS tclLoadAix.o" DL_LIBS="-lld" fi # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6 echo "configure:2368: checking for gettimeofday in -lbsd" >&5 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 libbsd=yes else echo "$ac_t""no" 1>&6 libbsd=no fi if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" cat >> confdefs.h <<\EOF #define USE_DELTA_FOR_TZ 1 EOF fi # Check to enable 64-bit flags for compiler/linker on AIX 5+ if test "$do64bit" = "yes" -a "`uname -v`" -gt "4" ; then if test "$GCC" = "yes" ; then echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2 else do64bit_ok=yes EXTRA_CFLAGS="-q64" LDFLAGS="-q64" fi fi ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD="cc -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="-export-dynamic" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible cat >> confdefs.h <<\EOF #define _XOPEN_SOURCE_EXTENDED 1 EOF SHLIB_SUFFIX=".sl" echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 echo "configure:2466: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 tcl_ok=yes else echo "$ac_t""no" 1>&6 tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="-Wl,-E" LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2 else do64bit_ok=yes EXTRA_CFLAGS="+DA2.0W" LDFLAGS="+DA2.0W $LDFLAGS" fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 echo "configure:2530: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 tcl_ok=yes else echo "$ac_t""no" 1>&6 tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="-Wl,-E" LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi ;; IRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="-Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' EXTRA_CFLAGS="" LDFLAGS="" ;; IRIX-6.*|IRIX64-6.5*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then EXTRA_CFLAGS="-mabi=n32" LDFLAGS="-mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. EXTRA_CFLAGS="-n32 -D_OLD_TERMIOS" ;; *) EXTRA_CFLAGS="-n32" ;; esac LDFLAGS="-n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" if test "$have_dl" = yes; then SHLIB_LD="${CC} -shared" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="-rdynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' else ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld.h""... $ac_c" 1>&6 echo "configure:2656: checking for dld.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2666: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 SHLIB_LD="ld -shared" DL_OBJS="tclLoadDld.o" DL_LIBS="-ldld" LDFLAGS="" LD_SEARCH_FLAGS="" else echo "$ac_t""no" 1>&6 fi fi if test "`uname -m`" = "alpha" ; then EXTRA_CFLAGS="-mieee" fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The # -fno-builtin flag should address this problem # but it does not work. The -fno-inline flag # is kind of overkill but it works. # Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${LIBOBJS}" != x ; then EXTRA_CFLAGS="${EXTRA_CFLAGS} -fno-inline" fi ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" if test "$have_dl" = yes; then SHLIB_LD="${CC} -shared" DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="-rdynamic" LD_SEARCH_FLAGS="" else ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld.h""... $ac_c" 1>&6 echo "configure:2723: checking for dld.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 SHLIB_LD="ld -shared" DL_OBJS="" DL_LIBS="-ldld" LDFLAGS="" LD_SEARCH_FLAGS="" else echo "$ac_t""no" 1>&6 fi fi if test "`uname -m`" = "alpha" ; then EXTRA_CFLAGS="-mieee" fi ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="-Wl,-Bexport" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[1-2].*|OpenBSD-*) # Not available on all versions: check for include file. ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 echo "configure:2788: checking for dlfcn.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' echo $ac_n "checking for ELF""... $ac_c" 1>&6 echo "configure:2825: checking for ELF" >&5 cat > conftest.$ac_ext <&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* echo "$ac_t""yes" 1>&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' else rm -rf conftest* echo "$ac_t""no" 1>&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' fi rm -f conftest* else echo "$ac_t""no" 1>&6 SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' fi # FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; FreeBSD-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="-export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "${TCL_THREADS}" = "1" ; then EXTRA_CFLAGS="-pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Rhapsody-*|Darwin-*) SHLIB_CFLAGS="-fno-common" SHLIB_LD="cc -dynamiclib \${LDFLAGS}" TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_MAJOR_VERSION} -current_version \${VERSION} -install_name \${LIB_RUNTIME_DIR}/\${TCL_LIB_FILE} -prebind -seg1addr a000000" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" LDFLAGS="-prebind" LD_SEARCH_FLAGS="" CFLAGS_OPTIMIZE="-O3" EXTRA_CFLAGS="-arch ppc -pipe" ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD="cc -nostdlib -r" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy cat >> confdefs.h <<\EOF #define _OE_SOCKETS 1 EOF # needed in sys/socket.h ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export :' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -shared" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" SHLIB_LD='ld -shared -expect_unresolved "*"' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "$GCC" != "yes" ; then EXTRA_CFLAGS="-DHAVE_TZSET -std1" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = "1" ; then EXTRA_CFLAGS="${EXTRA_CFLAGS} -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" EXTRA_CFLAGS="${EXTRA_CFLAGS} -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = "yes" ; then LIBS="$LIBS -lpthread -lmach -lexc" else EXTRA_CFLAGS="${EXTRA_CFLAGS} -pthread" LDFLAGS="-pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" ;; RISCos-*) SHLIB_CFLAGS="-G 0" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="-Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="-melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="-belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[0-6]*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >> confdefs.h <<\EOF #define _REENTRANT 1 EOF cat >> confdefs.h <<\EOF #define _POSIX_PTHREAD_SEMANTICS 1 EOF SHLIB_CFLAGS="-KPIC" SHLIB_LD="/usr/ccs/bin/ld -G -z text" # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" if test "$GCC" = "yes" ; then LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >> confdefs.h <<\EOF #define _REENTRANT 1 EOF cat >> confdefs.h <<\EOF #define _POSIX_PTHREAD_SEMANTICS 1 EOF SHLIB_CFLAGS="-KPIC" SHLIB_LD="/usr/ccs/bin/ld -G -z text" LDFLAGS="" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2 else do64bit_ok=yes if test "$do64bitVIS" = "yes" ; then EXTRA_CFLAGS="-xarch=v9a" LDFLAGS="-xarch=v9a" else EXTRA_CFLAGS="-xarch=v9" LDFLAGS="-xarch=v9" fi fi else echo "configure: warning: "64bit mode only supported sparcv9 system"" 1>&2 fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="-Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' if test "$GCC" != "yes" ; then EXTRA_CFLAGS="-DHAVE_TZSET -std1" fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. hold_ldflags=$LDFLAGS echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6 echo "configure:3150: checking for ld accepts -Bexport flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-Bexport" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* found=no fi rm -f conftest* LDFLAGS=$hold_ldflags echo "$ac_t""$found" 1>&6 if test $found = yes; then LDFLAGS="-Wl,-Bexport" else LDFLAGS="" fi LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then echo "configure: warning: "64bit support being disabled -- don\'t know magic for this platform"" 1>&2 fi # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop, # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need # to determine which of several header files defines the a.out file # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we # support only a file format that is more or less version-7-compatible. # In particular, # - a.out files must begin with `struct exec'. # - the N_TXTOFF on the `struct exec' must compute the seek address # of the text segment # - The `struct exec' must contain a_magic, a_text, a_data, a_bss # and a_entry fields. # The following compilation should succeed if and only if either sys/exec.h # or a.out.h is usable for the purpose. # # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the # `struct exec' includes a second header that contains information that # duplicates the v7 fields that are needed. if test "x$DL_OBJS" = "xtclLoadAout.o" ; then echo $ac_n "checking sys/exec.h""... $ac_c" 1>&6 echo "configure:3206: checking sys/exec.h" >&5 cat > conftest.$ac_ext < int main() { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } EOF if { (eval echo configure:3226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* tcl_ok=unusable fi rm -f conftest* echo "$ac_t""$tcl_ok" 1>&6 if test $tcl_ok = usable; then cat >> confdefs.h <<\EOF #define USE_SYS_EXEC_H 1 EOF else echo $ac_n "checking a.out.h""... $ac_c" 1>&6 echo "configure:3244: checking a.out.h" >&5 cat > conftest.$ac_ext < int main() { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } EOF if { (eval echo configure:3264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* tcl_ok=unusable fi rm -f conftest* echo "$ac_t""$tcl_ok" 1>&6 if test $tcl_ok = usable; then cat >> confdefs.h <<\EOF #define USE_A_OUT_H 1 EOF else echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6 echo "configure:3282: checking sys/exec_aout.h" >&5 cat > conftest.$ac_ext < int main() { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_midmag == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } EOF if { (eval echo configure:3302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* tcl_ok=unusable fi rm -f conftest* echo "$ac_t""$tcl_ok" 1>&6 if test $tcl_ok = usable; then cat >> confdefs.h <<\EOF #define USE_SYS_EXEC_AOUT_H 1 EOF else DL_OBJS="" fi fi fi fi # Step 5: disable dynamic loading if requested via a command-line switch. # Check whether --enable-load or --disable-load was given. if test "${enable_load+set}" = set; then enableval="$enable_load" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "no"; then DL_OBJS="" fi if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" echo "on this system." SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then if test "$GCC" = "yes" ; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; Rhapsody-*|Darwin-*) ;; RISCos-*) ;; SCO_SV-3.2*) ;; ULTRIX-4.*) ;; windows) if test "$MINGW32" != "yes"; then SHLIB_CFLAGS="-fPIC" fi ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' fi SHLIB_LDFLAGS='$(LDFLAGS_DEFAULT)' TDOM_LD_SEARCH_FLAGS=${LD_SEARCH_FLAGS} #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- if test x"${TEA_INITED}" = x ; then # Can't refer to exact macro name or it will be substituted { echo "configure: error: Must call TEA INIT before ENABLE_SYMBOLS" 1>&2; exit 1; } fi if test "${TEA_PLATFORM}" = "windows" ; then tcl_dbgx=d else tcl_dbgx=g fi echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 echo "configure:3431: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" tcl_ok=$enableval else tcl_ok=no fi if test "$tcl_ok" = "yes"; then CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' DBGX=${tcl_dbgx} TCL_DBGX=${tcl_dbgx} echo "$ac_t""yes" 1>&6 else CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' DBGX="" TCL_DBGX="" echo "$ac_t""no" 1>&6 fi if test "${SHARED_BUILD}" = "1" ; then CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' else CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}' fi #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- #AC_DEFINE(USE_TCL_STUBS) #AC_DEFINE(USE_TK_STUBS) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. # For tDOM we always build both, static and shared libraries #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(\$(PACKAGE)_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS} \$(LDFLAGS) -out:\$@ \$(\$(PACKAGE)_OBJECTS)" MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(\$(PACKAGE)stub_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(\$(PACKAGE)_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(\$(PACKAGE)_OBJECTS) \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(\$(PACKAGE)stub_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure the ${DBGX} in the suffix is # substituted. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" fi eval eval "${PACKAGE}_LIB_FILE=${PACKAGE}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "${PACKAGE}_LIB_FILE=${PACKAGE}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "${PACKAGE}stub_LIB_FILE=${PACKAGE}stub${UNSHARED_LIB_SUFFIX}" else if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" fi eval eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "${PACKAGE}stub_LIB_FILE=lib${PACKAGE}stub${UNSHARED_LIB_SUFFIX}" fi #-------------------------------------------------------------------- # __CHANGE__ # Add platform libs to LIBS or SHLIB_LD_LIBS as necessary. #-------------------------------------------------------------------- #LIBS="${LIBS} -lsuperfly" #-------------------------------------------------------------------- # Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl # file during the install process. Don't run the TCLSH_PROG through # ${CYGPATH} because it's being used directly by make. # Require that we use a tclsh shell version 8.2 or later since earlier # versions have bugs in the pkg_mkIndex routine. # Add WISH as well if this is a Tk extension. #-------------------------------------------------------------------- echo $ac_n "checking for tclsh""... $ac_c" 1>&6 echo "configure:3560: checking for tclsh" >&5 if eval "test \"`echo '$''{'ac_cv_path_tclsh'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else search_path=`echo ${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${exec_prefix}/bin:${prefix}/bin:${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/tclsh[8-9]*${EXEEXT} 2> /dev/null` \ `ls -r $dir/tclsh*${EXEEXT} 2> /dev/null` ; do if test x"$ac_cv_path_tclsh" = x ; then if test -f "$j" ; then ac_cv_path_tclsh=$j break fi fi done done fi if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG=$ac_cv_path_tclsh echo "$ac_t""$TCLSH_PROG" 1>&6 else { echo "configure: error: No tclsh found in PATH: $search_path" 1>&2; exit 1; } fi #TEA_PROG_WISH #-------------------------------------------------------------------- # Add some private include directories #-------------------------------------------------------------------- TDOM_INCLUDES="-I${srcdir}/generic -I${srcdir}/expat" #-------------------------------------------------------------------- # Add optional AOLserver includes #-------------------------------------------------------------------- echo $ac_n "checking for AOLserver configuration""... $ac_c" 1>&6 echo "configure:3605: checking for AOLserver configuration" >&5 # Check whether --with-aol or --without-aol was given. if test "${with_aol+set}" = set; then withval="$with_aol" \ with_aolserver=${withval} fi if eval "test \"`echo '$''{'ac_cv_c_aolserver'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test x"${with_aolserver}" != x ; then if test -f "${with_aolserver}/include/ns.h" ; then ac_cv_c_aolserver=`(cd ${with_aolserver}; pwd)` else { echo "configure: error: ${with_aolserver} directory doesn't contain ns.h" 1>&2; exit 1; } fi fi fi if test x"${ac_cv_c_aolserver}" = x ; then echo "$ac_t""none found" 1>&6 else AOL_DIR=${ac_cv_c_aolserver} echo "$ac_t""found AOLserver in $AOL_DIR" 1>&6 cat >> confdefs.h <<\EOF #define NS_AOLSERVER 1 EOF cat >> confdefs.h <<\EOF #define USE_NORMAL_ALLOCATOR 1 EOF fi if test x"${AOL_DIR}" != "x" ; then AOL_INCLUDES="-I${AOL_DIR}/include" else AOL_INCLUDES= fi #-------------------------------------------------------------------- # Add some private preprocessor options #-------------------------------------------------------------------- echo $ac_n "checking wether to enable dtd support""... $ac_c" 1>&6 echo "configure:3657: checking wether to enable dtd support" >&5 # Check whether --enable-dtd or --disable-dtd was given. if test "${enable_dtd+set}" = set; then enableval="$enable_dtd" tcl_ok=$enableval else tcl_ok=yes fi if test "${enable_dt+set}" = set; then enableval="$enable_dtd" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define XML_DTD 1 EOF else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking wether to enable namespace support""... $ac_c" 1>&6 echo "configure:3686: checking wether to enable namespace support" >&5 # Check whether --enable-ns or --disable-ns was given. if test "${enable_ns+set}" = set; then enableval="$enable_ns" tcl_ok=$enableval else tcl_ok=yes fi if test "${enable_ns+set}" = set; then enableval="$enable_ns" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define XML_NS 1 EOF else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking wether to enable built-in unknown command""... $ac_c" 1>&6 echo "configure:3715: checking wether to enable built-in unknown command" >&5 # Check whether --enable-ucmd or --disable-ucmd was given. if test "${enable_ucmd+set}" = set; then enableval="$enable_ucmd" tcl_ok=$enableval else tcl_ok=no fi if test "${enable_unknown+set}" = set; then enableval="$enable_unknown" tcl_ok=$enableval else tcl_ok=no fi if test "$tcl_ok" = "no" ; then echo "$ac_t""no" 1>&6 cat >> confdefs.h <<\EOF #define TDOM_NO_UNKNOWN_CMD 1 EOF else echo "$ac_t""yes" 1>&6 fi echo $ac_n "checking wether to enable tDOMs block allocator""... $ac_c" 1>&6 echo "configure:3744: checking wether to enable tDOMs block allocator" >&5 # Check whether --enable-tdomalloc or --disable-tdomalloc was given. if test "${enable_tdomalloc+set}" = set; then enableval="$enable_tdomalloc" tcl_ok=$enableval else tcl_ok=yes fi if test "${enable_tdomalloc+set}" = set; then enableval="$enable_tdomalloc" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 cat >> confdefs.h <<\EOF #define USE_NORMAL_ALLOCATOR 1 EOF fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 echo "configure:3772: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include int main() { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } EOF if { (eval echo configure:3790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include int main() { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } EOF if { (eval echo configure:3805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_bigendian=no fi rm -f conftest* else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* if test $ac_cv_c_bigendian = unknown; then if test "$cross_compiling" = yes; then echo $ac_n "cross-compiling... " 2>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_c_bigendian=yes fi rm -fr conftest* fi fi fi echo "$ac_t""$ac_cv_c_bigendian" 1>&6 if test $ac_cv_c_bigendian = unknown; then echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 echo "configure:3856: checking to probe for byte ordering" >&5 cat >conftest.c <&6 ac_cv_c_bigendian=yes fi if test `grep -l LiTTleEnDian conftest.o` ; then echo $ac_n ' little endian probe OK, ' 1>&6 if test $ac_cv_c_bigendian = yes ; then ac_cv_c_bigendian=unknown; else ac_cv_c_bigendian=no fi fi echo $ac_n 'guessing bigendian ... ' >&6 fi fi echo "$ac_t""$ac_cv_c_bigendian" 1>&6 fi if test $ac_cv_c_bigendian = yes; then cat >> confdefs.h <<\EOF #define WORDS_BIGENDIAN 1 EOF BYTEORDER=4321 else BYTEORDER=1234 fi if test $ac_cv_c_bigendian = unknown; then { echo "configure: error: unknown endianess - sorry" 1>&2; exit 1; } fi #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. cat > conftest.defs <<\EOF s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g s%\$%$$%g EOF DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` rm -f conftest.defs # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile tdomConfig.sh" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@CONFIGDIR@%$CONFIGDIR%g s%@PACKAGE@%$PACKAGE%g s%@TDOMSHELL@%$TDOMSHELL%g s%@MAJOR_VERSION@%$MAJOR_VERSION%g s%@MINOR_VERSION@%$MINOR_VERSION%g s%@PATCHLEVEL@%$PATCHLEVEL%g s%@tdom_LIB_FILE@%$tdom_LIB_FILE%g s%@tdomstub_LIB_FILE@%$tdomstub_LIB_FILE%g s%@CYGPATH@%$CYGPATH%g s%@EXEEXT@%$EXEEXT%g s%@TCL_VERSION@%$TCL_VERSION%g s%@TCL_BIN_DIR@%$TCL_BIN_DIR%g s%@TCL_SRC_DIR@%$TCL_SRC_DIR%g s%@TCL_LIB_FILE@%$TCL_LIB_FILE%g s%@TCL_LIB_FLAG@%$TCL_LIB_FLAG%g s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g s%@TCL_STUB_LIB_FILE@%$TCL_STUB_LIB_FILE%g s%@TCL_STUB_LIB_FLAG@%$TCL_STUB_LIB_FLAG%g s%@TCL_STUB_LIB_SPEC@%$TCL_STUB_LIB_SPEC%g s%@TCL_LIBS@%$TCL_LIBS%g s%@TCL_DEFS@%$TCL_DEFS%g s%@TCL_EXTRA_CFLAGS@%$TCL_EXTRA_CFLAGS%g s%@TCL_LD_FLAGS@%$TCL_LD_FLAGS%g s%@TCL_SHLIB_LD_LIBS@%$TCL_SHLIB_LD_LIBS%g s%@CC@%$CC%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@SET_MAKE@%$SET_MAKE%g s%@RANLIB@%$RANLIB%g s%@OBJEXT@%$OBJEXT%g s%@TCL_INCLUDES@%$TCL_INCLUDES%g s%@CLEANFILES@%$CLEANFILES%g s%@EXTRA_SOURCES@%$EXTRA_SOURCES%g s%@VERSION@%$VERSION%g s%@tdomstub_BUILD_SPEC@%$tdomstub_BUILD_SPEC%g s%@tdomstub_FILE_SPEC@%$tdomstub_FILE_SPEC%g s%@tdom_SRC_DIR@%$tdom_SRC_DIR%g s%@TCL_THREADS@%$TCL_THREADS%g s%@AR@%$AR%g s%@CPP@%$CPP%g s%@DL_LIBS@%$DL_LIBS%g s%@CFLAGS_DEBUG@%$CFLAGS_DEBUG%g s%@CFLAGS_OPTIMIZE@%$CFLAGS_OPTIMIZE%g s%@CFLAGS_WARNING@%$CFLAGS_WARNING%g s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g s%@STLIB_LD@%$STLIB_LD%g s%@SHLIB_LD@%$SHLIB_LD%g s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g s%@SHLIB_LDFLAGS@%$SHLIB_LDFLAGS%g s%@SHLIB_LD_LIBS@%$SHLIB_LD_LIBS%g s%@LDFLAGS_DEBUG@%$LDFLAGS_DEBUG%g s%@LDFLAGS_OPTIMIZE@%$LDFLAGS_OPTIMIZE%g s%@TDOM_LD_SEARCH_FLAGS@%$TDOM_LD_SEARCH_FLAGS%g s%@TCL_DBGX@%$TCL_DBGX%g s%@CFLAGS_DEFAULT@%$CFLAGS_DEFAULT%g s%@LDFLAGS_DEFAULT@%$LDFLAGS_DEFAULT%g s%@SHARED_BUILD@%$SHARED_BUILD%g s%@MAKE_LIB@%$MAKE_LIB%g s%@MAKE_SHARED_LIB@%$MAKE_SHARED_LIB%g s%@MAKE_STATIC_LIB@%$MAKE_STATIC_LIB%g s%@MAKE_STUB_LIB@%$MAKE_STUB_LIB%g s%@TCLSH_PROG@%$TCLSH_PROG%g s%@TDOM_INCLUDES@%$TDOM_INCLUDES%g s%@AOL_DIR@%$AOL_DIR%g s%@AOL_INCLUDES@%$AOL_INCLUDES%g s%@BYTEORDER@%$BYTEORDER%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 tDOM-0.8.3/CHANGES0000644000175000017500000001636410660665343013575 0ustar ssobernissoberni --- Release 0.8.2, 15. Aug. 2007 --- See ChangeLog for details --- 2007-08-11 Rolf Ade Now tcldomsh will source ~/.tcldomshrc at start up. 2007-08-05 Rolf Ade In case of asXML with indentation: indent XML comments as well. Added method deleteXPathCache: basic control over the xpath expression cache. Variable references in XPath queries (at the places allowed by the XPath syntax) will now be resoved as Tcl variables, relative to the scope of the expression. Ignoring the XPath syntax rules at this point, any valid Tcl variable name will work. 2007-07-31 Rolf Ade Update to expat 2.0.1. 2007-07-27 Rolf Ade Updated to TEA 3.6. 2007-07-25 Rolf Ade Fix for the -externalentitycommand problems on (some) 64-bit plattforms. 2006-11-22 Rolf Ade Normalize case of attribute also (not only elements). 2006-08-26 Rolf Ade Updated the TEA build system to 3.5, to fix build problems with newer bash shells. 2005-03-18 Rolf Ade Added the 'selectNodesNamespace' to documents, to provide a global XPath prefix / namespace mapping. See the user documentation for details. 2005-01-07 Rolf Ade Improved VC++ compiler makefile. Thanks to Pat Thoyts for contribution. 2005-01-06 Rolf Ade Added the methods 'transform' and 'delete' to xsltCmds. 2004-09-21 Rolf Ade Added the '-namespaces' option to the selectNodes method. Not resolved namespace prefixes within the xpath expression now raises an error. *** POTENTIAL INCOMPATIBILITY *** 2004-08-20 Rolf Ade Update to expat 1.95.8. 2004-08-19 Rolf Ade Made tDOM work out of the box on 64-bit systems like Itanium 2 (again) (though --disable-tdomalloc configure option at build time is still needed). --- Release 0.8.0, 11. Aug. 2004 --- See ChangeLog for details --- 2004-07-27 Rolf Ade New method createDocumentNode. Added methods nodeType, getElementById, firstChild, lastChild, appendChild, removeChild, hasChildNodes, childNodes, ownerDocument, insertBefore, replaceChild, appendFromList, appendXML, selectNodes, baseURI, appendFromScript and insertBeforeFromScript to dom docs. Beside other things, this allows much easier handling of top level nodes. The result tree may not be an XML document, but a general parsed entity. New (experimental) method setObjectCommands. 2004-05-26 Rolf Ade Added isPIName, isComment, isCDATA and isPIValue method to the dom command. Created new global (thread wide) flags for name and value checks (Names and FQ Names (element, attribute and processing instruction names), text nodes, comments, CDATA sections and processing instruction values). New methods setNameCheck and setTextCheck to control this flags. 2003-12-17 Rolf Ade Added baseURI method, which returns the current base URI and has an optional argument to set the base URI. (The getBaseURI is deprecated.) 2003-12-11 Rolf Ade Bug fix: Don't quash white space of non white space only content in trim mode. 2003-11-24 Rolf Ade Added domDoc methods omit-xml-declaration, indent, standalone, encoding and mediaType. 2003-10-23 Rolf Ade Update to expat 1.95.7. 2003-10-10 Rolf Ade Added method normalize to domNode and domDoc commands. 2003-10-07 Rolf Ade Added method insertBeforeFromScript to domNode commands. 2003-10-04 Rolf Ade Added method asText to domDoc and domNode commands. 2003-09-22 Rolf Ade Enhanced insertBefore method: If the refNode argument of that method is the empty string, the newNode argument will be inserted at the end of the list of children of the node. 2003-09-17 Rolf Ade Added the up to now missing implementation of expatObj method cget. Thanks goes to Harry Moreau for his contribution. 2003-04-09 Rolf Ade Added domDoc method toXSLTcmd, which converts the domDoc to an XSLTcmd. This has no advantage over the current method in one-shot cases (transformation of one XML document) but improves the speed of batch processing of several XML documents or server applications. The implementation was already included in the 0.7.7 release, only the documentation was not included in that release. Added option -paramentityparsing to the dom parse method. --- Release 0.7.7, 25. Mar. 2003 --- See ChangeLog for details --- --- Release 0.7.6, 24. Mar. 2003 --- See ChangeLog for details --- 2003-03-19 Rolf Ade Added option -useForeignDTD to dom parse and expat. Added domNode method 'precedes', to compare the relative order of two nodes out of the same document. 2003-02-22 Rolf Ade Added posteriori (DOM) validation capabilities. See the tnc man page for details. 2003-02-09 Rolf Ade Update to expat 1.95.6. 2003-02-09 Rolf Ade Added 'systemId' and 'publicId' methods to the domDoc commands. Added flag -doctypeDeclaration to the asXML and asHTML methods of the domDoc commands. 2003-01-29 Rolf Ade Changed the escaping while serializing XML data: in the past """ and "'" was escaped, now it isn't anymore. There isn't a clear rule (to the best of my knowledge) in any of the related specs about this, but now we do things almost along the lines, as saxon (which I regard as the currently most 'rule-setting' xslt processor) does it. In theory (from an XML viewpoint) this should not make a difference, but if somebody postprocess some tDOM output with other tools, there is a small risk, that things (slightly) breaks, therefor: *** POTENTIAL INCOMPATIBILITY *** 2002-12-28 Rolf Ade The xslt method now understands also the options -ignoreUndeclaredParameters and -xsltmessagecmd. --- Release 0.7.5, 27. Nov. 2002 --- See ChangeLog for details --- 2002-10-01 Zoran Vasiljevic The library file lib/tdomhtml.tcl is now moved to a separate package in "extensions" directory. This is a simple, yet very "clever" HTML generator, using advanced tdom HTML capabilities. To use, please change to "extensions/tdomhtml" directory and invoke "configure" followed by "make", followed by "make install". Be sure, however, to build and install the tdom package first. -EOF- tDOM-0.8.3/ChangeLog0000644000175000017500000025604710763334500014350 0ustar ssobernissoberni2008-03-04 Rolf Ade * generic/tclexpat.c: Editorial changes. * generic/domhtml.c: * generic/domxslt.c: Added a few casts, to pacify picky compliers. 2007-12-26 Rolf Ade * generic/dom.c * generic/tcldom.c: Fixed a memory leak in case of --enable-threads. 2007-10-30 Rolf Ade * generic/domhtml.c: * tests/htmlreader.test: ID Attributes in HTML documents parsed with -html do now what you expect: you find it with getElementById. 2007-10-29 Rolf Ade * doc/domNode.* * doc/domDoc.*: Fixed documentation error in the documentation of the replaceChild method. 2007-10-08 Rolf Ade * generic/domhtml.c * tests/htmlreader.test: Fixed handling of attributes without value. Now, an attribute without value gets the attribute name as value. 2007-10-04 Rolf Ade * tests/domDoc.test: Fixed test domDoc-1.2: Test was broken in case of locale != ISO-8859-1 (or -15). 2007-10-03 Rolf Ade * win/makefile.vc: makefile.vc generated a pkgIndex.tcl file, that didn't work in case of spaces in the install path. Thanks to Koen Danckaert. 2007-09-28 Rolf Ade * tests/all-bench.tcl * tests/domNode.bench * tests/xpath.bench: Added this files: Start of a benchmark suite. 2007-09-25 Rolf Ade * win/makefile.vc * win/nmakehlp.c * win/rules.vc * win/tdom.rc: Updated. (Thanks to Pat Thoyts.) * tdom.m4 * extensions/tnc/configure: Fixes tnc building against uninstalled tdom. (Thanks to Daniel A. Steffen.) 2007-08-23 Rolf Ade * generic/domxpath.c * tests/dom.test * tests/xmlsimple.test * tests/xpath.test * tests/xslt.test: Fixed bug triggered by invalid XSLT XPath pattern (normal XPath expr (via selectNodes) wasn't infected). Checked the code for similar spots and fixed a few. Replaced a fprintf(stderr, ..) called in an 'impossible' case with a more appropriate domPanic call. 2007-08-18 Rolf Ade * generic/domxslt.c: Code cleanup in document() implementation. * generic/dom.c * generic/dom.h * generic/domxslt.c * generic/tcldom.c: More constification and clean up. * generic/dom.c * generic/dom.h * generic/domalloc.c * generic/domxpath.c * generic/domxpath.h * generic/domxslt.c * generic/tcldom.c * generic/xmlsimple.c: Big const ification. 2007-08-15 Rolf Ade * configure * configure.in * unix/CONFIG * tdom.m4: New default build: --disable-tdomalloc. * CHANGES: Updated. * README * README.AOL * configure * configure-tcl8.0.5 * configure.in * tests/loadtdom.tcl * mac/Prefix/tDOMPrefix.h * mac/Prefix/tDOMPrefix_OSX.h * win/makefile.vc * win/makefile805.vc: * win/pkgIndex.tcl: Bumped version to 0.8.3. --- Release 0.8.2, 14. Aug. 2007 --- 2007-08-13 Rolf Ade * win/pkgIndex.tcl: Bumped version to 0.8.2 2007-08-12 Rolf Ade * generic/tcldom.c: Corrected a typo in the doc cmd usage message. Updated the asXML related parts of the doc and node cmd usage msg. Corrected a typo in the error msg in case of wrong # of args to asXML. * generic/tdomStubLib.c: Ensure that the new code build also with tcl8.0.x (although that old versions doesn't have extension stubs tables.) * extensions/tnc/configure * extensions/tnc/configure.in * extensions/tnc/tnc.c: Tweaks to build tnc with win/msys/mingw. * tdom.m4: Removed irritating breaks in TDOM_PATH_CONFIG. * unix/tclAppInit.c: Editorial fix. * generic/tdomStubLib.c: Rewritten from the scratch. 2007-08-11 Rolf Ade * generic/domxslt.c: Code cosmetic. * generic/tcldom.c: Updated error msg in case of wrong # of args to the asXML method to the new added option -escapeAllQuot. * generic/tdom.h * generic/tclexpat.h: Fixed build problem with the build environment win/msys/mingw. * generic/aolstub.cpp: Fixed editorial mistake in comment. * unix/tclAppInit.c: Rewritten from the scratch. New feature: tcldomsh will read ~/.tcldomshrc at start up. 2007-08-07 Rolf Ade * generic/dom.h: Another change needed, to complete the new type of domDoc->documentNumber. 2007-08-07 Rolf Ade * generic/dom.c: Type gymnastic for 64 bit systems. * generic/dom.c * generic/dom.h * generic/tcldom.c: Changed domDoc->documentNumber, domUniqueNodeNr and domUniqueDocNr to unsigned long, to prevent hard to debug / reproduce problems on 64 bit systems. * win/makefile.vc: Don't use precompiled headers. * extensions/tnc/makefile.vc: Brought in sync with tdom core. * generic/tclexpat.c: Compiler pacifying. * generic/tdomDecls.h: Fixed a wrong function signature. * generic/tdomStubLib.c: Made the compiler happy. * generic/dom.c: Corrected an error msg. * generic/tclexpat.c: Still problems on 64bit w/ -externalentitycommand. This health the biggest pain. 2007-08-05 Rolf Ade * win/makefile.vc * win/makefile805.vc: Bumped version to 0.8.2. Missed that in 0.8.2rc1 * README * README.AOL * configure * configure-tcl8.0.5 * configure.in * tests/loadtdom.tcl * mac/Prefix/tDOMPrefix.h * mac/Prefix/tDOMPrefix_OSX.h: Bumped version to 0.8.2. * generic/domhtml.c * generic/domxpath.c * generic/domxslt.c * generic/tcldom.c * generic/xmlsimple.c: Casted arg of ctype.h is* macros/function calles to unsigned char to reduce compiler warning noise. * generic/tcldom.c: * tests/domDoc.test: In case of asXML with indentation: indent XML comments as well. * doc/domNode.* * doc/domDoc.*: Added documentation to the new variable references feature of the selectNodes method, for the deleteXPathCache method and the -escapeAllQuot option of the asXML method. * generic/tcldom.c: Fixed a mem leak introduced by deleteXPathCache. Added option -escapeAllQuot to the asXML method. * generic/tcldom.c * tests/domDoc.test: Added method deleteXPathCache: basic control over the xpath expression cache. * generic/tcldom.c * generic/domxpath.c * generic/domxpath.h * generic/domxslt.c * tests/xpath.test: Variable references (at the places allowed by the XPath syntax) will now be resoved as Tcl variables, relative to the scope of the expression. Ignoring the XPath syntax rules at this point, any valid Tcl variable name will work. 2007-08-03 Rolf Ade * generic/tcldom.c: Added doc method renameNode, without XML namespace awareness. There will be a final (XML namespace aware) method implementation after 0.8.2, therefore, this will slip in as hidden or 'unsupported' and at least undocumented method. 2007-07-31 Rolf Ade * generic/domxpath.c * tests/xpath.test: Bug fix: floats in xpath expressions starting with . could have an additional (erroneous) dot in it without detection. * expat/* * extensions/tnc/tnc.c * generic/dom.c * generic/domxslt.c * generic/tcldom.c * generic/tclexpat.c * generic/tdom.decls * generic/tdom.h * generic/tdomDecls.h: Update to expat 2.0.1; minor build cosmetic. 2007-07-27 Rolf Ade * tclconfig/tcl.m4 * tclconfig/README.txt * configure.in * configure * extensions/tnc/configure.in * extensions/tnc/configure: Updated to TEA 3.6. Rebuild configure. 2007-07-25 Rolf Ade * generic/dom.c: Fix for the -externalentitycommand problems on (some) 64-bit plattforms. * tests/xpath.test: Added a few tests related to white-space in XPath expressions. 2007-07-23 Rolf Ade * generic/domhtml.c * tests/htmlreader.test: Fix for problem reported by http://tech.groups.yahoo.com/group/tdom/message/1666 2007-04-18 Rolf Ade * doc/domDoc.*: Emendation. 2007-03-03 Rolf Ade * Makefile.in: Fixed (at least for most of the cases) bug in test target, in case the user builds in a dir elsewhere. 2007-02-04 Rolf Ade * tdom.m4 * configure * extensions/tnc/configure * README * unix/CONFIG: Modified the tdom.m4 configure macros to use the current documentation style of TEA in case of configure --help. Fixed a bug in the TDOM_ENABLE_DTD. Re-generated configure and tnc configure. Added some explanations about the tDOM specific configure options to unix/CONFIG and a pointer to that information to README. * extensions/tnc/tnc.c: Minor editorial changes. * extensions/tnc/test.tcl: Fixed the loading of the tDOM scripted library in case of run with tcldomsh. * generic/domxslt.c: Fixed bug in xsl:fallback handling. 2007-02-02 Rolf Ade * tdom.m4 * configure: Corrected spelling error in tdom.m4, re-generated configure. Thanks to Larry Virden for reporting. 2007-01-16 Rolf Ade * extensions/tnc/configure.in: The build tool combination TEA/cygwin/VC++ needs a crude hack. 2007-01-10 Rolf Ade * Makefile.in: More corrections: Did not install the tDOM stubs library. Minor other corrections related to distclean. Again thanks to Andreas Kupries. * extensions/tnc/Makefile.in: Don't call target install-doc while installing - the tnc doc is in the top level doc dir. * extensions/tnc/pkgIndex.tcl.in: Fixed the name of the shared lib. Now uses @PKG_LIB_FILE@ for the dll name. 2007-01-09 Rolf Ade * Makefile.in: Did not install tdomConfig.sh anymore, which causes trouble building tDOM extensions (including tnc). Thanks to Andreas Kupries for reporting the problem with analysis. 2007-01-05 Rolf Ade * generic/domxpath.c: In XPath expressions: Whitespace between the abbreviated attribute axis specifier @ and the attribute name is allowed. 2006-11-22 Rolf Ade * generic/domhtml.c: Normalize case of attribute also (not only elements). Accept space on both sides of the = of attribute values. 2006-11-08 Rolf Ade * generic/domxpath.c * tests/xpath.test: Fixed seg fault in XPath expr parser for a certain kind of erroneous XPath expressions. 2006-08-26 Rolf Ade * CHANGES * configure.in * Makefile.in * configure * tclconfig/README.txt * tclconfig/tcl.m4 * extensions/tnc/configure.in * extensions/tnc/configure * extensions/tnc/Makefile.in: Updated the TEA build system to 3.5. 2006-05-24 Rolf Ade * generic/dom.c * tests/dom.test: Fix of the isQName method: Strings with valid prefix and non-NCNameStart char as first char after the ':' wasn't detected as invalid QName. 2006-01-08 Rolf Ade * generic/domxslt.c * tests/xslt.test: Fixed a rounding bug of format-number() (http://groups.yahoo.com/group/tdom/message/1217). 2006-01-06 Rolf Ade * doc/domDoc.*: Fixed markup errors. 2005-12-10 Rolf Ade * generic/dom.c * generic/dom.h * generic/domxslt.c * tests/xslt.test: Fixed bug in namespace handling in xsl:copy-of. 2005-12-03 Rolf Ade * generic/dom.c * tests/domNode.test: Fix of the cloneNode method: if the node to clone (or, in case of -deep, a node within the subtree to clone) had a namespace declaration attribute then the result was wrong. * tests/domDoc.test: Added a test for the special handling of the content of script/style tags in case of asHTML. 2005-10-19 Rolf Ade * generic/domxpath.c * generic/domxpath.h * tests/xpath.test: Fixed string-length() and substring() to work on chars, as they should, not on bytes. 2005-09-27 Rolf Ade * tests/htmlreader.test: Added a test case, reported by Richard Suchenwirth, which crashes 0.8.0, but raises error with current cvs head, without any mem problems. 2005-09-24 Rolf Ade * generic/domxslt.c: Doh! The code detected ill grouping-size values and set errMsg accordingly, but didn't propagate the error. Fixed. Do memory cleanup after detecting wrong xsl:number level attribute value. Fixed memory leak in case of incorrect xslt attributes of included or imported xsl:stylesheet elements. Fixed memory leak in case of syntactically wrong xsl:key use attribute XPath expression. Fixed memory leak in case of toplevel parameter or variables which are syntactically incorrect, because they have both a select attribute and content. 2005-09-19 Rolf Ade * generic/domxpath.c: Improved detection/reporting of XPath syntax errors. Fixed two memory leaks in the XPath parser in case of some kind of erroneous XPath expressions. 2005-09-17 Rolf Ade * generic/domxpath.c: id() on an empty node set should return an empty string, according to the rec, not raise an error, as it did up to now. Fixed a memory leak in concat() in the case of xpath expressions as arguments, which raise error. Normally, XPath expressions doens't raise error at all; that's how XPath is designed. That is unfortunately not completely true with current tDOM, because tDOM doesn't do an as rigoros as possible argument check at XPath expression parsing time (that will change) and because of user defined XPath extension functions. 2005-09-16 Rolf Ade * generic/domxslt.c: Fixed memory fault in case of external documents resolved based on the base URI of a node of the source element. 2005-09-13 Rolf Ade * generic/domxpath.c: Bug fix: The namespace axis will be empty unless the context node is an element. * aclocal.m4 * configure * tdom.m4 * tdomConfig.sh.in * extensions/tnc/configure * extensions/tnc/configure.in: Improvement of the build system. Now works also with the tool combination cygwin/TEA/VC++. Thanks to Andreas Kupries for his patch. 2005-08-26 Rolf Ade * generic/tdominit.c: Removed tests about mt-ness of tclsh/tdom, due to popular demand. Mt compiled tDOM now will load into non-mt tclsh, as will a non-mt compiled tDOM into a mt tclsh. NOTES: Using a non-mt tDOM within only one thread of a mt tclsh should work just fine. But never ever use a non-mt tDOM in several threads of a mt tclsh. That may crash randomly. Use, how surprising, an mt-enabled tDOM for that. This will work fine. Using a mt aware tDOM within a non-tm tclsh is little bit slower and memory demanding. It will also have a few methods, that are superfluous within the non-tm tcl context. It should always work, but for best results use a non-mt tDOM with non-mt tclsh. 2005-08-20 Rolf Ade * generic/dom.c * generic/dom.h: Added function domPreviousSibling(). * generic/domxslt.c: Bug fix: Use domPreviousSibling() in xsltNumber() to prevent erroneous results, if attribute nodes are involved in the numbering. 2005-06-10 Rolf Ade * generic/dom.c * generic/dom.h * generic/domhtml.c * generic/tcldom.c * generic/xmlsimple.c: Internal dispersion: Cleaned up rootNode/toplevel nodes connection, added new function domSetDocumentElement. * tcldom.c: Closed memory leak in case of not well-formed input to the simple or html parser. * generic/domlock.h: Removed unused variable. * tests/dom.test: Added test, to document handling of white space outside the document element even in case of -keepEmpties (it's markup white space and will be removed). * tests/domDoc.test * tests/htmlreader.test * tests/xmlsimple.test: Added a few tests. 2005-05-13 Rolf Ade * tests/htmlreader.test * generic/domhtml.c: Fixed seg fault in case of some garbage input. 2005-05-12 Rolf Ade * tests/domNode.test * generic/tcldom.c: Fix: domNode nodeValue $newValue didn't check the newValue for being valid pcdata. 2005-05-02 Rolf Ade * tests/parser.test * generic/tclexpat.c: Bug fix: expat parser method parsechannel didn't (depending on the encoding of the channel) report parsing errors. 2005-04-11 Rolf Ade * tclconfig/ChangeLog * tclconfig/ac_c_bigendian_cross.m4: Deleted. * tclconfig/README.txt: Updated. * apps/xslt.tcl: Updated to request tdom 0.8.1. * Makefile.in * configure * configure.in * tdom.m4 * tdomConfig.sh.in * tclconfig/tcl.m4 * extensions/tnc/Makefile.in * extensions/tnc/configure * extensions/tnc/configure.in * extensions/tnc/tnc.c: Updated to use TEA 3.2. Thanks to Daniel A. Steffen and Andreas Kupries for input. 2005-04-04 Rolf Ade * expat/expat.h: Removed last comma in enum XML_Status declaration, to prevent compiler errors (xlc on AIX 64). (Current expat CVS head has the same fix.) 2005-03-26 Rolf Ade * tests/xslt.test * generic/dom.c: Fix in domAppendNewElementNode(), domAppendLiteralNode() and domAppendNewTextNode(): if the created node is a child of doc->root, set the parentNode according. * generic/domxslt.c: Removed (anyway not correctly working) work-around to set parent of the childs of doc->root (problem now correctly fixed by changes in dom.c). * tests/domNode.test * generic/nodecmd.c: Changes, to prepare adding of node creating cmds, which creates namespace aware nodes. 2005-03-21 Rolf Ade * tests/domDoc.test: Fixed flawed test, which slipped through, somehow. 2005-03-18 Rolf Ade * doc/domDoc.* * doc/domNode.* * CHANGES * tests/domDoc.test * generic/tcldom.c * generic/dom.h * generic/dom.c: Added document method selectNodesNamespaces, to provide a document global XPath prefix/namespace mapping. 2005-03-12 Rolf Ade * tests/xslt.test: Added two tests about two subtleties of the XPath syntax: white space between the $ and a varname are not allowed, while white space between the braces of node() is allowed. 2005-03-11 Rolf Ade * generic/nodecmd.c * tests/dom.test: Using of a node creating command outside of node context after that node creating command was already used in node context didn't raised error (as it should) but could have all kinds of effects (including seg fault). 2005-02-26 Rolf Ade * generic/tcldom.c: Fix for MT-enabled tDOM: If a doc was attached to more than one thread, nodeCmd creation was borken (only one thread got a nodeCmd for a given node). 2005-02-03 Rolf Ade * generic/domxslt.c: Bug fix: current() did not work in xsl:key use expressions. Moved setting of xs->current from all about the place into evalXPath. A bit code massage, to avoid bogus compiler warning. * doc/domDoc.* * tests/domDoc.test * generic/dom.c * generic/domxslt.c * generic/tcldom.c: Added support for xsl:output cdata-section-elements attribute. Added method cdataSectionElements to domDocs, as tcl interface to cdata-section-elements. * doc/domDoc.*: Added documentation for the domDoc method internalSubset. * generic/domxpath.c: Editorial changes. 2005-02-02 Rolf Ade * win/makefile.vc: Updated to provide the new defines PACKAGE_NAME and PACKAGE_VERSION introduced by the update to TEA-3 support. 2005-01-19 Rolf Ade * generic/dom.c * generic/dom.h * generic/domhtml.c * generic/xmlsimple.c: Renamed exported symbols attrNames and tagNames to tdom_attrNames and tdom_tagNames, to avoid name clash. startDoctypeDeclHandler() and endDoctypeDeclHandler(): added missing static. 2005-01-16 Zoran Vasiljevic * Makefile.in: Bumped version to 0.8.1. * configure: Added TEA-3 support. * configure.in: Made AOLserver 4.x virtual-server aware * tdom.m4: and added examples how to build the * generic/aolstub.cpp: lib as AOLserver module for 4.x series. * generic/tdominit.c: * README: * README.AOL: * mac/Prefix/tDOMPrefix.h: * mac/Prefix/tDOMPrefix_OSX.h: * win/makefile.vc: * win/makefile805.vc: * win/pkgIndex.tcl: * tclconfig/ChangeLog: * tclconfig/tcl.m4: * tests/loadtdom.tcl: * unix/CONFIG: 2005-01-11 Rolf Ade * doc/domDoc.* * doc/domNode.*: Added documentation for the -cache option of the selectNodes method. * lib/tdom.tcl: Scripted xpath function element-available: moved xsl:output to the avaliable elements, since it's in fact avaliable in the meantime (with exception of the 'version' and 'cdata-section-elements' attributes) - the output options can be queried from the result doc, but it's the responsibility of the application, to serialize the tree according to that settings. 2005-01-10 Rolf Ade * doc/dom.*: Corrected typo. * generic/dom.c: Fixed a leftover reference to embedded hash table in domDocument struct. 2005-01-10 Rolf Ade * generic/dom.c * generic/dom.h * generic/domxpath.c * generic/domxpath.h * generic/tcldom.c * tests/domNode.test: Don't embed Tcl_HashTables into dom Docs, use pointers to the hash table. Added -cache option to the selectNodes method. 2005-01-07 Rolf Ade * generic/dom.c * generic/domalloc.c * generic/domxslt.c * generic/domxpath.c * generic/tclexpat.c * generic/nodecmd.c * generic/nodecmd.h * generic/tcldom.c * tests/domDoc.test * generic/tcldom.h: Clean up, to decrease (innocuous) compiler warnings (thanks to Pat Thoyts for triggering input and patch). * win/makefile.vc: Improved VC++ compiler makefile. Thanks to Pat Thoyts for contribution. * win/nmakehlp.c * win/rules.vc * win/tdom.rc: Added this files. Thanks to Pat Thoyts for contribution. 2005-01-06 Rolf Ade * generic/tcldom.c * tests/domDoc.test * tests/domNode.test * doc/domDoc.* * doc/domNode:*: Handle multiple -namespaces options to selectNodes method. Added methods transform and delete to xsltCmds. Ensure, that documents created with the [dom createDocument* methods] are created as docCmds in case of 'auto' creation mode. * tests/dom.test Added a few tests: related to createNodeCmd * tests/element.test (dom), node text method (domNode), chancing * tests/parser.test callback from within a callback (element, * tests/xslt.test parser) and catching of recursive xsl include/import (xslt). 2004-12-21 Rolf Ade * generic/domxslt.c: xsl:key with match expressions, which matches attributes, did not work. Prevent, that a stylesheet import/include itself. Editorial changes. * generic/dom.c: domAppendNewElementNode(): Set the namespace of a per xslt transformation generated node wrong under certain circumstances. This fixes http://groups.yahoo.com/group/tdom/message/1008. Removed leftover (former local used) define TNODE. 2004-12-12 Rolf Ade * generic/domxpath.c * tests/xpath.test: xpath expressions ancestor-or-self::node() and parent::node() returned wrong result if the context node is /. 2004-12-10 Rolf Ade * doc/expat.* * generic/tclexpat.c * generic/tclexpat.h * tests/parser.test: Don't allow the methods parse, parsechannel, parsefile, free and reset from within a callback of the parser be used but raise a tcl error. 2004-10-25 Rolf Ade * doc/domNode.*: Added documentation for the '-namespaces' option of the selectNodes method. * doc/dom.*: Added a note to the -externalentitycommand option of the parse method, that the programmer is responsible for closing the channel, if the resolver script returns a channel. 2004-09-29 Rolf Ade * win/pkgIndex.tcl: First [load] the lib, which has [package provide tdom], so that a [package require tdom] within the script lib doesn't loop. * generic/tcldom.c: Added the with 0.8 added doc methods to the doc_usage. 2004-09-21 Rolf Ade * doc/domDoc.*: Add documentation for 'selectNodes' method. * generic/dom.c * generic/dom.h * generic/domxpath.c * generic/domxpath.h * generic/domxslt.c * generic/tcldom.c: Added the '-namespaces' option to the selectNodes method. Not resolved namespace prefixes within the xpath expression now raises an error. *** POTENTIAL INCOMPATIBILITY *** 2004-09-13 Rolf Ade * generic/domxslt.c: Corrected a typo in an error msg. 2004-09-08 Rolf Ade * generic/domxslt.c: Editorial changes. 2004-09-02 Rolf Ade * generic/domxpath.c * generic/tcldom.c * tests/domNode.test: toXPath method: fixed bug with non-element top level nodes, closed mem leak. 2004-08-23 Rolf Ade * README * README.AOL: Corrected typos (thanks to G. Neumann) 2004-08-20 Rolf Ade * expat/*: Update to expat 1.95.8. 2004-08-19 Rolf Ade * unix/CONFIG * generic/dom.h * generic/tcldom.c: Made tDOM work out of the box on 64-bit systems like Itanium 2 (though --disable-tdomalloc configure option at build time is still needed). 2004-08-17 Rolf Ade * generic/dom.h: Added fluff, to fix build problemx on AIX w/ xlc compiler. * generic/domxpath.c * generic/tcldom.c: Removed unused variables. 2004-08-15 Rolf Ade * generic/dom.h * generic/dom.c * generic/domxslt.c * generic/tcldom.c * generic/xmlsimple.h * generic/xmlsimple.c * tests/dom.test: Pass external entity resolver script around in string representation (insteand of Tcl_Obj), to avoid problems with mt builds. --- Release 0.8.0, 11. Aug. 2004 --- 2004-08-10 Rolf Ade * extensions/tnc/makefile.vc: Link against tDOM 0.8.0. * doc/dom.*: Corrected a spelling mistake. 2004-07-28 Rolf Ade * lib/tdom.tcl: [namespace export] the public procs in ::tDOM. Added a few more encodings to IANAEncoding2TclEncoding. 2004-07-27 Rolf Ade * test/dom.test * doc/dom.* * generic/dom.h * generic/tcldom.c: New (experimental) method setObjectCommands. * test/domNode.test * generic/dom.c * generic/tclexpat.c * generic/tcldom.c: Reworked internal base URI handling, to fix a bug of the old approach and to be closer to (though not fully support) what DOM 3 say about base URI handling. * tests/dom.test * doc/dom.* * generic/tcldom.c: New method createDocumentNode. * tests/domDoc.test * doc/domDoc.* * generic/dom.c * generic/tcldom.c: Added methods nodeType, getElementById, firstChild, lastChild, appendChild, removeChild, hasChildNodes, childNodes, ownerDocument, insertBefore, replaceChild, appendFromList, appendXML, selectNodes, baseURI, appendFromScript and insertBeforeFromScript to dom docs. Beside other things, this allows much easier handling of top level nodes. The result tree may not be an XML document, but a general parsed entity. * tests/domNode.test * doc/domNode.* * generic/tcldom.c: Improved speed of the getAttribute shortcut '@attname' (and, not so notable, of tcl coded methods of the dom, domDoc and domNode cmds). Corrected typo in domNode usage msg for getElementByID. Improved error msg for getAttribute, if attribute is not found. Changed behavior of getElementByID: if no element with the given id is found, returns now the emtpy string, not a TCL_ERROR (closer to DOM rec, getElementByID never raise an exception). Bug fix: nodeName now returns the per DOM rec correct values for comment and cdata section nodes (were as yet reported as if they where text nodes). * tests/entity.test * generic/tclexpat.c: Better error msg in case of 'filename' and not valid file name. * tests/xpath.test: Documented behaviour in case of using (senseless, wrong) 'xslt variable' in selectNode exprs. * tests/xslt.test: More tests for script errors in external entity handler or errors in the requested external entities. 2004-07-19 Rolf Ade * generic/domxslt.c: Better error msg in case of XML parsing errors in external entities. * generic/nodecmd.c: Bug fix: Check, if refnode given to insertBeforeFromScript is valid. 2004-07-13 Rolf Ade * generic/domxslt.c: Ensure, that the first element node of the result tree is the documentElement of the generated document. * tests/xmlsimple.test * generic/xmlsimple.c: Empty CDATA sections should not create a node. 2004-07-08 Rolf Ade * generic/tdominit.c: Test, if a non-mt tDOM is tried to load into a mt tclsh. 2004-05-26 Rolf Ade * doc/dom.* * tests/dom.test * tests/domNode.test * tests/tdomcmd.test * generic/tcldom.c * generic/dom.c * generic/dom.h * generic/nodecmd.h * generic/nodecmd.c: Added isPIName, isComment, isCDATA and isPIValue method to the dom command. Created new global (thread wide) flags for name and value checks (Names and FQ Names (element, attribute and processing instruction names), text nodes, comments, CDATA sections and processing instruction values). New methods setNameCheck and setTextCheck to control this flags. * generic/nodecmd.c: Bug fix in case of appendFromScript script. * generic/domxslt.c: Uses the new domIsComment, domIsPINAME and domIsPIValue API functions of dom.c. Improved xsl:processing-instruction processing (now instantiating the content). * generic/domxpath.c: Minor editorial changes. * tests/domCmd.test: Deleted this file, moved the tests to the new dom.test or domDoc.test. * tests/dom.test: Moved the tests from this file to the new domNode.test and collected dom command tests here. * tests/domDoc.test * tests/domNode.test: Created this files, tests from dom.test and domCmd.test. * doc/expat.* * tests/xpath.test * tests/xslt.test: Minor changes. 2004-05-11 Rolf Ade * apps/xslt.tcl: Fixed the test for running in a source tree with tcldomsh. (doh!) 2004-05-08 Rolf Ade * generic/xmlsimple.c: Removed superfluous arg baseURI from XML_SimpleParse(). * generic/domhtml.c * tests/htmlreader.test: Fixed html-2.1 and html-2.2. (This html reader is crusty stuff...) 2004-03-26 Rolf Ade * generic/domxpath.c: Fix of the template priority calculation and clearing out of xpathGetPrio(). 2004-03-14 Rolf Ade * generic/xmlsimple.c: Fixed a few simple parser seg faults in case of not-wf input. See xmlconf/xmltest/not-wf/sa/022.xml, xmlconf/xmltest/not-wf/sa/042.xml for examples. 2003-12-30 Rolf Ade * Makefile.in * extensions/tdomhtml/pkgIndex.tcl.in * extensions/tnc/Makefile.in: Doh! Undo the last changes; I fixed this already 2003-10-12. * generic/dom.c: Removed superfluous comma from the tdomMethod enum, which bothered the AIX xlc compiler. * generic/domxpath.c: Editorial change: Removed some superfluous casts to (char*) from tdomstrdup result - its defined to return char*. * generic/domxpath.h * generic/domxpath.c * tests/xslt.test * generic/domxslt.c: Implemented the special constraints on certain xpath pattern/expr (no current() func in pattern, no var references in template and key match pattern and key use expr, no key() func in key match pattern and use expr.) 2003-12-24 Rolf Ade * Makefile.in * win/pkgIndex.tcl: * extensions/tnc/pkgIndex.tcl.in * extensions/tdomhtml/pkgIndex.tcl.in * extensions/example/pkgIndex.tcl.in: Bug fix: Protect against spaces in the path to the package. 2003-12-20 Rolf Ade * win/pkgIndex.tcl: Also updated to new version nr 0.8.0. 2003-12-17 Rolf Ade * doc/domNode.* * generic/tcldom.c: Added baseURI method, which returns the current base URI and has an optional argument to set the base URI. (The getBaseURI is deprecated.) 2003-12-15 Rolf Ade * generic/dom.c * generic/domxslt.c: More fixes to ensure ns integrity of xslt result trees. 2003-12-14 Rolf Ade * tests/attribute.text: Made test results independent from the (undefined) order of [array get]. * tests/dom.test: Build expected result of some tests with [list], instead of providing a string rep. This hides the changes in list string rep by TIP 148, so that the tests work both with pre- and post TIP 148 tcl. 2003-12-11 Rolf Ade * tests/xslt.test * generic/domxpath.c: Bug fix: double mem free in case of pattern w/ FQ element with positional dependent predicate. * generic/dom.c * tests/domCmd.test * tests/pcdata.test * tests/tdomcmd.test * generic/tclexpat.c: Bug fix: Don't quash white space of non white space only content in trim mode. 2003-12-09 Rolf Ade * lib/tdom.tcl: Improved regexp to extract encoding. Corrected typo. * generic/domxslt.c * generic/domxpath.c * generic/dom.c: Bug fix in namespace handling: copy-of from result tree fragments could mess up ns handling, if a default namespace is already in scope in the result tree. 2003-12-08 Rolf Ade * win/makefile.vc * win/makefile805.vc: Also updated to verson nr. 0.8.0. 2003-11-28 Rolf Ade * generic/tcldom.c: Switched back to Tcl_Panic() in one case, to make MT builds work. * generic/domxslt.c * generic/dom.c: With MT tDOM, a domDoc extRefHandler script may be used within another thread. 2003-11-27 Rolf Ade * generic/domxslt.c * generic/dom.c * tests/xslt.tests: Another fix, to ensure namespace integrity of the result doc. 2003-11-26 Rolf Ade * generic/domxslt.c * tests/xslt.test: Fix, to ensure namespace integrity of the result doc. Fixed parentNode of documentElement and siblings of the result tree. 2003-11-24 Rolf Ade * tests/tdomcmd.test: Added this file. * generic/dom.c * tests/dom.test: Don't include PIs inside the internal subset into the tree. * generic/tcldom.c * generic/dom.h * generic/domxslt.c * tests/xslt.test * generic/dom.c: Added domDoc methods omit-xml-declaration, indent, standalone, encoding and mediaType. * generic/tclexpat.c * generic/tclexpat.h * generic/dom.c: Changed parserObj behavior: parser don't need a reset call after a final parse or parsing error. * tests/xslt.test * generic/domxslt.c: Bug fix: seg fault for document('') with stylesheet tree with empty baseURI. Minor optimizations. Fixed invalid memory read. * generic/tcldom.c * tests/dom.test: (Probably) temporarily disabled automatically clean up of nodeObjCmds, to work around bug: Storing the same node in different evaluation contexts with the optional objVar argument (as in [$doc documentElement root]) at the same time did not work. * generic/domxpath.c: Fixed a mem leak with some sum() calls with NaN result. Fixed invalid memory read. * generic/tcldom.c: Fixed mem leak with -externalentitycommand. Fixed mem leak with parsing xml document with external entity and parsing error in an external entity. Minor code clean up. * tests/parser.test: * generic/tclexpat.c: Fixed memory problem, if handler script return TCL_ERROR. Made the cget method work for the parser related options, even if there are no handler scripts set. * generic/tcldom.c * generic/dom.c * generic/tclexpat.c * generic/domlock.c: Always use domPanic as panic function. 2003-11-20 Rolf Ade * generic/domxslt.c: Bug fix: Setting a top-level xslt param with -parameters and using this param for setting another top level var could end in seg fauld. 2003-11-10 Rolf Ade * generic/tcldom.c: Replaced a C++ style comment with a C style comment. 2003-11-02 Rolf Ade * tests/xpath.test: Added a few tests related to declarations to chapter 4.2 and 4.4 in the errata to the XPath rec. * generic/domxpath.h: Fixed memory leak, if floor or ceiling are called with non-numbers. 2003-11-01 Rolf Ade * generic/domxslt.c: Minor bug fix: Special handling is needed, if xsl:copy-of is used, to copy namespace nodes. 2003-10-26 Rolf Ade * apps/xslt.tcl: Removed not needed code. * generic/dom.c * tests/dom.test: Bug fix: Under some circumstances it was possible, that an URI change for a subtree was not stored in the tree (resulting in wrong base URI for that nodes). * generic/domxpath.c: number() bug fix: Now works according to the XPath rec understanding of a Number, not with the libc understanding of a double. * generic/domxpath.c * generic/dom.h * generic/dom.domxslt.c: Globalized the macro IS_XML_WHITESPACE. 2003-10-24 Rolf Ade * generic/domxslt.c: Bug fix for document() func, if called with 2 args and first arg evaluates to the empty string. Improved error reporting, if an XSLT variable is tried to reset, although there is already such a variable in scope: now the name of the var is also reported in the error msg. * apps/xslt.tcl: Updated to use the new asText option. 2003-10-23 Rolf Ade * expat/* * CHANGES: Update to expat 1.95.7. 2003-10-22 Rolf Ade * generic/domxpath.c * tests/xpath.test: Bug fix in the xpath lexer: In a union expr, a NCName test with a name equal to an operator was wrongly interpreted as operator. 2003-10-21 Rolf Ade * generic/domxslt.c: Fixed bug with current(), if it is used in the select expr of an xsl:sort. * generic/domxpath.c * generic/domxpath.h * generic/domxslt.c: Changed handling of key node sets. It's a somewhat focused optimization, for the price of a very small overall cost. I've done it anyway, because it's a very notable speed up for an important xslt pattern (the so called Muenchian Method for grouping). * generic/tcldom.c: Removed two unused variables. 2003-10-17 Rolf Ade * generic/dom.c: Fixed dom parse -channel option, which got accidentally broken, due to the lately switch from Tcl_GetStringFromObj() to Tcl_GetString(). * generic/tcldom.c: Added again some recently implemented methods to domObj_usage and node_usage, which got accidentally removed by the lately editorial changes. 2003-10-16 Zoran Vasiljevic * generic/tcldom.c: added "dom detachDocument" command to match the already present "dom attachDocument". This is used only for threaded tdom builds. * generic/domlock.c: changed lock caching to accomodate for situation with huge number of created documnents Also, added new "domDoc" command as a first-class tdom citizen, analogous to the already existing "domNode". It operates on the document token. Attempt has been made to start to follow Tcl-style-guide but we still have a way to go. The first thing is to try to force the 78-chars margin where possible/feasible. Therefore, many of the source files have been cosmetically touched, without code or functionality changes. 2003-10-12 Rolf Ade * generic/domxpath.c * generic/domxslt.c: Removed not used vars. * generic/dom.c * generic/dom.h * generic/domhtml.c * generic/tcldom.c * generic/tclexpat.c * generic/tclexpat.h * generic/xmlsimple.c: Merged domCreateEmptyDoc() and domCreateDoc(), now there is only one API proc: domCreateDoc(). 2003-10-10 Rolf Ade * Makefile.in * extensions/tdomhtml/pkgIndex.tcl.in * extensions/tnc/Makefile.in: Fixed pkgIndex.tcl problem, if the path to the packages contains a space. * doc/domDoc.* * doc/domNode.* * CHANGES * generic/dom.h * generic/dom.c * generic/tcldom.c * tests/domCmd.test: Added implementation for new method normalize (and as a by-product a C implementation for the method appendData). 2003-10-09 Rolf Ade * tests/domCmd.test * generic/tcldom.c: Made code robust against renaming of domDoc cmds (well, unlikely, not to say very unlikely, but at least it also simplified code and reduces obj size by a few bytes). Changed sharedDocs hash table (only MT build) from TCL_STRING_KEYS to TCL_ONE_WORD_KEYS. 2003-10-08 Rolf Ade * generic/tcldom.c: Fixed the preliminary (and MT only) method renumber. 2003-10-07 Rolf Ade * generic/nodecmd.c * generic/nodecmd.h * generic/tcldom.c * tests/dom.test * doc/domNode.* * CHANGES: Added new method insertBeforeFromScript to domNodes. Bug fixes for appendFromScript: In case of error in the script, the tree will not be altered. The appendFromScript may only be used for ELEMENT_NODEs. 2003-10-04 Rolf Ade * generic/domxpath.h: Removed prototypes of functions, which are not implemented. Editorial changes. * generic/domxpath.h * generic/domxpath.c * generic/domxslt.c * generic/tcldom.c * tests/dom.test * tests/domCmd.test * CHANGES * doc/domDoc.* * doc/domNode.*: Added new method 'asText' to domDocs and domNodes. Renamed xpathGetTextValue() to xpathGetStringValue(), to be more according to the vocabular of the XPath rec. 2003-10-01 Rolf Ade * generic/dom.c: Removed unnecessary check of domModuleIsInitialized in domReadDocument(). Corrected typo in a comment. * generic/dom.c * generic/dom.h * generic/domxpath.c * generic/domxslt.c * generic/tcldom.c * tests/dom.test: Reworked usage of nodeNumber. It is now used only in one place, the new domPrecedes function. Also in domPrecedes is a fall-back mechanism, which is used if the document has an invalid node numbering. Removed the forced re-numbering in case of invalid node numbering of the doc for every single selectNodes. Added preliminary method renumber for MT-enabled builds. Carefully reviewed every rsAddNode usage in domxpath.c. Some minor editorial changes. 2003-09-28 Rolf Ade * generic/tclexpat.c: Removed two unused vars. * tests/domnamespace.test * generic/dom.h: Changed type of domNameSpaceIndex, domNodeFlags, domAttrFlags, domDocFlags and info in dom*Node structs from int to unsigned int. This fixes bug with docs with more than 128 different namespaces. * tests/xpath.test * generic/domxpath.c: Bug fix: preceding-sibling axes could give wrong results in case the context node is a child of rootNode (e.g the documentElement). * tests/dom.test * generic/tcldom.c * generic/dom.c: Bug fix for replaceChild: If the node to replace was wrong, the doc got mangled. Bug fix for appendChild, replaceChild: the new node could not be a sibling or child of node. Speed improvment in some cases for removeChild, replaceChild, appendChild. 2003-09-22 Rolf Ade * tests/dom.test * doc/domNode.* * generic/tcldom.c * generic/dom.c: Reworked insertBefore: Bug fix: If the refNode was invalid, the involved documents got mangled. Bug fix: Dead loop, if the node to insert was the node itself. Bug fix: the rootNode of node's document could be used as node to insert. Bug fix: It was not possible, to insert a node before refNode, which was already a children of node. Bug fix: It was not possible, to insert a sibling of node. Feature enhancement: If the refnode is the empty string, the newNode is inserted at the end of the children list of node. Optimization: Average speed was O(n/2) (n: number of childs of node) in case the node to insert was out of the tree, and 0((n+m)/2) (m: number of nodes in the fragments list) in case the node to insert was out of the fragments list. Now its O(1). * tests/dom.test: Removed 'knownBug' constraint from two tests, which documented known bugs, that are fixed in the meantime. 2003-09-17 Rolf Ade * tests/cdata,test * tests/element.test * tests/parser.test: Added a few tests related to the new flexibility of the -elementstartcommand, -elementendcommand and -characterdatacommand scripts. * doc/expat.*: Added documentation for the now implemented cget method. Added information about the default for the -paramentityparsing option. * generic/tclexpat.c * generic/tclexpat.h: Enhanced the new cget method of parserObjs to also report the state of -noexpand, -useForeignDTD, -paramentityparsing (those by doing the bookkeeping with an enhanced TclGenExpatInfo struct, because the expat parser do not proived an API to request this settings) and -namespace. Improved argument check of the parser obj method calls. Optimization for calling handler scripts. 2003-09-16 Zoran Vasiljevic * Makefile.in: added SHLIB_CFLAGS to set of compiler switches in order to silence the picky linker. 2003-09-14 Rolf Ade * lib/tdom.tcl: Fixed scripting bugs in ::dom::domDoc::importNode and ::dom::domNode::length * Makefile.in: dist target: Don't include CVS dirs and hidden files into the distribution file. 2003-09-14 Zoran Vasiljevic * Makefile.in * configure * configure.in: made more TEA-2 compatible by moving the tcldomsh target out. Also, honour the MATH_LIBS as calculated by the tcl.m4 instead of plumbing our own. Also, fixed "make dist" to produce distribution file. * tclconfig/ChangeLog * tclconfig/tcl.m4: imported fresh new versions from SF * unix/CONFIG: cleanup * macosx/README: cleanup 2003-09-14 Rolf Ade Merged fixes from 0.7.8 into HEAD. This includes: 2003-08-06 Zoran Vasiljevic * generic/nodecmd.c: removed optimized domAppendChild1 in favour of generic domAppendChild since former was trashing memory in certain situations. 2003-08-06 Rolf Ade * tests/all.tcl * tests/domCmd.test: Added contraint need_uri, so that the few tests, which needs the tcllib uri package are skipped, if the uri package isn't present. 2003-07-06 Rolf Ade * generic/tclexpat.c: Fixed bug in the subtree skipping feature of event handlers. Should be merged with HEAD. * lib/tdom.tcl: Fixed error reporting in tDOM::extRefHandler. 2003-07-03 Zoran Vasiljevic * generic/domlock.c: fixed double mutex unlock. * generic/tcldom.c: allows same thread to issue several "attachDocument" commands to artificially bump the document refcount thus making the document sticky. Also, fixed variable tracing issues when tearing down the dom document. Now, all node object command variables are automatically untraced. This prevents memory trashing when such variables are unset by user or by Tcl. 2003-09-14 Rolf Ade * generic/tclexpat.c: Added cget method implementation for all parser options with the exceptions of -namespace, -useForeignDTD and -paramentityparsing. Revamped behind the scene code for handling of the -elementstartcommand, -elementendcommand and -characterdatacommand options. Up to now, the arguments to this options must have been the name of an already defined tcl proc. This allowed a special high performance calling of that procs. The new code behaves exactly the same way for every script, which worked with previous versions. Additionally it allows, to specify a not already defined tcl proc and, probably more important, allows 'arbitrary' tcl scripts as argument to that options. All in this checkin in the work of Harry Moreau (hmoreau@online.ie). Many thanks for this contribution. 2003-06-13 Rolf Ade * generic/tcldom.c: Added an argument check for XSLTCmds. 2003-06-11 Rolf Ade * generic/domxslt.c: Fixed a bug in xsl:number. If there is no 'count' attribute given to xsl:number, it must default to the pattern that matches any node with the same node type as the current node and, if the current node has an expanded-name, with the same expanded-name as the current node. But in case of PROCESSING_INSTRUCTION_NODEs as the current node and no 'count' attribute, it counted all pi's regardless of the name. Now, the name is respected, as it should be. 2003-06-11 Zoran Vasiljevic * generic/domlock.c: fixed double mutex unlock. 2003-05-19 Rolf Ade * doc/dom.*: Corrected the documentation of the createDocumentNS method: the args uri and docElementName were documented in the wrong order (reported by Vico Klump). Minor markup changes. 2003-05-16 Zoran Vasiljevic * generic/dom.h * generic/tdom.decls * generic/tdomDecls.h * generic/tdomStubInit.c * generic/tdomStubLib.c * generic/tdominit.c: fixed so it compiles cleanly when -NS_AOLSERVER is defined. 2003-05-16 Rolf Ade * generic/dom.h * generic/tcldom.c * generic/domxslt.c * generic/tclexpat.c: Switched to use XML_ParserCreate_MM(), to be able (at tDOM build time) to make the expat parser use custom *alloc/free() functions (macro MEM_SUITE in dom.h). For TCL_MEM_DEBUG and NS_AOLSERVER builds the mem functions, used by the parser default now to Tcl_Alloc()/Tcl_Realloc()/Tcl_Free(). Switched to XML_FreeContentModel(), for freeing stored element content models. 2003-05-11 Rolf Ade * generic/dom.c * generic/domxslt.c * generic/xmlsimple.c: Renamed the documents rootNode (in the sense of the XPath data model, that is not the document element) from "(rootNode)" to "", in preparation for the promissed 'domDoc without documentElement' feature, to fix a somewhat outlying problem with xslt numbering and because it's clearly more the 'right thing' according to the rec. * generic/domxslt.c: Removed the arg xs from sortNodeSetFastMerge(), because it isn't used. 2003-04-20 Rolf Ade * extensions/tdomhtml/tdomhtml.tcl: Proc newdoc: New optional argument (list of names of local variables) allows the use of local variables (in the scope of the caller of newdoc) in the script argument of newdoc. Contributed by Chuck Ferril. 2003-04-16 Rolf Ade * generic/domxslt.c: Optimization: Improved caching of external documents. 2003-04-12 Rolf Ade * README * README.AOL * configure.in * configure * configure-8.0.5 * tests/loadtdom.tcl * mac/Prefix/tDOMPrefix.h * mac/Prefix/tDOMPrefix_OSX.h * extensions/tnc/tnc.c: Bumped version to 0.8.0 (alpha). 2003-04-09 Rolf Ade * generic/dom.c: Fixed a bug in the creation of the error msg in case of parsing errors in an external entity. * generic/dom.c * generic/dom.h * generic/domxslt.c * tests/domCmd.test * doc/dom.* * generic/tcldom.c: Added option -paramentityparsing to the [dom parse] method. [dom parse] option parsing now uses Tcl_GetIndexFromObj() (which additionally fixes a minor bug with the current option parsing). * generic/tcldom.c: Removed an unused variable. Improved error reporting in case of not found attribute. Better options check for the 'xslt' methods. Changed implementation of the dom method isQName to use the lately introduced API function domIsQNAME. * generic/tclexpat.c tests/parser.test: Fixed a bug in the value parsing of the -paramentityparsing option. * tests/domCmd.test: Added tests for the interface of the xsltCmds. * tests/xpath.test: Added test which documents the bug prior to domxpath.c r1.63. * doc/dom.*: Added 'package require tdom' to the syntax decription (http://groups.yahoo.com/group/tdom/message/446) * doc/domDoc.*: Added documentation for the toXSLTcmd method and the resulting xsltCmds. Corrected the documentation for the xslt method (missed -ignoreUndeclaredParameters and -xsltmessagecmd in the method syntax). 2003-04-05 Rolf Ade * generic/tclexpat.c: Bug fix: If the parsing state is already not TCL_OK return in the notstandalonehandler immediately success, otherwise the error msg will be overwritten with a false diagnostic. A few editorial changes. 2003-04-04 Rolf Ade * generic/dom.c * generic/dom.h: Added domIsQNAME. * generic/dom.c: Bug fix: For textNodes getLine/getColumn method report the position of the first char of the text node. * generic/domxpath.c: Bug fix: Detects now some erroneous XPath expressions. Added parameter number check to XPath functions substring and concat (the last two XPath functions, without such check, they must have slipped thou somehow, up to now). * generic/domxslt.c: Improved interal function reportError(), can now be used with all kind of nodes not only element nodes. Improved behavior in case of dubious numbering (negative roman number or latin letters fall back to default latin numbers). Fixed a potential memory leak (in case of overwriting named templates without match attribute with an other named template). Improved error reports: for more detected errors there is now a line/column number given. Plenty of improvements in detecting erroneous stylesheets: more checks for format-number formatting patters (although especically format-number patterns are still a can of worms), added parameter number check for additional XPath function current(), template, paramter, variable, sort, choose, copy, and message elements. 2003-03-26 Rolf Ade * generic/domxslt.c: Fixed some memory problems, mostly in case of erroneous stylesheets. --- Release 0.7.7, 25. Mar. 2003 --- 2003-03-25 Rolf Ade * configure.in * configure * configure-tcl8.0.5 * README * README.AOL * win/makefile.vc * extensions/tnc/makefile.vc * mac/Prefix/tDOMPrefix.h * mac/Prefix/tDOMPrefix_OSX.h * mac/tDOM_OSX.prj.xml: Bumped the version number to 0.7.7. * generic/tcldom.c: Fixed error, which prevents building 0.7.6 with -DTCL_THREADS=1. (Arrrg.) --- Release 0.7.6, 24. Mar. 2003 --- 2003-03-22 Rolf Ade * mac/Prefix/tDOMPrefix.h * mac/Prefix/tDOMPrefix_OSX.h * mac/Prefix/tncPrefix.h * mac/Prefix/tncPrefix_OSX.h * mac/tDOM_OSX.prj.xml: Final tweaking for 0.7.6. * expat/VERSION * expat/expat.h: Updated to an after 1.95.6 version, which fixes the problem, that some compilers had with the 1.95.6 version. 2003-03-22 Rolf Ade * README * README.AOL * configure.in * configure * configure-tcl8.0.5 * mac/tDOM.r * mac/tDOM_OSX.prj.xml * mac/tnc.r * extensions/tnc/makefile.vc: Updated to new version number 0.7.6. * mac/tDOM/*: Added dir/files, to have a version number independed output dir for the mac build. * mac/tDOM.0.7.5/* * mac/tDOM.0.7.5: Removed in favor of a version-less tDOM output directory. * configure * configure.in: tdomstub_BUILD_SPEC must point to the plattform specific build dir. * generic/tcldom.h: Removed hard coded version number, uses now VERSION define. * win/makefile.vc * win/makefile805.vc * win/pkgIndex.tcl: Updated to new version 0.7.6. * extensions/tnc/tnc.c * extensions/tnc/tests/tnc.c: Added code needed to handle effects of the -useForeignDTD option. * doc/domNode.* * generic/tcldom.c * tests/dom.test: Renamed 'startBefore' method to the better name 'precedes' and changed behavior: the method now returns simply a boolean value. 2003-03-19 Rolf Ade * generic/tcldom.c * generic/domxslt.c * generic/dom.h * generic/dom.c: Replaced a few exit() code with Tcl_Panic(), which ensures, that even windows users get a useful error msg. * generic/dom.c: Fixed a mem leak in handling external entities. * doc/expat.* * doc/dom.* * tests/domCmd.test * tests/data/domCmd1.dtd * tests/data/domCmd2.dtd * tests/entity.test * lib/tdom.tcl * tests/domCmd.test * generic/tclexpat.c * generic/tcldom.c * generic/domxslt.c * generic/dom.h * generic/dom.c: Added option -useForeignDTD to dom parse and expat. * generic/domxslt.c: Fixed several potential memory leaks while processing erroneous stylesheets. Bug fix: added missing memory clean to grouping-separator/grouping-size support. * generic/tcldom.c: Fixed potential memory problem while processing erroneous stylesheet. Improved error msg in case of script errors in the -externalentitycommand script. * doc/domNode.* * tests/dom.test * generic/tcldom.c: Added method 'startBefore', to compare the relative order of two nodes out of the same document. * generic/nodecmd.c: Added explicit memory clean up of the nodecmd stack, to reduce 'noice' while memory leak debugging. * tests/dom.test: Added a reminder for a minor known memory problem. * tests/data/mondial-europe.xml: Added this file (used by the usage example of xe). * xe/xe-input: Changed pathes to point to the location of mondial-europe.xml. 2003-03-19 Zoran Vasiljevic * Makefile.in: installs the tdomConfig.sh into the $(libdir) whatever that points to. 2003-03-08 Zoran Vasiljevic * expt/internal.h: disabled FASTCALL & friends since those do not work anywhere, as of my knowledge. 2003-03-06 Zoran Vasiljevic * generic/domalloc.c: removed include malloc.h since not needed nor not found on macosx * configure.in: adds "-lm" even when linking the shared image since Starkit users need that. Also, fixed alternative libdir usage when installing in non-standard (user-given) location. * unix/CONFIG: new file. Adds some examples how to build the extension on some common Unix platforms. * mac: added Bernards CodeWarrior files for Mac builds. * macosx: added directory where we will supply the ProjectBuilder files (hopefully :) 2003-03-03 Rolf Ade * tests/dom.test * generic/tcldom.c: Fixed bug with using the 'domNode' cmd without argument (spotted by Bernard Desgraupes). 2003-02-27 Rolf Ade * generic/domxslt.c: xsl:number attributes grouping-separator and grouping-size now also interpreted as attribute value templates. (The last two (missing up to now only by mistake) attribute value templates under the recognized xsl attributes.) 2003-02-26 Rolf Ade * generic/tcldom.c: Removed unused variables. * lib/tdom.tcl generic/dom.c: Improved ::tDOM::xml(Read|Open)File. Now handles also utf-16 files with BOM right. * generic/domxslt.c: Made some functions static. Removed a TODO note, which already was done. Improved some error msgs (now with line/column info, if avaliable). Bug fix: xsltXPathFuncs must return -1 to signal error, because if the source of the function call was inside of domxslt.c the result code (rc) check rule is rc < 0. Fixed text in a xsl:attribute error msg. Fixed memory leak in error case in ExecAction, case forEach. Added a missing result code check in ExecAction, case procinstr. Bug fix: Even literal result element subtrees are relevant for xslt variable scope (default case of ExecAction). Bug fix: the expression context of the match expr of a xsl:template is the xsl:template node. Now the xslt white space stripping is done before the top level processing (was done after toplevel processing). 2003-02-25 Rolf Ade * expat/VERSION * expat/internal.h: Applied post 1.95.6 patch, to fix compiler warnings ("warning: `regparm' attribute directive ignored") from gcc on Solaris. 2003-02-22 Rolf Ade * generic/tcldom.c * generic/tdom.decls * generic/tdom.h * generic/tdomDecls.h * generic/tdomStubInit.c: Added tcldom_getNodeFromName(), tcldom_getDocumentFromName() and the dom.h typdefs to the tDOM stubs table. Needed for the new tnc feature (and elsewhere, on the long run). * doc/tnc.* * extensions/tnc/configure * extensions/tnc/configure.in * extensions/tnc/makefile.vc * extensions/tnc/test.tcl * extensions/tnc/tnc.c: Added new tnc method getValidateCmd. Changed to use the same memory allocator/free defines as the tDOM core. Bumped the version to 0.3. * extensions/tnc/tests * extensions/tnc/tests/all.tcl * extensions/tnc/tests/loadtnc.tcl extensions/tnc/tests/tnc.test: Started test suite for the tcl interface of the tnc command and the validator commands. * generic/tclexpat.c: Better eContents cleanup. Bug fix: of course we have to call the parserResetProcs of the registered C handler sets while reseting the expat parser command. * lib/tdom.tcl: Smaller fixes. Changed the values of the system-properties xsl:vendor (included me) and xsl:vendor-url (to http://www.tdom.org). 2003-02-22 Zoran Vasiljevic * generic/dom.h: Added (char*) cast to argument of Tcl_Free in the FREE macro. This avoids some compiler warnings. * generic/dom.c: Added some typecasts to MALLOC to avoid compiler warnings. 2003-02-21 Rolf Ade * generic/domxslt.c: Bug fixes: Return after detecting the error (xsltPathFuncs), ensure that savedLastNode is always set right (ExecAction, case copy). Editorial changes. * configure.in * Makefile.in * configure * configure-tcl8.0.5: Don't remove tdomConfig.sh with a 'make clean', only with a 'make distclean'. 2003-02-09 Rolf Ade * expat/*: Update to expat 1.95.6. * apps/xslt.tcl: Updated to use the new -xsltmessagecmd option of the xslt method and the -doctypeDeclaration of the asXML/asHTML methods. Added a few comments. 2003-02-09 Rolf Ade * generic/dom.c * generic/dom.h * generic/domxslt.c * generic/tcldom.c * doc/domDoc.* * tests/domCmd.test: Public and system identifier information are now stored (if parsed with the expat parser or generated by the xslt engine, if given), exposed to the script level (even writable, more than DOM 2 allows) and will be, on demand, respected while serializing. * generic/dom.c: Bug fix: Hold ID => node mapping consistent even after resetting or removal of known ID attributes. * generic/domxslt.c: Bug fix: invalid memory read. * generic/tcldom.c: Bug fix: invalid memory read. 2003-01-30 Rolf Ade * generic/dom.c * generic/tcldom.c * generic/xmlsimple.c * tests/xslt.tests: Fixed bug reported by Wilhelm Klink (http://groups.yahoo.com/group/tdom/message/404 see test xslt-4.1). Again a problem (sideeffect) of renumbering node->nodeNumber (which is necessary after modification of the tree for some XPath expr to work). The keys of the entries in the baseURIs hash table of the documents where the nodeNumber of the (subtree root) nodes with new baseURI. Since this nodeNumber isn't necessarily constant over the lifetime of a node (because of the possibility of re-numbering the tree), this could not work anymore. Instead the nodeNumber, we now use the pointer to the node structure as Key for the baseURIs hash table. This pointers stay always constant, even if the nodeNumber changes. Additional code was added to domFreeNode(), to ensure, that an entry in the baseURIs hash table gets freed, if the related node is in deed freed. Removed the yesterday added reseting of the domUniqueNodeNr counter, because it turned out in testing, that there are problems with sorting of resultSets, which includes nodes from different documents (which may happen with some special XSLT constructs (document() calls with a nodeset as argument)). The reseting of the domUniqueNodeNr is still desirable, but it turned out, that it should be carefully considered, when it should be done. 2003-01-29 Rolf Ade * generic/dom.c * generic/tcldom.c * tests/xslt.test: Changed escaping of serialized XML. The previous behavior wasn't 'wrong', but now we do it along the lines of almost all other (important) tools and it seems there's al least some xslt code out there, which banks on this 'common' way of serializing. Though, there is a small risk, that this is an incompatible change for a few users. * generic/dom.c * generic/dom.h * generic/xmlsimple.c * tests/dom.test: Fixed the problem of 'changing node references' under some circumstances (reported by Wilhelm Klink). This also decrease the possibility of a potential problem for extremely long running single threaded tDOM applications. * generic/dom.c * generic/tcldom.c * tests/dom.test: Fix for the problem with ownerDocument reported by Oleg Oleinick (see test dom-29.1). * generic/tcldom.c * tests/dom.test: Fixed bug with COMMENT_NODEs while using the asList method (problem reported by Ramon Ribó). While at it, also added code for handling processing instructions, which was also missing, up to now. 2003-01-11 Rolf Ade * generic/dom.c * generic/dom.h * generic/domxslt.c * generic/domxslt.h * generic/tcldom.c: Added conversion of XSLT stylesheet DOM trees to 'cached' xslt cmds (new domDoc method toXSLTcmd). Works for non threaded tcl; needs additional work for multi-threaded tcl and documentation. * generic/domxslt.c: Fixed a bug introduced during rework of the white space stripping for XML sources. * generic/tclexpat.c: Editorial change (Typo in comment) 2002-12-28 Rolf Ade * generic/domxslt.c * generic/domxslt.h * generic/tcldom.c * doc/domNode.* * doc/domDoc.* * tests/xslt.test: The xslt method now understands also the options -ignoreUndeclaredParameters and -xsltmessagecmd. * tests/xpath.test * generic/tcldom.h: Editorial changes. 2002-12-23 Rolf Ade * generic/domxslt.c: Reworked the white space stripping for XML sources a bit. Better white space handling in token lists. 2002-12-21 Rolf Ade * generic/domxpath.c: Fixed the changes by me in rev. 1.60 in the XPath Lexer. 2002-12-20 Zoran Vasiljevic (zoran@archiware.com) * generic/tcldom.c * generic/dom.c * generic/domxpath.c * generic/domalloc.c * generic/domhtml.c * generic/docxpath.c: added DBG macro arround some fprintf's 2002-11-28 Rolf Ade * generic/domxslt.c: Reuse already parsed trees only if it is requested again for the same matter (as stylesheet or as source dir), otherwise create a new tree, because of the different white space stripping rules for stylesheets and source documents. 2002-11-27 Rolf Ade * win/makefile805.vc: Added this file. VC++ 6.0 makefile to compile against tcl8.0.5, contributed by Sumit Pokhariyal. * generic/domxpath.c: FQ names with a localname equal to a XPath 'keyword' (for example ns1:div) are now recognized as node test (they raised error up to now). Changed generate-id() to return the more generic named 'id' instead of the up to now used 'node'. --- Release 0.7.5, 27. Nov. 2002 --- 2002-11-24 Rolf Ade * Makefile.in: Changed the order of the include dirs, to avoid clash with tcldom.h out of TclDOM-2.4, which will be installed in the same directory as tcl.h 2002-11-22 Rolf Ade * configure-tcl8.0.5: Added this file. Special configure for Tcl8.0.5 users. * README: Updated notes for Tcl8.0.5 users. 2002-11-21 Rolf Ade * doc/expat.*: We don't have a 'provide expat' anymore, it's all tdom. Fixed a typo. 2002-11-17 Rolf Ade * generic/domxslt.c: Report error, if xsl:import elements not come first. * doc/tnc.*: Better wording. 2002-11-16 Rolf Ade * win/makefile.vc * extensions/tnc/makefile.vc: A bit final tweaking for 0.7.5. 2002-11-16 Zoran Vasiljevic * generic/dom.h * generic/dom.c * generic/tcldom.c * generic/tclStubLib.c: fixed references to panic (now Tcl_Panic) Also, fixed some 8.0.5 compilation issues. * README: added some 8.0.5 compilation notes 2002-11-16 Rolf Ade * generic/tcldom.c: Fixed bugs, which only raised there head if compiled against tcl8.0.5. * tests/all.tcl * tests/loadtdom.tcl * tests/domCmd.test * tests/domnamespace.test * tests/htmlreader.test * tests/i18n.test * tests/xmlsimple.test * tests/xslt.test: Made test suite also running under tcl8.0.5. Added constraint to the tests, which uses i18n tcl features. * doc/tnc.xml * doc/tnc.html * doc/tnc.n: Updated documentation. 2002-11-15 Zoran Vasiljevic * generic/dom.h: added IS_DELETED node flag Changed domFreeNode to accept one additional parameter. This parameter is used to signal the function to perform node-walk and invoke user-supplied callback w/o actually freeing the node. This functionality is required for example when a thread detaches from the shared DOM tree and wants to detach all eventual node commands from its interpreter. Added "struct domNode *deletedNodes" in the document structure This is the head of all nodes spliced out of the tree but not yet free'd. This is needed in order to avoid memory trashing when one thread deletes the node and the second thread still holds the reference to it over the nodecmd command. Added "struct domNode *nextDeleted" to maintain the list of deleted nodes, as explained above. * generic/tcldom.c: introduced changes in the way nodes are deleted from the tree in multi-threading shared-tree situations. We now do not delete nodes having references from nodecmds from different threads/interpreters. Instead, we put them on the deleted nodes list and tear-down this list when we delete the document. * generic/tcldom.c: when a thread detaches from the shared dom tree it will now properly delete all commands attached to nodes. Also, the dom object command barks when attempting to use already deleted node (the node put on the deletion list). 2002-11-15 Rolf Ade * tests/dom.test: Added some tests for as yet not covered node methods. * tests/htmlreader.test: Minor fix: added tcltest cleanup. * generic/tcldom.c: Changed 'attributes' method to return the empty string as result for non element nodes, according to the DOM 2 rec, chapter "Interface Node". Fixed a seg fault in hasAttributeNS. Closed a mem leak in appendXML. * lib/tdom.tcl: Added simple debugging feature to tDOM::extRefHandler. 2002-11-14 Zoran Vasiljevic * generic/tcldom.c: fixed UMR report from Purify 2002-11-12 Rolf Ade * win/makefile.vc * extensions/tnc/makefile.vc: Updated to the new version nr and the lib name convention of the new TEA 2 build system. 2002-11-09 Rolf Ade * generic/tcldom.c: HTML serializer: No content escaping for the HTML tags script and style, according to XSLT rec 16.2. Fixed a memory problem during interp deletion. * generic/dom.c * generic/domxpath.c: Minor changes. 2002-11-03 Rolf Ade * lib/tdom.tcl: tDOM::xmlOpenFile fix for files < 4 Byte size. * generic/domxpath.c * generic/domxpath.h: Fixed ridiculously long runtime of certain // expr on certain documents. During analysis and testing, it turned out, that it would have been an even simpler approach, to simply expand the abbreviation // in the according productions. Though, the choosen implentation seems often to be (slightly) faster and is a start to collect experiences with early predicate evaluation. 2002-11-02 Zoran Vasiljevic * lib/tdomhtml.tcl: removed in favour of new tdom extension * extensions/tdomhtml: added new tdom extension for HTML generation based on tdomhtml.tcl and internal tdom appendFromScript mechanism. This is a Tcl-only extension which merely needs to be "make install"'ed. * Makefile.in: removed traces of tdomhtml.tcl file since it now lives in its own extension * configure.in: * configure: added TDOM_LD_SEARCH_FLAGS processing to help runtime linker locate eventual custom shared libraries 2002-11-01 Rolf Ade * Makefile.in: Fixed 'missing separator' problem (using tab instead of white space). * lib/tdom.tcl: Updated function-available, corrected ridiculous typo by my (element-avaliable -> element-available). Somewhat fixed and updated element-available. * generic/domxpath.c * tests/xpath.c: Full qualified XPath function names now are accepted as syntactical correct expr. The function call is resolved to the Tcl proc dom::xpathFunc::::. * generic/dom.c * generic/dom.h * generic/domxslt.c * generic/nodecmd.c * generic/tcldom.c * tests/xpath.test: Fixed old problem with Combine Set XPath expressions and XSLT sorts on trees, in which new nodes are inserted after the initial parsing (doc order of result). 2002-10-31 Zoran Vasiljevic * lib/tdom.tcl: does now "package require tdom" only, instead of "package provide tdom 0.7.5". The "package provide" with a correct version is done by the C-module now (which is better). Some cosmetic changes as well (keep 80-columns wide!). * lib/tdomhtml.tcl: renamed version of domhtml.tcl Also did some simplification in html2tcl, renamed some internal private functions and added namespace-wide definitions of html command names. The _2tcl procedure now creates the missing elementNode commands as it parses the html code, on the fly. * Makefile.in: changed order of loads in the pkgIndex.tcl. First the C-module is loaded, followed by the tdom.tcl library file, followed by the tdomhtml.tcl library file. Thus, the tdomhtml.tcl has become the first class citizen. * CHANGES: added this file 2002-10-31 Rolf Ade * generic/tcldom.c * tests/dom.test: Fixed argument check of domObj method documentElement. Fixed domNode method appendFromList (wrong list format could result in seg fault). Thanks to Oleg Oleinick, for reporting both problems. * generic/domxslt.c * generic/domxpath.c * generic/dom.c: Fixed mem leaks/possible invalid read 2002-10-30 Zoran Vasiljevic * generic/domxslt.c: added proper cast to arguments passed to FREE() macro to avoid compiler barking at us. 2002-10-30 Rolf Ade * generic/tcldom.c: Added -escapeNonASCII and -htmlEntities also to node_usage and domObj_usage. * extensions/tnc/test.tcl: Updated to use new tDOM features. Made more usable. * apps/xslt.tcl: Updated to using domDoc xslt method, -escapeNonASCII for asXML and asHTML and additionally -htmlEntities for asHTML. * generic/domxslt.c: Implemented "Forwards-Compatible Processing" (XSLT rec 2.5), with limitations: xsl:version attributes on literal result elements are not supported. Fixed a bug in XPath func format-number(). XsltProcess now accepts also a domDoc. Improved the setting of the documentElement of the resultDoc. 2002-10-29 Rolf Ade * generic/tcldom.c: * doc/domDoc.* * doc/domNode.*: Added -escapeNonASCII as option to the asXML and asHTML methods and -htmlEntities as option to the asHTML method. Added "xslt" method to domDoc commands. * generic/dom.c: Better error reporting in case of parsing errors in external entities. * doc/expat.*: Fixed a documentation bug. 2002-10-29 Zoran Vasiljevic * generic/tcldom.c * generic/nodecmd.c * generic/nodecmd.h: modified "dom createNodeCmd" to accept the -returnNodeCmd" optional argument. All commands created with this option willreturn the dom object command for accessing the generated node. * ChangeLog: added this file tDOM-0.8.3/mac/0000755000175000017500000000000011004674374013325 5ustar ssobernissobernitDOM-0.8.3/mac/tDOM/0000755000175000017500000000000011004674374014130 5ustar ssobernissobernitDOM-0.8.3/mac/tDOM/pkgIndex.tcl0000644000175000017500000000034407730740565016415 0ustar ssobernissoberniif {[catch {package require Tcl 8.2}]} return package ifneeded tdom 0.7.8 [list load [file join $dir tDOM.0.7.8.dylib] Tdom] package ifneeded tnc 0.3.0 "package require tdom; load [list [file join $dir tnc.0.3.0.dylib]] tnc" tDOM-0.8.3/mac/tDOM/tdom.tcl0000644000175000017500000006612207637206044015610 0ustar ssobernissoberni#---------------------------------------------------------------------------- # Copyright (c) 1999 Jochen Loewer (loewerj@hotmail.com) #---------------------------------------------------------------------------- # # $Header: /usr/local/pubcvs/tdom/mac/tDOM/tdom.tcl,v 1.1 2003/03/23 01:21:40 rolf Exp $ # # # The higher level functions of tDOM written in plain Tcl. # # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://www.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the # License for the specific language governing rights and limitations # under the License. # # The Original Code is tDOM. # # The Initial Developer of the Original Code is Jochen Loewer # Portions created by Jochen Loewer are Copyright (C) 1998, 1999 # Jochen Loewer. All Rights Reserved. # # Contributor(s): # Rolf Ade (rolf@pointsman.de): 'fake' nodelists/live childNodes # # written by Jochen Loewer # April, 1999 # #---------------------------------------------------------------------------- package require tdom #---------------------------------------------------------------------------- # setup namespaces for additional Tcl level methods, etc. # #---------------------------------------------------------------------------- namespace eval ::dom { namespace eval domDoc { } namespace eval domNode { } namespace eval DOMImplementation { } namespace eval xpathFunc { } namespace eval xpathFuncHelper { } } namespace eval ::tDOM { variable extRefHandlerDebug 0 variable useForeignDTD "" } #---------------------------------------------------------------------------- # hasFeature (DOMImplementation method) # # # @in url the URL, where to get the XML document # # @return document object # @exception XML parse errors, ... # #---------------------------------------------------------------------------- proc ::dom::DOMImplementation::hasFeature { dom feature {version ""} } { switch $feature { xml - XML { if {($version == "") || ($version == "1.0")} { return 1 } } } return 0 } #---------------------------------------------------------------------------- # load (DOMImplementation method) # # requests a XML document via http using the given URL and # builds up a DOM tree in memory returning the document object # # # @in url the URL, where to get the XML document # # @return document object # @exception XML parse errors, ... # #---------------------------------------------------------------------------- proc ::dom::DOMImplementation::load { dom url } { error "Sorry, load method not implemented yet!" } #---------------------------------------------------------------------------- # isa (docDoc method, for [incr tcl] compatibility) # # # @in className # # @return 1 iff inherits from the given class # #---------------------------------------------------------------------------- proc ::dom::domDoc::isa { doc className } { if {$className == "domDoc"} { return 1 } return 0 } #---------------------------------------------------------------------------- # info (domDoc method, for [incr tcl] compatibility) # # # @in subcommand # @in args # #---------------------------------------------------------------------------- proc ::dom::domDoc::info { doc subcommand args } { switch $subcommand { class { return "domDoc" } inherit { return "" } heritage { return "domDoc {}" } default { error "domDoc::info subcommand $subcommand not yet implemented!" } } } #---------------------------------------------------------------------------- # importNode (domDoc method) # # Document Object Model (Core) Level 2 method # # # @in subcommand # @in args # #---------------------------------------------------------------------------- proc ::dom::domDoc::importNode { doc importedNode deep } { if {$deep || ($deep == "-deep"} { set node [$importedNode cloneNode -deep] } else { set node [$importedNode cloneNode] } return $node } #---------------------------------------------------------------------------- # isa (domNode method, for [incr tcl] compatibility) # # # @in className # # @return 1 iff inherits from the given class # #---------------------------------------------------------------------------- proc ::dom::domNode::isa { doc className } { if {$className == "domNode"} { return 1 } return 0 } #---------------------------------------------------------------------------- # info (domNode method, for [incr tcl] compatibility) # # # @in subcommand # @in args # #---------------------------------------------------------------------------- proc ::dom::domNode::info { doc subcommand args } { switch $subcommand { class { return "domNode" } inherit { return "" } heritage { return "domNode {}" } default { error "domNode::info subcommand $subcommand not yet implemented!" } } } #---------------------------------------------------------------------------- # isWithin (domNode method) # # tests, whether a node object is nested below another tag # # # @in tagName the nodeName of an elment node # # @return 1 iff node is nested below a element with nodeName tagName # 0 otherwise # #---------------------------------------------------------------------------- proc ::dom::domNode::isWithin { node tagName } { while {[$node parentNode] != ""} { set node [$node parentNode] if {[$node nodeName] == $tagName} { return 1 } } return 0 } #---------------------------------------------------------------------------- # tagName (domNode method) # # same a nodeName for element interface # #---------------------------------------------------------------------------- proc ::dom::domNode::tagName { node } { if {[$node nodeType] == "ELEMENT_NODE"} { return [$node nodeName] } return -code error "NOT_SUPPORTED_ERR not an element!" } #---------------------------------------------------------------------------- # simpleTranslate (domNode method) # # applies simple translation rules similar to Cost's simple # translations to a node # # # @in output_var # @in trans_specs # #---------------------------------------------------------------------------- proc ::dom::domNode::simpleTranslate { node output_var trans_specs } { upvar $output_var output if {[$node nodeType] == "TEXT_NODE"} { append output [cgiQuote [$node nodeValue]] return } set found 0 foreach {match action} $trans_specs { if {[catch { if {!$found && ([$node selectNode self::$match] != "") } { set found 1 } } err]} { if {![string match "NodeSet expected for parent axis!" $err]} { error $err } } if {$found && ($action != "-")} { set stop 0 foreach {type value} $action { switch $type { prefix { append output [subst $value] } tag { append output <$value> } start { append output [eval $value] } stop { set stop 1 } } } if {!$stop} { foreach child [$node childNodes] { simpleTranslate $child output $trans_specs } } foreach {type value} $action { switch $type { suffix { append output [subst $value] } end { append output [eval $value] } tag { append output } } } return } } foreach child [$node childNodes] { simpleTranslate $child output $trans_specs } } #---------------------------------------------------------------------------- # a DOM conformant 'live' childNodes # # @return a 'nodelist' object (it is just the normal node) # #---------------------------------------------------------------------------- proc ::dom::domNode::childNodesLive { node } { return $node } #---------------------------------------------------------------------------- # item method on a 'nodelist' object # # @return a 'nodelist' object (it is just a normal # #---------------------------------------------------------------------------- proc ::dom::domNode::item { nodeListNode index } { return [lindex [$nodeListNode childNodes] $index] } #---------------------------------------------------------------------------- # length method on a 'nodelist' object # # @return a 'nodelist' object (it is just a normal # #---------------------------------------------------------------------------- proc ::dom::domNode::length { nodeListNode } { return [llength [$nodeListNode childNodes] $childNodes] } #---------------------------------------------------------------------------- # appendData on a 'CharacterData' object # #---------------------------------------------------------------------------- proc ::dom::domNode::appendData { node arg } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } set oldValue [$node nodeValue] $node nodeValue [append oldValue $arg] } #---------------------------------------------------------------------------- # deleteData on a 'CharacterData' object # #---------------------------------------------------------------------------- proc ::dom::domNode::deleteData { node offset count } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } incr offset -1 set before [string range [$node nodeValue] 0 $offset] incr offset incr offset $count set after [string range [$node nodeValue] $offset end] $node nodeValue [append before $after] } #---------------------------------------------------------------------------- # insertData on a 'CharacterData' object # #---------------------------------------------------------------------------- proc ::dom::domNode::insertData { node offset arg } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } incr offset -1 set before [string range [$node nodeValue] 0 $offset] incr offset set after [string range [$node nodeValue] $offset end] $node nodeValue [append before $arg $after] } #---------------------------------------------------------------------------- # replaceData on a 'CharacterData' object # #---------------------------------------------------------------------------- proc ::dom::domNode::replaceData { node offset count arg } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } incr offset -1 set before [string range [$node nodeValue] 0 $offset] incr offset incr offset $count set after [string range [$node nodeValue] $offset end] $node nodeValue [append before $arg $after] } #---------------------------------------------------------------------------- # substringData on a 'CharacterData' object # # @return part of the node value (text) # #---------------------------------------------------------------------------- proc ::dom::domNode::substringData { node offset count } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } set endOffset [expr $offset + $count - 1] return [string range [$node nodeValue] $offset $endOffset] } #---------------------------------------------------------------------------- # coerce2number # #---------------------------------------------------------------------------- proc ::dom::xpathFuncHelper::coerce2number { type value } { switch $type { empty { return 0 } number - string { return $value } attrvalues { return [lindex $value 0] } nodes { return [[lindex $value 0] selectNodes number()] } attrnodes { return [lindex $value 1] } } } #---------------------------------------------------------------------------- # coerce2string # #---------------------------------------------------------------------------- proc ::dom::xpathFuncHelper::coerce2string { type value } { switch $type { empty { return "" } number - string { return $value } attrvalues { return [lindex $value 0] } nodes { return [[lindex $value 0] selectNodes string()] } attrnodes { return [lindex $value 1] } } } #---------------------------------------------------------------------------- # function-available # #---------------------------------------------------------------------------- proc ::dom::xpathFunc::function-available { ctxNode pos nodeListType nodeList args} { if {[llength $args] != 2} { error "function-available(): wrong # of args!" } foreach { arg1Typ arg1Value } $args break set str [::dom::xpathFuncHelper::coerce2string $arg1Typ $arg1Value ] switch $str { boolean - ceiling - concat - contains - count - current - document - element-available - false - floor - format-number - generate-id - id - key - last - lang - local-name - name - namespace-uri - normalize-space - not - number - position - round - starts-with - string - string-length - substring - substring-after - substring-before - sum - translate - true - unparsed-entity-uri { return [list bool true] } default { set TclXpathFuncs [info procs ::dom::xpathFunc::*] if {[lsearch -exact $TclXpathFuncs $str] != -1} { return [list bool true] } else { return [list bool false] } } } } #---------------------------------------------------------------------------- # element-available # # This is not strictly correct. The XSLT namespace may be bound # to another prefix (and the prefix 'xsl' may be bound to another # namespace). Since the expression context isn't available at the # moment at tcl coded XPath functions, this couldn't be done better # than this "works in the 'normal' cases" version. #---------------------------------------------------------------------------- proc ::dom::xpathFunc::element-available { ctxNode pos nodeListType nodeList args} { if {[llength $args] != 2} { error "element-available(): wrong # of args!" } foreach { arg1Typ arg1Value } $args break set str [::dom::xpathFuncHelper::coerce2string $arg1Typ $arg1Value ] switch $str { xsl:stylesheet - xsl:transform - xsl:include - xsl:import - xsl:strip-space - xsl:preserve-space - xsl:template - xsl:apply-templates - xsl:apply-imports - xsl:call-template - xsl:element - xsl:attribute - xsl:attribute-set - xsl:text - xsl:processing-instruction - xsl:comment - xsl:copy - xsl:value-of - xsl:number - xsl:for-each - xsl:if - xsl:choose - xsl:when - xsl:otherwise - xsl:sort - xsl:variable - xsl:param - xsl:copy-of - xsl:with-param - xsl:key - xsl:message - xsl:decimal-format - xsl:namespace-alias - xsl:fallback { return [list bool true] } xsl:output - default { return [list bool false] } } } #---------------------------------------------------------------------------- # system-property # # This is not strictly correct. The XSLT namespace may be bound # to another prefix (and the prefix 'xsl' may be bound to another # namespace). Since the expression context isn't available at the # moment at tcl coded XPath functions, this couldn't be done better # than this "works in the 'normal' cases" version. #---------------------------------------------------------------------------- proc ::dom::xpathFunc::system-property { ctxNode pos nodeListType nodeList args } { if {[llength $args] != 2} { error "system-property(): wrong # of args!" } foreach { arg1Typ arg1Value } $args break set str [::dom::xpathFuncHelper::coerce2string $arg1Typ $arg1Value ] switch $str { xsl:version { return [list number 1.0] } xsl:vendor { return [list string "Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."] } xsl:vendor-url { return [list string "http://www.tdom.org"] } default { return [list string ""] } } } #---------------------------------------------------------------------------- # IANAEncoding2TclEncoding # #---------------------------------------------------------------------------- # As of version 8.3.4 tcl supports # cp860 cp861 cp862 cp863 tis-620 cp864 cp865 cp866 gb12345 cp949 # cp950 cp869 dingbats ksc5601 macCentEuro cp874 macUkraine jis0201 # gb2312 euc-cn euc-jp iso8859-10 macThai jis0208 iso2022-jp # macIceland iso2022 iso8859-13 iso8859-14 jis0212 iso8859-15 cp737 # iso8859-16 big5 euc-kr macRomania macTurkish gb1988 iso2022-kr # macGreek ascii cp437 macRoman iso8859-1 iso8859-2 iso8859-3 ebcdic # macCroatian koi8-r iso8859-4 iso8859-5 cp1250 macCyrillic iso8859-6 # cp1251 koi8-u macDingbats iso8859-7 cp1252 iso8859-8 cp1253 # iso8859-9 cp1254 cp1255 cp850 cp1256 cp932 identity cp1257 cp852 # macJapan cp1258 shiftjis utf-8 cp855 cp936 symbol cp775 unicode # cp857 # # Just add more mappings (and mail them to the tDOM mailing list, please). proc tDOM::IANAEncoding2TclEncoding {IANAName} { # First the most widespread encodings with there # preferred MIME name, to speed lookup in this # usual cases. Later the official names and the # aliases. # # For "official names for character sets that may be # used in the Internet" see # http://www.iana.org/assignments/character-sets # (that's the source for the encoding names below) # # Matching is case-insensitive switch [string tolower $IANAName] { "us-ascii" {return ascii} "utf-8" {return utf-8} "utf-16" {return unicode; # not sure about this} "iso-8859-1" {return iso8859-1} "iso-8859-2" {return iso8859-2} "iso-8859-3" {return iso8859-3} "iso-8859-4" {return iso8859-4} "iso-8859-5" {return iso8859-5} "iso-8859-6" {return iso8859-6} "iso-8859-7" {return iso8859-7} "iso-8859-8" {return iso8859-8} "iso-8859-9" {return iso8859-9} "iso-8859-10" {return iso8859-10} "iso-8859-13" {return iso8859-13} "iso-8859-14" {return iso8859-14} "iso-8859-15" {return iso8859-15} "iso-8859-16" {return iso8859-16} "iso-2022-kr" {return iso2022-kr} "euc-kr" {return euc-kr} "iso-2022-jp" {return iso2022-jp} "koi8-r" {return koi8-r} "shift_jis" {return shiftjis} "euc-jp" {return euc-jp} "gb2312" {return gb2312} "big5" {return big5} "cp866" {return cp866} "windows-1251" - "cp1251" {return cp1251} "iso_8859-1:1987" - "iso-ir-100" - "iso_8859-1" - "latin1" - "l1" - "ibm819" - "cp819" - "csisolatin1" {return iso8859-1} "iso_8859-2:1987" - "iso-ir-101" - "iso_8859-2" - "iso-8859-2" - "latin2" - "l2" - "csisolatin2" {return iso8859-2} "iso_8859-5:1988" - "iso-ir-144" - "iso_8859-5" - "iso-8859-5" - "cyrillic" - "csisolatincyrillic" {return iso8859-5} "ms_kanji" - "csshiftjis" {return shiftjis} "csiso2022kr" {return iso2022-kr} "ibm866" - "csibm866" {return cp866} default { # There are much more encoding names out there # It's only laziness, that let me stop here. error "Unrecognized encoding name '$IANAName'" } } } #---------------------------------------------------------------------------- # xmlOpenFile # #---------------------------------------------------------------------------- proc tDOM::xmlOpenFile {filename {encodingString {}}} { set fd [open $filename] if {$encodingString != {}} { upvar $encodingString encString } # The autodetection of the encoding follows # XML Recomendation, Appendix F fconfigure $fd -encoding binary if {![binary scan [read $fd 4] "H8" firstBytes]} { # very short (< 4 Bytes) file seek $fd 0 start set encString UTF-8 return $fd } # First check for BOM switch [string range $firstBytes 0 3] { "feff" - "fffe" { # feff: UTF-16, big-endian BOM # ffef: UTF-16, little-endian BOM seek $fd 0 start set encString UTF-16 fconfigure $fd -encoding identity return $fd } } # If the entity has a XML Declaration, the first four characters # must be "" $head] if {$closeIndex == -1} { error "Wired XML data or not XML data at all" } seek $fd 0 start set xmlDeclaration [read $fd [expr {$closeIndex + 5}]] # extract the encoding information set pattern {encoding=[\x20\x9\xd\xa]*["']([^ "']+)['"]} # emacs: " if {![regexp $pattern $head - encStr]} { # Probably something like . # Without encoding declaration this must be UTF-8 set encoding utf-8 set encString UTF-8 } else { set encoding [IANAEncoding2TclEncoding $encStr] set encString $encStr } } "0000003c" - "0000003c" - "3c000000" - "00003c00" { # UCS-4 error "UCS-4 not supported" } "003c003f" - "3c003f00" { # UTF-16, big-endian, no BOM # UTF-16, little-endian, no BOM seek $fd 0 start set encoding identity set encString UTF-16 } "4c6fa794" { # EBCDIC in some flavor error "EBCDIC not supported" } default { # UTF-8 without an encoding declaration seek $fd 0 start set encoding identity set encString "UTF-8" } } fconfigure $fd -encoding $encoding return $fd } #---------------------------------------------------------------------------- # xmlReadFile # #---------------------------------------------------------------------------- proc tDOM::xmlReadFile {filename {encodingString {}}} { if {$encodingString != {}} { upvar $encodingString encString } set fd [xmlOpenFile $filename encString] set data [read $fd [file size $filename]] close $fd return $data } #---------------------------------------------------------------------------- # extRefHandler # # A very simple external entity resolver, included for convenience. # Depends on the tcllib package uri and resolves only file URLs. # #---------------------------------------------------------------------------- if {![catch {package require uri}]} { proc tDOM::extRefHandler {base systemId publicId} { variable extRefHandlerDebug variable useForeignDTD if {$extRefHandlerDebug} { puts stderr "tDOM::extRefHandler called with:" puts stderr "\tbase: '$base'" puts stderr "\tsystemId: '$systemId'" puts stderr "\tpublicId: '$publicId'" } if {$systemId == ""} { if {$useForeignDTD != ""} { set systemId $useForeignDTD } else { return -code error -errorinfo "::tDOM::useForeignDTD does\ not point to the foreign DTD" } } set absolutURI [uri::resolve $base $systemId] array set uriData [uri::split $absolutURI] switch $uriData(scheme) { file { return [list string $absolutURI [xmlReadFile $uriData(path)]] } default { return -code error -errorinfo "can only handle file URI's" } } } } #---------------------------------------------------------------------------- # baseURL # # A simple convenience proc which returns an absolute URL for a given # filename. # #---------------------------------------------------------------------------- proc tDOM::baseURL {path} { switch [file pathtype $path] { "relative" { return "file://[pwd]/$path" } default { return "file://$path" } } } # EOF tDOM-0.8.3/mac/tDOM/CVS/0000755000175000017500000000000011004674374014563 5ustar ssobernissobernitDOM-0.8.3/mac/tDOM/CVS/Root0000644000175000017500000000006211004674374015427 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/mac/tDOM/CVS/Entries0000644000175000017500000000013011004674374016111 0ustar ssobernissoberni/pkgIndex.tcl/1.2/Sun Sep 14 01:16:37 2003// /tdom.tcl/1.1/Sun Mar 23 01:21:40 2003// D tDOM-0.8.3/mac/tDOM/CVS/Repository0000644000175000017500000000001611004674374016662 0ustar ssobernissobernitdom/mac/tDOM tDOM-0.8.3/mac/Prefix/0000755000175000017500000000000011004674374014562 5ustar ssobernissobernitDOM-0.8.3/mac/Prefix/tncPrefix_OSX.h0000644000175000017500000000015607637661510017435 0ustar ssobernissoberni#pragma once on #define USE_TDOM_STUBS 1 #include "tDOMPrefix_OSX.h" #undef VERSION #define VERSION "0.3" tDOM-0.8.3/mac/Prefix/expatPrefix.h0000644000175000017500000000002507631655214017232 0ustar ssobernissoberni#define MACOS_CLASSICtDOM-0.8.3/mac/Prefix/expatPrefix_OSX.h0000644000175000017500000000007007631655214017763 0ustar ssobernissoberni#define MACOS_CLASSIC #include "MSL MacHeadersMach-O.h"tDOM-0.8.3/mac/Prefix/tDOMPrefix.h0000644000175000017500000000020010660664350016704 0ustar ssobernissoberni#pragma once on #include "tclMacCommonPch.h" #define USE_TCL_STUBS 1 #define TDOM_NO_UNKNOWN_CMD #define VERSION "0.8.3" tDOM-0.8.3/mac/Prefix/tDOMPrefix_OSX.h0000644000175000017500000000170110660664407017447 0ustar ssobernissoberni#pragma once on #include "CoreHeadersMach-O.h" // These symbols are defined from MSL MacHeadersMach-O.h // (errno.h and stat.h are in the Kernel.framework) // and are redefined later in TclErrno.h : undef them // to avoid error message #undef EOVERFLOW #undef EOPNOTSUPP // This avoids the loading of stat.h from tclMacPort.h #define _MSL_STAT_H // --------------------------------------------------------------- // Replace #include "tclMacCommonPch.h" by its partial contents. #if !__option(enumsalwaysint) #error Tcl requires the Metrowerks setting "Enums always ints". #endif // Tell Tcl (or any Tcl extensions) that we are compiling for the Macintosh platform. #define MAC_TCL // --------------------------------------------------------------- #define USE_TCL_STUBS 1 // See dom.h for this one: #define USE_NORMAL_ALLOCATOR #define TCL_MEM_DEBUG #define MAC_OSX_TCL #define TDOM_NO_UNKNOWN_CMD #define VERSION "0.8.3" #include tDOM-0.8.3/mac/Prefix/CVS/0000755000175000017500000000000011004674374015215 5ustar ssobernissobernitDOM-0.8.3/mac/Prefix/CVS/Root0000644000175000017500000000006211004674374016061 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/mac/Prefix/CVS/Entries0000644000175000017500000000043411004674374016552 0ustar ssobernissoberni/expatPrefix.h/1.1/Thu Mar 6 14:26:20 2003// /expatPrefix_OSX.h/1.1/Thu Mar 6 14:26:20 2003// /tDOMPrefix.h/1.8/Wed Aug 15 20:58:16 2007// /tDOMPrefix_OSX.h/1.8/Wed Aug 15 20:58:47 2007// /tncPrefix.h/1.2/Mon Mar 24 19:58:00 2003// /tncPrefix_OSX.h/1.2/Mon Mar 24 19:58:00 2003// D tDOM-0.8.3/mac/Prefix/CVS/Repository0000644000175000017500000000002011004674374017307 0ustar ssobernissobernitdom/mac/Prefix tDOM-0.8.3/mac/Prefix/tncPrefix.h0000644000175000017500000000021207637661510016675 0ustar ssobernissoberni#pragma once on #include "tclMacCommonPch.h" #define USE_TCL_STUBS 1 #define USE_TDOM_STUBS 1 #undef VERSION #define VERSION "0.3" tDOM-0.8.3/mac/tDOM.0.7.5/0000755000175000017500000000000011004674374014576 5ustar ssobernissobernitDOM-0.8.3/mac/tDOM.0.7.5/CVS/0000755000175000017500000000000011004674374015231 5ustar ssobernissobernitDOM-0.8.3/mac/tDOM.0.7.5/CVS/Root0000644000175000017500000000006211004674374016075 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/mac/tDOM.0.7.5/CVS/Entries0000644000175000017500000000000211004674374016555 0ustar ssobernissoberniD tDOM-0.8.3/mac/tDOM.0.7.5/CVS/Repository0000644000175000017500000000002411004674374017327 0ustar ssobernissobernitdom/mac/tDOM.0.7.5 tDOM-0.8.3/mac/tDOM_OSX.prj.xml0000644000175000017500000173145107640154644016215 0ustar ssobernissoberni ]> tDOM dylib UserSourceTrees NameTclTk KindAbsolutePath Path Pathhd3:Tcl:Sources:TclTk_8.4.1: PathFormatMacOS PathRoot AlwaysSearchUserPathsfalse InterpretDOSAndUnixPathstrue RequireFrameworkStyleIncludestrue UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:tcl:mac: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:tcl:generic: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:tcl:compat: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::System:Library:Frameworks:CoreServices.framework:Versions:A: PathFormatMacOS PathRootSystem Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::expat: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::generic: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::expat: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL:MSL_C: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL:MSL_Extras: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS X Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:usr:include: PathFormatMacOS PathRootOS X Volume Recursivefalse FrameworkPathfalse HostFlagsAll SearchPath Path:usr:lib: PathFormatMacOS PathRootOS X Volume Recursivefalse FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:Libraries:Runtime:Common Includes: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:Universal:Interfaces:CIncludes: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:System:Library:Frameworks: PathFormatMacOS PathRootOS X Volume Recursivefalse FrameworkPathtrue HostFlagsAll SearchPath Path::Library:Frameworks: PathFormatMacOS PathRootSystem Recursivefalse FrameworkPathtrue HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS X PPC Linker PreLinker PostLinker TargetnametDOM dylib OutputDirectory Path:tDOM: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMDYL FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMLIB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMMLB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.axp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.h++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.hpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.lcf Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.m CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.mm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchmm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.plc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.ploc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.wke Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.a CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.dylib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.gif CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.icns CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.jpg CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.lib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.nib CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.plist CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.strings CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.tiff CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeadersMach-O.c CodeCompletionMacroFileNameMacOSX_BSD_C++_Macros.h ConsoleEncoding0 LogSystemMessagesfalse AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_mpwpointerstyle1 MWFrontEnd_C_prefixnametDOMPrefix_OSX.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline1 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline1 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen1 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg1 MWWarning_C_warn_extracomma1 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual1 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass1 MWFTP_Post_hostName MWFTP_Post_username MWFTP_Post_password0véP ýϐ ýËÈ MWFTP_Post_remoteDir MWFTP_Post_ftp_PathVersion1 MWFTP_Post_ftp_PathType0 MWFTP_Post_ftp_PathFormat0 MWFTP_Post_ftp_tree MWFTP_Post_uploadDir MWFTP_Post_ftp_port21 MWFTP_Post_SendBin1 MWFTP_Post_ShouldLog1 MWCommandLine_Java_clsName MWCommandLine_Java_args MWVJavaDebugging_Protocol1 MWVJavaDebugging_JDKVersion1 MWVJavaDebugging_TimeOut15 MWVJavaDebugging_SupportSlowDevicesfalse MWVJavaDebugging_UseRemoteLaunchAgentfalse MWVJavaDebugging_LaunchVMasServerfalse MWJava_Language_optimizefalse MWJava_Language_warnDeprecatedfalse MWJava_Language_emitMapfalse MWJava_Language_strictFileNamesfalse MWJava_Language_strictFileHierarchyfalse MWJava_Language_1_1_Compatiblefalse MWJava_Language_emitHeaders0 MWJava_Language_headerTypeJNINativeHeaders MWJava_Language_packageFilter MWJava_Language_genCommentstrue MWJava_Language_genHeadersfalse MWJava_Language_enableAssertsfalse MWJava_Language_targetVM1.1 Manifest-JAD Attributes AttributeMain-Class ValueAuto-Generated MWJava_MRJAppBuilder_outFileMRJApplication MWJava_MRJAppBuilder_mergefalse MWJava_MRJAppBuilder_quitMenutrue MWJava_MRJAppBuilder_growfalse MWJava_MRJAppBuilder_stdoutTypeConsole MWJava_MRJAppBuilder_stderrTypeConsole MWJava_MRJAppBuilder_stdinTypeConsole MWJava_MRJAppBuilder_appIconPVersion1 MWJava_MRJAppBuilder_appIconPType0 MWJava_MRJAppBuilder_appIconPFormat0 MWJava_MRJAppBuilder_appIconPTree MWJava_MRJAppBuilder_appIconFile MWJava_MRJAppBuilder_splashScreenPVersion1 MWJava_MRJAppBuilder_splashScreenPType0 MWJava_MRJAppBuilder_splashScreenPFormat0 MWJava_MRJAppBuilder_splashScreenPTree MWJava_MRJAppBuilder_splashScreenPICTFile MWJava_MRJAppBuilder_aboutName MWJava_MRJAppBuilder_stdoutPVersion1 MWJava_MRJAppBuilder_stdoutPType0 MWJava_MRJAppBuilder_stdoutPFormat0 MWJava_MRJAppBuilder_stdoutPTree MWJava_MRJAppBuilder_stdoutFile MWJava_MRJAppBuilder_stdoutAppendfalse MWJava_MRJAppBuilder_stderrPType0 MWJava_MRJAppBuilder_stderrPFormat0 MWJava_MRJAppBuilder_stderrPTree MWJava_MRJAppBuilder_stderrFile MWJava_MRJAppBuilder_stderrAppendfalse MWJava_MRJAppBuilder_stdinPType0 MWJava_MRJAppBuilder_stdinPFormat0 MWJava_MRJAppBuilder_stdinPTree MWJava_MRJAppBuilder_stdinFile MWJava_Output_outputtypeJarFile MWJava_Output_outfileJavaClasses.jar MWJava_Output_ftype1514754080 MWJava_Output_fcreator1297570384 MWJava_Output_compress0 MWJava_Output_genManifest0 MWJava_Output_trunctypeFront MWJava_Output_deleteClasses0 MWJava_Output_consoleApp1 MWJava_Output_preverify0 MWJava_Output_genJad0 MWJava_Output_obfuscate0 MWJava_Proj_projtypeApplet MWJava_Proj_mainClassName MWJava_Proj_HTMLAppCreator1463898714 MWJava_Proj_HTMLAppName MWJava_Proj_PathVersion1 MWJava_Proj_PathType0 MWJava_Proj_PathFormat0 MWJava_Proj_tree MWJava_Proj_HTMLAppWin32Name MWJava_Proj_compress0 MWJava_Proj_simulator0 MWJava_Proj_useVM\000\000mrj225 MWJava_Proj_vmarguments MWJava_Proj_vmName MWJava_Proj_simPropFile MWJavaDoc_Proj_Version1 MWJavaDoc_Proj_Deprecated1 MWJavaDoc_Proj_Author1 MWJavaDoc_Proj_Index1 MWJavaDoc_Proj_Tree1 MWJavaDoc_Proj_SunResolveToSame0 MWJavaDoc_Proj_Shortnames1 MWJavaDoc_Proj_Folder0 MWJavaDoc_Proj_GenerateAPILinks0 MWJavaDoc_Proj_scopePublic MWJavaDoc_Proj_fcreator1297303877 MWJavaDoc_Proj_encodingName MWJavaDoc_Proj_decodingName MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments MWMacOSPackager_UsePackager0 MWMacOSPackager_FolderToPackage Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreateClassicAlias0 MWMacOSPackager_ClassicAliasMethodUseTargetOutput MWMacOSPackager_ClassicAliasPath Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreatePkgInfo0 MWMacOSPackager_PkgCreatorType???? MWMacOSPackager_PkgFileTypeAPPL MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesInline MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole0 MWCodeGen_PPC_readonlystrings0 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_peephole0 MWCodeGen_MachO_readonlystrings1 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix1 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath1 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_split_segs0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsFile MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainname MWProject_MacOSX_typeSharedLibrary MWProject_MacOSX_outfiletDOM.0.7.7.dylib MWProject_MacOSX_filecreator???? MWProject_MacOSX_filetypeMDYL MWProject_MacOSX_vmaddress0 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWLinker_MachO_exportsPragma MWLinker_MachO_mainnamestart MWLinker_MachO_currentversion0 MWLinker_MachO_compatibleversion0 MWLinker_MachO_symfullpath0 MWLinker_MachO_supresswarnings0 MWLinker_MachO_multisymerror1 MWLinker_MachO_prebind1 MWLinker_MachO_deadstrip1 MWLinker_MachO_objectivecsemantics0 MWLinker_MachO_whichfileloaded0 MWLinker_MachO_whyfileloaded0 MWLinker_MachO_readonlyrelocsErrors MWLinker_MachO_undefinedsymbolsErrors MWLinker_MachO_twolevelnamespace1 MWLinker_MachO_stripdebugsymbols0 MWProject_MachO_typeSharedLibrary MWProject_MachO_outfileDynamic Library.dylib MWProject_MachO_filecreator???? MWProject_MachO_filetypeMDYL MWProject_MachO_vmaddress4096 MWProject_MachO_flatrsrc0 MWProject_MachO_flatrsrcfilename MWProject_MachO_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MachO_installpath./ MWProject_MachO_frameworkversion MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeApplication MWProject_PPC_outfileStd C Console PPC MWProject_PPC_filecreator???? MWProject_PPC_filetypeAPPL MWProject_PPC_size384 MWProject_PPC_minsize384 MWProject_PPC_stacksize64 MWProject_PPC_flags22720 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmanglefalse PDisasmX86_verbosefalse PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name dylib1.o MacOS Library Debug Name MSL_All_Mach-O_D.lib MacOS Library Debug Name aolstub.cpp MacOS Text Name domalloc.c MacOS Text Name domhtml.c MacOS Text Name domlock.c MacOS Text Name domxpath.c MacOS Text Name domxslt.c MacOS Text Name nodecmd.c MacOS Text Name tcldom.c MacOS Text Name tclexpat.c MacOS Text Name tdominit.c MacOS Text Name tdomStubInit.c MacOS Text Name tdomStubLib.c MacOS Text Name utf8conv.c MacOS Text Name xmlsimple.c MacOS Text Name dom.c MacOS Text Name console.stubs.c MacOS Text Debug Name Expat1.95.6_Mach-O.lib MacOS Library Debug, TargetOutputFile Name tDOM.exp MacOS Text Debug Name dylib1.o MacOS Name MSL_All_Mach-O_D.lib MacOS Name aolstub.cpp MacOS Name domalloc.c MacOS Name domhtml.c MacOS Name domlock.c MacOS Name domxpath.c MacOS Name domxslt.c MacOS Name nodecmd.c MacOS Name tcldom.c MacOS Name tclexpat.c MacOS Name tdominit.c MacOS Name tdomStubInit.c MacOS Name tdomStubLib.c MacOS Name utf8conv.c MacOS Name xmlsimple.c MacOS Name dom.c MacOS Name console.stubs.c MacOS Name Expat1.95.6_Mach-O.lib MacOS Name tDOM.exp MacOS Expat Mach-O static LinkAgainst Name Expat1.95.6_Mach-O.lib MacOS Name Tcl.framework MacOS Tcl Name System.framework MacOS System Name Carbon.framework MacOS Carbon Name CoreServices.framework MacOS CoreServices Precomp UserSourceTrees AlwaysSearchUserPathsfalse InterpretDOSAndUnixPathstrue RequireFrameworkStyleIncludestrue UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath Path:MSL:MSL_C: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL:MSL_C++: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS X Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:usr:include: PathFormatMacOS PathRootOS X Volume Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::System:Library:Frameworks: PathFormatMacOS PathRootSystem Recursivefalse FrameworkPathtrue HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS X PPC Linker PreLinker PostLinker TargetnamePrecomp OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMDYL FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMLIB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMMLB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.axp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.h++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.hpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.lcf Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.m CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.mm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchmm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.plc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.ploc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.wke Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.a CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.dylib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.gif CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.icns CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.jpg CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.lib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.nib CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.plist CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.strings CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.tiff CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatesfalse DumpBrowserInfofalse CacheSubprojectsfalse UseThirdPartyDebuggerfalse BrowserGenerator0 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos1 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixname MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings0 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse1 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen0 MWFrontEnd_C_templateparser1 MWFrontEnd_C_c991 MWFrontEnd_C_bottomupinline1 MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg1 MWWarning_C_warn_extracomma1 MWWarning_C_pedantic1 MWWarning_C_warningerrors1 MWWarning_C_warn_hidevirtual1 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass1 MWFTP_Post_hostName MWFTP_Post_username MWFTP_Post_password0véP ýϐ ýËÈ MWFTP_Post_remoteDir MWFTP_Post_ftp_PathVersion0 MWFTP_Post_ftp_PathType0 MWFTP_Post_ftp_PathFormat0 MWFTP_Post_ftp_tree MWFTP_Post_uploadDir MWFTP_Post_ftp_port21 MWFTP_Post_SendBin1 MWFTP_Post_ShouldLog1 MWCommandLine_Java_clsName MWCommandLine_Java_args MWVJavaDebugging_Protocol1 MWVJavaDebugging_JDKVersion1 MWVJavaDebugging_TimeOut25 MWVJavaDebugging_SupportSlowDevicesfalse MWVJavaDebugging_UseRemoteLaunchAgentfalse MWVJavaDebugging_LaunchVMasServerfalse MWJava_Language_optimizefalse MWJava_Language_warnDeprecatedfalse MWJava_Language_emitMapfalse MWJava_Language_strictFileNamesfalse MWJava_Language_strictFileHierarchyfalse MWJava_Language_1_1_Compatiblefalse MWJava_Language_emitHeaders0 MWJava_Language_headerTypeJNINativeHeaders MWJava_Language_packageFilter MWJava_Language_genCommentstrue MWJava_Language_genHeadersfalse MWJava_Language_enableAssertsfalse MWJava_Language_targetVM1.1 Manifest-JAD Attributes AttributeMain-Class ValueAuto-Generated MWJava_MRJAppBuilder_outFileMRJApplication MWJava_MRJAppBuilder_mergefalse MWJava_MRJAppBuilder_quitMenutrue MWJava_MRJAppBuilder_growfalse MWJava_MRJAppBuilder_stdoutTypeConsole MWJava_MRJAppBuilder_stderrTypeConsole MWJava_MRJAppBuilder_stdinTypeConsole MWJava_MRJAppBuilder_appIconPVersion0 MWJava_MRJAppBuilder_appIconPType0 MWJava_MRJAppBuilder_appIconPFormat0 MWJava_MRJAppBuilder_appIconPTree MWJava_MRJAppBuilder_appIconFile MWJava_MRJAppBuilder_splashScreenPVersion0 MWJava_MRJAppBuilder_splashScreenPType0 MWJava_MRJAppBuilder_splashScreenPFormat0 MWJava_MRJAppBuilder_splashScreenPTree MWJava_MRJAppBuilder_splashScreenPICTFile MWJava_MRJAppBuilder_aboutName MWJava_MRJAppBuilder_stdoutPVersion0 MWJava_MRJAppBuilder_stdoutPType0 MWJava_MRJAppBuilder_stdoutPFormat0 MWJava_MRJAppBuilder_stdoutPTree MWJava_MRJAppBuilder_stdoutFile MWJava_MRJAppBuilder_stdoutAppendfalse MWJava_MRJAppBuilder_stderrPType0 MWJava_MRJAppBuilder_stderrPFormat0 MWJava_MRJAppBuilder_stderrPTree MWJava_MRJAppBuilder_stderrFile MWJava_MRJAppBuilder_stderrAppendfalse MWJava_MRJAppBuilder_stdinPType0 MWJava_MRJAppBuilder_stdinPFormat0 MWJava_MRJAppBuilder_stdinPTree MWJava_MRJAppBuilder_stdinFile MWJava_Output_outputtypeJarFile MWJava_Output_outfileJavaClasses.jar MWJava_Output_ftype1514754080 MWJava_Output_fcreator1297570384 MWJava_Output_compress0 MWJava_Output_genManifest0 MWJava_Output_trunctypeFront MWJava_Output_deleteClasses0 MWJava_Output_consoleApp1 MWJava_Output_preverify0 MWJava_Output_genJad0 MWJava_Output_obfuscate0 MWJava_Proj_projtypeApplet MWJava_Proj_mainClassName MWJava_Proj_HTMLAppCreator1463898714 MWJava_Proj_HTMLAppName MWJava_Proj_PathVersion0 MWJava_Proj_PathType0 MWJava_Proj_PathFormat0 MWJava_Proj_tree MWJava_Proj_HTMLAppWin32Name MWJava_Proj_compress0 MWJava_Proj_simulator1 MWJava_Proj_useVM\000\000mrj225 MWJava_Proj_vmarguments MWJava_Proj_vmName MWJava_Proj_simPropFile MWJavaDoc_Proj_Version1 MWJavaDoc_Proj_Deprecated1 MWJavaDoc_Proj_Author1 MWJavaDoc_Proj_Index1 MWJavaDoc_Proj_Tree1 MWJavaDoc_Proj_SunResolveToSame0 MWJavaDoc_Proj_Shortnames1 MWJavaDoc_Proj_Folder0 MWJavaDoc_Proj_GenerateAPILinks0 MWJavaDoc_Proj_scopePublic MWJavaDoc_Proj_fcreator1297303877 MWJavaDoc_Proj_encodingName MWJavaDoc_Proj_decodingName MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC mcvs FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments MWMacOSPackager_UsePackager0 MWMacOSPackager_FolderToPackage Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreateClassicAlias0 MWMacOSPackager_ClassicAliasMethodUseTargetOutput MWMacOSPackager_ClassicAliasPath Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreatePkgInfo0 MWMacOSPackager_PkgCreatorType???? MWMacOSPackager_PkgFileTypeAPPL MWCodeGen_PPC_structalignmentMC68K MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata1 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_readonlystrings1 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings1 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs0 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_split_segs0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainname MWProject_MacOSX_typeLibrary MWProject_MacOSX_outfiletemp_delete_me.lib MWProject_MacOSX_filecreatorCWIE MWProject_MacOSX_filetypeMLIB MWProject_MacOSX_vmaddress0 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWLinker_MachO_exportsNone MWLinker_MachO_mainname MWLinker_MachO_currentversion0 MWLinker_MachO_compatibleversion0 MWLinker_MachO_symfullpath0 MWLinker_MachO_supresswarnings0 MWLinker_MachO_multisymerror1 MWLinker_MachO_prebind1 MWLinker_MachO_deadstrip1 MWLinker_MachO_objectivecsemantics0 MWLinker_MachO_whichfileloaded0 MWLinker_MachO_whyfileloaded0 MWLinker_MachO_readonlyrelocsErrors MWLinker_MachO_undefinedsymbolsErrors MWLinker_MachO_twolevelnamespace1 MWLinker_MachO_stripdebugsymbols0 MWProject_MachO_typeLibrary MWProject_MachO_outfiletemp_delete_me MWProject_MachO_filecreatorCWIE MWProject_MachO_filetypeMLIB MWProject_MachO_vmaddress0 MWProject_MachO_flatrsrc0 MWProject_MachO_flatrsrcfilename MWProject_MachO_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MachO_installpath./ MWProject_MachO_frameworkversion MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeApplication MWProject_PPC_outfilea.out MWProject_PPC_filecreator???? MWProject_PPC_filetypeAPPL MWProject_PPC_size384 MWProject_PPC_minsize384 MWProject_PPC_stacksize64 MWProject_PPC_flags22720 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcetrue PDisasmX86_showRelocationfalse PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmanglefalse PDisasmX86_verbosefalse PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemUnknown MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugfalse MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibstrue MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibtrue MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name CoreHeadersMach-O.pch MacOS Text Debug Name CoreHeadersMach-O.pch MacOS Name Carbon.framework MacOS Carbon Expat Mach-O static UserSourceTrees AlwaysSearchUserPathstrue InterpretDOSAndUnixPathsfalse RequireFrameworkStyleIncludesfalse UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::expat: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS X Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS X PPC Linker PreLinker PostLinker TargetnameExpat Mach-O static OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMDYL FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMLIB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMMLB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.axp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.h++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.hpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.lcf Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.m CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.mm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchmm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.plc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.ploc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.wke Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.a CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.dylib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.gif CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.icns CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.jpg CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.lib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.nib CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.plist CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.strings CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.tiff CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos1 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixnameexpatPrefix_OSX.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline1 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen1 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWWarning_C_warn_illpragma0 MWWarning_C_warn_emptydecl0 MWWarning_C_warn_possunwant0 MWWarning_C_warn_unusedvar0 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic0 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass0 MWFTP_Post_hostName MWFTP_Post_username MWFTP_Post_password0véP ýϐ ýËÈ MWFTP_Post_remoteDir MWFTP_Post_ftp_PathVersion0 MWFTP_Post_ftp_PathType0 MWFTP_Post_ftp_PathFormat0 MWFTP_Post_ftp_tree MWFTP_Post_uploadDir MWFTP_Post_ftp_port21 MWFTP_Post_SendBin1 MWFTP_Post_ShouldLog1 MWCommandLine_Java_clsName MWCommandLine_Java_args MWVJavaDebugging_Protocol1 MWVJavaDebugging_JDKVersion1 MWVJavaDebugging_TimeOut25 MWVJavaDebugging_SupportSlowDevicesfalse MWVJavaDebugging_UseRemoteLaunchAgentfalse MWVJavaDebugging_LaunchVMasServerfalse MWJava_Language_optimizefalse MWJava_Language_warnDeprecatedfalse MWJava_Language_emitMapfalse MWJava_Language_strictFileNamesfalse MWJava_Language_strictFileHierarchyfalse MWJava_Language_1_1_Compatiblefalse MWJava_Language_emitHeaders0 MWJava_Language_headerTypeJNINativeHeaders MWJava_Language_packageFilter MWJava_Language_genCommentstrue MWJava_Language_genHeadersfalse MWJava_Language_enableAssertsfalse MWJava_Language_targetVM1.1 Manifest-JAD Attributes AttributeMain-Class ValueAuto-Generated MWJava_MRJAppBuilder_outFileMRJApplication MWJava_MRJAppBuilder_mergefalse MWJava_MRJAppBuilder_quitMenutrue MWJava_MRJAppBuilder_growfalse MWJava_MRJAppBuilder_stdoutTypeConsole MWJava_MRJAppBuilder_stderrTypeConsole MWJava_MRJAppBuilder_stdinTypeConsole MWJava_MRJAppBuilder_appIconPVersion0 MWJava_MRJAppBuilder_appIconPType0 MWJava_MRJAppBuilder_appIconPFormat0 MWJava_MRJAppBuilder_appIconPTree MWJava_MRJAppBuilder_appIconFile MWJava_MRJAppBuilder_splashScreenPVersion0 MWJava_MRJAppBuilder_splashScreenPType0 MWJava_MRJAppBuilder_splashScreenPFormat0 MWJava_MRJAppBuilder_splashScreenPTree MWJava_MRJAppBuilder_splashScreenPICTFile MWJava_MRJAppBuilder_aboutName MWJava_MRJAppBuilder_stdoutPVersion0 MWJava_MRJAppBuilder_stdoutPType0 MWJava_MRJAppBuilder_stdoutPFormat0 MWJava_MRJAppBuilder_stdoutPTree MWJava_MRJAppBuilder_stdoutFile MWJava_MRJAppBuilder_stdoutAppendfalse MWJava_MRJAppBuilder_stderrPType0 MWJava_MRJAppBuilder_stderrPFormat0 MWJava_MRJAppBuilder_stderrPTree MWJava_MRJAppBuilder_stderrFile MWJava_MRJAppBuilder_stderrAppendfalse MWJava_MRJAppBuilder_stdinPType0 MWJava_MRJAppBuilder_stdinPFormat0 MWJava_MRJAppBuilder_stdinPTree MWJava_MRJAppBuilder_stdinFile MWJava_Output_outputtypeJarFile MWJava_Output_outfileJavaClasses.jar MWJava_Output_ftype1514754080 MWJava_Output_fcreator1297570384 MWJava_Output_compress0 MWJava_Output_genManifest0 MWJava_Output_trunctypeFront MWJava_Output_deleteClasses0 MWJava_Output_consoleApp1 MWJava_Output_preverify0 MWJava_Output_genJad0 MWJava_Output_obfuscate0 MWJava_Proj_projtypeApplet MWJava_Proj_mainClassName MWJava_Proj_HTMLAppCreator1463898714 MWJava_Proj_HTMLAppName MWJava_Proj_PathVersion0 MWJava_Proj_PathType0 MWJava_Proj_PathFormat0 MWJava_Proj_tree MWJava_Proj_HTMLAppWin32Name MWJava_Proj_compress0 MWJava_Proj_simulator1 MWJava_Proj_useVM\000\000mrj225 MWJava_Proj_vmarguments MWJava_Proj_vmName MWJava_Proj_simPropFile MWJavaDoc_Proj_Version1 MWJavaDoc_Proj_Deprecated1 MWJavaDoc_Proj_Author1 MWJavaDoc_Proj_Index1 MWJavaDoc_Proj_Tree1 MWJavaDoc_Proj_SunResolveToSame0 MWJavaDoc_Proj_Shortnames1 MWJavaDoc_Proj_Folder0 MWJavaDoc_Proj_GenerateAPILinks0 MWJavaDoc_Proj_scopePublic MWJavaDoc_Proj_fcreator1297303877 MWJavaDoc_Proj_encodingName MWJavaDoc_Proj_decodingName MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC mcvs FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments MWMacOSPackager_UsePackager0 MWMacOSPackager_FolderToPackage Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreateClassicAlias0 MWMacOSPackager_ClassicAliasMethodUseTargetOutput MWMacOSPackager_ClassicAliasPath Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreatePkgInfo0 MWMacOSPackager_PkgCreatorType???? MWMacOSPackager_PkgFileTypeAPPL MWCodeGen_PPC_structalignmentMC68K MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata1 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_readonlystrings1 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings1 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_split_segs0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainname MWProject_MacOSX_typeLibrary MWProject_MacOSX_outfileExpat1.95.6_Mach-O.lib MWProject_MacOSX_filecreatorCWIE MWProject_MacOSX_filetypeMLIB MWProject_MacOSX_vmaddress0 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWLinker_MachO_exportsNone MWLinker_MachO_mainnamestart MWLinker_MachO_currentversion0 MWLinker_MachO_compatibleversion0 MWLinker_MachO_symfullpath0 MWLinker_MachO_supresswarnings0 MWLinker_MachO_multisymerror0 MWLinker_MachO_prebind1 MWLinker_MachO_deadstrip1 MWLinker_MachO_objectivecsemantics0 MWLinker_MachO_whichfileloaded0 MWLinker_MachO_whyfileloaded0 MWLinker_MachO_readonlyrelocsErrors MWLinker_MachO_undefinedsymbolsErrors MWLinker_MachO_twolevelnamespace1 MWLinker_MachO_stripdebugsymbols0 MWProject_MachO_typeExecutable MWProject_MachO_outfile MWProject_MachO_filecreator???? MWProject_MachO_filetypeMEXE MWProject_MachO_vmaddress4096 MWProject_MachO_flatrsrc0 MWProject_MachO_flatrsrcfilename MWProject_MachO_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MachO_installpath./ MWProject_MachO_frameworkversion MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeApplication MWProject_PPC_outfilea.out MWProject_PPC_filecreator???? MWProject_PPC_filetypeAPPL MWProject_PPC_size384 MWProject_PPC_minsize384 MWProject_PPC_stacksize64 MWProject_PPC_flags22720 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcetrue PDisasmX86_showRelocationfalse PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmanglefalse PDisasmX86_verbosefalse PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemUnknown MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugfalse MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibstrue MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibtrue MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name xmlparse.c MacOS Text Debug Name xmlrole.c MacOS Text Debug Name xmltok.c MacOS Text Debug Name xmlparse.c MacOS Name xmlrole.c MacOS Name xmltok.c MacOS Tnc dylib UserSourceTrees NameTclTk KindAbsolutePath Path Pathhd3:Tcl:Sources:TclTk_8.4.1: PathFormatMacOS PathRoot AlwaysSearchUserPathsfalse InterpretDOSAndUnixPathstrue RequireFrameworkStyleIncludestrue UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:tcl:mac: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:tcl:generic: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:tcl:compat: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::System:Library:Frameworks:CoreServices.framework:Versions:A: PathFormatMacOS PathRootSystem Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::expat: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::extensions:tnc: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::generic: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::expat: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL:MSL_C: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL:MSL_Extras: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS X Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:usr:include: PathFormatMacOS PathRootOS X Volume Recursivefalse FrameworkPathfalse HostFlagsAll SearchPath Path:usr:lib: PathFormatMacOS PathRootOS X Volume Recursivefalse FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:Libraries:Runtime:Common Includes: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:Universal:Interfaces:CIncludes: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:System:Library:Frameworks: PathFormatMacOS PathRootOS X Volume Recursivefalse FrameworkPathtrue HostFlagsAll SearchPath Path::Library:Frameworks: PathFormatMacOS PathRootSystem Recursivefalse FrameworkPathtrue HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS X PPC Linker PreLinker PostLinker TargetnameTnc dylib OutputDirectory Path:tDOM: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMDYL FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMLIB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMMLB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.axp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.h++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.hpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.lcf Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.m CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.mm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchmm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.plc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.ploc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.wke Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.a CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.dylib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.gif CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.icns CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.jpg CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.lib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.nib CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.plist CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.strings CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.tiff CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeadersMach-O.c CodeCompletionMacroFileNameMacOSX_BSD_C++_Macros.h ConsoleEncoding0 LogSystemMessagesfalse AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_mpwpointerstyle1 MWFrontEnd_C_prefixnametncPrefix_OSX.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline1 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline1 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen1 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg1 MWWarning_C_warn_extracomma1 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual1 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass1 MWFTP_Post_hostName MWFTP_Post_username MWFTP_Post_password0véP ýϐ ýËÈ MWFTP_Post_remoteDir MWFTP_Post_ftp_PathVersion1 MWFTP_Post_ftp_PathType0 MWFTP_Post_ftp_PathFormat0 MWFTP_Post_ftp_tree MWFTP_Post_uploadDir MWFTP_Post_ftp_port21 MWFTP_Post_SendBin1 MWFTP_Post_ShouldLog1 MWCommandLine_Java_clsName MWCommandLine_Java_args MWVJavaDebugging_Protocol1 MWVJavaDebugging_JDKVersion1 MWVJavaDebugging_TimeOut15 MWVJavaDebugging_SupportSlowDevicesfalse MWVJavaDebugging_UseRemoteLaunchAgentfalse MWVJavaDebugging_LaunchVMasServerfalse MWJava_Language_optimizefalse MWJava_Language_warnDeprecatedfalse MWJava_Language_emitMapfalse MWJava_Language_strictFileNamesfalse MWJava_Language_strictFileHierarchyfalse MWJava_Language_1_1_Compatiblefalse MWJava_Language_emitHeaders0 MWJava_Language_headerTypeJNINativeHeaders MWJava_Language_packageFilter MWJava_Language_genCommentstrue MWJava_Language_genHeadersfalse MWJava_Language_enableAssertsfalse MWJava_Language_targetVM1.1 Manifest-JAD Attributes AttributeMain-Class ValueAuto-Generated MWJava_MRJAppBuilder_outFileMRJApplication MWJava_MRJAppBuilder_mergefalse MWJava_MRJAppBuilder_quitMenutrue MWJava_MRJAppBuilder_growfalse MWJava_MRJAppBuilder_stdoutTypeConsole MWJava_MRJAppBuilder_stderrTypeConsole MWJava_MRJAppBuilder_stdinTypeConsole MWJava_MRJAppBuilder_appIconPVersion1 MWJava_MRJAppBuilder_appIconPType0 MWJava_MRJAppBuilder_appIconPFormat0 MWJava_MRJAppBuilder_appIconPTree MWJava_MRJAppBuilder_appIconFile MWJava_MRJAppBuilder_splashScreenPVersion1 MWJava_MRJAppBuilder_splashScreenPType0 MWJava_MRJAppBuilder_splashScreenPFormat0 MWJava_MRJAppBuilder_splashScreenPTree MWJava_MRJAppBuilder_splashScreenPICTFile MWJava_MRJAppBuilder_aboutName MWJava_MRJAppBuilder_stdoutPVersion1 MWJava_MRJAppBuilder_stdoutPType0 MWJava_MRJAppBuilder_stdoutPFormat0 MWJava_MRJAppBuilder_stdoutPTree MWJava_MRJAppBuilder_stdoutFile MWJava_MRJAppBuilder_stdoutAppendfalse MWJava_MRJAppBuilder_stderrPType0 MWJava_MRJAppBuilder_stderrPFormat0 MWJava_MRJAppBuilder_stderrPTree MWJava_MRJAppBuilder_stderrFile MWJava_MRJAppBuilder_stderrAppendfalse MWJava_MRJAppBuilder_stdinPType0 MWJava_MRJAppBuilder_stdinPFormat0 MWJava_MRJAppBuilder_stdinPTree MWJava_MRJAppBuilder_stdinFile MWJava_Output_outputtypeJarFile MWJava_Output_outfileJavaClasses.jar MWJava_Output_ftype1514754080 MWJava_Output_fcreator1297570384 MWJava_Output_compress0 MWJava_Output_genManifest0 MWJava_Output_trunctypeFront MWJava_Output_deleteClasses0 MWJava_Output_consoleApp1 MWJava_Output_preverify0 MWJava_Output_genJad0 MWJava_Output_obfuscate0 MWJava_Proj_projtypeApplet MWJava_Proj_mainClassName MWJava_Proj_HTMLAppCreator1463898714 MWJava_Proj_HTMLAppName MWJava_Proj_PathVersion1 MWJava_Proj_PathType0 MWJava_Proj_PathFormat0 MWJava_Proj_tree MWJava_Proj_HTMLAppWin32Name MWJava_Proj_compress0 MWJava_Proj_simulator0 MWJava_Proj_useVM\000\000mrj225 MWJava_Proj_vmarguments MWJava_Proj_vmName MWJava_Proj_simPropFile MWJavaDoc_Proj_Version1 MWJavaDoc_Proj_Deprecated1 MWJavaDoc_Proj_Author1 MWJavaDoc_Proj_Index1 MWJavaDoc_Proj_Tree1 MWJavaDoc_Proj_SunResolveToSame0 MWJavaDoc_Proj_Shortnames1 MWJavaDoc_Proj_Folder0 MWJavaDoc_Proj_GenerateAPILinks0 MWJavaDoc_Proj_scopePublic MWJavaDoc_Proj_fcreator1297303877 MWJavaDoc_Proj_encodingName MWJavaDoc_Proj_decodingName MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments MWMacOSPackager_UsePackager0 MWMacOSPackager_FolderToPackage Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreateClassicAlias0 MWMacOSPackager_ClassicAliasMethodUseTargetOutput MWMacOSPackager_ClassicAliasPath Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreatePkgInfo0 MWMacOSPackager_PkgCreatorType???? MWMacOSPackager_PkgFileTypeAPPL MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesInline MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole0 MWCodeGen_PPC_readonlystrings0 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_peephole0 MWCodeGen_MachO_readonlystrings1 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix1 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath1 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_split_segs0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsFile MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainname MWProject_MacOSX_typeSharedLibrary MWProject_MacOSX_outfiletnc.0.3.0.dylib MWProject_MacOSX_filecreator???? MWProject_MacOSX_filetypeMDYL MWProject_MacOSX_vmaddress0 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWLinker_MachO_exportsPragma MWLinker_MachO_mainnamestart MWLinker_MachO_currentversion0 MWLinker_MachO_compatibleversion0 MWLinker_MachO_symfullpath0 MWLinker_MachO_supresswarnings0 MWLinker_MachO_multisymerror1 MWLinker_MachO_prebind1 MWLinker_MachO_deadstrip1 MWLinker_MachO_objectivecsemantics0 MWLinker_MachO_whichfileloaded0 MWLinker_MachO_whyfileloaded0 MWLinker_MachO_readonlyrelocsErrors MWLinker_MachO_undefinedsymbolsErrors MWLinker_MachO_twolevelnamespace1 MWLinker_MachO_stripdebugsymbols0 MWProject_MachO_typeSharedLibrary MWProject_MachO_outfileDynamic Library.dylib MWProject_MachO_filecreator???? MWProject_MachO_filetypeMDYL MWProject_MachO_vmaddress4096 MWProject_MachO_flatrsrc0 MWProject_MachO_flatrsrcfilename MWProject_MachO_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MachO_installpath./ MWProject_MachO_frameworkversion MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeApplication MWProject_PPC_outfileStd C Console PPC MWProject_PPC_filecreator???? MWProject_PPC_filetypeAPPL MWProject_PPC_size384 MWProject_PPC_minsize384 MWProject_PPC_stacksize64 MWProject_PPC_flags22720 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmanglefalse PDisasmX86_verbosefalse PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name dylib1.o MacOS Library Debug Name MSL_All_Mach-O_D.lib MacOS Library Debug Name tnc.exp MacOS Text Name tnc.c MacOS Text Name console.stubs.c MacOS Text Name Expat1.95.6_Mach-O.lib Unix Library Name tDOMStub_Mach-O.lib MacOS Library TargetOutputFile Name dylib1.o MacOS Name MSL_All_Mach-O_D.lib MacOS Name tDOMStub_Mach-O.lib MacOS Name Expat1.95.6_Mach-O.lib Unix Name tnc.exp MacOS Name tnc.c MacOS Name console.stubs.c MacOS tDOM stubs LinkAgainst Name tDOMStub_Mach-O.lib MacOS Name Tcl.framework MacOS Tcl Name System.framework MacOS System Name Carbon.framework MacOS Carbon Name CoreServices.framework MacOS CoreServices tDOM stubs UserSourceTrees NameTclTk KindAbsolutePath Path Pathhd3:Tcl:Sources:TclTk_8.4.1: PathFormatMacOS PathRoot AlwaysSearchUserPathsfalse InterpretDOSAndUnixPathstrue RequireFrameworkStyleIncludestrue UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:tcl:mac: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:tcl:generic: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:tcl:compat: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::System:Library:Frameworks:CoreServices.framework:Versions:A: PathFormatMacOS PathRootSystem Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::expat: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::generic: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::expat: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL:MSL_C: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL:MSL_Extras: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS X Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:usr:include: PathFormatMacOS PathRootOS X Volume Recursivefalse FrameworkPathfalse HostFlagsAll SearchPath Path:usr:lib: PathFormatMacOS PathRootOS X Volume Recursivefalse FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:Libraries:Runtime:Common Includes: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:Universal:Interfaces:CIncludes: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:System:Library:Frameworks: PathFormatMacOS PathRootOS X Volume Recursivefalse FrameworkPathtrue HostFlagsAll SearchPath Path::Library:Frameworks: PathFormatMacOS PathRootSystem Recursivefalse FrameworkPathtrue HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS X PPC Linker PreLinker PostLinker TargetnametDOM stubs OutputDirectory Path PathFormatUnix PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMDYL FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMLIB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMMLB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.axp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.h++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.hpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.lcf Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.m CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.mm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchmm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.plc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.ploc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.wke Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.a CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.dylib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.gif CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.icns CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.jpg CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.lib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.nib CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.plist CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.strings CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.tiff CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeadersMach-O.c CodeCompletionMacroFileNameMacOSX_BSD_C++_Macros.h ConsoleEncoding0 LogSystemMessagesfalse AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_mpwpointerstyle1 MWFrontEnd_C_prefixnametDOMPrefix_OSX.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline1 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline1 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen1 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg1 MWWarning_C_warn_extracomma1 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual1 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass1 MWFTP_Post_hostName MWFTP_Post_username MWFTP_Post_password0véP ýϐ ýËÈ MWFTP_Post_remoteDir MWFTP_Post_ftp_PathVersion1 MWFTP_Post_ftp_PathType0 MWFTP_Post_ftp_PathFormat0 MWFTP_Post_ftp_tree MWFTP_Post_uploadDir MWFTP_Post_ftp_port21 MWFTP_Post_SendBin1 MWFTP_Post_ShouldLog1 MWCommandLine_Java_clsName MWCommandLine_Java_args MWVJavaDebugging_Protocol1 MWVJavaDebugging_JDKVersion1 MWVJavaDebugging_TimeOut15 MWVJavaDebugging_SupportSlowDevicesfalse MWVJavaDebugging_UseRemoteLaunchAgentfalse MWVJavaDebugging_LaunchVMasServerfalse MWJava_Language_optimizefalse MWJava_Language_warnDeprecatedfalse MWJava_Language_emitMapfalse MWJava_Language_strictFileNamesfalse MWJava_Language_strictFileHierarchyfalse MWJava_Language_1_1_Compatiblefalse MWJava_Language_emitHeaders0 MWJava_Language_headerTypeJNINativeHeaders MWJava_Language_packageFilter MWJava_Language_genCommentstrue MWJava_Language_genHeadersfalse MWJava_Language_enableAssertsfalse MWJava_Language_targetVM1.1 Manifest-JAD Attributes AttributeMain-Class ValueAuto-Generated MWJava_MRJAppBuilder_outFileMRJApplication MWJava_MRJAppBuilder_mergefalse MWJava_MRJAppBuilder_quitMenutrue MWJava_MRJAppBuilder_growfalse MWJava_MRJAppBuilder_stdoutTypeConsole MWJava_MRJAppBuilder_stderrTypeConsole MWJava_MRJAppBuilder_stdinTypeConsole MWJava_MRJAppBuilder_appIconPVersion1 MWJava_MRJAppBuilder_appIconPType0 MWJava_MRJAppBuilder_appIconPFormat0 MWJava_MRJAppBuilder_appIconPTree MWJava_MRJAppBuilder_appIconFile MWJava_MRJAppBuilder_splashScreenPVersion1 MWJava_MRJAppBuilder_splashScreenPType0 MWJava_MRJAppBuilder_splashScreenPFormat0 MWJava_MRJAppBuilder_splashScreenPTree MWJava_MRJAppBuilder_splashScreenPICTFile MWJava_MRJAppBuilder_aboutName MWJava_MRJAppBuilder_stdoutPVersion1 MWJava_MRJAppBuilder_stdoutPType0 MWJava_MRJAppBuilder_stdoutPFormat0 MWJava_MRJAppBuilder_stdoutPTree MWJava_MRJAppBuilder_stdoutFile MWJava_MRJAppBuilder_stdoutAppendfalse MWJava_MRJAppBuilder_stderrPType0 MWJava_MRJAppBuilder_stderrPFormat0 MWJava_MRJAppBuilder_stderrPTree MWJava_MRJAppBuilder_stderrFile MWJava_MRJAppBuilder_stderrAppendfalse MWJava_MRJAppBuilder_stdinPType0 MWJava_MRJAppBuilder_stdinPFormat0 MWJava_MRJAppBuilder_stdinPTree MWJava_MRJAppBuilder_stdinFile MWJava_Output_outputtypeJarFile MWJava_Output_outfileJavaClasses.jar MWJava_Output_ftype1514754080 MWJava_Output_fcreator1297570384 MWJava_Output_compress0 MWJava_Output_genManifest0 MWJava_Output_trunctypeFront MWJava_Output_deleteClasses0 MWJava_Output_consoleApp1 MWJava_Output_preverify0 MWJava_Output_genJad0 MWJava_Output_obfuscate0 MWJava_Proj_projtypeApplet MWJava_Proj_mainClassName MWJava_Proj_HTMLAppCreator1463898714 MWJava_Proj_HTMLAppName MWJava_Proj_PathVersion1 MWJava_Proj_PathType0 MWJava_Proj_PathFormat0 MWJava_Proj_tree MWJava_Proj_HTMLAppWin32Name MWJava_Proj_compress0 MWJava_Proj_simulator0 MWJava_Proj_useVM\000\000mrj225 MWJava_Proj_vmarguments MWJava_Proj_vmName MWJava_Proj_simPropFile MWJavaDoc_Proj_Version1 MWJavaDoc_Proj_Deprecated1 MWJavaDoc_Proj_Author1 MWJavaDoc_Proj_Index1 MWJavaDoc_Proj_Tree1 MWJavaDoc_Proj_SunResolveToSame0 MWJavaDoc_Proj_Shortnames1 MWJavaDoc_Proj_Folder0 MWJavaDoc_Proj_GenerateAPILinks0 MWJavaDoc_Proj_scopePublic MWJavaDoc_Proj_fcreator1297303877 MWJavaDoc_Proj_encodingName MWJavaDoc_Proj_decodingName MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments MWMacOSPackager_UsePackager0 MWMacOSPackager_FolderToPackage Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreateClassicAlias0 MWMacOSPackager_ClassicAliasMethodUseTargetOutput MWMacOSPackager_ClassicAliasPath Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreatePkgInfo0 MWMacOSPackager_PkgCreatorType???? MWMacOSPackager_PkgFileTypeAPPL MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesInline MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole0 MWCodeGen_PPC_readonlystrings0 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_peephole0 MWCodeGen_MachO_readonlystrings1 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix1 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath1 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_split_segs0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsNone MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainname MWProject_MacOSX_typeLibrary MWProject_MacOSX_outfiletDOMStub_Mach-O.lib MWProject_MacOSX_filecreatorCWIE MWProject_MacOSX_filetypeMLIB MWProject_MacOSX_vmaddress0 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWLinker_MachO_exportsPragma MWLinker_MachO_mainnamestart MWLinker_MachO_currentversion0 MWLinker_MachO_compatibleversion0 MWLinker_MachO_symfullpath0 MWLinker_MachO_supresswarnings0 MWLinker_MachO_multisymerror1 MWLinker_MachO_prebind1 MWLinker_MachO_deadstrip1 MWLinker_MachO_objectivecsemantics0 MWLinker_MachO_whichfileloaded0 MWLinker_MachO_whyfileloaded0 MWLinker_MachO_readonlyrelocsErrors MWLinker_MachO_undefinedsymbolsErrors MWLinker_MachO_twolevelnamespace1 MWLinker_MachO_stripdebugsymbols0 MWProject_MachO_typeSharedLibrary MWProject_MachO_outfileDynamic Library.dylib MWProject_MachO_filecreator???? MWProject_MachO_filetypeMDYL MWProject_MachO_vmaddress4096 MWProject_MachO_flatrsrc0 MWProject_MachO_flatrsrcfilename MWProject_MachO_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MachO_installpath./ MWProject_MachO_frameworkversion MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeApplication MWProject_PPC_outfileStd C Console PPC MWProject_PPC_filecreator???? MWProject_PPC_filetypeAPPL MWProject_PPC_size384 MWProject_PPC_minsize384 MWProject_PPC_stacksize64 MWProject_PPC_flags22720 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmanglefalse PDisasmX86_verbosefalse PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name tdomStubLib.c MacOS Text Name tdomStubLib.c MacOS Name Tcl.framework MacOS Tcl Name System.framework MacOS System Name Carbon.framework MacOS Carbon Name CoreServices.framework MacOS CoreServices Precomp Expat Mach-O static tDOM stubs tDOM dylib Tnc dylib Precomp Headers Precomp Name CoreHeadersMach-O.pch MacOS Sources tDOM dylib Name aolstub.cpp MacOS tDOM dylib Name dom.c MacOS tDOM dylib Name domalloc.c MacOS tDOM dylib Name domhtml.c MacOS tDOM dylib Name domlock.c MacOS tDOM dylib Name domxpath.c MacOS tDOM dylib Name domxslt.c MacOS tDOM dylib Name nodecmd.c MacOS tDOM dylib Name tcldom.c MacOS tDOM dylib Name tclexpat.c MacOS tDOM dylib Name tdominit.c MacOS tDOM dylib Name tdomStubInit.c MacOS tDOM dylib Name tdomStubLib.c MacOS tDOM dylib Name utf8conv.c MacOS tDOM dylib Name xmlsimple.c MacOS tDOM dylib Name tDOM.exp MacOS Sources Expat Expat Mach-O static Name xmlparse.c MacOS Expat Mach-O static Name xmlrole.c MacOS Expat Mach-O static Name xmltok.c MacOS Sources tnc Tnc dylib Name tnc.c MacOS Tnc dylib Name tnc.exp MacOS Libraries tDOM dylib Name dylib1.o MacOS tDOM dylib Name MSL_All_Mach-O_D.lib MacOS tDOM dylib Name Expat1.95.6_Mach-O.lib MacOS Tnc dylib Name tDOMStub_Mach-O.lib MacOS tDOM dylib Name console.stubs.c MacOS tDOM-0.8.3/mac/tDOM.r0000644000175000017500000000434507637205637014332 0ustar ssobernissoberni// Macintosh port of J. Loewer's tDOM lib for Tcl // Author: Bernard Desgraupes // e-mail: bdesgraupes@easyconnect.fr // web-page: http://webperso.easyconnect.fr/bdesgraupes/ // Last modification : 2003-02-16 19:36:06 #include #include #define TDOM_MAJOR 0 #define TDOM_MINOR 7 #define TDOM_SUBMINOR 6 #define TCL_MAJOR 8 #define TCL_MINOR 4 // developStage, alphaStage, betaStage, finalStage #define TDOM_STAGE betaStage #if (TDOM_STAGE == developStage) # define TDOM_STAGE_CODE 'd' #elif (TDOM_STAGE == alphaStage) # define TDOM_STAGE_CODE 'a' #elif (TDOM_STAGE == betaStage) # define TDOM_STAGE_CODE 'b' #elif (TDOM_STAGE == finalStage) # define TDOM_STAGE_CODE 'f' #endif #define TDOM_MAJOR_BCD ((TDOM_MAJOR / 10) * 16) + (TDOM_MAJOR % 10) #define TDOM_MINOR_BCD (TDOM_MINOR * 16) // #define TDOM_VERSION_STRING $$Format("%d.%d%c%d", TDOM_MAJOR, TDOM_MINOR, \ // TDOM_STAGE_CODE, TDOM_SUBMINOR) #define TDOM_VERSION_STRING $$Format("%d.%d.%d", TDOM_MAJOR, TDOM_MINOR, TDOM_SUBMINOR) resource 'vers' (1) { TDOM_MAJOR_BCD, TDOM_MINOR_BCD, TDOM_STAGE, 0x00, verUS, TDOM_VERSION_STRING, $$Format("%s %s © %d\nported to Mac by B. Desgraupes", "tDOM", TDOM_VERSION_STRING, $$YEAR) }; resource 'vers' (2) { TDOM_MAJOR_BCD, TDOM_MINOR_BCD, TDOM_STAGE, 0x00, verUS, TDOM_VERSION_STRING, "Mac port of J. Loewer's tDOM lib" }; /* * The -16397 string will be displayed by Finder when a user * tries to open the shared library. The string should * give the user a little detail about the library's capabilities * and enough information to install the library in the correct location. * A similar string should be placed in all shared libraries. */ resource 'STR ' (-16397, purgeable) { "tDOM Library\n\n" "This library provides an XML/DOM/XPath/XSLT implementation for Tcl." " It should be placed in the ÔTool Command LanguageÕ folder " "within the Extensions folder. To load it: " "'package require tdom'" }; data 'TEXT' (1000,"pkgIndex",purgeable, preload) { $$Format("# Tcl package index file, version 1.0\npackage ifneeded tdom %d.%d.%d \"load [list [file join $dir tDOM%d.%d[info sharedlibextension]]] Tdom\"\n", TDOM_MAJOR, TDOM_MINOR, TDOM_SUBMINOR, TCL_MAJOR, TCL_MINOR) }; tDOM-0.8.3/mac/tnc.r0000644000175000017500000000430707637205637014311 0ustar ssobernissoberni// Macintosh port of the tnc extension for tDOM for Tcl // Author: Bernard Desgraupes // e-mail: bdesgraupes@easyconnect.fr // web-page: http://webperso.easyconnect.fr/bdesgraupes/ // Last modification : 2003-02-19 08:53:51 #include #include #define TNC_MAJOR 0 #define TNC_MINOR 3 #define TNC_SUBMINOR 0 #define TCL_MAJOR 8 #define TCL_MINOR 4 // developStage, alphaStage, betaStage, finalStage #define TNC_STAGE betaStage #if (TNC_STAGE == developStage) # define TNC_STAGE_CODE 'd' #elif (TNC_STAGE == alphaStage) # define TNC_STAGE_CODE 'a' #elif (TNC_STAGE == betaStage) # define TNC_STAGE_CODE 'b' #elif (TNC_STAGE == finalStage) # define TNC_STAGE_CODE 'f' #endif #define TNC_MAJOR_BCD ((TNC_MAJOR / 10) * 16) + (TNC_MAJOR % 10) #define TNC_MINOR_BCD (TNC_MINOR * 16) // #define TNC_VERSION_STRING $$Format("%d.%d%c%d", TNC_MAJOR, TNC_MINOR, \ // TNC_STAGE_CODE, TNC_SUBMINOR) #define TNC_VERSION_STRING $$Format("%d.%d.%d", TNC_MAJOR, TNC_MINOR, TNC_SUBMINOR) resource 'vers' (1) { TNC_MAJOR_BCD, TNC_MINOR_BCD, TNC_STAGE, 0x00, verUS, TNC_VERSION_STRING, $$Format("%s %s © %d\nported to Mac by B. Desgraupes", "tnc", TNC_VERSION_STRING, $$YEAR) }; resource 'vers' (2) { TNC_MAJOR_BCD, TNC_MINOR_BCD, TNC_STAGE, 0x00, verUS, TNC_VERSION_STRING, "Mac port of tnc extension for tDOM" }; /* * The -16397 string will be displayed by Finder when a user * tries to open the shared library. The string should * give the user a little detail about the library's capabilities * and enough information to install the library in the correct location. * A similar string should be placed in all shared libraries. */ resource 'STR ' (-16397, purgeable) { "tnc Library\n\n" "This library implements a set of tDOM C Handlers." " It should be placed in the ÔTool Command LanguageÕ folder " "within the Extensions folder. To load it: " "'package require tnc'" }; data 'TEXT' (1000,"pkgIndex",purgeable, preload) { $$Format("# Tcl package index file, version 1.0\npackage ifneeded tnc %d.%d.%d \"package require tdom;\nload [list [file join $dir tnc%d.%d[info sharedlibextension]]] tnc\"\n", TNC_MAJOR, TNC_MINOR, TNC_SUBMINOR, TCL_MAJOR, TCL_MINOR) }; tDOM-0.8.3/mac/CVS/0000755000175000017500000000000011004674374013760 5ustar ssobernissobernitDOM-0.8.3/mac/CVS/Root0000644000175000017500000000006211004674373014623 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/mac/CVS/Entries.Log0000644000175000017500000000010611004674374016031 0ustar ssobernissoberniA D/PrecompHeaders//// A D/Prefix//// A D/tDOM//// A D/tDOM.0.7.5//// tDOM-0.8.3/mac/CVS/Entries0000644000175000017500000000053711004674374015321 0ustar ssobernissoberni/Readme_Mac_Compiling/1.1/Thu Mar 6 14:24:05 2003// /macconfig.h/1.1/Thu Mar 6 14:24:05 2003// /tDOM.exp/1.1/Thu Mar 6 14:24:05 2003// /tDOM.prj.xml/1.1/Thu Mar 6 14:24:05 2003// /tDOM.r/1.2/Sun Mar 23 01:19:27 2003// /tDOM_OSX.prj.xml/1.4/Tue Mar 25 22:35:16 2003// /tnc.exp/1.1/Thu Mar 6 14:24:05 2003// /tnc.r/1.2/Sun Mar 23 01:19:27 2003// D tDOM-0.8.3/mac/CVS/Repository0000644000175000017500000000001111004674373016051 0ustar ssobernissobernitdom/mac tDOM-0.8.3/mac/tDOM.prj.xml0000644000175000017500000130005607631655005015452 0ustar ssobernissoberni ]> tDOM shlib UserSourceTrees NameTclTk KindAbsolutePath Path Pathhd3:Tcl:Sources:TclTk_8.4.1: PathFormatMacOS PathRoot AlwaysSearchUserPathstrue InterpretDOSAndUnixPathstrue RequireFrameworkStyleIncludesfalse UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::generic: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::expat: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:Universal: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:Libraries: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:Build: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:tcl: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS PPC Linker PreLinker PostLinker TargetnametDOM shlib OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.gc CompilerGameCode Converter EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.l CompilerFlex Preprocessor EditLanguage Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.p CompilerMW Pascal PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pas CompilerMW Pascal PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.ppu CompilerMW Pascal PPC EditLanguage Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.y CompilerBison Preprocessor EditLanguage Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionNameno connections avaiable DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixnametDOMPrefix.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline1 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline1 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen1 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg1 MWWarning_C_warn_extracomma1 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual1 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass0 MWFTP_Post_hostName MWFTP_Post_username MWFTP_Post_password0véP ýϐ ýËÈ MWFTP_Post_remoteDir MWFTP_Post_ftp_PathVersion0 MWFTP_Post_ftp_PathType0 MWFTP_Post_ftp_PathFormat0 MWFTP_Post_ftp_tree MWFTP_Post_uploadDir MWFTP_Post_ftp_port21 MWFTP_Post_SendBin1 MWFTP_Post_ShouldLog1 MWCommandLine_Java_clsName MWCommandLine_Java_args MWVJavaDebugging_Protocol1 MWVJavaDebugging_JDKVersion1 MWVJavaDebugging_TimeOut25 MWVJavaDebugging_SupportSlowDevicesfalse MWVJavaDebugging_UseRemoteLaunchAgentfalse MWVJavaDebugging_LaunchVMasServerfalse MWJava_Language_optimizefalse MWJava_Language_warnDeprecatedfalse MWJava_Language_emitMapfalse MWJava_Language_strictFileNamesfalse MWJava_Language_strictFileHierarchyfalse MWJava_Language_1_1_Compatiblefalse MWJava_Language_emitHeaders0 MWJava_Language_headerTypeJNINativeHeaders MWJava_Language_packageFilter MWJava_Language_genCommentstrue MWJava_Language_genHeadersfalse MWJava_Language_enableAssertsfalse MWJava_Language_targetVM1.1 Manifest-JAD Attributes AttributeMain-Class ValueAuto-Generated MWJava_MRJAppBuilder_outFileMRJApplication MWJava_MRJAppBuilder_mergefalse MWJava_MRJAppBuilder_quitMenutrue MWJava_MRJAppBuilder_growfalse MWJava_MRJAppBuilder_stdoutTypeConsole MWJava_MRJAppBuilder_stderrTypeConsole MWJava_MRJAppBuilder_stdinTypeConsole MWJava_MRJAppBuilder_appIconPVersion0 MWJava_MRJAppBuilder_appIconPType0 MWJava_MRJAppBuilder_appIconPFormat0 MWJava_MRJAppBuilder_appIconPTree MWJava_MRJAppBuilder_appIconFile MWJava_MRJAppBuilder_splashScreenPVersion0 MWJava_MRJAppBuilder_splashScreenPType0 MWJava_MRJAppBuilder_splashScreenPFormat0 MWJava_MRJAppBuilder_splashScreenPTree MWJava_MRJAppBuilder_splashScreenPICTFile MWJava_MRJAppBuilder_aboutName MWJava_MRJAppBuilder_stdoutPVersion0 MWJava_MRJAppBuilder_stdoutPType0 MWJava_MRJAppBuilder_stdoutPFormat0 MWJava_MRJAppBuilder_stdoutPTree MWJava_MRJAppBuilder_stdoutFile MWJava_MRJAppBuilder_stdoutAppendfalse MWJava_MRJAppBuilder_stderrPType0 MWJava_MRJAppBuilder_stderrPFormat0 MWJava_MRJAppBuilder_stderrPTree MWJava_MRJAppBuilder_stderrFile MWJava_MRJAppBuilder_stderrAppendfalse MWJava_MRJAppBuilder_stdinPType0 MWJava_MRJAppBuilder_stdinPFormat0 MWJava_MRJAppBuilder_stdinPTree MWJava_MRJAppBuilder_stdinFile MWJava_Output_outputtypeJarFile MWJava_Output_outfileJavaClasses.jar MWJava_Output_ftype1514754080 MWJava_Output_fcreator1297570384 MWJava_Output_compress0 MWJava_Output_genManifest0 MWJava_Output_trunctypeFront MWJava_Output_deleteClasses0 MWJava_Output_consoleApp1 MWJava_Output_preverify0 MWJava_Output_genJad0 MWJava_Output_obfuscate0 MWJava_Proj_projtypeApplet MWJava_Proj_mainClassName MWJava_Proj_HTMLAppCreator1463898714 MWJava_Proj_HTMLAppName MWJava_Proj_PathVersion1 MWJava_Proj_PathType0 MWJava_Proj_PathFormat0 MWJava_Proj_tree MWJava_Proj_HTMLAppWin32Name MWJava_Proj_compress0 MWJava_Proj_simulator0 MWJava_Proj_useVM\000\000mrj225 MWJava_Proj_vmarguments MWJava_Proj_vmName MWJava_Proj_simPropFile MWJavaDoc_Proj_Version1 MWJavaDoc_Proj_Deprecated1 MWJavaDoc_Proj_Author1 MWJavaDoc_Proj_Index1 MWJavaDoc_Proj_Tree1 MWJavaDoc_Proj_SunResolveToSame0 MWJavaDoc_Proj_Shortnames1 MWJavaDoc_Proj_Folder0 MWJavaDoc_Proj_GenerateAPILinks0 MWJavaDoc_Proj_scopePublic MWJavaDoc_Proj_fcreator1297303877 MWJavaDoc_Proj_encodingName MWJavaDoc_Proj_decodingName MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments MWMacOSPackager_UsePackager0 MWMacOSPackager_FolderToPackage Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreateClassicAlias0 MWMacOSPackager_ClassicAliasMethodUseTargetOutput MWMacOSPackager_ClassicAliasPath Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreatePkgInfo0 MWMacOSPackager_PkgCreatorType???? MWMacOSPackager_PkgFileTypeAPPL MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesInline MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole0 MWCodeGen_PPC_readonlystrings0 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule1 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings0 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel4 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym0 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initnameTclMacInitializeFragment MWLinker_PPC_mainname MWLinker_PPC_termnameTclMacTerminateFragment MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_split_segs0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainnamestart MWProject_MacOSX_typeSharedLibrary MWProject_MacOSX_outfilepowerTcl.shlb MWProject_MacOSX_filecreatorTclL MWProject_MacOSX_filetypeshlb MWProject_MacOSX_vmaddress4096 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWLinker_MachO_exportsNone MWLinker_MachO_mainnamestart MWLinker_MachO_currentversion0 MWLinker_MachO_compatibleversion0 MWLinker_MachO_symfullpath0 MWLinker_MachO_supresswarnings0 MWLinker_MachO_multisymerror0 MWLinker_MachO_prebind1 MWLinker_MachO_deadstrip1 MWLinker_MachO_objectivecsemantics0 MWLinker_MachO_whichfileloaded0 MWLinker_MachO_whyfileloaded0 MWLinker_MachO_readonlyrelocsErrors MWLinker_MachO_undefinedsymbolsErrors MWLinker_MachO_twolevelnamespace1 MWLinker_MachO_stripdebugsymbols0 MWProject_MachO_typeExecutable MWProject_MachO_outfilea.exe MWProject_MachO_filecreator???? MWProject_MachO_filetypeMEXE MWProject_MachO_vmaddress4096 MWProject_MachO_flatrsrc1 MWProject_MachO_flatrsrcfilenamea.rsrc MWProject_MachO_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MachO_installpath./ MWProject_MachO_frameworkversion MWPEF_exportsFile MWPEF_libfolder0 MWPEF_sortcodeDepthFirst MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads1 MWProject_PPC_typeSharedLibrary MWProject_PPC_outfiletDOM8.4.shlb MWProject_PPC_filecreatorTclL MWProject_PPC_filetypeshlb MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmangletrue PDisasmX86_verbosetrue PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name TclStub.lib MacOS Library Debug Name tclMacLibrary.c MacOS Text Debug Name tDOM.r MacOS Text Debug Name MSL_All_PPC.Lib MacOS Library Debug Name InterfaceLib MacOS Library Debug Name aolstub.cpp MacOS Text Name dom.c MacOS Text Name domalloc.c MacOS Text Name domhtml.c MacOS Text Name domlock.c MacOS Text Name domxpath.c MacOS Text Name domxslt.c MacOS Text Name nodecmd.c MacOS Text Name tcldom.c MacOS Text Name tclexpat.c MacOS Text Name tdominit.c MacOS Text Name tdomStubInit.c MacOS Text Name tdomStubLib.c MacOS Text Name utf8conv.c MacOS Text Name xmlsimple.c MacOS Text Name Expat1.95.6.Lib MacOS Library Debug, TargetOutputFile Name MathLib MacOS Library Debug Name MSL_SIOUX_WASTE_PPC.Lib MacOS Library Debug Name tDOM.exp MacOS Text Debug Name tclMacLibrary.c MacOS Name TclStub.lib MacOS Name tDOM.r MacOS Name MSL_All_PPC.Lib MacOS Name InterfaceLib MacOS Name aolstub.cpp MacOS Name dom.c MacOS Name domalloc.c MacOS Name domhtml.c MacOS Name domlock.c MacOS Name domxpath.c MacOS Name domxslt.c MacOS Name nodecmd.c MacOS Name tcldom.c MacOS Name tclexpat.c MacOS Name tdominit.c MacOS Name tdomStubInit.c MacOS Name tdomStubLib.c MacOS Name utf8conv.c MacOS Name xmlsimple.c MacOS Name Expat1.95.6.Lib MacOS Name MathLib MacOS Name MSL_SIOUX_WASTE_PPC.Lib MacOS Name tDOM.exp MacOS Expat static lib LinkAgainst Name Expat1.95.6.Lib MacOS tDOM stublib UserSourceTrees NameTclTk KindAbsolutePath Path Pathhd3:Tcl:Sources:TclTk_8.4.1: PathFormatMacOS PathRoot AlwaysSearchUserPathstrue InterpretDOSAndUnixPathstrue RequireFrameworkStyleIncludesfalse UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:Universal: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:Libraries: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:Build: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:tcl: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS PPC Linker PreLinker PostLinker TargetnametDOM stublib OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.gc CompilerGameCode Converter EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.l CompilerFlex Preprocessor EditLanguage Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.p CompilerMW Pascal PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pas CompilerMW Pascal PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.ppu CompilerMW Pascal PPC EditLanguage Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.y CompilerBison Preprocessor EditLanguage Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionNameno connections avaiable DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixnametDOMPrefix.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline1 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline1 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen1 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg1 MWWarning_C_warn_extracomma1 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual1 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass0 MWFTP_Post_hostName MWFTP_Post_username MWFTP_Post_password0véP ýϐ ýËÈ MWFTP_Post_remoteDir MWFTP_Post_ftp_PathVersion0 MWFTP_Post_ftp_PathType0 MWFTP_Post_ftp_PathFormat0 MWFTP_Post_ftp_tree MWFTP_Post_uploadDir MWFTP_Post_ftp_port21 MWFTP_Post_SendBin1 MWFTP_Post_ShouldLog1 MWCommandLine_Java_clsName MWCommandLine_Java_args MWVJavaDebugging_Protocol1 MWVJavaDebugging_JDKVersion1 MWVJavaDebugging_TimeOut25 MWVJavaDebugging_SupportSlowDevicesfalse MWVJavaDebugging_UseRemoteLaunchAgentfalse MWVJavaDebugging_LaunchVMasServerfalse MWJava_Language_optimizefalse MWJava_Language_warnDeprecatedfalse MWJava_Language_emitMapfalse MWJava_Language_strictFileNamesfalse MWJava_Language_strictFileHierarchyfalse MWJava_Language_1_1_Compatiblefalse MWJava_Language_emitHeaders0 MWJava_Language_headerTypeJNINativeHeaders MWJava_Language_packageFilter MWJava_Language_genCommentstrue MWJava_Language_genHeadersfalse MWJava_Language_enableAssertsfalse MWJava_Language_targetVM1.1 Manifest-JAD Attributes AttributeMain-Class ValueAuto-Generated MWJava_MRJAppBuilder_outFileMRJApplication MWJava_MRJAppBuilder_mergefalse MWJava_MRJAppBuilder_quitMenutrue MWJava_MRJAppBuilder_growfalse MWJava_MRJAppBuilder_stdoutTypeConsole MWJava_MRJAppBuilder_stderrTypeConsole MWJava_MRJAppBuilder_stdinTypeConsole MWJava_MRJAppBuilder_appIconPVersion0 MWJava_MRJAppBuilder_appIconPType0 MWJava_MRJAppBuilder_appIconPFormat0 MWJava_MRJAppBuilder_appIconPTree MWJava_MRJAppBuilder_appIconFile MWJava_MRJAppBuilder_splashScreenPVersion0 MWJava_MRJAppBuilder_splashScreenPType0 MWJava_MRJAppBuilder_splashScreenPFormat0 MWJava_MRJAppBuilder_splashScreenPTree MWJava_MRJAppBuilder_splashScreenPICTFile MWJava_MRJAppBuilder_aboutName MWJava_MRJAppBuilder_stdoutPVersion0 MWJava_MRJAppBuilder_stdoutPType0 MWJava_MRJAppBuilder_stdoutPFormat0 MWJava_MRJAppBuilder_stdoutPTree MWJava_MRJAppBuilder_stdoutFile MWJava_MRJAppBuilder_stdoutAppendfalse MWJava_MRJAppBuilder_stderrPType0 MWJava_MRJAppBuilder_stderrPFormat0 MWJava_MRJAppBuilder_stderrPTree MWJava_MRJAppBuilder_stderrFile MWJava_MRJAppBuilder_stderrAppendfalse MWJava_MRJAppBuilder_stdinPType0 MWJava_MRJAppBuilder_stdinPFormat0 MWJava_MRJAppBuilder_stdinPTree MWJava_MRJAppBuilder_stdinFile MWJava_Output_outputtypeJarFile MWJava_Output_outfileJavaClasses.jar MWJava_Output_ftype1514754080 MWJava_Output_fcreator1297570384 MWJava_Output_compress0 MWJava_Output_genManifest0 MWJava_Output_trunctypeFront MWJava_Output_deleteClasses0 MWJava_Output_consoleApp1 MWJava_Output_preverify0 MWJava_Output_genJad0 MWJava_Output_obfuscate0 MWJava_Proj_projtypeApplet MWJava_Proj_mainClassName MWJava_Proj_HTMLAppCreator1463898714 MWJava_Proj_HTMLAppName MWJava_Proj_PathVersion1 MWJava_Proj_PathType0 MWJava_Proj_PathFormat0 MWJava_Proj_tree MWJava_Proj_HTMLAppWin32Name MWJava_Proj_compress0 MWJava_Proj_simulator0 MWJava_Proj_useVM\000\000mrj225 MWJava_Proj_vmarguments MWJava_Proj_vmName MWJava_Proj_simPropFile MWJavaDoc_Proj_Version1 MWJavaDoc_Proj_Deprecated1 MWJavaDoc_Proj_Author1 MWJavaDoc_Proj_Index1 MWJavaDoc_Proj_Tree1 MWJavaDoc_Proj_SunResolveToSame0 MWJavaDoc_Proj_Shortnames1 MWJavaDoc_Proj_Folder0 MWJavaDoc_Proj_GenerateAPILinks0 MWJavaDoc_Proj_scopePublic MWJavaDoc_Proj_fcreator1297303877 MWJavaDoc_Proj_encodingName MWJavaDoc_Proj_decodingName MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments MWMacOSPackager_UsePackager0 MWMacOSPackager_FolderToPackage Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreateClassicAlias0 MWMacOSPackager_ClassicAliasMethodUseTargetOutput MWMacOSPackager_ClassicAliasPath Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreatePkgInfo0 MWMacOSPackager_PkgCreatorType???? MWMacOSPackager_PkgFileTypeAPPL MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesInline MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole0 MWCodeGen_PPC_readonlystrings0 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule1 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings0 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel4 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym0 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_split_segs0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainnamestart MWProject_MacOSX_typeSharedLibrary MWProject_MacOSX_outfilepowerTcl.shlb MWProject_MacOSX_filecreatorTclL MWProject_MacOSX_filetypeshlb MWProject_MacOSX_vmaddress4096 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWLinker_MachO_exportsNone MWLinker_MachO_mainnamestart MWLinker_MachO_currentversion0 MWLinker_MachO_compatibleversion0 MWLinker_MachO_symfullpath0 MWLinker_MachO_supresswarnings0 MWLinker_MachO_multisymerror0 MWLinker_MachO_prebind1 MWLinker_MachO_deadstrip1 MWLinker_MachO_objectivecsemantics0 MWLinker_MachO_whichfileloaded0 MWLinker_MachO_whyfileloaded0 MWLinker_MachO_readonlyrelocsErrors MWLinker_MachO_undefinedsymbolsErrors MWLinker_MachO_twolevelnamespace1 MWLinker_MachO_stripdebugsymbols0 MWProject_MachO_typeExecutable MWProject_MachO_outfilea.exe MWProject_MachO_filecreator???? MWProject_MachO_filetypeMEXE MWProject_MachO_vmaddress4096 MWProject_MachO_flatrsrc1 MWProject_MachO_flatrsrcfilenamea.rsrc MWProject_MachO_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MachO_installpath./ MWProject_MachO_frameworkversion MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads1 MWProject_PPC_typeLibrary MWProject_PPC_outfiletDOMStub.lib MWProject_PPC_filecreator???? MWProject_PPC_filetype???? MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmangletrue PDisasmX86_verbosetrue PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name tdomStubLib.c MacOS Text Name tdomStubLib.c MacOS Expat static lib UserSourceTrees AlwaysSearchUserPathstrue InterpretDOSAndUnixPathsfalse RequireFrameworkStyleIncludesfalse UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::expat: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS PPC Linker PreLinker PostLinker TargetnameExpat static lib OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC EditLanguageBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC EditLanguageBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.axp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.h++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.hpp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.m CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.mm CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchm CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchmm CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.plc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.ploc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm EditLanguageBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.wke Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC EditLanguageBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC EditLanguageBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC EditLanguageBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.gif CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.icns CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.jpg CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.nib CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.o CompilerXCOFF Import PPC EditLanguageBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.plist CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.strings CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.tiff CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos1 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixnameexpatPrefix.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline1 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen1 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWWarning_C_warn_illpragma0 MWWarning_C_warn_emptydecl0 MWWarning_C_warn_possunwant0 MWWarning_C_warn_unusedvar0 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic0 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass0 MWFTP_Post_hostName MWFTP_Post_username MWFTP_Post_password0véP ýϐ ýËÈ MWFTP_Post_remoteDir MWFTP_Post_ftp_PathVersion0 MWFTP_Post_ftp_PathType0 MWFTP_Post_ftp_PathFormat0 MWFTP_Post_ftp_tree MWFTP_Post_uploadDir MWFTP_Post_ftp_port21 MWFTP_Post_SendBin1 MWFTP_Post_ShouldLog1 MWCommandLine_Java_clsName MWCommandLine_Java_args MWVJavaDebugging_Protocol1 MWVJavaDebugging_JDKVersion1 MWVJavaDebugging_TimeOut25 MWVJavaDebugging_SupportSlowDevicesfalse MWVJavaDebugging_UseRemoteLaunchAgentfalse MWVJavaDebugging_LaunchVMasServerfalse MWJava_Language_optimizefalse MWJava_Language_warnDeprecatedfalse MWJava_Language_emitMapfalse MWJava_Language_strictFileNamesfalse MWJava_Language_strictFileHierarchyfalse MWJava_Language_1_1_Compatiblefalse MWJava_Language_emitHeaders0 MWJava_Language_headerTypeJNINativeHeaders MWJava_Language_packageFilter MWJava_Language_genCommentstrue MWJava_Language_genHeadersfalse MWJava_Language_enableAssertsfalse MWJava_Language_targetVM1.1 Manifest-JAD Attributes AttributeMain-Class ValueAuto-Generated MWJava_MRJAppBuilder_outFileMRJApplication MWJava_MRJAppBuilder_mergefalse MWJava_MRJAppBuilder_quitMenutrue MWJava_MRJAppBuilder_growfalse MWJava_MRJAppBuilder_stdoutTypeConsole MWJava_MRJAppBuilder_stderrTypeConsole MWJava_MRJAppBuilder_stdinTypeConsole MWJava_MRJAppBuilder_appIconPVersion0 MWJava_MRJAppBuilder_appIconPType0 MWJava_MRJAppBuilder_appIconPFormat0 MWJava_MRJAppBuilder_appIconPTree MWJava_MRJAppBuilder_appIconFile MWJava_MRJAppBuilder_splashScreenPVersion0 MWJava_MRJAppBuilder_splashScreenPType0 MWJava_MRJAppBuilder_splashScreenPFormat0 MWJava_MRJAppBuilder_splashScreenPTree MWJava_MRJAppBuilder_splashScreenPICTFile MWJava_MRJAppBuilder_aboutName MWJava_MRJAppBuilder_stdoutPVersion0 MWJava_MRJAppBuilder_stdoutPType0 MWJava_MRJAppBuilder_stdoutPFormat0 MWJava_MRJAppBuilder_stdoutPTree MWJava_MRJAppBuilder_stdoutFile MWJava_MRJAppBuilder_stdoutAppendfalse MWJava_MRJAppBuilder_stderrPType0 MWJava_MRJAppBuilder_stderrPFormat0 MWJava_MRJAppBuilder_stderrPTree MWJava_MRJAppBuilder_stderrFile MWJava_MRJAppBuilder_stderrAppendfalse MWJava_MRJAppBuilder_stdinPType0 MWJava_MRJAppBuilder_stdinPFormat0 MWJava_MRJAppBuilder_stdinPTree MWJava_MRJAppBuilder_stdinFile MWJava_Output_outputtypeJarFile MWJava_Output_outfileJavaClasses.jar MWJava_Output_ftype1514754080 MWJava_Output_fcreator1297570384 MWJava_Output_compress0 MWJava_Output_genManifest0 MWJava_Output_trunctypeFront MWJava_Output_deleteClasses0 MWJava_Output_consoleApp1 MWJava_Output_preverify0 MWJava_Output_genJad0 MWJava_Output_obfuscate0 MWJava_Proj_projtypeApplet MWJava_Proj_mainClassName MWJava_Proj_HTMLAppCreator1463898714 MWJava_Proj_HTMLAppName MWJava_Proj_PathVersion0 MWJava_Proj_PathType0 MWJava_Proj_PathFormat0 MWJava_Proj_tree MWJava_Proj_HTMLAppWin32Name MWJava_Proj_compress0 MWJava_Proj_simulator1 MWJava_Proj_useVM\000\000mrj225 MWJava_Proj_vmarguments MWJava_Proj_vmName MWJava_Proj_simPropFile MWJavaDoc_Proj_Version1 MWJavaDoc_Proj_Deprecated1 MWJavaDoc_Proj_Author1 MWJavaDoc_Proj_Index1 MWJavaDoc_Proj_Tree1 MWJavaDoc_Proj_SunResolveToSame0 MWJavaDoc_Proj_Shortnames1 MWJavaDoc_Proj_Folder0 MWJavaDoc_Proj_GenerateAPILinks0 MWJavaDoc_Proj_scopePublic MWJavaDoc_Proj_fcreator1297303877 MWJavaDoc_Proj_encodingName MWJavaDoc_Proj_decodingName MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC mcvs FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments MWMacOSPackager_UsePackager0 MWMacOSPackager_FolderToPackage Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreateClassicAlias0 MWMacOSPackager_ClassicAliasMethodUseTargetOutput MWMacOSPackager_ClassicAliasPath Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreatePkgInfo0 MWMacOSPackager_PkgCreatorType???? MWMacOSPackager_PkgFileTypeAPPL MWCodeGen_PPC_structalignmentMC68K MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata1 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_readonlystrings1 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings1 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_split_segs0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainnamestart MWProject_MacOSX_typeExecutable MWProject_MacOSX_outfile MWProject_MacOSX_filecreator???? MWProject_MacOSX_filetypeMEXE MWProject_MacOSX_vmaddress4096 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWLinker_MachO_exportsNone MWLinker_MachO_mainnamestart MWLinker_MachO_currentversion0 MWLinker_MachO_compatibleversion0 MWLinker_MachO_symfullpath0 MWLinker_MachO_supresswarnings0 MWLinker_MachO_multisymerror0 MWLinker_MachO_prebind1 MWLinker_MachO_deadstrip1 MWLinker_MachO_objectivecsemantics0 MWLinker_MachO_whichfileloaded0 MWLinker_MachO_whyfileloaded0 MWLinker_MachO_readonlyrelocsErrors MWLinker_MachO_undefinedsymbolsErrors MWLinker_MachO_twolevelnamespace1 MWLinker_MachO_stripdebugsymbols0 MWProject_MachO_typeExecutable MWProject_MachO_outfile MWProject_MachO_filecreator???? MWProject_MachO_filetypeMEXE MWProject_MachO_vmaddress4096 MWProject_MachO_flatrsrc0 MWProject_MachO_flatrsrcfilename MWProject_MachO_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MachO_installpath./ MWProject_MachO_frameworkversion MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads1 MWProject_PPC_typeLibrary MWProject_PPC_outfileExpat1.95.6.Lib MWProject_PPC_filecreator???? MWProject_PPC_filetype???? MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcetrue PDisasmX86_showRelocationfalse PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmanglefalse PDisasmX86_verbosefalse PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemUnknown MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugfalse MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibstrue MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibtrue MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name xmlparse.c MacOS Text Debug Name xmlrole.c MacOS Text Debug Name xmltok.c MacOS Text Debug Name xmlparse.c MacOS Name xmlrole.c MacOS Name xmltok.c MacOS Tnc shlib UserSourceTrees NameTclTk KindAbsolutePath Path Pathhd3:Tcl:Sources:TclTk_8.4.1: PathFormatMacOS PathRoot AlwaysSearchUserPathstrue InterpretDOSAndUnixPathstrue RequireFrameworkStyleIncludesfalse UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::generic: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::extensions:tnc: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::expat: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:Universal: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:Libraries: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:Build: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:tcl: PathFormatMacOS PathRootTclTk Recursivetrue FrameworkPathfalse HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS PPC Linker PreLinker PostLinker TargetnameTnc shlib OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.gc CompilerGameCode Converter EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.l CompilerFlex Preprocessor EditLanguage Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.p CompilerMW Pascal PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pas CompilerMW Pascal PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.ppu CompilerMW Pascal PPC EditLanguage Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.y CompilerBison Preprocessor EditLanguage Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionNameno connections avaiable DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixnametncPrefix.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline1 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline1 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen1 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg1 MWWarning_C_warn_extracomma1 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual1 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass0 MWFTP_Post_hostName MWFTP_Post_username MWFTP_Post_password0véP ýϐ ýËÈ MWFTP_Post_remoteDir MWFTP_Post_ftp_PathVersion0 MWFTP_Post_ftp_PathType0 MWFTP_Post_ftp_PathFormat0 MWFTP_Post_ftp_tree MWFTP_Post_uploadDir MWFTP_Post_ftp_port21 MWFTP_Post_SendBin1 MWFTP_Post_ShouldLog1 MWCommandLine_Java_clsName MWCommandLine_Java_args MWVJavaDebugging_Protocol1 MWVJavaDebugging_JDKVersion1 MWVJavaDebugging_TimeOut25 MWVJavaDebugging_SupportSlowDevicesfalse MWVJavaDebugging_UseRemoteLaunchAgentfalse MWVJavaDebugging_LaunchVMasServerfalse MWJava_Language_optimizefalse MWJava_Language_warnDeprecatedfalse MWJava_Language_emitMapfalse MWJava_Language_strictFileNamesfalse MWJava_Language_strictFileHierarchyfalse MWJava_Language_1_1_Compatiblefalse MWJava_Language_emitHeaders0 MWJava_Language_headerTypeJNINativeHeaders MWJava_Language_packageFilter MWJava_Language_genCommentstrue MWJava_Language_genHeadersfalse MWJava_Language_enableAssertsfalse MWJava_Language_targetVM1.1 Manifest-JAD Attributes AttributeMain-Class ValueAuto-Generated MWJava_MRJAppBuilder_outFileMRJApplication MWJava_MRJAppBuilder_mergefalse MWJava_MRJAppBuilder_quitMenutrue MWJava_MRJAppBuilder_growfalse MWJava_MRJAppBuilder_stdoutTypeConsole MWJava_MRJAppBuilder_stderrTypeConsole MWJava_MRJAppBuilder_stdinTypeConsole MWJava_MRJAppBuilder_appIconPVersion0 MWJava_MRJAppBuilder_appIconPType0 MWJava_MRJAppBuilder_appIconPFormat0 MWJava_MRJAppBuilder_appIconPTree MWJava_MRJAppBuilder_appIconFile MWJava_MRJAppBuilder_splashScreenPVersion0 MWJava_MRJAppBuilder_splashScreenPType0 MWJava_MRJAppBuilder_splashScreenPFormat0 MWJava_MRJAppBuilder_splashScreenPTree MWJava_MRJAppBuilder_splashScreenPICTFile MWJava_MRJAppBuilder_aboutName MWJava_MRJAppBuilder_stdoutPVersion0 MWJava_MRJAppBuilder_stdoutPType0 MWJava_MRJAppBuilder_stdoutPFormat0 MWJava_MRJAppBuilder_stdoutPTree MWJava_MRJAppBuilder_stdoutFile MWJava_MRJAppBuilder_stdoutAppendfalse MWJava_MRJAppBuilder_stderrPType0 MWJava_MRJAppBuilder_stderrPFormat0 MWJava_MRJAppBuilder_stderrPTree MWJava_MRJAppBuilder_stderrFile MWJava_MRJAppBuilder_stderrAppendfalse MWJava_MRJAppBuilder_stdinPType0 MWJava_MRJAppBuilder_stdinPFormat0 MWJava_MRJAppBuilder_stdinPTree MWJava_MRJAppBuilder_stdinFile MWJava_Output_outputtypeJarFile MWJava_Output_outfileJavaClasses.jar MWJava_Output_ftype1514754080 MWJava_Output_fcreator1297570384 MWJava_Output_compress0 MWJava_Output_genManifest0 MWJava_Output_trunctypeFront MWJava_Output_deleteClasses0 MWJava_Output_consoleApp1 MWJava_Output_preverify0 MWJava_Output_genJad0 MWJava_Output_obfuscate0 MWJava_Proj_projtypeApplet MWJava_Proj_mainClassName MWJava_Proj_HTMLAppCreator1463898714 MWJava_Proj_HTMLAppName MWJava_Proj_PathVersion1 MWJava_Proj_PathType0 MWJava_Proj_PathFormat0 MWJava_Proj_tree MWJava_Proj_HTMLAppWin32Name MWJava_Proj_compress0 MWJava_Proj_simulator0 MWJava_Proj_useVM\000\000mrj225 MWJava_Proj_vmarguments MWJava_Proj_vmName MWJava_Proj_simPropFile MWJavaDoc_Proj_Version1 MWJavaDoc_Proj_Deprecated1 MWJavaDoc_Proj_Author1 MWJavaDoc_Proj_Index1 MWJavaDoc_Proj_Tree1 MWJavaDoc_Proj_SunResolveToSame0 MWJavaDoc_Proj_Shortnames1 MWJavaDoc_Proj_Folder0 MWJavaDoc_Proj_GenerateAPILinks0 MWJavaDoc_Proj_scopePublic MWJavaDoc_Proj_fcreator1297303877 MWJavaDoc_Proj_encodingName MWJavaDoc_Proj_decodingName MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments MWMacOSPackager_UsePackager0 MWMacOSPackager_FolderToPackage Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreateClassicAlias0 MWMacOSPackager_ClassicAliasMethodUseTargetOutput MWMacOSPackager_ClassicAliasPath Path: PathFormatMacOS PathRootProject MWMacOSPackager_CreatePkgInfo0 MWMacOSPackager_PkgCreatorType???? MWMacOSPackager_PkgFileTypeAPPL MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesInline MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole0 MWCodeGen_PPC_readonlystrings0 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule1 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings0 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel4 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym0 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initnameTclMacInitializeFragment MWLinker_PPC_mainname MWLinker_PPC_termnameTclMacTerminateFragment MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_split_segs0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainnamestart MWProject_MacOSX_typeSharedLibrary MWProject_MacOSX_outfilepowerTcl.shlb MWProject_MacOSX_filecreatorTclL MWProject_MacOSX_filetypeshlb MWProject_MacOSX_vmaddress4096 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWLinker_MachO_exportsNone MWLinker_MachO_mainnamestart MWLinker_MachO_currentversion0 MWLinker_MachO_compatibleversion0 MWLinker_MachO_symfullpath0 MWLinker_MachO_supresswarnings0 MWLinker_MachO_multisymerror0 MWLinker_MachO_prebind1 MWLinker_MachO_deadstrip1 MWLinker_MachO_objectivecsemantics0 MWLinker_MachO_whichfileloaded0 MWLinker_MachO_whyfileloaded0 MWLinker_MachO_readonlyrelocsErrors MWLinker_MachO_undefinedsymbolsErrors MWLinker_MachO_twolevelnamespace1 MWLinker_MachO_stripdebugsymbols0 MWProject_MachO_typeExecutable MWProject_MachO_outfilea.exe MWProject_MachO_filecreator???? MWProject_MachO_filetypeMEXE MWProject_MachO_vmaddress4096 MWProject_MachO_flatrsrc1 MWProject_MachO_flatrsrcfilenamea.rsrc MWProject_MachO_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MachO_installpath./ MWProject_MachO_frameworkversion MWPEF_exportsFile MWPEF_libfolder0 MWPEF_sortcodeDepthFirst MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads1 MWProject_PPC_typeSharedLibrary MWProject_PPC_outfiletnc8.4.shlb MWProject_PPC_filecreatorTclL MWProject_PPC_filetypeshlb MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmangletrue PDisasmX86_verbosetrue PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name InterfaceLib MacOS Library Name MathLib MacOS Library Name TclStub.lib MacOS Library Debug Name tclMacLibrary.c MacOS Text Name MSL_All_PPC.Lib MacOS Library Debug Name MSL_SIOUX_WASTE_PPC.Lib MacOS Library Debug Name tnc.c MacOS Text Name tnc.r MacOS Text Debug Name tnc.exp MacOS Text Debug Name Expat1.95.6.Lib MacOS Library Debug Name tDOMStub.lib MacOS Library Debug, TargetOutputFile Name tclMacLibrary.c MacOS Name InterfaceLib MacOS Name MathLib MacOS Name MSL_All_PPC.Lib MacOS Name MSL_SIOUX_WASTE_PPC.Lib MacOS Name Expat1.95.6.Lib MacOS Name TclStub.lib MacOS Name tDOMStub.lib MacOS Name tnc.c MacOS Name tnc.r MacOS Name tnc.exp MacOS tDOM stublib LinkAgainst Name tDOMStub.lib MacOS Expat static lib tDOM stublib tDOM shlib Tnc shlib Sources tDOM tDOM shlib Name aolstub.cpp MacOS tDOM shlib Name dom.c MacOS tDOM shlib Name domalloc.c MacOS tDOM shlib Name domhtml.c MacOS tDOM shlib Name domlock.c MacOS tDOM shlib Name domxpath.c MacOS tDOM shlib Name domxslt.c MacOS tDOM shlib Name nodecmd.c MacOS tDOM shlib Name tcldom.c MacOS tDOM shlib Name tclexpat.c MacOS tDOM shlib Name tdominit.c MacOS tDOM shlib Name tdomStubInit.c MacOS tDOM shlib Name tdomStubLib.c MacOS tDOM shlib Name utf8conv.c MacOS tDOM shlib Name xmlsimple.c MacOS tDOM shlib Name tDOM.exp MacOS Sources Expat Expat static lib Name xmlparse.c MacOS Expat static lib Name xmlrole.c MacOS Expat static lib Name xmltok.c MacOS Sources tnc Tnc shlib Name tnc.c MacOS Tnc shlib Name tnc.exp MacOS Resources tDOM shlib Name tDOM.r MacOS Tnc shlib Name tnc.r MacOS Mac Libraries tDOM shlib Name InterfaceLib MacOS tDOM shlib Name MathLib MacOS tDOM shlib Name MSL_All_PPC.Lib MacOS tDOM shlib Name MSL_SIOUX_WASTE_PPC.Lib MacOS MacOSX Libraries Tcl Libraries tDOM shlib Name TclStub.lib MacOS Tnc shlib Name tDOMStub.lib MacOS tDOM shlib Name tclMacLibrary.c MacOS XML Libraries tDOM shlib Name Expat1.95.6.Lib MacOS tDOM-0.8.3/mac/tnc.exp0000644000175000017500000000001107631655005014620 0ustar ssobernissoberniTnc_Init tDOM-0.8.3/mac/PrecompHeaders/0000755000175000017500000000000011004674374016226 5ustar ssobernissobernitDOM-0.8.3/mac/PrecompHeaders/CoreHeadersMach-O.pch0000644000175000017500000000047407631655160022103 0ustar ssobernissoberni// CoreHeadersMach-O.pch #pragma c99 on #define _MSL_USING_MW_C_HEADERS 1 #if __mwlinker__ #pragma precompile_target "CoreHeadersMacOSX" #else #pragma precompile_target "CoreHeadersMach-O" #endif /* Now just include the "CoreHeadersMach-O.c" source file ... */ #pragma once on #include "CoreHeadersMach-O.c"tDOM-0.8.3/mac/PrecompHeaders/CoreHeadersMach-O.c0000644000175000017500000000127207631655160021550 0ustar ssobernissoberni/* =========================================================================== MacHeadersMach-O.c © 2000-2002 Metrowerks Corporation. All rights reserved. =========================================================================== Includes used to generate the 'MacHeadersMach-O' precompiled header for Metrowerks C/C++. */ #define _MSL_MACHEADERS_INCLUDES_CMATH 0 #if defined(__cplusplus) && _MSL_USING_MW_C_HEADERS && _MSL_MACHEADERS_INCLUDES_CMATH #include #endif // Apple Framework Headers #ifndef __NOEXTENSIONS__ #define __NOEXTENSIONS__ #endif #ifndef __CF_USE_FRAMEWORK_INCLUDES__ #define __CF_USE_FRAMEWORK_INCLUDES__ #endif #include tDOM-0.8.3/mac/PrecompHeaders/CVS/0000755000175000017500000000000011004674374016661 5ustar ssobernissobernitDOM-0.8.3/mac/PrecompHeaders/CVS/Root0000644000175000017500000000006211004674374017525 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/mac/PrecompHeaders/CVS/Entries0000644000175000017500000000024011004674374020211 0ustar ssobernissoberni/CoreHeadersMach-O.c/1.1/Thu Mar 6 14:25:52 2003// /CoreHeadersMach-O.h/1.1/Thu Mar 6 14:25:52 2003// /CoreHeadersMach-O.pch/1.1/Thu Mar 6 14:25:52 2003// D tDOM-0.8.3/mac/PrecompHeaders/CVS/Repository0000644000175000017500000000003011004674374020754 0ustar ssobernissobernitdom/mac/PrecompHeaders tDOM-0.8.3/mac/PrecompHeaders/CoreHeadersMach-O.h0000644000175000017500000000016307631655160021553 0ustar ssobernissoberni// CoreHeadersMach-O.h #if __mwlinker__ #include #else #include #endiftDOM-0.8.3/mac/Readme_Mac_Compiling0000644000175000017500000000406707631655005017236 0ustar ssobernissoberniReadme_Mac_Compiling ==================== This folder contains the CodeWarrior (CW Pro8) project files to compile the tDOM and tnc extensions. These files are in XML format to ensure their portability. To recreate the projects, you must launch CodeWarrior and choose the "Import Project..." command in the File menu: - tDOM.prj.xml contains targets to build tDOM and tnc as CFM shared libraries (shlibs) for MacOS classic (system 8 or 9): ¥ Expat static lib ¥ tDOM stublib ¥ tDOM shlib ¥ Tnc shlib - tDOM_OSX.prj.xml contains targets to build tDOM and tnc as Mach-O dynamic libraries (dylibs) for MacOSX: ¥ Precomp ¥ Expat Mach-O static ¥ tDOM stubs ¥ tDOM dylib ¥ Tnc dylib To build these extensions, you need the TclStub.lib stubs library coming with Tcl 8.4 for the classic project and the Tcl.framework framework for the OSX project. You also need to have the Expat sources in the "expat" folder (http://expat.sourceforge.net/). There is a target in both projects to build Expat as a static library. The only thing to do, before starting the Make process, is to check that the access paths are set correctly for your installation. All the paths are relative: if you have a standard installation, you should just have to set the {TclTk} source tree to point to your Tcl/Tk sources folder. This is done in the "Source Trees Setting Panel": there is already a {TclTk} source tree defined there, just let it point to the right location. Note also that the OSX project file has a target to build a precompiled header: this precompiled header contains a minimal set of Mac headers to work around a problem due to a conflicting symbol name "Pattern" defined both in tDOM and in QuickDraw.h. Both extensions should now build out of the box provided you "make" the targets in the order. The targets have been made interdependant anyway. You can also find already compiled binaries on my web page: Bernard Desgraupes Last modification: 2003-02-28 06:51:51 tDOM-0.8.3/mac/tDOM.exp0000644000175000017500000000053007631655005014645 0ustar ssobernissoberniTdom_Init Tdom_SafeInit CHandlerSetCreate CHandlerSetGet CHandlerSetGetUserData CHandlerSetInstall CHandlerSetRemove CheckExpatParserObj GetExpatInfo TclExpatObjCmd XML_GetBase XML_GetCurrentByteCount XML_GetCurrentByteIndex XML_GetCurrentColumnNumber XML_GetCurrentLineNumber XML_GetIdAttributeIndex XML_GetSpecifiedAttributeCount XML_SetBase tDOM-0.8.3/mac/macconfig.h0000644000175000017500000000270307631655005015427 0ustar ssobernissoberni/* Copyright 2000, Clark Cooper All rights reserved. This is free software. You are permitted to copy, distribute, or modify it under the terms of the MIT/X license (contained in the COPYING file with this distribution.) */ /* Define to empty if the keyword does not work. */ #undef const /* Define if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to `long' if doesn't define. */ #undef off_t /* Define to `unsigned' if doesn't define. */ #undef size_t /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ //#undef WORDS_BIGENDIAN #define WORDS_BIGENDIAN /* Define if you have the bcopy function. */ #undef HAVE_BCOPY /* Define if you have the getpagesize function. */ #undef HAVE_GETPAGESIZE /* Define if you have the memmove function. */ #define HAVE_MEMMOVE 1 /* Define if you have the header file. */ // #undef HAVE_FCNTL_H #define HAVE_FCNTL_H /* Define if you have the header file. */ #define HAVE_UNISTD_H 1 #define XML_NS #define XML_DTD #ifdef WORDS_BIGENDIAN #define XML_BYTE_ORDER 21 #else #define XML_BYTE_ORDER 12 #endif #define XML_CONTEXT_BYTES 1024 #ifndef HAVE_MEMMOVE #ifdef HAVE_BCOPY #define memmove(d,s,l) bcopy((s),(d),(l)) #else #define memmove(d,s,l) ;punting on memmove; #endif #endif tDOM-0.8.3/tdom.m40000644000175000017500000002464410676044273014007 0ustar ssobernissoberni #------------------------------------------------------------------------ # TDOM_ENABLE_DTD -- # # Allows the building with DTD support # # Arguments: # None # # Results: # # Adds the following arguments to configure: # --enable-dtd=yes|no # # Defines the following vars: # # Sets the following vars: # #------------------------------------------------------------------------ AC_DEFUN(TDOM_ENABLE_DTD, [ AC_MSG_CHECKING([whether to enable dtd support]) AC_ARG_ENABLE(dtd, AC_HELP_STRING([--enable-dtd], [build with dtd support (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_dtd+set}" = set; then enableval="$enable_dtd" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then AC_MSG_RESULT([yes]) AC_DEFINE(XML_DTD) else AC_MSG_RESULT([no]) fi ]) #------------------------------------------------------------------------ # TDOM_ENABLE_NS -- # # Allows the building with namespace support # # Arguments: # None # # Results: # # Adds the following arguments to configure: # --enable-ns=yes|no # # Defines the following vars: # # Sets the following vars: # #------------------------------------------------------------------------ AC_DEFUN(TDOM_ENABLE_NS, [ AC_MSG_CHECKING([whether to enable namespace support]) AC_ARG_ENABLE(ns, AC_HELP_STRING([--enable-ns], [build with XML namespace support (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_ns+set}" = set; then enableval="$enable_ns" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then AC_MSG_RESULT([yes]) AC_DEFINE(XML_NS) else AC_MSG_RESULT([no]) fi ]) #------------------------------------------------------------------------ # TDOM_ENABLE_UNKNOWN -- # # Allows the building with (or without) the custom unknown command # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-unknown=yes|no # # Defines the following vars: # # Sets the following vars: # #------------------------------------------------------------------------ AC_DEFUN(TDOM_ENABLE_UNKNOWN, [ AC_MSG_CHECKING([whether to enable built-in unknown command]) AC_ARG_ENABLE(ucmd, AC_HELP_STRING([--enable-unknown], [enable built-in unknown command (default: off)]), [tcl_ok=$enableval], [tcl_ok=no]) if test "${enable_unknown+set}" = set; then enableval="$enable_unknown" tcl_ok=$enableval else tcl_ok=no fi if test "$tcl_ok" = "no" ; then AC_MSG_RESULT([no]) AC_DEFINE(TDOM_NO_UNKNOWN_CMD) else AC_MSG_RESULT([yes]) fi ]) #------------------------------------------------------------------------ # TDOM_ENABLE_TDOMALLOC -- # # Allows the building with tDOMs block allocator for nodes # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-tdomalloc=yes|no # # Defines the following vars: # # Sets the following vars: # #------------------------------------------------------------------------ AC_DEFUN(TDOM_ENABLE_TDOMALLOC, [ AC_MSG_CHECKING([whether to enable tDOMs block allocator]) AC_ARG_ENABLE(tdomalloc, AC_HELP_STRING([--enable-tdomalloc], [build with the tDOM allocator (default: off)]), [tcl_ok=$enableval], [tcl_ok=no]) if test "${enable_tdomalloc+set}" = set; then enableval="$enable_tdomalloc" tcl_ok=$enableval else tcl_ok=no fi if test "$tcl_ok" = "yes" ; then AC_MSG_RESULT([yes]) TEA_ADD_SOURCES([generic/domalloc.c]) else AC_MSG_RESULT([no]) AC_DEFINE(USE_NORMAL_ALLOCATOR) fi ]) #------------------------------------------------------------------------ # TDOM_PATH_AOLSERVER # # Allows the building with support for AOLserver # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-aolserver=... # # Defines the following vars: # AOL_DIR Full path to the directory containing AOLserver distro # # Sets the following vars: # NS_AOLSERVER #------------------------------------------------------------------------ AC_DEFUN(TDOM_PATH_AOLSERVER, [ AC_MSG_CHECKING([for AOLserver configuration]) AC_ARG_WITH(aol, AC_HELP_STRING([--with-aolserver], [directory with AOLserver distribution]), with_aolserver=${withval}) AC_CACHE_VAL(ac_cv_c_aolserver,[ if test x"${with_aolserver}" != x ; then if test -f "${with_aolserver}/include/ns.h" ; then ac_cv_c_aolserver=`(cd ${with_aolserver}; pwd)` else AC_MSG_ERROR([${with_aolserver} directory doesn't contain ns.h]) fi fi ]) if test x"${ac_cv_c_aolserver}" = x ; then AC_MSG_RESULT([none found]) else AOL_DIR=${ac_cv_c_aolserver} AOL_INCLUDES="-I\"${AOL_DIR}/include\"" if test "`uname -s`" = Darwin ; then aollibs=`ls ${AOL_DIR}/lib/libns* 2>/dev/null` if test x"$aollibs" != x ; then AOL_LIBS="-L\"${AOL_DIR}/lib\" -lnsd -lnsthread" fi fi AC_MSG_RESULT([found AOLserver in $AOL_DIR]) AC_DEFINE(NS_AOLSERVER) AC_DEFINE(USE_NORMAL_ALLOCATOR) fi ]) #------------------------------------------------------------------------ # TDOM_PATH_CONFIG -- # # Locate the tdomConfig.sh file # # Arguments: # None # # Results: # # Adds the following arguments to configure: # --with-tdom=... # # Defines the following vars: # TDOM_BIN_DIR Full path to the directory with tdomConfig.sh #------------------------------------------------------------------------ AC_DEFUN(TDOM_PATH_CONFIG, [ if test x"${no_tdom}" = x ; then AC_MSG_CHECKING([for tDOM configuration]) AC_ARG_WITH(tdom, AC_HELP_STRING([--with-tdom], [directory containig tDOM configuration (tdomConfig.sh)]), with_tdomconfig=${withval}) no_tdom=true if test "${TEA_PLATFORM}" = "windows" ; then tdom_bindir=win else tdom_bindir=unix fi AC_CACHE_VAL(ac_cv_c_tdomconfig,[ # First check to see if --with-tdom was specified. if test x"${with_tdomconfig}" != x ; then if test -f "${with_tdomconfig}/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd ${with_tdomconfig}; pwd)` else AC_MSG_ERROR([${with_tdomconfig} directory doesn't contain tdomConfig.sh]) fi fi # Then check for a sibling installation if test x"${ac_cv_c_tdomconfig}" = x ; then for i in \ ../tdom `ls -dr ../tdom-* 2>/dev/null` \ ../../tdom `ls -dr ../../tdom-* 2>/dev/null` \ ../../../tdom `ls -dr ../../../tdom-* 2>/dev/null` ; do if test -f "$i/$tdom_bindir/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd $i/$tdom_bindir; pwd)` fi done fi # Then check if tnc/tdom are compilied in the source tree if test x"${ac_cv_c_tdomconfig}" = x ; then if test -f "../../$tdom_bindir/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd ../../$tdom_bindir; pwd)` fi fi # Check in a few common install locations if test x"${ac_cv_c_tdomconfig}" = x ; then for i in \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` ; do if test -f "$i/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd $i; pwd)` fi done fi # Check in a few other private locations if test x"${ac_cv_c_tdomconfig}" = x ; then for i in \ ${srcdir}/../tdom \ `ls -dr ${srcdir}/../tdom[[0-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/$tdom_bindir/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd $i/$tdom_bindir; pwd)` fi done fi ]) if test x"${ac_cv_c_tdomconfig}" = x ; then TDOM_BIN_DIR="# no tDOM configuration file found" AC_MSG_WARN(Can't find tDOM configuration definitions) exit 0 else no_tdom= TDOM_BIN_DIR=${ac_cv_c_tdomconfig} AC_MSG_RESULT(found $TDOM_BIN_DIR/tdomConfig.sh) fi fi ]) #------------------------------------------------------------------------ # TDOM_LOAD_CONFIG -- # # Load the tdomConfig.sh file # # Arguments: # # Requires the following vars to be set: # TDOM_BIN_DIR # # Defines the following vars: # # Sets the following vars: # #------------------------------------------------------------------------ AC_DEFUN(TDOM_LOAD_CONFIG, [ AC_MSG_CHECKING([for existence of $TDOM_BIN_DIR/tdomConfig.sh]) if test -f "$TDOM_BIN_DIR/tdomConfig.sh" ; then AC_MSG_RESULT([loading]) . $TDOM_BIN_DIR/tdomConfig.sh else AC_MSG_RESULT([file not found]) fi if test -f "${TDOM_BIN_DIR}/Makefile" ; then TDOM_STUB_LIB_SPEC=${TDOM_BUILD_STUB_LIB_SPEC} fi AC_SUBST(TDOM_VERSION) AC_SUBST(TDOM_STUB_LIB_SPEC) AC_SUBST(TDOM_SRC_DIR) ]) #------------------------------------------------------------------------ # TDOM_EXPORT_CONFIG -- # # Define the data to insert into the ${PACKAGE_NAME}Config.sh file # # Arguments: # None # # Results: # Subst the following vars: # #------------------------------------------------------------------------ AC_DEFUN(TDOM_EXPORT_CONFIG, [ #-------------------------------------------------------------------- # These are for ${PACKAGE_NAME}Config.sh #-------------------------------------------------------------------- # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib) eval pkglibdir="[$]{libdir}/${PACKAGE_NAME}${PACKAGE_VERSION}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval PKG_STUB_LIB_FLAG="-l${PACKAGE_NAME}stub${PACKAGE_VERSION}" else eval PKG_STUB_LIB_FLAG="-l${PACKAGE_NAME}stub`echo ${PACKAGE_VERSION} | tr -d .`" fi PKG_BUILD_STUB_LIB_SPEC="-L`pwd` ${PKG_STUB_LIB_FLAG}" PKG_STUB_LIB_SPEC="-L${pkglibdir} ${PKG_STUB_LIB_FLAG}" PKG_BUILD_STUB_LIB_PATH="`pwd`/[$]{PKG_STUB_LIB_FILE}" PKG_STUB_LIB_PATH="${pkglibdir}/[$]{PKG_STUB_LIB_FILE}" AC_SUBST(PKG_BUILD_STUB_LIB_SPEC) AC_SUBST(PKG_STUB_LIB_SPEC) AC_SUBST(PKG_BUILD_STUB_LIB_PATH) AC_SUBST(PKG_STUB_LIB_PATH) ]) # Local Variables: # mode: autoconf # End: # EOF tDOM-0.8.3/macosx/0000755000175000017500000000000011004674374014057 5ustar ssobernissobernitDOM-0.8.3/macosx/CVS/0000755000175000017500000000000011004674374014512 5ustar ssobernissobernitDOM-0.8.3/macosx/CVS/Root0000644000175000017500000000006211004674374015356 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/macosx/CVS/Entries0000644000175000017500000000005111004674374016042 0ustar ssobernissoberni/README/1.3/Sun Sep 14 11:08:40 2003// D tDOM-0.8.3/macosx/CVS/Repository0000644000175000017500000000001411004674374016607 0ustar ssobernissobernitdom/macosx tDOM-0.8.3/macosx/README0000644000175000017500000000026307731046070014736 0ustar ssobernissoberni Please go to ../unix directory and inspect the CONFIG file. There you will find example on how to configure and make the library on Mac OSX using GNU configure/make tools. -EOF tDOM-0.8.3/lib/0000755000175000017500000000000011004674373013332 5ustar ssobernissobernitDOM-0.8.3/lib/tdom.tcl0000644000175000017500000006653410170773537015024 0ustar ssobernissoberni#---------------------------------------------------------------------------- # Copyright (c) 1999 Jochen Loewer (loewerj@hotmail.com) #---------------------------------------------------------------------------- # # $Id: tdom.tcl,v 1.19 2005/01/11 15:57:19 rolf Exp $ # # # The higher level functions of tDOM written in plain Tcl. # # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://www.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the # License for the specific language governing rights and limitations # under the License. # # The Original Code is tDOM. # # The Initial Developer of the Original Code is Jochen Loewer # Portions created by Jochen Loewer are Copyright (C) 1998, 1999 # Jochen Loewer. All Rights Reserved. # # Contributor(s): # Rolf Ade (rolf@pointsman.de): 'fake' nodelists/live childNodes # # written by Jochen Loewer # April, 1999 # #---------------------------------------------------------------------------- package require tdom #---------------------------------------------------------------------------- # setup namespaces for additional Tcl level methods, etc. # #---------------------------------------------------------------------------- namespace eval ::dom { namespace eval domDoc { } namespace eval domNode { } namespace eval DOMImplementation { } namespace eval xpathFunc { } namespace eval xpathFuncHelper { } } namespace eval ::tDOM { variable extRefHandlerDebug 0 variable useForeignDTD "" namespace export xmlOpenFile xmlReadFile extRefHandler baseURL } #---------------------------------------------------------------------------- # hasFeature (DOMImplementation method) # # # @in url the URL, where to get the XML document # # @return document object # @exception XML parse errors, ... # #---------------------------------------------------------------------------- proc ::dom::DOMImplementation::hasFeature { dom feature {version ""} } { switch $feature { xml - XML { if {($version == "") || ($version == "1.0")} { return 1 } } } return 0 } #---------------------------------------------------------------------------- # load (DOMImplementation method) # # requests a XML document via http using the given URL and # builds up a DOM tree in memory returning the document object # # # @in url the URL, where to get the XML document # # @return document object # @exception XML parse errors, ... # #---------------------------------------------------------------------------- proc ::dom::DOMImplementation::load { dom url } { error "Sorry, load method not implemented yet!" } #---------------------------------------------------------------------------- # isa (docDoc method, for [incr tcl] compatibility) # # # @in className # # @return 1 iff inherits from the given class # #---------------------------------------------------------------------------- proc ::dom::domDoc::isa { doc className } { if {$className == "domDoc"} { return 1 } return 0 } #---------------------------------------------------------------------------- # info (domDoc method, for [incr tcl] compatibility) # # # @in subcommand # @in args # #---------------------------------------------------------------------------- proc ::dom::domDoc::info { doc subcommand args } { switch $subcommand { class { return "domDoc" } inherit { return "" } heritage { return "domDoc {}" } default { error "domDoc::info subcommand $subcommand not yet implemented!" } } } #---------------------------------------------------------------------------- # importNode (domDoc method) # # Document Object Model (Core) Level 2 method # # # @in subcommand # @in args # #---------------------------------------------------------------------------- proc ::dom::domDoc::importNode { doc importedNode deep } { if {$deep || ($deep == "-deep")} { set node [$importedNode cloneNode -deep] } else { set node [$importedNode cloneNode] } return $node } #---------------------------------------------------------------------------- # isa (domNode method, for [incr tcl] compatibility) # # # @in className # # @return 1 iff inherits from the given class # #---------------------------------------------------------------------------- proc ::dom::domNode::isa { doc className } { if {$className == "domNode"} { return 1 } return 0 } #---------------------------------------------------------------------------- # info (domNode method, for [incr tcl] compatibility) # # # @in subcommand # @in args # #---------------------------------------------------------------------------- proc ::dom::domNode::info { doc subcommand args } { switch $subcommand { class { return "domNode" } inherit { return "" } heritage { return "domNode {}" } default { error "domNode::info subcommand $subcommand not yet implemented!" } } } #---------------------------------------------------------------------------- # isWithin (domNode method) # # tests, whether a node object is nested below another tag # # # @in tagName the nodeName of an elment node # # @return 1 iff node is nested below a element with nodeName tagName # 0 otherwise # #---------------------------------------------------------------------------- proc ::dom::domNode::isWithin { node tagName } { while {[$node parentNode] != ""} { set node [$node parentNode] if {[$node nodeName] == $tagName} { return 1 } } return 0 } #---------------------------------------------------------------------------- # tagName (domNode method) # # same a nodeName for element interface # #---------------------------------------------------------------------------- proc ::dom::domNode::tagName { node } { if {[$node nodeType] == "ELEMENT_NODE"} { return [$node nodeName] } return -code error "NOT_SUPPORTED_ERR not an element!" } #---------------------------------------------------------------------------- # simpleTranslate (domNode method) # # applies simple translation rules similar to Cost's simple # translations to a node # # # @in output_var # @in trans_specs # #---------------------------------------------------------------------------- proc ::dom::domNode::simpleTranslate { node output_var trans_specs } { upvar $output_var output if {[$node nodeType] == "TEXT_NODE"} { append output [cgiQuote [$node nodeValue]] return } set found 0 foreach {match action} $trans_specs { if {[catch { if {!$found && ([$node selectNode self::$match] != "") } { set found 1 } } err]} { if {![string match "NodeSet expected for parent axis!" $err]} { error $err } } if {$found && ($action != "-")} { set stop 0 foreach {type value} $action { switch $type { prefix { append output [subst $value] } tag { append output <$value> } start { append output [eval $value] } stop { set stop 1 } } } if {!$stop} { foreach child [$node childNodes] { simpleTranslate $child output $trans_specs } } foreach {type value} $action { switch $type { suffix { append output [subst $value] } end { append output [eval $value] } tag { append output } } } return } } foreach child [$node childNodes] { simpleTranslate $child output $trans_specs } } #---------------------------------------------------------------------------- # a DOM conformant 'live' childNodes # # @return a 'nodelist' object (it is just the normal node) # #---------------------------------------------------------------------------- proc ::dom::domNode::childNodesLive { node } { return $node } #---------------------------------------------------------------------------- # item method on a 'nodelist' object # # @return a 'nodelist' object (it is just a normal # #---------------------------------------------------------------------------- proc ::dom::domNode::item { nodeListNode index } { return [lindex [$nodeListNode childNodes] $index] } #---------------------------------------------------------------------------- # length method on a 'nodelist' object # # @return a 'nodelist' object (it is just a normal # #---------------------------------------------------------------------------- proc ::dom::domNode::length { nodeListNode } { return [llength [$nodeListNode childNodes]] } #---------------------------------------------------------------------------- # appendData on a 'CharacterData' object # #---------------------------------------------------------------------------- proc ::dom::domNode::appendData { node arg } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } set oldValue [$node nodeValue] $node nodeValue [append oldValue $arg] } #---------------------------------------------------------------------------- # deleteData on a 'CharacterData' object # #---------------------------------------------------------------------------- proc ::dom::domNode::deleteData { node offset count } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } incr offset -1 set before [string range [$node nodeValue] 0 $offset] incr offset incr offset $count set after [string range [$node nodeValue] $offset end] $node nodeValue [append before $after] } #---------------------------------------------------------------------------- # insertData on a 'CharacterData' object # #---------------------------------------------------------------------------- proc ::dom::domNode::insertData { node offset arg } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } incr offset -1 set before [string range [$node nodeValue] 0 $offset] incr offset set after [string range [$node nodeValue] $offset end] $node nodeValue [append before $arg $after] } #---------------------------------------------------------------------------- # replaceData on a 'CharacterData' object # #---------------------------------------------------------------------------- proc ::dom::domNode::replaceData { node offset count arg } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } incr offset -1 set before [string range [$node nodeValue] 0 $offset] incr offset incr offset $count set after [string range [$node nodeValue] $offset end] $node nodeValue [append before $arg $after] } #---------------------------------------------------------------------------- # substringData on a 'CharacterData' object # # @return part of the node value (text) # #---------------------------------------------------------------------------- proc ::dom::domNode::substringData { node offset count } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } set endOffset [expr $offset + $count - 1] return [string range [$node nodeValue] $offset $endOffset] } #---------------------------------------------------------------------------- # coerce2number # #---------------------------------------------------------------------------- proc ::dom::xpathFuncHelper::coerce2number { type value } { switch $type { empty { return 0 } number - string { return $value } attrvalues { return [lindex $value 0] } nodes { return [[lindex $value 0] selectNodes number()] } attrnodes { return [lindex $value 1] } } } #---------------------------------------------------------------------------- # coerce2string # #---------------------------------------------------------------------------- proc ::dom::xpathFuncHelper::coerce2string { type value } { switch $type { empty { return "" } number - string { return $value } attrvalues { return [lindex $value 0] } nodes { return [[lindex $value 0] selectNodes string()] } attrnodes { return [lindex $value 1] } } } #---------------------------------------------------------------------------- # function-available # #---------------------------------------------------------------------------- proc ::dom::xpathFunc::function-available { ctxNode pos nodeListType nodeList args} { if {[llength $args] != 2} { error "function-available(): wrong # of args!" } foreach { arg1Typ arg1Value } $args break set str [::dom::xpathFuncHelper::coerce2string $arg1Typ $arg1Value ] switch $str { boolean - ceiling - concat - contains - count - current - document - element-available - false - floor - format-number - generate-id - id - key - last - lang - local-name - name - namespace-uri - normalize-space - not - number - position - round - starts-with - string - string-length - substring - substring-after - substring-before - sum - translate - true - unparsed-entity-uri { return [list bool true] } default { set TclXpathFuncs [info procs ::dom::xpathFunc::*] if {[lsearch -exact $TclXpathFuncs $str] != -1} { return [list bool true] } else { return [list bool false] } } } } #---------------------------------------------------------------------------- # element-available # # This is not strictly correct. The XSLT namespace may be bound # to another prefix (and the prefix 'xsl' may be bound to another # namespace). Since the expression context isn't available at the # moment at tcl coded XPath functions, this couldn't be done better # than this "works in the 'normal' cases" version. #---------------------------------------------------------------------------- proc ::dom::xpathFunc::element-available { ctxNode pos nodeListType nodeList args} { if {[llength $args] != 2} { error "element-available(): wrong # of args!" } foreach { arg1Typ arg1Value } $args break set str [::dom::xpathFuncHelper::coerce2string $arg1Typ $arg1Value ] switch $str { xsl:stylesheet - xsl:transform - xsl:include - xsl:import - xsl:strip-space - xsl:preserve-space - xsl:template - xsl:apply-templates - xsl:apply-imports - xsl:call-template - xsl:element - xsl:attribute - xsl:attribute-set - xsl:text - xsl:processing-instruction - xsl:comment - xsl:copy - xsl:value-of - xsl:number - xsl:for-each - xsl:if - xsl:choose - xsl:when - xsl:otherwise - xsl:sort - xsl:variable - xsl:param - xsl:copy-of - xsl:with-param - xsl:key - xsl:message - xsl:decimal-format - xsl:namespace-alias - xsl:output - xsl:fallback { return [list bool true] } default { return [list bool false] } } } #---------------------------------------------------------------------------- # system-property # # This is not strictly correct. The XSLT namespace may be bound # to another prefix (and the prefix 'xsl' may be bound to another # namespace). Since the expression context isn't available at the # moment at tcl coded XPath functions, this couldn't be done better # than this "works in the 'normal' cases" version. #---------------------------------------------------------------------------- proc ::dom::xpathFunc::system-property { ctxNode pos nodeListType nodeList args } { if {[llength $args] != 2} { error "system-property(): wrong # of args!" } foreach { arg1Typ arg1Value } $args break set str [::dom::xpathFuncHelper::coerce2string $arg1Typ $arg1Value ] switch $str { xsl:version { return [list number 1.0] } xsl:vendor { return [list string "Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."] } xsl:vendor-url { return [list string "http://www.tdom.org"] } default { return [list string ""] } } } #---------------------------------------------------------------------------- # IANAEncoding2TclEncoding # #---------------------------------------------------------------------------- # As of version 8.3.4 tcl supports # cp860 cp861 cp862 cp863 tis-620 cp864 cp865 cp866 gb12345 cp949 # cp950 cp869 dingbats ksc5601 macCentEuro cp874 macUkraine jis0201 # gb2312 euc-cn euc-jp iso8859-10 macThai jis0208 iso2022-jp # macIceland iso2022 iso8859-13 iso8859-14 jis0212 iso8859-15 cp737 # iso8859-16 big5 euc-kr macRomania macTurkish gb1988 iso2022-kr # macGreek ascii cp437 macRoman iso8859-1 iso8859-2 iso8859-3 ebcdic # macCroatian koi8-r iso8859-4 iso8859-5 cp1250 macCyrillic iso8859-6 # cp1251 koi8-u macDingbats iso8859-7 cp1252 iso8859-8 cp1253 # iso8859-9 cp1254 cp1255 cp850 cp1256 cp932 identity cp1257 cp852 # macJapan cp1258 shiftjis utf-8 cp855 cp936 symbol cp775 unicode # cp857 # # Just add more mappings (and mail them to the tDOM mailing list, please). proc tDOM::IANAEncoding2TclEncoding {IANAName} { # First the most widespread encodings with there # preferred MIME name, to speed lookup in this # usual cases. Later the official names and the # aliases. # # For "official names for character sets that may be # used in the Internet" see # http://www.iana.org/assignments/character-sets # (that's the source for the encoding names below) # # Matching is case-insensitive switch [string tolower $IANAName] { "us-ascii" {return ascii} "utf-8" {return utf-8} "utf-16" {return unicode; # not sure about this} "iso-8859-1" {return iso8859-1} "iso-8859-2" {return iso8859-2} "iso-8859-3" {return iso8859-3} "iso-8859-4" {return iso8859-4} "iso-8859-5" {return iso8859-5} "iso-8859-6" {return iso8859-6} "iso-8859-7" {return iso8859-7} "iso-8859-8" {return iso8859-8} "iso-8859-9" {return iso8859-9} "iso-8859-10" {return iso8859-10} "iso-8859-13" {return iso8859-13} "iso-8859-14" {return iso8859-14} "iso-8859-15" {return iso8859-15} "iso-8859-16" {return iso8859-16} "iso-2022-kr" {return iso2022-kr} "euc-kr" {return euc-kr} "iso-2022-jp" {return iso2022-jp} "koi8-r" {return koi8-r} "shift_jis" {return shiftjis} "euc-jp" {return euc-jp} "gb2312" {return gb2312} "big5" {return big5} "cp866" {return cp866} "cp1250" {return cp1250} "cp1253" {return cp1253} "cp1254" {return cp1254} "cp1255" {return cp1255} "cp1256" {return cp1256} "cp1257" {return cp1257} "windows-1251" - "cp1251" {return cp1251} "windows-1252" - "cp1252" {return cp1252} "iso_8859-1:1987" - "iso-ir-100" - "iso_8859-1" - "latin1" - "l1" - "ibm819" - "cp819" - "csisolatin1" {return iso8859-1} "iso_8859-2:1987" - "iso-ir-101" - "iso_8859-2" - "iso-8859-2" - "latin2" - "l2" - "csisolatin2" {return iso8859-2} "iso_8859-5:1988" - "iso-ir-144" - "iso_8859-5" - "iso-8859-5" - "cyrillic" - "csisolatincyrillic" {return iso8859-5} "ms_kanji" - "csshiftjis" {return shiftjis} "csiso2022kr" {return iso2022-kr} "ibm866" - "csibm866" {return cp866} default { # There are much more encoding names out there # It's only laziness, that let me stop here. error "Unrecognized encoding name '$IANAName'" } } } #---------------------------------------------------------------------------- # xmlOpenFile # #---------------------------------------------------------------------------- proc tDOM::xmlOpenFile {filename {encodingString {}}} { set fd [open $filename] if {$encodingString != {}} { upvar $encodingString encString } # The autodetection of the encoding follows # XML Recomendation, Appendix F fconfigure $fd -encoding binary if {![binary scan [read $fd 4] "H8" firstBytes]} { # very short (< 4 Bytes) file seek $fd 0 start set encString UTF-8 return $fd } # First check for BOM switch [string range $firstBytes 0 3] { "feff" - "fffe" { # feff: UTF-16, big-endian BOM # ffef: UTF-16, little-endian BOM seek $fd 0 start set encString UTF-16 fconfigure $fd -encoding identity return $fd } } # If the entity has a XML Declaration, the first four characters # must be "" $head] if {$closeIndex == -1} { error "Weird XML data or not XML data at all" } seek $fd 0 start set xmlDeclaration [read $fd [expr {$closeIndex + 5}]] # extract the encoding information set pattern {^[^>]+encoding=[\x20\x9\xd\xa]*["']([^ "']+)['"]} # emacs: " if {![regexp $pattern $head - encStr]} { # Probably something like . # Without encoding declaration this must be UTF-8 set encoding utf-8 set encString UTF-8 } else { set encoding [IANAEncoding2TclEncoding $encStr] set encString $encStr } } "0000003c" - "0000003c" - "3c000000" - "00003c00" { # UCS-4 error "UCS-4 not supported" } "003c003f" - "3c003f00" { # UTF-16, big-endian, no BOM # UTF-16, little-endian, no BOM seek $fd 0 start set encoding identity set encString UTF-16 } "4c6fa794" { # EBCDIC in some flavor error "EBCDIC not supported" } default { # UTF-8 without an encoding declaration seek $fd 0 start set encoding identity set encString "UTF-8" } } fconfigure $fd -encoding $encoding return $fd } #---------------------------------------------------------------------------- # xmlReadFile # #---------------------------------------------------------------------------- proc tDOM::xmlReadFile {filename {encodingString {}}} { if {$encodingString != {}} { upvar $encodingString encString } set fd [xmlOpenFile $filename encString] set data [read $fd [file size $filename]] close $fd return $data } #---------------------------------------------------------------------------- # extRefHandler # # A very simple external entity resolver, included for convenience. # Depends on the tcllib package uri and resolves only file URLs. # #---------------------------------------------------------------------------- if {![catch {package require uri}]} { proc tDOM::extRefHandler {base systemId publicId} { variable extRefHandlerDebug variable useForeignDTD if {$extRefHandlerDebug} { puts stderr "tDOM::extRefHandler called with:" puts stderr "\tbase: '$base'" puts stderr "\tsystemId: '$systemId'" puts stderr "\tpublicId: '$publicId'" } if {$systemId == ""} { if {$useForeignDTD != ""} { set systemId $useForeignDTD } else { error "::tDOM::useForeignDTD does\ not point to the foreign DTD" } } set absolutURI [uri::resolve $base $systemId] array set uriData [uri::split $absolutURI] switch $uriData(scheme) { file { return [list string $absolutURI [xmlReadFile $uriData(path)]] } default { error "can only handle file URI's" } } } } #---------------------------------------------------------------------------- # baseURL # # A simple convenience proc which returns an absolute URL for a given # filename. # #---------------------------------------------------------------------------- proc tDOM::baseURL {path} { switch [file pathtype $path] { "relative" { return "file://[pwd]/$path" } default { return "file://$path" } } } # EOF tDOM-0.8.3/lib/CVS/0000755000175000017500000000000011004674373013765 5ustar ssobernissobernitDOM-0.8.3/lib/CVS/Root0000644000175000017500000000006211004674373014631 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/lib/CVS/Entries0000644000175000017500000000005411004674373015320 0ustar ssobernissoberni/tdom.tcl/1.19/Tue Jan 11 15:57:19 2005// D tDOM-0.8.3/lib/CVS/Repository0000644000175000017500000000001111004674373016057 0ustar ssobernissobernitdom/lib tDOM-0.8.3/xe/0000755000175000017500000000000011004674377013204 5ustar ssobernissobernitDOM-0.8.3/xe/xe-input0000644000175000017500000000236707636075133014711 0ustar ssobernissoberni xml(file:../tests/data/mondial-europe.xml)/country[name='Germany'] xml(file:../tests/data/mondial-europe.xml) contains(//country[name='Germany']/name,"any") xml(file:../tests/data/mondial-europe.xml)//country[name='Germany']/province[population>5000000]/name xml(file:../tests/data/mondial-europe.xml)count(//country[name='Germany']/province) xml(file:../tests/data/mondial-europe.xml) //mountain[in_country[@ref = string(//country[name='Germany']/@id)]] xml(file:../tests/data/mondial-europe.xml)//country[name='France']/province/name xml(file:../tests/data/mondial-europe.xml)//country[name='Germany']//city[population>1000000] xml(file:../tests/data/mondial-europe.xml)//country[name='France']/province/city[population<100000] xml(file:../tests/data/mondial-europe.xml)//river[length>4000] xml(file:../tests/data/mondial-europe.xml)//river/name xml(file:../tests/data/mondial-europe.xml) //country/car_code/text() xml(file:../tests/data/books.xml) //book[@style="novel"] xml(file:../doc/domNode.xml) //method/text() xml(http://www.fernweh.com/wap/info.wml) xml(http://www.fernweh.com/wap/categories.wml) xml(http://wap.is.danet.de/lh/flugplan/index.wml) xml(http://wap.t-d1-wap.de/t-online/) xml(http://www.vbxml.com/downloads/files/dropdown_xsl.txt) tDOM-0.8.3/xe/xe.bat0000644000175000017500000000004607435314537014312 0ustar ssobernissobernid:\opt\tcl8.2.3\bin\wish82 xe xe-inputtDOM-0.8.3/xe/CVS/0000755000175000017500000000000011004674377013637 5ustar ssobernissobernitDOM-0.8.3/xe/CVS/Root0000644000175000017500000000006211004674376014502 0ustar ssobernissoberni:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs tDOM-0.8.3/xe/CVS/Entries0000644000175000017500000000025011004674377015170 0ustar ssobernissoberni/README/1.1.1.1/Fri Feb 22 01:05:35 2002// /xe/1.1.1.1/Fri Feb 22 01:05:35 2002// /xe-input/1.2/Wed Mar 19 14:10:35 2003// /xe.bat/1.1.1.1/Fri Feb 22 01:05:35 2002// D tDOM-0.8.3/xe/CVS/Repository0000644000175000017500000000001011004674376015727 0ustar ssobernissobernitdom/xe tDOM-0.8.3/xe/README0000644000175000017500000000052007435314537014063 0ustar ssobernissoberni XE needs saves the upper input window in the file ~/.xe-input, if it is called without arguments. Otherwise the first argument gives the file name for the saved input windos. To start playing with XE copy you could do either: 1) cp xe-input ~/.xe-input xe 2) xe xe-input Latter should be more appropiate for Wn32 users. tDOM-0.8.3/xe/xe0000755000175000017500000023306007435314537013554 0ustar ssobernissoberni#!/opt/tcl/bin/wish #---------------------------------------------------------------------------- # Copyright (c) 1999 - 2000 Jochen C. Loewer (loewerj@hotmail.com) #---------------------------------------------------------------------------- # # A XML/DOM/XPath evaluator/viewer... featuring the Tk text widget. # # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://www.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the # License for the specific language governing rights and limitations # under the License. # # The Original Code is tDOM. # # The Initial Developer of the Original Code is Jochen Loewer # Portions created by Jochen Loewer are Copyright (C) 1998, 1999 # Jochen Loewer. All Rights Reserved. # # Contributor(s): # # # # $Log: xe,v $ # Revision 1.1.1.1 2002/02/22 01:05:35 rolf # tDOM0.7test with Jochens first set of patches # # # # # written by Jochen Loewer # December, 1999 # # # # Contains emacsbinds.tcl: # # Copyright 1993 by Paul Raines (raines@bohr.physics.upenn.edu) # # Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that the above copyright # notice appear in all copies. The University of Pennsylvania # makes no representations about the suitability of this # software for any purpose. It is provided "as is" without # express or implied warranty. # #---------------------------------------------------------------------------- # ! All that needs some code cleanup! The code should be more readable! # ! Currently just use xe! #---------------------------------------------------------------------------- # Package/Includes #---------------------------------------------------------------------------- package require http 2 if {[catch { load ../unix/tdom0.6[info shared] }]} { catch { load ../win/tdom0.6.dll } } catch { package require tdom 0.6 } catch { source ../lib/tdom.tcl } #---------------------------------------------------------------------------- # Globals #---------------------------------------------------------------------------- set HttpProxyHost "" set HttpProxyPort "" #---------------------------------------------------------------------------- # $Header: /usr/local/pubcvs/tdom/xe/xe,v 1.1.1.1 2002/02/22 01:05:35 rolf Exp $ # # # p a n e implements the new widget 'pane' to realize a # resizing of the space between two sub windows # in fixed size outer window, the pane window. # Uses plain tcl/tk code # # # $Log: xe,v $ # Revision 1.1.1.1 2002/02/22 01:05:35 rolf # tDOM0.7test with Jochens first set of patches # # Revision 1.1 96/12/06 15:59:14 15:59:14 jolo (#Jochen Loewer) # Initial revision # # # # written by Jochen Loewer # July, 1996 # #---------------------------------------------------------------------------- #----------------------------------------------------------------------pane-- proc pane { path type width height } { global _pane_Priv set _pane_Priv(moving) no frame $path -height $height -width $width -relief flat frame $path.separator -height 7 -relief flat frame $path.separator.line -height 4 -relief ridge -borderwidth 1 frame $path.separator.handle -width 8 -height 8 -relief raised -borderwidth 1 place $path.separator.line -anchor nw -x 0 -rely 0.4 -relwidth 1.0 place $path.separator.handle -anchor center -relx 1.0 -rely 0.5 -x -8 place $path.separator -anchor nw -x 0 -y 0 -relwidth 1.0 $path.separator.handle config -cursor sb_v_double_arrow set _pane_Priv(maxy) $height set _pane_Priv(moving) no } #----------------------------------------------------------------------pane-- proc pane_place { path type ratio win1 win2 } { global _pane_Priv set _pane_Priv(moving) no update scan [winfo geometry $path] "%dx%d+%d+%d" w h x y set middley [expr $h*$ratio] place $path.separator -anchor nw -x 0 -y $middley -relwidth 1.0 update pane_partionize $path $win1 $win2 $path.separator.handle config -cursor sb_v_double_arrow bind $path.separator.handle "pane_down $path" bind $path.separator.handle "pane_motion $path" bind $path.separator.handle "pane_release $path $win1 $win2" bind $path "pane_resize $path $win1 $win2 %w %h" set _pane_Priv(maxy) $h set _pane_Priv(moving) no } #-----------------------------------------------------------------pane_down-- proc pane_down { pane } { global _pane_Priv $pane.separator.handle configure -relief sunken raise $pane.separator set _pane_Priv(rooty) [winfo pointery $pane] scan [winfo geometry $pane] "%dx%d+%d+%d" w h x y set _pane_Priv(maxy) $h scan [winfo geometry $pane.separator] "%dx%d+%d+%d" w h x y set _pane_Priv(oldy) $y set _pane_Priv(moving) yes } #---------------------------------------------------------------pane_motion-- proc pane_motion { pane } { global _pane_Priv set y [winfo pointery $pane] set delta [expr $y-$_pane_Priv(rooty)] set newy [expr $_pane_Priv(oldy)+$delta] if { ($newy > 8) && ([expr $newy+16] <$_pane_Priv(maxy)) } { place $pane.separator -anchor nw -x 0 -y $newy -relwidth 1.0 } } #--------------------------------------------------------------pane_release-- proc pane_partionize { pane win1 win2 } { scan [winfo geometry $pane.separator] "%dx%d+%d+%d" w h x y place $win1 -anchor nw -x 0 -y 0 -relwidth 1.0 -height $y -relheight {} set ywin2 [expr $y+$h] scan [winfo geometry $pane] "%dx%d+%d+%d" w h x y set hwin2 [expr $h-$ywin2-1] place $win2 -anchor se -relx 1.0 -rely 1.0 -relwidth 1.0 -height $hwin2 } #--------------------------------------------------------------pane_release-- proc pane_release { pane win1 win2 } { global _pane_Priv $pane.separator.handle configure -relief raised pane_partionize $pane $win1 $win2 set _pane_Priv(moving) no } #---------------------------------------------------------------pane_resize-- proc pane_resize { pane win1 win2 neww newh} { global _pane_Priv if { $_pane_Priv(moving) != "yes" } { scan [winfo geometry $pane.separator] "%dx%d+%d+%d" w h xp y set newy [expr ($y*$newh)/$_pane_Priv(maxy)] place $pane.separator -anchor nw -x 0 -y $newy -relwidth 1.0 update pane_partionize $pane $win1 $win2 } set _pane_Priv(maxy) $newh } ############################################################################ # include bindings.tk from TkMail (Thanks Paul!) ############################################################################ # # COPYRIGHT: # Copyright 1993 by Paul Raines (raines@bohr.physics.upenn.edu) # # Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that the above copyright # notice appear in all copies. The University of Pennsylvania # makes no representations about the suitability of this # software for any purpose. It is provided "as is" without # express or implied warranty. # global bind_xnd btp # USER SETTINGS set btp(prevcmd) "begin-line" # maximum number of kills to save in ring set btp(maxkill) 10 # maximum number of marks to save in ring set btp(maxmark) 10 # syntax for letter not part of a "word" set btp(not-word) {[^a-zA-Z_0-9]} # procedure to use for errors set btp(error) error # procedure to use for beeping set btp(beep) "" # whether to bind Escape prefix commands also to the Meta modifier set btp(use-meta) 1 # column at which to line wrap set btp(fillcol) 0 # prefix for line wrapping (NOT REALLY WORKING YET) set btp(fillprefix) "" # PRIVATE SETTINGS set btp(lastkill) 0.0 set btp(killring) "" set btp(killptr) 0 set btp(killlen) 0 set btp(arg) def proc tk_entryForwspace w { set x [expr [$w index insert] - 1] catch {$w delete $x} } # selection_if_any - return selection if it exists, else {} # this is from kjx@comp.vuw.ac.nz (R. James Noble) proc selection_if_any {} { if {[catch {selection get} s]} {return ""} {return $s} } proc bind_cleanup { w } { global btp catch {unset btp($w,markring)} } proc bt:current-line { w } { return [lindex [split [$w index insert] .] 0] } proc bt:current-col { w } { return [lindex [split [$w index insert] .] 1] } proc bt:move-line { w {num 1} } { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num [expr $num*$btp(arg)] set btp(arg) def } if {$btp(prevcmd) != "move-line"} { set btp(goalcol) [lindex [split [$w index insert] .] 1] } if {$num > -1} {set num "+$num"} $w tag remove sel 1.0 end set ndx [$w index "insert $num line lineend"] set goalndx [lindex [split $ndx .] 0].$btp(goalcol) if {$btp(goalcol) < [lindex [split $ndx .] 1]} { $w mark set insert $goalndx } else { $w mark set insert $ndx } $w yview -pickplace insert set btp(prevcmd) move-line } proc bt:move-char { w {num 1} } { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num [expr $num*$btp(arg)] set btp(arg) def } if {$num > -1} {set num "+$num"} $w tag remove sel 1.0 end $w mark set insert "insert $num char" $w yview -pickplace insert set btp(prevcmd) "move-char" } proc bt:move-word {w {num 1}} { global btp set btp(lastkill) 0.0 $w tag remove sel 1.0 end if {$btp(arg) != "def"} { set num [expr $num*$btp(arg)] set btp(arg) def } if {$num > 0} { for {set i 0} {$i < $num } {incr i} { while {[regexp $btp(not-word) [$w get insert]]} { $w mark set insert insert+1c } $w mark set insert {insert wordend} } } else { for {set i 0} {$i > $num } {incr i -1} { $w mark set insert insert-1c while {[regexp $btp(not-word) [$w get insert]]} { $w mark set insert insert-1c } $w mark set insert {insert wordstart} } } $w yview -pickplace insert set btp(prevcmd) "move-word" } proc bt:begin-line { w {num 0}} { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } if {$num != 0} {set num [expr $num-1]} bt:move-line $w $num $w mark set insert {insert linestart} $w tag remove sel 1.0 end $w yview -pickplace insert set btp(prevcmd) "begin-line" } proc bt:end-line { w {num 0}} { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } if {$num != 0} {set num [expr $num-1]} bt:move-line $w $num $w mark set insert {insert lineend} $w tag remove sel 1.0 end $w yview -pickplace insert set btp(prevcmd) end-line } proc bt:begin-buffer { w {num 0}} { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } bt:set-mark $w set ndx [expr 1+[lindex [split [$w index end] .] 0]*$num/10] $w mark set insert $ndx.0 $w tag remove sel 1.0 end $w yview -pickplace insert set btp(prevcmd) begin-buffer } proc bt:end-buffer { w {num 0}} { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } bt:set-mark $w set ndx [expr [lindex [split [$w index end] .] 0]*$num/10] $w mark set insert "end - $ndx lines" $w tag remove sel 1.0 end $w yview -pickplace insert set btp(prevcmd) end-buffer } proc bt:scroll-next { w {num 1}} { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } $w tag remove sel 1.0 end set scr [lindex [lindex [$w configure -yscroll] 4] 0] $w mark set insert [lindex [$scr get] 3].0 $w yview insert-1l set btp(prevcmd) scroll-next } proc bt:scroll-prior { w {num 1}} { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } $w tag remove sel 1.0 end set scr [lindex [lindex [$w configure -yscroll] 4] 0] set tndx [expr [lindex [$scr get] 2]-[lindex [$scr get] 1]+5].0 if {$tndx < 1.0} {set tndx 1.0} $w mark set insert $tndx $w yview insert-1l set btp(prevcmd) scroll-prior } proc bt:delete-word { w {num 1}} { global btp $w tag remove sel 1.0 end if {[$w compare $btp(lastkill) == insert]} { set lastcut [bt:pop-cut] } else { set lastcut "" } set beg [$w index insert] if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } bt:move-word $w $num #puts "$num : $beg [$w index insert]" if {$beg < [$w index insert]} { bt:push-cut "$lastcut[$w get $beg insert]" $w delete $beg insert } else { bt:push-cut "[$w get insert $beg]$lastcut" $w delete insert $beg } set btp(lastkill) [$w index insert] $w yview -pickplace insert set btp(prevcmd) delete-word } proc bt:delete-line { w {num 0}} { global btp $w tag remove sel 1.0 end if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } if {[$w compare $btp(lastkill) == insert]} { set lastcut [bt:pop-cut] } else { set lastcut ""} # while {[$w get insert] == " "} { # $w mark set insert insert+1c # } if {[$w compare insert == "insert lineend"] && $num == 0} { set num 1 } set beg [$w index insert] if {$num != 0} { bt:move-line $w $num bt:begin-line $w if {$beg < [$w index insert]} { bt:push-cut "$lastcut[$w get $beg insert]" $w delete $beg insert } else { bt:push-cut "[$w get insert $beg]$lastcut" $w delete insert $beg } } else { bt:push-cut "$lastcut[$w get insert {insert lineend}]" $w delete insert {insert lineend}; $w yview -pickplace insert } $w yview -pickplace insert set btp(lastkill) [$w index insert] set btp(prevcmd) delete-line } proc bt:delete-back-char-or-sel { w {num 1} } { global btp if {$btp(arg) != "def"} { set num $btp(arg) } else {set btp(lastkill) 0.0} set num [expr -1*$num] if {$num > -1} {set num "+$num"} if {[$w compare $btp(lastkill) == insert]} { set lastcut [bt:pop-cut] } else { set lastcut ""} if [catch {set tmp [$w get sel.first sel.last]}] { if {$btp(arg) != "def"} { if {$num < 0} { bt:push-cut "[$w get "insert $num char" insert]$lastcut" $w delete "insert $num char" insert } else { bt:push-cut "$lastcut[$w get insert "insert $num char"]" $w delete insert "insert $num char" } set btp(lastkill) [$w index insert] } else { if {$num < 0} { $w delete "insert $num char" insert } else { $w delete insert "insert $num char" } set btp(lastkill) 0.0 } } else { $w delete sel.first sel.last bt:push-cut $tmp set btp(lastkill) 0.0 } set btp(arg) def $w yview -pickplace insert set btp(prevcmd) delete-back-char-or-sel } proc bt:delete-region-or-sel { w } { global btp if {[catch {set tmp [$w get sel.first sel.last]}]} { if {[catch "$w index emacs"]} { $btp(error) "No emacs mark has been set yet!" } if {[$w compare $btp(lastkill) == insert]} { set lastcut [bt:pop-cut] } else { set lastcut ""} if {[$w compare emacs < insert]} { bt:push-cut "$lastcut[$w get emacs insert]" $w delete emacs insert } else { bt:push-cut "[$w get insert emacs]$lastcut" $w delete insert emacs } set btp(lastkill) [$w index insert] } else { $w delete sel.first sel.last bt:push-cut $tmp set btp(lastkill) 0.0 } set btp(arg) def set btp(prevcmd) delete-region-or-sel } proc bt:copy-region-or-sel { w } { global btp if {[catch {set tmp [$w get sel.first sel.last]}]} { if {[catch "$w index emacs"]} { $btp(error) "No emacs mark has been set yet!" } if {[$w compare $btp(lastkill) == insert]} { set lastcut [bt:pop-cut] } else { set lastcut ""} if {[$w compare emacs < insert]} { bt:push-cut "$lastcut[$w get emacs insert]" } else { bt:push-cut "[$w get insert emacs]$lastcut" } bt:exchange-point-and-mark $w after 200 bt:exchange-point-and-mark $w } else { bt:push-cut $tmp } set btp(arg) def set btp(lastkill) 0.0 set btp(prevcmd) copy-region-or-sel } proc bt:append-next-kill { w } { global btp set btp(lastkill) [$w index insert] } proc bt:push-cut { txt } { global btp set btp(killlen) [llength [lappend btp(killring) $txt]] if { $btp(killlen) > $btp(maxkill)} { set btp(killring) [lreplace $btp(killring) 0 0] incr btp(killlen) -1 } set btp(killptr) 0 } proc bt:pop-cut { } { global btp if {$btp(killlen) == 0} {return ""} set txt [bt:get-cut 1] set ndx [expr $btp(killlen)-1] set btp(killring) [lreplace $btp(killring) $ndx $ndx ] incr btp(killlen) -1 set btp(killptr) 0 return $txt } proc bt:get-cut { {ndx 1} } { global btp set ndx [expr $ndx+$btp(killptr)] set btp(killptr) [expr $ndx-1] set ndx [expr $ndx%$btp(killlen)] if {$ndx == 0} {set ndx $btp(killlen)} return [lindex $btp(killring) [expr $btp(killlen)-$ndx]] } proc bt:yank { w {num 1}} { global btp $w tag remove sel 1.0 end if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } set btp(lastkill) 0.0 set tmp [$w index insert] $w insert insert [bt:get-cut $num] $w mark set emacs $tmp $w yview -pickplace insert set btp(prevcmd) yank } proc bt:yank-pop { w {num 1}} { global btp if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } if {$btp(prevcmd) != "yank"} return $w tag remove sel 1.0 end $w delete emacs insert set tmp [$w index insert] $w insert insert [bt:get-cut [expr $num+1]] $w mark set emacs $tmp $w yview -pickplace insert } proc bt:pop-mark { w } { global btp set ndx [expr [llength $btp($w,markring)]-1] set oldmark [lindex $btp($w,markring) $ndx] $w mark set emacs $oldmark set btp($w,markring) [concat $oldmark [lreplace $btp($w,markring) $ndx $ndx]] } proc bt:push-mark { w ndx } { global btp lappend btp($w,markring) $ndx $w tag remove emacssel 1.0 end } proc bt:set-mark { w {num def}} { global btp $w tag remove sel 1.0 end if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } if {$num != "def"} { if {[catch "$w index emacs"]} { $btp(error) "No emacs mark has been set yet!" } #puts stdout "$w.yview \n" $w yview -pickplace insert bt:pop-mark $w $w mark set insert emacs } else { bt:push-mark $w [$w index insert] $w mark set emacs insert } set btp(lastkill) 0.0 set btp(prevcmd) set-mark } proc bt:exchange-point-and-mark { w } { global btp if {[catch "$w index emacs"]} { $btp(error) "No emacs mark has been set yet!" } set tmp [$w index insert] $w mark set insert emacs $w mark set emacs $tmp set btp(lastkill) 0.0 set btp(prevcmd) set-mark } proc bt:open-line {w {num 1}} { global btp if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } catch {$w delete sel.first sel.last} for {set i 0} {$i < $num } {incr i} { $w insert insert \n } $w mark set insert insert-1c $w yview -pickplace insert set btp(prevcmd) open-line } proc bt:argkey { w a } { global btp set btp(arg) $a } proc bt:numkey { w a } { global btp if {$btp(arg) == "def"} { catch {%W delete sel.first sel.last} $w insert insert $a if {$btp(fillcol) && [bt:current-col $w] >= $btp(fillcol)} { bt:wrap-word $w } $w yview -pickplace insert set btp(lastkill) 0.0 set btp(prevcmd) self-insert } else { if {$a == "-"} { if {$btp(arg) == "-"} { set btp(arg) "0" } elseif {$btp(arg) == "0"} { set btp(arg) "-" } else { set btp(arg) [expr -1*$btp(arg)] } } else { append btp(arg) $a } } } proc bt:univ-arg { w } { global btp if {$btp(arg) == "def"} { set btp(arg) 4 } else { if {$btp(arg) == "-"} { set btp(arg) "-4" } else { set btp(arg) [expr 4*$btp(arg)] } } } proc bt:wrap-word { w } { global btp bt:move-word $w -1 $w insert insert \n bt:end-line $w } proc bt:set-fill-col { w {num 0}} { global btp if {$btp(arg) == "def"} { if {$num < 1} { set btp(fillcol) [bt:current-col $w] } else { set btp(fillcol) $num } } else { if {$btp(arg) < 1} { set btp(fillcol) [bt:current-col $w] } else { set btp(fillcol) $btp(arg) } } set btp(arg) def set btp(lastkill) 0.0 set btp(prevcmd) set-fill-col } proc bind_motiftext { tw } { global bind_xnd bind $tw { global btp if {"%A" != ""} {eval $btp(beep) } } # Some better bindings for text and entry bind $tw {bt:move-line %W -1} bind $tw {bt:move-line %W 1} bind $tw {bt:move-char %W -1} bind $tw {bt:move-char %W 1} bind $tw {bt:begin-line %W} bind $tw {bt:end-line %W} bind $tw {bt:begin-buffer %W} bind $tw {bt:end-buffer %W} bind $tw {bt:move-word %W -1} bind $tw {bt:move-word %W 1} bind $tw {bt:scroll-next %W} bind $tw {bt:scroll-prior %W} bind $tw { global btp set num 1 if {"%A" != ""} { if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } catch {%W delete sel.first sel.last} for {set i 0} { $i < $num} {incr i} {%W insert insert %A} if {$btp(fillcol) && [bt:current-col %W] >= $btp(fillcol)} { if {"%A" == " "} { %W insert insert \n } elseif {"%A" == "\t"} { %W insert insert \n\t } else { bt:wrap-word %W } } %W yview -pickplace insert set btp(lastkill) 0.0 set btp(prevcmd) self-insert } } bind $tw { global btp catch {%W delete sel.first sel.last} set num 1 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } for {set i 0} { $i < $num} {incr i} {%W insert insert "\n"} %W yview -pickplace insert set btp(lastkill) 0.0 set btp(prevcmd) newline } bind $tw {bt:delete-back-char-or-sel %W 1} bind $tw {bt:delete-back-char-or-sel %W 1} bind $tw <1> "[bind Text <1>]; \ global btp; set btp(lastkill) 0.0; \ set btp(prevcmd) mouse-set" bind $tw <3> {%W tag remove sel 1.0 end} bind $tw {bind_textB1motion %W @%x,%y} set bind_xnd(b2-time) 0 set bind_xnd(b2-y) 0 bind $tw <2> { global bind_xnd %W scan mark %y set bind_xnd(b2-time) %t set bind_xnd(b2-y) %y } bind $tw { global bind_xnd if {[expr %t-$bind_xnd(b2-time)]<1000} { %W insert insert [selection_if_any] global btp set btp(lastkill) 0.0 set btp(prevcmd) mouse-insert } } # only one mouse, so no need have separate vars for each widget set bind_xnd(txnd) 0 set bind_xnd(xdelay) 100 proc bind_textB1motion { w loc } { global bind_xnd set ypos [lindex [split $loc ","] 1] if {$ypos > [winfo height $w]} { if {!$bind_xnd(txnd)} {after $bind_xnd(xdelay) bind_textExtend $w} set bind_xnd(txnd) 1 set bind_xnd(direction) down } elseif {$ypos < 0} { if {!$bind_xnd(txnd)} {after $bind_xnd(xdelay) bind_textExtend $w} set bind_xnd(txnd) 1 set bind_xnd(direction) up } else { set bind_xnd(txnd) 0 set bind_xnd(direction) 0 } if {!$bind_xnd(txnd)} { tk_textSelectTo $w $loc } } bind $tw { global bind_xnd btp set bind_xnd(txnd) 0 set btp(lastkill) 0.0 set btp(prevcmd) mouse-select } proc bind_textExtend { w } { global bind_xnd if {$bind_xnd(txnd)} { if {$bind_xnd(direction) == "down"} { tk_textSelectTo $w sel.last+1l $w yview -pickplace sel.last+1l } elseif {$bind_xnd(direction) == "up"} { tk_textSelectTo $w sel.first-1l $w yview -pickplace sel.first-1l } else { return } after $bind_xnd(xdelay) bind_textExtend $w } } } proc bind_emacstext { tw } { global btp bind $tw { if [catch {set tmp [%W get emacssel.first emacssel.last]}] { } else { %W tag remove emacssel 1.0 $first %W tag add emacssel $first $last %W tag remove emacssel $last end update idletasks } %W insert insert %A } # make Escape key simulate a state Alt key bind $tw { } bind $tw { global btp if {"%A" != ""} {eval $btp(beep) } } bind $tw {bt:begin-line %W} bind $tw {bt:end-line %W} bind $tw {bt:move-char %W 1} bind $tw {bt:move-char %W -1} bind $tw {bt:move-word %W 1} bind $tw {bt:move-word %W -1} bind $tw {bt:move-line %W 1} bind $tw {bt:move-line %W -1} bind $tw { %W yview -pickplace insert } bind $tw {bt:open-line %W 1} bind $tw {bt:delete-back-char-or-sel %W -1} bind $tw {bt:delete-word %W 1} bind $tw {bt:delete-back-char-or-sel %W -1} bind $tw {bt:delete-line %W 0} bind $tw {bt:delete-region-or-sel %W} bind $tw {bt:copy-region-or-sel %W} bind $tw {bt:yank %W} bind $tw {bt:yank-pop %W} bind $tw {bt:set-mark %W} bind $tw {bt:univ-arg %W} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} # make C-x key a state bind $tw { } bind $tw { global btp if {"%A" != ""} {eval $btp(beep) } } bind $tw {bt:exchange-point-and-mark %W} bind $tw {bt:set-fill-col %W} # Make Meta key like and Escape prefix if {$btp(use-meta)} { bind $tw { global btp if {"%A" != ""} {eval $btp(beep) } } bind $tw { global btp if {"%A" != ""} {eval $btp(beep) } } bind $tw {bt:move-word %W 1} bind $tw {bt:move-word %W -1} bind $tw {bt:delete-word %W 1} bind $tw {bt:copy-region-or-sel %W} bind $tw {bt:yank-pop %W} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} } } #---------------------------------------------------------------------------- #---------------------------------------------------------------------------- # # The xe main code follows now ... # #---------------------------------------------------------------------------- #---------------------------------------------------------------------------- #--------------------------------------------------------------- # PrintOutputWindow # #--------------------------------------------------------------- proc PrintOutputWindow { printer_pipe } { set f [open "|$printer_pipe" w] puts $f [.pane.output.text get 1.0 end ] close $f } #--------------------------------------------------------------- # PrintPreDefined # #--------------------------------------------------------------- proc PrintPreDefined { } { global landscape doublesided nobanner prsize set printerName [.printdlg.input.predef.f.prname.name get] #puts stderr "printer_name: $printerName" #puts stderr "landscape: $landscape" #puts stderr "doublesided: $doublesided" #puts stderr "prsize: $prsize" array set sizeoption { yes-large { -o vsi7 -o fp16 -o landscape } yes-normal { -o vsi6 -o fp18 -o landscape -o height80 } yes-small { -o vsi5 -o fp20 -o landscape -o height90 } yes-smallest { -o vsi4 -o fp24 -o landscape -o height100 } yes-micro { -o vsi3 -o fp28 -o landscape -o height110 } no-large { -o vsi7 -o fp16 -o portrait } no-normal { -o vsi6 -o fp18 -o portrait } no-small { -o vsi5 -o fp20 -o portrait } no-smallest { -o vsi4 -o fp24 -o portrait } } set command $sizeoption(${landscape}-${prsize}) if {$doublesided == "yes"} { append command " -o duplex" } else { append command " -o simplex" } if {$nobanner == "yes"} { append command " -o nb" } append command " -d $printerName" PrintOutputWindow "lp $command" } #--------------------------------------------------------------- # PrintDialog # #--------------------------------------------------------------- proc PrintDialog { } { global dbname dbsname set w .printdlg catch {destroy $w} toplevel $w -class Dialog wm title $w "Print Output" wm iconname $w "Print Output" wm protocol $w WM_DELETE_WINDOW { } frame $w.input \ -relief flat -borderwidth 0 -highlightthickness 0 frame $w.buttons \ -relief flat -borderwidth 0 -highlightthickness 0 button $w.buttons.print \ -text " Print " \ -command "PrintPreDefined; destroy $w" button $w.buttons.cancel \ -text " Cancel " -command "destroy $w" pack $w.buttons.print $w.buttons.cancel -side top -pady 10 -fill x #----------------------------------------------- # pre-customized printer configuration #----------------------------------------------- frame $w.input.predef \ -relief flat -borderwidth 0 -highlightthickness 0 label $w.input.predef.h \ -text "Pre-customized Printer Configuration:" frame $w.input.predef.f \ -relief groove -borderwidth 2 -highlightthickness 0 pack $w.input.predef.h -anchor w -side top pack $w.input.predef.f -side top -ipadx 5 -ipady 5 -fill x frame $w.input.predef.f.prname \ -relief groove -borderwidth 0 -highlightthickness 0 label $w.input.predef.f.prname.l \ -text "Printer Name:" entry $w.input.predef.f.prname.name \ -relief sunken -borderwidth 1 -highlightthickness 1 \ -width 20 -background gray90 -exportselection yes pack $w.input.predef.f.prname.l -side left pack $w.input.predef.f.prname.name -side left -anchor w -fill x frame $w.input.predef.f.kind \ -relief groove -borderwidth 0 -highlightthickness 0 radiobutton $w.input.predef.f.kind.large \ -text "Large (100 char width) " -variable prsize -relief flat -value large radiobutton $w.input.predef.f.kind.normal \ -text "Normal (150 char width)" -variable prsize -relief flat -value normal radiobutton $w.input.predef.f.kind.small \ -text "Small (200 char width)" -variable prsize -relief flat -value small radiobutton $w.input.predef.f.kind.smallest \ -text "Smallest (240 char width)" -variable prsize -relief flat -value smallest radiobutton $w.input.predef.f.kind.micro \ -text "Micro (>240 char width)" -variable prsize -relief flat -value micro $w.input.predef.f.kind.small select pack $w.input.predef.f.kind.large \ $w.input.predef.f.kind.normal \ $w.input.predef.f.kind.small \ $w.input.predef.f.kind.smallest \ $w.input.predef.f.kind.micro -anchor w -side top frame $w.input.predef.f.optionskind \ -relief groove -borderwidth 0 -highlightthickness 0 checkbutton $w.input.predef.f.optionskind.landscape -text "landscape (-o landscape)" \ -variable landscape -onvalue "yes" -offvalue "no" -relief flat $w.input.predef.f.optionskind.landscape select checkbutton $w.input.predef.f.optionskind.double -text "double sided (-o duplex)" \ -variable doublesided -onvalue "yes" -offvalue "no" -relief flat checkbutton $w.input.predef.f.optionskind.nobanner -text "no banner (-o nb)" \ -variable nobanner -onvalue "yes" -offvalue "no" -relief flat pack $w.input.predef.f.optionskind.landscape \ $w.input.predef.f.optionskind.double \ $w.input.predef.f.optionskind.nobanner -anchor w -side top pack $w.input.predef.f.prname \ $w.input.predef.f.kind \ $w.input.predef.f.optionskind -side top -padx 1 -pady 5 -fill x #----------------------------------------------- # self printer configuration #----------------------------------------------- frame $w.input.self \ -relief flat -borderwidth 0 -highlightthickness 0 label $w.input.self.h \ -text "Full Command Line:" frame $w.input.self.f2 \ -relief groove -borderwidth 2 -highlightthickness 0 entry $w.input.self.f2.cmdline \ -relief sunken -borderwidth 2 -highlightthickness 1 \ -width 40 -background gray90 -exportselection yes button $w.input.self.f2.print \ -text " Print " -command { set printer_pipe [.printdlg.input.self.f2.cmdline get]; PrintOutputWindow "$printer_pipe" } pack $w.input.self.f2.cmdline $w.input.self.f2.print \ -side left -padx 5 pack $w.input.self.h -anchor w -side top pack $w.input.self.f2 -side top -ipadx 5 -ipady 5 #------------------------------------------------------------- pack $w.input.predef $w.input.self -side top -pady 10 -fill x pack $w.input -side left -padx 10 -pady 10 -fill x pack $w.buttons -side left -padx 10 -pady 30 -fill y } #---------------------------------------------------------------------------- # SaveTextWindow # #---------------------------------------------------------------------------- proc SaveTextWindow { textw filename } { set f [open $filename w ]; $textw mark set insert end #--remove the empty part at the bottom while {1} { set line [$textw get {insert linestart} {insert lineend}] if {$line != ""} { break; } $textw mark set insert {insert -1 line} if {[$textw compare insert < 3.0]} { break; } } puts $f [$textw get 1.0 {insert lineend} ] close $f } #---------------------------------------------------------------------------- # Base64Init # #---------------------------------------------------------------------------- proc Base64Init { } { global base64_b2c base64_c2b set i -1 foreach a { A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 + / } { binary scan [binary format c1 [incr i]] B* v set base64_b2c([string range $v 2 end]) $a set base64_c2b($a) [string range $v 2 end] } } #---------------------------------------------------------------------------- # Base64EncodeBufferData # #---------------------------------------------------------------------------- proc Base64EncodeBufferData { data } { global base64_b2c # Get the bit stream binary scan $data B* bits # Convert groups of six bits to a list for easy traversal regsub -all {((0|1)(0|1)(0|1)(0|1)(0|1)(0|1))} $bits {\1 } bits foreach b $bits { append result $base64_b2c($b) } return $result } #---------------------------------------------------------------------------- # Base64Encode # #---------------------------------------------------------------------------- proc Base64Encode { data {buffersize 6144} } { global base64_b2c if { ![array exists base64_b2c] } { Base64Init } # Convert the data to a bitstream and then encode. # This approach requires a buffer eight times the size of the # data to be encoded, so just work on a buffer at a time. # The default buffer size is 6 * 1024 bytes (6KB). # This is a trade-off between speed and space. if {$buffersize % 3} { # Buffer must be a multiple of 3 bytes set buffersize [expr $buffersize - $buffersize % 3] } set linelen 0 while {[string length $data] > $buffersize} { # Get the buffer to work on set buffer [string range $data 0 [expr $buffersize - 1]] set data [string range $data $buffersize end] append result [Base64EncodeBufferData $buffer] } if {[string length $data]} { # Deal with remaining data # Encode to an even multiple of 3 bytes, and then # pad the rest set buffer [string range $data 0 [expr [string length $data] - [string length $data] % 3 - 1]] set remainder [string range $data [expr [string length $data] - [string length $data] % 3] end] append result [Base64EncodeBufferData $buffer] switch [string length $remainder] { 1 { binary scan $remainder B* bits append result $base64_b2c([string range $bits 0 5]) append result $base64_b2c([string range $bits 6 7]0000) append result == } 2 { binary scan $remainder B* bits append result $base64_b2c([string range $bits 0 5]) append result $base64_b2c([string range $bits 6 11]) append result $base64_b2c([string range $bits 12 15]00) append result = } } } # Ensure lines are no more than 76 characters regsub -all {(........................................................................)} \ $result "\\1\n" result return $result } #---------------------------------------------------------------------------- # IntroWindow # #---------------------------------------------------------------------------- proc IntroWindow { } { global HelvB12 Helv12 frame .splash -borderwidth 4 -relief raised label .splash.info1 -font $HelvB12 -text "XE - a simple XML/XPath Browser/Viewer" label .splash.info2 -font $Helv12 -text "Version 0.2" label .splash.info3 -font $Helv12 -text "Copyright (c) 1999,2001 Jochen Loewer (loewerj@hotmail.com)" pack .splash.info1 \ .splash.info2 \ .splash.info3 -padx 4 -pady 4 -anchor w place .splash -anchor c -relx .5 -rely .5 after 2500 destroy .splash update } #---------------------------------------------------------------------------- # ConfigureProxy # #---------------------------------------------------------------------------- proc ConfigureProxy { } { global HttpProxyHost HttpProxyPort gotProxy set gotProxy -1 set w .proxyDdlg catch {destroy $w} toplevel $w -class Dialog wm title $w "Configure HTTP Proxy" wm iconname $w "HTTP Proxy" wm protocol $w WM_DELETE_WINDOW { } frame $w.hdr \ -relief flat -borderwidth 0 -highlightthickness 0 label $w.hdr.icon -bitmap questhead label $w.hdr.msg -text "Specify HTTP proxy server: " frame $w.fields \ -relief flat -borderwidth 0 -highlightthickness 0 label $w.fields.hostlabel -text "Proxy Host:" entry $w.fields.hostvalue \ -relief sunken -borderwidth 1 -highlightthickness 1 \ -width 20 -background gray90 -exportselection yes label $w.fields.portlabel -text "Porxy Port:" entry $w.fields.portvalue \ -relief sunken -borderwidth 1 -highlightthickness 1 \ -width 20 -background gray90 -exportselection yes frame $w.buttons \ -relief flat -borderwidth 0 -highlightthickness 0 button $w.buttons.ok -text " OK " \ -command "set gotProxy \[list 1 \[$w.fields.hostvalue get\] \ \[$w.fields.portvalue get\] \]; \ destroy $w" bind $w.fields.portvalue " \ set gotProxy \[list 1 \[$w.fields.hostvalue get\] \ \[$w.fields.portvalue get\] \]; \ destroy $w" button $w.buttons.cancel -text " Cancel " \ -command "destroy $w; set gotProxy {0 {} {}}" $w.fields.hostvalue insert 0 $HttpProxyHost $w.fields.portvalue insert 0 $HttpProxyPort pack $w.hdr.icon $w.hdr.msg -side left grid $w.fields.hostlabel -in $w.fields -column 0 -row 0 -sticky e grid $w.fields.portlabel -in $w.fields -column 0 -row 1 -sticky e grid $w.fields.hostvalue -in $w.fields -column 1 -row 0 -sticky w grid $w.fields.portvalue -in $w.fields -column 1 -row 1 -sticky w pack $w.buttons.ok $w.buttons.cancel -side left pack $w.hdr \ $w.fields \ $w.buttons -side top -anchor w -padx 9 -pady 9 focus $w.fields.hostvalue while {$gotProxy == -1} { vwait gotProxy } if {[lindex $gotProxy 0]} { set HttpProxyHost [lindex $gotProxy 1] set HttpProxyPort [lindex $gotProxy 2] } } #---------------------------------------------------------------------------- # GetUserPassword # #---------------------------------------------------------------------------- proc GetUserPassword { state_var login_var password_var } { global gotPassword Login upvar $state_var state upvar $login_var login upvar $password_var password #parray state set server "" set realm "" regexp {http://([^/]*)/(.*)} $state(url) all server file array set meta $state(meta) if {[info exists meta(WWW-authenticate)]} { set realmStr [lindex $meta(WWW-authenticate) 1] regexp {realm="([^"]*)"} $realmStr all realm } #puts stderr "login='$login' password='$password' server='$server' realm='$realm'" if {[info exists Login($server,$realm)]} { foreach { new_login new_password } $Login($server,$realm) break if {($new_login != $login ) || ($new_password != $password)} { set login $new_login set password $new_password return 1 } } set gotPassword -1 set login "" set password "" set w .passwordDdlg catch {destroy $w} toplevel $w -class Dialog wm title $w "HTTP Password" wm iconname $w "HTTP Password" wm protocol $w WM_DELETE_WINDOW { } frame $w.hdr \ -relief flat -borderwidth 0 -highlightthickness 0 label $w.hdr.icon -bitmap questhead label $w.hdr.msg -text "Enter username for $realm at $server " frame $w.fields \ -relief flat -borderwidth 0 -highlightthickness 0 label $w.fields.userlabel -text "User name:" entry $w.fields.uservalue \ -relief sunken -borderwidth 1 -highlightthickness 1 \ -width 20 -background gray90 -exportselection yes label $w.fields.passlabel -text "Password:" entry $w.fields.passvalue \ -relief sunken -borderwidth 1 -highlightthickness 1 \ -width 20 -background gray90 -exportselection yes -show * frame $w.buttons \ -relief flat -borderwidth 0 -highlightthickness 0 button $w.buttons.ok -text " OK " \ -command "set gotPassword \[list 1 \[$w.fields.uservalue get\] \ \[$w.fields.passvalue get\] \]; \ destroy $w" bind $w.fields.passvalue " \ set gotPassword \[list 1 \[$w.fields.uservalue get\] \ \[$w.fields.passvalue get\] \]; \ destroy $w" button $w.buttons.cancel -text " Cancel " \ -command "destroy $w; set gotPassword {0 {} {}}" pack $w.hdr.icon $w.hdr.msg -side left grid $w.fields.userlabel -in $w.fields -column 0 -row 0 -sticky e grid $w.fields.passlabel -in $w.fields -column 0 -row 1 -sticky e grid $w.fields.uservalue -in $w.fields -column 1 -row 0 -sticky w grid $w.fields.passvalue -in $w.fields -column 1 -row 1 -sticky w pack $w.buttons.ok $w.buttons.cancel -side left pack $w.hdr \ $w.fields \ $w.buttons -side top -anchor w -padx 9 -pady 9 focus $w.fields.uservalue while {$gotPassword == -1} { vwait gotPassword } if {[lindex $gotPassword 0]} { set login [lindex $gotPassword 1] set password [lindex $gotPassword 2] set Login($server,$realm) [list $login $password] return 1 } return 0 } #---------------------------------------------------------------------------- # xmlEdit # #---------------------------------------------------------------------------- proc xmlEdit { {line 0} {column 0} } { global xml Cour12 Helv12 if {[winfo exists .edit]} { .edit.f.text mark set insert $line.$column .edit.f.text see insert focus .edit.f.text return } toplevel .edit wm title .edit "XML Source" set path .edit.f frame $path -relief flat -borderwidth 3 -highlightthickness 0 text $path.text -width 100 -height 30 -font $Cour12 \ -bg gray90 \ -exportselection yes -wrap none \ -yscrollcommand "$path.vsb set" \ -xscrollcommand "$path.hsb set" scrollbar $path.vsb -relief sunken -orient vertical \ -command "$path.text yview" scrollbar $path.hsb -relief sunken -orient horizontal \ -command "$path.text xview" button .edit.reload -text " Reload " -command xmlReload \ -font $Helv12 pack $path.vsb -side right -fill y -expand no pack $path.hsb -side bottom -fill x -expand no pack $path.text -side top -fill both -expand yes pack $path -expand yes -fill both pack .edit.reload -anchor e $path.text delete 1.0 end $path.text insert end $xml .edit.f.text mark set insert $line.$column .edit.f.text see insert focus .edit.f.text } #---------------------------------------------------------------------------- # xmlHighlight # #---------------------------------------------------------------------------- proc xmlHighlight { path pos tag highlight_tag} { set range [$path tag nextrange $tag $pos [$path index "$pos lineend"] ] if {$range == ""} { set range [$path tag prevrange $tag $pos [$path index "$pos linestart"] ] } if {$range != ""} { eval $path tag add $highlight_tag [lrange $range 0 1] } } #---------------------------------------------------------------------------- # xmlHighlightMotion # #---------------------------------------------------------------------------- proc xmlHighlightMotion { path pos tag highlight_tag} { set tags [$path tag names $pos] if {[lsearch -exact $tags $highlight_tag] < 0} { $path tag remove $highlight_tag 1.0 end } xmlHighlight $path $pos $tag $highlight_tag } #---------------------------------------------------------------------------- # xmlJump # #---------------------------------------------------------------------------- proc xmlJump { path pos } { foreach tag [$path tag names $pos] { if { ($tag != "tag") } { xmlEdit [$tag getLine] [$tag getColumn] } } } #---------------------------------------------------------------------------- # xmlOpen # #---------------------------------------------------------------------------- proc xmlOpen { path pos } { global levels foreach tag [$path tag names $pos] { if {($tag != "open") && ($tag != "hot") && ($tag != "sel")} { $path configure -state normal set start [$path index "$pos linestart"] set end [$path index "$start + 1 lines"] $path delete $start $end while 1 { set end [$path index "$start + 1 lines"] set nextLine [$path get $start $end] if {[string match "$levels($tag) *" $nextLine]} { $path delete $start $end } else { break } } $path mark set insert $start xmlWidgetLoad_Recurs $path 0 $levels($tag) $tag 2 $path see $start } } # that's a hack to remove selections, which occur sometimes after 50 "$path tag remove sel 1.0 end" } #---------------------------------------------------------------------------- # xmlClose # #---------------------------------------------------------------------------- proc xmlClose { path pos } { global levels foreach tag [$path tag names $pos] { if {($tag != "close") && ($tag != "hot") && ($tag != "sel")} { $path configure -state normal set start [$path index "$pos linestart"] set end [$path index "$start + 1 lines"] $path delete $start $end while 1 { set end [$path index "$start + 1 lines"] set nextLine [$path get $start $end] if {[string match "$levels($tag) *" $nextLine]} { $path delete $start $end } else { break } } $path mark set insert $start xmlWidgetLoad_Recurs $path 0 $levels($tag) $tag 1 $path see $start } } # that's a hack to remove selections, which occur sometimes after 50 "$path tag remove sel 1.0 end" } #---------------------------------------------------------------------------- # xmlWidget # #---------------------------------------------------------------------------- proc xmlWidget { path } { global Cour12 HelvB12 set tagFont $HelvB12 set attrFont $Cour12 set opnclFont $Cour12 frame $path -relief flat -borderwidth 0 -highlightthickness 0 text $path.text -width 100 -height 25 -font $Cour12 \ -bg gray85 -cursor left_ptr \ -exportselection yes -wrap none \ -yscrollcommand "$path.vsb set" \ -xscrollcommand "$path.hsb set" scrollbar $path.vsb -relief sunken -orient vertical \ -command "$path.text yview" scrollbar $path.hsb -relief sunken -orient horizontal \ -command "$path.text xview" pack $path.vsb -side right -fill y -expand no pack $path.hsb -side bottom -fill x -expand no pack $path.text -side top -fill both -expand yes #$path.text tag configure tag -font $tagFont \ # -background #ffffa666a666 \ # -foreground black $path.text tag configure tag -font $tagFont \ -foreground #40004000D000 $path.text tag configure comment -font $attrFont \ -background #d000e800d000 \ -foreground black $path.text tag configure textValue -font $attrFont \ -background #d200d200f000 \ -foreground black #$path.text tag configure attr -font $attrFont \ # -background #fae0d53fdaaa \ # -foreground black # -background #D000D000ffff \ $path.text tag configure attrName -font $attrFont \ -foreground black # -background #D000D000ffff \ # -background #e800d000d000 \ # -background gray90 \ # -foreground #d00000000000 $path.text tag configure attrValue -font $attrFont \ -background #f000d000d000 \ -foreground black $path.text tag configure header -background gray90 \ -foreground red2 $path.text tag configure query -background gray95 \ -foreground red2 $path.text tag configure hot -background #a666a666ffff $path.text tag configure open -font $opnclFont $path.text tag configure close -font $opnclFont $path.text tag configure leave -font $opnclFont $path.text tag bind tag <2> "xmlJump $path.text @%x,%y" $path.text tag bind open "xmlHighlight $path.text @%x,%y open hot" $path.text tag bind open "xmlHighlightMotion $path.text @%x,%y open hot" $path.text tag bind open "$path.text tag remove hot 1.0 end" $path.text tag bind open <1> "xmlOpen $path.text @%x,%y" $path.text tag bind close "xmlHighlight $path.text @%x,%y open hot" $path.text tag bind close "xmlHighlightMotion $path.text @%x,%y close hot" $path.text tag bind close "$path.text tag remove hot 1.0 end" $path.text tag bind close <1> "xmlClose $path.text @%x,%y" } #---------------------------------------------------------------------------- # xmlWidgetLoad_Recurs # #---------------------------------------------------------------------------- proc xmlWidgetLoad_Recurs { path doSiblings level node maxlevel } { global levels incr maxlevel -1 if {$maxlevel < 0} { return } while {$node != ""} { set levels($node) $level $path insert insert $level set type [$node nodeType] if { $type == "ELEMENT_NODE" } { set firstChild [$node firstChild] if {$firstChild == ""} { $path insert insert " = " leave } else { if {$maxlevel > 0} { $path insert insert " - " [list close $node] } else { $path insert insert " + " [list open $node] } } $path insert insert "[$node nodeName] " [list tag $node] set attr_line_width 0 set attr_name_width 0 set attr_value_width [string length $level] foreach attr [$node attributes] { if {[llength $attr] > 1} { if {[lindex $attr 1] == ""} { set attr [lindex $attr 0] } else { set attr "[lindex $attr 1]:[lindex $attr 0]" } } set l [string length $attr] if {$l > $attr_name_width} { set attr_name_width $l } incr attr_line_width $l set l [string length [$node getAttribute $attr]] if {$l > $attr_value_width} { set attr_value_width $l } incr attr_line_width $l } set recurseToChilds 1 set attrDisplayMode [expr $attr_line_width > 80] if {$attrDisplayMode} { foreach attr [$node attributes] { $path insert insert "\n" $path insert insert "$level " #$path insert insert [format " %-${attr_name_width}s = %-${attr_value_width}s " \ # $attr [$node getAttribute $attr] \ # ] attr if {[llength $attr] > 1} { if {[lindex $attr 1] == ""} { set attr [lindex $attr 0] } else { set attr "[lindex $attr 1]:[lindex $attr 0]" } } $path insert insert [format " %-${attr_name_width}s= " \ $attr \ ] attrName $path insert insert [$node getAttribute $attr] attrValue #$path insert insert [format "%-${attr_value_width}s " \ # '[$node getAttribute $attr]' \ # ] attrValue } $path insert insert "\n" } else { if {[$node attributes] == ""} { set childs [$node childNodes] if {[llength $childs] == 1} { if {[$childs nodeType] == "TEXT_NODE"} { set value [$childs nodeValue] if {([string length $value] < 60) && ([string first \n $value] == -1)} { $path insert insert $value textValue set recurseToChilds 0 } } } } else { foreach attr [$node attributes] { if {[llength $attr] > 1} { if {[lindex $attr 1] == ""} { set attr [lindex $attr 0] } else { set attr "[lindex $attr 1]:[lindex $attr 0]" } } $path insert insert " $attr=" attrName $path insert insert [$node getAttribute $attr] attrValue #$path insert insert ' attrName } } $path insert insert "\n" } set recurseToChilds 1 if {$recurseToChilds} { foreach child [$node childNodes] { xmlWidgetLoad_Recurs $path 1 "$level " $child $maxlevel } } } else { switch $type { COMMENT_NODE { $path insert insert " C " $path insert insert [$node nodeValue] comment $path insert insert "\n" } CDATA_SECTION_NODE - TEXT_NODE { set lines 0 foreach line [split [$node nodeValue] \n] { if {$lines == 0} { $path insert insert " T " } else { $path insert insert "$level " } if {$line == ""} { $path insert insert " " textValue } else { $path insert insert $line textValue } $path insert insert "\n" incr lines } } PROCESSING_INSTRUCTION_NODE { $path insert insert " P " $path insert insert [$node target] tag set lines 0 foreach line [split [$node data] \n] { if {$lines == 0} { $path insert insert " " } else { $path insert insert "$level " } $path insert insert $line attrValue $path insert insert "\n" incr lines } } default { $path insert insert " ? " $path insert insert [$node nodeValue] attrValue $path insert insert "\n" } } } if {!$doSiblings} { return } break #set node [$node nextSibling] } } #---------------------------------------------------------------------------- # xmlWidgetLoad # #---------------------------------------------------------------------------- proc xmlWidgetLoad { path mode location xml query } { global doc root keepEmpties useSimple if {$mode == "xml"} { if {$useSimple} { if {$keepEmpties} { set doc [dom parse -keepEmpties -simple $xml] } else { set doc [dom parse -simple $xml] } } else { if {$keepEmpties} { set doc [dom parse -keepEmpties $xml] } else { set doc [dom parse $xml] } } } else { if {$keepEmpties} { set doc [dom parse -keepEmpties -html $xml] } else { set doc [dom parse -html $xml] } } set root [$doc documentElement] set query [string trim $query] if {$query == ""} { set query / } $path insert end \n $path insert end xml( header $path insert end $location query $path insert end ") " header $path insert end $query query $path insert end \n set nodes 0 set rows 0 set results [$root selectNodes $query type] switch $type { nodes { foreach node $results { $path mark set insert end xmlWidgetLoad_Recurs $path 1 "" $node 2 $path insert end \n incr nodes } } attrnodes { foreach {attrName attrValue} $results { $path insert end $attrName attrName $path insert end " " $path insert end $attrValue attrValue $path insert end \n incr rows } } attrvalues { foreach result $results { $path insert end "$result\n" incr rows } } default { $path insert end "$results\n" } } if {$rows != 0} { $path insert end "---$rows result(s)---\n" } if {$nodes != 0} { $path insert end "---$nodes node(s)---\n" } $path yview -pickplace end } #---------------------------------------------------------------------------- # xmlReload # #---------------------------------------------------------------------------- proc xmlReload { } { global xml set xml [.edit.f.text get 1.0 end] xmlWidgetLoad .xml.text xml $xml } #---------------------------------------------------------------------------- # GetXML # #---------------------------------------------------------------------------- proc GetXML { url } { global Login HttpProxyHost HttpProxyPort if {[regexp { *file:(.*)} $url all path]} { #puts stderr "file path='$path'" set fd [open $path] set xml [read $fd [file size $path]] close $fd } if {[regexp { *http:(.*)} $url all path]} { #puts stderr "http url='$path'" set xml "" set login "" set password "" #------------------------------------------------------ # try to re-use old login and password # #------------------------------------------------------ regexp {//([^/]*)/(.*)} $url all server file set indexes [array names Login $server,*] if {[llength $indexes] == 1} { foreach { login password } $Login($indexes) break } while 1 { set hdrs {} if {$login != ""} { #------------------------------------------- # generate Basic Authenication header #------------------------------------------ set hdrs [list Authorization "Basic [Base64Encode $login:$password]" ] } #------------------------------------------- # do HTTP request #------------------------------------------- http::config -proxyhost $HttpProxyHost -proxyport $HttpProxyPort set token [http::geturl $url -headers $hdrs] #------------------------------------------- # wait till HTTP request finishes #------------------------------------------ http::wait $token upvar $token state set statuscode [lindex $state(http) 1] if {$statuscode != "200"} { if {$statuscode == "401"} { if {[GetUserPassword state login password]} { #puts stderr "login='$login' password='$password'" continue } else { return "" } } else { puts stderr "\n\n\nstatuscode=$statuscode" puts stderr "$state(http)" break } } else { set xml [http::data $token] break } } } return $xml } #---------------------------------------------------------------------------- # xmlExecute # #---------------------------------------------------------------------------- proc xmlExecute { sel } { #puts stderr $sel if {[regexp { *(xml|html)\(([^)]*)\)(.*)} $sel all mode location query]} { #puts stderr "'$sel' location='$location' query='$query'" .pane.output.text configure -cursor watch . configure -cursor watch update set xml [GetXML $location] if {$xml != ""} { xmlWidgetLoad .pane.output.text $mode $location $xml $query } .pane.output.text configure -cursor left_ptr . configure -cursor left_ptr } else { error "Not a complete query!!" } } #---------------------------------------------------------------------------- # GotoParent # #---------------------------------------------------------------------------- proc GotoParent { } { global PointerXY set pos $PointerXY set path .pane.output.text foreach tag [$path tag names $pos] { #puts stderr "tag=$tag" if {[string match domNode* $tag]} { set tag [$tag parentNode] if {$tag == ""} return $path configure -state normal set start [$path index "$pos linestart"] set end [$path index "$start + 1 lines"] regexp {$( *)} [$path index "$start + 1 lines"] all level $path delete $start $end while 1 { set end [$path index "$start + 1 lines"] set nextLine [$path get $start $end] if {[string match "$level *" $nextLine]} { $path delete $start $end } else { break } } $path mark set insert $start xmlWidgetLoad_Recurs $path 0 $level $tag 2 $path see $start } } } #---------------------------------------------------------------------------- # As # #---------------------------------------------------------------------------- proc As { method } { global PointerXY set path .pane.output.text foreach tag [$path tag names $PointerXY] { if {[string match domNode* $tag]} { set oldEnd [$path index end] $path insert end \n[$tag $method] $path see $oldEnd } } } #---------------------------------------------------------------------------- # ToXPath # #---------------------------------------------------------------------------- proc ToXPath { } { global PointerXY set path .pane.output.text foreach tag [$path tag names $PointerXY] { if {[string match domNode* $tag]} { set oldEnd [$path index end] $path insert end \n[$tag toXPath] $path see $oldEnd } } } #---------------------------------------------------------------------------- # begin main part #---------------------------------------------------------------------------- namespace eval ::dom::xpathFunc { proc names { ctxNode pos nodeListType nodeList args } { if {[llength $args] != 2} { error "wrong # of args for XPATH function 'names'" } foreach { type value } $args break if {($type != "nodes") && ($type != "attrnodes") } { error "names only applicable for node or attribute node lists!" } set n {} if {$type == "nodes"} { foreach node $value { lappend n [$node nodeName] } } else { foreach {attrName attrValue} $value { lappend n $attrName } } return [list string $n] } } set xe_save "~/.xe-input" set xe_config "~/.xe-config" if {[llength $argv] > 0} { set xe_save [lindex $argv 0] } set bgcolor "grey90" set fgcolor "black" switch $tcl_platform(platform) { unix { set Cour12 8x13 set CourB12 8x13b set Helv10 "-Adobe-helvetica-medium-r-normal--*-100-*" set Helv12 "-Adobe-helvetica-medium-r-normal--*-120-*" set HelvB10 "-Adobe-helvetica-bold-r-normal--*-100-*" set HelvB12 "-Adobe-helvetica-bold-r-normal--*-120-*" } windows { set Cour12 "{Courier New} 10" set CourB12 "{Courier New} 10 bold" set Helv10 "Arial 9" set Helv12 "Arial 10" set HelvB10 "Arial 9 bold" set HelvB12 "Arial 10 bold" } } option add *background gray80 option add *foreground black option add *selector black option add *Scrollbar.foreground #dfdfdf option add *Scrollbar.activeForeground #efefef option add *font $HelvB12 wm title . "xe - [lindex $argv 0]" wm minsize . 30 10 wm geometry . 80x20 #--------------------------------------- # set up iconwin #--------------------------------------- if {$tcl_platform(platform)== "unix"} { toplevel .icwin frame .icwin.f -relief flat -borderwidth 1 label .icwin.f.l1 -text xe -font $Helv12 label .icwin.f.l2 -text [lindex $argv 0] -font $Helv12 pack .icwin.f pack .icwin.f.l1 .icwin.f.l2 -anchor nw .icwin configure -relief ridge -borderwidth 2 wm geometry .icwin 60x60 wm iconwindow . .icwin } set keepEmpties 0 set useSimple 0 frame .menu -relief raised -borderwidth 1 -highlightthickness 0 #-- File -------------- menubutton .menu.file -text " File " -menu .menu.file.m menu .menu.file.m -tearoff 0 .menu.file.m add command -label " Clear Input Window " -command { .pane.upper.input.text delete 0.0 end } .menu.file.m add separator .menu.file.m add command -label " Save Output Window in ~/xe-out" -command { SaveTextWindow .pane.output.text "~/xe-out" } .menu.file.m add command -label " Print Output Window" -command { PrintDialog } .menu.file.m add separator .menu.file.m add command -label " Quit without Save" -command { exit } .menu.file.m add command -label " Save Input Window in $xe_save" -command { SaveTextWindow .pane.upper.input.text $xe_save } .menu.file.m add command -label " Quit and Save Input Window in $xe_save" \ -command { SaveTextWindow .pane.upper.input.text $xe_save exit } #-- Options -------------- menubutton .menu.options -text " Options " -menu .menu.options.m menu .menu.options.m -tearoff 0 .menu.options.m add command -label " http proxy " -command ConfigureProxy .menu.options.m add check -label " keep empties " \ -underline 1 -variable keepEmpties .menu.options.m add check -label " use simple parser " \ -underline 1 -variable useSimple pack .menu.file \ .menu.options -side left label .menu.info -text "XE " -font $HelvB12 pack .menu.info -side right pane .pane vertical 1000 1000 .pane configure -highlightthickness 0 frame .pane.upper -borderwidth 0 -highlightthickness 0 frame .pane.upper.input -borderwidth 2 -highlightthickness 0 text .pane.upper.input.text -relief sunken -bd 2 -height 10 -width 80 \ -bg $bgcolor -fg $fgcolor \ -font $Cour12 -padx 2 -pady 2 -setgrid 1 \ -yscrollcommand ".pane.upper.input.sb set" .pane.upper.input.text configure -exportselection yes .pane.upper.input.text tag configure search -background white -foreground black scrollbar .pane.upper.input.sb -relief sunken -command ".pane.upper.input.text yview" pack .pane.upper.input.sb -side right -fill y -expand no pack .pane.upper.input.text -side top -fill both -expand yes xmlWidget .pane.output pack .pane.output -side bottom -fill both -expand yes frame .pane.upper.buttons -borderwidth 1 -highlightthickness 0 label .pane.upper.buttons.searchL -text " search:" -underline 4 -font $Helv12 entry .pane.upper.buttons.search -width 20 -relief sunken -borderwidth 2 \ -textvariable searchString -exportselection yes \ -font $Cour12 -highlightthickness 1 \ -background gray90 button .pane.upper.buttons.padb1 -state disabled -relief flat \ -highlightthickness 0 \ -borderwidth 0 -padx 15 -pady 0 button .pane.upper.buttons.padb2 -state disabled -relief flat \ -highlightthickness 0 \ -borderwidth 0 -padx 15 -pady 0 button .pane.upper.buttons.execute -text "execute " -command { set sel [selection get] if {$sel != ""} { xmlExecute $sel } } -pady 2 button .pane.upper.buttons.clearoutput -text clearoutput -command { .pane.output.text delete 0.0 en foreach doc [info commands domDoc*] { $doc delete } } -pady 2 pack .pane.upper.buttons.searchL \ .pane.upper.buttons.search \ .pane.upper.buttons.padb1 \ .pane.upper.buttons.execute \ .pane.upper.buttons.padb2 \ .pane.upper.buttons.clearoutput -side left pack .pane.upper.buttons -anchor w pack .pane.upper.input -side top -fill both -expand yes pack .pane.upper.buttons -side bottom -fill x -expand no pack .pane.upper -fill both -expand yes pack .menu -fill x -side top -expand no pack .pane -side top -fill both -expand yes pane_place .pane vertical 0.25 .pane.upper .pane.output bind_emacstext Text menu .pane.output.m -tearoff 0 .pane.output.m add command -label " goto parent " -command GotoParent .pane.output.m add command -label " asXML " -command "As asXML" .pane.output.m add command -label " asHTML " -command "As asHTML" .pane.output.m add command -label " toXPath " -command ToXPath bind .pane.output.text <3> { .pane.output.text configure -cursor left_ptr set PointerXY @%x,%y eval tk_popup .pane.output.m [winfo pointerxy %W] } #-------------------------------------------------------------------- # search feature #-------------------------------------------------------------------- set origSearchWin .pane.upper.input.text .pane.output.text tag configure search -background white -foreground black .pane.upper.input.text tag configure search -background white -foreground black bind Text { global origSearchWin set origSearchWin %W focus .pane.upper.buttons.search } bind .pane.upper.buttons.search { set len [string length $searchString] .pane.upper.input.text tag remove search 0.0 end .pane.output.text tag remove search 0.0 end set curinsert [$origSearchWin index insert] set spos [$origSearchWin search -regexp $searchString insert] if {$spos != ""} { if {[$origSearchWin compare $curinsert == $spos]} { $origSearchWin mark set insert {insert +1char} } set spos [$origSearchWin search -regexp $searchString insert] if {$spos != ""} { $origSearchWin mark set insert $spos $origSearchWin see insert $origSearchWin tag add search insert "insert + $len char" } } break } #-------------------------------------------------------------------- # load the xe save file into the input window # #-------------------------------------------------------------------- if {[catch { set f [open $xe_save r ] }] == 0} { .pane.upper.input.text delete 1.0 end while { [gets $f i] >= 0 } { .pane.upper.input.text insert end $i .pane.upper.input.text insert end "\n" } close $f } IntroWindow # button .startedit -text " Edit plain XML " -font $Helv12 -command xmlEdit # button .dump -text " dump " -font $Helv12 -command {puts stderr [info commands xmlelem*]} # pack .xml -fill both -expand yes # pack .dump .startedit -anchor e # set fd [open [lindex $argv 0]] # set xml [read $fd] # close $fd # xmlWidgetLoad .pane.output.text $xml #---------------------------------------------------------------------------- # end of main part #---------------------------------------------------------------------------- tDOM-0.8.3/generic/0000755000175000017500000000000011004674373014200 5ustar ssobernissobernitDOM-0.8.3/generic/tcldom.c0000644000175000017500000067044110734307746015650 0ustar ssobernissoberni/*---------------------------------------------------------------------------- | Copyright (c) 1999 Jochen Loewer (loewerj@hotmail.com) +----------------------------------------------------------------------------- | | $Id: tcldom.c,v 1.113 2007/12/25 23:19:02 rolf Exp $ | | | A DOM implementation for Tcl using James Clark's expat XML parser | | | The contents of this file are subject to the Mozilla Public License | Version 1.1 (the "License"); you may not use this file except in | compliance with the License. You may obtain a copy of the License at | http://www.mozilla.org/MPL/ | | Software distributed under the License is distributed on an "AS IS" | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | License for the specific language governing rights and limitations | under the License. | | The Original Code is tDOM. | | The Initial Developer of the Original Code is Jochen Loewer | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 | Jochen Loewer. All Rights Reserved. | | Contributor(s): | Sept99 Carsten Zerbst Added comment and processing instructions | nodes. | June00 Zoran Vasiljevic Made thread-safe. | July00 Zoran Vasiljevic Added "domNode appendFromScript" | | | written by Jochen Loewer | April, 1999 | \---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- | Includes | \---------------------------------------------------------------------------*/ #include #include #include #include #include #include #include #include #include #include #include /* #define DEBUG */ /*---------------------------------------------------------------------------- | Debug Macros | \---------------------------------------------------------------------------*/ #ifdef DEBUG # define DBG(x) x #else # define DBG(x) #endif /*---------------------------------------------------------------------------- | Macros | \---------------------------------------------------------------------------*/ #define XP_CHILD 0 #define XP_DESCENDANT 1 #define XP_ANCESTOR 2 #define XP_FSIBLING 3 #define XP_PSIBLING 4 #define MAX_REWRITE_ARGS 50 #define SetResult(str) Tcl_ResetResult(interp); \ Tcl_SetStringObj(Tcl_GetObjResult(interp), (str), -1) #define SetIntResult(i) Tcl_ResetResult(interp); \ Tcl_SetIntObj(Tcl_GetObjResult(interp), (i)) #define SetDoubleResult(d) Tcl_ResetResult(interp); \ Tcl_SetDoubleObj(Tcl_GetObjResult(interp), (d)) #define SetBooleanResult(i) Tcl_ResetResult(interp); \ Tcl_SetBooleanObj(Tcl_GetObjResult(interp), (i)) #define AppendResult(str) {Tcl_Obj *o = Tcl_GetObjResult(interp); \ if (Tcl_IsShared(o)) { \ o = Tcl_DuplicateObj(o); \ Tcl_SetObjResult(interp, o); \ } \ Tcl_AppendToObj(o, (str), -1);} #define CheckArgs(min,max,n,msg) \ if ((objc < min) || (objc >max)) { \ Tcl_WrongNumArgs(interp, n, objv, msg); \ return TCL_ERROR; \ } #define CheckName(interp, name, errText, isFQ) \ if (!TSD(dontCheckName)) { \ if (!tcldom_nameCheck(interp, name, errText, isFQ)) {\ return TCL_ERROR; \ } \ } #define CheckPIName(interp, name) \ if (!TSD(dontCheckName)) { \ if (!tcldom_PINameCheck(interp, name)) {\ return TCL_ERROR; \ } \ } #define CheckText(interp, text, errText) \ if (!TSD(dontCheckCharData)) { \ if (!tcldom_textCheck(interp, text, errText)) {\ return TCL_ERROR; \ } \ } #define CheckComment(interp, text) \ if (!TSD(dontCheckCharData)) { \ if (!tcldom_commentCheck(interp, text)) {\ return TCL_ERROR; \ } \ } #define CheckCDATA(interp, text) \ if (!TSD(dontCheckCharData)) { \ if (!tcldom_CDATACheck(interp, text)) {\ return TCL_ERROR; \ } \ } #define CheckPIValue(interp, text) \ if (!TSD(dontCheckCharData)) { \ if (!tcldom_PIValueCheck(interp, text)) {\ return TCL_ERROR; \ } \ } #if TclOnly8Bits #define writeChars(var,chan,buf,len) (chan) ? \ ((void)Tcl_Write ((chan), (buf), (len) )) : \ (Tcl_AppendToObj ((var), (buf), (len) )); #else #define writeChars(var,chan,buf,len) (chan) ? \ ((void)Tcl_WriteChars ((chan), (buf), (len) )) : \ (Tcl_AppendToObj ((var), (buf), (len) )); #endif #define DOM_CREATECMDMODE_AUTO 0 #define DOM_CREATECMDMODE_CMDS 1 #define DOM_CREATECMDMODE_TOKENS 2 /*---------------------------------------------------------------------------- | Module Globals | \---------------------------------------------------------------------------*/ #ifndef TCL_THREADS static TEncoding *Encoding_to_8bit = NULL; static int storeLineColumn = 0; static int dontCreateObjCommands = 0; static int dontCheckCharData = 0; static int dontCheckName = 0; static int domCreateCmdMode = 0; # define TSD(x) x # define GetTcldomTSD() #else typedef struct ThreadSpecificData { TEncoding *Encoding_to_8bit; int storeLineColumn; int dontCreateObjCommands; int dontCheckCharData; int dontCheckName; int domCreateCmdMode; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; static Tcl_HashTable sharedDocs; static Tcl_Mutex tableMutex; static int tcldomInitialized; # define TSD(x) tsdPtr->x # define GetTcldomTSD() ThreadSpecificData *tsdPtr = \ (ThreadSpecificData*) \ Tcl_GetThreadData( \ &dataKey, \ sizeof(ThreadSpecificData)); #endif /* TCL_THREADS */ static char dom_usage[] = "Usage dom , where subCommand can be: \n" " parse ?-keepEmpties? ?-channel ?-baseurl ? \n" " ?-feedbackAfter <#Bytes>? \n" " ?-externalentitycommand ? \n" " ?-useForeignDTD ? \n" " ?-paramentityparsing \n" " ?-simple? ?-html? ?? ?? \n" " createDocument docElemName ?objVar? \n" " createDocumentNS uri docElemName ?objVar? \n" " createDocumentNode ?objVar? \n" TDomThreaded( " attachDocument domDoc ?objVar? \n" " detachDocument domDoc \n" ) " createNodeCmd ?-returnNodeCmd? (element|comment|text|cdata|pi)Node cmdName \n" " setResultEncoding ?encodingName? \n" " setStoreLineColumn ?boolean? \n" " setNameCheck ?boolean? \n" " setTextCheck ?boolean? \n" " setObjectCommands ?(automatic|token|command)? \n" " isCharData string \n" " isComment string \n" " isCDATA string \n" " isPIValue string \n" " isName string \n" " isQName string \n" " isNCName string \n" " isPIName string \n" ; static char doc_usage[] = "Usage domDoc , where method can be:\n" " documentElement ?objVar? \n" " getElementsByTagName name \n" " getElementsByTagNameNS uri localname \n" " createElement tagName ?objVar? \n" " createElementNS uri tagName ?objVar? \n" " createCDATASection data ?objVar? \n" " createTextNode text ?objVar? \n" " createComment text ?objVar? \n" " createProcessingInstruction target data ?objVar? \n" " asXML ?-indent ? ?-channel ? ?-escapeNonASCII? ?-escapeAllQuot? ?-doctypeDeclaration ?\n" " asHTML ?-channel ? ?-escapeNonASCII? ?-htmlEntities?\n" " asText \n" " getDefaultOutputMethod \n" " publicId ?publicId? \n" " systemId ?systemId? \n" " internalSubset ?internalSubset? \n" " indent ?boolean? \n" " omit-xml-declaration ?boolean? \n" " encoding ?value? \n" " standalone ?boolean? \n" " mediaType ?value? \n" " delete \n" " xslt ?-parameters parameterList? ?-ignoreUndeclaredParameters? ?-xsltmessagecmd cmd? ?objVar?\n" " toXSLTcmd \n" " cdataSectionElements (?URI:?localname|*) ?boolean?\n" " normalize ?-forXPath? \n" " nodeType \n" " hasChildNodes \n" " childNodes \n" " firstChild ?nodeObjVar? \n" " lastChild ?nodeObjVar? \n" " appendChild new \n" " insertBefore new ref \n" " replaceChild new old \n" " removeChild child \n" " ownerDocument \n" " getElementById id \n" " baseURI ?URI? \n" " appendFromList nestedList \n" " appendFromScript script \n" " insertBeforeFromScript script ref \n" " appendXML xmlString \n" " selectNodesNamespaces ?prefixUriList? \n" " selectNodes ?-namespaces prefixUriList? ?-cache ? xpathQuery ?typeVar? \n" " renameNode \n" " deleteXPathCache ?xpathQuery? \n" TDomThreaded( " readlock \n" " writelock \n" " renumber \n" ) ; static char node_usage[] = "Usage nodeObj , where method can be:\n" " nodeType \n" " nodeName \n" " nodeValue ?newValue? \n" " hasChildNodes \n" " childNodes \n" " childNodesLive \n" " parentNode \n" " firstChild ?nodeObjVar? \n" " lastChild ?nodeObjVar? \n" " nextSibling ?nodeObjVar? \n" " previousSibling ?nodeObjVar? \n" " hasAttribute attrName \n" " getAttribute attrName ?defaultValue? \n" " setAttribute attrName value ?attrName value ...? \n" " removeAttribute attrName \n" " hasAttributeNS uri localName \n" " getAttributeNS uri localName ?defaultValue? \n" " setAttributeNS uri attrName value ?attrName value ...? \n" " removeAttributeNS uri attrName \n" " attributes ?attrNamePattern? \n" " appendChild new \n" " insertBefore new ref \n" " replaceChild new old \n" " removeChild child \n" " cloneNode ?-deep? \n" " ownerDocument \n" " getElementsByTagName name \n" " getElementsByTagNameNS uri localname \n" " getElementById id \n" " find attrName attrValue ?nodeObjVar? \n" " child number|all ?type? ?attrName attrValue? \n" " descendant number|all ?type? ?attrName attrValue? \n" " ancestor number|all ?type? ?attrName attrValue? \n" " fsibling number|all ?type? ?attrName attrValue? \n" " psibling number|all ?type? ?attrName attrValue? \n" " root ?nodeObjVar? \n" " target \n" " data \n" " text \n" " prefix \n" " namespaceURI \n" " getBaseURI \n" " baseURI ?URI? \n" " localName \n" " delete \n" " getLine \n" " getColumn \n" " @ ?defaultValue? \n" " asList \n" " asXML ?-indent ? ?-channel ? ?-escapeNonASCII? ?-escapeAllQuot? ?-doctypeDeclaration ?\n" " asHTML ?-channel ? ?-escapeNonASCII? ?-htmlEntities?\n" " asText \n" " appendFromList nestedList \n" " appendFromScript script \n" " insertBeforeFromScript script ref \n" " appendXML xmlString \n" " selectNodes ?-namespaces prefixUriList? ?-cache ? xpathQuery ?typeVar? \n" " toXPath \n" " disableOutputEscaping ?boolean? \n" " precedes node \n" " normalize ?-forXPath? \n" " xslt ?-parameters parameterList? \n" TDomThreaded( " readlock \n" " writelock \n" ) ; /*---------------------------------------------------------------------------- | Types | \---------------------------------------------------------------------------*/ typedef struct XsltMsgCBInfo { Tcl_Interp * interp; Tcl_Obj * msgcmd; } XsltMsgCBInfo; /*---------------------------------------------------------------------------- | Prototypes for procedures defined later in this file: | \---------------------------------------------------------------------------*/ static Tcl_VarTraceProc tcldom_docTrace; static Tcl_VarTraceProc tcldom_nodeTrace; static Tcl_CmdDeleteProc tcldom_docCmdDeleteProc; static Tcl_CmdDeleteProc tcldom_nodeCmdDeleteProc; #ifdef TCL_THREADS static int tcldom_EvalLocked(Tcl_Interp* interp, Tcl_Obj** objv, domDocument* doc, int flag); static int tcldom_RegisterDocShared(domDocument* doc); static int tcldom_CheckDocShared(domDocument* doc); static int tcldom_UnregisterDocShared(Tcl_Interp* interp, domDocument* doc); /*---------------------------------------------------------------------------- | tcldom_Finalize | | Activated in application exit handler to delete shared document table | Table entries are deleted by the object command deletion callbacks, | so at this time, table should be empty. If not, we will leave some | memory leaks. This is not fatal, though: we're exiting the app anyway. | This is a private function to this file. \---------------------------------------------------------------------------*/ static void tcldom_Finalize( ClientData unused ) { Tcl_MutexLock(&tableMutex); Tcl_DeleteHashTable(&sharedDocs); Tcl_MutexUnlock(&tableMutex); } /*---------------------------------------------------------------------------- | tcldom_initialize | Activated at module load to initialize shared document table. | This is exported since we need it in tdominit.c. \---------------------------------------------------------------------------*/ void tcldom_initialize() { if (!tcldomInitialized) { Tcl_MutexLock(&tableMutex); Tcl_InitHashTable(&sharedDocs, TCL_ONE_WORD_KEYS); Tcl_CreateExitHandler(tcldom_Finalize, NULL); tcldomInitialized = 1; Tcl_MutexUnlock(&tableMutex); } } #endif /* TCL_THREADS */ /*---------------------------------------------------------------------------- | tcldom_deleteNode | \---------------------------------------------------------------------------*/ static void tcldom_deleteNode ( domNode * node, void * clientData ) { Tcl_Interp *interp = clientData; char objCmdName[80]; /* Try to delete the node object commands, ignore errors */ if (node->nodeFlags & VISIBLE_IN_TCL) { NODE_CMD(objCmdName, node); Tcl_DeleteCommand(interp, objCmdName); node->nodeFlags &= ~VISIBLE_IN_TCL; } } /*---------------------------------------------------------------------------- | tcldom_deleteDoc | \---------------------------------------------------------------------------*/ static void tcldom_deleteDoc ( Tcl_Interp * interp, domDocument * doc ) { int deleted = 1; TDomThreaded(deleted = tcldom_UnregisterDocShared(interp, doc)); if (deleted) { domFreeDocument(doc, tcldom_deleteNode, interp); } } /*---------------------------------------------------------------------------- | tcldom_docCmdDeleteProc | \---------------------------------------------------------------------------*/ static void tcldom_docCmdDeleteProc( ClientData clientData ) { domDeleteInfo *dinfo = (domDeleteInfo *)clientData; domDocument *doc = dinfo->document; char *var = dinfo->traceVarName; DBG(fprintf(stderr, "--> tcldom_docCmdDeleteProc doc %p\n", doc)); if (var) { DBG(fprintf(stderr, "--> tcldom_docCmdDeleteProc calls " "Tcl_UntraceVar for \"%s\"\n", var)); Tcl_UntraceVar(dinfo->interp, var, TCL_TRACE_WRITES|TCL_TRACE_UNSETS, tcldom_docTrace, clientData); FREE(var); dinfo->traceVarName = NULL; } tcldom_deleteDoc(dinfo->interp, doc); FREE((void*)dinfo); } /*---------------------------------------------------------------------------- | tcldom_nodeCmdDeleteProc | \---------------------------------------------------------------------------*/ static void tcldom_nodeCmdDeleteProc ( ClientData clientData ) { domDeleteInfo *dinfo = (domDeleteInfo *)clientData; char *var = dinfo->traceVarName; DBG(fprintf (stderr, "--> tcldom_nodeCmdDeleteProc node %p\n", dinfo->node)); if (var) { DBG(fprintf(stderr, "--> tcldom_nodeCmdDeleteProc calls " "Tcl_UntraceVar for \"%s\"\n", var)); Tcl_UntraceVar(dinfo->interp, var, TCL_TRACE_WRITES|TCL_TRACE_UNSETS, tcldom_nodeTrace, clientData); FREE(var); dinfo->traceVarName = NULL; } FREE((void*)dinfo); } /*---------------------------------------------------------------------------- | tcldom_docTrace | \---------------------------------------------------------------------------*/ static char * tcldom_docTrace ( ClientData clientData, Tcl_Interp *interp, CONST84 char *name1, CONST84 char *name2, int flags ) { domDeleteInfo *dinfo = (domDeleteInfo*) clientData; domDocument *doc = dinfo->document; char objCmdName[80]; DBG(fprintf(stderr, "--> tcldom_docTrace %x %p\n", flags, doc)); if (flags & TCL_INTERP_DESTROYED) { return NULL; } if (flags & TCL_TRACE_WRITES) { return "var is read-only"; } if (flags & TCL_TRACE_UNSETS) { DOC_CMD(objCmdName, doc); DBG(fprintf(stderr, "--> tcldom_docTrace delete doc %p\n", doc)); Tcl_DeleteCommand(interp, objCmdName); } return NULL; } /*---------------------------------------------------------------------------- | tcldom_nodeTrace | \---------------------------------------------------------------------------*/ static char * tcldom_nodeTrace ( ClientData clientData, Tcl_Interp *interp, CONST84 char *name1, CONST84 char *name2, int flags ) { domDeleteInfo *dinfo = (domDeleteInfo*)clientData; domNode *node = dinfo->node; char objCmdName[80]; DBG(fprintf(stderr, "--> tcldom_nodeTrace %x %p\n", flags, node)); if (flags & TCL_INTERP_DESTROYED) { return NULL; } if (flags & TCL_TRACE_WRITES) { return "var is read-only"; } if (flags & TCL_TRACE_UNSETS) { NODE_CMD(objCmdName, node); DBG(fprintf(stderr, "--> tcldom_nodeTrace delete node %p\n", node)); Tcl_UntraceVar(interp, name1, TCL_TRACE_WRITES | TCL_TRACE_UNSETS, tcldom_nodeTrace, clientData); Tcl_DeleteCommand(interp, objCmdName); node->nodeFlags &= ~VISIBLE_IN_TCL; } return NULL; } /*---------------------------------------------------------------------------- | tcldom_createNodeObj | \---------------------------------------------------------------------------*/ void tcldom_createNodeObj ( Tcl_Interp * interp, domNode * node, char * objCmdName ) { GetTcldomTSD() NODE_CMD(objCmdName, node); if (TSD(dontCreateObjCommands) == 0) { DBG(fprintf(stderr,"--> creating node %s\n", objCmdName)); Tcl_CreateObjCommand(interp, objCmdName, (Tcl_ObjCmdProc *) tcldom_NodeObjCmd, (ClientData) node, (Tcl_CmdDeleteProc*)NULL); node->nodeFlags |= VISIBLE_IN_TCL; } } /*---------------------------------------------------------------------------- | tcldom_returnNodeObj | \---------------------------------------------------------------------------*/ static int tcldom_returnNodeObj ( Tcl_Interp *interp, domNode *node, int setVariable, Tcl_Obj *var_name ) { char objCmdName[80], *objVar; domDeleteInfo * dinfo; Tcl_CmdInfo cmdInfo; GetTcldomTSD() if (node == NULL) { if (setVariable) { objVar = Tcl_GetString(var_name); Tcl_UnsetVar(interp, objVar, 0); Tcl_SetVar(interp, objVar, "", 0); } SetResult(""); return TCL_OK; } tcldom_createNodeObj(interp, node, objCmdName); if (TSD(dontCreateObjCommands)) { if (setVariable) { objVar = Tcl_GetString(var_name); Tcl_SetVar(interp, objVar, objCmdName, 0); } } else { if (setVariable) { objVar = Tcl_GetString(var_name); Tcl_UnsetVar(interp, objVar, 0); Tcl_SetVar (interp, objVar, objCmdName, 0); Tcl_GetCommandInfo(interp, objCmdName, &cmdInfo); if (0) { dinfo = (domDeleteInfo*)MALLOC(sizeof(domDeleteInfo)); dinfo->interp = interp; dinfo->node = node; dinfo->traceVarName = NULL; Tcl_TraceVar(interp, objVar, TCL_TRACE_WRITES | TCL_TRACE_UNSETS, (Tcl_VarTraceProc*)tcldom_nodeTrace, (ClientData)dinfo); dinfo->traceVarName = tdomstrdup(objVar); /* Patch node object command to remove above trace on teardown */ cmdInfo.deleteData = (ClientData)dinfo; cmdInfo.deleteProc = tcldom_nodeCmdDeleteProc; Tcl_SetCommandInfo(interp, objCmdName, &cmdInfo); } } } SetResult(objCmdName); return TCL_OK; } /*---------------------------------------------------------------------------- | tcldom_returnDocumentObj | \---------------------------------------------------------------------------*/ int tcldom_returnDocumentObj ( Tcl_Interp *interp, domDocument *document, int setVariable, Tcl_Obj *var_name, int trace, int forOwnerDocument ) { char objCmdName[80], *objVar; domDeleteInfo *dinfo; Tcl_CmdInfo cmd_info; GetTcldomTSD() if (document == NULL) { if (setVariable) { objVar = Tcl_GetString(var_name); Tcl_UnsetVar(interp, objVar, 0); Tcl_SetVar (interp, objVar, "", 0); } SetResult(""); return TCL_OK; } DOC_CMD(objCmdName, document); if (TSD(dontCreateObjCommands)) { if (setVariable) { objVar = Tcl_GetString(var_name); Tcl_SetVar(interp, objVar, objCmdName, 0); } } else { if (!Tcl_GetCommandInfo(interp, objCmdName, &cmd_info)) { dinfo = (domDeleteInfo*)MALLOC(sizeof(domDeleteInfo)); dinfo->interp = interp; dinfo->document = document; dinfo->traceVarName = NULL; Tcl_CreateObjCommand(interp, objCmdName, (Tcl_ObjCmdProc *) tcldom_DocObjCmd, (ClientData) dinfo, (Tcl_CmdDeleteProc*)tcldom_docCmdDeleteProc); } else { dinfo = (domDeleteInfo*)cmd_info.objClientData; } if (setVariable) { objVar = Tcl_GetString(var_name); Tcl_UnsetVar(interp, objVar, 0); Tcl_SetVar (interp, objVar, objCmdName, 0); if (trace) { dinfo->traceVarName = tdomstrdup(objVar); Tcl_TraceVar(interp,objVar,TCL_TRACE_WRITES|TCL_TRACE_UNSETS, (Tcl_VarTraceProc*)tcldom_docTrace, (ClientData)dinfo); } } } if (!forOwnerDocument) { TDomThreaded(tcldom_RegisterDocShared(document)); } SetResult(objCmdName); return TCL_OK; } /*---------------------------------------------------------------------------- | tcldom_getElementsByTagName | \---------------------------------------------------------------------------*/ static int tcldom_getElementsByTagName ( Tcl_Interp *interp, char *namePattern, domNode *node, int nsIndex, const char *uri ) { int result; domNode *child; char prefix[MAX_PREFIX_LEN], objCmdName[80]; const char *localName; Tcl_Obj *namePtr, *resultPtr; /* nsIndex == -1 ==> DOM 1 no NS i.e getElementsByTagName nsIndex != -1 are the NS aware cases nsIndex == -2 ==> more than one namespace in the document with the requested namespace, we have to strcmp the URI with the namespace uri of every node nsIndex == -3 ==> NS wildcard '*' nsIndex == -4 ==> special handled case uri == "", i.e. all nodes not in a namespace */ while (node) { if (node->nodeType != ELEMENT_NODE) { node = node->nextSibling; continue; } if ( (nsIndex == -1) || (nsIndex == (int)node->namespace) || (nsIndex == -3) || (nsIndex == -2 && node->namespace && strcmp(uri, domNamespaceURI (node)) == 0) || (nsIndex == -4 && (!node->namespace || strcmp ("", domNamespaceURI (node))==0)) ) { if (nsIndex == -1) { localName = node->nodeName; } else { domSplitQName(node->nodeName, prefix, &localName); } if (Tcl_StringMatch(localName, namePattern)) { resultPtr = Tcl_GetObjResult(interp); tcldom_createNodeObj(interp, node, objCmdName); namePtr = Tcl_NewStringObj(objCmdName, -1); result = Tcl_ListObjAppendElement(interp, resultPtr, namePtr); if (result != TCL_OK) { Tcl_DecrRefCount(namePtr); return result; } } } /* recurs to the child nodes */ child = node->firstChild; result = tcldom_getElementsByTagName(interp, namePattern, child, nsIndex, uri); if (result != TCL_OK) { return result; } node = node->nextSibling; } return TCL_OK; } /*---------------------------------------------------------------------------- | tcldom_find | \---------------------------------------------------------------------------*/ static domNode * tcldom_find ( domNode *node, char *attrName, char *attrVal, int length ) { domNode *child, *result; domAttrNode *attrs; if (node->nodeType != ELEMENT_NODE) return NULL; attrs = node->firstAttr; while (attrs) { if ((strcmp(attrs->nodeName, attrName)==0) && (length == attrs->valueLength) && (strncmp(attrs->nodeValue, attrVal, length)==0)) { return node; } attrs = attrs->nextSibling; } child = node->firstChild; while (child != NULL) { result = tcldom_find(child, attrName, attrVal, length); if (result != NULL) { return result; } child = child->nextSibling; } return NULL; } /*---------------------------------------------------------------------------- | tcldom_xpointerAddCallback | \---------------------------------------------------------------------------*/ static int tcldom_xpointerAddCallback ( domNode * node, void * clientData ) { Tcl_Interp * interp = (Tcl_Interp*)clientData; Tcl_Obj * resultPtr = Tcl_GetObjResult(interp); Tcl_Obj * namePtr; char objCmdName[80]; int result; tcldom_createNodeObj(interp, node, objCmdName); namePtr = Tcl_NewStringObj(objCmdName, -1); result = Tcl_ListObjAppendElement(interp, resultPtr, namePtr); if (result != TCL_OK) { Tcl_DecrRefCount(namePtr); } return result; } /*---------------------------------------------------------------------------- | tcldom_xpointerSearch | \---------------------------------------------------------------------------*/ static int tcldom_xpointerSearch ( Tcl_Interp * interp, int mode, domNode * node, int objc, Tcl_Obj * CONST objv[] ) { char *str; int i = 0; int result = 0; int all = 0; int instance = 0; int type = ELEMENT_NODE; char *element = NULL; char *attrName = NULL; char *attrValue = NULL; int attrLen; str = Tcl_GetString(objv[2]); if (strcmp(str, "all")==0) { all = 1; } else { if (Tcl_GetIntFromObj(interp, objv[2], &instance) != TCL_OK) { SetResult( "instance must be integer or 'all'"); return TCL_ERROR; } } if (objc > 3) { str = Tcl_GetString(objv[3]); if (*str == '#') { if (strcmp(str,"#text")==0) { type = TEXT_NODE; } else if (strcmp(str,"#cdata")==0) { type = CDATA_SECTION_NODE; } else if (strcmp(str,"#all")==0) { type = ALL_NODES; } else if (strcmp(str,"#element")==0) { type = ELEMENT_NODE; } else { SetResult( "wrong node type"); return TCL_ERROR; } } else { element = str; } } if (objc >= 5) { if ((type != ELEMENT_NODE) && (type != ALL_NODES)) { SetResult( "Attribute search only for element nodes"); return TCL_ERROR; } attrName = Tcl_GetString(objv[4]); if (objc == 6) { attrValue = Tcl_GetStringFromObj(objv[5], &attrLen); } else { attrValue = "*"; attrLen = 1; } } Tcl_ResetResult(interp); switch (mode) { case XP_CHILD: result = domXPointerChild (node, all, instance, type, element, attrName, attrValue, attrLen, tcldom_xpointerAddCallback, interp); break; case XP_DESCENDANT: result = domXPointerDescendant (node, all, instance, &i, type, element, attrName, attrValue, attrLen, tcldom_xpointerAddCallback, interp); break; case XP_ANCESTOR: result = domXPointerAncestor (node, all, instance, &i, type, element, attrName, attrValue, attrLen, tcldom_xpointerAddCallback, interp); break; case XP_FSIBLING: result = domXPointerXSibling (node, 1, all, instance, type, element, attrName, attrValue, attrLen, tcldom_xpointerAddCallback, interp); break; case XP_PSIBLING: result = domXPointerXSibling (node, 0, all, instance, type, element, attrName, attrValue, attrLen, tcldom_xpointerAddCallback, interp); break; } if (result != 0) { return TCL_ERROR; } return TCL_OK; } /*---------------------------------------------------------------------------- | tcldom_getNodeFromName | \---------------------------------------------------------------------------*/ domNode * tcldom_getNodeFromName ( Tcl_Interp *interp, char *nodeName, char **errMsg ) { Tcl_CmdInfo cmdInfo; domNode *node = NULL; if (strncmp(nodeName, "domNode", 7)) { *errMsg = "parameter not a domNode!"; return NULL; } if (sscanf(&nodeName[7], "%p", &node) != 1) { if (!Tcl_GetCommandInfo(interp, nodeName, &cmdInfo)) { *errMsg = "parameter not a domNode!"; return NULL; } if ( (cmdInfo.isNativeObjectProc == 0) || (cmdInfo.objProc != (Tcl_ObjCmdProc*)tcldom_NodeObjCmd)) { *errMsg = "parameter not a domNode object command!"; return NULL; } node = (domNode*)cmdInfo.objClientData; } return node; } /*---------------------------------------------------------------------------- | tcldom_getDocumentFromName | \---------------------------------------------------------------------------*/ domDocument * tcldom_getDocumentFromName ( Tcl_Interp *interp, char *docName, char **errMsg ) { Tcl_CmdInfo cmdInfo; domDocument *doc = NULL; int shared = 1; if (strncmp(docName, "domDoc", 6)) { *errMsg = "parameter not a domDoc!"; return NULL; } if (sscanf(&docName[6], "%p", &doc) != 1) { if (!Tcl_GetCommandInfo(interp, docName, &cmdInfo)) { *errMsg = "parameter not a domDoc!"; return NULL; } if ( (cmdInfo.isNativeObjectProc == 0) || (cmdInfo.objProc != (Tcl_ObjCmdProc*)tcldom_DocObjCmd)) { *errMsg = "parameter not a domDoc object command!"; return NULL; } doc = ((domDeleteInfo*)cmdInfo.objClientData)->document; } TDomThreaded(shared = tcldom_CheckDocShared(doc)); if (!shared) { *errMsg = "parameter not a shared domDoc!"; return NULL; } return doc; } /*---------------------------------------------------------------------------- | tcldom_appendXML | \---------------------------------------------------------------------------*/ int tcldom_appendXML ( Tcl_Interp *interp, domNode *node, Tcl_Obj *obj ) { char *xml_string, *extResolver = NULL; int xml_string_len; domDocument *doc; domNode *nodeToAppend; XML_Parser parser; GetTcldomTSD() xml_string = Tcl_GetStringFromObj(obj, &xml_string_len); #ifdef TDOM_NO_EXPAT SetResult("tDOM was compiled without Expat!"); return TCL_ERROR; #else parser = XML_ParserCreate_MM(NULL, MEM_SUITE, NULL); if (node->ownerDocument->extResolver) { extResolver = tdomstrdup (node->ownerDocument->extResolver); } doc = domReadDocument(parser, xml_string, xml_string_len, 1, TSD(Encoding_to_8bit), TSD(storeLineColumn), 0, NULL, NULL, extResolver, 0, (int) XML_PARAM_ENTITY_PARSING_ALWAYS, interp); if (doc == NULL) { char s[50]; long byteIndex, i; Tcl_ResetResult(interp); sprintf(s, "%ld", XML_GetCurrentLineNumber(parser)); Tcl_AppendResult(interp, "error \"", XML_ErrorString(XML_GetErrorCode(parser)), "\" at line ", s, " character ", NULL); sprintf(s, "%ld", XML_GetCurrentColumnNumber(parser)); Tcl_AppendResult(interp, s, NULL); byteIndex = XML_GetCurrentByteIndex(parser); if (byteIndex != -1) { Tcl_AppendResult(interp, "\n\"", NULL); s[1] = '\0'; for (i=-20; i < 40; i++) { if ((byteIndex+i)>=0) { if (xml_string[byteIndex+i]) { s[0] = xml_string[byteIndex+i]; Tcl_AppendResult(interp, s, NULL); if (i==0) { Tcl_AppendResult(interp, " <--Error-- ", NULL); } } else { break; } } } Tcl_AppendResult(interp, "\"",NULL); } XML_ParserFree(parser); return TCL_ERROR; } XML_ParserFree(parser); nodeToAppend = doc->rootNode->firstChild; while (nodeToAppend) { domAppendChild(node, nodeToAppend); nodeToAppend = nodeToAppend->nextSibling; } domFreeDocument(doc, NULL, NULL); return tcldom_returnNodeObj(interp, node, 0, NULL); #endif } /*---------------------------------------------------------------------------- | tcldom_xpathResultSet | \---------------------------------------------------------------------------*/ static int tcldom_xpathResultSet ( Tcl_Interp *interp, xpathResultSet *rs, Tcl_Obj *type, Tcl_Obj *value ) { int rc, i; Tcl_Obj *namePtr, *objv[2]; char objCmdName[80]; domAttrNode *attr; domNodeType startType; int mixedNodeSet; switch (rs->type) { case EmptyResult: Tcl_SetStringObj(type, "empty", -1); Tcl_SetStringObj(value, "", -1); break; case BoolResult: Tcl_SetStringObj(type, "bool", -1); Tcl_SetIntObj(value, rs->intvalue); break; case IntResult: Tcl_SetStringObj(type, "number", -1); Tcl_SetIntObj(value, rs->intvalue); break; case RealResult: Tcl_SetStringObj(type, "number", -1); Tcl_SetDoubleObj(value, rs->realvalue); break; case NaNResult: Tcl_SetStringObj(type, "number", -1); Tcl_SetStringObj(value, "NaN", -1); break; case InfResult: Tcl_SetStringObj(type, "number", -1); Tcl_SetStringObj(value, "Infinity", -1); break; case NInfResult: Tcl_SetStringObj(type, "number", -1); Tcl_SetStringObj(value, "-Infinity", -1); break; case StringResult: Tcl_SetStringObj(type, "string", -1); Tcl_SetStringObj(value, rs->string, rs->string_len); break; case xNodeSetResult: startType = rs->nodes[0]->nodeType; mixedNodeSet = 0; for (i=0; inr_nodes; i++) { if (rs->nodes[i]->nodeType != startType) mixedNodeSet = 1; if (rs->nodes[i]->nodeType == ATTRIBUTE_NODE) { attr = (domAttrNode*)rs->nodes[i]; objv[0] = Tcl_NewStringObj(attr->nodeName, -1); objv[1] = Tcl_NewStringObj(attr->nodeValue, attr->valueLength); namePtr = Tcl_NewListObj(2, objv); } else { tcldom_createNodeObj(interp, rs->nodes[i], objCmdName); namePtr = Tcl_NewStringObj(objCmdName, -1); } rc = Tcl_ListObjAppendElement(interp, value, namePtr); if (rc != TCL_OK) { Tcl_DecrRefCount(namePtr); return rc; } } if (mixedNodeSet) { Tcl_SetStringObj(type, "mixed", 5); } else { if (startType == ATTRIBUTE_NODE) Tcl_SetStringObj(type, "attrnodes",-1); else Tcl_SetStringObj(type, "nodes", 5); } break; } return TCL_OK; } /*---------------------------------------------------------------------------- | tcldom_xpathFuncCallBack | \---------------------------------------------------------------------------*/ static int tcldom_xpathFuncCallBack ( void *clientData, char *functionName, domNode *ctxNode, int position, xpathResultSet *nodeList, domNode *exprContext, int argc, xpathResultSets *args, xpathResultSet *result, char **errMsg ) { Tcl_Interp *interp = (Tcl_Interp*) clientData; char tclxpathFuncName[200], objCmdName[80]; char *errStr, *typeStr, *nodeName; Tcl_Obj *resultPtr, *objv[MAX_REWRITE_ARGS], *type, *value, *nodeObj; Tcl_CmdInfo cmdInfo; int objc, rc, i, errStrLen, listLen, intValue, res; double doubleValue; domNode *node; DBG(fprintf(stderr, "tcldom_xpathFuncCallBack functionName=%s " "position=%d argc=%d\n", functionName, position, argc);) sprintf (tclxpathFuncName, "::dom::xpathFunc::%s", functionName); DBG(fprintf(stderr, "testing %s\n", tclxpathFuncName);) rc = Tcl_GetCommandInfo (interp, tclxpathFuncName, &cmdInfo); if (!rc) { *errMsg = (char*)MALLOC (80 + strlen (functionName)); strcpy (*errMsg, "Unknown XPath function: \""); strcat (*errMsg, functionName); strcat (*errMsg, "\"!"); return XPATH_EVAL_ERR; } if (!cmdInfo.isNativeObjectProc) { *errMsg = (char*)tdomstrdup("can't access Tcl level method!"); return XPATH_EVAL_ERR; } if ( (5+(2*argc)) >= MAX_REWRITE_ARGS) { *errMsg = (char*)tdomstrdup("too many args for Tcl level method!"); return XPATH_EVAL_ERR; } objc = 0; objv[objc] = Tcl_NewStringObj(tclxpathFuncName, -1); Tcl_IncrRefCount(objv[objc++]); tcldom_createNodeObj(interp, ctxNode, objCmdName); objv[objc] = Tcl_NewStringObj(objCmdName, -1); Tcl_IncrRefCount(objv[objc++]); objv[objc] = Tcl_NewIntObj(position); Tcl_IncrRefCount(objv[objc++]); type = Tcl_NewObj(); value = Tcl_NewObj(); tcldom_xpathResultSet(interp, nodeList, type, value); objv[objc] = type; Tcl_IncrRefCount(objv[objc++]); objv[objc] = value; Tcl_IncrRefCount(objv[objc++]); for (i=0; i returning XPATH_EVAL_ERR \n");) res = XPATH_EVAL_ERR; goto funcCallCleanup; } Tcl_ResetResult(interp); res = XPATH_OK; } else { errStr = Tcl_GetStringFromObj( Tcl_GetObjResult(interp), &errStrLen); *errMsg = (char*)MALLOC(120+strlen(functionName) + errStrLen); strcpy(*errMsg, "Tcl error while executing XPATH extension function '"); strcat(*errMsg, functionName ); strcat(*errMsg, "':\n" ); strcat(*errMsg, errStr); Tcl_ResetResult(interp); DBG(fprintf(stderr, "returning XPATH_EVAL_ERR \n");) res = XPATH_EVAL_ERR; } funcCallCleanup: for (i = 0; i < objc; i++) { Tcl_DecrRefCount(objv[i]); } return res; } /*---------------------------------------------------------------------------- | tcldom_xsltMsgCB | \---------------------------------------------------------------------------*/ static void tcldom_xsltMsgCB ( void *clientData, char *str, int length, int terminate ) { XsltMsgCBInfo *msgCBInfo = (XsltMsgCBInfo *)clientData; Tcl_Obj *cmdPtr; if (msgCBInfo->msgcmd == NULL) { return; } cmdPtr = Tcl_DuplicateObj(msgCBInfo->msgcmd); Tcl_IncrRefCount(cmdPtr); if (Tcl_ListObjAppendElement(msgCBInfo->interp, cmdPtr, Tcl_NewStringObj(str, length)) != TCL_OK) { Tcl_DecrRefCount(cmdPtr); return; } if (terminate) { Tcl_ListObjAppendElement(msgCBInfo->interp, cmdPtr, Tcl_NewBooleanObj(1)); } else { Tcl_ListObjAppendElement(msgCBInfo->interp, cmdPtr, Tcl_NewBooleanObj(0)); } Tcl_GlobalEvalObj(msgCBInfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); return; } /*---------------------------------------------------------------------------- | tcldom_xpathResolveVar | \---------------------------------------------------------------------------*/ static char * tcldom_xpathResolveVar ( void *clientData, char *strToParse, int *offset, char **errMsg ) { CONST char *varValue; CONST char *termPtr; Tcl_Interp *interp = (Tcl_Interp *) clientData; *offset = 0; varValue = Tcl_ParseVar(interp, strToParse, &termPtr); if (varValue) { *offset = termPtr - strToParse; /* If strToParse start with a single '$' without a following * var name (according to tcl var name rules), Tcl_ParseVar() * doesn't report a parsing error but returns just a pointer * to a static string "$". */ if (*offset == 1) { *errMsg = tdomstrdup ("Missing var name after '$'."); varValue = NULL; } } else { *errMsg = tdomstrdup (Tcl_GetStringResult(interp)); } Tcl_ResetResult (interp); return (char*)varValue; } /*---------------------------------------------------------------------------- | tcldom_selectNodes | \---------------------------------------------------------------------------*/ static int tcldom_selectNodes ( Tcl_Interp *interp, domNode *node, int objc, Tcl_Obj *CONST objv[] ) { char *xpathQuery, *typeVar, *option; char *errMsg = NULL, **mappings = NULL; int rc, i, len, optionIndex, localmapping, cache = 0; xpathResultSet rs; Tcl_Obj *type, *objPtr; xpathCBs cbs; xpathParseVarCB parseVarCB; static CONST84 char *selectNodesOptions[] = { "-namespaces", "-cache", NULL }; enum selectNodesOption { o_namespaces, o_cache }; if (objc < 2) { SetResult("Wrong # of arguments."); return TCL_ERROR; } while (objc > 2) { option = Tcl_GetString (objv[1]); if (option[0] != '-') { break; } if (Tcl_GetIndexFromObj (NULL, objv[1], selectNodesOptions, "option", 0, &optionIndex) != TCL_OK) { break; } switch ((enum selectNodesOption) optionIndex) { case o_namespaces: rc = Tcl_ListObjLength (interp, objv[2], &len); if (rc != TCL_OK || (len % 2) != 0) { SetResult ("The \"-namespaces\" option requires a 'prefix" " namespace' pairs list as argument"); return TCL_ERROR; } if (mappings) { FREE (mappings); } mappings = MALLOC (sizeof (char *) * (len + 1)); for (i = 0; i < len; i++) { Tcl_ListObjIndex (interp, objv[2], i, &objPtr); /* The prefixMappings array is only used at xpath expr compile time. (And every needed info is strdup'ed.) So, we don't need to fiddle around with the refcounts of the prefixMappings list members. If we, at some day, allow to evaluate tcl scripts during xpath lexing/parsing, this must be revisited. */ mappings[i] = Tcl_GetString (objPtr); } mappings[len] = NULL; objc -= 2; objv += 2; break; case o_cache: if (Tcl_GetBooleanFromObj (interp, objv[2], &cache) != TCL_OK) { return TCL_ERROR; } objc -= 2; objv += 2; break; default: Tcl_ResetResult (interp); Tcl_AppendResult (interp, "bad option \"", Tcl_GetString (objv[1]), "\"; must be " "-namespaces", NULL); return TCL_ERROR; } } if (objc != 2 && objc != 3) { if (mappings) { FREE (mappings); } SetResult("Wrong # of arguments."); return TCL_ERROR; } xpathQuery = Tcl_GetString(objv[1]); xpathRSInit(&rs); cbs.funcCB = tcldom_xpathFuncCallBack; cbs.funcClientData = interp; cbs.varCB = NULL; cbs.varClientData = NULL; parseVarCB.parseVarCB = tcldom_xpathResolveVar; parseVarCB.parseVarClientData = interp; if (mappings == NULL) { mappings = node->ownerDocument->prefixNSMappings; localmapping = 0; } else { localmapping = 1; } if (cache) { if (!node->ownerDocument->xpathCache) { node->ownerDocument->xpathCache = MALLOC (sizeof (Tcl_HashTable)); Tcl_InitHashTable (node->ownerDocument->xpathCache, TCL_STRING_KEYS); } rc = xpathEval (node, node, xpathQuery, mappings, &cbs, &parseVarCB, node->ownerDocument->xpathCache, &errMsg, &rs); } else { rc = xpathEval (node, node, xpathQuery, mappings, &cbs, &parseVarCB, NULL, &errMsg, &rs); } if (rc != XPATH_OK) { xpathRSFree(&rs); SetResult(errMsg); DBG(fprintf(stderr, "errMsg = %s \n", errMsg);) if (errMsg) { FREE(errMsg); } if (localmapping && mappings) { FREE(mappings); } return TCL_ERROR; } if (errMsg) { FREE(errMsg); } typeVar = NULL; if (objc > 2) { typeVar = Tcl_GetString(objv[2]); } type = Tcl_NewObj(); Tcl_IncrRefCount(type); DBG(fprintf(stderr, "before tcldom_xpathResultSet \n");) tcldom_xpathResultSet(interp, &rs, type, Tcl_GetObjResult(interp)); DBG(fprintf(stderr, "after tcldom_xpathResultSet \n");) if (typeVar) { Tcl_SetVar(interp,typeVar, Tcl_GetString(type), 0); } Tcl_DecrRefCount(type); xpathRSFree( &rs ); if (localmapping && mappings) { FREE (mappings); } return TCL_OK; } /*---------------------------------------------------------------------------- | tcldom_nameCheck | \---------------------------------------------------------------------------*/ int tcldom_nameCheck ( Tcl_Interp *interp, char *name, char *nameType, int isFQName ) { int result; if (isFQName) { result = domIsQNAME (name); } else { result = domIsNAME (name); } if (!result) { Tcl_ResetResult (interp); Tcl_AppendResult (interp, "Invalid ", nameType, " name '", name, "'", (char *) NULL); return 0; } return 1; } /*---------------------------------------------------------------------------- | tcldom_PINameCheck | \---------------------------------------------------------------------------*/ int tcldom_PINameCheck ( Tcl_Interp *interp, char *name ) { /* XML rec, production 17 */ if (!domIsPINAME (name)) { Tcl_ResetResult (interp); Tcl_AppendResult (interp, "Invalid processing instruction name '", name, "'", NULL); return 0; } return 1; } /*---------------------------------------------------------------------------- | tcldom_textCheck | \---------------------------------------------------------------------------*/ int tcldom_textCheck ( Tcl_Interp *interp, char *text, char *errText ) { if (!domIsChar (text)) { Tcl_ResetResult (interp); Tcl_AppendResult (interp, "Invalid ", errText, " value '", text, "'", (char *) NULL); return 0; } return 1; } /*---------------------------------------------------------------------------- | tcldom_commentCheck | \---------------------------------------------------------------------------*/ int tcldom_commentCheck ( Tcl_Interp *interp, char *text ) { if (!domIsComment (text)) { Tcl_ResetResult (interp); Tcl_AppendResult (interp, "Invalid comment value '", text, "'", (char *) NULL); return 0; } return 1; } /*---------------------------------------------------------------------------- | tcldom_CDATACheck | \---------------------------------------------------------------------------*/ int tcldom_CDATACheck ( Tcl_Interp *interp, char *text ) { if (!domIsCDATA (text)) { Tcl_ResetResult (interp); Tcl_AppendResult (interp, "Invalid CDATA section value '", text, "'", (char *) NULL); return 0; } return 1; } /*---------------------------------------------------------------------------- | tcldom_PIValueCheck | \---------------------------------------------------------------------------*/ int tcldom_PIValueCheck ( Tcl_Interp *interp, char *text ) { if (!domIsPIValue (text)) { Tcl_ResetResult (interp); Tcl_AppendResult (interp, "Invalid processing instruction value '", text, "'", (char *) NULL); return 0; } return 1; } /*---------------------------------------------------------------------------- | tcldom_appendFromTclList | \---------------------------------------------------------------------------*/ static int tcldom_appendFromTclList ( Tcl_Interp *interp, domNode *node, Tcl_Obj *obj ) { int i, rc, length, valueLength, attrLength, attrValueLength; int childListLength; Tcl_Obj *lnode, *tagNameObj, *piNameObj, *valueObj, *attrListObj, *attrObj, *childListObj, *childObj; char *tag_name, *pi_name, *value, *attrName, *attrValue; domNode *newnode; GetTcldomTSD(); /*------------------------------------------------------------------------ | check format of Tcl list node \-----------------------------------------------------------------------*/ lnode = obj; if ((rc = Tcl_ListObjLength(interp, lnode, &length)) != TCL_OK) { return rc; } if ((length != 3) && (length != 2)) { SetResult( "invalid node list format!"); return TCL_ERROR; } /*------------------------------------------------------------------------ | create node \-----------------------------------------------------------------------*/ if ((rc = Tcl_ListObjIndex(interp, lnode, 0, &tagNameObj)) != TCL_OK) { return rc; } tag_name = Tcl_GetString(tagNameObj); if ( (strcmp(tag_name,"#cdata")==0) || (strcmp(tag_name,"#text")==0) || (strcmp(tag_name,"#comment")==0) ) { if (length != 2) { SetResult( "invalid text or comment node list format!"); return TCL_ERROR; } /*-------------------------------------------------------------------- | create text node \-------------------------------------------------------------------*/ if ((rc = Tcl_ListObjIndex(interp, lnode, 1, &valueObj)) != TCL_OK) { return rc; } value = Tcl_GetStringFromObj(valueObj, &valueLength); if (strcmp(tag_name, "#text")==0) { CheckText (interp, value, "text"); newnode = (domNode*)domNewTextNode(node->ownerDocument, value, valueLength, TEXT_NODE); } else if (strcmp(tag_name, "#comment")==0) { CheckComment (interp, value); newnode = (domNode*)domNewTextNode(node->ownerDocument, value, valueLength, COMMENT_NODE); } else { CheckCDATA (interp, value); newnode = (domNode*)domNewTextNode(node->ownerDocument, value, valueLength, CDATA_SECTION_NODE); } domAppendChild(node, newnode); return TCL_OK; } if (strcmp(tag_name,"#pi")==0) { if (length != 3) { SetResult( "invalid PI node list format!"); return TCL_ERROR; } /*-------------------------------------------------------------------- | create processing instruction node \-------------------------------------------------------------------*/ if ((rc = Tcl_ListObjIndex(interp, lnode, 1, &piNameObj)) != TCL_OK) { return rc; } if ((rc = Tcl_ListObjIndex(interp, lnode, 2, &valueObj)) != TCL_OK) { return rc; } pi_name = Tcl_GetStringFromObj(piNameObj, &length); CheckPIName (interp, pi_name); value = Tcl_GetStringFromObj(valueObj, &valueLength); CheckPIValue (interp, value); newnode = (domNode*)domNewProcessingInstructionNode (node->ownerDocument, pi_name, length, value, valueLength); domAppendChild(node, newnode); return TCL_OK; } /*------------------------------------------------------------------------ | create element node \-----------------------------------------------------------------------*/ if (length != 3) { SetResult("invalid element node list format!"); return TCL_ERROR; } CheckName (interp, tag_name, "tag", 0); newnode = domNewElementNode(node->ownerDocument, tag_name, ELEMENT_NODE); domAppendChild(node, newnode); /*------------------------------------------------------------------------ | create atributes \-----------------------------------------------------------------------*/ if ((rc = Tcl_ListObjIndex(interp, lnode, 1, &attrListObj)) != TCL_OK) { return rc; } if ((rc = Tcl_ListObjLength(interp, attrListObj, &attrLength)) != TCL_OK) { return rc; } if (attrLength % 2) { SetResult("invalid attributes list format!"); return TCL_ERROR; } for (i=0; inodeType == TEXT_NODE) || (node->nodeType == CDATA_SECTION_NODE)) { value = Tcl_NewStringObj(((domTextNode*)node)->nodeValue, ((domTextNode*)node)->valueLength); objv[0] = Tcl_NewStringObj("#text", -1); objv[1] = value; return Tcl_NewListObj(2, objv); } if (node->nodeType == COMMENT_NODE) { value = Tcl_NewStringObj(((domTextNode*)node)->nodeValue, ((domTextNode*)node)->valueLength); objv[0] = Tcl_NewStringObj("#comment", -1); objv[1] = value; return Tcl_NewListObj(2, objv); } if (node->nodeType == PROCESSING_INSTRUCTION_NODE) { domProcessingInstructionNode *dpn; dpn = (domProcessingInstructionNode *)node; name = Tcl_NewStringObj(dpn->targetValue, dpn->targetLength); value = Tcl_NewStringObj(dpn->dataValue, dpn->dataLength); objv[0] = Tcl_NewStringObj("#pi", -1); objv[1] = name; objv[2] = value; return Tcl_NewListObj(3, objv); } name = Tcl_NewStringObj(node->nodeName, -1); attrsList = Tcl_NewListObj(0, NULL); attrs = node->firstAttr; while (attrs) { attrName = Tcl_NewStringObj(attrs->nodeName, -1); attrValue = Tcl_NewStringObj(attrs->nodeValue, attrs->valueLength); Tcl_ListObjAppendElement(interp, attrsList, attrName); Tcl_ListObjAppendElement(interp, attrsList, attrValue); attrs = attrs->nextSibling; } childList = Tcl_NewListObj(0, NULL); if (node->nodeType == ELEMENT_NODE) { child = node->firstChild; while (child != NULL) { result = Tcl_ListObjAppendElement (interp, childList, tcldom_treeAsTclList(interp, child)); if (result != TCL_OK) { return NULL; } child = child->nextSibling; } } objv[0] = name; objv[1] = attrsList; objv[2] = childList; return Tcl_NewListObj(3, objv); } /*---------------------------------------------------------------------------- | tcldom_AppendEscaped | \---------------------------------------------------------------------------*/ static void tcldom_AppendEscaped ( Tcl_Obj *xmlString, Tcl_Channel chan, char *value, int value_length, int forAttr, int escapeNonASCII, int htmlEntities, int escapeAllQuot ) { #define APESC_BUF_SIZE 512 #define AP(c) *b++ = c; #define AE(s) pc1 = s; while(*pc1) *b++ = *pc1++; char buf[APESC_BUF_SIZE+80], *b, *bLimit, *pc, *pc1, *pEnd, charRef[10]; int charDone, i; #if !TclOnly8Bits int clen = 0; Tcl_UniChar uniChar; #endif b = buf; bLimit = b + APESC_BUF_SIZE; pc = pEnd = value; if (value_length != -1) { pEnd = pc + value_length; } while ( (value_length == -1 && *pc) || (value_length != -1 && pc != pEnd) ) { if ((forAttr || escapeAllQuot) && (*pc == '"')) { AP('&') AP('q') AP('u') AP('o') AP('t') AP(';') } else if (*pc == '&') { AP('&') AP('a') AP('m') AP('p') AP(';') } else if (*pc == '<') { AP('&') AP('l') AP('t') AP(';') } else if (*pc == '>') { AP('&') AP('g') AP('t') AP(';') } else if (forAttr && (*pc == '\n')) { AP('&') AP('#') AP('x') AP('A') AP(';') } else { charDone = 0; if (htmlEntities) { charDone = 1; #if TclOnly8Bits switch ((unsigned int)*pc) #else Tcl_UtfToUniChar(pc, &uniChar); switch (uniChar) #endif { case 0240: AE(" "); break; case 0241: AE("¡"); break; case 0242: AE("¢"); break; case 0243: AE("£"); break; case 0244: AE("¤"); break; case 0245: AE("¥"); break; case 0246: AE("¦"); break; case 0247: AE("§"); break; case 0250: AE("¨"); break; case 0251: AE("©"); break; case 0252: AE("ª"); break; case 0253: AE("«"); break; case 0254: AE("¬"); break; case 0255: AE("­"); break; case 0256: AE("®"); break; case 0257: AE("¯"); break; case 0260: AE("°"); break; case 0261: AE("±"); break; case 0262: AE("²"); break; case 0263: AE("³"); break; case 0264: AE("´"); break; case 0265: AE("µ"); break; case 0266: AE("¶"); break; case 0267: AE("·"); break; case 0270: AE("¸"); break; case 0271: AE("¹"); break; case 0272: AE("º"); break; case 0273: AE("»"); break; case 0274: AE("¼"); break; case 0275: AE("½"); break; case 0276: AE("¾"); break; case 0277: AE("¿"); break; case 0300: AE("À"); break; case 0301: AE("Á"); break; case 0302: AE("Â"); break; case 0303: AE("Ã"); break; case 0304: AE("Ä"); break; case 0305: AE("Å"); break; case 0306: AE("Æ"); break; case 0307: AE("Ç"); break; case 0310: AE("È"); break; case 0311: AE("É"); break; case 0312: AE("Ê"); break; case 0313: AE("Ë"); break; case 0314: AE("Ì"); break; case 0315: AE("Í"); break; case 0316: AE("Î"); break; case 0317: AE("Ï"); break; case 0320: AE("Ð"); break; case 0321: AE("Ñ"); break; case 0322: AE("Ò"); break; case 0323: AE("Ó"); break; case 0324: AE("Ô"); break; case 0325: AE("Õ"); break; case 0326: AE("Ö"); break; case 0327: AE("×"); break; case 0330: AE("Ø"); break; case 0331: AE("Ù"); break; case 0332: AE("Ú"); break; case 0333: AE("Û"); break; case 0334: AE("Ü"); break; case 0335: AE("Ý"); break; case 0336: AE("Þ"); break; case 0337: AE("ß"); break; case 0340: AE("à"); break; case 0341: AE("á"); break; case 0342: AE("â"); break; case 0343: AE("ã"); break; case 0344: AE("ä"); break; case 0345: AE("å"); break; case 0346: AE("æ"); break; case 0347: AE("ç"); break; case 0350: AE("è"); break; case 0351: AE("é"); break; case 0352: AE("ê"); break; case 0353: AE("ë"); break; case 0354: AE("ì"); break; case 0355: AE("í"); break; case 0356: AE("î"); break; case 0357: AE("ï"); break; case 0360: AE("ð"); break; case 0361: AE("ñ"); break; case 0362: AE("ò"); break; case 0363: AE("ó"); break; case 0364: AE("ô"); break; case 0365: AE("õ"); break; case 0366: AE("ö"); break; case 0367: AE("÷"); break; case 0370: AE("ø"); break; case 0371: AE("ù"); break; case 0372: AE("ú"); break; case 0373: AE("û"); break; case 0374: AE("ü"); break; case 0375: AE("ý"); break; case 0376: AE("þ"); break; case 0377: AE("ÿ"); break; #if !TclOnly8Bits /* "Special" chars, according to XHTML xhtml-special.ent */ case 338: AE("Œ"); break; case 339: AE("œ"); break; case 352: AE("Š"); break; case 353: AE("š"); break; case 376: AE("Ÿ"); break; case 710: AE("ˆ"); break; case 732: AE("˜"); break; case 8194: AE(" "); break; case 8195: AE(" "); break; case 8201: AE(" "); break; case 8204: AE("‌"); break; case 8205: AE("‍"); break; case 8206: AE("‎"); break; case 8207: AE("‏"); break; case 8211: AE("–"); break; case 8212: AE("—"); break; case 8216: AE("‘"); break; case 8217: AE("’"); break; case 8218: AE("‚"); break; case 8220: AE("“"); break; case 8221: AE("”"); break; case 8222: AE("„"); break; case 8224: AE("†"); break; case 8225: AE("‡"); break; case 8240: AE("‰"); break; case 8249: AE("‹"); break; case 8250: AE("›"); break; case 8364: AE("€"); break; /* "Symbol" chars, according to XHTML xhtml-symbol.ent */ case 402: AE("ƒ"); break; case 913: AE("Α"); break; case 914: AE("Β"); break; case 915: AE("Γ"); break; case 916: AE("Δ"); break; case 917: AE("Ε"); break; case 918: AE("Ζ"); break; case 919: AE("Η"); break; case 920: AE("Θ"); break; case 921: AE("Ι"); break; case 922: AE("Κ"); break; case 923: AE("Λ"); break; case 924: AE("Μ"); break; case 925: AE("Ν"); break; case 926: AE("Ξ"); break; case 927: AE("Ο"); break; case 928: AE("Π"); break; case 929: AE("Ρ"); break; case 931: AE("Σ"); break; case 932: AE("Τ"); break; case 933: AE("Υ"); break; case 934: AE("Φ"); break; case 935: AE("Χ"); break; case 936: AE("Ψ"); break; case 937: AE("Ω"); break; case 945: AE("α"); break; case 946: AE("β"); break; case 947: AE("γ"); break; case 948: AE("δ"); break; case 949: AE("ε"); break; case 950: AE("ζ"); break; case 951: AE("η"); break; case 952: AE("θ"); break; case 953: AE("ι"); break; case 954: AE("κ"); break; case 955: AE("λ"); break; case 956: AE("μ"); break; case 957: AE("ν"); break; case 958: AE("ξ"); break; case 959: AE("ο"); break; case 960: AE("π"); break; case 961: AE("ρ"); break; case 962: AE("ς"); break; case 963: AE("σ"); break; case 964: AE("τ"); break; case 965: AE("υ"); break; case 966: AE("φ"); break; case 967: AE("χ"); break; case 968: AE("ψ"); break; case 969: AE("ω"); break; case 977: AE("ϑ");break; case 978: AE("ϒ"); break; case 982: AE("ϖ"); break; case 8226: AE("•"); break; case 8230: AE("…"); break; case 8242: AE("′"); break; case 8243: AE("″"); break; case 8254: AE("‾"); break; case 8260: AE("⁄"); break; case 8472: AE("℘"); break; case 8465: AE("ℑ"); break; case 8476: AE("ℜ"); break; case 8482: AE("™"); break; case 8501: AE("ℵ"); break; case 8592: AE("←"); break; case 8593: AE("↑"); break; case 8594: AE("→"); break; case 8595: AE("↓"); break; case 8596: AE("↔"); break; case 8629: AE("↵"); break; case 8656: AE("⇐"); break; case 8657: AE("⇑"); break; case 8658: AE("⇒"); break; case 8659: AE("⇓"); break; case 8660: AE("⇔"); break; case 8704: AE("∀"); break; case 8706: AE("∂"); break; case 8707: AE("∃"); break; case 8709: AE("∅"); break; case 8711: AE("∇"); break; case 8712: AE("∈"); break; case 8713: AE("∉"); break; case 8715: AE("∋"); break; case 8719: AE("∏"); break; case 8721: AE("∑"); break; case 8722: AE("−"); break; case 8727: AE("∗"); break; case 8730: AE("√"); break; case 8733: AE("∝"); break; case 8734: AE("∞"); break; case 8736: AE("∠"); break; case 8743: AE("∧"); break; case 8744: AE("∨"); break; case 8745: AE("∩"); break; case 8746: AE("∪"); break; case 8747: AE("∫"); break; case 8756: AE("∴"); break; case 8764: AE("∼"); break; case 8773: AE("≅"); break; case 8776: AE("≈"); break; case 8800: AE("≠"); break; case 8801: AE("≡"); break; case 8804: AE("≤"); break; case 8805: AE("≥"); break; case 8834: AE("⊂"); break; case 8835: AE("⊃"); break; case 8836: AE("⊄"); break; case 8838: AE("⊆"); break; case 8839: AE("⊇"); break; case 8853: AE("⊕"); break; case 8855: AE("⊗"); break; case 8869: AE("⊥"); break; case 8901: AE("⋅"); break; case 8968: AE("⌈"); break; case 8969: AE("⌉"); break; case 8970: AE("⌊"); break; case 8971: AE("⌋"); break; case 9001: AE("⟨"); break; case 9002: AE("⟩"); break; case 9674: AE("◊"); break; case 9824: AE("♠"); break; case 9827: AE("♣"); break; case 9829: AE("♥"); break; case 9830: AE("♦"); break; #endif default: charDone = 0; } #if !TclOnly8Bits if (charDone) { clen = UTF8_CHAR_LEN(*pc); pc += (clen - 1); } #endif } #if TclOnly8Bits if (!charDone) { if (escapeNonASCII && ((unsigned char)*pc > 127)) { AP('&') AP('#') sprintf(charRef, "%d", (unsigned char)*pc); for (i = 0; i < 3; i++) { AP(charRef[i]); } AP(';') } else { AP(*pc); } } #else if (!charDone) { if ((unsigned char)*pc > 127) { clen = UTF8_CHAR_LEN(*pc); if (!clen) { domPanic("tcldom_AppendEscaped: can only handle " "UTF-8 chars up to 3 bytes length"); } if (escapeNonASCII) { Tcl_UtfToUniChar(pc, &uniChar); AP('&') AP('#') sprintf(charRef, "%d", uniChar); for (i = 0; i < (int)strlen(charRef); i++) { AP(charRef[i]); } AP(';') pc += (clen - 1); } else { for (i = 0; i < clen; i++) { AP(*pc); pc++; } pc--; } } else { AP(*pc); } } #endif } if (b >= bLimit) { writeChars(xmlString, chan, buf, b - buf); b = buf; } pc++; } if (b > buf) { writeChars(xmlString, chan, buf, b - buf); } } /*---------------------------------------------------------------------------- | tcldom_tolower | \---------------------------------------------------------------------------*/ void tcldom_tolower ( const char *str, char *str_out, int len ) { char *p; int i; len--; i = 0; p = str_out; while (*str && (i < len)) { *p++ = tolower((unsigned char)*str++); i++; } *p++ = '\0'; } /*---------------------------------------------------------------------------- | tcldom_treeAsHTML | \---------------------------------------------------------------------------*/ static void tcldom_treeAsHTML ( Tcl_Obj *htmlString, domNode *node, Tcl_Channel chan, int escapeNonASCII, int htmlEntities, int doctypeDeclaration, int noEscaping ) { int empty, scriptTag; domNode *child; domAttrNode *attrs; domDocument *doc; char tag[80], attrName[80]; if (node->nodeType == DOCUMENT_NODE) { doc = (domDocument*) node; if (doctypeDeclaration && doc->documentElement) { writeChars(htmlString, chan, "documentElement->nodeName, -1); if ( doc->doctype && doc->doctype->systemId && doc->doctype->systemId[0] != '\0') { if ( doc->doctype->publicId && doc->doctype->publicId[0] != '\0') { writeChars(htmlString, chan, " PUBLIC \"", 9); writeChars(htmlString, chan, doc->doctype->publicId, -1); writeChars(htmlString, chan, "\" \"", 3); writeChars(htmlString, chan, doc->doctype->systemId, -1); writeChars(htmlString, chan, "\"", 1); } else { writeChars(htmlString, chan, " SYSTEM \"", 9); writeChars(htmlString, chan, doc->doctype->systemId, -1); writeChars(htmlString, chan, "\"", 1); } } if (doc->doctype && doc->doctype->internalSubset) { writeChars(htmlString, chan, " [", 2); writeChars(htmlString, chan, doc->doctype->internalSubset, -1); writeChars(htmlString, chan, "]", 1); } writeChars(htmlString, chan, ">\n", 2); } child = doc->rootNode->firstChild; while (child) { tcldom_treeAsHTML(htmlString, child, chan, escapeNonASCII, htmlEntities, doctypeDeclaration, 0); child = child->nextSibling; } return; } if (node->nodeType == PROCESSING_INSTRUCTION_NODE) { domProcessingInstructionNode *dpn; dpn = (domProcessingInstructionNode *)node; writeChars(htmlString, chan, "targetValue, dpn->targetLength); writeChars(htmlString, chan, " ", 1); writeChars(htmlString, chan, dpn->dataValue, dpn->dataLength); writeChars(htmlString, chan, ">", 1); return; } if (node->nodeType == TEXT_NODE) { if ((node->nodeFlags & DISABLE_OUTPUT_ESCAPING) || noEscaping) { writeChars(htmlString, chan, ((domTextNode*)node)->nodeValue, ((domTextNode*)node)->valueLength); } else { tcldom_AppendEscaped(htmlString, chan, ((domTextNode*)node)->nodeValue, ((domTextNode*)node)->valueLength, 0, escapeNonASCII, htmlEntities, 0); } return; } if (node->nodeType == CDATA_SECTION_NODE) { if (noEscaping) { writeChars(htmlString, chan, ((domTextNode*)node)->nodeValue, ((domTextNode*)node)->valueLength); } else { tcldom_AppendEscaped(htmlString, chan, ((domTextNode*)node)->nodeValue, ((domTextNode*)node)->valueLength, 0, escapeNonASCII, htmlEntities, 0); } } if (node->nodeType == COMMENT_NODE) { writeChars(htmlString, chan, "", 3); return; } tcldom_tolower(node->nodeName, tag, 80); writeChars(htmlString, chan, "<", 1); writeChars(htmlString, chan, tag, -1); /*----------------------------------------------------------- | check for HTML tags, that must be handled special: | empty tags and script tags (todo: HTML tags with | URI attributes, to do escaping of Non-ASCII chars | in the URI). \----------------------------------------------------------*/ empty = 0; scriptTag = 0; switch (tag[0]) { case 'a': if (!strcmp(tag,"area")) empty = 1; break; case 'b': if (!strcmp(tag,"br") || !strcmp(tag,"base") || !strcmp(tag,"basefont")) empty = 1; case 'c': if (!strcmp(tag,"col")) empty = 1; break; case 'f': if (!strcmp(tag,"frame")) empty = 1; break; case 'h': if (!strcmp(tag,"hr")) empty = 1; break; case 'i': if (!strcmp(tag,"img") || !strcmp(tag,"input") || !strcmp(tag,"isindex")) empty = 1; break; case 'l': if (!strcmp(tag,"link")) empty = 1; break; case 'm': if (!strcmp(tag,"meta")) empty = 1; break; case 'p': if (!strcmp(tag,"param")) empty = 1; break; case 's': if (!strcmp(tag,"script") || !strcmp(tag,"style")) scriptTag = 1; break; } attrs = node->firstAttr; while (attrs) { tcldom_tolower(attrs->nodeName, attrName, 80); writeChars(htmlString, chan, " ", 1); writeChars (htmlString, chan, attrName, -1); writeChars(htmlString, chan, "=\"", 2); tcldom_AppendEscaped(htmlString, chan, attrs->nodeValue, -1, 1, escapeNonASCII, htmlEntities, 0); writeChars(htmlString, chan, "\"", 1); attrs = attrs->nextSibling; } writeChars(htmlString, chan, ">", 1); if (empty) { /* strange ! should not happen ! */ child = node->firstChild; while (child != NULL) { tcldom_treeAsHTML(htmlString, child, chan, escapeNonASCII, htmlEntities, doctypeDeclaration, scriptTag); child = child->nextSibling; } return; } if (node->nodeType == ELEMENT_NODE) { child = node->firstChild; if ((child != NULL) && (child != node->lastChild) && (child->nodeType != TEXT_NODE)) { writeChars(htmlString, chan, "\n", 1); } while (child != NULL) { tcldom_treeAsHTML(htmlString, child, chan, escapeNonASCII, htmlEntities, doctypeDeclaration, scriptTag); child = child->nextSibling; } if ((node->firstChild != NULL) && (node->firstChild != node->lastChild) && (node->lastChild->nodeType != TEXT_NODE)) { writeChars(htmlString, chan, "\n", 1); } } writeChars(htmlString, chan, "", 1); } /*---------------------------------------------------------------------------- | tcldom_treeAsXML | \---------------------------------------------------------------------------*/ static void tcldom_treeAsXML ( Tcl_Obj *xmlString, domNode *node, int indent, int level, int doIndent, Tcl_Channel chan, int escapeNonASCII, int doctypeDeclaration, int cdataChild, int escapeAllQuot ) { domAttrNode *attrs; domNode *child; domDocument *doc; int first, hasElements, i; char prefix[MAX_PREFIX_LEN], *start, *p; const char *localName; Tcl_HashEntry *h; Tcl_DString dStr; if (node->nodeType == DOCUMENT_NODE) { doc = (domDocument*) node; if (doctypeDeclaration && doc->documentElement) { writeChars(xmlString, chan, "documentElement->nodeName, -1); if ( doc->doctype && doc->doctype->systemId && (doc->doctype->systemId[0] != '\0')) { if ( doc->doctype->publicId && doc->doctype->publicId[0] != '\0') { writeChars(xmlString, chan, " PUBLIC \"", 9); writeChars(xmlString, chan, doc->doctype->publicId, -1); writeChars(xmlString, chan, "\" \"", 3); writeChars(xmlString, chan, doc->doctype->systemId, -1); writeChars(xmlString, chan, "\"", 1); } else { writeChars(xmlString, chan, " SYSTEM \"", 9); writeChars(xmlString, chan, doc->doctype->systemId, -1); writeChars(xmlString, chan, "\"", 1); } if (doc->doctype->internalSubset) { writeChars(xmlString, chan, " [", 2); writeChars(xmlString, chan, doc->doctype->internalSubset, -1); writeChars(xmlString, chan, "]", 1); } } writeChars(xmlString, chan, ">\n", 2); } child = doc->rootNode->firstChild; while (child) { tcldom_treeAsXML(xmlString, child, indent, level, doIndent, chan, escapeNonASCII, doctypeDeclaration, 0, escapeAllQuot); child = child->nextSibling; } return; } if (node->nodeType == TEXT_NODE) { if (cdataChild) { writeChars(xmlString, chan, "nodeValue; while (i < ((domTextNode*)node)->valueLength) { if (*p == ']') { p++; i++;; if (i >= ((domTextNode*)node)->valueLength) break; if (*p == ']') { p++; i++;; if (i >= ((domTextNode*)node)->valueLength) break; if (*p == '>') { writeChars(xmlString, chan, start, p-start); writeChars(xmlString, chan, "]]>", 13); start = p+1; } } } p++; i++;; } writeChars(xmlString, chan, start, p-start); writeChars(xmlString, chan, "]]>", 3); } else { if (node->nodeFlags & DISABLE_OUTPUT_ESCAPING) { writeChars(xmlString, chan, ((domTextNode*)node)->nodeValue, ((domTextNode*)node)->valueLength); } else { tcldom_AppendEscaped(xmlString, chan, ((domTextNode*)node)->nodeValue, ((domTextNode*)node)->valueLength, 0, escapeNonASCII, 0, escapeAllQuot); } } return; } if (node->nodeType == CDATA_SECTION_NODE) { writeChars(xmlString, chan, "nodeValue, ((domTextNode*)node)->valueLength); writeChars(xmlString, chan, "]]>", 3); return; } if ((indent != -1) && doIndent) { for(i=0; inodeType == COMMENT_NODE) { writeChars(xmlString, chan, "", 3); if (indent != -1) writeChars (xmlString, chan, "\n", 1); return; } if (node->nodeType == PROCESSING_INSTRUCTION_NODE) { writeChars(xmlString, chan, "targetValue, ((domProcessingInstructionNode*)node)->targetLength); writeChars(xmlString, chan, " ", 1); writeChars(xmlString, chan, ((domProcessingInstructionNode*)node)->dataValue, ((domProcessingInstructionNode*)node)->dataLength); writeChars(xmlString, chan, "?>", 2); if (indent != -1) writeChars (xmlString, chan, "\n", 1); return; } writeChars(xmlString, chan, "<", 1); writeChars(xmlString, chan, node->nodeName, -1); attrs = node->firstAttr; while (attrs) { writeChars(xmlString, chan, " ", 1); writeChars(xmlString, chan, attrs->nodeName, -1); writeChars(xmlString, chan, "=\"", 2); tcldom_AppendEscaped(xmlString, chan, attrs->nodeValue, attrs->valueLength, 1, escapeNonASCII, 0, escapeAllQuot); writeChars(xmlString, chan, "\"", 1); attrs = attrs->nextSibling; } hasElements = 0; first = 1; doIndent = 1; if (node->nodeType == ELEMENT_NODE) { cdataChild = 0; if (node->ownerDocument->doctype && node->ownerDocument->doctype->cdataSectionElements) { if (node->namespace) { Tcl_DStringInit (&dStr); Tcl_DStringAppend (&dStr, domNamespaceURI(node), -1); Tcl_DStringAppend (&dStr, ":", 1); domSplitQName (node->nodeName, prefix, &localName); Tcl_DStringAppend (&dStr, localName, -1); h = Tcl_FindHashEntry ( node->ownerDocument->doctype->cdataSectionElements, Tcl_DStringValue (&dStr)); Tcl_DStringFree (&dStr); } else { h = Tcl_FindHashEntry ( node->ownerDocument->doctype->cdataSectionElements, node->nodeName); } if (h) { cdataChild = 1; } } child = node->firstChild; while (child != NULL) { if ( (child->nodeType == ELEMENT_NODE) ||(child->nodeType == PROCESSING_INSTRUCTION_NODE) ||(child->nodeType == COMMENT_NODE) ) { hasElements = 1; } if (first) { writeChars(xmlString, chan, ">", 1); if ((indent != -1) && hasElements) { writeChars(xmlString, chan, "\n", 1); } } first = 0; tcldom_treeAsXML(xmlString, child, indent, level+1, doIndent, chan, escapeNonASCII, doctypeDeclaration, cdataChild, escapeAllQuot); doIndent = 0; if ( (child->nodeType == ELEMENT_NODE) ||(child->nodeType == PROCESSING_INSTRUCTION_NODE) ||(child->nodeType == COMMENT_NODE) ) { doIndent = 1; } child = child->nextSibling; } } if (first) { if (indent != -1) { writeChars(xmlString, chan, "/>\n", 3); } else { writeChars(xmlString, chan, "/>", 2); } } else { if ((indent != -1) && hasElements) { for(i=0; inodeName, -1); if (indent != -1) { writeChars(xmlString, chan, ">\n", 2); } else { writeChars(xmlString, chan, ">", 1); } } } /*---------------------------------------------------------------------------- | findBaseURI | \---------------------------------------------------------------------------*/ const char *findBaseURI ( domNode *node ) { const char *baseURI = NULL; Tcl_HashEntry *entryPtr; domNode *orgNode; orgNode = node; do { if (node->nodeFlags & HAS_BASEURI) { entryPtr = Tcl_FindHashEntry(node->ownerDocument->baseURIs, (char*)node); baseURI = (const char *)Tcl_GetHashValue(entryPtr); break; } else { node = node->parentNode; } } while (node); if (!baseURI) { node = orgNode->ownerDocument->rootNode; if (node->nodeFlags & HAS_BASEURI) { entryPtr = Tcl_FindHashEntry(node->ownerDocument->baseURIs, (char*)node); baseURI = (const char *)Tcl_GetHashValue(entryPtr); } } return baseURI; } /*---------------------------------------------------------------------------- | serializeAsXML | \---------------------------------------------------------------------------*/ static int serializeAsXML ( domNode *node, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ) { char *channelId, prefix[MAX_PREFIX_LEN]; const char *localName; int indent, mode, escapeNonASCII = 0, doctypeDeclaration = 0; int optionIndex, cdataChild, escapeAllQuot = 0; Tcl_Obj *resultPtr; Tcl_Channel chan = (Tcl_Channel) NULL; Tcl_HashEntry *h; Tcl_DString dStr; static CONST84 char *asXMLOptions[] = { "-indent", "-channel", "-escapeNonASCII", "-doctypeDeclaration", "-escapeAllQuot", NULL }; enum asXMLOption { m_indent, m_channel, m_escapeNonASCII, m_doctypeDeclaration, m_escapeAllQuot }; if (objc > 10) { Tcl_WrongNumArgs(interp, 2, objv, "?-indent <0..8>? ?-channel ? " "?-escapeNonASCII? ?-escapeAllQuot? " "?-doctypeDeclaration ?"); return TCL_ERROR; } indent = 4; while (objc > 2) { if (Tcl_GetIndexFromObj(interp, objv[2], asXMLOptions, "option", 0, &optionIndex) != TCL_OK) { return TCL_ERROR; } switch ((enum asXMLOption) optionIndex) { case m_indent: if (objc < 4) { SetResult("-indent must have an argument " "(0..8 or 'no'/'none')"); return TCL_ERROR; } if (strcmp("none", Tcl_GetString(objv[3]))==0) { indent = -1; } else if (strcmp("no", Tcl_GetString(objv[3]))==0) { indent = -1; } else if (Tcl_GetIntFromObj(interp, objv[3], &indent) != TCL_OK) { SetResult( "indent must be an integer (0..8) or 'no'/'none'"); return TCL_ERROR; } objc -= 2; objv += 2; break; case m_channel: if (objc < 4) { SetResult("-channel must have a channeldID as argument"); return TCL_ERROR; } channelId = Tcl_GetString(objv[3]); chan = Tcl_GetChannel(interp, channelId, &mode); if (chan == (Tcl_Channel) NULL) { SetResult("-channel must have a channeldID as argument"); return TCL_ERROR; } if ((mode & TCL_WRITABLE) == 0) { Tcl_AppendResult(interp, "channel \"", channelId, "\" wasn't opened for writing", (char*)NULL); return TCL_ERROR; } objc -= 2; objv += 2; break; case m_escapeNonASCII: escapeNonASCII = 1; objc--; objv++; break; case m_doctypeDeclaration: if (node->nodeType != DOCUMENT_NODE) { SetResult("-doctypeDeclaration as flag to the method " "'asXML' is only allowed for domDocCmds"); return TCL_ERROR; } if (objc < 4) { SetResult("-doctypeDeclaration must have a boolean value " "as argument"); return TCL_ERROR; } if (Tcl_GetBooleanFromObj(interp, objv[3], &doctypeDeclaration) != TCL_OK) { return TCL_ERROR; } objc -= 2; objv += 2; break; case m_escapeAllQuot: escapeAllQuot = 1; objc -= 1; objv += 1; break; } } if (indent > 8) indent = 8; if (indent < -1) indent = -1; resultPtr = Tcl_NewStringObj("", 0); cdataChild = 0; if (node->nodeType == ELEMENT_NODE && node->ownerDocument->doctype && node->ownerDocument->doctype->cdataSectionElements) { if (node->namespace) { Tcl_DStringInit (&dStr); Tcl_DStringAppend (&dStr, domNamespaceURI(node), -1); Tcl_DStringAppend (&dStr, ":", 1); domSplitQName (node->nodeName, prefix, &localName); Tcl_DStringAppend (&dStr, localName, -1); h = Tcl_FindHashEntry ( node->ownerDocument->doctype->cdataSectionElements, Tcl_DStringValue (&dStr)); Tcl_DStringFree (&dStr); } else { h = Tcl_FindHashEntry ( node->ownerDocument->doctype->cdataSectionElements, node->nodeName); } if (h) { cdataChild = 1; } } tcldom_treeAsXML(resultPtr, node, indent, 0, 1, chan, escapeNonASCII, doctypeDeclaration, cdataChild, escapeAllQuot); Tcl_SetObjResult(interp, resultPtr); return TCL_OK; } /*---------------------------------------------------------------------------- | serializeAsHTML | \---------------------------------------------------------------------------*/ static int serializeAsHTML ( domNode *node, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ) { char *channelId; int optionIndex, mode, escapeNonASCII = 0, htmlEntities = 0; int doctypeDeclaration = 0; Tcl_Obj *resultPtr; Tcl_Channel chan = (Tcl_Channel) NULL; static CONST84 char *asHTMLOptions[] = { "-channel", "-escapeNonASCII", "-htmlEntities", "-doctypeDeclaration", NULL }; enum asHTMLOption { m_channel, m_escapeNonASCII, m_htmlEntities, m_doctypeDeclaration }; if (objc > 8) { Tcl_WrongNumArgs(interp, 2, objv, "?-channel ? ?-escapeNonASCII? " "?-htmlEntities? ?-doctypeDeclaration ?"); return TCL_ERROR; } while (objc > 2) { if (Tcl_GetIndexFromObj(interp, objv[2], asHTMLOptions, "option", 0, &optionIndex) != TCL_OK) { return TCL_ERROR; } switch ((enum asHTMLOption) optionIndex) { case m_channel: if (objc < 4) { SetResult("-channel must have a channeldID as argument"); return TCL_ERROR; } channelId = Tcl_GetString(objv[3]); chan = Tcl_GetChannel(interp, channelId, &mode); if (chan == (Tcl_Channel) NULL) { SetResult("-channel must have a channeldID as argument"); return TCL_ERROR; } if ((mode & TCL_WRITABLE) == 0) { Tcl_AppendResult(interp, "channel \"", channelId, "\" wasn't opened for writing", (char*)NULL); return TCL_ERROR; } objc -= 2; objv += 2; break; case m_escapeNonASCII: escapeNonASCII = 1; objc--; objv++; break; case m_htmlEntities: htmlEntities = 1; objc--; objv++; break; case m_doctypeDeclaration: if (node->nodeType != DOCUMENT_NODE) { SetResult("-doctypeDeclaration as flag to the method " "'asHTML' is only allowed for domDocCmds"); return TCL_ERROR; } if (objc < 4) { SetResult("-doctypeDeclaration must have a boolean value " "as argument"); return TCL_ERROR; } if (Tcl_GetBooleanFromObj(interp, objv[3], &doctypeDeclaration) != TCL_OK) { return TCL_ERROR; } objc -= 2; objv += 2; break; } } resultPtr = Tcl_NewStringObj("", 0); tcldom_treeAsHTML(resultPtr, node, chan, escapeNonASCII, htmlEntities, doctypeDeclaration, 0); Tcl_AppendResult(interp, Tcl_GetString(resultPtr), NULL); Tcl_DecrRefCount(resultPtr); return TCL_OK; } /*---------------------------------------------------------------------------- | cdataSectionElements | \---------------------------------------------------------------------------*/ static int cdataSectionElements ( domDocument *doc, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ) { int result, hnew; Tcl_Obj *resultPtr,*namePtr; Tcl_HashEntry *h; Tcl_HashSearch search; CheckArgs (3,4,0, " cdataSectionElements ?URI:?localname " "?boolean?"); if (objc == 3) { if (Tcl_GetString(objv[2])[0] == '*' && Tcl_GetString(objv[2])[1] == '\0') { Tcl_ResetResult (interp); if (doc->doctype && doc->doctype->cdataSectionElements) { resultPtr = Tcl_GetObjResult (interp); for (h = Tcl_FirstHashEntry ( doc->doctype->cdataSectionElements, &search); h != NULL; h = Tcl_NextHashEntry(&search)) { namePtr = Tcl_NewStringObj ( Tcl_GetHashKey (doc->doctype->cdataSectionElements, h), -1); result = Tcl_ListObjAppendElement (interp, resultPtr, namePtr); if (result != TCL_OK) { Tcl_DecrRefCount(namePtr); return result; } } } return TCL_OK; } if (!doc->doctype || !doc->doctype->cdataSectionElements) { SetBooleanResult (0); } else { if (Tcl_FindHashEntry (doc->doctype->cdataSectionElements, Tcl_GetString (objv[2]))) { SetBooleanResult (1); } else { SetBooleanResult (0); } } } else { if (Tcl_GetBooleanFromObj (interp, objv[3], &result) != TCL_OK) { return TCL_ERROR; } if (result) { if (!doc->doctype) { doc->doctype = (domDocInfo *)MALLOC(sizeof(domDocInfo)); memset(doc->doctype, 0,(sizeof(domDocInfo))); } if (!doc->doctype->cdataSectionElements) { doc->doctype->cdataSectionElements = (Tcl_HashTable *)MALLOC(sizeof(Tcl_HashTable)); Tcl_InitHashTable (doc->doctype->cdataSectionElements, TCL_STRING_KEYS); } Tcl_CreateHashEntry (doc->doctype->cdataSectionElements, Tcl_GetString (objv[2]), &hnew); } else { if (doc->doctype && doc->doctype->cdataSectionElements) { h = Tcl_FindHashEntry (doc->doctype->cdataSectionElements, Tcl_GetString (objv[2])); if (h) { Tcl_DeleteHashEntry (h); if (!doc->doctype->cdataSectionElements->numEntries) { Tcl_DeleteHashTable ( doc->doctype->cdataSectionElements ); FREE (doc->doctype->cdataSectionElements); doc->doctype->cdataSectionElements = NULL; } } } } SetBooleanResult(result); } return TCL_OK; } /*---------------------------------------------------------------------------- | selectNodesNamespaces | \---------------------------------------------------------------------------*/ static int selectNodesNamespaces ( domDocument *doc, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ) { int len, i, result; Tcl_Obj *objPtr, *listPtr; CheckArgs (2,3,2, "?prefixUriList?"); if (objc == 3) { result = Tcl_ListObjLength (interp, objv[2], &len); if (result != TCL_OK || (len % 2) != 0) { SetResult ("The optional argument to the selectNodesNamespaces" " method must be a 'prefix namespace' pairs list"); return TCL_ERROR; } i = 0; if (doc->prefixNSMappings) { while (doc->prefixNSMappings[i]) { FREE (doc->prefixNSMappings[i]); i++; } } if (i < len + 1) { if (doc->prefixNSMappings) FREE (doc->prefixNSMappings); doc->prefixNSMappings = MALLOC (sizeof (char*)*(len+1)); } for (i = 0; i < len; i++) { Tcl_ListObjIndex (interp, objv[2], i, &objPtr); doc->prefixNSMappings[i] = tdomstrdup (Tcl_GetString (objPtr)); } doc->prefixNSMappings[len] = NULL; Tcl_SetObjResult (interp, objv[2]); } else { listPtr = Tcl_NewListObj (0, NULL); i = 0; if (doc->prefixNSMappings) { while (doc->prefixNSMappings[i]) { objPtr = Tcl_NewStringObj (doc->prefixNSMappings[i], -1); Tcl_ListObjAppendElement (interp, listPtr, objPtr); i++; } } Tcl_SetObjResult (interp, listPtr); } return TCL_OK; } /*---------------------------------------------------------------------------- | renameNodes | \---------------------------------------------------------------------------*/ static int renameNodes ( domDocument *doc, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ) { int len, i, hnew; char *errMsg; Tcl_HashEntry *h; Tcl_Obj *objPtr; domNode *node; CheckArgs (4,4,0, " renameNode nodeList name"); if (Tcl_ListObjLength (interp, objv[2], &len) != TCL_OK) { SetResult ("The first argument to the renameNode method" " must be a list of element nodes."); return TCL_ERROR; } h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_tagNames), Tcl_GetString(objv[3]), &hnew); for (i = 0; i < len; i++) { Tcl_ListObjIndex (interp, objv[2], i, &objPtr); node = tcldom_getNodeFromName (interp, Tcl_GetString (objPtr), &errMsg); if (node == NULL) { SetResult (errMsg); if (errMsg) FREE (errMsg); return TCL_ERROR; } node->nodeName = (char *)&(h->key); } return TCL_OK; } /*---------------------------------------------------------------------------- | deleteXPathCache | \---------------------------------------------------------------------------*/ static int deleteXPathCache ( domDocument *doc, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ) { Tcl_HashEntry *h; Tcl_HashSearch search; CheckArgs (2,3,0, " deleteXPathCache ?xpathQuery?"); if (objc == 3) { if (!doc->xpathCache) { return TCL_OK; } h = Tcl_FindHashEntry (doc->xpathCache, Tcl_GetString(objv[2])); if (h) { xpathFreeAst((ast)Tcl_GetHashValue (h)); Tcl_DeleteHashEntry (h); } return TCL_OK; } if (!doc->xpathCache) { return TCL_OK; } h = Tcl_FirstHashEntry (doc->xpathCache, &search); while (h) { xpathFreeAst((ast)Tcl_GetHashValue (h)); h = Tcl_NextHashEntry (&search); } Tcl_DeleteHashTable (doc->xpathCache); FREE (doc->xpathCache); doc->xpathCache = NULL; return TCL_OK; } /*---------------------------------------------------------------------------- | applyXSLT | \---------------------------------------------------------------------------*/ static int applyXSLT ( domNode *node, Tcl_Interp *interp, void *clientData, int objc, Tcl_Obj *CONST objv[] ) { char *usage, **parameters = NULL, *errMsg, *option; Tcl_Obj *objPtr, *localListPtr = (Tcl_Obj *)NULL; int i, result, length, optionIndex; int ignoreUndeclaredParameters = 0; domDocument *xsltDoc, *xmlDoc, *resultDoc; XsltMsgCBInfo xsltMsgInfo; static char *method_usage = "wrong # args: should be \"nodeObj xslt ?-parameters parameterList? " "?-ignoreUndeclaredParameters? ?-xsltmessagecmd cmd? xsltDocNode " "?varname?\""; static char *cmd_usage = "wrong # args: should be \"?-parameters parameterList? " "?-ignoreUndeclaredParameters? ?-xsltmessagecmd cmd? " "?objVar?\""; static CONST84 char *xsltOptions[] = { "-parameters", "-ignoreUndeclaredParameters", "-xsltmessagecmd", NULL }; enum xsltOption { m_parmeters, m_ignoreUndeclaredParameters, m_xsltmessagecmd }; xsltMsgInfo.interp = interp; xsltMsgInfo.msgcmd = NULL; if (node) usage = method_usage; else usage = cmd_usage; while (objc > 1) { option = Tcl_GetString(objv[0]); if (option[0] != '-') { break; } if (Tcl_GetIndexFromObj(interp, objv[0], xsltOptions, "option", 0, &optionIndex) != TCL_OK) { goto applyXSLTCleanUP; } switch ((enum xsltOption) optionIndex) { case m_parmeters: if (objc < 3) {SetResult(usage); goto applyXSLTCleanUP;} if (Tcl_ListObjLength(interp, objv[1], &length) != TCL_OK) { SetResult("ill-formed parameters list: the -parameters " "option needs a list of parameter name and " "parameter value pairs"); goto applyXSLTCleanUP; } if (length % 2) { SetResult("parameter value missing: the -parameters " "option needs a list of parameter name and " "parameter value pairs"); goto applyXSLTCleanUP; } if (parameters) { SetResult("only one -parameters option allowed"); goto applyXSLTCleanUP; } localListPtr = Tcl_DuplicateObj(objv[1]); Tcl_IncrRefCount(localListPtr); parameters = (char **)MALLOC(sizeof(char *)*(length+1)); for (i = 0; i < length; i ++) { Tcl_ListObjIndex(interp, localListPtr, i, &objPtr); parameters[i] = Tcl_GetString(objPtr); } parameters[length] = NULL; objc -= 2; objv += 2; break; case m_ignoreUndeclaredParameters: if (objc < 2) {SetResult(usage); goto applyXSLTCleanUP;} ignoreUndeclaredParameters = 1; objc--; objv++; break; case m_xsltmessagecmd: if (objc < 3) {SetResult(usage); goto applyXSLTCleanUP;} if (xsltMsgInfo.msgcmd) { Tcl_DecrRefCount(xsltMsgInfo.msgcmd); } xsltMsgInfo.msgcmd = objv[1]; Tcl_IncrRefCount(xsltMsgInfo.msgcmd); objc -= 2; objv += 2; break; } } if (objc > 2 || objc < 1) {SetResult(usage); goto applyXSLTCleanUP;} if (node) { xsltDoc = tcldom_getDocumentFromName(interp, Tcl_GetString(objv[0]), &errMsg); if (xsltDoc == NULL) { SetResult( errMsg ); goto applyXSLTCleanUP; } } else { xmlDoc = tcldom_getDocumentFromName(interp,Tcl_GetString(objv[0]), &errMsg); if (xmlDoc == NULL) { SetResult( errMsg ); goto applyXSLTCleanUP; } node = (domNode *) xmlDoc; xsltDoc = NULL; } result = xsltProcess(xsltDoc, node, clientData, parameters, ignoreUndeclaredParameters, tcldom_xpathFuncCallBack, interp, tcldom_xsltMsgCB, &xsltMsgInfo, &errMsg, &resultDoc); if (result < 0) { SetResult( errMsg ); FREE(errMsg); goto applyXSLTCleanUP; } if (parameters) { Tcl_DecrRefCount(localListPtr); FREE((char *) parameters); } if (xsltMsgInfo.msgcmd) { Tcl_DecrRefCount(xsltMsgInfo.msgcmd); } return tcldom_returnDocumentObj(interp, resultDoc, (objc == 2), (objc == 2) ? objv[1] : NULL, 1, 0); applyXSLTCleanUP: if (localListPtr) { Tcl_DecrRefCount(localListPtr); FREE((char *) parameters); } if (xsltMsgInfo.msgcmd) { Tcl_DecrRefCount(xsltMsgInfo.msgcmd); } return TCL_ERROR; } /*---------------------------------------------------------------------------- | tcldom_XSLTObjCmd | \---------------------------------------------------------------------------*/ static int tcldom_XSLTObjCmd ( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ) { int index; char *errMsg = NULL; static CONST84 char *options[] = { "transform", "delete", NULL }; enum option { m_transform, m_delete }; /* Longest possible call currently is: xsltCmd transform -parameters parameterList \ -ignoreUndeclaredParameters -xsltmessagecmd cmd objVar */ CheckArgs(2,9,1,"option ?arg ...?"); /* This is not optimal, because we do the tcldom_getDocumentFromName call here and again in applyXSLT. This is only transitional, until will be deprecated */ if ((tcldom_getDocumentFromName (interp, Tcl_GetString(objv[1]), &errMsg) != NULL) || (Tcl_GetString (objv[1])[0] == '-')) { /* Method obmitted, may default to "transform", try this */ objv++; objc--; return applyXSLT(NULL, interp, (void *) clientData, objc, objv); } if (Tcl_GetIndexFromObj (interp, objv[1], options, "option", 0, &index) != TCL_OK) { return TCL_ERROR; } switch ((enum option) index) { case m_transform: objv++;objv++; objc--;objc--; return applyXSLT(NULL, interp, (void *) clientData, objc, objv); case m_delete: if (objc != 2) { Tcl_WrongNumArgs(interp, 2, objv, ""); return TCL_ERROR; } Tcl_DeleteCommand(interp, Tcl_GetString(objv[0])); } return TCL_OK; } /*---------------------------------------------------------------------------- | convertToXSLTCmd | \---------------------------------------------------------------------------*/ static int convertToXSLTCmd ( domDocument *doc, Tcl_Interp *interp, int setVariable, Tcl_Obj *var_name ) { char *errMsg, *objVar, objCmdName[80]; ClientData *clientData; doc->nodeFlags |= DONT_FREE; clientData = (ClientData *) xsltCompileStylesheet(doc, tcldom_xpathFuncCallBack, interp, 0, &errMsg); if (!clientData) { SetResult(errMsg); if (setVariable) { objVar = Tcl_GetString(var_name); Tcl_UnsetVar(interp, objVar, 0); Tcl_SetVar (interp, objVar, "", 0); } FREE(errMsg); return TCL_ERROR; } DOC_CMD(objCmdName, doc); Tcl_DeleteCommand( interp, objCmdName ); XSLT_CMD(objCmdName, doc); Tcl_CreateObjCommand(interp, objCmdName, tcldom_XSLTObjCmd, clientData, xsltFreeStateWrapper); if (setVariable) { objVar = Tcl_GetString(var_name); Tcl_UnsetVar (interp, objVar, 0); Tcl_SetVar (interp, objVar, objCmdName, 0); } SetResult(objCmdName); return TCL_OK; } /*---------------------------------------------------------------------------- | tcldom_NodeObjCmd | \---------------------------------------------------------------------------*/ int tcldom_NodeObjCmd ( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ) { GetTcldomTSD() domNode *node, *child, *refChild, *oldChild, *refNode; domNS *ns; domAttrNode *attrs; domException exception; char tmp[200], objCmdName[80], prefix[MAX_PREFIX_LEN], *method, *nodeName, *str, *attr_name, *attr_val, *filter, *errMsg; const char *localName, *uri, *nsStr; int result, length, methodIndex, i, line, column; int nsIndex, bool, hnew; Tcl_Obj *namePtr, *resultPtr; Tcl_Obj *mobjv[MAX_REWRITE_ARGS]; Tcl_CmdInfo cmdInfo; Tcl_HashEntry *h; static CONST84 char *nodeMethods[] = { "firstChild", "nextSibling", "getAttribute", "nodeName", "nodeValue", "nodeType", "attributes", "asList", "find", "setAttribute", "removeAttribute", "parentNode", "previousSibling", "lastChild", "appendChild", "removeChild", "hasChildNodes", "localName", "childNodes", "ownerDocument", "insertBefore", "replaceChild", "getLine", "getColumn", "asXML", "appendFromList", "child", "fsibling", "psibling", "descendant", "ancestor", "text", "root", "hasAttribute", "cloneNode", "appendXML", "target", "data", "selectNodes", "namespaceURI", "getAttributeNS", "setAttributeNS", "hasAttributeNS", "removeAttributeNS", "asHTML", "prefix", "getBaseURI", "appendFromScript", "xslt", "toXPath", "delete", "getElementById", "getElementsByTagName", "getElementsByTagNameNS", "disableOutputEscaping", "precedes", "asText", "insertBeforeFromScript", "normalize", "baseURI", #ifdef TCL_THREADS "readlock", "writelock", #endif NULL }; enum nodeMethod { m_firstChild, m_nextSibling, m_getAttribute, m_nodeName, m_nodeValue, m_nodeType, m_attributes, m_asList, m_find, m_setAttribute, m_removeAttribute, m_parentNode, m_previousSibling, m_lastChild, m_appendChild, m_removeChild, m_hasChildNodes, m_localName, m_childNodes, m_ownerDocument, m_insertBefore, m_replaceChild, m_getLine, m_getColumn, m_asXML, m_appendFromList, m_child, m_fsibling, m_psibling, m_descendant, m_ancestor, m_text, m_root, m_hasAttribute, m_cloneNode, m_appendXML, m_target, m_data, m_selectNodes, m_namespaceURI, m_getAttributeNS, m_setAttributeNS, m_hasAttributeNS, m_removeAttributeNS, m_asHTML, m_prefix, m_getBaseURI, m_appendFromScript, m_xslt, m_toXPath, m_delete, m_getElementById, m_getElementsByTagName, m_getElementsByTagNameNS, m_disableOutputEscaping, m_precedes, m_asText, m_insertBeforeFromScript, m_normalize, m_baseURI #ifdef TCL_THREADS ,m_readlock, m_writelock #endif }; node = (domNode*) clientData; if (TSD(domCreateCmdMode) == DOM_CREATECMDMODE_AUTO) { TSD(dontCreateObjCommands) = 0; } if (node == NULL) { if (objc < 3) { SetResult(node_usage); return TCL_ERROR; } if (TSD(domCreateCmdMode) == DOM_CREATECMDMODE_AUTO) { TSD(dontCreateObjCommands) = 1; } nodeName = Tcl_GetString(objv[1]); node = tcldom_getNodeFromName(interp, nodeName, &errMsg); if (node == NULL) { SetResult(errMsg); return TCL_ERROR; } objc--; objv++; } if (objc < 2) { SetResult(node_usage); return TCL_ERROR; } if (Tcl_GetIndexFromObj(NULL, objv[1], nodeMethods, "method", 0, &methodIndex) != TCL_OK) { method = Tcl_GetString(objv[1]); if (*method != '@') { /*-------------------------------------------------------- | not a getAttribute short cut: | try to find method implemented as normal Tcl proc \-------------------------------------------------------*/ result = 0; if (node->nodeType == ELEMENT_NODE) { /*---------------------------------------------------- | try to find Tcl level node specific method proc | | ::dom::domNode:::: | \---------------------------------------------------*/ sprintf(tmp, "::dom::domNode::%s::%s", (char*)node->nodeName, method); DBG(fprintf(stderr, "testing %s\n", tmp)); result = Tcl_GetCommandInfo(interp, tmp, &cmdInfo); } if (!result) { /*---------------------------------------------------- | try to find Tcl level general method proc | | ::dom::domNode:: | \---------------------------------------------------*/ sprintf(tmp, "::dom::domNode::%s", method); DBG(fprintf(stderr, "testing %s\n", tmp)); result = Tcl_GetCommandInfo(interp, tmp, &cmdInfo); } if (!result) { SetResult(node_usage); return TCL_ERROR; } if (!cmdInfo.isNativeObjectProc) { SetResult("can't access Tcl level method!"); return TCL_ERROR; } if (objc >= MAX_REWRITE_ARGS) { SetResult("too many args to call Tcl level method!"); return TCL_ERROR; } mobjv[0] = objv[1]; mobjv[1] = objv[0]; for (i=2; i: try to look up attribute \-------------------------------------------------------*/ Tcl_ResetResult(interp); CheckArgs(2,3,1,"@ ?defaultvalue?"); if (node->nodeType != ELEMENT_NODE) { SetResult("NOT_AN_ELEMENT : there are no attributes"); return TCL_ERROR; } attrs = node->firstAttr; while (attrs && strcmp(attrs->nodeName, &(method[1]))) { attrs = attrs->nextSibling; } if (attrs) { SetResult(attrs->nodeValue); } else { if (objc == 3) { SetResult(Tcl_GetString(objv[2])); } else { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "Attribute \"", &(method[1]), "\" not found!", NULL); return TCL_ERROR; } } return TCL_OK; } /*---------------------------------------------------------------------- | node may have been deleted in the meantime by some other | thread operating on the tree, so check this fact before. | \---------------------------------------------------------------------*/ if (node->nodeFlags & IS_DELETED) { SetResult("node has been deleted"); return TCL_ERROR; } /*---------------------------------------------------------------------- | dispatch the node object method | \---------------------------------------------------------------------*/ switch ((enum nodeMethod)methodIndex) { case m_toXPath: CheckArgs(2,2,2,""); str = xpathNodeToXPath(node); SetResult (str); FREE (str); return TCL_OK; case m_xslt: CheckArgs(3,9,2, "?-parameters parameterList? " "?-ignoreUndeclaredParameters? ?-xsltmessagecmd cmd? " " ?objVar?"); objv += 2; objc -= 2; return applyXSLT(node, interp, NULL, objc, objv); case m_selectNodes: return tcldom_selectNodes (interp, node, --objc, ++objv); case m_find: CheckArgs(4,5,2,"attrName attrVal ?nodeObjVar?"); attr_name = Tcl_GetStringFromObj(objv[2], NULL); attr_val = Tcl_GetStringFromObj(objv[3], &length); return tcldom_returnNodeObj (interp, tcldom_find(node, attr_name, attr_val, length), (objc == 5), (objc == 5) ? objv[4] : NULL); case m_child: CheckArgs(3,6,2,"instance|all ?type? ?attr value?"); return tcldom_xpointerSearch(interp, XP_CHILD, node, objc, objv); case m_descendant: CheckArgs(3,6,2,"instance|all ?type? ?attr value?"); return tcldom_xpointerSearch(interp, XP_DESCENDANT,node,objc,objv); case m_ancestor: CheckArgs(3,6,2,"instance|all ?type? ?attr value?"); return tcldom_xpointerSearch(interp, XP_ANCESTOR, node,objc,objv); case m_fsibling: CheckArgs(3,6,2,"instance|all ?type? ?attr value?"); return tcldom_xpointerSearch(interp, XP_FSIBLING, node,objc,objv); case m_psibling: CheckArgs(3,6,2,"instance|all ?type? ?attr value?"); return tcldom_xpointerSearch(interp, XP_PSIBLING, node,objc,objv); case m_root: CheckArgs(2,3,2,"?nodeObjVar?"); while (node->parentNode) { node = node->parentNode; } return tcldom_returnNodeObj(interp, node, (objc == 3), (objc == 3) ? objv[2] : NULL); case m_text: CheckArgs(2,2,2,""); if (node->nodeType != ELEMENT_NODE) { SetResult("NOT_AN_ELEMENT"); return TCL_ERROR; } Tcl_ResetResult(interp); child = node->firstChild; while (child) { if ((child->nodeType == TEXT_NODE) || (child->nodeType == CDATA_SECTION_NODE)) { Tcl_AppendToObj(Tcl_GetObjResult(interp), ((domTextNode*)child)->nodeValue, ((domTextNode*)child)->valueLength); } child = child->nextSibling; } return TCL_OK; case m_attributes: CheckArgs(2,3,2,"?nameFilter?"); if (node->nodeType != ELEMENT_NODE) { SetResult(""); return TCL_OK; } if (objc == 3) { filter = Tcl_GetString(objv[2]); } else { filter = "*"; } Tcl_ResetResult(interp); resultPtr = Tcl_GetObjResult(interp); attrs = node->firstAttr; while (attrs != NULL) { if (Tcl_StringMatch((char*)attrs->nodeName, filter)) { if (attrs->namespace == 0) { namePtr = Tcl_NewStringObj((char*)attrs->nodeName, -1); } else { domSplitQName((char*)attrs->nodeName, prefix, &localName); mobjv[0] = Tcl_NewStringObj((char*)localName, -1); mobjv[1] = Tcl_NewStringObj( domNamespacePrefix((domNode*)attrs), -1 ); mobjv[2] = Tcl_NewStringObj( domNamespaceURI((domNode*)attrs), -1 ); namePtr = Tcl_NewListObj(3, mobjv); } result = Tcl_ListObjAppendElement(interp, resultPtr, namePtr); if (result != TCL_OK) { Tcl_DecrRefCount(namePtr); return result; } } attrs = attrs->nextSibling; } break; case m_asList: CheckArgs(2,2,2,""); Tcl_SetObjResult(interp, tcldom_treeAsTclList(interp, node)); break; case m_asXML: Tcl_ResetResult(interp); if (serializeAsXML(node, interp, objc, objv) != TCL_OK) { return TCL_ERROR; } break; case m_asHTML: Tcl_ResetResult(interp); if (serializeAsHTML(node, interp, objc, objv) != TCL_OK) { return TCL_ERROR; } break; case m_getAttribute: CheckArgs(3,4,2,"attrName ?defaultValue?"); if (node->nodeType != ELEMENT_NODE) { SetResult("NOT_AN_ELEMENT : there are no attributes"); return TCL_ERROR; } attr_name = Tcl_GetString(objv[2]); attrs = node->firstAttr; while(attrs && strcmp(attrs->nodeName, attr_name)) { attrs = attrs->nextSibling; } if (attrs) { SetResult(attrs->nodeValue); return TCL_OK; } if (objc == 4) { SetResult(Tcl_GetString(objv[3])); return TCL_OK; } else { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "Attribute \"", attr_name, "\" not found!", NULL); return TCL_ERROR; } break; case m_getAttributeNS: CheckArgs(4,4,2,"uri localName"); if (node->nodeType != ELEMENT_NODE) { SetResult("NOT_AN_ELEMENT : there are no attributes"); return TCL_ERROR; } uri = Tcl_GetString(objv[2]); localName = Tcl_GetString(objv[3]); attrs = domGetAttributeNodeNS(node, uri, localName); if (attrs) { SetResult(attrs->nodeValue); return TCL_OK; } sprintf(tmp,"attribute with localName %80.80s not found!",localName); SetResult(tmp); return TCL_ERROR; case m_setAttribute: if (node->nodeType != ELEMENT_NODE) { SetResult("NOT_AN_ELEMENT : there are no attributes"); return TCL_ERROR; } if ((objc < 4) || ((objc % 2)!=0)) { SetResult("attrName value pairs expected"); return TCL_ERROR; } for ( i = 2; i < objc; ) { attr_name = Tcl_GetString(objv[i++]); CheckName (interp, attr_name, "attribute", 0); attr_val = Tcl_GetString(objv[i++]); CheckText (interp, attr_val, "attribute"); domSetAttribute(node, attr_name, attr_val); } return tcldom_returnNodeObj(interp, node, 0, NULL); case m_setAttributeNS: if (node->nodeType != ELEMENT_NODE) { SetResult("NOT_AN_ELEMENT : there are no attributes"); return TCL_ERROR; } if ((objc < 5) || (((objc - 2) % 3) != 0)) { SetResult("uri attrName value triples expected"); return TCL_ERROR; } for (i = 2; i < objc;) { uri = Tcl_GetString(objv[i++]); attr_name = Tcl_GetString(objv[i++]); CheckName (interp, attr_name, "full qualified attribute", 1); attr_val = Tcl_GetString(objv[i++]); CheckText (interp, attr_val, "attribute"); attrs = domSetAttributeNS(node, attr_name, attr_val, uri, 0); if (!attrs) { if (uri[0]) { SetResult("An attribute in a namespace " "must have a prefix"); } else { SetResult("For all prefixed attributes with prefixes " "other than 'xml' or 'xmlns' " "you have to provide a namespace URI"); } return TCL_ERROR; } } return tcldom_returnNodeObj(interp, node, 0, NULL); case m_hasAttribute: CheckArgs(3,3,2,"attrName"); if (node->nodeType != ELEMENT_NODE) { SetResult("NOT_AN_ELEMENT : there are no attributes"); return TCL_ERROR; } attr_name = Tcl_GetString(objv[2]); attrs = node->firstAttr; while (attrs && strcmp(attrs->nodeName, attr_name)) { attrs = attrs->nextSibling; } if (attrs) { SetResult("1"); return TCL_OK; } SetResult("0"); return TCL_OK; case m_hasAttributeNS: CheckArgs(4,4,2,"uri localName"); if (node->nodeType != ELEMENT_NODE) { SetResult("NOT_AN_ELEMENT : there are no attributes"); return TCL_ERROR; } uri = Tcl_GetString(objv[2]); localName = Tcl_GetString(objv[3]); attrs = node->firstAttr; while (attrs) { domSplitQName(attrs->nodeName, prefix, &nsStr); if (!strcmp(localName,nsStr)) { ns = domGetNamespaceByIndex(node->ownerDocument, attrs->namespace); if (ns && !strcmp(ns->uri, uri)) { SetResult("1"); return TCL_OK; } } attrs = attrs->nextSibling; } SetResult("0"); return TCL_OK; case m_removeAttribute: CheckArgs(3,3,2,"attrName"); if (node->nodeType != ELEMENT_NODE) { SetResult("NOT_AN_ELEMENT : there are no attributes"); return TCL_ERROR; } attr_name = Tcl_GetString(objv[2]); result = domRemoveAttribute(node, attr_name); if (result) { SetResult("can't remove attribute '"); AppendResult(attr_name); AppendResult("'"); return TCL_ERROR; } return tcldom_returnNodeObj(interp, node, 0, NULL); case m_removeAttributeNS: CheckArgs(4,4,2,"uri attrName"); if (node->nodeType != ELEMENT_NODE) { SetResult("NOT_AN_ELEMENT : there are no attributes"); return TCL_ERROR; } uri = Tcl_GetString(objv[2]); localName = Tcl_GetString(objv[3]); result = domRemoveAttributeNS(node, uri, localName); if (result < 0) { SetResult("can't remove attribute with localName '"); AppendResult(localName); AppendResult("'"); return TCL_ERROR; } return tcldom_returnNodeObj(interp, node, 0, NULL); case m_nextSibling: CheckArgs(2,3,2,"?nodeObjVar?"); return tcldom_returnNodeObj(interp, node->nextSibling, (objc == 3), (objc == 3) ? objv[2] : NULL); case m_previousSibling: CheckArgs(2,3,2,"?nodeObjVar?"); return tcldom_returnNodeObj(interp, node->previousSibling, (objc == 3), (objc == 3) ? objv[2] : NULL); case m_firstChild: CheckArgs(2,3,2,"?nodeObjVar?"); if (node->nodeType == ELEMENT_NODE) { return tcldom_returnNodeObj(interp, node->firstChild, (objc == 3), (objc == 3) ? objv[2] : NULL); } return tcldom_returnNodeObj(interp, NULL, (objc == 3), (objc == 3) ? objv[2] : NULL); case m_lastChild: CheckArgs(2,3,2,"?nodeObjVar?"); if (node->nodeType == ELEMENT_NODE) { return tcldom_returnNodeObj(interp, node->lastChild, (objc == 3), (objc == 3) ? objv[2] : NULL); } return tcldom_returnNodeObj(interp, NULL, (objc == 3), (objc == 3) ? objv[2] : NULL); case m_parentNode: CheckArgs(2,3,2,"?nodeObjVar?"); return tcldom_returnNodeObj(interp, node->parentNode, (objc == 3), (objc == 3) ? objv[2] : NULL); case m_appendFromList: CheckArgs(3,3,2,"list"); return tcldom_appendFromTclList(interp, node, objv[2]); case m_appendFromScript: CheckArgs(3,3,2,"script"); if (nodecmd_appendFromScript(interp, node, objv[2]) != TCL_OK) { return TCL_ERROR; } return tcldom_returnNodeObj(interp, node, 0, NULL); case m_insertBeforeFromScript: CheckArgs(4,4,2, "script refChild"); nodeName = Tcl_GetString (objv[3]); if (nodeName[0] == '\0') { refChild = NULL; } else { refChild = tcldom_getNodeFromName (interp, nodeName, &errMsg); if (refChild == NULL) { SetResult ( errMsg ); return TCL_ERROR; } } if (nodecmd_insertBeforeFromScript(interp, node, objv[2], refChild) != TCL_OK) { return TCL_ERROR; } return tcldom_returnNodeObj (interp, node, 0, NULL); case m_appendXML: CheckArgs(3,3,2,"xmlString"); return tcldom_appendXML(interp, node, objv[2]); case m_appendChild: CheckArgs(3,3,2,"nodeToAppend"); nodeName = Tcl_GetString(objv[2]); child = tcldom_getNodeFromName(interp, nodeName, &errMsg); if (child == NULL) { SetResult(errMsg); return TCL_ERROR; } exception = domAppendChild (node, child); if (exception != OK) { SetResult(domException2String(exception)); return TCL_ERROR; } return tcldom_returnNodeObj(interp, child, 0, NULL); case m_cloneNode: CheckArgs(2,3,2,"?-deep?"); if (objc == 3) { if (!strcmp(Tcl_GetString(objv[2]), "-deep")) { return tcldom_returnNodeObj(interp, domCloneNode(node, 1), 0, NULL); } SetResult("unknown option! Options: ?-deep? "); return TCL_ERROR; } return tcldom_returnNodeObj(interp, domCloneNode(node, 0), 0, NULL); case m_removeChild: CheckArgs(3,3,2,"childToRemove"); nodeName = Tcl_GetString(objv[2]); child = tcldom_getNodeFromName(interp, nodeName, &errMsg); if (child == NULL) { SetResult(errMsg); return TCL_ERROR; } exception = domRemoveChild (node, child); if (exception != OK) { SetResult (domException2String (exception)); return TCL_ERROR; } return tcldom_returnNodeObj(interp, child, 0, NULL); case m_insertBefore: CheckArgs(4,4,2,"childToInsert refChild"); nodeName = Tcl_GetString(objv[2]); child = tcldom_getNodeFromName(interp, nodeName, &errMsg); if (child == NULL) { SetResult(errMsg); return TCL_ERROR; } nodeName = Tcl_GetString (objv[3]); if (nodeName[0] == '\0') { refChild = NULL; } else { refChild = tcldom_getNodeFromName (interp, nodeName, &errMsg); if (refChild == NULL) { SetResult ( errMsg ); return TCL_ERROR; } } exception = domInsertBefore(node, child, refChild); if (exception != OK) { SetResult(domException2String(exception)); return TCL_ERROR; } return tcldom_returnNodeObj(interp, child, 0, NULL); case m_replaceChild: CheckArgs(4,4,2,"new old"); nodeName = Tcl_GetString(objv[2]); child = tcldom_getNodeFromName(interp, nodeName, &errMsg); if (child == NULL) { SetResult(errMsg); return TCL_ERROR; } nodeName = Tcl_GetString(objv[3]); oldChild = tcldom_getNodeFromName(interp, nodeName, &errMsg); if (oldChild == NULL) { SetResult(errMsg); return TCL_ERROR; } exception = domReplaceChild(node, child, oldChild); if (exception != OK) { SetResult(domException2String(exception)); return TCL_ERROR; } return tcldom_returnNodeObj(interp, oldChild, 0, NULL); case m_hasChildNodes: CheckArgs(2,2,2,""); if (node->nodeType == ELEMENT_NODE) { SetIntResult(node->firstChild ? 1 : 0); } else { SetIntResult(0); } break; case m_childNodes: CheckArgs(2,2,2,""); resultPtr = Tcl_GetObjResult(interp); if (node->nodeType == ELEMENT_NODE) { child = node->firstChild; while (child != NULL) { tcldom_createNodeObj(interp, child, objCmdName); namePtr = Tcl_NewStringObj(objCmdName, -1); result = Tcl_ListObjAppendElement(interp, resultPtr, namePtr); if (result != TCL_OK) { Tcl_DecrRefCount(namePtr); return result; } child = child->nextSibling; } } break; case m_getElementsByTagName: CheckArgs(3,3,2,"elementName"); if (node->nodeType != ELEMENT_NODE) { SetResult("Node must be an element node."); return TCL_ERROR; } Tcl_ResetResult(interp); return tcldom_getElementsByTagName(interp, Tcl_GetString(objv[2]), node->firstChild, -1, NULL); case m_getElementsByTagNameNS: CheckArgs(4,4,2,"uri localname"); if (node->nodeType != ELEMENT_NODE) { SetResult("Node must be an element node."); return TCL_ERROR; } uri = Tcl_GetString(objv[2]); str = Tcl_GetString(objv[3]); nsIndex = -1; if (uri[0] == '*' && uri[1] == '\0') { nsIndex = -3; } else if (uri[0] == '\0') { /* all elements not in a namespace */ nsIndex = -4; } else { for (i = 0; i <= node->ownerDocument->nsptr; i++) { if (strcmp (node->ownerDocument->namespaces[i]->uri, uri)==0) { if (nsIndex != -1) { /* OK, this is one of the 'degenerated' (though legal) documents, which bind the same URI to different prefixes. */ nsIndex = -2; break; } nsIndex = node->ownerDocument->namespaces[i]->index; } } } if (nsIndex == -1) { /* There isn't such a namespace declared in this document. Since getElementsByTagNameNS doesn't raise an execption short cut: return empty result */ Tcl_ResetResult(interp); return TCL_OK; } return tcldom_getElementsByTagName(interp, str, node->firstChild, nsIndex, uri); case m_getElementById: CheckArgs(3,3,2,"id"); if (node->ownerDocument->ids) { str = Tcl_GetString(objv[2]); h = Tcl_FindHashEntry(node->ownerDocument->ids, str); if (h) { domNode *node = Tcl_GetHashValue(h); return tcldom_returnNodeObj(interp, node, 0, NULL); } } SetResult(""); return TCL_OK; case m_nodeName: CheckArgs(2,2,2,""); if (node->nodeType == ELEMENT_NODE) { SetResult((char*)node->nodeName); } else if (node->nodeType == TEXT_NODE) { SetResult("#text"); } else if (node->nodeType == PROCESSING_INSTRUCTION_NODE) { domProcessingInstructionNode *dpn; dpn = (domProcessingInstructionNode *)node; Tcl_SetStringObj(Tcl_GetObjResult(interp), dpn->targetValue, dpn->targetLength); } else if (node->nodeType == COMMENT_NODE) { SetResult("#comment"); } else if (node->nodeType == CDATA_SECTION_NODE) { SetResult("#cdata-section"); } else { SetResult(""); } break; case m_nodeValue: CheckArgs(2,3,2,"?newValue?"); if (node->nodeType == ELEMENT_NODE) { Tcl_SetStringObj(Tcl_GetObjResult(interp), "", 0); } else if (node->nodeType == PROCESSING_INSTRUCTION_NODE) { domProcessingInstructionNode *dpn; dpn = (domProcessingInstructionNode *)node; Tcl_SetStringObj(Tcl_GetObjResult(interp), dpn->dataValue, dpn->dataLength); } else { domTextNode *dtn; dtn = (domTextNode*)node; Tcl_SetStringObj(Tcl_GetObjResult(interp), dtn->nodeValue, dtn->valueLength); } if (objc == 3) { str = Tcl_GetStringFromObj(objv[2], &length); switch (node->nodeType) { case TEXT_NODE: CheckText (interp, str, "text"); break; case COMMENT_NODE: CheckComment (interp, str); break; case CDATA_SECTION_NODE: CheckCDATA (interp, str); break; default: break; /* Do nothing */ } exception = domSetNodeValue(node, str, length); if (exception != OK) { SetResult(domException2String(exception)); return TCL_ERROR; } } break; case m_nodeType: CheckArgs(2,2,2,""); switch (node->nodeType) { case ELEMENT_NODE: SetResult("ELEMENT_NODE"); break; case ATTRIBUTE_NODE: SetResult("ATTRIBUTE_NODE"); break; case TEXT_NODE: SetResult("TEXT_NODE"); break; case CDATA_SECTION_NODE: SetResult("CDATA_SECTION_NODE"); break; case COMMENT_NODE: SetResult("COMMENT_NODE"); break; case PROCESSING_INSTRUCTION_NODE: SetResult("PROCESSING_INSTRUCTION_NODE"); break; default: SetResult("unknown nodeType!"); return TCL_ERROR; } break; case m_prefix: CheckArgs(2,2,2,""); nsStr = domNamespacePrefix(node); if (nsStr) { SetResult(nsStr); } else { SetResult(""); } return TCL_OK; case m_namespaceURI: CheckArgs(2,2,2,""); nsStr = domNamespaceURI(node); if (nsStr) { SetResult(nsStr); } else { SetResult(""); } return TCL_OK; case m_localName: CheckArgs(2,2,2,""); if (node->nodeType == ELEMENT_NODE) { if (node->namespace != 0) { SetResult(domGetLocalName((char*)node->nodeName)); break; } } SetResult(""); break; case m_ownerDocument: CheckArgs(2,3,2,"?docObjVar?"); return tcldom_returnDocumentObj(interp, node->ownerDocument, (objc == 3), (objc == 3) ? objv[2] : NULL, 0, 1); case m_target: CheckArgs(2,2,2,""); if (node->nodeType != PROCESSING_INSTRUCTION_NODE) { SetResult("not a PROCESSING_INSTRUCTION_NODE!"); return TCL_ERROR; } else { domProcessingInstructionNode *dpn; dpn = (domProcessingInstructionNode *)node; Tcl_SetStringObj(Tcl_GetObjResult(interp), dpn->targetValue, dpn->targetLength); } break; case m_delete: CheckArgs(2,2,2,""); domDeleteNode(node, tcldom_deleteNode, interp); break; case m_data: CheckArgs(2,2,2,""); if (node->nodeType == PROCESSING_INSTRUCTION_NODE) { domProcessingInstructionNode *dpn; dpn = (domProcessingInstructionNode*)node; Tcl_SetStringObj(Tcl_GetObjResult(interp), dpn->dataValue, dpn->dataLength); } else if ( node->nodeType == TEXT_NODE || node->nodeType == CDATA_SECTION_NODE || node->nodeType == COMMENT_NODE) { domTextNode *dtn; dtn = (domTextNode*)node; Tcl_SetStringObj(Tcl_GetObjResult(interp), dtn->nodeValue, dtn->valueLength); } else { SetResult("not a " "TEXT_NODE / " "CDATA_SECTION_NODE / " "COMMENT_NODE / " "PROCESSING_INSTRUCTION_NODE !"); return TCL_ERROR; } break; case m_getLine: CheckArgs(2,2,2,""); if (domGetLineColumn(node, &line, &column) < 0) { SetResult("no line/column information available!"); return TCL_ERROR; } SetIntResult(line); break; case m_getColumn: CheckArgs(2,2,2,""); if (domGetLineColumn (node, &line, &column) < 0) { SetResult("no line/column information available!"); return TCL_ERROR; } SetIntResult(column); break; case m_getBaseURI: CheckArgs(2,2,2,""); /* fall thru */ case m_baseURI: CheckArgs(2,3,2,"?URI?"); if (objc == 3) { h = Tcl_CreateHashEntry (node->ownerDocument->baseURIs, (char *) node, &hnew); if (!hnew) { FREE (Tcl_GetHashValue (h)); } Tcl_SetHashValue (h, tdomstrdup (Tcl_GetString (objv[2]))); node->nodeFlags |= HAS_BASEURI; SetResult (Tcl_GetString (objv[2])); } else { nsStr = findBaseURI(node); if (!nsStr) { SetResult(""); } else { SetResult(nsStr); } } break; case m_disableOutputEscaping: CheckArgs(2,3,2,"?boolean?"); if (node->nodeType != TEXT_NODE) { SetResult("not a TEXT_NODE!"); return TCL_ERROR; } SetIntResult( (((node->nodeFlags & DISABLE_OUTPUT_ESCAPING) == 0) ? 0 : 1)); if (objc == 3) { if (Tcl_GetBooleanFromObj(interp, objv[2], &bool) != TCL_OK) { return TCL_ERROR; } if (bool) { node->nodeFlags |= DISABLE_OUTPUT_ESCAPING; } else { node->nodeFlags &= (~DISABLE_OUTPUT_ESCAPING); } } break; case m_precedes: CheckArgs(3,3,2, "node"); nodeName = Tcl_GetString(objv[2]); refNode = tcldom_getNodeFromName(interp, nodeName, &errMsg); if (refNode == NULL) { SetResult(errMsg); return TCL_ERROR; } if (node->ownerDocument != refNode->ownerDocument) { SetResult("Cannot compare the relative order of nodes " "out of different documents."); return TCL_ERROR; } if (((node->parentNode == NULL) && (node != node->ownerDocument->documentElement) && (node != node->ownerDocument->rootNode)) || ((refNode->parentNode == NULL) && (refNode != refNode->ownerDocument->documentElement) && (refNode != refNode->ownerDocument->rootNode))) { SetResult("Cannot compare the relative order of a node " "with a node out of the fragment list."); return TCL_ERROR; } SetBooleanResult (domPrecedes (node, refNode)); break; case m_asText: CheckArgs (2,2,2, ""); str = xpathGetStringValue(node, &length); Tcl_SetStringObj(Tcl_GetObjResult(interp), str, length); FREE (str); return TCL_OK; case m_normalize: CheckArgs (2,3,2, "?-forXPath?"); bool = 0; if (objc == 3) { if (strcmp (Tcl_GetString(objv[2]), "-forXPath") == 0) { bool = 1; } else { SetResult("unknown option! Options: ?-forXPath?"); return TCL_ERROR; } } domNormalize (node, bool, tcldom_deleteNode, interp); return TCL_OK; TDomThreaded( case m_writelock: CheckArgs(3,3,2,"script"); return tcldom_EvalLocked(interp, (Tcl_Obj**)objv, node->ownerDocument, LOCK_WRITE); case m_readlock: CheckArgs(3,3,2,"script"); return tcldom_EvalLocked(interp, (Tcl_Obj**)objv, node->ownerDocument, LOCK_READ); ) } return TCL_OK; } /*---------------------------------------------------------------------------- | tcldom_DocObjCmd | \---------------------------------------------------------------------------*/ int tcldom_DocObjCmd ( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ) { GetTcldomTSD() domDeleteInfo * dinfo; domDocument * doc; char * method, *tag, *data, *target, *uri, tmp[100]; char * str, *docName, *errMsg; int methodIndex, result, data_length, target_length, i; int nsIndex, forXPath, bool, setDocumentElement = 0; int restoreDomCreateCmdMode = 0; domNode * n; Tcl_CmdInfo cmdInfo; Tcl_Obj * mobjv[MAX_REWRITE_ARGS]; static CONST84 char *docMethods[] = { "documentElement", "getElementsByTagName", "delete", "createElement", "createCDATASection", "createTextNode", "createComment", "createProcessingInstruction", "createElementNS", "getDefaultOutputMethod", "asXML", "asHTML", "getElementsByTagNameNS", "xslt", "publicId", "systemId", "internalSubset", "toXSLTcmd", "asText", "normalize", "indent", "omit-xml-declaration", "encoding", "standalone", "mediaType", "nodeType", "cdataSectionElements", "selectNodesNamespaces", "renameNode", "deleteXPathCache", /* The following methods will be dispatched to tcldom_NodeObjCmd */ "getElementById", "firstChild", "lastChild", "appendChild", "removeChild", "hasChildNodes", "childNodes", "ownerDocument", "insertBefore", "replaceChild", "appendFromList", "appendXML", "selectNodes", "baseURI", "appendFromScript", "insertBeforeFromScript", #ifdef TCL_THREADS "readlock", "writelock", "renumber", #endif NULL }; enum docMethod { m_documentElement, m_getElementsByTagName, m_delete, m_createElement, m_createCDATASection, m_createTextNode, m_createComment, m_createProcessingInstruction, m_createElementNS, m_getdefaultoutputmethod, m_asXML, m_asHTML, m_getElementsByTagNameNS, m_xslt, m_publicId, m_systemId, m_internalSubset, m_toXSLTcmd, m_asText, m_normalize, m_indent, m_omitXMLDeclaration, m_encoding, m_standalone, m_mediaType, m_nodeType, m_cdataSectionElements, m_selectNodesNamespaces, m_renameNode, m_deleteXPathCache, /* The following methods will be dispatched to tcldom_NodeObjCmd */ m_getElementById, m_firstChild, m_lastChild, m_appendChild, m_removeChild, m_hasChildNodes, m_childNodes, m_ownerDocument, m_insertBefore, m_replaceChild, m_appendFromList, m_appendXML, m_selectNodes, m_baseURI, m_appendFromScript, m_insertBeforeFromScript #ifdef TCL_THREADS ,m_readlock, m_writelock, m_renumber #endif }; dinfo = (domDeleteInfo*)clientData; if (TSD(domCreateCmdMode) == DOM_CREATECMDMODE_AUTO) { TSD(dontCreateObjCommands) = 0; } if (dinfo == NULL) { if (objc < 3) { SetResult(doc_usage); return TCL_ERROR; } if (TSD(domCreateCmdMode) == DOM_CREATECMDMODE_AUTO) { TSD(dontCreateObjCommands) = 1; } docName = Tcl_GetString(objv[1]); doc = tcldom_getDocumentFromName(interp, docName, &errMsg); if (doc == NULL) { SetResult(errMsg); return TCL_ERROR; } objc--; objv++; } else { doc = dinfo->document; } if (objc < 2) { SetResult(doc_usage); return TCL_ERROR; } method = Tcl_GetString(objv[1]); if (Tcl_GetIndexFromObj(NULL, objv[1], docMethods, "method", 0, &methodIndex) != TCL_OK) { /*-------------------------------------------------------- | try to find method implemented as normal Tcl proc \-------------------------------------------------------*/ sprintf(tmp, "::dom::domDoc::%s", method); DBG(fprintf(stderr, "testing %s\n", tmp)); result = Tcl_GetCommandInfo(interp, tmp, &cmdInfo); if (!result) { SetResult(doc_usage); return TCL_ERROR; } if (!cmdInfo.isNativeObjectProc) { SetResult( "can't access Tcl level method!"); return TCL_ERROR; } if (objc >= MAX_REWRITE_ARGS) { SetResult("too many args to call Tcl level method!"); return TCL_ERROR; } mobjv[0] = objv[1]; mobjv[1] = objv[0]; for (i = 2; i < objc; i++) { mobjv[i] = objv[i]; } return cmdInfo.objProc(cmdInfo.objClientData, interp, objc, mobjv); } CheckArgs (2,10,1,dom_usage); Tcl_ResetResult (interp); /*---------------------------------------------------------------------- | dispatch the doc object method | \---------------------------------------------------------------------*/ switch ((enum docMethod) methodIndex ) { case m_documentElement: CheckArgs(2,3,2,""); return tcldom_returnNodeObj(interp, doc->documentElement, (objc == 3), (objc == 3) ? objv[2] : NULL); case m_getElementsByTagName: CheckArgs(3,3,2,"elementName"); return tcldom_getElementsByTagName(interp, Tcl_GetString(objv[2]), doc->documentElement, -1, NULL); case m_getElementsByTagNameNS: CheckArgs(4,4,2,"uri localname"); uri = Tcl_GetString(objv[2]); str = Tcl_GetString(objv[3]); nsIndex = -1; if (uri[0] == '*' && uri[1] == '\0') { nsIndex = -3; } else if (uri[0] == '\0') { /* all elements not in a namespace i.e. */ nsIndex = -4; } else { for (i = 0; i <= doc->nsptr; i++) { if (strcmp(doc->namespaces[i]->uri, uri)==0) { if (nsIndex != -1) { /* OK, this is one of the 'degenerated' (though legal) documents, which bind the same URI to different prefixes. */ nsIndex = -2; break; } nsIndex = doc->namespaces[i]->index; } } } if (nsIndex == -1) { /* There isn't such a namespace declared in this document. Since getElementsByTagNameNS doesn't raise an execption short cut: return empty result */ return TCL_OK; } return tcldom_getElementsByTagName(interp, str, doc->documentElement, nsIndex, uri); case m_createElement: CheckArgs(3,4,2,"elementName ?newObjVar?"); tag = Tcl_GetString(objv[2]); CheckName (interp, tag, "tag", 0); n = domNewElementNode(doc, tag, ELEMENT_NODE); return tcldom_returnNodeObj(interp, n, (objc == 4), (objc == 4) ? objv[3] : NULL); case m_createElementNS: CheckArgs(4,5,2,"elementName uri ?newObjVar?"); uri = Tcl_GetString(objv[2]); tag = Tcl_GetString(objv[3]); CheckName (interp, tag, "full qualified tag", 1); n = domNewElementNodeNS(doc, tag, uri, ELEMENT_NODE); return tcldom_returnNodeObj(interp, n, (objc == 5), (objc == 5) ? objv[4] : NULL); case m_createTextNode: CheckArgs(3,4,2,"data ?newObjVar?"); data = Tcl_GetStringFromObj(objv[2], &data_length); CheckText (interp, data, "text"); n = (domNode*)domNewTextNode(doc, data, data_length, TEXT_NODE); return tcldom_returnNodeObj(interp, n, (objc == 4), (objc == 4) ? objv[3] : NULL); case m_createCDATASection: CheckArgs(3,4,2,"data ?newObjVar?"); data = Tcl_GetStringFromObj(objv[2], &data_length); CheckCDATA (interp, data); n = (domNode*)domNewTextNode(doc, data, data_length, CDATA_SECTION_NODE); return tcldom_returnNodeObj(interp, n, (objc == 4), (objc == 4) ? objv[3] : NULL); case m_createComment: CheckArgs(3,4,2,"data ?newObjVar?"); data = Tcl_GetStringFromObj(objv[2], &data_length); CheckComment(interp, data); n = (domNode*)domNewTextNode(doc, data, data_length, COMMENT_NODE); return tcldom_returnNodeObj(interp, n, (objc == 4), (objc == 4) ? objv[3] : NULL); case m_createProcessingInstruction: CheckArgs(4,5,2,"target data ?newObjVar?"); target = Tcl_GetStringFromObj(objv[2], &target_length); CheckPIName (interp, target); data = Tcl_GetStringFromObj(objv[3], &data_length); CheckPIValue (interp, data); n = (domNode*)domNewProcessingInstructionNode(doc, target, target_length, data, data_length); return tcldom_returnNodeObj(interp, n, (objc == 5), (objc == 5) ? objv[4] : NULL); case m_delete: CheckArgs(2,2,2,""); if (clientData != NULL) { Tcl_DeleteCommand(interp, Tcl_GetString (objv[0])); } else { tcldom_deleteDoc(interp, doc); } SetResult(""); return TCL_OK; case m_getdefaultoutputmethod: CheckArgs(2,2,2,""); if (doc->doctype && doc->doctype->method) { SetResult (doc->doctype->method); } else { SetResult("xml"); } return TCL_OK; case m_asXML: if (serializeAsXML((domNode*)doc, interp, objc, objv) != TCL_OK) { return TCL_ERROR; } return TCL_OK; case m_asHTML: if (serializeAsHTML((domNode*)doc, interp, objc, objv) != TCL_OK) { return TCL_ERROR; } return TCL_OK; case m_xslt: CheckArgs(3,9,2, "?-parameters parameterList? " "?-ignoreUndeclaredParameters? " "?-xsltmessagecmd cmd? ?objVar?"); objv += 2; objc -= 2; return applyXSLT((domNode *) doc, interp, NULL, objc, objv); case m_toXSLTcmd: CheckArgs(2,3,2, "?objVar?"); return convertToXSLTCmd(doc, interp, (objc == 3), (objc == 3) ? objv[2] : NULL); case m_publicId: CheckArgs(2,3,2, "?publicID?"); if (doc->doctype && doc->doctype->publicId) { SetResult(doc->doctype->publicId); } else { SetResult(""); } if (objc == 3) { if (!doc->doctype) { doc->doctype = (domDocInfo *)MALLOC(sizeof(domDocInfo)); memset(doc->doctype, 0,(sizeof(domDocInfo))); } else if (doc->doctype->publicId) { FREE(doc->doctype->publicId); } doc->doctype->publicId = tdomstrdup(Tcl_GetString(objv[2])); } return TCL_OK; case m_systemId: CheckArgs(2,3,2, "?systemID?"); if (doc->doctype && doc->doctype->systemId) { SetResult(doc->doctype->systemId); } else { SetResult(""); } if (objc == 3) { if (!doc->doctype) { doc->doctype = (domDocInfo *)MALLOC(sizeof(domDocInfo)); memset(doc->doctype, 0,(sizeof(domDocInfo))); } else if (doc->doctype->systemId) { FREE(doc->doctype->systemId); } doc->doctype->systemId = tdomstrdup(Tcl_GetString(objv[2])); } return TCL_OK; case m_internalSubset: CheckArgs(2,3,2, "?internalSubset?"); if (doc->doctype && doc->doctype->internalSubset) { SetResult(doc->doctype->internalSubset); } else { SetResult(""); } if (objc == 3) { if (!doc->doctype) { doc->doctype = (domDocInfo *)MALLOC(sizeof(domDocInfo)); memset(doc->doctype, 0,(sizeof(domDocInfo))); } else if (doc->doctype->systemId) { FREE(doc->doctype->systemId); } doc->doctype->internalSubset = tdomstrdup(Tcl_GetString(objv[2])); } return TCL_OK; case m_indent: CheckArgs(2,3,2, "?boolean?"); if (doc->nodeFlags & OUTPUT_DEFAULT_INDENT) { SetBooleanResult (1); } else { SetBooleanResult(0); } if (objc == 3) { if (Tcl_GetBooleanFromObj (interp, objv[2], &bool) != TCL_OK) { return TCL_ERROR; } if (bool) { doc->nodeFlags |= OUTPUT_DEFAULT_INDENT; } else { doc->nodeFlags &= ~OUTPUT_DEFAULT_INDENT; } } return TCL_OK; case m_omitXMLDeclaration: CheckArgs(2,3,2, "?boolean?"); if (doc->doctype) { SetBooleanResult (doc->doctype->omitXMLDeclaration); } else { SetBooleanResult (1); } if (objc == 3) { if (!doc->doctype) { doc->doctype = (domDocInfo *)MALLOC(sizeof(domDocInfo)); memset(doc->doctype, 0,(sizeof(domDocInfo))); } if (Tcl_GetBooleanFromObj ( interp, objv[2], &(doc->doctype->omitXMLDeclaration) ) != TCL_OK) { return TCL_ERROR; } } return TCL_OK; case m_encoding: CheckArgs(2,3,2, "?value?"); if (doc->doctype && doc->doctype->encoding) { SetResult (doc->doctype->encoding); } else { SetResult (""); } if (objc == 3) { if (!doc->doctype) { doc->doctype = (domDocInfo *)MALLOC(sizeof(domDocInfo)); memset(doc->doctype, 0,(sizeof(domDocInfo))); } else { if (doc->doctype->encoding) FREE (doc->doctype->encoding); } doc->doctype->encoding = tdomstrdup (Tcl_GetString (objv[2])); } return TCL_OK; case m_standalone: CheckArgs(2,3,2, "?boolean?"); if (doc->doctype) { SetBooleanResult (doc->doctype->standalone); } else { SetBooleanResult (0); } if (objc == 3) { if (!doc->doctype) { doc->doctype = (domDocInfo *)MALLOC(sizeof(domDocInfo)); memset(doc->doctype, 0,(sizeof(domDocInfo))); } if (Tcl_GetBooleanFromObj ( interp, objv[2], &(doc->doctype->standalone) ) != TCL_OK) { return TCL_ERROR; } } return TCL_OK; case m_mediaType: CheckArgs(2,3,2, "?value?"); if (doc->doctype && doc->doctype->mediaType) { SetResult (doc->doctype->mediaType); } else { SetResult (""); } if (objc == 3) { if (!doc->doctype) { doc->doctype = (domDocInfo *)MALLOC(sizeof(domDocInfo)); memset(doc->doctype, 0,(sizeof(domDocInfo))); } else { if (doc->doctype->mediaType) FREE(doc->doctype->mediaType); } doc->doctype->mediaType = tdomstrdup (Tcl_GetString (objv[2])); } return TCL_OK; case m_asText: CheckArgs (2,2,2,""); data = xpathGetStringValue (doc->rootNode, &data_length); Tcl_SetStringObj (Tcl_GetObjResult (interp), data, data_length); FREE (data); return TCL_OK; case m_normalize: CheckArgs (2,3,2, "?-forXPath?"); forXPath = 0; if (objc == 3) { if (strcmp (Tcl_GetString (objv[2]), "-forXPath") == 0) { forXPath = 1; } else { SetResult("unknown option! Options: ?-forXPath?"); return TCL_ERROR; } } domNormalize(doc->rootNode, forXPath, tcldom_deleteNode, interp); return TCL_OK; case m_nodeType: CheckArgs (2,2,2, ""); SetResult("DOCUMENT_NODE"); return TCL_OK; case m_cdataSectionElements: return cdataSectionElements (doc, interp, objc, objv); case m_selectNodesNamespaces: return selectNodesNamespaces (doc, interp, objc, objv); case m_renameNode: return renameNodes (doc, interp, objc, objv); case m_deleteXPathCache: return deleteXPathCache (doc, interp, objc, objv); case m_appendChild: case m_removeChild: case m_insertBefore: case m_replaceChild: case m_appendFromList: case m_appendXML: case m_appendFromScript: case m_insertBeforeFromScript: setDocumentElement = 1; /* Fall throuh */ case m_firstChild: case m_lastChild: case m_hasChildNodes: case m_childNodes: case m_ownerDocument: case m_selectNodes: case m_baseURI: case m_getElementById: /* We dispatch the method call to tcldom_NodeObjCmd */ if (TSD(domCreateCmdMode) == DOM_CREATECMDMODE_AUTO) { if (dinfo == NULL) { /* tcldom_DocObjCmd was called with a doc token. Since the domCreateCmdMode is 'automatic' and we call tcldom_DocObjCmd with the root node as 'clientData', we temporarily set domCreateCmdMode to 'token', to get token results from that call and later to set it back. */ TSD(domCreateCmdMode) = DOM_CREATECMDMODE_TOKENS; restoreDomCreateCmdMode = 1; } } if (tcldom_NodeObjCmd (doc->rootNode, interp, objc, objv) != TCL_OK) { if (restoreDomCreateCmdMode) { TSD(domCreateCmdMode) = DOM_CREATECMDMODE_AUTO; TSD(dontCreateObjCommands) = 0; } return TCL_ERROR; } if (setDocumentElement) { /* The method call may have altered the documentElement. */ /* There may be even no node anymore */ domSetDocumentElement (doc); } if (restoreDomCreateCmdMode) { TSD(domCreateCmdMode) = DOM_CREATECMDMODE_AUTO; TSD(dontCreateObjCommands) = 0; } return TCL_OK; TDomThreaded( case m_writelock: CheckArgs(3,3,2,"script"); return tcldom_EvalLocked(interp, (Tcl_Obj**)objv, doc, LOCK_WRITE); case m_readlock: CheckArgs(3,3,2,"script"); return tcldom_EvalLocked(interp, (Tcl_Obj**)objv, doc, LOCK_READ); case m_renumber: CheckArgs(2,2,2,""); if (doc->nodeFlags & NEEDS_RENUMBERING) { domRenumberTree (doc->rootNode); doc->nodeFlags &= ~NEEDS_RENUMBERING; } return TCL_OK; ) } SetResult(doc_usage); return TCL_ERROR; } /*---------------------------------------------------------------------------- | tcldom_createDocument | \---------------------------------------------------------------------------*/ static int tcldom_createDocument ( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[] ) { int setVariable = 0; domDocument *doc; Tcl_Obj *newObjName = NULL; CheckArgs(2,3,1,"docElemName ?newObjVar?"); if (objc == 3) { newObjName = objv[2]; setVariable = 1; } doc = domCreateDocument(interp, NULL, Tcl_GetString(objv[1])); if (doc == NULL) { return TCL_ERROR; } return tcldom_returnDocumentObj(interp, doc, setVariable, newObjName, 1, 0); } /*---------------------------------------------------------------------------- | tcldom_createDocumentNode | \---------------------------------------------------------------------------*/ static int tcldom_createDocumentNode ( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[] ) { int setVariable = 0; domDocument *doc; Tcl_Obj *newObjName = NULL; CheckArgs(1,2,1,"?newObjVar?"); if (objc == 2) { newObjName = objv[1]; setVariable = 1; } doc = domCreateDoc(NULL, 0); return tcldom_returnDocumentObj(interp, doc, setVariable, newObjName, 1, 0); } /*---------------------------------------------------------------------------- | tcldom_createDocumentNS | \---------------------------------------------------------------------------*/ static int tcldom_createDocumentNS ( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[] ) { int setVariable = 0; domDocument *doc; Tcl_Obj *newObjName = NULL; CheckArgs(3,4,1,"uri docElemName ?newObjVar?"); if (objc == 4) { newObjName = objv[3]; setVariable = 1; } doc = domCreateDocument(interp, Tcl_GetString(objv[1]), Tcl_GetString(objv[2])); if (doc == NULL) { return TCL_ERROR; } return tcldom_returnDocumentObj(interp, doc, setVariable, newObjName, 1, 0); } /*---------------------------------------------------------------------------- | tcldom_setResultEncoding | \---------------------------------------------------------------------------*/ static int tcldom_setResultEncoding ( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[] ) { GetTcldomTSD() TEncoding *encoding; char *encodingName; CheckArgs(1,2,1,"?encodingName?"); if (objc == 1) { if (TSD(Encoding_to_8bit) == NULL) { Tcl_AppendResult(interp, "UTF-8", NULL); } else { Tcl_AppendResult(interp, TSD(Encoding_to_8bit->name), NULL); } return TCL_OK; } encodingName = Tcl_GetString(objv[1]); if ( (strcmp(encodingName, "UTF-8")==0) ||(strcmp(encodingName, "UTF8")==0) ||(strcmp(encodingName, "utf-8")==0) ||(strcmp(encodingName, "utf8")==0)) { TSD(Encoding_to_8bit) = NULL; } else { encoding = tdom_GetEncoding ( encodingName ); if (encoding == NULL) { Tcl_AppendResult(interp, "encoding not found", NULL); return TCL_ERROR; } TSD(Encoding_to_8bit) = encoding; } return TCL_OK; } /*---------------------------------------------------------------------------- | tcldom_parse | \---------------------------------------------------------------------------*/ static int tcldom_parse ( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[] ) { GetTcldomTSD() char *xml_string, *option, *errStr, *channelId, *baseURI = NULL; char *extResolver = NULL; CONST84 char *interpResult; int optionIndex, value, xml_string_len, mode; int ignoreWhiteSpaces = 1; int takeSimpleParser = 0; int takeHTMLParser = 0; int setVariable = 0; int feedbackAfter = 0; int useForeignDTD = 0; int paramEntityParsing = (int)XML_PARAM_ENTITY_PARSING_ALWAYS; domDocument *doc; Tcl_Obj *newObjName = NULL; XML_Parser parser; Tcl_Channel chan = (Tcl_Channel) NULL; static CONST84 char *parseOptions[] = { "-keepEmpties", "-simple", "-html", "-feedbackAfter", "-channel", "-baseurl", "-externalentitycommand", "-useForeignDTD", "-paramentityparsing", NULL }; enum parseOption { o_keepEmpties, o_simple, o_html, o_feedbackAfter, o_channel, o_baseurl, o_externalentitycommand, o_useForeignDTD, o_paramentityparsing }; static CONST84 char *paramEntityParsingValues[] = { "always", "never", "notstandalone", (char *) NULL }; enum paramEntityParsingValue { EXPAT_PARAMENTITYPARSINGALWAYS, EXPAT_PARAMENTITYPARSINGNEVER, EXPAT_PARAMENTITYPARSINGNOTSTANDALONE }; while (objc > 1) { option = Tcl_GetString(objv[1]); if (option[0] != '-') { break; } if (Tcl_GetIndexFromObj(interp, objv[1], parseOptions, "option", 0, &optionIndex) != TCL_OK) { return TCL_ERROR; } switch ((enum parseOption) optionIndex) { case o_keepEmpties: ignoreWhiteSpaces = 0; objv++; objc--; continue; case o_simple: takeSimpleParser = 1; objv++; objc--; continue; case o_html: takeSimpleParser = 1; takeHTMLParser = 1; objv++; objc--; continue; case o_feedbackAfter: objv++; objc--; if (objc > 1) { if (Tcl_GetIntFromObj(interp, objv[1], &feedbackAfter) != TCL_OK) { SetResult("-feedbackAfter must have an integer argument"); return TCL_ERROR; } } else { SetResult("The \"dom parse\" option \"-feedbackAfter\" requires" " an integer as argument."); return TCL_ERROR; } objv++; objc--; continue; case o_channel: objv++; objc--; if (objc > 1) { channelId = Tcl_GetString(objv[1]); } else { SetResult("The \"dom parse\" option \"-channel\" " "requires a tcl channel as argument."); return TCL_ERROR; } chan = Tcl_GetChannel(interp, channelId, &mode); if (chan == (Tcl_Channel) NULL) { return TCL_ERROR; } if ((mode & TCL_READABLE) == 0) { Tcl_AppendResult(interp, "channel \"", channelId, "\" wasn't opened for reading", (char *) NULL); return TCL_ERROR; } objv++; objc--; continue; case o_baseurl: objv++; objc--; if (objc > 1) { baseURI = Tcl_GetString(objv[1]); } else { SetResult("The \"dom parse\" option \"-baseurl\" " "requires the base URL of the document " "to parse as argument."); return TCL_ERROR; } objv++; objc--; continue; case o_externalentitycommand: objv++; objc--; if (objc > 1) { extResolver = tdomstrdup (Tcl_GetString (objv[1])); } else { SetResult("The \"dom parse\" option \"-externalentitycommand\" " "requires a script as argument."); return TCL_ERROR; } objv++; objc--; continue; case o_useForeignDTD: objv++; objc--; if (objc > 1) { if (Tcl_GetBooleanFromObj(interp, objv[1], &useForeignDTD) != TCL_OK) { return TCL_ERROR; } } else { SetResult(dom_usage); return TCL_ERROR; } objv++; objc--; continue; case o_paramentityparsing: if (objc > 2) { if (Tcl_GetIndexFromObj(interp, objv[2], paramEntityParsingValues, "value", 0, &value) != TCL_OK) { return TCL_ERROR; } switch ((enum paramEntityParsingValue) value) { case EXPAT_PARAMENTITYPARSINGALWAYS: paramEntityParsing = (int) XML_PARAM_ENTITY_PARSING_ALWAYS; break; case EXPAT_PARAMENTITYPARSINGNEVER: paramEntityParsing = (int) XML_PARAM_ENTITY_PARSING_NEVER; break; case EXPAT_PARAMENTITYPARSINGNOTSTANDALONE: paramEntityParsing = (int) XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE; break; } } else { SetResult("-paramEntityParsing requires 'always', 'never' " "or 'notstandalone' as argument"); return TCL_ERROR; } objv++; objc--; objv++; objc--; continue; } } if (chan == NULL) { if (objc < 2) { SetResult(dom_usage); return TCL_ERROR; } xml_string = Tcl_GetStringFromObj( objv[1], &xml_string_len); if (objc == 3) { newObjName = objv[2]; setVariable = 1; } } else { if (objc > 2) { SetResult(dom_usage); return TCL_ERROR; } xml_string = NULL; xml_string_len = 0; if (takeSimpleParser || takeHTMLParser) { Tcl_AppendResult(interp, "simple and/or HTML parser(s) " " don't support channel reading", NULL); return TCL_ERROR; } if (objc == 2) { newObjName = objv[1]; setVariable = 1; } } if (takeSimpleParser) { char s[50]; int byteIndex, i; errStr = NULL; if (takeHTMLParser) { doc = HTML_SimpleParseDocument(xml_string, ignoreWhiteSpaces, &byteIndex, &errStr); } else { doc = XML_SimpleParseDocument(xml_string, ignoreWhiteSpaces, baseURI, extResolver, &byteIndex, &errStr); } if (errStr != NULL) { domFreeDocument (doc, NULL, interp); Tcl_ResetResult(interp); sprintf(s, "%d", byteIndex); Tcl_AppendResult(interp, "error \"", errStr, "\" at position ", s, NULL); if (byteIndex != -1) { Tcl_AppendResult(interp, "\n\"", NULL); s[1] = '\0'; for (i=-80; i < 80; i++) { if ((byteIndex+i)>=0) { if (xml_string[byteIndex+i]) { s[0] = xml_string[byteIndex+i]; Tcl_AppendResult(interp, s, NULL); if (i==0) { Tcl_AppendResult(interp, " <--Error-- ", NULL); } } else { break; } } } Tcl_AppendResult(interp, "\"",NULL); } if (takeHTMLParser) { FREE(errStr); } return TCL_ERROR; } return tcldom_returnDocumentObj (interp, doc, setVariable, newObjName, 1, 0); } #ifdef TDOM_NO_EXPAT Tcl_AppendResult(interp, "tDOM was compiled without Expat!", NULL); return TCL_ERROR; #else parser = XML_ParserCreate_MM(NULL, MEM_SUITE, NULL); Tcl_ResetResult(interp); doc = domReadDocument(parser, xml_string, xml_string_len, ignoreWhiteSpaces, TSD(Encoding_to_8bit), TSD(storeLineColumn), feedbackAfter, chan, baseURI, extResolver, useForeignDTD, paramEntityParsing, interp); if (doc == NULL) { char s[50]; long byteIndex, i; interpResult = Tcl_GetStringResult(interp); if (interpResult[0] == '\0') { /* If the interp result isn't empty, then there was an error in an enternal entity and the interp result has already the error msg. If we don't got a document, but interp result is empty, the error occured in the main document and we build the error msg as follows. */ sprintf(s, "%ld", XML_GetCurrentLineNumber(parser)); Tcl_AppendResult(interp, "error \"", XML_ErrorString(XML_GetErrorCode(parser)), "\" at line ", s, " character ", NULL); sprintf(s, "%ld", XML_GetCurrentColumnNumber(parser)); Tcl_AppendResult(interp, s, NULL); byteIndex = XML_GetCurrentByteIndex(parser); if ((byteIndex != -1) && (chan == NULL)) { Tcl_AppendResult(interp, "\n\"", NULL); s[1] = '\0'; for (i=-20; i < 40; i++) { if ((byteIndex+i)>=0) { if (xml_string[byteIndex+i]) { s[0] = xml_string[byteIndex+i]; Tcl_AppendResult(interp, s, NULL); if (i==0) { Tcl_AppendResult(interp, " <--Error-- ", NULL); } } else { break; } } } Tcl_AppendResult(interp, "\"",NULL); } } XML_ParserFree(parser); return TCL_ERROR; } XML_ParserFree(parser); return tcldom_returnDocumentObj (interp, doc, setVariable, newObjName, 1, 0); #endif } /*---------------------------------------------------------------------------- | tcldom_DomObjCmd | \---------------------------------------------------------------------------*/ int tcldom_DomObjCmd ( ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[] ) { GetTcldomTSD() char * method, tmp[300]; int methodIndex, result, i, bool; Tcl_CmdInfo cmdInfo; Tcl_Obj * mobjv[MAX_REWRITE_ARGS]; static CONST84 char *domMethods[] = { "createDocument", "createDocumentNS", "createNodeCmd", "parse", "setResultEncoding", "setStoreLineColumn", "isCharData", "isName", "isPIName", "isQName", "isComment", "isCDATA", "isPIValue", "isNCName", "createDocumentNode", "setNameCheck", "setTextCheck", "setObjectCommands", #ifdef TCL_THREADS "attachDocument", "detachDocument", #endif NULL }; enum domMethod { m_createDocument, m_createDocumentNS, m_createNodeCmd, m_parse, m_setResultEncoding, m_setStoreLineColumn, m_isCharData, m_isName, m_isPIName, m_isQName, m_isComment, m_isCDATA, m_isPIValue, m_isNCName, m_createDocumentNode, m_setNameCheck, m_setTextCheck, m_setObjectCommands #ifdef TCL_THREADS ,m_attachDocument, m_detachDocument #endif }; static CONST84 char *nodeModeValues[] = { "automatic", "command", "token", NULL }; enum nodeModeValue { v_automatic, v_command, v_token }; if (objc < 2) { SetResult(dom_usage); return TCL_ERROR; } if (TSD(domCreateCmdMode) == DOM_CREATECMDMODE_AUTO) { TSD(dontCreateObjCommands) = 0; } method = Tcl_GetString(objv[1]); if (Tcl_GetIndexFromObj(NULL, objv[1], domMethods, "method", 0, &methodIndex) != TCL_OK) { /*-------------------------------------------------------- | try to find method implemented as normal Tcl proc \-------------------------------------------------------*/ if ((strlen(method)-1) >= 270) { SetResult("method name to long!"); return TCL_ERROR; } sprintf(tmp, "::dom::DOMImplementation::%s", method); DBG(fprintf(stderr, "testing %s\n", tmp)); result = Tcl_GetCommandInfo(interp, tmp, &cmdInfo); if (!result) { SetResult(dom_usage); return TCL_ERROR; } if (!cmdInfo.isNativeObjectProc) { SetResult("can't access Tcl level method!"); return TCL_ERROR; } if (objc >= MAX_REWRITE_ARGS) { SetResult("too many args to call Tcl level method!"); return TCL_ERROR; } mobjv[0] = objv[1]; mobjv[1] = objv[0]; for (i=2; ilock; domLocksLock(dl, flag); Tcl_AllowExceptions(interp); ret = Tcl_EvalObj(interp, objv[2]); if (ret == TCL_ERROR) { char msg[64 + TCL_INTEGER_SPACE]; sprintf(msg, "\n (\"%s %s\" body line %d)", Tcl_GetString(objv[0]), Tcl_GetString(objv[1]), interp->errorLine); Tcl_AddErrorInfo(interp, msg); } domLocksUnlock(dl); return (ret == TCL_BREAK) ? TCL_OK : ret; } /*---------------------------------------------------------------------------- | tcldom_RegisterDocShared | \---------------------------------------------------------------------------*/ static int tcldom_RegisterDocShared ( domDocument * doc ) { Tcl_HashEntry *entryPtr; int refCount, newEntry; Tcl_MutexLock(&tableMutex); refCount = ++doc->refCount; entryPtr = Tcl_CreateHashEntry(&sharedDocs, (char*)doc, &newEntry); if (newEntry) { Tcl_SetHashValue(entryPtr, (ClientData)doc); } Tcl_MutexUnlock(&tableMutex); DBG(fprintf(stderr, "--> tcldom_RegisterDocShared: doc %p %s " "shared table now with refcount of %d\n", doc, newEntry ? "entered into" : "already in", refCount)); return 0; } /*---------------------------------------------------------------------------- | tcldom_UnregisterDocShared | \---------------------------------------------------------------------------*/ static int tcldom_UnregisterDocShared ( Tcl_Interp * interp, domDocument * doc ) { int deleted; Tcl_MutexLock(&tableMutex); if (doc->refCount > 1) { tcldom_deleteNode(doc->rootNode, interp); domFreeNode(doc->rootNode, tcldom_deleteNode, interp, 1); doc->refCount--; deleted = 0; } else { Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(&sharedDocs, (char*)doc); if (entryPtr) { Tcl_DeleteHashEntry(entryPtr); deleted = 1; } else { deleted = 0; } } Tcl_MutexUnlock(&tableMutex); DBG(fprintf(stderr, "--> tcldom_UnregisterDocShared: doc %p %s " "shared table\n", doc, deleted ? "deleted from" : "left in")); return deleted; } /*---------------------------------------------------------------------------- | tcldom_CheckDocShared | \---------------------------------------------------------------------------*/ static int tcldom_CheckDocShared ( domDocument * doc ) { Tcl_HashEntry *entryPtr; domDocument *tabDoc = NULL; int found = 0; Tcl_MutexLock(&tableMutex); entryPtr = Tcl_FindHashEntry(&sharedDocs, (char*)doc); if (entryPtr == NULL) { found = 0; } else { tabDoc = (domDocument*)Tcl_GetHashValue(entryPtr); found = tabDoc ? 1 : 0; } Tcl_MutexUnlock(&tableMutex); if (found && doc != tabDoc) { Tcl_Panic("document mismatch; doc=%p, in table=%p\n", doc, tabDoc); } return found; } #endif /* TCL_THREADS */ #ifndef TDOM_NO_UNKNOWN_CMD /*---------------------------------------------------------------------------- | tcldom_unknownCmd | \---------------------------------------------------------------------------*/ int tcldom_unknownCmd ( ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[] ) { int len, i, rc, openedParen, count, args; char *cmd, *dot, *paren, *arg[MAX_REWRITE_ARGS], *object, *method; Tcl_DString callString; Tcl_CmdInfo cmdInfo; Tcl_Obj *vector[2+MAX_REWRITE_ARGS]; Tcl_Obj **objvCall; cmd = Tcl_GetStringFromObj(objv[1], &len); DBG(fprintf(stderr, "tcldom_unknownCmd: cmd=-%s- \n", cmd)); dot = strchr(cmd,'.'); if ((dot != NULL) && (dot != cmd)) { object = cmd; cmd = dot+1; *dot = '\0'; dot = strchr(cmd,'.'); while (dot != NULL) { method = cmd; paren = strchr(cmd,'('); args = 0; if (paren && (paren < dot)) { *paren = '\0'; paren++; arg[args] = paren; openedParen = 1; while (*paren) { if (*paren == '\\') { (void) Tcl_Backslash(paren, &count); paren += count; } else if (*paren == ')') { openedParen--; if (openedParen==0) { *paren = '\0'; args++; break; } } else if (*paren == '(') { openedParen++; paren++; } else if (*paren == ',') { *paren = '\0'; arg[++args] = paren+1; if (args >= MAX_REWRITE_ARGS) { SetResult( "too many args"); return TCL_ERROR; } paren++; } else { paren++; } } if (openedParen!=0) { SetResult( "mismatched ("); return TCL_ERROR; } } cmd = dot+1; *dot = '\0'; DBG(fprintf(stderr, "method=-%s- \n", method); fprintf(stderr, "rest=-%s- \n", cmd); for(i=0; i= 0; i--) { Tcl_DecrRefCount(vector[i]); } } else { Tcl_DStringInit(&callString); Tcl_DStringAppendElement(&callString, object); Tcl_DStringAppendElement(&callString, method); for(i=0; i= MAX_REWRITE_ARGS) { SetResult( "too many args"); return TCL_ERROR; } paren++; } else { paren++; } } if (openedParen!=0) { SetResult( "mismatched ("); return TCL_ERROR; } } DBG(fprintf(stderr, "method=-%s- \n", method); fprintf(stderr, "rest=-%s- \n", cmd); for(i=0; i= 0; i--) { Tcl_DecrRefCount(objvCall[i]); } FREE((void*)objvCall); } else { Tcl_DStringInit(&callString); Tcl_DStringAppendElement(&callString, object); Tcl_DStringAppendElement(&callString, method); for(i=2; i /* The following procs are defined in tcldom.c - since they are used * in nodecmd.c these need a prototype somewhere. The prototypes can * live here for now. */ int tcldom_textCheck(Tcl_Interp *interp, char *text, char *errText); int tcldom_commentCheck(Tcl_Interp *interp, char *text); int tcldom_CDATACheck(Tcl_Interp *interp, char *text); int tcldom_PIValueCheck(Tcl_Interp *interp, char *text); int tcldom_PINameCheck(Tcl_Interp *interp, char *name); int tcldom_nameCheck(Tcl_Interp *interp, char *name, char *nameType, int isFQName); void tcldom_createNodeObj(Tcl_Interp * interp, domNode *node, char *objCmdName); void tcldom_initialize(void); Tcl_ObjCmdProc tcldom_DomObjCmd; Tcl_ObjCmdProc tcldom_DocObjCmd; Tcl_ObjCmdProc tcldom_NodeObjCmd; Tcl_ObjCmdProc TclExpatObjCmd; Tcl_ObjCmdProc tcldom_unknownCmd; Tcl_ObjCmdProc TclTdomObjCmd; #if defined(_MSC_VER) # undef TCL_STORAGE_CLASS # define TCL_STORAGE_CLASS DLLEXPORT #endif #define STR_TDOM_VERSION(v) (VERSION) EXTERN int Tdom_Init _ANSI_ARGS_((Tcl_Interp *interp)); EXTERN int Tdom_SafeInit _ANSI_ARGS_((Tcl_Interp *interp)); #endif tDOM-0.8.3/generic/tdom.h0000644000175000017500000001421010657176032015314 0ustar ssobernissoberni #include "tcl.h" #include struct TclGenExpatInfo; typedef void (*CHandlerSet_userDataReset)(Tcl_Interp *interp, void *userData); typedef void (*CHandlerSet_userDataFree)(Tcl_Interp *interp, void *userData); typedef void (*CHandlerSet_parserReset)(XML_Parser parser, void *userData); typedef void (*CHandlerSet_initParse)(const struct TclGenExpatInfo *expat, void *userData); typedef struct CHandlerSet { struct CHandlerSet *nextHandlerSet; char *name; /* refname of the handler set */ int ignoreWhiteCDATAs; /* ignore 'white' CDATA sections */ void *userData; /* Handler set specific Data Structure; the C handler set extention has to malloc the needed structure in his init func and has to provide a cleanup func (to free it). */ CHandlerSet_userDataReset resetProc; CHandlerSet_userDataFree freeProc; CHandlerSet_parserReset parserResetProc; CHandlerSet_initParse initParseProc; /* C func for element start */ XML_StartElementHandler elementstartcommand; /* C func for element end */ XML_EndElementHandler elementendcommand; /* C func for character data */ XML_CharacterDataHandler datacommand; /* C func for namespace decl start */ XML_StartNamespaceDeclHandler startnsdeclcommand; /* C func for namespace decl end */ XML_EndNamespaceDeclHandler endnsdeclcommand; /* C func for processing instruction */ XML_ProcessingInstructionHandler picommand; /* C func for default data */ XML_DefaultHandler defaultcommand; /* C func for unparsed entity declaration */ XML_NotationDeclHandler notationcommand; /* C func for external entity */ XML_ExternalEntityRefHandler externalentitycommand; /* C func for unknown encoding */ XML_UnknownEncodingHandler unknownencodingcommand; /* C func for comments */ XML_CommentHandler commentCommand; /* C func for "not standalone" docs */ XML_NotStandaloneHandler notStandaloneCommand; /* C func for CDATA section start */ XML_StartCdataSectionHandler startCdataSectionCommand; /* C func for CDATA section end */ XML_EndCdataSectionHandler endCdataSectionCommand; /* C func for #include typedef void (*xsltMsgCB) (void *clientData, char *str, int length, int terminate); /*---------------------------------------------------------------------------- | Prototypes | \---------------------------------------------------------------------------*/ int xsltProcess (domDocument * xsltDoc, domNode * xmlNode, void * xsltCmdData, char ** parameters, int ignoreUndeclaredParameters, xpathFuncCallback funcCB, void * xpathFuncClientData, xsltMsgCB xsltMsgCB, void * xsltMsgClientData, char ** errMsg, domDocument ** resultDoc ); void * xsltCompileStylesheet ( domDocument * xsltDoc, xpathFuncCallback funcCB, void * xpathFuncClientData, int guardXSLTTree, char ** errMsg ); void xsltFreeStateWrapper (void *clientData); void sortByDocOrder (xpathResultSet *rs); #endif tDOM-0.8.3/generic/tclexpat.h0000644000175000017500000002012610657176056016206 0ustar ssobernissoberni#include #include struct TclGenExpatInfo; typedef void (*CHandlerSet_userDataReset)(Tcl_Interp *interp, void *userData); typedef void (*CHandlerSet_userDataFree)(Tcl_Interp *interp, void *userData); typedef void (*CHandlerSet_parserReset)(XML_Parser parser, void *userData); typedef void (*CHandlerSet_initParse)(Tcl_Interp *interp, void *userData); typedef struct CHandlerSet { struct CHandlerSet *nextHandlerSet; char *name; /* refname of the handler set */ int ignoreWhiteCDATAs; /* ignore 'white' CDATA sections */ void *userData; /* Handler set specific Data Structure; the C handler set extention has to malloc the needed structure in his init func and has to provide a cleanup func (to free it). */ CHandlerSet_userDataReset resetProc; CHandlerSet_userDataFree freeProc; CHandlerSet_parserReset parserResetProc; CHandlerSet_initParse initParseProc; /* C func for element start */ XML_StartElementHandler elementstartcommand; /* C func for element end */ XML_EndElementHandler elementendcommand; /* C func for character data */ XML_CharacterDataHandler datacommand; /* C func for namespace decl start */ XML_StartNamespaceDeclHandler startnsdeclcommand; /* C func for namespace decl end */ XML_EndNamespaceDeclHandler endnsdeclcommand; /* C func for processing instruction */ XML_ProcessingInstructionHandler picommand; /* C func for default data */ XML_DefaultHandler defaultcommand; /* C func for unparsed entity declaration */ XML_NotationDeclHandler notationcommand; /* C func for external entity */ XML_ExternalEntityRefHandler externalentitycommand; /* C func for unknown encoding */ XML_UnknownEncodingHandler unknownencodingcommand; /* C func for comments */ XML_CommentHandler commentCommand; /* C func for "not standalone" docs */ XML_NotStandaloneHandler notStandaloneCommand; /* C func for CDATA section start */ XML_StartCdataSectionHandler startCdataSectionCommand; /* C func for CDATA section end */ XML_EndCdataSectionHandler endCdataSectionCommand; /* C func for #include #include #include /*---------------------------------------------------------------------------- | Defines | \---------------------------------------------------------------------------*/ #define DBG(x) #define TDOM_NS #ifdef TDOM_NS # define RetError(m,p) *errStr=m; *pos=p; FREE((char*)activeNS); return TCL_ERROR; #else # define RetError(m,p) *errStr=m; *pos=p; return TCL_ERROR; #endif #define SPACE(c) ((c)==' ' || (c)=='\n' || (c)=='\t' || (c)=='\r') /*--------------------------------------------------------------------------- | type domActiveNS | \--------------------------------------------------------------------------*/ typedef struct _domActiveNS { int depth; domNS *namespace; } domActiveNS; /*---------------------------------------------------------------------------- | Begin Character Entity Translator | | | The next section of code implements routines used to translate | character entity references into their corresponding strings. | | Examples: | | & "&" | < "<" | > ">" |   " " | \---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- | Each entity reference is recorded as an instance of the following | structure \---------------------------------------------------------------------------*/ typedef struct Er Er; struct Er { char *zName; /* The name of this entity reference. ex: "amp" */ char *zValue; /* The value for this entity. ex: "&" */ Er *pNext; /* Next entity with the same hash on zName */ }; /*---------------------------------------------------------------------------- | The size of the hash table. For best results this should | be a prime number which is about the same size as the number of | character entity references known to the system. | \---------------------------------------------------------------------------*/ #define ER_HASH_SIZE 7 /*---------------------------------------------------------------------------- | The following flag is TRUE if entity reference hash table needs | to be initialized. | | Hash table is used read-only, therefore just one copy, protected with | mutex when used in threading environments. The mutex is used only for | initial setup of the table. | \---------------------------------------------------------------------------*/ static int bErNeedsInit = 1; TDomThreaded(static Tcl_Mutex initMutex;) /*---------------------------------------------------------------------------- | The hash table | | If the name of an entity reference hashes to the value H, then | apErHash[H] will point to a linked list of Er structures, one of | which will be the Er structure for that entity reference | \---------------------------------------------------------------------------*/ static Er *apErHash[ER_HASH_SIZE]; /*---------------------------------------------------------------------------- | ErHash -- | | Hash an entity reference name. The value returned is an | integer between 0 and Er_HASH_SIZE-1, inclusive. | \---------------------------------------------------------------------------*/ static int ErHash( const char *zName ) { int h = 0; /* The hash value to be returned */ char c; /* The next character in the name being hashed */ while( (c=*zName)!=0 ){ h = h<<5 ^ h ^ c; zName++; } if( h<0 ) h = -h; return h % ER_HASH_SIZE; } /* ErHash */ /*---------------------------------------------------------------------------- | The following is a table of all entity references. To create | new character entities, add entries to this table. | | Note: For the decoder to work, the name of the entity reference | must not be shorter than the value. | \---------------------------------------------------------------------------*/ static Er er_sequences[] = { { "amp", "&", 0 }, { "lt", "<", 0 }, { "gt", ">", 0 }, { "apos", "'", 0 }, { "quot", "\"", 0 }, #if TclOnly8Bits { "nbsp", "\240", 0 }, #else { "nbsp", "\xC2\xA0", 0 }, #endif }; /*---------------------------------------------------------------------------- | ErInit -- | | Initialize the entity reference hash table | \---------------------------------------------------------------------------*/ static void ErInit (void) { size_t i; /* For looping thru the list of entity references */ int h; /* The hash on a entity */ for(i=0; i='0') && (c<='9')) { value += c-'0'; } else if ((c>='A') && (c<='F')) { value += c-'A' + 10; } else if ((c>='a') && (c<='f')) { value += c-'a' + 10; } else { /* error */ return 0; } i++; } } else { while (z[i] && (c=z[i]) && (c!=';')) { value = value * 10; if ((c>='0') && (c<='9')) { value += c-'0'; } else { /* error */ return 0; } i++; } } if (!z[i] || (z[i]!=';')) { return 0; /* error */ } from = i+1; #if TclOnly8Bits z[to++] = value; #else if (value < 0x80) { z[to++] = value; } else if (value <= 0x7FF) { z[to++] = (char) ((value >> 6) | 0xC0); z[to++] = (char) ((value | 0x80) & 0xBF); } else if (value <= 0xFFFF) { z[to++] = (char) ((value >> 12) | 0xE0); z[to++] = (char) (((value >> 6) | 0x80) & 0xBF); z[to++] = (char) ((value | 0x80) & 0xBF); } else { /* error */ return 0; } #endif } else { while (z[i] && isalpha((unsigned char)z[i])) { i++; } if (!z[i] || (z[i]!=';')) { return 0; } c = z[i]; z[i] = 0; h = ErHash(&z[from+1]); p = apErHash[h]; while (p && strcmp(p->zName,&z[from+1])!=0 ) { p = p->pNext; } z[i] = c; if (p) { zVal = p->zValue; while (*zVal) { z[to++] = *(zVal++); } from = i; if (c==';') from++; } else { z[to++] = z[from++]; } } } else { z[to++] = z[from++]; } } z[to] = 0; *newLen = to; return 1; } /*---------------------------------------------------------------------------- | End Of Character Entity Translator \---------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------- | domIsNamespaceInScope | \--------------------------------------------------------------------------*/ static int domIsNamespaceInScope ( domActiveNS *NSstack, int NSstackPos, const char *prefix, const char *namespaceURI ) { int i; for (i = NSstackPos; i >= 0; i--) { if (NSstack[i].namespace->prefix[0] && (strcmp(NSstack[i].namespace->prefix, prefix)==0)) { if (strcmp(NSstack[i].namespace->uri, namespaceURI)==0) { /* OK, exactly the same namespace declaration is in scope */ return 1; } else { /* This prefix is currently assigned to another uri, we need a new NS declaration, to override this one */ return 0; } } } return 0; } /*---------------------------------------------------------------------------- | XML_SimpleParse (non recursive) | | Parses the XML string starting at 'pos' and continuing to the | first encountered error. | \---------------------------------------------------------------------------*/ static int XML_SimpleParse ( char *xml, /* XML string */ int *pos, /* Index of next unparsed character in xml */ domDocument *doc, domNode *parent_nodeOld, int ignoreWhiteSpaces, char **errStr ) { register int c; /* Next character of the input file */ register char *pn; register char *x, *start, *piSep; int saved; int hasContent; domNode *node; domNode *parent_node = NULL; domTextNode *tnode; domAttrNode *attrnode, *lastAttr, *attrList; int ampersandSeen = 0; int only_whites = 0; domProcessingInstructionNode *pinode; int hnew; Tcl_HashEntry *h; #ifdef TDOM_NS int nspos, newNS; int depth = 0; int activeNSpos = -1; int activeNSsize = 8; domActiveNS *activeNS = (domActiveNS*) MALLOC (sizeof(domActiveNS) * activeNSsize); const char *xmlns, *localname; domNS *ns; char tagPrefix[MAX_PREFIX_LEN]; char prefix[MAX_PREFIX_LEN]; domAttrNode *lastNSAttr, *NSattrList; #endif x = &(xml[*pos]); while ( (c=*x)!=0 ) { start = x; if (c!='<') { /*---------------------------------------------------------------- | read text between tags | \---------------------------------------------------------------*/ ampersandSeen = 0; only_whites = 1; while ( (c=*x)!=0 && c!='<' ) { if (c=='&') ampersandSeen = 1; if ( (c != ' ') && (c != '\t') && (c != '\n') && (c != '\r') ) { only_whites = 0; } x++; } if (!(only_whites && ignoreWhiteSpaces) && parent_node) { /*-------------------------------------------------------- | allocate new TEXT node \-------------------------------------------------------*/ tnode = (domTextNode*) domAlloc(sizeof(domTextNode)); memset(tnode, 0, sizeof(domTextNode)); tnode->nodeType = TEXT_NODE; tnode->nodeFlags = 0; tnode->namespace = 0; tnode->ownerDocument = doc; tnode->nodeNumber = NODE_NO(doc); tnode->valueLength = (x - start); tnode->nodeValue = (char*)MALLOC((x - start)+1); memmove(tnode->nodeValue, start, (x - start)); *(tnode->nodeValue + (x - start)) = 0; if (ampersandSeen) { if (!TranslateEntityRefs(tnode->nodeValue, &(tnode->valueLength) )) { RetError("Entity parsing error", (x - xml)); } } tnode->parentNode = parent_node; if (parent_node->firstChild) { parent_node->lastChild->nextSibling = (domNode*)tnode; tnode->previousSibling = parent_node->lastChild; parent_node->lastChild = (domNode*)tnode; } else { parent_node->firstChild = parent_node->lastChild = (domNode*)tnode; } } } else if (x[1]=='/') { /*------------------------------------------------------------ | read and check closing tag \-----------------------------------------------------------*/ node = parent_node; if (!parent_node) { RetError("Syntax error",(x - xml)); } parent_node = node->parentNode; pn = (char*)node->nodeName; x += 2; while (*x == *pn) { x++; pn++; } if ( *pn || (*x!='>' && !SPACE(*x) ) ) { RetError("Unterminated element",(x - xml)); } while (SPACE(*x)) { x++; } if (*x=='>') { x++; } else { RetError("Missing \">\"",(x - xml)-1); } #ifdef TDOM_NS depth--; /* pop active namespaces */ while ( (activeNSpos >= 0) && (activeNS[activeNSpos].depth == depth) ) { activeNSpos--; } #endif if (parent_node == NULL) { /* we return to main node and so finished parsing */ #ifdef TDOM_NS FREE ((char *) activeNS); #endif return TCL_OK; } continue; } else { x++; if (*x=='!') { if (x[1]=='-' && x[2]=='-') { /*-------------------------------------------------------- | read over a comment \-------------------------------------------------------*/ x += 3; while ( (c=*x)!=0 && (c!='-' || x[1]!='-' || x[2]!='>')) { x++; } if (*x) { /*---------------------------------------------------- | allocate new COMMENT node for comments \---------------------------------------------------*/ tnode = (domTextNode*) domAlloc(sizeof(domTextNode)); memset(tnode, 0, sizeof(domTextNode)); tnode->nodeType = COMMENT_NODE; tnode->nodeFlags = 0; tnode->namespace = 0; tnode->ownerDocument = doc; tnode->nodeNumber = NODE_NO(doc); tnode->parentNode = parent_node; tnode->valueLength = x - start - 4; tnode->nodeValue = (char*)MALLOC(tnode->valueLength+1); memmove(tnode->nodeValue, start+4, tnode->valueLength); *(tnode->nodeValue + tnode->valueLength) = 0; if (parent_node == NULL) { if (doc->rootNode->lastChild) { tnode->previousSibling = doc->rootNode->lastChild; doc->rootNode->lastChild->nextSibling = (domNode*)tnode; } else { doc->rootNode->firstChild = (domNode*) tnode; } doc->rootNode->lastChild = (domNode*) tnode; } else { if (parent_node->firstChild) { parent_node->lastChild->nextSibling = (domNode*)tnode; tnode->previousSibling = parent_node->lastChild; parent_node->lastChild = (domNode*)tnode; } else { parent_node->firstChild = parent_node->lastChild = (domNode*)tnode; } } x += 3; } else { RetError("Unterminated comment",(start-xml)); } continue; } else if (x[1]=='D' && x[2]=='O' && x[3]=='C' && x[4]=='T' && x[5]=='Y' && x[6]=='P' && x[7]=='E' ) { /*-------------------------------------------------------- | read over a DOCTYPE definition \-------------------------------------------------------*/ x += 8; start = x; while (*x!=0) { if (*x=='[') { x++; while ((*x!=0) && (*x!=']')) x++; } else if (*x=='>') { break; } else { x++; } } if (*x) { x++; } else { RetError("Unterminated DOCTYPE definition",(start-xml)); } continue; } else if (x[1]=='[' && x[2]=='C' && x[3]=='D' && x[4]=='A' && x[5]=='T' && x[6]=='A' && x[7]=='[' ) { /*-------------------------------------------------------- | read over a '))) { x++; } if (*x) { if (parent_node && (x - start)) { /*---------------------------------------------------- | allocate new TEXT node for CDATA section data \---------------------------------------------------*/ tnode = (domTextNode*) domAlloc(sizeof(domTextNode)); memset(tnode, 0, sizeof(domTextNode)); tnode->nodeType = TEXT_NODE; tnode->nodeFlags = 0; tnode->namespace = 0; tnode->ownerDocument = doc; tnode->nodeNumber = NODE_NO(doc); tnode->parentNode = parent_node; tnode->valueLength = (x - start); tnode->nodeValue = (char*)MALLOC((x - start)+1); memmove(tnode->nodeValue, start, (x - start)); *(tnode->nodeValue + (x - start)) = 0; if (parent_node->firstChild) { parent_node->lastChild->nextSibling = (domNode*)tnode; tnode->previousSibling = parent_node->lastChild; parent_node->lastChild = (domNode*)tnode; } else { parent_node->firstChild = parent_node->lastChild = (domNode*)tnode; } } x += 3; } else { RetError("Unterminated CDATA definition",(start-xml) ); } continue; } else { RetError("Incorrect ')) { x++; } if (*x) { /*------------------------------------------------------------ | allocate new PI node for processing instruction section \-----------------------------------------------------------*/ pinode = (domProcessingInstructionNode*) domAlloc(sizeof(domProcessingInstructionNode)); memset(pinode, 0, sizeof(domProcessingInstructionNode)); pinode->nodeType = PROCESSING_INSTRUCTION_NODE; pinode->nodeFlags = 0; pinode->namespace = 0; pinode->ownerDocument = doc; pinode->nodeNumber = NODE_NO(doc); pinode->parentNode = parent_node; /*------------------------------------------------- | extract PI target \------------------------------------------------*/ piSep = start; while ( (c=*piSep)!=0 && !SPACE(c) && (c!='?' || piSep[1]!='>')) { piSep++; } *piSep = '\0'; /* temporarily terminate the string */ pinode->targetLength = strlen(start); pinode->targetValue = (char*)MALLOC(pinode->targetLength); memmove(pinode->targetValue, start, pinode->targetLength); *piSep = c; /* remove temporarily termination */ /*------------------------------------------------- | extract PI data \------------------------------------------------*/ while (SPACE(*piSep)) { piSep++; } pinode->dataLength = x - piSep; pinode->dataValue = (char*)MALLOC(pinode->dataLength); memmove(pinode->dataValue, piSep, pinode->dataLength); if (parent_node == NULL) { if (doc->rootNode->lastChild) { pinode->previousSibling = doc->rootNode->lastChild; doc->rootNode->lastChild->nextSibling = (domNode*) pinode; } else { doc->rootNode->firstChild = (domNode*) pinode; } doc->rootNode->lastChild = (domNode*) pinode; } else { if (parent_node->firstChild) { parent_node->lastChild->nextSibling = (domNode*)pinode; pinode->previousSibling = parent_node->lastChild; parent_node->lastChild = (domNode*)pinode; } else { parent_node->firstChild = parent_node->lastChild = (domNode*)pinode; } } x += 2; } else { RetError("Unterminated processing instruction(PI)",(start-xml) ); } continue; } /*---------------------------------------------------------------- | new tag/element | \---------------------------------------------------------------*/ hasContent = 1; while ((c=*x)!=0 && c!='/' && c!='>' && !SPACE(c) ) { x++; } if (c==0) { RetError("Missing \">\"",(start-xml) ); } if ( (x-start)==1) { RetError("Null markup name",(start-xml) ); } *x = '\0'; /* temporarily terminate the string */ /*------------------------------------------------------ | create new DOM element node \-----------------------------------------------------*/ h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_tagNames), start+1, &hnew); node = (domNode*) domAlloc(sizeof(domNode)); memset(node, 0, sizeof(domNode)); node->nodeType = ELEMENT_NODE; node->nodeFlags = 0; node->namespace = 0; node->nodeName = (char *)&(h->key); node->ownerDocument = doc; node->nodeNumber = NODE_NO(doc); node->ownerDocument = doc; if (parent_node == NULL) { if (doc->rootNode->lastChild) { node->previousSibling = doc->rootNode->lastChild; doc->rootNode->lastChild->nextSibling = node; } else { doc->rootNode->firstChild = node; } doc->rootNode->lastChild = node; } else { node->parentNode = parent_node; if (parent_node->firstChild) { parent_node->lastChild->nextSibling = node; node->previousSibling = parent_node->lastChild; parent_node->lastChild = node; } else { parent_node->firstChild = parent_node->lastChild = node; } } *x = c; /* remove temporarily termination */ while (SPACE(*x) ) { x++; } /*----------------------------------------------------------- | read attribute name-value pairs \----------------------------------------------------------*/ lastAttr = NULL; attrList = NULL; #ifdef TDOM_NS lastNSAttr = NULL; NSattrList = NULL; #endif while ( (c=*x) && (c!='/') && (c!='>') ) { char *ArgName = x; int nArgName; char *ArgVal = NULL; int nArgVal = 0; while ((c=*x)!=0 && c!='=' && c!='>' && !SPACE(c) ) { x++; } nArgName = x - ArgName; while (SPACE(*x)) { x++; } if (*x=='=') { x++; } saved = *(ArgName + nArgName); *(ArgName + nArgName) = '\0'; /* terminate arg name */ while (SPACE(*x)) { x++; } if (*x=='>' || *x==0) { ArgVal = ArgName; nArgVal = nArgName; } else if ((c=*x)=='\"' || c=='\'') { register int cDelim = c; x++; ArgVal = x; ampersandSeen = 0; while ((c=*x)!=0 && c!=cDelim) { if (c=='&') { ampersandSeen = 1; } x++; } nArgVal = x - ArgVal; if (c==0) { RetError("Unterminated string",(ArgVal - xml - 1) ); } else { x++; } } else if (c!=0 && c!='>') { ArgVal = x; while ((c=*x)!=0 && c!='>' && !SPACE(c)) { if (c=='&') { ampersandSeen = 1; } x++; } if (c==0) { RetError("Missing \">\"",(start-xml)); } nArgVal = x - ArgVal; } #ifdef TDOM_NS /*------------------------------------------------------------ | handle namespace attributes or normal ones \------------------------------------------------------------*/ if (strncmp((char *)ArgName, "xmlns", 5) == 0) { xmlns = ArgName; newNS = 1; h = Tcl_CreateHashEntry(&HASHTAB(doc, tdom_attrNames), ArgName, &hnew); attrnode = (domAttrNode*) domAlloc(sizeof(domAttrNode)); memset(attrnode, 0, sizeof(domAttrNode)); attrnode->parentNode = node; attrnode->nodeName = (char *)&(h->key); attrnode->nodeType = ATTRIBUTE_NODE; attrnode->nodeFlags = IS_NS_NODE; attrnode->nodeValue = (char*)MALLOC(nArgVal+1); attrnode->valueLength = nArgVal; memmove(attrnode->nodeValue, ArgVal, nArgVal); *(attrnode->nodeValue + nArgVal) = 0; if (ampersandSeen) { if (!TranslateEntityRefs(attrnode->nodeValue, &(attrnode->valueLength) )) { RetError("Entity parsing error",(start-xml)); } } if (xmlns[5] == ':') { if (domIsNamespaceInScope (activeNS, activeNSpos, &(xmlns[6]), (char*)attrnode->nodeValue)) { ns = domLookupPrefix (node, &(xmlns[6])); newNS = 0; } else { ns = domNewNamespace(doc, &(xmlns[6]), (char*)attrnode->nodeValue); } } else { ns = domNewNamespace(doc, "", (char*)attrnode->nodeValue); } attrnode->namespace = ns->index; if (newNS) { /* push active namespace */ activeNSpos++; if (activeNSpos >= activeNSsize) { activeNS = (domActiveNS*) REALLOC( (char*)activeNS, sizeof(domActiveNS) * 2 * activeNSsize); activeNSsize = 2 * activeNSsize; } activeNS[activeNSpos].depth = depth; activeNS[activeNSpos].namespace = ns; } if (NSattrList) { lastNSAttr->nextSibling = attrnode; } else { NSattrList = attrnode; } lastNSAttr = attrnode; } else { #endif /*------------------------------------------------------------ | allocate new attribute node \------------------------------------------------------------*/ h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_attrNames), ArgName, &hnew); attrnode = (domAttrNode*) domAlloc(sizeof(domAttrNode)); memset(attrnode, 0, sizeof(domAttrNode)); attrnode->parentNode = node; attrnode->nodeName = (char *)&(h->key); attrnode->nodeType = ATTRIBUTE_NODE; attrnode->nodeFlags = 0; attrnode->nodeValue = (char*)MALLOC(nArgVal+1); attrnode->valueLength = nArgVal; memmove(attrnode->nodeValue, ArgVal, nArgVal); *(attrnode->nodeValue + nArgVal) = 0; if (ampersandSeen) { if (!TranslateEntityRefs(attrnode->nodeValue, &(attrnode->valueLength) )) { RetError("Entity parsing error", (start - xml)); } } if (attrList) { lastAttr->nextSibling = attrnode; } else { attrList = attrnode; } lastAttr = attrnode; #ifdef TDOM_NS } #endif *(ArgName + nArgName) = saved; while (SPACE(*x)) { x++; } } #ifdef TDOM_NS /*---------------------------------------------------------- | look for namespace of element \---------------------------------------------------------*/ domSplitQName (node->nodeName, tagPrefix, &localname); for (nspos = activeNSpos; nspos >= 0; nspos--) { if ( ((tagPrefix[0] == '\0') && (activeNS[nspos].namespace->prefix[0] == '\0')) || ((tagPrefix[0] != '\0') && (activeNS[nspos].namespace->prefix[0] != '\0') && (strcmp(tagPrefix, activeNS[nspos].namespace->prefix) == 0)) ) { if (activeNS[nspos].namespace->prefix[0] == '\0' && activeNS[nspos].namespace->uri[0] == '\0' && tagPrefix[0] == '\0') { /* xml-names rec. 5.2: "The default namespace can be set to the empty string. This has the same effect, within the scope of the declaration, of there being no default namespace." */ break; } node->namespace = activeNS[nspos].namespace->index; DBG(fprintf(stderr, "tag='%s' uri='%s' \n",node->nodeName, activeNS[nspos].namespace->uri); ) break; } } /*---------------------------------------------------------- | look for attribute namespace \---------------------------------------------------------*/ attrnode = attrList; while (attrnode) { domSplitQName ((char*)attrnode->nodeName, prefix, &localname); if (prefix[0] != '\0') { for (nspos = activeNSpos; nspos >= 0; nspos--) { if ( ((prefix[0] == '\0') && (activeNS[nspos].namespace->prefix[0] == '\0')) || ((prefix[0] != '\0') && (activeNS[nspos].namespace->prefix[0] != '\0') && (strcmp(prefix, activeNS[nspos].namespace->prefix) == 0)) ) { attrnode->namespace = activeNS[nspos].namespace->index; DBG(fprintf(stderr, "attr='%s' uri='%s' \n", attrnode->nodeName, activeNS[nspos].namespace->uri); ) break; } } } attrnode = attrnode->nextSibling; } if (lastNSAttr) { node->firstAttr = NSattrList; lastNSAttr->nextSibling = attrList; } else { node->firstAttr = attrList; } #else node->firstAttr = attrList; #endif if (*x=='/') { hasContent = 0; x++; if (*x!='>') { RetError("Syntax Error",(x - xml - 1) ); } } if (x[1] == 0) { #ifdef TDOM_NS FREE ((char *) activeNS); #endif return TCL_OK; } if (*x=='>') { x++; } if (hasContent) { #ifdef TDOM_NS depth++; #endif /*------------------------------------------------------------ | recurs to read child tags/texts \-----------------------------------------------------------*/ parent_node = node; } } } RetError("Unexpected end",(x - xml) ); } /* XML_SimpleParse */ /*---------------------------------------------------------------------------- | XML_SimpleParseDocument | | Create a document, parses the XML string starting at 'pos' and | continuing to the first encountered error. | \---------------------------------------------------------------------------*/ domDocument * XML_SimpleParseDocument ( char *xml, /* Complete text of the file being parsed */ int ignoreWhiteSpaces, char *baseURI, char *extResolver, int *pos, char **errStr ) { domDocument *doc = domCreateDoc(baseURI, 0); if (extResolver) { doc->extResolver = extResolver; } *pos = 0; XML_SimpleParse (xml, pos, doc, NULL, ignoreWhiteSpaces, errStr); domSetDocumentElement (doc); return doc; } /* XML_SimpleParseDocument */ tDOM-0.8.3/generic/win32.h0000644000175000017500000000053607470550501015315 0ustar ssobernissoberni /* This is stuff to make the code compile with VC++ 6.0 I know nearly nothing about other versions. */ #include #define isnan _isnan #define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 : ((_fpclass(d) == _FPCLASS_NINF) ? -1 :0)) /* #ifndef isnan */ /* int isnan(double number) { return (!(number == number)); } */ /* #endif */ tDOM-0.8.3/generic/aolstub.cpp0000644000175000017500000000444510657165325016371 0ustar ssobernissoberni/* * aolstub.cpp -- * * Adds interface for loading the extension into the AOLserver. * * See the file "LICENSE" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * Rcsid: @(#)$Id: aolstub.cpp,v 1.7 2007/08/10 22:46:45 rolf Exp $ * --------------------------------------------------------------------------- */ #if defined (NS_AOLSERVER) #include int Ns_ModuleVersion = 1; /* * Structure to pass to NsThread_Init. This holds the module * and virtual server name for proper interp initializations. * This is valid only for AOLservers 4.x or later. */ struct mydata { char *modname; char *server; }; /* *---------------------------------------------------------------------------- * * NsTdom_Init -- * * Loads the package in the Tcl interpreter. * * Results: * Standard Tcl result * * Side effects: * Package initialized. Tcl commands created. * *---------------------------------------------------------------------------- */ static int NsTdom_Init (Tcl_Interp *interp, void *cd) { struct mydata *md = (struct mydata*)cd; int ret = Tdom_Init(interp); if (ret != TCL_OK) { Ns_Log(Warning, "can't load module %s: %s", md->modname, Tcl_GetStringResult(interp)); } Tcl_SetAssocData(interp, "tdom:nsd", NULL, (ClientData)md); return TCL_OK; } /* *---------------------------------------------------------------------------- * * Ns_ModuleInit -- * * Called by the AOLserver when loading shared object file. * * Results: * Standard AOLserver result * * Side effects: * Many. Depends on the package. * *---------------------------------------------------------------------------- */ int Ns_ModuleInit(char *srv, char *mod) { struct mydata *md = NULL; md = (struct mydata*)ns_malloc(sizeof(struct mydata)); md->modname = strcpy(ns_malloc(strlen(mod)+1), mod); md->server = strcpy(ns_malloc(strlen(srv)+1), srv); return (Ns_TclInitInterps(srv, NsTdom_Init, (void*)md) == TCL_OK) ? NS_OK : NS_ERROR; } #endif /* NS_AOLSERVER */ /* EOF $RCSfile: aolstub.cpp,v $ */ /* Emacs Setup Variables */ /* Local Variables: */ /* mode: C */ /* indent-tabs-mode: nil */ /* c-basic-offset: 4 */ /* End: */ tDOM-0.8.3/generic/xmlsimple.h0000644000175000017500000000033410110023030016332 0ustar ssobernissoberni domDocument * XML_SimpleParseDocument ( char *xml, int ignoreWhiteSpaces, char *baseURI, char *extResolver, int *pos, char **errStr ); tDOM-0.8.3/generic/utf8conv.h0000644000175000017500000000530510107422323016115 0ustar ssobernissoberni/*--------------------------------------------------------------------------- | Copyright (C) 1999 Jochen C. Loewer (loewerj@hotmail.com) +---------------------------------------------------------------------------- | | $Id: utf8conv.h,v 1.3 2004/08/14 14:42:27 rolf Exp $ | | | Functions, which (try) to convert UTF-8 encoded Unicode strings back | to some 8bit encodings like ISO-8859-*, ... | | | The contents of this file are subject to the Mozilla Public License | Version 1.1 (the "License"); you may not use this file except in | compliance with the License. You may obtain a copy of the License at | http://www.mozilla.org/MPL/ | | Software distributed under the License is distributed on an "AS IS" | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | License for the specific language governing rights and limitations | under the License. | | The Original Code is tDOM. | | The Initial Developer of the Original Code is Jochen Loewer | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 | Jochen Loewer. All Rights Reserved. | | Contributor(s): | | | $Log: utf8conv.h,v $ | Revision 1.3 2004/08/14 14:42:27 rolf | Use 'Id' cvs keyword (instead of 'Header') in the file heads. | | Revision 1.2 2002/07/04 15:06:49 zoran | fixed reference to unsigned* to char since Sun compiler barfs at it. | | Revision 1.1.1.1 2002/02/22 01:05:35 rolf | tDOM0.7test with Jochens first set of patches | | | | written by Jochen Loewer | November, 1999 | \--------------------------------------------------------------------------*/ #ifndef __UTF8CONV_H__ #define __UTF8CONV_H__ /*--------------------------------------------------------------------------- | Includes | \--------------------------------------------------------------------------*/ #include #include #include /*--------------------------------------------------------------------------- | Typedefs | \--------------------------------------------------------------------------*/ typedef struct { int type; int start_code; int len; char * map; } TEncodingRule; typedef struct { const char * name; int fallback_char; TEncodingRule * rules; } TEncoding; /*-------------------------------------------------------------------------- | Function prototypes | \-------------------------------------------------------------------------*/ TEncoding * tdom_GetEncoding (char *name); char * tdom_GetEncodingName (TEncoding *encoding); void tdom_Utf8to8Bit (TEncoding *encoding, const char *utf8_string, int *len); #endif tDOM-0.8.3/generic/domhtml.c0000644000175000017500000017734410763333237016032 0ustar ssobernissoberni/*---------------------------------------------------------------------------- | Copyright (c) 2000 Jochen Loewer (loewerj@hotmail.com) |----------------------------------------------------------------------------- | | | !! EXPERIMENTAL / pre alpha !! | A simple (hopefully fast) HTML parser to build up a DOM structure | in memory. | Based on xmlsimple.c. | !! EXPERIMENTAL / pre alpha !! | | | The contents of this file are subject to the Mozilla Public License | Version 1.1 (the "License"); you may not use this file except in | compliance with the License. You may obtain a copy of the License at | http://www.mozilla.org/MPL/ | | Software distributed under the License is distributed on an "AS IS" | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | License for the specific language governing rights and limitations | under the License. | | The Original Code is tDOM. | | The Initial Developer of the Original Code is Jochen Loewer | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 | Jochen Loewer. All Rights Reserved. | | Contributor(s): | | | written by Jochen Loewer | October 2000 | | ------------------------------------------------------------------------ | | A parser for XML. | | Copyright (C) 1998 D. Richard Hipp | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Library General Public | License as published by the Free Software Foundation; either | version 2 of the License, or (at your option) any later version. | | This library 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 | Library General Public License for more details. | | You should have received a copy of the GNU Library General Public | License along with this library; if not, write to the | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | Boston, MA 02111-1307, USA. | | Author contact information: | drh@acm.org | http://www.hwaci.com/drh/ | \---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- | Includes | \---------------------------------------------------------------------------*/ #include #include #include #include /*---------------------------------------------------------------------------- | Defines | \---------------------------------------------------------------------------*/ #define DBG(x) #define RetError(m,p) *errStr = tdomstrdup(m); *pos = p; return TCL_ERROR; #define SPACE(c) ((c)==' ' || (c)=='\n' || (c)=='\t' || (c)=='\r') #define IsLetter(c) ( ((c)>='A' && (c)<='Z') || ((c)>='a' && (c)<='z') || ((c) >= '0' && (c) <= '9') ) #define TU(c) toupper((unsigned char)c) /*---------------------------------------------------------------------------- | Begin Character Entity Translator | | | The next section of code implements routines used to translate | character entity references into their corresponding strings. | | Examples: | | & "&" | < "<" | > ">" |   " " | \---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- | Each entity reference is recorded as an instance of the following | tructure \---------------------------------------------------------------------------*/ typedef struct Er Er; struct Er { char *zName; /* The name of this entity reference. ex: "amp" */ char *zValue; /* The value for this entity. ex: "&" */ Er *pNext; /* Next entity with the same hash on zName */ }; /*---------------------------------------------------------------------------- | The size of the hash table. For best results this should | be a prime number which is about the same size as the number of | character entity references known to the system. | \---------------------------------------------------------------------------*/ #if TclOnly8Bits #define ER_HASH_SIZE 107 #else #define ER_HASH_SIZE 257 #endif /*---------------------------------------------------------------------------- | The following flag is TRUE if entity reference hash table needs | to be initialized. | \---------------------------------------------------------------------------*/ static int bErNeedsInit = 1; TDomThreaded(static Tcl_Mutex initMutex;) /*---------------------------------------------------------------------------- | The hash table | | If the name of an entity reference hashes to the value H, then | apErHash[H] will point to a linked list of Er structures, one of | which will be the Er structure for that entity reference | \---------------------------------------------------------------------------*/ static Er *apErHash[ER_HASH_SIZE]; /*---------------------------------------------------------------------------- | ErHash -- | | Hash an entity reference name. The value returned is an | integer between 0 and Er_HASH_SIZE-1, inclusive. | \---------------------------------------------------------------------------*/ static int ErHash( const char *zName ) { int h = 0; /* The hash value to be returned */ char c; /* The next character in the name being hashed */ while( (c=*zName)!=0 ){ h = h<<5 ^ h ^ c; zName++; } if( h<0 ) h = -h; return h % ER_HASH_SIZE; } /* ErHash */ /*---------------------------------------------------------------------------- | The following is a table of all entity references. To create | new character entities, add entries to this table. | | Note: For the decoder to work, the name of the entity reference | must not be shorter than the value. | \---------------------------------------------------------------------------*/ static Er er_sequences[] = { { "amp", "&", 0 }, { "lt", "<", 0 }, { "gt", ">", 0 }, { "apos", "'", 0 }, { "quot", "\"", 0 }, #if TclOnly8Bits { "nbsp", "\240", 0 }, { "iexcl", "\241", 0 }, /* inverted exclamation mark */ { "cent", "\242", 0 }, /* cent sign */ { "pound", "\243", 0 }, /* pound sterling sign */ { "curren", "\244", 0 }, /* general currency sign */ { "yen", "\245", 0 }, /* yen sign */ { "brvbar", "\246", 0 }, /* broken (vertical) bar */ { "sect", "\247", 0 }, /* section sign */ { "uml", "\250", 0 }, /* umlaut (dieresis) */ { "copy", "\251", 0 }, /* copyright sign */ { "ordf", "\252", 0 }, /* ordinal indicator, feminine */ { "laquo", "\253", 0 }, /* angle quotation mark, left */ { "not", "\254", 0 }, /* not sign */ { "shy", "\255", 0 }, /* soft hyphen */ { "reg", "\256", 0 }, /* registered sign */ { "macr", "\257", 0 }, /* macron */ { "deg", "\260", 0 }, /* degree sign */ { "plusmn", "\261", 0 }, /* plus-or-minus sign */ { "sup2", "\262", 0 }, /* superscript two */ { "sup3", "\263", 0 }, /* superscript three */ { "acute", "\264", 0 }, /* acute accent */ { "micro", "\265", 0 }, /* micro sign */ { "para", "\266", 0 }, /* pilcrow (paragraph sign) */ { "middot", "\267", 0 }, /* middle dot */ { "cedil", "\270", 0 }, /* cedilla */ { "sup1", "\271", 0 }, /* superscript one */ { "ordm", "\272", 0 }, /* ordinal indicator, masculine */ { "raquo", "\273", 0 }, /* angle quotation mark, right */ { "frac14", "\274", 0 }, /* fraction one-quarter */ { "frac12", "\275", 0 }, /* fraction one-half */ { "frac34", "\276", 0 }, /* fraction three-quarters */ { "iquest", "\277", 0 }, /* inverted question mark */ { "Agrave", "\300", 0 }, /* capital A, grave accent */ { "Aacute", "\301", 0 }, /* capital A, acute accent */ { "Acirc", "\302", 0 }, /* capital A, circumflex accent */ { "Atilde", "\303", 0 }, /* capital A, tilde */ { "Auml", "\304", 0 }, /* capital A, dieresis or umlaut mark */ { "Aring", "\305", 0 }, /* capital A, ring */ { "AElig", "\306", 0 }, /* capital AE diphthong (ligature) */ { "Ccedil", "\307", 0 }, /* capital C, cedilla */ { "Egrave", "\310", 0 }, /* capital E, grave accent */ { "Eacute", "\311", 0 }, /* capital E, acute accent */ { "Ecirc", "\312", 0 }, /* capital E, circumflex accent */ { "Euml", "\313", 0 }, /* capital E, dieresis or umlaut mark */ { "Igrave", "\314", 0 }, /* capital I, grave accent */ { "Iacute", "\315", 0 }, /* capital I, acute accent */ { "Icirc", "\316", 0 }, /* capital I, circumflex accent */ { "Iuml", "\317", 0 }, /* capital I, dieresis or umlaut mark */ { "ETH", "\320", 0 }, /* capital Eth, Icelandic */ { "Ntilde", "\321", 0 }, /* capital N, tilde */ { "Ograve", "\322", 0 }, /* capital O, grave accent */ { "Oacute", "\323", 0 }, /* capital O, acute accent */ { "Ocirc", "\324", 0 }, /* capital O, circumflex accent */ { "Otilde", "\325", 0 }, /* capital O, tilde */ { "Ouml", "\326", 0 }, /* capital O, dieresis or umlaut mark */ { "times", "\327", 0 }, /* multiply sign */ { "Oslash", "\330", 0 }, /* capital O, slash */ { "Ugrave", "\331", 0 }, /* capital U, grave accent */ { "Uacute", "\332", 0 }, /* capital U, acute accent */ { "Ucirc", "\333", 0 }, /* capital U, circumflex accent */ { "Uuml", "\334", 0 }, /* capital U, dieresis or umlaut mark */ { "Yacute", "\335", 0 }, /* capital Y, acute accent */ { "THORN", "\336", 0 }, /* capital THORN, Icelandic */ { "szlig", "\337", 0 }, /* small sharp s, German (sz ligature) */ { "agrave", "\340", 0 }, /* small a, grave accent */ { "aacute", "\341", 0 }, /* small a, acute accent */ { "acirc", "\342", 0 }, /* small a, circumflex accent */ { "atilde", "\343", 0 }, /* small a, tilde */ { "auml", "\344", 0 }, /* small a, dieresis or umlaut mark */ { "aring", "\345", 0 }, /* small a, ring */ { "aelig", "\346", 0 }, /* small ae diphthong (ligature) */ { "ccedil", "\347", 0 }, /* small c, cedilla */ { "egrave", "\350", 0 }, /* small e, grave accent */ { "eacute", "\351", 0 }, /* small e, acute accent */ { "ecirc", "\352", 0 }, /* small e, circumflex accent */ { "euml", "\353", 0 }, /* small e, dieresis or umlaut mark */ { "igrave", "\354", 0 }, /* small i, grave accent */ { "iacute", "\355", 0 }, /* small i, acute accent */ { "icirc", "\356", 0 }, /* small i, circumflex accent */ { "iuml", "\357", 0 }, /* small i, dieresis or umlaut mark */ { "eth", "\360", 0 }, /* small eth, Icelandic */ { "ntilde", "\361", 0 }, /* small n, tilde */ { "ograve", "\362", 0 }, /* small o, grave accent */ { "oacute", "\363", 0 }, /* small o, acute accent */ { "ocirc", "\364", 0 }, /* small o, circumflex accent */ { "otilde", "\365", 0 }, /* small o, tilde */ { "ouml", "\366", 0 }, /* small o, dieresis or umlaut mark */ { "divide", "\367", 0 }, /* divide sign */ { "oslash", "\370", 0 }, /* small o, slash */ { "ugrave", "\371", 0 }, /* small u, grave accent */ { "uacute", "\372", 0 }, /* small u, acute accent */ { "ucirc", "\373", 0 }, /* small u, circumflex accent */ { "uuml", "\374", 0 }, /* small u, dieresis or umlaut mark */ { "yacute", "\375", 0 }, /* small y, acute accent */ { "thorn", "\376", 0 }, /* small thorn, Icelandic */ { "yuml", "\377", 0 }, /* small y, dieresis or umlaut mark */ #else { "nbsp", "\xC2\xA0", 0 }, { "iexcl", "\xC2\xA1", 0 }, { "cent", "\xC2\xA2", 0 }, { "pound", "\xC2\xA3", 0 }, { "curren", "\xC2\xA4", 0 }, { "yen", "\xC2\xA5", 0 }, { "brvbar", "\xC2\xA6", 0 }, { "sect", "\xC2\xA7", 0 }, { "uml", "\xC2\xA8", 0 }, { "copy", "\xC2\xA9", 0 }, { "ordf", "\xC2\xAA", 0 }, { "laquo", "\xC2\xAB", 0 }, { "not", "\xC2\xAC", 0 }, { "shy", "\xC2\xAD", 0 }, { "reg", "\xC2\xAE", 0 }, { "macr", "\xC2\xAF", 0 }, { "deg", "\xC2\xB0", 0 }, { "plusmn", "\xC2\xB1", 0 }, { "sup2", "\xC2\xB2", 0 }, { "sup3", "\xC2\xB3", 0 }, { "acute", "\xC2\xB4", 0 }, { "micro", "\xC2\xB5", 0 }, { "para", "\xC2\xB6", 0 }, { "middot", "\xC2\xB7", 0 }, { "cedil", "\xC2\xB8", 0 }, { "sup1", "\xC2\xB9", 0 }, { "ordm", "\xC2\xBA", 0 }, { "raquo", "\xC2\xBB", 0 }, { "frac14", "\xC2\xBC", 0 }, { "frac12", "\xC2\xBD", 0 }, { "frac34", "\xC2\xBE", 0 }, { "iquest", "\xC2\xBF", 0 }, { "Agrave", "\xC3\x80", 0 }, { "Aacute", "\xC3\x81", 0 }, { "Acirc", "\xC3\x82", 0 }, { "Atilde", "\xC3\x83", 0 }, { "Auml", "\xC3\x84", 0 }, { "Aring", "\xC3\x85", 0 }, { "AElig", "\xC3\x86", 0 }, { "Ccedil", "\xC3\x87", 0 }, { "Egrave", "\xC3\x88", 0 }, { "Eacute", "\xC3\x89", 0 }, { "Ecirc", "\xC3\x8A", 0 }, { "Euml", "\xC3\x8B", 0 }, { "Igrave", "\xC3\x8C", 0 }, { "Iacute", "\xC3\x8D", 0 }, { "Icirc", "\xC3\x8E", 0 }, { "Iuml", "\xC3\x8F", 0 }, { "ETH", "\xC3\x90", 0 }, { "Ntilde", "\xC3\x91", 0 }, { "Ograve", "\xC3\x92", 0 }, { "Oacute", "\xC3\x93", 0 }, { "Ocirc", "\xC3\x94", 0 }, { "Otilde", "\xC3\x95", 0 }, { "Ouml", "\xC3\x96", 0 }, { "times", "\xC3\x97", 0 }, { "Oslash", "\xC3\x98", 0 }, { "Ugrave", "\xC3\x99", 0 }, { "Uacute", "\xC3\x9A", 0 }, { "Ucirc", "\xC3\x9B", 0 }, { "Uuml", "\xC3\x9C", 0 }, { "Yacute", "\xC3\x9D", 0 }, { "THORN", "\xC3\x9E", 0 }, { "szlig", "\xC3\x9F", 0 }, { "agrave", "\xC3\xA0", 0 }, { "aacute", "\xC3\xA1", 0 }, { "acirc", "\xC3\xA2", 0 }, { "atilde", "\xC3\xA3", 0 }, { "auml", "\xC3\xA4", 0 }, { "aring", "\xC3\xA5", 0 }, { "aelig", "\xC3\xA6", 0 }, { "ccedil", "\xC3\xA7", 0 }, { "egrave", "\xC3\xA8", 0 }, { "eacute", "\xC3\xA9", 0 }, { "ecirc", "\xC3\xAA", 0 }, { "euml", "\xC3\xAB", 0 }, { "igrave", "\xC3\xAC", 0 }, { "iacute", "\xC3\xAD", 0 }, { "icirc", "\xC3\xAE", 0 }, { "iuml", "\xC3\xAF", 0 }, { "eth", "\xC3\xB0", 0 }, { "ntilde", "\xC3\xB1", 0 }, { "ograve", "\xC3\xB2", 0 }, { "oacute", "\xC3\xB3", 0 }, { "ocirc", "\xC3\xB4", 0 }, { "otilde", "\xC3\xB5", 0 }, { "ouml", "\xC3\xB6", 0 }, { "divide", "\xC3\xB7", 0 }, { "oslash", "\xC3\xB8", 0 }, { "ugrave", "\xC3\xB9", 0 }, { "uacute", "\xC3\xBA", 0 }, { "ucirc", "\xC3\xBB", 0 }, { "uuml", "\xC3\xBC", 0 }, { "yacute", "\xC3\xBD", 0 }, { "thorn", "\xC3\xBE", 0 }, { "yuml", "\xC3\xBF", 0 }, /* "Special" chars, according to XHTML xhtml-special.ent */ { "OElig", "\xC5\x92", 0 }, { "oelig", "\xC5\x93", 0 }, { "Scaron", "\xC5\xA0", 0 }, { "scaron", "\xC5\xA1", 0 }, { "Yuml", "\xC5\xB8", 0 }, { "circ", "\xCB\x86", 0 }, { "tilde", "\xCB\x9C", 0 }, { "ensp", "\xE2\x80\x82", 0 }, { "emsp", "\xE2\x80\x83", 0 }, { "thinsp", "\xE2\x80\x89", 0 }, { "zwnj", "\xE2\x81\xB0", 0 }, { "zwj", "\xE2\x80\x8D", 0 }, { "lrm", "\xE2\x80\x8E", 0 }, { "rlm", "\xE2\x80\x8F", 0 }, { "ndash", "\xE2\x80\x93", 0 }, { "mdash", "\xE2\x80\x94", 0 }, { "lsquo", "\xE2\x80\x98", 0 }, { "rsquo", "\xE2\x80\x99", 0 }, { "sbquo", "\xE2\x80\x9A", 0 }, { "ldquo", "\xE2\x80\x9C", 0 }, { "rdquo", "\xE2\x80\x9D", 0 }, { "bdquo", "\xE2\x80\x9E", 0 }, { "dagger", "\xE2\x80\xA0", 0 }, { "Dagger", "\xE2\x80\xA1", 0 }, { "permil", "\xE2\x80\xB0", 0 }, { "lsaquo", "\xE2\x80\xB9", 0 }, { "rsaquo", "\xE2\x80\xBA", 0 }, { "euro", "\xE2\x82\xAC", 0 }, /* "Symbol" chars, according to XHTML xhtml-symbol.ent */ { "fnof", "\xC6\x92", 0 }, { "Alpha", "\xCE\x91", 0 }, { "Beta", "\xCE\x92", 0 }, { "Gamma", "\xCE\x93", 0 }, { "Delta", "\xCE\x94", 0 }, { "Epsilon", "\xCE\x95", 0 }, { "Zeta", "\xCE\x96", 0 }, { "Eta", "\xCE\x97", 0 }, { "Theta", "\xCE\x98", 0 }, { "Iota", "\xCE\x99", 0 }, { "Kappa", "\xCE\x9A", 0 }, { "Lambda", "\xCE\x9B", 0 }, { "Mu", "\xCE\x9C", 0 }, { "Nu", "\xCE\x9D", 0 }, { "Xi", "\xCE\x9E", 0 }, { "Omicron", "\xCE\x9F", 0 }, { "Pi", "\xCE\xA0", 0 }, { "Rho", "\xCE\xA1", 0 }, { "Sigma", "\xCE\xA3", 0 }, { "Tau", "\xCE\xA4", 0 }, { "Upsilon", "\xCE\xA5", 0 }, { "Phi", "\xCE\xA6", 0 }, { "Chi", "\xCE\xA7", 0 }, { "Psi", "\xCE\xA8", 0 }, { "Omega", "\xCE\xA9", 0 }, { "alpha", "\xCE\xB1", 0 }, { "beta", "\xCE\xB2", 0 }, { "gamma", "\xCE\xB3", 0 }, { "delta", "\xCE\xB4", 0 }, { "epsilon", "\xCE\xB5", 0 }, { "zeta", "\xCE\xB6", 0 }, { "eta", "\xCE\xB7", 0 }, { "theta", "\xCE\xB8", 0 }, { "iota", "\xCE\xB9", 0 }, { "kappa", "\xCE\xBA", 0 }, { "lambda", "\xCE\xBB", 0 }, { "mu", "\xCE\xBC", 0 }, { "nu", "\xCE\xBD", 0 }, { "xi", "\xCE\xBE", 0 }, { "omicron", "\xCE\xBF", 0 }, { "pi", "\xCF\x80", 0 }, { "rho", "\xCF\x81", 0 }, { "sigmaf", "\xCF\x82", 0 }, { "sigma", "\xCF\x83", 0 }, { "tau", "\xCF\x84", 0 }, { "upsilon", "\xCF\x85", 0 }, { "phi", "\xCF\x86", 0 }, { "chi", "\xCF\x87", 0 }, { "psi", "\xCF\x88", 0 }, { "omega", "\xCF\x89", 0 }, { "thetasym", "\xCF\x91", 0 }, { "upsih", "\xCF\x92", 0 }, { "piv", "\xCF\x96", 0 }, { "bull", "\xE2\x80\xA2", 0 }, { "hellip", "\xE2\x80\xA6", 0 }, { "prime", "\xE2\x80\xB2", 0 }, { "Prime", "\xE2\x80\xB3", 0 }, { "oline", "\xE2\x80\xBE", 0 }, { "frasl", "\xE2\x81\x84", 0 }, { "weierp", "\xE2\x84\x98", 0 }, { "image", "\xE2\x84\x91", 0 }, { "real", "\xE2\x84\x9C", 0 }, { "trade", "\xE2\x84\xA2", 0 }, { "alefsym", "\xE2\x84\xB5", 0 }, { "larr", "\xE2\x86\x90", 0 }, { "uarr", "\xE2\x86\x91", 0 }, { "rarr", "\xE2\x86\x92", 0 }, { "darr", "\xE2\x86\x93", 0 }, { "harr", "\xE2\x86\x94", 0 }, { "crarr", "\xE2\x86\xB5", 0 }, { "lArr", "\xE2\x87\x90", 0 }, { "uArr", "\xE2\x87\x91", 0 }, { "rArr", "\xE2\x87\x92", 0 }, { "dArr", "\xE2\x87\x93", 0 }, { "hArr", "\xE2\x87\x94", 0 }, { "forall", "\xE2\x88\x80", 0 }, { "part", "\xE2\x88\x82", 0 }, { "exist", "\xE2\x88\x83", 0 }, { "empty", "\xE2\x88\x85", 0 }, { "nabla", "\xE2\x88\x87", 0 }, { "isin", "\xE2\x88\x88", 0 }, { "notin", "\xE2\x88\x89", 0 }, { "ni", "\xE2\x88\x8B", 0 }, { "prod", "\xE2\x88\x8F", 0 }, { "sum", "\xE2\x88\x91", 0 }, { "minus", "\xE2\x88\x92", 0 }, { "lowast", "\xE2\x88\x97", 0 }, { "radic", "\xE2\x88\x9A", 0 }, { "prop", "\xE2\x88\x9D", 0 }, { "infin", "\xE2\x88\x9E", 0 }, { "ang", "\xE2\x88\xA0", 0 }, { "and", "\xE2\x88\xA7", 0 }, { "or", "\xE2\x88\xA8", 0 }, { "cap", "\xE2\x88\xA9", 0 }, { "cup", "\xE2\x88\xAA", 0 }, { "int", "\xE2\x88\xAB", 0 }, { "there4", "\xE2\x88\xB4", 0 }, { "sim", "\xE2\x88\xBC", 0 }, { "cong", "\xE2\x89\x85", 0 }, { "asymp", "\xE2\x89\x88", 0 }, { "ne", "\xE2\x89\xA0", 0 }, { "equiv", "\xE2\x89\xA1", 0 }, { "le", "\xE2\x89\xA4", 0 }, { "ge", "\xE2\x89\xA5", 0 }, { "sub", "\xE2\x8A\x82", 0 }, { "sup", "\xE2\x8A\x83", 0 }, { "nsub", "\xE2\x8A\x84", 0 }, { "sube", "\xE2\x8A\x86", 0 }, { "supe", "\xE2\x8A\x87", 0 }, { "oplus", "\xE2\x8A\x95", 0 }, { "otimes", "\xE2\x8A\x97", 0 }, { "perp", "\xE2\x8A\xA5", 0 }, { "sdot", "\xE2\x8B\x85", 0 }, { "lceil", "\xE2\x8C\x88", 0 }, { "rceil", "\xE2\x8C\x89", 0 }, { "lfloor", "\xE2\x8C\x8A", 0 }, { "rfloor", "\xE2\x8C\x8B", 0 }, { "lang", "\xE2\x8C\xA9", 0 }, { "rang", "\xE2\x8C\xAA", 0 }, { "loz", "\xE2\x97\x8A", 0 }, { "spades", "\xE2\x99\xA0", 0 }, { "clubs", "\xE2\x99\xA3", 0 }, { "hearts", "\xE2\x99\xA5", 0 }, { "diams", "\xE2\x99\xA6", 0 }, #endif }; /*---------------------------------------------------------------------------- | ErInit -- | | Initialize the entity reference hash table | \---------------------------------------------------------------------------*/ static void ErInit (void) { size_t i; /* For looping thru the list of entity references */ int h; /* The hash on a entity */ for(i=0; i='0') && (c<='9')) { value += c-'0'; } else if ((c>='A') && (c<='F')) { value += c-'A' + 10; } else if ((c>='a') && (c<='f')) { value += c-'a' + 10; } else { /* error */ } i++; } } else { while ((c=z[i]) && (c!=';')) { value = value * 10; if ((c>='0') && (c<='9')) { value += c-'0'; } else { /* error */ } i++; } } if (z[i]!=';') { /* error */ } from = i+1; #if TclOnly8Bits z[to++] = value; #else if (value < 0x80) { z[to++] = value; } else if (value <= 0x7FF) { z[to++] = (char) ((value >> 6) | 0xC0); z[to++] = (char) ((value | 0x80) & 0xBF); } else if (value <= 0xFFFF) { z[to++] = (char) ((value >> 12) | 0xE0); z[to++] = (char) (((value >> 6) | 0x80) & 0xBF); z[to++] = (char) ((value | 0x80) & 0xBF); } else { /* error */ } #endif } else { while (z[i] && isalpha((unsigned char)z[i])) { i++; } c = z[i]; z[i] = 0; h = ErHash(&z[from+1]); p = apErHash[h]; while (p && strcmp(p->zName,&z[from+1])!=0 ) { p = p->pNext; } z[i] = c; if (p) { zVal = p->zValue; while (*zVal) { z[to++] = *(zVal++); } from = i; if (c==';') from++; } else { z[to++] = z[from++]; } } } else { z[to++] = z[from++]; } } z[to] = 0; *newLen = to; } /*---------------------------------------------------------------------------- | End Of Character Entity Translator \---------------------------------------------------------------------------*/ DBG( /*---------------------------------------------------------------------------- | getDeep | \---------------------------------------------------------------------------*/ static int getDeep (domNode *n) { int d; d = 0; while (n->parentNode != NULL) { d++; n = n->parentNode; } return d; } ) /*---------------------------------------------------------------------------- | HTML_SimpleParse (non recursive) | | Parses the HTML string starting at 'pos' and continuing to the | first encountered error. | \---------------------------------------------------------------------------*/ static int HTML_SimpleParse ( char *html, /* HTML string */ int *pos, /* Index of next unparsed character in xml */ domDocument *doc, domNode *parent_nodeOld, int ignoreWhiteSpaces, char **errStr ) { register int c; /* Next character of the input file */ register char *pn, *e; register char *x, *start, *piSep; int saved; int hasContent; domNode *pnode; domNode *node = NULL, *parent_node = NULL; domTextNode *tnode; domAttrNode *attrnode, *lastAttr; int ampersandSeen = 0; int only_whites = 0; int hnew, autoclose, ignore; char tmp[250], *y = NULL; Tcl_HashEntry *h; domProcessingInstructionNode *pinode; x = &(html[*pos]); while ( (c=*x)!=0 ) { start = x; if ((c!='<') || ((c=='<') && (x[1]!='!') && (x[2]!='-') && (x[3]!='-') && (x[1]!='/') && !IsLetter(x[1])) ) { /*---------------------------------------------------------------- | read text between tags | \---------------------------------------------------------------*/ readText: ampersandSeen = 0; only_whites = 1; if (c=='<') x++; while ( (c=*x)!=0 && c!='<' ) { if (c=='&') ampersandSeen = 1; if ( !SPACE(c) ) only_whites = 0; x++; } if (!(only_whites && ignoreWhiteSpaces) && parent_node) { /*-------------------------------------------------------- | allocate new TEXT node \-------------------------------------------------------*/ tnode = (domTextNode*) domAlloc(sizeof(domTextNode)); memset(tnode, 0, sizeof(domTextNode)); tnode->nodeType = TEXT_NODE; tnode->nodeFlags = 0; tnode->namespace = 0; tnode->ownerDocument = doc; tnode->nodeNumber = NODE_NO(doc); tnode->valueLength = (x - start); tnode->nodeValue = (char*)MALLOC((x - start)+1); memmove(tnode->nodeValue, start, (x - start)); *(tnode->nodeValue + (x - start)) = 0; DBG(fprintf(stderr, "New text node: '%s'\n", tnode->nodeValue);) if (ampersandSeen) { TranslateEntityRefs(tnode->nodeValue, &(tnode->valueLength) ); } tnode->parentNode = parent_node; if (parent_node->firstChild) { parent_node->lastChild->nextSibling = (domNode*)tnode; tnode->previousSibling = parent_node->lastChild; parent_node->lastChild = (domNode*)tnode; } else { parent_node->firstChild = parent_node->lastChild = (domNode*)tnode; } node = (domNode*)tnode; } } else if (x[1]=='/') { /*------------------------------------------------------------ | read and check closing tag \-----------------------------------------------------------*/ x += 2; while ((c=*x)!=0 && c!='>' && c!='<' && !SPACE(c) ) { *x = tolower(c); x++; } if (c==0) { RetError("Missing \">\"",(start-html) ); } if ( (x-start)==2) { RetError("Null markup name",(start-html) ); } *x = '\0'; /* temporarily terminate the string */ /*---------------------------------------------------------------------- | check for tags which could optional be close | like \---------------------------------------------------------------------*/ ignore = 0; pnode = NULL; if (parent_node) { if (parent_node->lastChild && (parent_node->lastChild->nodeType == ELEMENT_NODE)) { pnode = parent_node->lastChild; } else if (parent_node->lastChild && parent_node->lastChild->previousSibling && (parent_node->lastChild->previousSibling->nodeType == ELEMENT_NODE)) { pnode = parent_node->lastChild->previousSibling; } } if (pnode) { DBG(fprintf(stderr, "'%s' closing with last empty tag '%s' ?\n", start+2, pnode->nodeName);) if (strcmp(start+2,pnode->nodeName)==0) { switch (*(start+2)) { case 'o': if (!strcmp(start+2,"option")) ignore = 1; break; } } } if (!ignore) { /*---------------------------------------------------------------------- | look for a corresponding opening tag the way up the tag hierarchy \---------------------------------------------------------------------*/ pnode = parent_node; while (pnode != NULL) { DBG(fprintf(stderr, "checking '%s' to top hierarchy: '%s' \n", start+2,pnode->nodeName);) if (!strcmp(start+2,pnode->nodeName)) break; pnode = pnode->parentNode; } if (pnode == NULL) { /* begining tag was not found the way up the tag hierarchy -> ignore the tag */ DBG(fprintf(stderr,"ignoring closing '%s' \n", start+2);) ignore = 1; } } if (!ignore) { pn = (char*)parent_node->nodeName; while (1) { DBG(fprintf(stderr, "comparing '%s' with pn='%s' \n", start+2, pn);) if (strcmp(start+2,pn)!=0) { /*---------------------------------------------------------- | check for parent tags which allow closing of sub tags | which belong to the parent tag \---------------------------------------------------------*/ ignore = 0; if (!strcmp(pn,"table") && (!strcmp(start+2,"tr") || !strcmp(start+2,"td")) ) { ignore = 1; } if (ignore) { parent_node = node->parentNode; break; } /*--------------------------------------------------------------- | check for tags for which end tag can be omitted \--------------------------------------------------------------*/ autoclose = 0; switch (pn[0]) { case 'a': if (!strcmp(pn,"a")) autoclose = 1; break; case 'b': if (!strcmp(pn,"b")) autoclose = 1; break; case 'c': if (!strcmp(pn,"colgroup")) autoclose = 1; break; case 'd': if (!strcmp(pn,"dd") || !strcmp(pn,"dt") || (!strcmp(start+2,"form") && !strcmp(pn,"div")) ) autoclose = 1; break; case 'h': if (!strcmp(pn,"head") || !strcmp(pn,"html")) autoclose = 1; break; case 'f': if (!strcmp(pn,"font")|| !strcmp(pn,"form")) autoclose = 1; break; case 'i': if (!strcmp(pn,"i")) autoclose = 1; break; case 'l': if (!strcmp(pn,"li")) autoclose = 1; break; case 'n': if (!strcmp(pn,"noscript")) autoclose = 1; break; case 'o': if (!strcmp(pn,"option")) autoclose = 1; break; case 'p': if (!strcmp(pn,"p")) autoclose = 1; break; case 's': if (!strcmp(pn,"span")) autoclose = 1; break; case 't': if (!strcmp(pn,"tbody") || !strcmp(pn,"td") || !strcmp(pn,"tfoot") || !strcmp(pn,"thead") || !strcmp(pn,"th") || !strcmp(pn,"tr") || !strcmp(pn,"tt")) autoclose = 1; break; case 'u': if (!strcmp(pn,"ul")) autoclose = 1; break; /* ext */ } /*--------------------------------------------------------------- | check for tags for close inner tags \--------------------------------------------------------------*/ switch (start[2]) { case 'b': if (!strcmp(start+2,"body")) autoclose = 1; break; } if (autoclose) { DBG(fprintf(stderr, "autoclose '%s' with '%s' \n", pn, start+2);) if (parent_node != NULL) { node = parent_node; parent_node = node->parentNode; pn = (char*)node->nodeName; break; } } sprintf(tmp, "Unterminated element '%s' (within '%s')", start+2, pn); *x = c; /* remove temporarily termination */ RetError(tmp,(x - html)); } break; } /* move up */ node = parent_node; parent_node = NULL; if (node) parent_node = node->parentNode; } *x = c; /* remove temporarily termination */ while (SPACE(*x)) { x++; } if (*x=='>') { x++; } else { if (*x == '<') { /* start of new tag, ends closing tag */ } else { RetError("Missing \">\"",(x - html)-1); } } if (parent_node == NULL) { /* we return to main node and so finished parsing */ return TCL_OK; } continue; } else { x++; if (*x=='!') { if (x[1]=='-' && x[2]=='-') { /*-------------------------------------------------------- | read over a comment \-------------------------------------------------------*/ x += 3; while ( (c=*x)!=0 && (c!='-' || x[1]!='-' || x[2]!='>')) { x++; } if (*x) { /*---------------------------------------------------- | allocate new COMMENT node for comments \---------------------------------------------------*/ tnode = (domTextNode*) domAlloc(sizeof(domTextNode)); memset(tnode, 0, sizeof(domTextNode)); tnode->nodeType = COMMENT_NODE; tnode->nodeFlags = 0; tnode->namespace = 0; tnode->ownerDocument = doc; tnode->nodeNumber = NODE_NO(doc); tnode->parentNode = parent_node; tnode->valueLength = x - start - 4; tnode->nodeValue = (char*)MALLOC(tnode->valueLength+1); memmove(tnode->nodeValue, start+4, tnode->valueLength); *(tnode->nodeValue + tnode->valueLength) = 0; if (parent_node == NULL) { if (doc->rootNode->lastChild) { tnode->previousSibling = doc->rootNode->lastChild; doc->rootNode->lastChild->nextSibling = (domNode *) tnode; } else { doc->rootNode->firstChild = (domNode*) tnode; } doc->rootNode->lastChild = (domNode*) tnode; } else { if (parent_node->firstChild) { parent_node->lastChild->nextSibling = (domNode*)tnode; tnode->previousSibling = parent_node->lastChild; parent_node->lastChild = (domNode*)tnode; } else { parent_node->firstChild = parent_node->lastChild = (domNode*)tnode; } } x += 3; } else { RetError("Unterminated comment",(start-html)); } continue; } else if (TU(x[1])=='D' && TU(x[2])=='O' && TU(x[3])=='C' && TU(x[4])=='T' && TU(x[5])=='Y' && TU(x[6])=='P' && TU(x[7])=='E' ) { /*-------------------------------------------------------- | read over a DOCTYPE definition \-------------------------------------------------------*/ x += 8; start = x; while (*x!=0) { if (*x=='[') { x++; while ((*x!=0) && (*x!=']')) x++; } else if (*x=='>') { break; } else { x++; } } if (*x) { x++; } else { RetError("Unterminated DOCTYPE definition",(start-html)); } continue; } else if (x[1]=='[' && x[2]=='C' && x[3]=='D' && x[4]=='A' && x[5]=='T' && x[6]=='A' && x[7]=='[' ) { /*-------------------------------------------------------- | read over a '))) { x++; } if (*x) { if (parent_node) { /*---------------------------------------------------- | allocate new TEXT node for CDATA section data \---------------------------------------------------*/ tnode = (domTextNode*) domAlloc(sizeof(domTextNode)); memset(tnode, 0, sizeof(domTextNode)); tnode->nodeType = TEXT_NODE; tnode->nodeFlags = 0; tnode->namespace = 0; tnode->ownerDocument = doc; tnode->nodeNumber = NODE_NO(doc); tnode->parentNode = parent_node; tnode->valueLength = (x - start); tnode->nodeValue = (char*)MALLOC((x - start)+1); memmove(tnode->nodeValue, start, (x - start)); *(tnode->nodeValue + (x - start)) = 0; if (parent_node->firstChild) { parent_node->lastChild->nextSibling = (domNode*)tnode; tnode->previousSibling = parent_node->lastChild; parent_node->lastChild = (domNode*)tnode; } else { parent_node->firstChild = parent_node->lastChild = (domNode*)tnode; } } x += 3; } else { RetError("Unterminated CDATA definition",(start-html) ); } continue; } else { RetError("Incorrect ')) { x++; } if (*x) { /*------------------------------------------------------------ | allocate new PI node for processing instruction section \-----------------------------------------------------------*/ pinode = (domProcessingInstructionNode*) MALLOC(sizeof(domProcessingInstructionNode)); memset(pinode, 0, sizeof(domProcessingInstructionNode)); pinode->nodeType = PROCESSING_INSTRUCTION_NODE; pinode->nodeFlags = 0; pinode->namespace = 0; pinode->ownerDocument = doc; pinode->nodeNumber = NODE_NO(doc); pinode->parentNode = parent_node; /*------------------------------------------------- | extract PI target \------------------------------------------------*/ piSep = start; while ( (c=*piSep)!=0 && !SPACE(c) && (c!='?' || piSep[1]!='>')) { piSep++; } *piSep = '\0'; /* temporarily terminate the string */ pinode->targetLength = strlen(start); pinode->targetValue = (char*)MALLOC(pinode->targetLength); memmove(pinode->targetValue, start, pinode->targetLength); *piSep = c; /* remove temporarily termination */ /*------------------------------------------------- | extract PI data \------------------------------------------------*/ while (SPACE(*piSep)) { piSep++; } pinode->dataLength = x - piSep; pinode->dataValue = (char*)MALLOC(pinode->dataLength); memmove(pinode->dataValue, piSep, pinode->dataLength); if (parent_node == NULL) { if (doc->rootNode->lastChild) { pinode->previousSibling = doc->rootNode->lastChild; doc->rootNode->lastChild->nextSibling = (domNode*) pinode; } else { doc->rootNode->firstChild = (domNode*) pinode; } doc->rootNode->lastChild = (domNode*) pinode; } else { if (parent_node->firstChild) { parent_node->lastChild->nextSibling = (domNode*)pinode; pinode->previousSibling = parent_node->lastChild; parent_node->lastChild = (domNode*)pinode; } else { parent_node->firstChild = parent_node->lastChild = (domNode*)pinode; } } x += 2; } else { RetError("Unterminated processing instruction(PI)",(start-html) ); } continue; } /*---------------------------------------------------------------- | new tag/element | \---------------------------------------------------------------*/ while ((c=*x)!=0 && c!='/' && c!='>' && c!='<' && !SPACE(c) ) { if (!isalnum(c)) goto readText; *x = tolower(c); x++; } hasContent = 1; if (c==0) { RetError("Missing \">\"",(start-html) ); } if ( (x-start)==1) { RetError("Null markup name",(start-html) ); } DBG(fprintf(stderr, "\nnew tag '%70.70s...' \n", start);) *x = '\0'; /* temporarily terminate the string */ /*----------------------------------------------------------- | check, whether new starting element close an other | currently open one \----------------------------------------------------------*/ e = start+1; pn = ""; if (parent_node) { pn = (char*)parent_node->nodeName; } autoclose = 0; switch (*e) { case 'a': if(!strcmp(e,"a")&&!strcmp(pn,"a")) autoclose=1; break; case 'b': if(!strcmp(e,"b")&&!strcmp(pn,"b")) autoclose=1; break; case 'o': if (!strcmp(e,"option")&&!strcmp(pn,"option")) autoclose = 1; break; case 'p': if((!strcmp(e,"pre")&&!strcmp(pn,"pre")) ||(!strcmp(e,"p")&&!strcmp(pn,"p"))) autoclose=1; break; } if (autoclose) { DBG(fprintf(stderr, "autoclose '%s' because of new '%s' \n", pn, e);) node = parent_node; parent_node = node->parentNode; } /*----------------------------------------------------------- | create new DOM element node \----------------------------------------------------------*/ h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_tagNames), e, &hnew); node = (domNode*) domAlloc(sizeof(domNode)); memset(node, 0, sizeof(domNode)); node->nodeType = ELEMENT_NODE; node->nodeFlags = 0; node->namespace = 0; node->nodeName = (char *)&(h->key); node->ownerDocument = doc; node->nodeNumber = NODE_NO(doc); if (parent_node == NULL) { if (doc->rootNode->lastChild) { node->previousSibling = doc->rootNode->lastChild; doc->rootNode->lastChild->nextSibling = node; } else { doc->rootNode->firstChild = node; } doc->rootNode->lastChild = node; } else { node->parentNode = parent_node; if (parent_node->firstChild) { parent_node->lastChild->nextSibling = node; node->previousSibling = parent_node->lastChild; parent_node->lastChild = node; } else { parent_node->firstChild = parent_node->lastChild = node; } } *x = c; /* remove temporarily termination */ while (SPACE(*x) ) { x++; } /*----------------------------------------------------------- | read attribute name-value pairs \----------------------------------------------------------*/ lastAttr = NULL; while ( (c=*x) && (c!='/') && (c!='>') && (c!='<') ) { char *ArgName = x; int nArgName; char *ArgVal = NULL; int nArgVal = 0; while ((c=*x)!=0 && c!='=' && c!='>' && !SPACE(c) ) { *x = tolower(c); x++; } nArgName = x - ArgName; while (SPACE(*x)) { x++; } if (*x == '=') { /* attribute with value, like width="1234" */ x++; while (SPACE(*x)) { x++; } saved = *(ArgName + nArgName); *(ArgName + nArgName) = '\0'; /* terminate arg name */ if (*x=='>' || *x==0) { ArgVal = ArgName; nArgVal = nArgName; } else if ((c=*x)=='\"' || c=='\'') { register int cDelim = c; x++; ArgVal = x; ampersandSeen = 0; while ((c=*x)!=0 && c!=cDelim) { if (c=='&') ampersandSeen = 1; x++; } nArgVal = x - ArgVal; if (c==0) { RetError("Unterminated string",(ArgVal - html - 1) ); } else { x++; } } else if (c!=0 && c!='>') { ArgVal = x; while ((c=*x)!=0 && c!='>' && !SPACE(c)) { if (c=='&') ampersandSeen = 1; x++; } if (c==0) { RetError("Missing \">\"",(start-html)); } nArgVal = x - ArgVal; } } else { /* attribute without value, like 'nowrap' */ saved = *(ArgName + nArgName); *(ArgName + nArgName) = '\0'; /* terminate arg name */ ArgVal = ArgName; nArgVal = nArgName; } /*-------------------------------------------------- | allocate new attribute node \--------------------------------------------------*/ h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_attrNames), ArgName, &hnew); attrnode = (domAttrNode*) domAlloc(sizeof(domAttrNode)); memset(attrnode, 0, sizeof(domAttrNode)); attrnode->parentNode = node; attrnode->nodeName = (char *)&(h->key); attrnode->nodeType = ATTRIBUTE_NODE; attrnode->nodeFlags = 0; attrnode->nodeValue = (char*)MALLOC(nArgVal+1); attrnode->valueLength = nArgVal; memmove(attrnode->nodeValue, ArgVal, nArgVal); *(attrnode->nodeValue + nArgVal) = 0; if (ampersandSeen) { TranslateEntityRefs(attrnode->nodeValue, &(attrnode->valueLength) ); } if (!strcmp(ArgName, "id")) { if (!doc->ids) { doc->ids = (Tcl_HashTable *) MALLOC (sizeof (Tcl_HashTable)); Tcl_InitHashTable (doc->ids, TCL_STRING_KEYS); } h = Tcl_CreateHashEntry (doc->ids, attrnode->nodeValue, &hnew); /* How to resolve in case of dublicates? We follow, what the core dom building code does: the first value in document order wins. */ if (hnew) { Tcl_SetHashValue (h, node); } } if (node->firstAttr) { lastAttr->nextSibling = attrnode; } else { node->firstAttr = attrnode; } lastAttr = attrnode; *(ArgName + nArgName) = saved; while (SPACE(*x)) { x++; } } /*----------------------------------------------------------- | check for empty HTML tags \----------------------------------------------------------*/ switch (node->nodeName[0]) { case 'a': if (!strcmp(node->nodeName,"area")) hasContent = 0; break; case 'b': if (!strcmp(node->nodeName,"br") || !strcmp(node->nodeName,"base") || !strcmp(node->nodeName,"basefont")) hasContent = 0; break; case 'c': if (!strcmp(node->nodeName,"col")) hasContent = 0; break; case 'e': if (!strcmp(node->nodeName,"embed")) hasContent = 0; break; /*ext*/ case 'f': if (!strcmp(node->nodeName,"frame")) hasContent = 0; break; case 'h': if (!strcmp(node->nodeName,"hr")) hasContent = 0; break; case 'i': if (!strcmp(node->nodeName,"img") || !strcmp(node->nodeName,"input") || !strcmp(node->nodeName,"isindex")) hasContent = 0; break; case 'l': if (!strcmp(node->nodeName,"link")) hasContent = 0; break; case 'm': if (!strcmp(node->nodeName,"meta")) hasContent = 0; break; case 'p': if (!strcmp(node->nodeName,"param")) hasContent = 0; break; case 's': if (!strcmp(node->nodeName,"spacer")) hasContent = 0; break; /*ext*/ } if (*x=='/') { hasContent = 0; x++; if (*x!='>') { RetError("Syntax Error",(x - html - 1) ); } } if (*x=='>') { x++; } DBG(fprintf(stderr, "%d: new node '%s' hasContent=%d \n", getDeep(node), node->nodeName, hasContent);) if ((strcmp(node->nodeName,"style" )==0) || (strcmp(node->nodeName,"script")==0) ) { /*----------------------------------------------------------- | read over any data within a 'style' or 'script' tag \----------------------------------------------------------*/ hasContent = 1; start = x; while (1) { while ( (*x!=0) && ((*x!='<') || (x[1]!='/'))) { x++; } if (!*x) break; y = x + 2; while (*y!=0 && SPACE(*y)) y++; if (TU(y[0]) == 'S' && TU(y[1]) == 'C' && TU(y[2]) == 'R' && TU(y[3]) == 'I' && TU(y[4]) == 'P' && TU(y[5]) == 'T' ) break; if (TU(y[0]) == 'S' && TU(y[1]) == 'T' && TU(y[2]) == 'Y' && TU(y[3]) == 'L' && TU(y[4]) == 'E' ) break; x++; } if (*x) { /*---------------------------------------------------- | allocate new TEXT node for style/script data \---------------------------------------------------*/ tnode = (domTextNode*) domAlloc(sizeof(domTextNode)); memset(tnode, 0, sizeof(domTextNode)); tnode->nodeType = TEXT_NODE; tnode->nodeFlags = 0; tnode->namespace = 0; tnode->ownerDocument = doc; tnode->nodeNumber = NODE_NO(doc); tnode->parentNode = node; tnode->valueLength = (x - start); tnode->nodeValue = (char*)MALLOC((x - start)+1); memmove(tnode->nodeValue, start, (x - start)); *(tnode->nodeValue + (x - start)) = 0; if (node->firstChild) { node->lastChild->nextSibling = (domNode*)tnode; tnode->previousSibling = node->lastChild; node->lastChild = (domNode*)tnode; } else { node->firstChild = node->lastChild = (domNode*)tnode; } } } if (hasContent) { /*------------------------------------------------------------ | recurs to read child tags/texts \-----------------------------------------------------------*/ parent_node = node; } DBG(fprintf(stderr, "%d: after node '%s' \n", getDeep(node), node->nodeName);) } } while (parent_node != NULL && node->parentNode) { pn = (char*)node->parentNode->nodeName; DBG(fprintf(stderr, "final autoclose '%s'? \n", pn);) /*--------------------------------------------------------------- | check for tags for which end tag can be omitted \--------------------------------------------------------------*/ autoclose = 0; switch (pn[0]) { case 'b': if (!strcmp(pn,"body")) autoclose = 1; break; case 'c': if (!strcmp(pn,"colgroup")) autoclose = 1; break; case 'd': if (!strcmp(pn,"dd") || !strcmp(pn,"dt")) autoclose = 1; break; case 'h': if (!strcmp(pn,"head") || !strcmp(pn,"html")) autoclose = 1; break; case 'l': if (!strcmp(pn,"li")) autoclose = 1; break; case 'o': if (!strcmp(pn,"option")) autoclose = 1; break; case 'p': if (!strcmp(pn,"p")) autoclose = 1; break; case 't': if (!strcmp(pn,"tbody") || !strcmp(pn,"td") || !strcmp(pn,"tfoot") || !strcmp(pn,"thead") || !strcmp(pn,"th") || !strcmp(pn,"tr")) autoclose = 1; break; case 'u': if (!strcmp(pn,"ul")) autoclose = 1; break; /* ext */ } if (!autoclose) break; DBG(fprintf(stderr, "final autoclosed '%s'! \n", pn);) node = node->parentNode; parent_node = node->parentNode; } if (parent_node == NULL) { /* we return to main node and so finished parsing */ return TCL_OK; } RetError("Unexpected end",(x - html) ); } /* HTML_SimpleParse */ /*---------------------------------------------------------------------------- | HTML_SimpleParseDocument | | Create a document, parses the HTML string starting at 'pos' and | continuing to the first encountered error. | \---------------------------------------------------------------------------*/ domDocument * HTML_SimpleParseDocument ( char *html, /* Complete text of the file being parsed */ int ignoreWhiteSpaces, int *pos, char **errStr ) { domDocument *doc = domCreateDoc(NULL, 0); *pos = 0; HTML_SimpleParse (html, pos, doc, NULL, ignoreWhiteSpaces, errStr); domSetDocumentElement (doc); return doc; } /* HTML_SimpleParseDocument */ tDOM-0.8.3/generic/dom.c0000644000175000017500000051673610734307721015144 0ustar ssobernissoberni/*--------------------------------------------------------------------------- | Copyright (C) 1999 Jochen C. Loewer (loewerj@hotmail.com) +---------------------------------------------------------------------------- | | $Id: dom.c,v 1.107 2007/12/25 23:18:41 rolf Exp $ | | | A DOM interface upon the expat XML parser for the C language | according to the W3C recommendation REC-DOM-Level-1-19981001 | | | The contents of this file are subject to the Mozilla Public License | Version 1.1 (the "License"); you may not use this file except in | compliance with the License. You may obtain a copy of the License at | http://www.mozilla.org/MPL/ | | Software distributed under the License is distributed on an "AS IS" | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | License for the specific language governing rights and limitations | under the License. | | The Original Code is tDOM. | | The Initial Developer of the Original Code is Jochen Loewer | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 | Jochen Loewer. All Rights Reserved. | | Contributor(s): | Sept99 Carsten Zerbst Added comment and processing instructions | nodes. | | June00 Zoran Vasiljevic Made thread-safe. | | 01 Rolf Ade baseURI stuff, ID support, external | entities, tdom command | | | written by Jochen Loewer | April 5, 1999 | \--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------- | Includes | \--------------------------------------------------------------------------*/ #include #include #include #include #include #include #include /*--------------------------------------------------------------------------- | Defines | \--------------------------------------------------------------------------*/ #define DBG(x) #define TDOM_NS #define XSLT_NAMESPACE "http://www.w3.org/1999/XSL/Transform" #define MutationEvent() #define MutationEvent2(type,node) #define MutationEvent3(type,node,relatioNode) #define MCHK(a) if ((a)==NULL) { \ fprintf(stderr, \ "Memory alloc error line: %d",__LINE__); \ exit(1); \ } #define INITIAL_BASEURISTACK_SIZE 4; /*--------------------------------------------------------------------------- | Globals | In threading environment, some are located in domDocument structure | and some are handled differently (domUniqueNodeNr, domUniqueDocNr) | \--------------------------------------------------------------------------*/ #ifndef TCL_THREADS unsigned long domUniqueNodeNr = 0; unsigned long domUniqueDocNr = 0; Tcl_HashTable tdom_tagNames; Tcl_HashTable tdom_attrNames; #endif static int domModuleIsInitialized = 0; TDomThreaded(static Tcl_Mutex initMutex;) static char *domException2StringTable [] = { "OK - no expection", "INDEX_SIZE_ERR", "DOMSTRING_SIZE_ERR", "HIERARCHY_REQUEST_ERR", "WRONG_DOCUMENT_ERR", "INVALID_CHARACTER_ERR", "NO_DATA_ALLOWED_ERR", "NO_MODIFICATION_ALLOWED_ERR", "NOT_FOUND_ERR", "NOT_SUPPORTED_ERR", "INUSE_ATTRIBUTE_ERR" }; static char tdom_usage[] = "Usage tdom , where subCommand can be:\n" " enable \n" " getdoc \n" " setResultEncoding \n" " setStoreLineColumn \n" ; /*--------------------------------------------------------------------------- | type domActiveNS | \--------------------------------------------------------------------------*/ typedef struct _domActiveNS { int depth; domNS *namespace; } domActiveNS; /*--------------------------------------------------------------------------- | type domBaseURIstackElem | \--------------------------------------------------------------------------*/ typedef struct _domActiveBaseURI { int depth; const char *baseURI; } domActiveBaseURI; /*--------------------------------------------------------------------------- | type domReadInfo | \--------------------------------------------------------------------------*/ typedef struct _domReadInfo { XML_Parser parser; domDocument *document; domNode *currentNode; int depth; int ignoreWhiteSpaces; Tcl_DString *cdata; TEncoding *encoding_8bit; int storeLineColumn; int feedbackAfter; int lastFeedbackPosition; Tcl_Interp *interp; int activeNSsize; int activeNSpos; domActiveNS *activeNS; int baseURIstackSize; int baseURIstackPos; domActiveBaseURI *baseURIstack; int insideDTD; } domReadInfo; /*---------------------------------------------------------------------------- | Prototypes | \---------------------------------------------------------------------------*/ static void DispatchPCDATA (domReadInfo *info); #ifndef TCL_THREADS /*--------------------------------------------------------------------------- | domModuleFinalize | \--------------------------------------------------------------------------*/ static void domModuleFinalize(ClientData unused) { Tcl_HashEntry *entryPtr; Tcl_HashSearch search; entryPtr = Tcl_FirstHashEntry(&tdom_tagNames, &search); while (entryPtr) { Tcl_DeleteHashEntry(entryPtr); entryPtr = Tcl_NextHashEntry(&search); } Tcl_DeleteHashTable(&tdom_tagNames); entryPtr = Tcl_FirstHashEntry(&tdom_attrNames, &search); while (entryPtr) { Tcl_DeleteHashEntry(entryPtr); entryPtr = Tcl_NextHashEntry(&search); } Tcl_DeleteHashTable(&tdom_attrNames); return; } #endif /* TCL_THREADS */ /*--------------------------------------------------------------------------- | domModuleInitialize | \--------------------------------------------------------------------------*/ void domModuleInitialize ( ) { if (domModuleIsInitialized == 0) { TDomThreaded(Tcl_MutexLock(&initMutex);) if (domModuleIsInitialized == 0) { domAllocInit(); TDomNotThreaded ( Tcl_InitHashTable(&tdom_tagNames, TCL_STRING_KEYS); Tcl_InitHashTable(&tdom_attrNames, TCL_STRING_KEYS); Tcl_CreateExitHandler(domModuleFinalize, NULL); ) TDomThreaded( Tcl_CreateExitHandler(domLocksFinalize, NULL); ) domModuleIsInitialized = 1; } TDomThreaded(Tcl_MutexUnlock(&initMutex);) } } /*--------------------------------------------------------------------------- | coercion routines for calling from C++ | \--------------------------------------------------------------------------*/ domAttrNode * coerceToAttrNode( domNode *n ) { return (domAttrNode *)n; } domTextNode * coerceToTextNode( domNode *n ) { return (domTextNode *)n; } domProcessingInstructionNode * coerceToProcessingInstructionNode( domNode *n ) { return (domProcessingInstructionNode *)n; } /*--------------------------------------------------------------------------- | domIsNAME | \--------------------------------------------------------------------------*/ int domIsNAME ( const char *name ) { const char *p; p = name; if (!isNameStart(p)) return 0; p += UTF8_CHAR_LEN(*p); while (*p) { if (isNameChar(p)) p += UTF8_CHAR_LEN(*p); else return 0; } return 1; } /*--------------------------------------------------------------------------- | domIsPINAME | \--------------------------------------------------------------------------*/ int domIsPINAME ( const char *name ) { if (strlen (name) == 3 && ((name[0] == 'x') || (name[0] == 'X')) && ((name[1] == 'm') || (name[1] == 'M')) && ((name[2] == 'l') || (name[2] == 'L')) ) { return 0; } return domIsNAME (name); } /*--------------------------------------------------------------------------- | domIsQNAME | \--------------------------------------------------------------------------*/ int domIsQNAME ( const char *name ) { const char *p; p = name; if (!isNCNameStart(p)) return 0; p += UTF8_CHAR_LEN(*p); while (*p) { if (isNCNameChar(p)) p += UTF8_CHAR_LEN(*p); else { if (*p == ':') { p += 1; if (!isNCNameStart(p)) return 0; p += UTF8_CHAR_LEN(*p); break; } else return 0; } } while (*p) { if (isNCNameChar(p)) p += UTF8_CHAR_LEN(*p); else return 0; } return 1; } /*--------------------------------------------------------------------------- | domIsNCNAME | \--------------------------------------------------------------------------*/ int domIsNCNAME ( const char *name ) { const char *p; p = name; if (!isNCNameStart(p)) return 0; p += UTF8_CHAR_LEN(*p); while (*p) { if (isNCNameChar(p)) p += UTF8_CHAR_LEN(*p); else return 0; } return 1; } /*--------------------------------------------------------------------------- | domIsChar | \--------------------------------------------------------------------------*/ int domIsChar ( const char *str ) { const char *p; int clen; p = str; while (*p) { clen = UTF8_CHAR_LEN(*p); if (UTF8_XMLCHAR((unsigned const char *)p,clen)) p += clen; else return 0; } return 1; } /*--------------------------------------------------------------------------- | domIsComment | \--------------------------------------------------------------------------*/ int domIsComment ( const char *str ) { const char *p; int len, i = 0; p = str; len = strlen (str); while (i < len) { if (*p == '-') { if (i == len - 1) return 0; p++; i++; if (*p == '-') return 0; } p++; i++; } return domIsChar (str); } /*--------------------------------------------------------------------------- | domIsCDATA | \--------------------------------------------------------------------------*/ int domIsCDATA ( const char *str ) { const char *p; int len, i = 0; p = str; len = strlen (str); while (i < len - 2) { if ( *p == ']' && p[1] == ']' && p[2] == '>') return 0; p++; i++; } return domIsChar (str); } /*--------------------------------------------------------------------------- | domIsPIValue | \--------------------------------------------------------------------------*/ int domIsPIValue ( const char *str ) { const char *p; int len, i = 0; p = str; len = strlen (str); while (i < len - 1) { if (*p == '?' && p[1] == '>') return 0; p++; i++; } return domIsChar (str); } /*--------------------------------------------------------------------------- | domLookupNamespace | \--------------------------------------------------------------------------*/ domNS * domLookupNamespace ( domDocument *doc, const char *prefix, const char *namespaceURI ) { domNS *ns; int i; if (prefix==NULL) return NULL; for (i = 0; i <= doc->nsptr; i++) { ns = doc->namespaces[i]; if ( (ns->prefix != NULL) && (strcmp(prefix,ns->prefix)==0) && (strcmp(namespaceURI, ns->uri)==0) ) { return ns; } } return NULL; } /* *---------------------------------------------------------------------- * * domPrecedes -- * * This helper procedure returns if node precedes other with regard * to their position in the document and according to the document * order. The two nodes could be out of the two documents. Both * nodes must not be out of the fragments list. * * Results: * 1 if node precedes other in document order, 0 otherwise. * * Side effects: * None. * *---------------------------------------------------------------------- */ int domPrecedes ( domNode *node, domNode *other ) { domNode *nodeAncestor, *otherAncestor, *otherToplevel; domAttrNode *attrN, *attrO; if (node == other) { return 0; } if (node->nodeType == ATTRIBUTE_NODE) { attrN = (domAttrNode*)node; if (other->nodeType == ATTRIBUTE_NODE) { attrO = (domAttrNode*)other; if (attrN->parentNode == attrO->parentNode) { attrN = attrN->nextSibling; while (attrN) { if (attrN == attrO) { return 1; } attrN = attrN->nextSibling; } return 0; } else { node = attrN->parentNode; other = attrO->parentNode; } } else { if (attrN->parentNode == other) { return 0; } else { node = attrN->parentNode; } } } if (other->nodeType == ATTRIBUTE_NODE) { attrO = (domAttrNode*)other; if (node == attrO->parentNode) { return 1; } else { other = attrO->parentNode; } } if (node->ownerDocument != other->ownerDocument) { /* For mt tdom, this does not, what it should: whatever relative order two nodes out of different documents ever have (that is not determined by the rec) it must return always the same order (that is required by the rec). */ return (node->ownerDocument->documentNumber < other->ownerDocument->documentNumber); } #ifndef TCL_THREADS if (node->ownerDocument->nodeFlags & NEEDS_RENUMBERING) { domRenumberTree (node->ownerDocument->rootNode); node->ownerDocument->nodeFlags &= ~NEEDS_RENUMBERING; } return (node->nodeNumber < other->nodeNumber); # else if (!(node->ownerDocument->nodeFlags & NEEDS_RENUMBERING)) { return (node->nodeNumber < other->nodeNumber); } #endif otherAncestor = other; while (otherAncestor->parentNode) { otherAncestor = otherAncestor->parentNode; if (otherAncestor == node) { return 1; } } otherToplevel = otherAncestor; nodeAncestor = node; while (nodeAncestor->parentNode) { otherAncestor = other; while (otherAncestor->parentNode) { if (nodeAncestor->parentNode == otherAncestor->parentNode) { nodeAncestor = nodeAncestor->nextSibling; while (nodeAncestor) { if (nodeAncestor == otherAncestor) { return 1; } nodeAncestor = nodeAncestor->nextSibling; } return 0; } otherAncestor = otherAncestor->parentNode; } nodeAncestor = nodeAncestor->parentNode; if (nodeAncestor == other) { return 0; } } nodeAncestor = nodeAncestor->nextSibling; while (nodeAncestor) { if (nodeAncestor == otherAncestor) { return 1; } nodeAncestor = nodeAncestor->nextSibling; } if (node == node->ownerDocument->rootNode) { return 1; } return 0; } /*--------------------------------------------------------------------------- | domRenumberTree | \--------------------------------------------------------------------------*/ void domRenumberTree ( domNode *node ) { while (node) { node->nodeNumber = NODE_NO(node->ownerDocument); if (node->nodeType == ELEMENT_NODE) { domRenumberTree (node->firstChild); } node = node->nextSibling; } } /*--------------------------------------------------------------------------- | domLookupPrefixWithMappings | \--------------------------------------------------------------------------*/ const char * domLookupPrefixWithMappings ( domNode *node, const char *prefix, char **prefixMappings ) { int i; domNS *ns; if (prefixMappings) { i = 0; while (prefixMappings[i]) { if (strcmp (prefix, prefixMappings[i]) == 0) { return prefixMappings[i+1]; } i += 2; } } ns = domLookupPrefix (node, prefix); if (ns) return ns->uri; else return NULL; } /*--------------------------------------------------------------------------- | domLookupPrefix | \--------------------------------------------------------------------------*/ domNS * domLookupPrefix ( domNode *node, const char *prefix ) { domAttrNode *NSattr; domNode *orgNode = node; int found; found = 0; while (node) { if (node->firstAttr && !(node->firstAttr->nodeFlags & IS_NS_NODE)) { node = node->parentNode; continue; } NSattr = node->firstAttr; while (NSattr && (NSattr->nodeFlags & IS_NS_NODE)) { if (prefix[0] == '\0') { if (NSattr->nodeName[5] == '\0') { found = 1; break; } } else { if (NSattr->nodeName[5] != '\0' && strcmp (&NSattr->nodeName[6], prefix)==0) { found = 1; break; } } NSattr = NSattr->nextSibling; } if (found) { return domGetNamespaceByIndex (node->ownerDocument, NSattr->namespace); } node = node->parentNode; } if (prefix && (strcmp (prefix, "xml")==0)) { NSattr = orgNode->ownerDocument->rootNode->firstAttr; return domGetNamespaceByIndex (orgNode->ownerDocument, NSattr->namespace); } return NULL; } /*--------------------------------------------------------------------------- | domIsNamespaceInScope | \--------------------------------------------------------------------------*/ static int domIsNamespaceInScope ( domActiveNS *NSstack, int NSstackPos, const char *prefix, const char *namespaceURI ) { int i; for (i = NSstackPos; i >= 0; i--) { if (NSstack[i].namespace->prefix[0] && (strcmp(NSstack[i].namespace->prefix, prefix)==0)) { if (strcmp(NSstack[i].namespace->uri, namespaceURI)==0) { /* OK, exactly the same namespace declaration is in scope */ return 1; } else { /* This prefix is currently assigned to another uri, we need a new NS declaration, to override this one */ return 0; } } } return 0; } /*--------------------------------------------------------------------------- | domLookupURI | \--------------------------------------------------------------------------*/ domNS * domLookupURI ( domNode *node, char *uri ) { domAttrNode *NSattr; int found, alreadyHaveDefault; found = 0; alreadyHaveDefault = 0; while (node) { if (node->firstAttr && !(node->firstAttr->nodeFlags & IS_NS_NODE)) { node = node->parentNode; continue; } NSattr = node->firstAttr; while (NSattr && (NSattr->nodeFlags & IS_NS_NODE)) { if (NSattr->nodeName[5] == '\0') { if (!alreadyHaveDefault) { if (strcmp (NSattr->nodeValue, uri)==0) { found = 1; break; } else { alreadyHaveDefault = 1; } } } else { if (strcmp (NSattr->nodeValue, uri)==0) { found = 1; break; } } NSattr = NSattr->nextSibling; } if (found) { return domGetNamespaceByIndex (node->ownerDocument, NSattr->namespace); } node = node->parentNode; } return NULL; } /*--------------------------------------------------------------------------- | domGetNamespaceByIndex | \--------------------------------------------------------------------------*/ domNS * domGetNamespaceByIndex ( domDocument *doc, int nsIndex ) { if (!nsIndex) return NULL; return doc->namespaces[nsIndex-1]; } /*--------------------------------------------------------------------------- | domNewNamespace | \--------------------------------------------------------------------------*/ domNS* domNewNamespace ( domDocument *doc, const char *prefix, const char *namespaceURI ) { domNS *ns = NULL; DBG(fprintf(stderr, "domNewNamespace '%s' --> '%s' \n", prefix, namespaceURI);) ns = domLookupNamespace (doc, prefix, namespaceURI); if (ns != NULL) return ns; doc->nsptr++; if (doc->nsptr > 254) { DBG(fprintf (stderr, "maximum number of namespaces exceeded!!!\n");) domPanic("domNewNamespace: maximum number of namespaces exceeded!"); } if (doc->nsptr >= doc->nslen) { doc->namespaces = (domNS**) REALLOC ((char*) doc->namespaces, sizeof (domNS*) * 2 * doc->nslen); doc->nslen *= 2; } doc->namespaces[doc->nsptr] = (domNS*)MALLOC (sizeof (domNS)); ns = doc->namespaces[doc->nsptr]; if (prefix == NULL) { ns->prefix = tdomstrdup(""); } else { ns->prefix = tdomstrdup(prefix); } if (namespaceURI == NULL) { ns->uri = tdomstrdup(""); } else { ns->uri = tdomstrdup(namespaceURI); } ns->index = doc->nsptr + 1; return ns; } /*--------------------------------------------------------------------------- | domSplitQName - extract namespace prefix (if any) | \--------------------------------------------------------------------------*/ int domSplitQName ( const char *name, char *prefix, const char **localName ) { const char *s; char *p, *prefixEnd; s = name; p = prefix; prefixEnd = &prefix[MAX_PREFIX_LEN-1]; while (*s && (*s != ':')) { if (p < prefixEnd) *p++ = *s; s++; } if (*s != ':') { *prefix = '\0'; *localName = name; return 0; } *p++ = '\0'; *localName = ++s; DBG(fprintf(stderr, "domSplitName %s -> '%s' '%s'\n", name, prefix, *localName); ) return 1; } /*--------------------------------------------------------------------------- | domNamespaceURI | \--------------------------------------------------------------------------*/ const char * domNamespaceURI ( domNode *node ) { domAttrNode *attr; domNS *ns; if (!node->namespace) return NULL; if (node->nodeType == ATTRIBUTE_NODE) { attr = (domAttrNode*)node; if (attr->nodeFlags & IS_NS_NODE) return NULL; ns = attr->parentNode->ownerDocument->namespaces[attr->namespace-1]; } else if (node->nodeType == ELEMENT_NODE) { ns = node->ownerDocument->namespaces[node->namespace-1]; } else { return NULL; } return ns->uri; } /*--------------------------------------------------------------------------- | domNamespacePrefix | \--------------------------------------------------------------------------*/ const char * domNamespacePrefix ( domNode *node ) { domAttrNode *attr; domNS *ns; if (!node->namespace) return NULL; if (node->nodeType == ATTRIBUTE_NODE) { attr = (domAttrNode*)node; ns = attr->parentNode->ownerDocument->namespaces[attr->namespace-1]; } else if (node->nodeType == ELEMENT_NODE) { ns = node->ownerDocument->namespaces[node->namespace-1]; } else { return NULL; } if (ns) return ns->prefix; return NULL; } /*--------------------------------------------------------------------------- | domGetLocalName | \--------------------------------------------------------------------------*/ const char * domGetLocalName ( const char *nodeName ) { char prefix[MAX_PREFIX_LEN]; const char *localName; domSplitQName (nodeName, prefix, &localName); return localName; } /* *---------------------------------------------------------------------- * * domGetAttributeNodeNS -- * * Search a given node for an attribute with namespace "uri" and * localname "localname". * * Results: * Returns a pointer to the attribute, if there is one with the * given namespace and localname. Otherwise returns NULL. * * Side effects: * None. * *---------------------------------------------------------------------- */ domAttrNode * domGetAttributeNodeNS ( domNode *node, /* The attributes of this node are searched for a matching attribute; the node must exist */ const char *uri, /* The namespace of the demanded attribute */ const char *localname /* The localname of the demanded attribute */ ) { domAttrNode *attr; domNS *ns; int noNS; char prefix[MAX_PREFIX_LEN]; const char *attrLocalName; if (uri[0] == '\0') noNS = 1; else noNS = 0; attr = node->firstAttr; while (attr) { if (noNS) { if (!attr->namespace && strcmp (attr->nodeName, localname) == 0) { return attr; } } else { if (attr->namespace) { domSplitQName (attr->nodeName, prefix, &attrLocalName); if (strcmp (localname, attrLocalName) == 0) { ns = domGetNamespaceByIndex (node->ownerDocument, attr->namespace); if (strcmp (ns->uri, uri) == 0) { return attr; } } } } attr = attr->nextSibling; } return NULL; } /* *---------------------------------------------------------------------- * * domPreviousSibling -- * * Returns the previous node to the given node or NULL, if there * is no previous node. This function is needed in situations, * where the given node may also be an domAttrNode. Namespace * declaring attributes are treated as any other * attributes. Since the domAttrNode struct doesn't has an * element for the previous attribute, we need a function for the * relatively rare cases, the 'previous attribute' is * needed. Remeber, that the XML rec say, that there is no * specific order of the attributes of a node. * * Results: * A pointer to the previous node of the given one * or NULL, if there isn't a previous node. * * Side effects: * None. * *---------------------------------------------------------------------- */ domNode * domPreviousSibling ( domNode *node /* The reference attribute */ ) { domAttrNode *attr, *attr1; if (node->nodeType != ATTRIBUTE_NODE) { return node->previousSibling; } attr = (domAttrNode*) node; if (attr->parentNode->firstAttr == attr) { return NULL; } attr1 = attr->parentNode->firstAttr; while (attr1) { if (attr1->nextSibling == attr) { return (domNode*)attr1; } attr1 = attr1->nextSibling; } /* Not reached */ return NULL; } #ifndef TDOM_NO_EXPAT /*--------------------------------------------------------------------------- | startElement | \--------------------------------------------------------------------------*/ static void startElement( void *userData, const char *name, const char **atts ) { domReadInfo *info = userData; domNode *node, *parentNode; domLineColumn *lc; domAttrNode *attrnode, *lastAttr; const char **atPtr, **idAttPtr; Tcl_HashEntry *h; int hnew, len, pos, idatt, newNS; const char *xmlns, *localname; char tagPrefix[MAX_PREFIX_LEN]; char prefix[MAX_PREFIX_LEN]; domNS *ns; char feedbackCmd[24]; if (info->feedbackAfter) { if (info->lastFeedbackPosition < XML_GetCurrentByteIndex (info->parser) ) { sprintf(feedbackCmd, "%s", "::dom::domParseFeedback"); if (Tcl_Eval(info->interp, feedbackCmd) != TCL_OK) { DBG(fprintf(stderr, "%s\n", Tcl_GetStringResult (info->interp));) /* FIXME: We simply ignore script errors in the feedbackCmd, for now. One fine day, expat may provide a way to cancel an already started parse run from inside a handler. Then we should revisit this. */ /* exit(1) */ } info->lastFeedbackPosition += info->feedbackAfter; } } DispatchPCDATA (info); h = Tcl_CreateHashEntry(&HASHTAB(info->document,tdom_tagNames), name, &hnew); if (info->storeLineColumn) { node = (domNode*) domAlloc(sizeof(domNode) + sizeof(domLineColumn)); } else { node = (domNode*) domAlloc(sizeof(domNode)); } memset(node, 0, sizeof(domNode)); node->nodeType = ELEMENT_NODE; node->nodeFlags = 0; node->namespace = 0; node->nodeName = (char *)&(h->key); node->nodeNumber = NODE_NO(info->document); node->ownerDocument = info->document; if (info->baseURIstack[info->baseURIstackPos].baseURI != XML_GetBase (info->parser)) { h = Tcl_CreateHashEntry (info->document->baseURIs, (char*) node, &hnew); Tcl_SetHashValue (h, tdomstrdup (XML_GetBase (info->parser))); node->nodeFlags |= HAS_BASEURI; info->baseURIstackPos++; if (info->baseURIstackPos >= info->baseURIstackSize) { info->baseURIstack = (domActiveBaseURI*) REALLOC( (char*)info->baseURIstack, sizeof(domActiveBaseURI) * 2 * info->baseURIstackSize); info->baseURIstackSize = 2 * info->baseURIstackSize; } info->baseURIstack[info->baseURIstackPos].baseURI = XML_GetBase (info->parser); info->baseURIstack[info->baseURIstackPos].depth = info->depth; } if (info->depth == 0) { if (info->document->rootNode->lastChild) { info->document->rootNode->lastChild->nextSibling = node; node->previousSibling = info->document->rootNode->lastChild; } else { info->document->rootNode->firstChild = node; } info->document->rootNode->lastChild = node; } else { parentNode = info->currentNode; node->parentNode = parentNode; if (parentNode->firstChild) { parentNode->lastChild->nextSibling = node; node->previousSibling = parentNode->lastChild; parentNode->lastChild = node; } else { parentNode->firstChild = parentNode->lastChild = node; } } info->currentNode = node; if (info->storeLineColumn) { lc = (domLineColumn*) ( ((char*)node) + sizeof(domNode)); node->nodeFlags |= HAS_LINE_COLUMN; lc->line = XML_GetCurrentLineNumber(info->parser); lc->column = XML_GetCurrentColumnNumber(info->parser); } lastAttr = NULL; /*-------------------------------------------------------------- | process namespace declarations | \-------------------------------------------------------------*/ #ifdef TDOM_NS for (atPtr = atts; atPtr[0] && atPtr[1]; atPtr += 2) { if (strncmp(atPtr[0], "xmlns", 5) == 0) { xmlns = atPtr[0]; newNS = 1; if (xmlns[5] == ':') { if (domIsNamespaceInScope (info->activeNS, info->activeNSpos, &(xmlns[6]), atPtr[1])) { ns = domLookupPrefix (info->currentNode, &(xmlns[6])); newNS = 0; } else { ns = domNewNamespace(info->document, &xmlns[6], atPtr[1]); } } else { ns = domNewNamespace(info->document, "", atPtr[1]); } if (newNS) { /* push active namespace */ info->activeNSpos++; if (info->activeNSpos >= info->activeNSsize) { info->activeNS = (domActiveNS*) REALLOC( (char*)info->activeNS, sizeof(domActiveNS) * 2 * info->activeNSsize); info->activeNSsize = 2 * info->activeNSsize; } info->activeNS[info->activeNSpos].depth = info->depth; info->activeNS[info->activeNSpos].namespace = ns; } h = Tcl_CreateHashEntry(&HASHTAB(info->document, tdom_attrNames), atPtr[0], &hnew); attrnode = (domAttrNode*) domAlloc(sizeof(domAttrNode)); memset(attrnode, 0, sizeof(domAttrNode)); attrnode->nodeType = ATTRIBUTE_NODE; attrnode->nodeFlags = IS_NS_NODE; attrnode->namespace = ns->index; attrnode->nodeName = (char *)&(h->key); attrnode->parentNode = node; len = strlen(atPtr[1]); if (TclOnly8Bits && info->encoding_8bit) { tdom_Utf8to8Bit(info->encoding_8bit, atPtr[1], &len); } attrnode->valueLength = len; attrnode->nodeValue = (char*)MALLOC(len+1); strcpy(attrnode->nodeValue, atPtr[1]); if (node->firstAttr) { lastAttr->nextSibling = attrnode; } else { node->firstAttr = attrnode; } lastAttr = attrnode; } } /*---------------------------------------------------------- | look for namespace of element \---------------------------------------------------------*/ domSplitQName (name, tagPrefix, &localname); for (pos = info->activeNSpos; pos >= 0; pos--) { if ( ((tagPrefix[0] == '\0') && (info->activeNS[pos].namespace->prefix[0] == '\0')) || ((tagPrefix[0] != '\0') && (info->activeNS[pos].namespace->prefix[0] != '\0') && (strcmp(tagPrefix, info->activeNS[pos].namespace->prefix) == 0)) ) { if (info->activeNS[pos].namespace->prefix[0] == '\0' && info->activeNS[pos].namespace->uri[0] == '\0' && tagPrefix[0] == '\0') { /* xml-names rec. 5.2: "The default namespace can be set to the empty string. This has the same effect, within the scope of the declaration, of there being no default namespace." */ goto elemNSfound; } node->namespace = info->activeNS[pos].namespace->index; DBG(fprintf(stderr, "tag='%s' uri='%s' \n", node->nodeName, info->activeNS[pos].namespace->uri); ) goto elemNSfound; } } if (tagPrefix[0] != '\0') { if (strcmp (tagPrefix, "xml")==0) { node->namespace = info->document->rootNode->firstAttr->namespace; } else { /* Since where here, this means, the element has a up to now not declared namespace prefix. We probably should return this as an error, shouldn't we?*/ } } elemNSfound: #endif /*-------------------------------------------------------------- | add the attribute nodes | \-------------------------------------------------------------*/ if ((idatt = XML_GetIdAttributeIndex (info->parser)) != -1) { if (!info->document->ids) { info->document->ids = MALLOC (sizeof (Tcl_HashTable)); Tcl_InitHashTable (info->document->ids, TCL_STRING_KEYS); } h = Tcl_CreateHashEntry (info->document->ids, atts[idatt+1], &hnew); /* if hnew isn't 1 this is a validation error. Hm, no clear way to report this. And more, xslt and xpath can process not valid XML, the spec mentioned this even within the context of id(). If some elements share the same ID, the first in document order should be used. Doing it this way, this is guaranteed for unchanged DOM trees. There are problems, if the DOM tree is changed, befor using id() */ if (hnew) { Tcl_SetHashValue (h, node); } idAttPtr = atts + idatt; } else { idAttPtr = NULL; } /* lastAttr already set right, either to NULL above, or to the last NS attribute */ for (atPtr = atts; atPtr[0] && atPtr[1]; atPtr += 2) { #ifdef TDOM_NS if (strncmp(atPtr[0], "xmlns", 5) == 0) { continue; } #endif h = Tcl_CreateHashEntry(&HASHTAB(info->document, tdom_attrNames), atPtr[0], &hnew); attrnode = (domAttrNode*) domAlloc(sizeof(domAttrNode)); memset(attrnode, 0, sizeof(domAttrNode)); attrnode->nodeType = ATTRIBUTE_NODE; if (atPtr == idAttPtr) { attrnode->nodeFlags |= IS_ID_ATTRIBUTE; } else { attrnode->nodeFlags = 0; } attrnode->namespace = 0; attrnode->nodeName = (char *)&(h->key); attrnode->parentNode = node; len = strlen(atPtr[1]); if (TclOnly8Bits && info->encoding_8bit) { tdom_Utf8to8Bit(info->encoding_8bit, atPtr[1], &len); } attrnode->valueLength = len; attrnode->nodeValue = (char*)MALLOC(len+1); strcpy(attrnode->nodeValue, (char *)atPtr[1]); if (node->firstAttr) { lastAttr->nextSibling = attrnode; } else { node->firstAttr = attrnode; } lastAttr = attrnode; #ifdef TDOM_NS /*---------------------------------------------------------- | look for attribute namespace \---------------------------------------------------------*/ domSplitQName (attrnode->nodeName, prefix, &localname); if (prefix[0] != '\0') { for (pos = info->activeNSpos; pos >= 0; pos--) { if ( ((prefix[0] == '\0') && (info->activeNS[pos].namespace->prefix[0] == '\0')) || ((prefix[0] != '\0') && (info->activeNS[pos].namespace->prefix[0] != '\0') && (strcmp(prefix, info->activeNS[pos].namespace->prefix) == 0)) ) { attrnode->namespace = info->activeNS[pos].namespace->index; DBG(fprintf(stderr, "attr='%s' uri='%s' \n", attrnode->nodeName, info->activeNS[pos].namespace->uri); ) goto attrNSfound; } } if (strcmp (prefix, "xml")==0) { attrnode->namespace = info->document->rootNode->firstAttr->namespace; } else { /* Since where here, this means, the attribute has a up to now not declared namespace prefix. We probably should return this as an error, shouldn't we?*/ } attrNSfound: ; } #endif } info->depth++; } /*--------------------------------------------------------------------------- | endElement | \--------------------------------------------------------------------------*/ static void endElement ( void *userData, const char *name ) { domReadInfo *info = userData; DispatchPCDATA (info); info->depth--; #ifdef TDOM_NS /* pop active namespaces */ while ( (info->activeNSpos >= 0) && (info->activeNS[info->activeNSpos].depth == info->depth) ) { info->activeNSpos--; } #endif if (info->depth != -1) { info->currentNode = info->currentNode->parentNode; } else { info->currentNode = NULL; } if (info->depth) { if (info->baseURIstack[info->baseURIstackPos].depth == info->depth) { info->baseURIstackPos--; } } } /*--------------------------------------------------------------------------- | characterDataHandler | \--------------------------------------------------------------------------*/ static void characterDataHandler ( void *userData, const char *s, int len ) { domReadInfo *info = userData; Tcl_DStringAppend (info->cdata, s, len); return; } /*--------------------------------------------------------------------------- | DispatchPCDATA | \--------------------------------------------------------------------------*/ static void DispatchPCDATA ( domReadInfo *info ) { domTextNode *node; domNode *parentNode; domLineColumn *lc; Tcl_HashEntry *h; char *s; int len, hnew; s = Tcl_DStringValue (info->cdata); len = Tcl_DStringLength (info->cdata); if (!len) return; if (TclOnly8Bits && info->encoding_8bit) { tdom_Utf8to8Bit( info->encoding_8bit, s, &len); } parentNode = info->currentNode; if (!parentNode) return; if ( parentNode->lastChild && parentNode->lastChild->nodeType == TEXT_NODE) { /* normalize text node, i.e. there are no adjacent text nodes */ node = (domTextNode*)parentNode->lastChild; node->nodeValue = REALLOC(node->nodeValue, node->valueLength + len); memmove(node->nodeValue + node->valueLength, s, len); node->valueLength += len; } else { if (info->ignoreWhiteSpaces) { char *pc; int i, only_whites; only_whites = 1; for (i=0, pc = s; i < len; i++, pc++) { if ( (*pc != ' ') && (*pc != '\t') && (*pc != '\n') && (*pc != '\r') ) { only_whites = 0; break; } } if (only_whites) { Tcl_DStringSetLength (info->cdata, 0); return; } } if (info->storeLineColumn) { node = (domTextNode*) domAlloc(sizeof(domTextNode) + sizeof(domLineColumn)); } else { node = (domTextNode*) domAlloc(sizeof(domTextNode)); } memset(node, 0, sizeof(domTextNode)); node->nodeType = TEXT_NODE; node->nodeFlags = 0; node->namespace = 0; node->nodeNumber = NODE_NO(info->document); node->valueLength = len; node->nodeValue = (char*)MALLOC(len); memmove(node->nodeValue, s, len); node->ownerDocument = info->document; node->parentNode = parentNode; if (parentNode->nodeType == ELEMENT_NODE) { if (parentNode->firstChild) { parentNode->lastChild->nextSibling = (domNode*)node; node->previousSibling = parentNode->lastChild; } else { parentNode->firstChild = (domNode*)node; } parentNode->lastChild = (domNode*)node; } if (info->baseURIstack[info->baseURIstackPos].baseURI != XML_GetBase (info->parser)) { h = Tcl_CreateHashEntry (info->document->baseURIs, (char*) node, &hnew); Tcl_SetHashValue (h, tdomstrdup (XML_GetBase (info->parser))); node->nodeFlags |= HAS_BASEURI; } if (info->storeLineColumn) { lc = (domLineColumn*) ( ((char*)node) + sizeof(domTextNode) ); node->nodeFlags |= HAS_LINE_COLUMN; lc->line = XML_GetCurrentLineNumber(info->parser); lc->column = XML_GetCurrentColumnNumber(info->parser); } } Tcl_DStringSetLength (info->cdata, 0); } /*--------------------------------------------------------------------------- | commentHandler | \--------------------------------------------------------------------------*/ static void commentHandler ( void *userData, const char *s ) { domReadInfo *info = userData; domTextNode *node; domNode *parentNode; domLineColumn *lc; int len, hnew; Tcl_HashEntry *h; if (info->insideDTD) { DBG(fprintf (stderr, "commentHandler: insideDTD, skipping\n");) return; } DispatchPCDATA (info); len = strlen(s); if (TclOnly8Bits && info->encoding_8bit) { tdom_Utf8to8Bit(info->encoding_8bit, s, &len); } parentNode = info->currentNode; if (info->storeLineColumn) { node = (domTextNode*) domAlloc(sizeof(domTextNode) + sizeof(domLineColumn)); } else { node = (domTextNode*) domAlloc(sizeof(domTextNode)); } memset(node, 0, sizeof(domTextNode)); node->nodeType = COMMENT_NODE; node->nodeFlags = 0; node->namespace = 0; node->nodeNumber = NODE_NO(info->document); node->valueLength = len; node->nodeValue = (char*)MALLOC(len); memmove(node->nodeValue, s, len); node->ownerDocument = info->document; node->parentNode = parentNode; if (parentNode == NULL) { if (info->document->rootNode->lastChild) { info->document->rootNode->lastChild->nextSibling = (domNode*)node; node->previousSibling = info->document->rootNode->lastChild; } else { info->document->rootNode->firstChild = (domNode*)node; } info->document->rootNode->lastChild = (domNode*)node; } else if(parentNode->nodeType == ELEMENT_NODE) { if (parentNode->firstChild) { parentNode->lastChild->nextSibling = (domNode*)node; node->previousSibling = parentNode->lastChild; parentNode->lastChild = (domNode*)node; } else { parentNode->firstChild = parentNode->lastChild = (domNode*)node; } } if (info->baseURIstack[info->baseURIstackPos].baseURI != XML_GetBase (info->parser)) { h = Tcl_CreateHashEntry (info->document->baseURIs, (char*) node, &hnew); Tcl_SetHashValue (h, tdomstrdup (XML_GetBase (info->parser))); node->nodeFlags |= HAS_BASEURI; } if (info->storeLineColumn) { lc = (domLineColumn*) ( ((char*)node) + sizeof(domTextNode) ); node->nodeFlags |= HAS_LINE_COLUMN; lc->line = XML_GetCurrentLineNumber(info->parser); lc->column = XML_GetCurrentColumnNumber(info->parser); } } /*--------------------------------------------------------------------------- | processingInstructionHandler | \--------------------------------------------------------------------------*/ static void processingInstructionHandler( void *userData, const char *target, const char *data ) { domProcessingInstructionNode *node; domReadInfo *info = userData; domNode *parentNode; domLineColumn *lc; int len,hnew; Tcl_HashEntry *h; if (info->insideDTD) { DBG(fprintf (stderr, "processingInstructionHandler: insideDTD, skipping\n");) return; } DispatchPCDATA (info); parentNode = info->currentNode; if (info->storeLineColumn) { node = (domProcessingInstructionNode*) domAlloc(sizeof(domProcessingInstructionNode) + sizeof(domLineColumn)); } else { node = (domProcessingInstructionNode*) domAlloc(sizeof(domProcessingInstructionNode)); } memset(node, 0, sizeof(domProcessingInstructionNode)); node->nodeType = PROCESSING_INSTRUCTION_NODE; node->nodeFlags = 0; node->namespace = 0; node->nodeNumber = NODE_NO(info->document); if (info->baseURIstack[info->baseURIstackPos].baseURI != XML_GetBase (info->parser)) { h = Tcl_CreateHashEntry (info->document->baseURIs, (char*) node, &hnew); Tcl_SetHashValue (h, tdomstrdup (XML_GetBase (info->parser))); node->nodeFlags |= HAS_BASEURI; } len = strlen(target); if (TclOnly8Bits && info->encoding_8bit) { tdom_Utf8to8Bit(info->encoding_8bit, target, &len); } node->targetLength = len; node->targetValue = (char*)MALLOC(len); memmove(node->targetValue, target, len); len = strlen(data); if (TclOnly8Bits && info->encoding_8bit) { tdom_Utf8to8Bit(info->encoding_8bit, data, &len); } node->dataLength = len; node->dataValue = (char*)MALLOC(len); memmove(node->dataValue, data, len); node->ownerDocument = info->document; node->parentNode = parentNode; if (parentNode == NULL) { if (info->document->rootNode->lastChild) { info->document->rootNode->lastChild->nextSibling = (domNode*)node; node->previousSibling = info->document->rootNode->lastChild; } else { info->document->rootNode->firstChild = (domNode*)node; } info->document->rootNode->lastChild = (domNode*)node; } else if(parentNode->nodeType == ELEMENT_NODE) { if (parentNode->firstChild) { parentNode->lastChild->nextSibling = (domNode*)node; node->previousSibling = parentNode->lastChild; parentNode->lastChild = (domNode*)node; } else { parentNode->firstChild = parentNode->lastChild = (domNode*)node; } } if (info->storeLineColumn) { lc = (domLineColumn*)(((char*)node)+sizeof(domProcessingInstructionNode)); node->nodeFlags |= HAS_LINE_COLUMN; lc->line = XML_GetCurrentLineNumber(info->parser); lc->column = XML_GetCurrentColumnNumber(info->parser); } } /*--------------------------------------------------------------------------- | entityDeclHandler | \--------------------------------------------------------------------------*/ static void entityDeclHandler ( void *userData, const char *entityName, int is_parameter_entity, const char *value, int value_length, const char *base, const char *systemId, const char *publicId, const char *notationName ) { domReadInfo *info = (domReadInfo *) userData; Tcl_HashEntry *entryPtr; int hnew; if (notationName) { if (!info->document->unparsedEntities) { info->document->unparsedEntities = MALLOC (sizeof (Tcl_HashTable)); Tcl_InitHashTable (info->document->unparsedEntities, TCL_STRING_KEYS); } entryPtr = Tcl_CreateHashEntry (info->document->unparsedEntities, entityName, &hnew); if (hnew) { Tcl_SetHashValue (entryPtr, tdomstrdup (systemId)); } } } /*--------------------------------------------------------------------------- | externalEntityRefHandler | \--------------------------------------------------------------------------*/ static int externalEntityRefHandler ( XML_Parser parser, CONST char *openEntityNames, CONST char *base, CONST char *systemId, CONST char *publicId ) { domReadInfo *info = (domReadInfo *) XML_GetUserData (parser); Tcl_Obj *cmdPtr, *resultObj, *resultTypeObj, *extbaseObj, *xmlstringObj; Tcl_Obj *channelIdObj; int result, mode, done, byteIndex, i; size_t len; int tclLen; XML_Parser extparser, oldparser = NULL; char buf[4096], *resultType, *extbase, *xmlstring, *channelId, s[50]; Tcl_Channel chan = (Tcl_Channel) NULL; if (info->document->extResolver == NULL) { Tcl_AppendResult (info->interp, "Can't read external entity \"", systemId, "\": No -externalentitycommand given", NULL); return 0; } DispatchPCDATA (info); /* * Take a copy of the callback script so that arguments may be appended. */ cmdPtr = Tcl_NewStringObj(info->document->extResolver, -1); Tcl_IncrRefCount(cmdPtr); if (base) { Tcl_ListObjAppendElement(info->interp, cmdPtr, Tcl_NewStringObj(base, strlen(base))); } else { Tcl_ListObjAppendElement(info->interp, cmdPtr, Tcl_NewObj()); } /* For a document with doctype declaration, the systemId is always != NULL. But if the document doesn't have a doctype declaration and the user uses -useForeignDTD 1, the externalEntityRefHandler will be called with a systemId (and publicId and openEntityNames) == NULL. */ if (systemId) { Tcl_ListObjAppendElement(info->interp, cmdPtr, Tcl_NewStringObj(systemId, strlen(systemId))); } else { Tcl_ListObjAppendElement(info->interp, cmdPtr, Tcl_NewObj()); } if (publicId) { Tcl_ListObjAppendElement(info->interp, cmdPtr, Tcl_NewStringObj(publicId, strlen(publicId))); } else { Tcl_ListObjAppendElement(info->interp, cmdPtr, Tcl_NewObj()); } #if TclOnly8Bits result = Tcl_GlobalEvalObj(info->interp, cmdPtr); #else result = Tcl_EvalObjEx (info->interp, cmdPtr, TCL_EVAL_DIRECT | TCL_EVAL_GLOBAL); #endif Tcl_DecrRefCount(cmdPtr); if (result != TCL_OK) { return 0; } extparser = XML_ExternalEntityParserCreate (parser, openEntityNames, 0); resultObj = Tcl_GetObjResult (info->interp); Tcl_IncrRefCount (resultObj); result = Tcl_ListObjLength (info->interp, resultObj, &tclLen); if ((result != TCL_OK) || (tclLen != 3)) { goto wrongScriptResult; } result = Tcl_ListObjIndex (info->interp, resultObj, 0, &resultTypeObj); if (result != TCL_OK) { goto wrongScriptResult; } resultType = Tcl_GetString(resultTypeObj); if (strcmp (resultType, "string") == 0) { result = Tcl_ListObjIndex (info->interp, resultObj, 2, &xmlstringObj); xmlstring = Tcl_GetString(xmlstringObj); len = strlen (xmlstring); chan = NULL; } else if (strcmp (resultType, "channel") == 0) { xmlstring = NULL; len = 0; result = Tcl_ListObjIndex (info->interp, resultObj, 2, &channelIdObj); channelId = Tcl_GetString(channelIdObj); chan = Tcl_GetChannel (info->interp, channelId, &mode); if (chan == (Tcl_Channel) NULL) { goto wrongScriptResult; } if ((mode & TCL_READABLE) == 0) { return 0; } } else if (strcmp (resultType, "filename") == 0) { /* result type "filename" not yet implemented */ return 0; } else { goto wrongScriptResult; } result = Tcl_ListObjIndex (info->interp, resultObj, 1, &extbaseObj); if (result != TCL_OK) { goto wrongScriptResult; } extbase = Tcl_GetString(extbaseObj); /* TODO: what to do, if this document was already parsed before ? */ if (!extparser) { Tcl_DecrRefCount (resultObj); Tcl_SetResult (info->interp, "unable to create expat external entity parser", NULL); return 0; } oldparser = info->parser; info->parser = extparser; XML_SetBase (extparser, extbase); if (chan == NULL) { if (!XML_Parse(extparser, xmlstring, strlen (xmlstring), 1)) { Tcl_ResetResult (info->interp); sprintf(s, "%ld", XML_GetCurrentLineNumber(extparser)); Tcl_AppendResult(info->interp, "error \"", XML_ErrorString(XML_GetErrorCode(extparser)), "\" in entity \"", systemId, "\" at line ", s, " character ", NULL); sprintf(s, "%ld", XML_GetCurrentColumnNumber(extparser)); Tcl_AppendResult(info->interp, s, NULL); byteIndex = XML_GetCurrentByteIndex(extparser); if (byteIndex != -1) { Tcl_AppendResult(info->interp, "\n\"", NULL); s[1] = '\0'; for (i=-20; i < 40; i++) { if ((byteIndex+i)>=0) { if (xmlstring[byteIndex+i]) { s[0] = xmlstring[byteIndex+i]; Tcl_AppendResult(info->interp, s, NULL); if (i==0) { Tcl_AppendResult(info->interp, " <--Error-- ", NULL); } } else { break; } } } Tcl_AppendResult(info->interp, "\"",NULL); } Tcl_DecrRefCount (resultObj); XML_ParserFree (extparser); info->parser = oldparser; return 0; } } else { do { len = Tcl_Read (chan, buf, sizeof(buf)); done = len < sizeof(buf); if (!XML_Parse (extparser, buf, len, done)) { Tcl_ResetResult (info->interp); sprintf(s, "%ld", XML_GetCurrentLineNumber(extparser)); Tcl_AppendResult(info->interp, "error \"", XML_ErrorString(XML_GetErrorCode(extparser)), "\" in entity \"", systemId, "\" at line ", s, " character ", NULL); sprintf(s, "%ld", XML_GetCurrentColumnNumber(extparser)); Tcl_AppendResult(info->interp, s, NULL); Tcl_DecrRefCount (resultObj); XML_ParserFree (extparser); info->parser = oldparser; return 0; } } while (!done); } DispatchPCDATA (info); XML_ParserFree (extparser); info->parser = oldparser; Tcl_DecrRefCount (resultObj); Tcl_ResetResult (info->interp); return 1; wrongScriptResult: Tcl_DecrRefCount (resultObj); Tcl_ResetResult (info->interp); XML_ParserFree (extparser); if (oldparser) { info->parser = oldparser; } Tcl_AppendResult (info->interp, "The -externalentitycommand script " "has to return a Tcl list with 3 elements.\n" "Syntax: {string|channel|filename }\n", NULL); return 0; } /*--------------------------------------------------------------------------- | startDoctypeDeclHandler | \--------------------------------------------------------------------------*/ static void startDoctypeDeclHandler ( void *userData, const char *doctypeName, const char *sysid, const char *pubid, int has_internal_subset ) { domReadInfo *info = (domReadInfo *) userData; if (pubid) { info->document->doctype = (domDocInfo*)MALLOC (sizeof (domDocInfo)); memset (info->document->doctype, 0, sizeof (domDocInfo)); info->document->doctype->systemId = tdomstrdup (sysid); info->document->doctype->publicId = tdomstrdup (pubid); } else if (sysid) { info->document->doctype = (domDocInfo*)MALLOC (sizeof (domDocInfo)); memset (info->document->doctype, 0, sizeof (domDocInfo)); info->document->doctype->systemId = tdomstrdup (sysid); } info->insideDTD = 1; } /*--------------------------------------------------------------------------- | endDoctypeDeclHandler | \--------------------------------------------------------------------------*/ static void endDoctypeDeclHandler ( void *userData ) { domReadInfo *info = (domReadInfo *) userData; info->insideDTD = 0; } /*--------------------------------------------------------------------------- | domReadDocument | \--------------------------------------------------------------------------*/ domDocument * domReadDocument ( XML_Parser parser, char *xml, int length, int ignoreWhiteSpaces, TEncoding *encoding_8bit, int storeLineColumn, int feedbackAfter, Tcl_Channel channel, const char *baseurl, char *extResolver, int useForeignDTD, int paramEntityParsing, Tcl_Interp *interp ) { int done, tclLen; size_t len; domReadInfo info; char buf[8192]; #if !TclOnly8Bits Tcl_Obj *bufObj; Tcl_DString dStr; int useBinary; char *str; #endif domDocument *doc = domCreateDoc(baseurl, storeLineColumn); doc->extResolver = extResolver; info.parser = parser; info.document = doc; info.currentNode = NULL; info.depth = 0; info.ignoreWhiteSpaces = ignoreWhiteSpaces; info.cdata = (Tcl_DString*) MALLOC (sizeof (Tcl_DString)); Tcl_DStringInit (info.cdata); info.encoding_8bit = encoding_8bit; info.storeLineColumn = storeLineColumn; info.feedbackAfter = feedbackAfter; info.lastFeedbackPosition = 0; info.interp = interp; info.activeNSpos = -1; info.activeNSsize = 8; info.activeNS = (domActiveNS*) MALLOC (sizeof(domActiveNS) * info.activeNSsize); info.baseURIstackPos = 0; info.baseURIstackSize = INITIAL_BASEURISTACK_SIZE; info.baseURIstack = (domActiveBaseURI*) MALLOC (sizeof(domActiveBaseURI) * info.baseURIstackSize); info.insideDTD = 0; XML_SetUserData(parser, &info); XML_SetBase (parser, baseurl); /* We must use XML_GetBase(), because XML_SetBase copies the baseURI, and we want to compare the pointers */ info.baseURIstack[0].baseURI = XML_GetBase (parser); info.baseURIstack[0].depth = 0; XML_UseForeignDTD (parser, (unsigned char) useForeignDTD); XML_SetElementHandler(parser, startElement, endElement); XML_SetCharacterDataHandler(parser, characterDataHandler); XML_SetCommentHandler(parser, commentHandler); XML_SetProcessingInstructionHandler(parser, processingInstructionHandler); XML_SetEntityDeclHandler (parser, entityDeclHandler); if (extResolver) { XML_SetExternalEntityRefHandler (parser, externalEntityRefHandler); } XML_SetParamEntityParsing (parser, (enum XML_ParamEntityParsing) paramEntityParsing); XML_SetDoctypeDeclHandler (parser, startDoctypeDeclHandler, endDoctypeDeclHandler); if (channel == NULL) { if (!XML_Parse(parser, xml, length, 1)) { FREE ( info.activeNS ); FREE ( info.baseURIstack ); Tcl_DStringFree (info.cdata); FREE ( info.cdata); domFreeDocument (doc, NULL, NULL); return NULL; } } else { #if !TclOnly8Bits Tcl_DStringInit (&dStr); if (Tcl_GetChannelOption (interp, channel, "-encoding", &dStr) != TCL_OK) { FREE ( (char*) info.activeNS ); FREE ( info.baseURIstack ); Tcl_DStringFree (info.cdata); FREE ( info.cdata); domFreeDocument (doc, NULL, NULL); return NULL; } if (strcmp (Tcl_DStringValue (&dStr), "identity")==0 ) useBinary = 1; else useBinary = 0; Tcl_DStringFree (&dStr); if (useBinary) { do { len = Tcl_Read (channel, buf, sizeof(buf)); done = len < sizeof(buf); if (!XML_Parse (parser, buf, len, done)) { FREE ( info.activeNS ); FREE ( info.baseURIstack ); Tcl_DStringFree (info.cdata); FREE ( info.cdata); domFreeDocument (doc, NULL, NULL); return NULL; } } while (!done); } else { bufObj = Tcl_NewObj(); Tcl_SetObjLength (bufObj, 6144); do { len = Tcl_ReadChars (channel, bufObj, 1024, 0); done = (len < 1024); str = Tcl_GetStringFromObj(bufObj, &tclLen); if (!XML_Parse (parser, str, tclLen, done)) { FREE ( info.activeNS ); FREE ( info.baseURIstack ); Tcl_DStringFree (info.cdata); FREE ( info.cdata); domFreeDocument (doc, NULL, NULL); Tcl_DecrRefCount (bufObj); return NULL; } } while (!done); Tcl_DecrRefCount (bufObj); } #else do { len = Tcl_Read (channel, buf, sizeof(buf)); done = len < sizeof(buf); if (!XML_Parse (parser, buf, len, done)) { FREE ( info.activeNS ); FREE ( info.baseURIstack ); domFreeDocument (doc, NULL, NULL); Tcl_DStringFree (info.cdata); FREE ( info.cdata); return NULL; } } while (!done); #endif } FREE ( info.activeNS ); FREE ( info.baseURIstack ); Tcl_DStringFree (info.cdata); FREE ( info.cdata); domSetDocumentElement (doc); return doc; } #endif /* ifndef TDOM_NO_EXPAT */ /*--------------------------------------------------------------------------- | domException2String | \--------------------------------------------------------------------------*/ const char * domException2String ( domException exception ) { return domException2StringTable[exception]; } /*--------------------------------------------------------------------------- | domGetLineColumn | \--------------------------------------------------------------------------*/ int domGetLineColumn ( domNode *node, int *line, int *column ) { char *v; domLineColumn *lc; *line = -1; *column = -1; if (node->nodeFlags & HAS_LINE_COLUMN) { v = (char*)node; switch (node->nodeType) { case ELEMENT_NODE: v = v + sizeof(domNode); break; case TEXT_NODE: case CDATA_SECTION_NODE: case COMMENT_NODE: v = v + sizeof(domTextNode); break; case PROCESSING_INSTRUCTION_NODE: v = v + sizeof(domProcessingInstructionNode); break; default: return -1; } lc = (domLineColumn *)v; *line = lc->line; *column = lc->column; return 0; } else { return -1; } } #ifdef TDOM_NS domAttrNode * domCreateXMLNamespaceNode ( domNode *parent ) { Tcl_HashEntry *h; int hnew; domAttrNode *attr; domNS *ns; attr = (domAttrNode *) domAlloc (sizeof (domAttrNode)); memset (attr, 0, sizeof (domAttrNode)); h = Tcl_CreateHashEntry(&HASHTAB(parent->ownerDocument,tdom_attrNames), "xmlns:xml", &hnew); ns = domNewNamespace (parent->ownerDocument, "xml", XML_NAMESPACE); attr->nodeType = ATTRIBUTE_NODE; attr->nodeFlags = IS_NS_NODE; attr->namespace = ns->index; attr->nodeName = (char *)&(h->key); attr->parentNode = parent; attr->valueLength = strlen (XML_NAMESPACE); attr->nodeValue = tdomstrdup (XML_NAMESPACE); return attr; } #endif /* TDOM_NS */ /* *---------------------------------------------------------------------- * * domCreateDoc -- * * This procedure allocates a new domDocument, initialize it and * creates its rootNode (with initialization). * * Results: * The domDocument node: * * Side effects: * Allocates memory for the returned domDocument and its * rootNode. * *---------------------------------------------------------------------- */ domDocument * domCreateDoc ( const char * baseURI, int storeLineColumn ) { Tcl_HashEntry *h; int hnew; domNode *rootNode; domDocument *doc; domLineColumn *lc; doc = (domDocument *) MALLOC (sizeof (domDocument)); memset(doc, 0, sizeof(domDocument)); doc->nodeType = DOCUMENT_NODE; doc->documentNumber = DOC_NO(doc); doc->nsptr = -1; doc->nslen = 4; doc->namespaces = (domNS**) MALLOC (sizeof (domNS*) * doc->nslen); /* We malloc and initialze the baseURIs hash table here to avoid cluttering of the code all over the place with checks. */ doc->baseURIs = MALLOC (sizeof (Tcl_HashTable)); Tcl_InitHashTable (doc->baseURIs, TCL_ONE_WORD_KEYS); TDomThreaded( domLocksAttach(doc); Tcl_InitHashTable(&doc->tdom_tagNames, TCL_STRING_KEYS); Tcl_InitHashTable(&doc->tdom_attrNames, TCL_STRING_KEYS); ) if (storeLineColumn) { rootNode = (domNode*) domAlloc(sizeof(domNode)+sizeof(domLineColumn)); } else { rootNode = (domNode*) domAlloc(sizeof(domNode)); } memset(rootNode, 0, sizeof(domNode)); rootNode->nodeType = ELEMENT_NODE; if (baseURI) { h = Tcl_CreateHashEntry (doc->baseURIs, (char*)rootNode, &hnew); Tcl_SetHashValue (h, tdomstrdup (baseURI)); rootNode->nodeFlags |= HAS_BASEURI; } else { rootNode->nodeFlags = 0; } rootNode->namespace = 0; h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_tagNames), "", &hnew); rootNode->nodeName = (char *)&(h->key); rootNode->nodeNumber = NODE_NO(doc); rootNode->ownerDocument = doc; rootNode->parentNode = NULL; rootNode->firstChild = rootNode->lastChild = NULL; #ifdef TDOM_NS rootNode->firstAttr = domCreateXMLNamespaceNode (rootNode); #endif if (storeLineColumn) { lc = (domLineColumn*) ( ((char*)rootNode) + sizeof(domNode)); rootNode->nodeFlags |= HAS_LINE_COLUMN; lc->line = 0; lc->column = 0; } doc->rootNode = rootNode; return doc; } /*--------------------------------------------------------------------------- | domCreateDocument | \--------------------------------------------------------------------------*/ domDocument * domCreateDocument ( Tcl_Interp *interp, const char *uri, char *documentElementTagName ) { Tcl_HashEntry *h; int hnew; domNode *node; domDocument *doc; char prefix[MAX_PREFIX_LEN]; const char *localName; domNS *ns = NULL; if (uri) { domSplitQName (documentElementTagName, prefix, &localName); DBG(fprintf(stderr, "rootName: -->%s<--, prefix: -->%s<--, localName: -->%s<--\n", documentElementTagName, prefix, localName);) if (prefix[0] != '\0') { if (!domIsNCNAME (prefix)) { if (interp) { Tcl_SetObjResult(interp, Tcl_NewStringObj("invalid prefix name", -1)); } return NULL; } } if (!domIsNCNAME (localName)) { if (interp) { Tcl_SetObjResult(interp, Tcl_NewStringObj("invalid local name", -1)); } return NULL; } } else { if (!domIsNAME (documentElementTagName)) { if (interp) { Tcl_SetObjResult(interp, Tcl_NewStringObj("invalid root element name", -1)); } return NULL; } } doc = domCreateDoc (NULL, 0); h = Tcl_CreateHashEntry(&HASHTAB(doc, tdom_tagNames), documentElementTagName, &hnew); node = (domNode*) domAlloc(sizeof(domNode)); memset(node, 0, sizeof(domNode)); node->nodeType = ELEMENT_NODE; node->nodeFlags = 0; node->nodeNumber = NODE_NO(doc); node->ownerDocument = doc; node->nodeName = (char *)&(h->key); doc->documentElement = node; if (uri) { ns = domNewNamespace (doc, prefix, uri); node->namespace = ns->index; domAddNSToNode (node, ns); } doc->rootNode->firstChild = doc->rootNode->lastChild = doc->documentElement; return doc; } /*--------------------------------------------------------------------------- | domSetDocumentElement | \--------------------------------------------------------------------------*/ void domSetDocumentElement ( domDocument *doc ) { domNode *node; doc->documentElement = NULL; node = doc->rootNode->firstChild; while (node) { if (node->nodeType == ELEMENT_NODE) { doc->documentElement = node; break; } node = node->nextSibling; } if (!doc->documentElement) { doc->documentElement = doc->rootNode->firstChild; } } /*--------------------------------------------------------------------------- | domFreeNode | \--------------------------------------------------------------------------*/ void domFreeNode ( domNode * node, domFreeCallback freeCB, void * clientData, int dontfree ) { int shared = 0; domNode *child, *ctemp; domAttrNode *atemp, *attr, *aprev; Tcl_HashEntry *entryPtr; if (node == NULL) { DBG(fprintf (stderr, "null ptr in domFreeNode (dom.c) !\n");) return; } TDomThreaded ( shared = node->ownerDocument && node->ownerDocument->refCount > 1; ) /*---------------------------------------------------------------- | dontfree instruct us to walk the node tree and apply the | user-supplied callback, *w/o* actually deleting nodes. | This is normally done when a thread detaches from the | shared DOM tree and wants to garbage-collect all nodecmds | in it's interpreter which attached to the tree nodes. \---------------------------------------------------------------*/ if (dontfree) { shared = 1; } else { node->nodeFlags |= IS_DELETED; } if (node->nodeType == ATTRIBUTE_NODE && !shared) { attr = ((domAttrNode*)node)->parentNode->firstAttr; aprev = NULL; while (attr && (attr != (domAttrNode*)node)) { aprev = attr; attr = attr->nextSibling; } if (attr) { if (aprev) { aprev->nextSibling = attr->nextSibling; } else { ((domAttrNode*)node)->parentNode->firstAttr = attr->nextSibling; } FREE (attr->nodeValue); domFree ((void*)attr); } } else if (node->nodeType == ELEMENT_NODE) { child = node->lastChild; while (child) { ctemp = child->previousSibling; if (freeCB) { freeCB(child, clientData); } domFreeNode (child, freeCB, clientData, dontfree); child = ctemp; } if (shared) { return; } attr = node->firstAttr; while (attr) { atemp = attr; attr = attr->nextSibling; FREE (atemp->nodeValue); domFree ((void*)atemp); } if (node->nodeFlags & HAS_BASEURI) { entryPtr = Tcl_FindHashEntry (node->ownerDocument->baseURIs, (char*)node); if (entryPtr) { FREE ((char *) Tcl_GetHashValue (entryPtr)); Tcl_DeleteHashEntry (entryPtr); } } domFree ((void*)node); } else if (node->nodeType == PROCESSING_INSTRUCTION_NODE && !shared) { FREE (((domProcessingInstructionNode*)node)->dataValue); FREE (((domProcessingInstructionNode*)node)->targetValue); domFree ((void*)node); } else if (!shared) { FREE (((domTextNode*)node)->nodeValue); domFree ((void*)node); } } /*--------------------------------------------------------------------------- | domDeleteNode - unlinks node from tree and free all child nodes | and itself | \--------------------------------------------------------------------------*/ domException domDeleteNode ( domNode * node, domFreeCallback freeCB, void * clientData ) { TDomThreaded(int shared = 0;) domDocument *doc; if (node->nodeType == ATTRIBUTE_NODE) { domPanic("domDeleteNode on ATTRIBUTE_NODE not supported!"); } TDomThreaded ( shared = node->ownerDocument->refCount > 1; ) doc = node->ownerDocument; /*---------------------------------------------------------------- | unlink node from child or fragment list \---------------------------------------------------------------*/ if (node->previousSibling) { node->previousSibling->nextSibling = node->nextSibling; } else { if (node->parentNode) { node->parentNode->firstChild = node->nextSibling; } else { /* Node may be a top level node */ if (doc->rootNode->firstChild == node) { doc->rootNode->firstChild = node->nextSibling; } } } if (node->nextSibling) { node->nextSibling->previousSibling = node->previousSibling; } else { if (node->parentNode) { node->parentNode->lastChild = node->previousSibling; } else { /* Node may be a top level node */ if (doc->rootNode->lastChild == node) { doc->rootNode->lastChild = node->previousSibling; } } } if (doc->fragments == node) { doc->fragments = node->nextSibling; } if (!node->parentNode) { domSetDocumentElement (doc); } /*---------------------------------------------------------------- | for shared docs, append node to the delete nodes list | otherwise delete the node physically \---------------------------------------------------------------*/ if (freeCB) { freeCB(node, clientData); } TDomThreaded ( if (shared) { if (doc->deletedNodes) { doc->deletedNodes->nextDeleted = node; } else { doc->deletedNodes = node; } node->nodeFlags |= IS_DELETED; node->nextDeleted = NULL; } ) MutationEvent3(DOMNodeRemoved, childToRemove, node); MutationEvent2(DOMSubtreeModified, node); domFreeNode(node, freeCB, clientData, 0); return OK; } /*--------------------------------------------------------------------------- | domFreeDocument | \--------------------------------------------------------------------------*/ void domFreeDocument ( domDocument * doc, domFreeCallback freeCB, void * clientData ) { domNode *node, *next; domNS *ns; int i, dontfree = 0; Tcl_HashEntry *entryPtr; Tcl_HashSearch search; if (doc->nodeFlags & DONT_FREE) { doc->nodeFlags &= ~DONT_FREE; dontfree = 1; } /*----------------------------------------------------------- | delete main trees, including top level PIs, etc. \-----------------------------------------------------------*/ node = doc->rootNode; if (node) { if (freeCB) { freeCB(node, clientData); } domFreeNode (node, freeCB, clientData, dontfree); } /*----------------------------------------------------------- | delete fragment trees \-----------------------------------------------------------*/ node = doc->fragments; while (node) { next = node->nextSibling; if (freeCB) { freeCB(node, clientData); } domFreeNode (node, freeCB, clientData, dontfree); node = next; } if (dontfree) return; /*----------------------------------------------------------- | delete namespaces \-----------------------------------------------------------*/ for (i = 0; i <= doc->nsptr; i++) { ns = doc->namespaces[i]; FREE(ns->uri); FREE(ns->prefix); FREE ((char*) ns); } FREE ((char *)doc->namespaces); /*----------------------------------------------------------- | delete global selectNodes prefix namespace mappings \-----------------------------------------------------------*/ if (doc->prefixNSMappings) { i = 0; while (doc->prefixNSMappings[i]) { FREE (doc->prefixNSMappings[i]); i++; } FREE (doc->prefixNSMappings); } /*----------------------------------------------------------- | delete doctype info \-----------------------------------------------------------*/ if (doc->doctype) { #define DOCINFO_FREE(item) if (doc->doctype->item) FREE(doc->doctype->item) DOCINFO_FREE(systemId); DOCINFO_FREE(publicId); DOCINFO_FREE(internalSubset); DOCINFO_FREE(encoding); DOCINFO_FREE(mediaType); DOCINFO_FREE(method); if (doc->doctype->cdataSectionElements) { Tcl_DeleteHashTable (doc->doctype->cdataSectionElements); FREE (doc->doctype->cdataSectionElements); } FREE((char*) doc->doctype); } /*----------------------------------------------------------- | delete ID hash table \-----------------------------------------------------------*/ if (doc->ids) { Tcl_DeleteHashTable (doc->ids); FREE (doc->ids); } /*----------------------------------------------------------- | delete unparsed entities hash table \-----------------------------------------------------------*/ if (doc->unparsedEntities) { entryPtr = Tcl_FirstHashEntry (doc->unparsedEntities, &search); while (entryPtr) { FREE (Tcl_GetHashValue (entryPtr)); entryPtr = Tcl_NextHashEntry (&search); } Tcl_DeleteHashTable (doc->unparsedEntities); FREE (doc->unparsedEntities); } /*----------------------------------------------------------- | delete base URIs hash table \-----------------------------------------------------------*/ entryPtr = Tcl_FirstHashEntry (doc->baseURIs, &search); while (entryPtr) { FREE (Tcl_GetHashValue (entryPtr)); entryPtr = Tcl_NextHashEntry (&search); } Tcl_DeleteHashTable (doc->baseURIs); FREE (doc->baseURIs); /*----------------------------------------------------------- | delete xpath cache hash table \-----------------------------------------------------------*/ if (doc->xpathCache) { entryPtr = Tcl_FirstHashEntry (doc->xpathCache, &search); while (entryPtr) { xpathFreeAst((ast)Tcl_GetHashValue (entryPtr)); entryPtr = Tcl_NextHashEntry (&search); } Tcl_DeleteHashTable (doc->xpathCache); FREE (doc->xpathCache); } if (doc->extResolver) { FREE (doc->extResolver); } /*----------------------------------------------------------- | delete tag/attribute hash tables (for threaded builds only) \-----------------------------------------------------------*/ TDomThreaded ( { Tcl_HashEntry *entryPtr; Tcl_HashSearch search; entryPtr = Tcl_FirstHashEntry(&doc->tdom_tagNames, &search); while (entryPtr) { Tcl_DeleteHashEntry(entryPtr); entryPtr = Tcl_NextHashEntry(&search); } Tcl_DeleteHashTable(&doc->tdom_tagNames); entryPtr = Tcl_FirstHashEntry(&doc->tdom_attrNames, &search); while (entryPtr) { Tcl_DeleteHashEntry(entryPtr); entryPtr = Tcl_NextHashEntry(&search); } Tcl_DeleteHashTable(&doc->tdom_attrNames); domLocksDetach(doc); node = doc->deletedNodes; while (node) { next = node->nextSibling; domFreeNode (node, freeCB, clientData, 0); node = next; } } ) FREE ((char*)doc); } /*--------------------------------------------------------------------------- | domSetAttribute | \--------------------------------------------------------------------------*/ domAttrNode * domSetAttribute ( domNode *node, const char *attributeName, const char *attributeValue ) { domAttrNode *attr, *lastAttr; Tcl_HashEntry *h; int hnew; if (!node || node->nodeType != ELEMENT_NODE) { return NULL; } /*---------------------------------------------------- | try to find an existing attribute \---------------------------------------------------*/ attr = node->firstAttr; while (attr && strcmp(attr->nodeName, attributeName)) { attr = attr->nextSibling; } if (attr) { if (attr->nodeFlags & IS_ID_ATTRIBUTE) { h = Tcl_FindHashEntry (node->ownerDocument->ids, attr->nodeValue); if (h) { Tcl_DeleteHashEntry (h); h = Tcl_CreateHashEntry (node->ownerDocument->ids, attributeValue, &hnew); /* XXX what to do, if hnew = 0 ??? */ Tcl_SetHashValue (h, node); } } FREE (attr->nodeValue); attr->valueLength = strlen(attributeValue); attr->nodeValue = (char*)MALLOC(attr->valueLength+1); strcpy(attr->nodeValue, attributeValue); } else { /*----------------------------------------------- | add a complete new attribute node \----------------------------------------------*/ attr = (domAttrNode*) domAlloc(sizeof(domAttrNode)); memset(attr, 0, sizeof(domAttrNode)); h = Tcl_CreateHashEntry(&HASHTAB(node->ownerDocument,tdom_attrNames), attributeName, &hnew); attr->nodeType = ATTRIBUTE_NODE; attr->nodeFlags = 0; attr->namespace = 0; attr->nodeName = (char *)&(h->key); attr->parentNode = node; attr->valueLength = strlen(attributeValue); attr->nodeValue = (char*)MALLOC(attr->valueLength+1); strcpy(attr->nodeValue, attributeValue); if (node->firstAttr) { lastAttr = node->firstAttr; /* move to the end of the attribute list */ while (lastAttr->nextSibling) lastAttr = lastAttr->nextSibling; lastAttr->nextSibling = attr; } else { node->firstAttr = attr; } } MutationEvent(); return attr; } /*--------------------------------------------------------------------------- | domSetAttributeNS | \--------------------------------------------------------------------------*/ domAttrNode * domSetAttributeNS ( domNode *node, const char *attributeName, const char *attributeValue, const char *uri, int createNSIfNeeded ) { domAttrNode *attr, *lastAttr; Tcl_HashEntry *h; int hnew, hasUri = 1, isNSAttr = 0, isDftNS = 0; domNS *ns; char prefix[MAX_PREFIX_LEN]; const char *localName, *newLocalName; Tcl_DString dStr; DBG(fprintf (stderr, "domSetAttributeNS: attributeName %s, attributeValue %s, uri %s\n", attributeName, attributeValue, uri);) if (!node || node->nodeType != ELEMENT_NODE) { return NULL; } domSplitQName (attributeName, prefix, &localName); if (!uri || uri[0]=='\0') hasUri = 0; if (hasUri && (prefix[0] == '\0')) return NULL; if ((prefix[0] == '\0' && strcmp (localName, "xmlns")==0) || (strcmp (prefix, "xmlns")==0)) { isNSAttr = 1; createNSIfNeeded = 0; if (prefix[0] == '\0') { isDftNS = 1; ns = domLookupPrefix (node, ""); } else { ns = domLookupPrefix (node, prefix); } if (ns && (strcmp (ns->uri, attributeValue)==0)) return NULL; if (!hasUri) { uri = attributeValue; isNSAttr = 1; hasUri = 1; if (strcmp (localName, "xmlns")==0) isDftNS = 1; } else { return NULL; } } if (!hasUri) { if (prefix[0] != '\0' && strcmp (prefix, "xml")==0) { uri = "http://www.w3.org/XML/1998/namespace"; hasUri = 1; } } if (!hasUri && prefix[0] != '\0') return NULL; /*---------------------------------------------------- | try to find an existing attribute \---------------------------------------------------*/ attr = node->firstAttr; while (attr) { if (hasUri) { if (attr->nodeFlags & IS_NS_NODE) { if (isNSAttr) { if (strcmp (attributeName, attr->nodeName)==0) { break; } } } else { if (attr->namespace && !isNSAttr) { ns = domGetNamespaceByIndex (node->ownerDocument, attr->namespace); if (strcmp (uri, ns->uri)==0) { newLocalName = localName; domSplitQName (attr->nodeName, prefix, &localName); if (strcmp (newLocalName, localName)==0) break; } } } } else { if (!attr->namespace) { if (strcmp (attr->nodeName, localName)==0) break; } } attr = attr->nextSibling; } if (attr) { DBG(fprintf (stderr, "domSetAttributeNS: reseting existing attribute %s ; old value: %s\n", attr->nodeName, attr->nodeValue);) if (attr->nodeFlags & IS_ID_ATTRIBUTE) { h = Tcl_FindHashEntry (node->ownerDocument->ids, attr->nodeValue); if (h) { Tcl_DeleteHashEntry (h); h = Tcl_CreateHashEntry (node->ownerDocument->ids, attributeValue, &hnew); Tcl_SetHashValue (h, node); } } FREE (attr->nodeValue); attr->valueLength = strlen(attributeValue); attr->nodeValue = (char*)MALLOC(attr->valueLength+1); strcpy(attr->nodeValue, attributeValue); } else { /*-------------------------------------------------------- | add a complete new attribute node \-------------------------------------------------------*/ attr = (domAttrNode*) domAlloc(sizeof(domAttrNode)); memset(attr, 0, sizeof(domAttrNode)); h = Tcl_CreateHashEntry(&HASHTAB(node->ownerDocument,tdom_attrNames), attributeName, &hnew); attr->nodeType = ATTRIBUTE_NODE; if (hasUri) { if (isNSAttr) { if (isDftNS) { ns = domLookupNamespace (node->ownerDocument, "", uri); } else { ns = domLookupNamespace (node->ownerDocument, localName, uri); } } else { ns = domLookupPrefix (node, prefix); if (ns && (strcmp (ns->uri, uri)!=0)) ns = NULL; } if (!ns) { if (isNSAttr) { if (isDftNS) { ns = domNewNamespace (node->ownerDocument, "", uri); } else { ns = domNewNamespace (node->ownerDocument, localName, uri); } } else { ns = domNewNamespace (node->ownerDocument, prefix, uri); if (createNSIfNeeded) { if (prefix[0] == '\0') { domSetAttributeNS (node, "xmlns", uri, NULL, 0); } else { Tcl_DStringInit (&dStr); Tcl_DStringAppend (&dStr, "xmlns:", 6); Tcl_DStringAppend (&dStr, prefix, -1); domSetAttributeNS (node, Tcl_DStringValue (&dStr), uri, NULL, 0); } } } } attr->namespace = ns->index; if (isNSAttr) { attr->nodeFlags = IS_NS_NODE; } } attr->nodeName = (char *)&(h->key); attr->parentNode = node; attr->valueLength = strlen(attributeValue); attr->nodeValue = (char*)MALLOC(attr->valueLength+1); strcpy(attr->nodeValue, attributeValue); if (isNSAttr) { if (node->firstAttr && (node->firstAttr->nodeFlags & IS_NS_NODE)) { lastAttr = node->firstAttr; while (lastAttr->nextSibling && (lastAttr->nextSibling->nodeFlags & IS_NS_NODE)) { lastAttr = lastAttr->nextSibling; } attr->nextSibling = lastAttr->nextSibling; lastAttr->nextSibling = attr; } else { attr->nextSibling = node->firstAttr; node->firstAttr = attr; } } else { if (node->firstAttr) { lastAttr = node->firstAttr; /* move to the end of the attribute list */ while (lastAttr->nextSibling) lastAttr = lastAttr->nextSibling; lastAttr->nextSibling = attr; } else { node->firstAttr = attr; } } } MutationEvent(); return attr; } /*--------------------------------------------------------------------------- | domRemoveAttribute | \--------------------------------------------------------------------------*/ int domRemoveAttribute ( domNode *node, const char *attributeName ) { domAttrNode *attr, *previous = NULL; Tcl_HashEntry *h; if (!node || node->nodeType != ELEMENT_NODE) { return -1; } /*---------------------------------------------------- | try to find the attribute \---------------------------------------------------*/ attr = node->firstAttr; while (attr && strcmp(attr->nodeName, attributeName)) { previous = attr; attr = attr->nextSibling; } if (attr) { if (previous) { previous->nextSibling = attr->nextSibling; } else { attr->parentNode->firstAttr = attr->nextSibling; } if (attr->nodeFlags & IS_ID_ATTRIBUTE) { h = Tcl_FindHashEntry (node->ownerDocument->ids, attr->nodeValue); if (h) Tcl_DeleteHashEntry (h); } FREE (attr->nodeValue); MutationEvent(); domFree ((void*)attr); return 0; } return -1; } /*--------------------------------------------------------------------------- | domRemoveAttributeNS | \--------------------------------------------------------------------------*/ int domRemoveAttributeNS ( domNode *node, const char *uri, const char *localName ) { domAttrNode *attr, *previous = NULL; domNS *ns = NULL; char prefix[MAX_PREFIX_LEN]; const char *str; Tcl_HashEntry *h; if (!node || node->nodeType != ELEMENT_NODE) { return -1; } attr = node->firstAttr; while (attr) { domSplitQName (attr->nodeName, prefix, &str); if (strcmp(localName,str)==0) { ns = domGetNamespaceByIndex(node->ownerDocument, attr->namespace); if (strcmp(ns->uri, uri)==0) { if (previous) { previous->nextSibling = attr->nextSibling; } else { attr->parentNode->firstAttr = attr->nextSibling; } if (attr->nodeFlags & IS_ID_ATTRIBUTE) { h = Tcl_FindHashEntry (node->ownerDocument->ids, attr->nodeValue); if (h) Tcl_DeleteHashEntry (h); } FREE (attr->nodeValue); MutationEvent(); domFree ((void*)attr); return 0; } } previous = attr; attr = attr->nextSibling; } return -1; } /*--------------------------------------------------------------------------- | __dbgAttr | \--------------------------------------------------------------------------*/ DBG( static void __dbgAttr (domAttrNode *node) { DBG(fprintf(stderr, " %s=%s", node->nodeName, node->nodeValue);) if (node->nextSibling) __dbgAttr(node->nextSibling); } ) /*--------------------------------------------------------------------------- | domSetDocument | \--------------------------------------------------------------------------*/ void domSetDocument ( domNode *node, domDocument *doc ) { domNode *child; domNS *ns, *origNS; domDocument *origDoc; domAttrNode *attr; Tcl_HashEntry *h; TDomThreaded ( int hnew; ) if (node->nodeFlags & HAS_BASEURI) { h = Tcl_FindHashEntry (node->ownerDocument->baseURIs, (char*)node); if (h) { FREE ((char *) Tcl_GetHashValue (h)); Tcl_DeleteHashEntry (h); } node->nodeFlags &= ~HAS_BASEURI; } if (node->nodeType == ELEMENT_NODE) { origDoc = node->ownerDocument; node->ownerDocument = doc; for (attr = node->firstAttr; attr != NULL; attr = attr->nextSibling) { if (attr->nodeFlags & IS_NS_NODE) { origNS = origDoc->namespaces[attr->namespace-1]; ns = domNewNamespace (doc, origNS->prefix, origNS->uri); attr->namespace = ns->index; } else if (attr->namespace) { ns = domAddNSToNode (node, origDoc->namespaces[attr->namespace-1]); if (ns) attr->namespace = ns->index; } } if (node->namespace) { ns = domAddNSToNode (node, origDoc->namespaces[node->namespace-1]); if (ns) node->namespace = ns->index; } else { ns = domAddNSToNode (node, NULL); if (ns) { node->namespace = ns->index; } } DBG(fprintf(stderr, "domSetDocument node%s ", node->nodeName); __dbgAttr(node->firstAttr); fprintf(stderr, "\n"); ) TDomThreaded ( if (origDoc != doc) { /* Make hash table entries as necessary for * tdom_tagNames and tdom_attrNames. */ h = Tcl_CreateHashEntry(&doc->tdom_tagNames, node->nodeName, &hnew); node->nodeName = (domString) &(h->key); for (attr = node->firstAttr; attr != NULL; attr = attr->nextSibling) { h = Tcl_CreateHashEntry(&doc->tdom_attrNames, attr->nodeName, &hnew); attr->nodeName = (domString) &(h->key); } } ) child = node->firstChild; while (child != NULL) { domSetDocument (child, doc); child = child->nextSibling; } } else { node->ownerDocument = doc; } DBG(fprintf(stderr, "end domSetDocument node %s\n", node->nodeName);) } /*--------------------------------------------------------------------------- | domSetNodeValue | \--------------------------------------------------------------------------*/ domException domSetNodeValue ( domNode *node, const char *nodeValue, int valueLen ) { domTextNode *textnode; if ((node->nodeType != TEXT_NODE) && (node->nodeType != CDATA_SECTION_NODE) && (node->nodeType != COMMENT_NODE) ) { return NO_MODIFICATION_ALLOWED_ERR; } textnode = (domTextNode*) node; FREE(textnode->nodeValue); textnode->nodeValue = MALLOC (valueLen); textnode->valueLength = valueLen; memmove(textnode->nodeValue, nodeValue, valueLen); MutationEvent(); return OK; } /* *---------------------------------------------------------------------- * * domRemoveChild -- * * This procedure implements the dom method removeChild. Removes * child from the list of children of node. * * Results: * Returns a domException: * * NOT_FOUND_ERR: Raised if the node child is not a child of node. * * OK: otherwise * * Side effects: * Alters the involved document. * *---------------------------------------------------------------------- */ domException domRemoveChild ( domNode *node, domNode *child ) { domNode *n; /* check, if node is in deed the parent of child */ if (child->parentNode != node) { /* If node is the root node of a document and child is in deed a child of this node, then child->parentNode will be NULL. In this case, we loop throu the childs of node, to see, if the child is valid. */ if (node->ownerDocument->rootNode == node) { n = node->firstChild; while (n) { if (n == child) { /* child is in deed a child of node */ break; } n = n->nextSibling; } if (!n) { return NOT_FOUND_ERR; } } else { return NOT_FOUND_ERR; } } if (child->previousSibling) { child->previousSibling->nextSibling = child->nextSibling; } else { node->firstChild = child->nextSibling; } if (child->nextSibling) { child->nextSibling->previousSibling = child->previousSibling; } else { node->lastChild = child->previousSibling; } /* link child into the fragments list */ if (child->ownerDocument->fragments) { child->nextSibling = child->ownerDocument->fragments; child->ownerDocument->fragments->previousSibling = child; child->ownerDocument->fragments = child; } else { child->ownerDocument->fragments = child; child->nextSibling = NULL; } child->parentNode = NULL; child->previousSibling = NULL; MutationEvent3(DOMNodeRemoved, child, node); MutationEvent2(DOMSubtreeModified, node); return OK; } /* *---------------------------------------------------------------------- * * domAppendChild -- * * This procedure implements the dom method appendChild. Adds the * node newChild to the end of the list of children of this * node. If the newChild is already in the tree, it is first * removed. * * Results: * Returns a domException: * * HIERARCHY_REQUEST_ERR: Raised if node is of a type that does * not allow children of the type of the childToAppend node, or * if the node to append is one of node's ancestors or the * rootNode of node's document. * * NOT_SUPPORTED_ERR: Raised if the childToInsert is the rootNode * of another document or if node is a rootNode. * * OK: otherwise * * Side effects: * Alters the involved document(s). * *---------------------------------------------------------------------- */ domException domAppendChild ( domNode *node, domNode *childToAppend ) { domNode *n; if (node->nodeType != ELEMENT_NODE) { return HIERARCHY_REQUEST_ERR; } /* check, whether childToAppend is node or one of node's ancestors */ n = node; while (n) { if (n == childToAppend) { return HIERARCHY_REQUEST_ERR; } n = n->parentNode; } if (childToAppend == childToAppend->ownerDocument->rootNode) { if (childToAppend == node->ownerDocument->rootNode) { return HIERARCHY_REQUEST_ERR; } else { return NOT_SUPPORTED_ERR; } } /* unlink childToAppend */ if (childToAppend->previousSibling) { childToAppend->previousSibling->nextSibling = childToAppend->nextSibling; } else { if (childToAppend->parentNode) { childToAppend->parentNode->firstChild = childToAppend->nextSibling; } else { /* childToAppend is either out of the fragment list or a child of the rootNode of its document */ if (childToAppend->ownerDocument->fragments == childToAppend) { childToAppend->ownerDocument->fragments = childToAppend->nextSibling; } else { childToAppend->ownerDocument->rootNode->firstChild = childToAppend->nextSibling; } } } if (childToAppend->nextSibling) { childToAppend->nextSibling->previousSibling = childToAppend->previousSibling; } else { if (childToAppend->parentNode) { childToAppend->parentNode->lastChild = childToAppend->previousSibling; } else { if (childToAppend->ownerDocument->rootNode->lastChild == childToAppend) { childToAppend->ownerDocument->rootNode->lastChild = childToAppend->previousSibling; } } } if (node->lastChild) { node->lastChild->nextSibling = childToAppend; childToAppend->previousSibling = node->lastChild; } else { node->firstChild = childToAppend; childToAppend->previousSibling = NULL; } node->lastChild = childToAppend; childToAppend->nextSibling = NULL; if (!childToAppend->parentNode && (childToAppend->ownerDocument->documentElement == childToAppend)) { childToAppend->ownerDocument->documentElement = childToAppend->ownerDocument->rootNode->firstChild; } if (node == node->ownerDocument->rootNode) { childToAppend->parentNode = NULL; } else { childToAppend->parentNode = node; } if ((node->ownerDocument != childToAppend->ownerDocument) || node->ownerDocument->nsptr || childToAppend->ownerDocument->baseURIs->numEntries) { domSetDocument (childToAppend, node->ownerDocument); } node->ownerDocument->nodeFlags |= NEEDS_RENUMBERING; MutationEvent(); return OK; } /* *---------------------------------------------------------------------- * * domInsertBefore -- * * This procedure implements the dom method insertBefore. * It inserts the node childToInsert before the existing child * node referenceChild. If referenceChild is null, insert * childToInsert at the end of the list of children of node. The * arguments node and childToInsert must be non NULL. The * childToInsert is unlinked from its previous place (fragment * list or tree). * * Results: * Returns a domException: * * HIERARCHY_REQUEST_ERR: Raised if node is of a type that does * not allow children of the type of the childToInsert node, or * if the node to insert is node or one of node's ancestors or the * rootNode of node's document. * * NOT_FOUND_ERR: Raised if refChild is not a child of this node. * * NOT_SUPPORTED_ERR: Raised if the childToInsert is the rootNode * of another document or if node is a rootNode. * * OK: otherwise * * Side effects: * Alters the involved document(s). * *---------------------------------------------------------------------- */ domException domInsertBefore ( domNode *node, domNode *childToInsert, domNode *referenceChild ) { domNode *n; if (node->nodeType != ELEMENT_NODE) { return HIERARCHY_REQUEST_ERR; } /* check, if node is in deed the parent of referenceChild */ if (referenceChild) { if (referenceChild->parentNode != node) { /* If node is the root node of a document and referenceChild is in deed a child of this node, then referenceChild->parentNode will be NULL. In this case, we loop throu the childs of node, to see, if the referenceChild is valid. */ if (node->ownerDocument->rootNode == node) { n = node->firstChild; while (n) { if (n == referenceChild) { /* referenceChild is in deed a child of node */ break; } n = n->nextSibling; } if (!n) { return NOT_FOUND_ERR; } } else { return NOT_FOUND_ERR; } } } if (childToInsert == referenceChild) { return OK; } /* check, whether childToInsert is one of node's ancestors */ n = node; while (n) { if (n == childToInsert) { return HIERARCHY_REQUEST_ERR; } n = n->parentNode; } if (childToInsert == childToInsert->ownerDocument->rootNode) { if (childToInsert == node->ownerDocument->rootNode) { return HIERARCHY_REQUEST_ERR; } else { /* For now, we simply don't allow the rootNode of another element as childToInsert. The way to go may be simply to treat the rootNode as DocumentFragment and to insert all childs of that rootNode before the referenceChild. This would result in a document without documentElement, which then should be handled right by other methods. This is planed, but not carefully considered, yet. */ return NOT_SUPPORTED_ERR; } } /* unlink childToInsert */ if (childToInsert->previousSibling) { childToInsert->previousSibling->nextSibling = childToInsert->nextSibling; } else { if (childToInsert->parentNode) { childToInsert->parentNode->firstChild = childToInsert->nextSibling; } else { /* childToInsert is either out of the fragment list or a child of the rootNode of its document */ if (childToInsert->ownerDocument->fragments == childToInsert) { childToInsert->ownerDocument->fragments = childToInsert->nextSibling; } else { childToInsert->ownerDocument->rootNode->firstChild = childToInsert->nextSibling; } } } if (childToInsert->nextSibling) { childToInsert->nextSibling->previousSibling = childToInsert->previousSibling; } else { if (childToInsert->parentNode) { childToInsert->parentNode->lastChild = childToInsert->previousSibling; } else { if (childToInsert->ownerDocument->rootNode->lastChild == childToInsert) { childToInsert->ownerDocument->rootNode->lastChild = childToInsert->previousSibling; } } } childToInsert->nextSibling = referenceChild; if (referenceChild) { if (referenceChild->previousSibling) { childToInsert->previousSibling = referenceChild->previousSibling; referenceChild->previousSibling->nextSibling = childToInsert; } else { node->firstChild = childToInsert; childToInsert->previousSibling = NULL; } referenceChild->previousSibling = childToInsert; } else { if (node->lastChild) { node->lastChild->nextSibling = childToInsert; childToInsert->previousSibling = node->lastChild; } else { node->firstChild = childToInsert; childToInsert->previousSibling = NULL; } node->lastChild = childToInsert; } if (!childToInsert->parentNode && (childToInsert->ownerDocument->documentElement == childToInsert)) { childToInsert->ownerDocument->documentElement = childToInsert->ownerDocument->rootNode->firstChild; } if (node == node->ownerDocument->rootNode) { childToInsert->parentNode = NULL; } else { childToInsert->parentNode = node; } if (node->ownerDocument != childToInsert->ownerDocument || node->ownerDocument->nsptr || childToInsert->ownerDocument->baseURIs->numEntries) { domSetDocument (childToInsert, node->ownerDocument); } node->ownerDocument->nodeFlags |= NEEDS_RENUMBERING; MutationEvent3(DOMNodeInsert, childToInsert, node); MutationEvent2(DOMSubtreeModified, node); return OK; } /* *---------------------------------------------------------------------- * * domReplaceChild -- * * This procedure implements the dom method replaceChild. * Replaces the child node oldChild with newChild in the list of * children of node 'node'. * * Results: * Returns a domException: * * HIERARCHY_REQUEST_ERR: Raised if node is of a type that does * not allow children of the type of the newChild node, or * if newChild is node or one of node's ancestors or the * rootNode of node's document. * * NOT_FOUND_ERR: Raised if oldChild is not a child of node. * * NOT_SUPPORTED_ERR: Raised if the newChild is the rootNode * of another document. * * OK: otherwise * * Side effects: * Alters the involved document(s). * *---------------------------------------------------------------------- */ domException domReplaceChild ( domNode *node, domNode *newChild, domNode *oldChild ) { domNode *n; if (node->nodeType != ELEMENT_NODE) { return HIERARCHY_REQUEST_ERR; } /* check, if node is in deed the parent of oldChild */ if (oldChild->parentNode != node) { /* If node is the root node of a document and oldChild is in deed a child of this node, then oldChild->parentNode will be NULL. In this case, we loop throu the childs of node, to see, if the oldChild is valid. */ if (node->ownerDocument->rootNode == node) { n = node->firstChild; while (n) { if (n == oldChild) { /* oldChild is in deed a child of node */ break; } n = n->nextSibling; } if (!n) { return NOT_FOUND_ERR; } } else { return NOT_FOUND_ERR; } } if (oldChild == newChild) { return OK; } /* check, whether newChild is node or one of node's ancestors */ n = node; while (n) { if (n == newChild) { return HIERARCHY_REQUEST_ERR; } n = n->parentNode; } if (newChild == newChild->ownerDocument->rootNode) { if (newChild == node->ownerDocument->rootNode) { return HIERARCHY_REQUEST_ERR; } else { return NOT_SUPPORTED_ERR; } } /* unlink newChild */ if (newChild->previousSibling) { newChild->previousSibling->nextSibling = newChild->nextSibling; } else { if (newChild->parentNode) { newChild->parentNode->firstChild = newChild->nextSibling; } else { /* newChild is either out of the fragment list or a child of the rootNode of its document */ if (newChild->ownerDocument->fragments == newChild) { newChild->ownerDocument->fragments = newChild->nextSibling; } else { newChild->ownerDocument->rootNode->firstChild = newChild->nextSibling; } } } if (newChild->nextSibling) { newChild->nextSibling->previousSibling = newChild->previousSibling; } else { if (newChild->parentNode) { newChild->parentNode->lastChild = newChild->previousSibling; } else { if (newChild->ownerDocument->rootNode->lastChild == newChild) { newChild->ownerDocument->rootNode->lastChild = newChild->previousSibling; } } } newChild->nextSibling = oldChild->nextSibling; newChild->previousSibling = oldChild->previousSibling; if (!newChild->parentNode && (newChild->ownerDocument->documentElement == newChild)) { newChild->ownerDocument->documentElement = newChild->ownerDocument->rootNode->firstChild; } if (node == node->ownerDocument->rootNode) { newChild->parentNode = NULL; } else { newChild->parentNode = node; } if (oldChild->previousSibling) { oldChild->previousSibling->nextSibling = newChild; } else { node->firstChild = newChild; } if (oldChild->nextSibling) { oldChild->nextSibling->previousSibling = newChild; } else { node->lastChild = newChild; } if (node->ownerDocument != newChild->ownerDocument || node->ownerDocument->nsptr || newChild->ownerDocument->baseURIs->numEntries) { domSetDocument (newChild, node->ownerDocument); } /* add old child into his fragment list */ if (oldChild->ownerDocument->fragments) { oldChild->nextSibling = oldChild->ownerDocument->fragments; oldChild->ownerDocument->fragments->previousSibling = oldChild; oldChild->ownerDocument->fragments = oldChild; } else { oldChild->ownerDocument->fragments = oldChild; oldChild->nextSibling = oldChild->previousSibling = NULL; } oldChild->parentNode = NULL; node->ownerDocument->nodeFlags |= NEEDS_RENUMBERING; MutationEvent(); return OK; } /*--------------------------------------------------------------------------- | domNewTextNode | \--------------------------------------------------------------------------*/ domTextNode * domNewTextNode( domDocument *doc, const char *value, int length, domNodeType nodeType ) { domTextNode *node; node = (domTextNode*) domAlloc(sizeof(domTextNode)); memset(node, 0, sizeof(domTextNode)); node->nodeType = nodeType; node->nodeFlags = 0; node->namespace = 0; node->nodeNumber = NODE_NO(doc); node->ownerDocument = doc; node->valueLength = length; node->nodeValue = (char*)MALLOC(length); memmove(node->nodeValue, value, length); if (doc->fragments) { node->nextSibling = doc->fragments; doc->fragments->previousSibling = (domNode*)node; doc->fragments = (domNode*)node; } else { doc->fragments = (domNode*)node; } return node; } void domEscapeCData ( char *value, int length, Tcl_DString *escapedData ) { int i, start = 0; char *pc; Tcl_DStringInit (escapedData); pc = value; for (i = 0; i < length; i++) { if (*pc == '&') { Tcl_DStringAppend (escapedData, &value[start], i - start); Tcl_DStringAppend (escapedData, "&", 5); start = i+1; } else if (*pc == '<') { Tcl_DStringAppend (escapedData, &value[start], i - start); Tcl_DStringAppend (escapedData, "<", 4); start = i+1; } else if (*pc == '>') { Tcl_DStringAppend (escapedData, &value[start], i - start); Tcl_DStringAppend (escapedData, ">", 4); start = i+1; } pc++; } if (start) { Tcl_DStringAppend (escapedData, &value[start], length - start); } } /*--------------------------------------------------------------------------- | domAppendNewTextNode | \--------------------------------------------------------------------------*/ domTextNode * domAppendNewTextNode( domNode *parent, char *value, int length, domNodeType nodeType, int disableOutputEscaping ) { domTextNode *node; if (!length) { return NULL; } if (parent->lastChild && parent->lastChild->nodeType == TEXT_NODE && nodeType == TEXT_NODE ) { /*------------------------------------------------------------------ | append to already existing text node \-----------------------------------------------------------------*/ domAppendData ((domTextNode *) (parent->lastChild), value, length, disableOutputEscaping); MutationEvent(); return (domTextNode*)parent->lastChild; } node = (domTextNode*) domAlloc(sizeof(domTextNode)); memset(node, 0, sizeof(domTextNode)); node->nodeType = nodeType; node->nodeFlags = 0; if (disableOutputEscaping) { node->nodeFlags |= DISABLE_OUTPUT_ESCAPING; } node->namespace = 0; node->nodeNumber = NODE_NO(parent->ownerDocument); node->ownerDocument = parent->ownerDocument; node->valueLength = length; node->nodeValue = (char*)MALLOC(length); memmove(node->nodeValue, value, length); if (parent->lastChild) { parent->lastChild->nextSibling = (domNode*)node; node->previousSibling = parent->lastChild; } else { parent->firstChild = (domNode*)node; node->previousSibling = NULL; } parent->lastChild = (domNode*)node; node->nextSibling = NULL; if (parent != parent->ownerDocument->rootNode) { node->parentNode = parent; } MutationEvent(); return node; } /*--------------------------------------------------------------------------- | domAppendNewElementNode | \--------------------------------------------------------------------------*/ domNode * domAppendNewElementNode( domNode *parent, const char *tagName, const char *uri ) { Tcl_HashEntry *h; domNode *node; domNS *ns; domAttrNode *NSattr; int hnew; char prefix[MAX_PREFIX_LEN]; const char *localname; Tcl_DString dStr; if (parent == NULL) { DBG(fprintf(stderr, "dom.c: Error parent == NULL!\n");) return NULL; } h = Tcl_CreateHashEntry(&HASHTAB(parent->ownerDocument,tdom_tagNames), tagName, &hnew); node = (domNode*) domAlloc(sizeof(domNode)); memset(node, 0, sizeof(domNode)); node->nodeType = ELEMENT_NODE; node->nodeNumber = NODE_NO(parent->ownerDocument); node->ownerDocument = parent->ownerDocument; node->nodeName = (char *)&(h->key); if (parent->lastChild) { parent->lastChild->nextSibling = node; node->previousSibling = parent->lastChild; } else { parent->firstChild = node; node->previousSibling = NULL; } parent->lastChild = node; node->nextSibling = NULL; if (parent != parent->ownerDocument->rootNode) { node->parentNode = parent; } /*-------------------------------------------------------- | re-use existing namespace or create a new one \-------------------------------------------------------*/ if (uri) { domSplitQName (tagName, prefix, &localname); DBG(fprintf(stderr, "tag '%s' has prefix='%s' \n", tagName, prefix);) ns = domLookupPrefix (node, prefix); if (!ns || (strcmp (uri, ns->uri)!=0)) { ns = domNewNamespace(node->ownerDocument, prefix, uri); if (prefix[0] == '\0') { domSetAttributeNS (node, "xmlns", uri, NULL, 1); } else { Tcl_DStringInit (&dStr); Tcl_DStringAppend (&dStr, "xmlns:", 6); Tcl_DStringAppend (&dStr, prefix, -1); domSetAttributeNS (node, Tcl_DStringValue (&dStr), uri, NULL, 1); } } node->namespace = ns->index; } else { ns = domLookupPrefix (node, ""); if (ns) { if (strcmp (ns->uri, "")!=0) { NSattr = domSetAttributeNS (node, "xmlns", "", NULL, 1); if (NSattr) { node->namespace = NSattr->namespace; } } else { node->namespace = ns->index; } } } MutationEvent(); return node; } /* *---------------------------------------------------------------------- * * domAppendData -- * * This procedure implements the dom method appendData. It is * also used by domNormalize and domAppendNewTextNode. * * Results: * A domException; currently always OK. * * Side effects: * Appends the data to node. * *---------------------------------------------------------------------- */ domException domAppendData ( domTextNode *node, /* The node, to append value to. Must be a TEXT_NODE, COMMENT_NODE or CDATA_SECTION_NODE*/ char *value, /* The data to append */ int length, /* The length of value in byte */ int disableOutputEscaping /* If true, disable output escaping on the node */ ) { Tcl_DString escData; if (node->nodeFlags & DISABLE_OUTPUT_ESCAPING) { if (disableOutputEscaping) { node->nodeValue = REALLOC (node->nodeValue, node->valueLength + length); memmove (node->nodeValue + node->valueLength, value, length); node->valueLength += length; } else { domEscapeCData (value, length, &escData); if (Tcl_DStringLength (&escData)) { node->nodeValue = REALLOC (node->nodeValue, node->valueLength + Tcl_DStringLength (&escData)); memmove (node->nodeValue + node->valueLength, Tcl_DStringValue (&escData), Tcl_DStringLength (&escData)); node->valueLength += Tcl_DStringLength (&escData); } else { node->nodeValue = REALLOC (node->nodeValue, node->valueLength+length); memmove (node->nodeValue + node->valueLength, value, length); node->valueLength += length; } Tcl_DStringFree (&escData); } } else { if (disableOutputEscaping) { node->nodeFlags |= DISABLE_OUTPUT_ESCAPING; domEscapeCData (node->nodeValue, node->valueLength, &escData); if (Tcl_DStringLength (&escData)) { FREE (node->nodeValue); node->nodeValue = MALLOC (Tcl_DStringLength (&escData) + length); memmove (node->nodeValue, Tcl_DStringValue (&escData), Tcl_DStringLength (&escData)); node->valueLength = Tcl_DStringLength (&escData); } else { node->nodeValue = REALLOC (node->nodeValue, node->valueLength+length); } Tcl_DStringFree (&escData); } else { node->nodeValue = REALLOC (node->nodeValue, node->valueLength + length); } memmove (node->nodeValue + node->valueLength, value, length); node->valueLength += length; } return OK; } /* *---------------------------------------------------------------------- * * domNormalize -- * * This procedure implements the dom method normalize. Puts all * Text nodes in the full depth of the sub-tree underneath node, * including attribute nodes, into a "normal" form where only * structure (e.g., elements, comments, processing instructions, * CDATA sections, and entity references) separates Text nodes, * i.e., there are neither adjacent Text nodes nor empty Text * nodes. If the flag forXPath is true, then CDATASection nodes * are treated as if they are text nodes (and merged with * circumjacent text nodes). Node must be an ELEMENT_NODE. * * Results: * None. * * Side effects: * May alter the tree. * *---------------------------------------------------------------------- */ void domNormalize ( domNode *node, /* root of the sub-tree to normalize */ int forXPath, /* if true, treat CDATA_SECTION_NODEs as if they where TEXT_NODEs */ domFreeCallback freeCB, /* Function to call, if a node must be freed */ void *clientData /* ClientData, to provide to the freeCB */ ) { domNode *child, *nextChild; int merge = 0; if (node->nodeType != ELEMENT_NODE) return; child = node->firstChild; while (child) { merge = 0; switch (child->nodeType) { case ELEMENT_NODE: domNormalize (child, forXPath, freeCB, clientData); break; case TEXT_NODE: if (child->previousSibling && child->previousSibling->nodeType == TEXT_NODE) { merge = 1; } else { if (((domTextNode *)child)->valueLength == 0) { nextChild = child->nextSibling; domDeleteNode (child, freeCB, clientData); child = nextChild; continue; } } break; case CDATA_SECTION_NODE: if (forXPath) { if (child->previousSibling && child->previousSibling->nodeType == TEXT_NODE) { merge = 1; } else { if (((domTextNode *)child)->valueLength == 0) { nextChild = child->nextSibling; domDeleteNode (child, freeCB, clientData); child = nextChild; continue; } child->nodeType = TEXT_NODE; } } break; default: break; } if (merge) { domAppendData ( (domTextNode *)(child->previousSibling), ((domTextNode *)child)->nodeValue, ((domTextNode *)child)->valueLength, (child->nodeFlags & DISABLE_OUTPUT_ESCAPING) ); nextChild = child->nextSibling; domDeleteNode (child, freeCB, clientData); child = nextChild; } else { child = child->nextSibling; } } } /*--------------------------------------------------------------------------- | domAddNSToNode | \--------------------------------------------------------------------------*/ domNS * domAddNSToNode ( domNode *node, domNS *nsToAdd ) { domAttrNode *attr, *lastNSAttr; domNS *ns, noNS; Tcl_HashEntry *h; int hnew; Tcl_DString dStr; if (!nsToAdd) { noNS.uri = ""; noNS.prefix = ""; noNS.index = 0; nsToAdd = &noNS; } DBG(fprintf (stderr, "domAddNSToNode to node '%s': prefix: %s, uri: %s\n", node->nodeName, nsToAdd->prefix, nsToAdd->uri);) ns = domLookupPrefix (node, nsToAdd->prefix); if (ns) { if (strcmp (ns->uri, nsToAdd->uri)==0) { /* namespace already in scope, we're done. */ return ns; } } else { /* If the NS to set was no NS and there isn't a default NS we're done */ if (nsToAdd->prefix[0] == '\0' && nsToAdd->uri[0] == '\0') return NULL; } ns = domNewNamespace (node->ownerDocument, nsToAdd->prefix, nsToAdd->uri); Tcl_DStringInit (&dStr); if (nsToAdd->prefix[0] == '\0') { Tcl_DStringAppend (&dStr, "xmlns", 5); } else { Tcl_DStringAppend (&dStr, "xmlns:", 6); Tcl_DStringAppend (&dStr, nsToAdd->prefix, -1); } /* Add new namespace attribute */ attr = (domAttrNode*) domAlloc(sizeof(domAttrNode)); memset(attr, 0, sizeof(domAttrNode)); h = Tcl_CreateHashEntry(&HASHTAB(node->ownerDocument,tdom_attrNames), Tcl_DStringValue(&dStr), &hnew); attr->nodeType = ATTRIBUTE_NODE; attr->nodeFlags = IS_NS_NODE; attr->namespace = ns->index; attr->nodeName = (char *)&(h->key); attr->parentNode = node; attr->valueLength = strlen(nsToAdd->uri); attr->nodeValue = (char*)MALLOC(attr->valueLength+1); strcpy(attr->nodeValue, nsToAdd->uri); lastNSAttr = NULL; if (node->firstAttr && (node->firstAttr->nodeFlags & IS_NS_NODE)) { lastNSAttr = node->firstAttr; while (lastNSAttr->nextSibling && (lastNSAttr->nextSibling->nodeFlags & IS_NS_NODE)) { lastNSAttr = lastNSAttr->nextSibling; } } if (lastNSAttr) { attr->nextSibling = lastNSAttr->nextSibling; lastNSAttr->nextSibling = attr; } else { attr->nextSibling = node->firstAttr; node->firstAttr = attr; } Tcl_DStringFree (&dStr); return ns; } /*--------------------------------------------------------------------------- | domAppendLiteralNode | \--------------------------------------------------------------------------*/ domNode * domAppendLiteralNode( domNode *parent, domNode *literalNode ) { Tcl_HashEntry *h; domNode *node; int hnew; if (parent == NULL) { DBG(fprintf(stderr, "dom.c: Error parent == NULL!\n");) return NULL; } h = Tcl_CreateHashEntry(&HASHTAB(parent->ownerDocument, tdom_tagNames), literalNode->nodeName, &hnew); node = (domNode*) domAlloc(sizeof(domNode)); memset(node, 0, sizeof(domNode)); node->nodeType = ELEMENT_NODE; node->nodeNumber = NODE_NO(parent->ownerDocument); node->ownerDocument = parent->ownerDocument; node->nodeName = (char *)&(h->key); if (parent->lastChild) { parent->lastChild->nextSibling = node; node->previousSibling = parent->lastChild; } else { parent->firstChild = node; node->previousSibling = NULL; } parent->lastChild = node; node->nextSibling = NULL; if (parent != parent->ownerDocument->rootNode) { node->parentNode = parent; } MutationEvent(); return node; } /*--------------------------------------------------------------------------- | domNewProcessingInstructionNode | \--------------------------------------------------------------------------*/ domProcessingInstructionNode * domNewProcessingInstructionNode( domDocument *doc, const char *targetValue, int targetLength, const char *dataValue, int dataLength ) { domProcessingInstructionNode *node; node = (domProcessingInstructionNode*) domAlloc(sizeof(domProcessingInstructionNode)); memset(node, 0, sizeof(domProcessingInstructionNode)); node->nodeType = PROCESSING_INSTRUCTION_NODE; node->nodeFlags = 0; node->namespace = 0; node->nodeNumber = NODE_NO(doc); node->ownerDocument = doc; node->targetLength = targetLength; node->targetValue = (char*)MALLOC(targetLength); memmove(node->targetValue, targetValue, targetLength); node->dataLength = dataLength; node->dataValue = (char*)MALLOC(dataLength); memmove(node->dataValue, dataValue, dataLength); if (doc->fragments) { node->nextSibling = doc->fragments; doc->fragments->previousSibling = (domNode*)node; doc->fragments = (domNode*)node; } else { doc->fragments = (domNode*)node; } MutationEvent(); return node; } /*--------------------------------------------------------------------------- | domNewElementNode | \--------------------------------------------------------------------------*/ domNode * domNewElementNode( domDocument *doc, const char *tagName, domNodeType nodeType ) { domNode *node; Tcl_HashEntry *h; int hnew; h = Tcl_CreateHashEntry(&HASHTAB(doc, tdom_tagNames), tagName, &hnew); node = (domNode*) domAlloc(sizeof(domNode)); memset(node, 0, sizeof(domNode)); node->nodeType = nodeType; node->nodeFlags = 0; node->namespace = 0; node->nodeNumber = NODE_NO(doc); node->ownerDocument = doc; node->nodeName = (char *)&(h->key); if (doc->fragments) { node->nextSibling = doc->fragments; doc->fragments->previousSibling = node; doc->fragments = node; } else { doc->fragments = node; } return node; } /*--------------------------------------------------------------------------- | domNewElementNodeNS | \--------------------------------------------------------------------------*/ domNode * domNewElementNodeNS ( domDocument *doc, const char *tagName, const char *uri, domNodeType nodeType ) { domNode *node; Tcl_HashEntry *h; int hnew; char prefix[MAX_PREFIX_LEN]; const char *localname; domNS *ns; h = Tcl_CreateHashEntry(&HASHTAB(doc, tdom_tagNames), tagName, &hnew); node = (domNode*) domAlloc(sizeof(domNode)); memset(node, 0, sizeof(domNode)); node->nodeType = nodeType; node->nodeFlags = 0; node->namespace = 0; node->nodeNumber = NODE_NO(doc); node->ownerDocument = doc; node->nodeName = (char *)&(h->key); domSplitQName (tagName, prefix, &localname); ns = domNewNamespace(doc, prefix, uri); node->namespace = ns->index; if (doc->fragments) { node->nextSibling = doc->fragments; doc->fragments->previousSibling = node; doc->fragments = node; } else { doc->fragments = node; } return node; } /*--------------------------------------------------------------------------- | domCloneNode | \--------------------------------------------------------------------------*/ domNode * domCloneNode ( domNode *node, int deep ) { domAttrNode *attr, *nattr; domNode *n, *child, *newChild; /*------------------------------------------------------------------ | create new node \-----------------------------------------------------------------*/ if (node->nodeType == PROCESSING_INSTRUCTION_NODE) { domProcessingInstructionNode *pinode = (domProcessingInstructionNode*)node; return (domNode*) domNewProcessingInstructionNode( pinode->ownerDocument, pinode->targetValue, pinode->targetLength, pinode->dataValue, pinode->dataLength); } if (node->nodeType != ELEMENT_NODE) { domTextNode *tnode = (domTextNode*)node; return (domNode*) domNewTextNode(tnode->ownerDocument, tnode->nodeValue, tnode->valueLength, tnode->nodeType); } n = domNewElementNode(node->ownerDocument, node->nodeName, node->nodeType); n->namespace = node->namespace; /*------------------------------------------------------------------ | copy attributes (if any) \-----------------------------------------------------------------*/ attr = node->firstAttr; while (attr != NULL) { nattr = domSetAttribute (n, attr->nodeName, attr->nodeValue ); nattr->namespace = attr->namespace; if (attr->nodeFlags & IS_NS_NODE) { nattr->nodeFlags |= IS_NS_NODE; } attr = attr->nextSibling; } if (deep) { child = node->firstChild; while (child) { newChild = domCloneNode(child, deep); /* append new (cloned)child to cloned node, its new parent. Don't use domAppendChild for this, because that would mess around with the namespaces */ if (n->ownerDocument->fragments->nextSibling) { n->ownerDocument->fragments = n->ownerDocument->fragments->nextSibling; n->ownerDocument->fragments->previousSibling = NULL; newChild->nextSibling = NULL; } else { n->ownerDocument->fragments = NULL; } if (n->firstChild) { newChild->previousSibling = n->lastChild; n->lastChild->nextSibling = newChild; } else { n->firstChild = newChild; } n->lastChild = newChild; newChild->parentNode = n; /* clone next child */ child = child->nextSibling; } } return n; } /*---------------------------------------------------------------------------- | domCopyNS | \---------------------------------------------------------------------------*/ void domCopyNS ( domNode *from, domNode *to ) { domNode *n, *n1; domNS *ns, *ns1; domAttrNode *attr, *attr1; int skip; n = from; while (n) { attr = n->firstAttr; while (attr && (attr->nodeFlags & IS_NS_NODE)) { ns = n->ownerDocument->namespaces[attr->namespace-1]; skip = 0; n1 = from; while (n1 != n) { attr1 = n1->firstAttr; while (attr1 && (attr1->nodeFlags & IS_NS_NODE)) { ns1 = n1->ownerDocument->namespaces[attr1->namespace-1]; if ((ns1->prefix == NULL && ns->prefix == NULL) || (strcmp (ns1->prefix, ns->prefix)==0)) { skip = 1; break; } attr1 = attr1->nextSibling; } if (skip) break; n1 = n1->parentNode; } if (!skip) { /* Add this prefix/uri combination only to the destination, if it isn't already in scope */ ns1 = domLookupPrefix (to, ns->prefix); if (!ns1 || (strcmp (ns->uri, ns1->uri)!=0)) { domAddNSToNode (to, ns); } } attr = attr->nextSibling; } n = n->parentNode; } } /*--------------------------------------------------------------------------- | domCopyTo | \--------------------------------------------------------------------------*/ void domCopyTo ( domNode *node, domNode *parent, int copyNS ) { domAttrNode *attr, *nattr; domNode *n, *child; domNS *ns, *ns1; /*------------------------------------------------------------------ | create new node \-----------------------------------------------------------------*/ if (node->nodeType == PROCESSING_INSTRUCTION_NODE) { domProcessingInstructionNode *pinode = (domProcessingInstructionNode*)node; n = (domNode*) domNewProcessingInstructionNode( parent->ownerDocument, pinode->targetValue, pinode->targetLength, pinode->dataValue, pinode->dataLength); domAppendChild (parent, n); return; } if (node->nodeType != ELEMENT_NODE) { domTextNode *tnode = (domTextNode*)node; n = (domNode*) domNewTextNode(parent->ownerDocument, tnode->nodeValue, tnode->valueLength, tnode->nodeType); domAppendChild (parent, n); return; } n = domAppendLiteralNode (parent, node); if (copyNS) { domCopyNS (node, n); } /*------------------------------------------------------------------ | copy attributes (if any) \-----------------------------------------------------------------*/ attr = node->firstAttr; while (attr != NULL) { if (attr->nodeFlags & IS_NS_NODE) { if (copyNS) { /* If copyNS is true, then all namespaces in scope * (including the one declared with the node to copy) * are allready copied over. */ attr = attr->nextSibling; continue; } ns = node->ownerDocument->namespaces[attr->namespace-1]; ns1 = domLookupPrefix (n, ns->prefix); if (ns1 && strcmp (ns->uri, ns1->uri)==0) { /* This namespace is already in scope, so we don't copy the namespace attribute over */ attr = attr->nextSibling; continue; } nattr = domSetAttribute (n, attr->nodeName, attr->nodeValue ); nattr->nodeFlags = attr->nodeFlags; ns1 = domNewNamespace (n->ownerDocument, ns->prefix, ns->uri); nattr->namespace = ns1->index; } else { nattr = domSetAttribute (n, attr->nodeName, attr->nodeValue ); nattr->nodeFlags = attr->nodeFlags; if (attr->namespace) { ns = node->ownerDocument->namespaces[attr->namespace-1]; ns1 = domLookupPrefix (n, ns->prefix); if (ns1) { nattr->namespace = ns1->index; } } } attr = attr->nextSibling; } /* We have to set the node namespace index after copying the attribute nodes over, because the node may be in a namespace, which is declared just at the node. */ if (node->namespace) { ns = node->ownerDocument->namespaces[node->namespace-1]; ns1 = domLookupPrefix (n, ns->prefix); n->namespace = ns1->index; } child = node->firstChild; while (child) { domCopyTo(child, n, 0); child = child->nextSibling; } } /*--------------------------------------------------------------------------- | domXPointerChild | \--------------------------------------------------------------------------*/ int domXPointerChild ( domNode * node, int all, int instance, domNodeType type, char * element, char * attrName, char * attrValue, int attrLen, domAddCallback addCallback, void * clientData ) { domNode *child; domAttrNode *attr; int i=0, result; if (node->nodeType != ELEMENT_NODE) { return 0; } if (instance<0) { child = node->lastChild; } else { child = node->firstChild; } while (child) { if ((type == ALL_NODES) || (child->nodeType == type)) { if ((element == NULL) || ((child->nodeType == ELEMENT_NODE) && (strcmp(child->nodeName,element)==0)) ) { if (attrName == NULL) { i = (instance<0) ? i-1 : i+1; if (all || (i == instance)) { result = addCallback (child, clientData); if (result) { return result; } } } else { attr = child->firstAttr; while (attr) { if ((strcmp(attr->nodeName,attrName)==0) && ( (strcmp(attrValue,"*")==0) || ( (attr->valueLength == attrLen) && (strcmp(attr->nodeValue,attrValue)==0) ) ) ) { i = (instance<0) ? i-1 : i+1; if (all || (i == instance)) { result = addCallback (child, clientData); if (result) { return result; } } } attr = attr->nextSibling; } } } } if (instance<0) { child = child->previousSibling; } else { child = child->nextSibling; } } return 0; } /*--------------------------------------------------------------------------- | domXPointerXSibling | \--------------------------------------------------------------------------*/ int domXPointerXSibling ( domNode * node, int forward_mode, int all, int instance, domNodeType type, char * element, char * attrName, char * attrValue, int attrLen, domAddCallback addCallback, void * clientData ) { domNode *sibling, *endSibling; domAttrNode *attr; int i=0, result; if (forward_mode) { if (instance<0) { endSibling = node; sibling = node; if (node->parentNode) { sibling = node->parentNode->lastChild; } } else { sibling = node->nextSibling; endSibling = NULL; } } else { if (instance<0) { endSibling = node; sibling = node; if (node->parentNode) { sibling = node->parentNode->firstChild; } } else { sibling = node->previousSibling; endSibling = NULL; } instance = -1 * instance; } while (sibling != endSibling) { if ((type == ALL_NODES) || (sibling->nodeType == type)) { if ((element == NULL) || ((sibling->nodeType == ELEMENT_NODE) && (strcmp(sibling->nodeName,element)==0)) ) { if (attrName == NULL) { i = (instance<0) ? i-1 : i+1; if (all || (i == instance)) { result = addCallback (sibling, clientData); if (result) { return result; } } } else { attr = sibling->firstAttr; while (attr) { if ((strcmp(attr->nodeName,attrName)==0) && ( (strcmp(attrValue,"*")==0) || ( (attr->valueLength == attrLen) && (strcmp(attr->nodeValue,attrValue)==0) ) ) ) { i = (instance<0) ? i-1 : i+1; if (all || (i == instance)) { result = addCallback (sibling, clientData); if (result) { return result; } } } attr = attr->nextSibling; } } } } if (instance<0) { sibling = sibling->previousSibling; } else { sibling = sibling->nextSibling; } } return 0; } /*--------------------------------------------------------------------------- | domXPointerDescendant | \--------------------------------------------------------------------------*/ int domXPointerDescendant ( domNode * node, int all, int instance, int * i, domNodeType type, char * element, char * attrName, char * attrValue, int attrLen, domAddCallback addCallback, void * clientData ) { domNode *child; domAttrNode *attr; int found=0, result; if (node->nodeType != ELEMENT_NODE) { return 0; } if (instance<0) { child = node->lastChild; } else { child = node->firstChild; } while (child) { found = 0; if ((type == ALL_NODES) || (child->nodeType == type)) { if ((element == NULL) || ((child->nodeType == ELEMENT_NODE) && (strcmp(child->nodeName,element)==0)) ) { if (attrName == NULL) { *i = (instance<0) ? (*i)-1 : (*i)+1; if (all || (*i == instance)) { result = addCallback (child, clientData); if (result) { return result; } found = 1; } } else { attr = child->firstAttr; while (attr) { if ((strcmp(attr->nodeName,attrName)==0) && ( (strcmp(attrValue,"*")==0) || ( (attr->valueLength == attrLen) && (strcmp(attr->nodeValue,attrValue)==0) ) ) ) { *i = (instance<0) ? (*i)-1 : (*i)+1; if (all || (*i == instance)) { result = addCallback (child, clientData); if (result) { return result; } found = 1; } } attr = attr->nextSibling; } } } } if (!found) { /* recurs into childs */ result = domXPointerDescendant (child, all, instance, i, type, element, attrName, attrValue, attrLen, addCallback, clientData); if (result) { return result; } } if (instance<0) { child = child->previousSibling; } else { child = child->nextSibling; } } return 0; } /*--------------------------------------------------------------------------- | domXPointerAncestor | \--------------------------------------------------------------------------*/ int domXPointerAncestor ( domNode * node, int all, int instance, int * i, domNodeType type, char * element, char * attrName, char * attrValue, int attrLen, domAddCallback addCallback, void * clientData ) { domNode *ancestor; domAttrNode *attr; int found=0, result; ancestor = node->parentNode; if (ancestor) { found = 0; if ((type == ALL_NODES) || (ancestor->nodeType == type)) { if ((element == NULL) || ((ancestor->nodeType == ELEMENT_NODE) && (strcmp(ancestor->nodeName,element)==0)) ) { if (attrName == NULL) { *i = (instance<0) ? (*i)-1 : (*i)+1; if (all || (*i == instance)) { result = addCallback (ancestor, clientData); if (result) { return result; } found = 1; } } else { attr = ancestor->firstAttr; while (attr) { if ((strcmp(attr->nodeName,attrName)==0) && ( (strcmp(attrValue,"*")==0) || ( (attr->valueLength == attrLen) && (strcmp(attr->nodeValue,attrValue)==0) ) ) ) { *i = (instance<0) ? (*i)-1 : (*i)+1; if (all || (*i == instance)) { result = addCallback (ancestor, clientData); if (result) { return result; } found = 1; } } attr = attr->nextSibling; } } } } /* go up */ result = domXPointerAncestor (ancestor, all, instance, i, type, element, attrName, attrValue, attrLen, addCallback, clientData); if (result) { return result; } } return 0; } /*--------------------------------------------------------------------------- | type tdomCmdReadInfo | \--------------------------------------------------------------------------*/ typedef struct _tdomCmdReadInfo { XML_Parser parser; domDocument *document; domNode *currentNode; int depth; int ignoreWhiteSpaces; Tcl_DString *cdata; TEncoding *encoding_8bit; int storeLineColumn; int feedbackAfter; int lastFeedbackPosition; Tcl_Interp *interp; int activeNSsize; int activeNSpos; domActiveNS *activeNS; int baseURIstackSize; int baseURIstackPos; domActiveBaseURI *baseURIstack; int insideDTD; /* Now the tdom cmd specific elements */ int tdomStatus; Tcl_Obj *extResolver; } tdomCmdReadInfo; EXTERN int tcldom_returnDocumentObj (Tcl_Interp *interp, domDocument *document, int setVariable, Tcl_Obj *var_name, int trace, int forOwnerDocument); void tdom_freeProc ( Tcl_Interp *interp, void *userData ) { tdomCmdReadInfo *info = (tdomCmdReadInfo *) userData; if (info->document) { domFreeDocument (info->document, NULL, NULL); } if (info->activeNS) { FREE (info->activeNS); } if (info->baseURIstack) { FREE (info->baseURIstack); } Tcl_DStringFree (info->cdata); FREE (info->cdata); if (info->extResolver) { Tcl_DecrRefCount (info->extResolver); } FREE (info); } void tdom_parserResetProc ( XML_Parser parser, void *userData ) { tdomCmdReadInfo *info = (tdomCmdReadInfo *) userData; info->parser = parser; } void tdom_resetProc ( Tcl_Interp *interp, void *userData ) { tdomCmdReadInfo *info = (tdomCmdReadInfo *) userData; if (!info->tdomStatus) return; if (info->document) { domFreeDocument (info->document, NULL, NULL); } info->document = NULL; info->currentNode = NULL; info->depth = 0; info->feedbackAfter = 0; Tcl_DStringSetLength (info->cdata, 0); info->lastFeedbackPosition = 0; info->interp = interp; info->activeNSpos = -1; info->insideDTD = 0; info->baseURIstackPos = 0; info->tdomStatus = 0; } void tdom_initParseProc ( Tcl_Interp *interp, void *userData ) { tdomCmdReadInfo *info = (tdomCmdReadInfo *) userData; info->document = domCreateDoc(XML_GetBase (info->parser), info->storeLineColumn); if (info->extResolver) { info->document->extResolver = tdomstrdup (Tcl_GetString (info->extResolver)); } info->baseURIstack[0].baseURI = XML_GetBase (info->parser); info->baseURIstack[0].depth = 0; info->tdomStatus = 2; } static void tdom_charDataHandler ( void *userData, const char *s, int len ) { domReadInfo *info = userData; Tcl_DStringAppend (info->cdata, s, len); DispatchPCDATA (info); return; } int TclTdomObjCmd (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { char *method, *encodingName; CHandlerSet *handlerSet; int methodIndex, result, bool; tdomCmdReadInfo *info; TclGenExpatInfo *expat; Tcl_Obj *newObjName = NULL; TEncoding *encoding; static CONST84 char *tdomMethods[] = { "enable", "getdoc", "setResultEncoding", "setStoreLineColumn", "setExternalEntityResolver", "keepEmpties", "remove", NULL }; enum tdomMethod { m_enable, m_getdoc, m_setResultEncoding, m_setStoreLineColumn, m_setExternalEntityResolver, m_keepEmpties, m_remove }; if (objc < 3 || objc > 4) { Tcl_WrongNumArgs (interp, 1, objv, tdom_usage); return TCL_ERROR; } if (!CheckExpatParserObj (interp, objv[1])) { Tcl_SetResult (interp, "First argument has to be a expat parser object", NULL); return TCL_ERROR; } method = Tcl_GetString(objv[2]); if (Tcl_GetIndexFromObj (interp, objv[2], tdomMethods, "method", 0, &methodIndex) != TCL_OK) { Tcl_SetResult (interp, tdom_usage, NULL); return TCL_ERROR; } switch ((enum tdomMethod) methodIndex) { default: Tcl_SetResult (interp, "unknown method", NULL); return TCL_ERROR; case m_enable: handlerSet = CHandlerSetCreate ("tdom"); handlerSet->ignoreWhiteCDATAs = 1; handlerSet->resetProc = tdom_resetProc; handlerSet->freeProc = tdom_freeProc; handlerSet->parserResetProc = tdom_parserResetProc; handlerSet->initParseProc = tdom_initParseProc; handlerSet->elementstartcommand = startElement; handlerSet->elementendcommand = endElement; handlerSet->datacommand = tdom_charDataHandler; /* handlerSet->datacommand = characterDataHandler; */ handlerSet->commentCommand = commentHandler; handlerSet->picommand = processingInstructionHandler; handlerSet->entityDeclCommand = entityDeclHandler; handlerSet->startDoctypeDeclCommand = startDoctypeDeclHandler; handlerSet->endDoctypeDeclCommand = endDoctypeDeclHandler; expat = GetExpatInfo (interp, objv[1]); info = (tdomCmdReadInfo *) MALLOC (sizeof (tdomCmdReadInfo)); info->parser = expat->parser; info->document = NULL; info->currentNode = NULL; info->depth = 0; info->ignoreWhiteSpaces = 1; info->cdata = (Tcl_DString*) MALLOC (sizeof (Tcl_DString)); Tcl_DStringInit (info->cdata); info->encoding_8bit = 0; info->storeLineColumn = 0; info->feedbackAfter = 0; info->lastFeedbackPosition = 0; info->interp = interp; info->activeNSpos = -1; info->activeNSsize = 8; info->activeNS = (domActiveNS*) MALLOC(sizeof(domActiveNS) * info->activeNSsize); info->baseURIstackPos = 0; info->baseURIstackSize = INITIAL_BASEURISTACK_SIZE; info->baseURIstack = (domActiveBaseURI*) MALLOC (sizeof(domActiveBaseURI) * info->baseURIstackSize); info->insideDTD = 0; info->tdomStatus = 0; info->extResolver = NULL; handlerSet->userData = info; CHandlerSetInstall (interp, objv[1], handlerSet); break; case m_getdoc: info = CHandlerSetGetUserData (interp, objv[1], "tdom"); if (!info) { Tcl_SetResult (interp, "parser object isn't tdom enabled.", NULL); return TCL_ERROR; } expat = GetExpatInfo (interp, objv[1]); if (info->tdomStatus != 2 || !expat->finished) { Tcl_SetResult (interp, "No DOM tree avaliable.", NULL); return TCL_ERROR; } domSetDocumentElement (info->document); result = tcldom_returnDocumentObj (interp, info->document, 0, newObjName, 0, 0); info->document = NULL; return result; case m_setResultEncoding: info = CHandlerSetGetUserData (interp, objv[1], "tdom"); if (!info) { Tcl_SetResult (interp, "parser object isn't tdom enabled.", NULL); return TCL_ERROR; } if (info->encoding_8bit == NULL) { Tcl_AppendResult (interp, "UTF-8", NULL); } else { Tcl_AppendResult (interp, tdom_GetEncodingName (info->encoding_8bit), NULL); } if (objc == 4) { encodingName = Tcl_GetString(objv[3]); if ( (strcmp(encodingName, "UTF-8") == 0) ||(strcmp(encodingName, "UTF8" ) == 0) ||(strcmp(encodingName, "utf-8") == 0) ||(strcmp(encodingName, "utf8" ) == 0)) { info->encoding_8bit = NULL; } else { encoding = tdom_GetEncoding ( encodingName ); if (encoding == NULL) { Tcl_AppendResult(interp, "encoding not found", NULL); return TCL_ERROR; } info->encoding_8bit = encoding; } } info->tdomStatus = 1; break; case m_setStoreLineColumn: info = CHandlerSetGetUserData (interp, objv[1], "tdom"); if (!info) { Tcl_SetResult (interp, "parser object isn't tdom enabled.", NULL); return TCL_ERROR; } Tcl_SetIntObj (Tcl_GetObjResult (interp), info->storeLineColumn); if (objc == 4) { Tcl_GetBooleanFromObj (interp, objv[3], &bool); info->storeLineColumn = bool; } info->tdomStatus = 1; break; case m_remove: result = CHandlerSetRemove (interp, objv[1], "tdom"); if (result == 2) { Tcl_SetResult (interp, "expat parser obj hasn't a C handler set named \"tdom\"", NULL); return TCL_ERROR; } break; case m_setExternalEntityResolver: if (objc != 4) { Tcl_SetResult (interp, "You must name a tcl command as external entity resolver for setExternalEntityResolver.", NULL); return TCL_ERROR; } info = CHandlerSetGetUserData (interp, objv[1], "tdom"); if (!info) { Tcl_SetResult (interp, "parser object isn't tdom enabled.", NULL); return TCL_ERROR; } if (info->extResolver) { Tcl_DecrRefCount (info->extResolver); } if (strcmp (Tcl_GetString (objv[3]), "") == 0) { info->extResolver = NULL; } else { info->extResolver = objv[3]; Tcl_IncrRefCount (info->extResolver); } info->tdomStatus = 1; break; case m_keepEmpties: if (objc != 4) { Tcl_SetResult (interp, "wrong # of args for method keepEmpties.", NULL); return TCL_ERROR; } handlerSet = CHandlerSetGet (interp, objv[1], "tdom"); info = handlerSet->userData; if (!info) { Tcl_SetResult (interp, "parser object isn't tdom enabled.", NULL); return TCL_ERROR; } Tcl_SetIntObj (Tcl_GetObjResult (interp), info->ignoreWhiteSpaces); Tcl_GetBooleanFromObj (interp, objv[3], &bool); info->ignoreWhiteSpaces = !bool; handlerSet->ignoreWhiteCDATAs = !bool; info->tdomStatus = 1; break; } return TCL_OK; } tDOM-0.8.3/generic/tclexpat.c0000644000175000017500000042567610763331124016207 0ustar ssobernissoberni/* * tclexpat.c -- * * A Tcl interface to James Clark's expat XML parser * * Copyright (c) 1998 Steve Ball, Zveno Pty Ltd * * with modifications * by Jochen Loewer(loewerj@hotmail.com) (July 1999) * by ericm@scriptics.com, 1999.6.25 * by Rolf Ade (rolf@pointsman.de) (2000, 2001) * * * Zveno Pty Ltd makes this software and associated documentation * available free of charge for any purpose. You may make copies * of the software but you must include all of this notice on any copy. * * Zveno Pty Ltd does not warrant that this software is error free * or fit for any purpose. Zveno Pty Ltd disclaims any liability for * all claims, expenses, losses, damages and costs any user may incur * as a result of using, copying or modifying the software. * * Jochen Loewer does not warrant that this software is error free * or fit for any purpose. Jochen Loewer disclaims any liability for * all claims, expenses, losses, damages and costs any user may incur * as a result of using, copying or modifying the software. * * 2001-2007 Rolf Ade All changes and enhancements. * */ /*---------------------------------------------------------------------------- | Includes | \---------------------------------------------------------------------------*/ #include #include #include #include #include #ifdef _MSC_VER #include #endif #ifdef _POSIX_SOURCE #include #endif /* Used internal als status, like TCL_OK, TCL_ERROR etc. As a consequent, application specific error codes must be at least greater than 5 */ #define ERROR_IN_EXTREFHANDLER 5 #define READ_SIZE (1024*8) #ifndef O_BINARY #ifdef _O_BINARY #define O_BINARY _O_BINARY #else #define O_BINARY 0 #endif #endif /*---------------------------------------------------------------------------- | Macros | \---------------------------------------------------------------------------*/ #define DBG(x) #define SetResult(interp,str) \ (Tcl_SetStringObj (Tcl_GetObjResult (interp), (str), -1)) #define SetIntResult(interp,i) \ (Tcl_SetIntObj (Tcl_GetObjResult (interp), (i) )) #define AppendResult(interp,str) \ (Tcl_AppendToObj (Tcl_GetObjResult (interp), (str), -1)) #define CheckArgs(min,max,n,msg) \ if ((objc < min) || (objc >max)) { \ Tcl_WrongNumArgs(interp, n, objv, msg); \ return TCL_ERROR; \ } #define CheckDefaultTclHandlerSet \ if (!activeTclHandlerSet) { \ activeTclHandlerSet = CreateTclHandlerSet("default");\ tmpTclHandlerSet = expat->firstTclHandlerSet; \ expat->firstTclHandlerSet = activeTclHandlerSet; \ activeTclHandlerSet->nextHandlerSet = tmpTclHandlerSet; \ } /*---------------------------------------------------------------------------- | typedefs | \---------------------------------------------------------------------------*/ typedef enum { EXPAT_INPUT_STRING, EXPAT_INPUT_CHANNEL, EXPAT_INPUT_FILENAME } TclExpat_InputType; /*---------------------------------------------------------------------------- | local globals | \---------------------------------------------------------------------------*/ static int uniqueCounter = 0; /* Counter to generate unique command names */ TDomThreaded(static Tcl_Mutex counterMutex;) /* Protect the counter (zv) */ /*---------------------------------------------------------------------------- | Prototypes for procedures defined later in this file: | \---------------------------------------------------------------------------*/ int TclExpatObjCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclExpatInstanceCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, struct Tcl_Obj *CONST objv[])); static void TclExpatDeleteCmd _ANSI_ARGS_((ClientData clientData)); static Tcl_Obj* FindUniqueCmdName _ANSI_ARGS_((Tcl_Interp *interp)); static int TclExpatCheckWhiteData _ANSI_ARGS_((char *pc, int len)); static int TclExpatInitializeParser _ANSI_ARGS_((Tcl_Interp *interp, TclGenExpatInfo *expat, int resetOptions )); static void TclExpatFreeParser _ANSI_ARGS_((TclGenExpatInfo *expat)); static int TclExpatParse _ANSI_ARGS_((Tcl_Interp *interp, TclGenExpatInfo *expat, char *data, int len, TclExpat_InputType type)); static int TclExpatConfigure _ANSI_ARGS_((Tcl_Interp *interp, TclGenExpatInfo *expat, int objc, Tcl_Obj *CONST objv[])); static int TclExpatCget _ANSI_ARGS_((Tcl_Interp *interp, TclGenExpatInfo *expat, int objc, Tcl_Obj *CONST objv[])); static int TclExpatGet _ANSI_ARGS_((Tcl_Interp *interp, TclGenExpatInfo *expat, int objc, Tcl_Obj *CONST objv[])); static void TclExpatDispatchPCDATA _ANSI_ARGS_((TclGenExpatInfo *expat)); static void TclGenExpatElementStartHandler _ANSI_ARGS_((void *userdata, const XML_Char *name, const XML_Char **atts)); static void TclGenExpatElementEndHandler _ANSI_ARGS_((void *userData, const XML_Char *name)); static void TclGenExpatCharacterDataHandler _ANSI_ARGS_((void *userData, const XML_Char *s, int len)); static void TclGenExpatProcessingInstructionHandler _ANSI_ARGS_(( void *userData, const XML_Char *target, const XML_Char *data)); static int TclGenExpatExternalEntityRefHandler _ANSI_ARGS_(( XML_Parser parser, const XML_Char *openEntityNames, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId)); static void TclGenExpatDefaultHandler _ANSI_ARGS_ ((void *userData, const XML_Char *s, int len)); static void TclGenExpatNotationDeclHandler _ANSI_ARGS_ ((void *userData, const XML_Char *notationName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId)); static int TclGenExpatUnknownEncodingHandler _ANSI_ARGS_ (( void *encodingHandlerData, const XML_Char *name, XML_Encoding *info)); static void TclGenExpatStartNamespaceDeclHandler _ANSI_ARGS_((void *userdata, const XML_Char *prefix, const XML_Char *uri)); static void TclGenExpatEndNamespaceDeclHandler _ANSI_ARGS_((void *userData, const XML_Char *prefix)); /* Following added by ericm@scriptics, 1999.6.25 */ /* Prototype definition for the TclExpat comment handler */ static void TclGenExpatCommentHandler _ANSI_ARGS_ ((void *userData, const XML_Char *data)); /* Prototype for TclExpat Not Standalone Handler */ static int TclGenExpatNotStandaloneHandler _ANSI_ARGS_ ((void *userData)); /* Prototype for TclExpat {Start|End}CdataSectionHandler */ static void TclGenExpatStartCdataSectionHandler _ANSI_ARGS_((void *userData)); static void TclGenExpatEndCdataSectionHandler _ANSI_ARGS_((void *userData)); /* Added by ericm@scriptics.com, 1999.09.13 */ /* Prototype for TclExpat (Element|Attlist) Declaration Handlers */ static void TclGenExpatElementDeclHandler _ANSI_ARGS_((void *userData, const XML_Char *name, XML_Content *model)); static void TclGenExpatAttlistDeclHandler _ANSI_ARGS_((void *userData, const XML_Char *elname, const XML_Char *name, const XML_Char *type, const XML_Char *dflt, int isrequired)); /* Prototypes for the TclExpat Doctype Decl handlers */ static void TclGenExpatStartDoctypeDeclHandler _ANSI_ARGS_((void *userData, const XML_Char *doctypeName, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset)); static void TclGenExpatEndDoctypeDeclHandler _ANSI_ARGS_((void *userData)); static void TclGenExpatXmlDeclHandler _ANSI_ARGS_((void *userData, const XML_Char *version, const XML_Char *encoding, int standalone)); static void TclGenExpatEntityDeclHandler _ANSI_ARGS_((void *userData, const XML_Char *entityname, int is_param, const XML_Char *value, int length, CONST XML_Char *base, CONST XML_Char *systemId, CONST XML_Char *publicId, CONST XML_Char *notationName)); /* *---------------------------------------------------------------------------- * * CreateTclHandlerSet -- * * Malloc's and initializes a tclHandlerSet. * * Results: * None. * * Side effects: * Mallocs memory for the structure and the 'name' field, sets all * handler scripts to NULL and inits some other fields. * *---------------------------------------------------------------------------- */ static TclHandlerSet* CreateTclHandlerSet (name) char *name; { TclHandlerSet *handlerSet; handlerSet = (TclHandlerSet*) MALLOC (sizeof (TclHandlerSet)); \ handlerSet->name = tdomstrdup (name); handlerSet->ignoreWhiteCDATAs = 0; handlerSet->status = TCL_OK; handlerSet->continueCount = 0; handlerSet->nextHandlerSet = NULL; handlerSet->elementstartcommand = NULL; handlerSet->elementendcommand = NULL; handlerSet->startnsdeclcommand = NULL; handlerSet->endnsdeclcommand = NULL; handlerSet->datacommand = NULL; handlerSet->picommand = NULL; handlerSet->defaultcommand = NULL; handlerSet->notationcommand = NULL; handlerSet->externalentitycommand = NULL; handlerSet->unknownencodingcommand = NULL; handlerSet->commentCommand = NULL; handlerSet->notStandaloneCommand = NULL; handlerSet->startCdataSectionCommand = NULL; handlerSet->endCdataSectionCommand = NULL; handlerSet->elementDeclCommand = NULL; handlerSet->attlistDeclCommand = NULL; handlerSet->startDoctypeDeclCommand = NULL; handlerSet->endDoctypeDeclCommand = NULL; handlerSet->xmlDeclCommand = NULL; handlerSet->entityDeclCommand = NULL; return handlerSet; } /* *---------------------------------------------------------------------------- * * CHandlerSetCreate -- * * Initializes a CHandlerSet. * * Results: * None. * * Side effects: * Mallocs memory for the 'name' of the structure, sets all * handler functions to NULL and inits some other fields. * *---------------------------------------------------------------------------- */ CHandlerSet* CHandlerSetCreate (name) char *name; { CHandlerSet *handlerSet; handlerSet = (CHandlerSet *) MALLOC (sizeof (CHandlerSet)); handlerSet->name = tdomstrdup (name); handlerSet->ignoreWhiteCDATAs = 0; handlerSet->nextHandlerSet = NULL; handlerSet->userData = NULL; handlerSet->resetProc = NULL; handlerSet->freeProc = NULL; handlerSet->initParseProc = NULL; handlerSet->parserResetProc = NULL; handlerSet->elementstartcommand = NULL; handlerSet->elementendcommand = NULL; handlerSet->startnsdeclcommand = NULL; handlerSet->endnsdeclcommand = NULL; handlerSet->datacommand = NULL; handlerSet->picommand = NULL; handlerSet->defaultcommand = NULL; handlerSet->notationcommand = NULL; handlerSet->externalentitycommand = NULL; handlerSet->unknownencodingcommand = NULL; handlerSet->commentCommand = NULL; handlerSet->notStandaloneCommand = NULL; handlerSet->startCdataSectionCommand = NULL; handlerSet->endCdataSectionCommand = NULL; handlerSet->elementDeclCommand = NULL; handlerSet->attlistDeclCommand = NULL; handlerSet->startDoctypeDeclCommand = NULL; handlerSet->endDoctypeDeclCommand = NULL; handlerSet->xmlDeclCommand = NULL; handlerSet->entityDeclCommand = NULL; return handlerSet; } /* *---------------------------------------------------------------------------- * * TclExpatObjCmd -- * * Creation command for expat class. * * Results: * The name of the newly created parser instance. * * Side effects: * This creates an expat parser. * *---------------------------------------------------------------------------- */ int TclExpatObjCmd(dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { TclGenExpatInfo *genexpat; int ns_mode = 0; char *nsoption; /* * Create the data structures for this parser. */ if (!(genexpat = (TclGenExpatInfo *) MALLOC(sizeof(TclGenExpatInfo)))) { FREE( (char*) genexpat); Tcl_SetResult(interp, "unable to create parser", NULL); return TCL_ERROR; } memset (genexpat, 0, sizeof (TclGenExpatInfo)); genexpat->interp = interp; genexpat->final = 1; /* * Find unique command name */ if (objc < 2) { genexpat->name = FindUniqueCmdName(interp); } else { genexpat->name = objv[1]; if (*(Tcl_GetString(genexpat->name)) != '-') { Tcl_IncrRefCount(genexpat->name); objv++; objc--; } else { genexpat->name = FindUniqueCmdName(interp); } } genexpat->paramentityparsing = XML_PARAM_ENTITY_PARSING_NEVER; if (objc > 1) { nsoption = Tcl_GetString(objv[1]); if (strcmp(nsoption,"-namespace")==0) { ns_mode = 1; objv++; objc--; } } genexpat->ns_mode = ns_mode; genexpat->nsSeparator = ':'; if (TclExpatInitializeParser(interp, genexpat, 0) != TCL_OK) { FREE( (char*) genexpat); return TCL_ERROR; } /* * Register a Tcl command for this parser instance. */ Tcl_CreateObjCommand(interp, Tcl_GetString(genexpat->name), TclExpatInstanceCmd, (ClientData) genexpat, TclExpatDeleteCmd); /* * Handle configuration options */ if (objc > 1) { if (TclExpatConfigure(interp, genexpat, objc - 1, objv + 1) != TCL_OK) { return TCL_ERROR; } } Tcl_SetObjResult(interp, genexpat->name); return TCL_OK; } /* *---------------------------------------------------------------------------- * * FindUniqueCmdName -- * * Generate new command name in caller's namespace. * * Results: * Returns newly allocated Tcl object containing name. * * Side effects: * Allocates Tcl object. * *---------------------------------------------------------------------------- */ static Tcl_Obj * FindUniqueCmdName(interp) Tcl_Interp *interp; { Tcl_Obj *name; Tcl_CmdInfo info; char s[20]; name = Tcl_NewStringObj("", 0); Tcl_IncrRefCount(name); do { TDomThreaded(Tcl_MutexLock(&counterMutex);) sprintf(s, "xmlparser%d", uniqueCounter++); TDomThreaded(Tcl_MutexUnlock(&counterMutex);) Tcl_SetStringObj(name, s, -1); } while (Tcl_GetCommandInfo(interp, Tcl_GetString(name), &info)); return name; } /* *---------------------------------------------------------------------------- * * TclExpatInitializeParser -- * * Create or re-initializes (if it already exists) the expat * parser and initialise (some of) the TclExpatInfo structure. * * Note that callback commands are not affected by this routine, * to allow a reset to leave these intact. * * Results: * A flag, signaling success or error. * * Side effects: * Creates or reset an expat parser. * Modifies TclExpatInfo fields. * *---------------------------------------------------------------------------- */ static int TclExpatInitializeParser(interp, expat, resetOptions) Tcl_Interp *interp; TclGenExpatInfo *expat; int resetOptions; { CHandlerSet *activeCHandlerSet; ExpatElemContent *eContent, *eContentSave; if (expat->parser) { XML_ParserReset (expat->parser, NULL); activeCHandlerSet = expat->firstCHandlerSet; while (activeCHandlerSet) { if (activeCHandlerSet->resetProc) { activeCHandlerSet->resetProc (expat->interp, activeCHandlerSet->userData); } activeCHandlerSet = activeCHandlerSet->nextHandlerSet; } } else { if (expat->ns_mode) { if (!(expat->parser = XML_ParserCreate_MM(NULL, MEM_SUITE, &expat->nsSeparator))) { Tcl_SetResult(interp, "unable to create expat parserNs", NULL); return TCL_ERROR; } } else { if (!(expat->parser = XML_ParserCreate_MM(NULL, MEM_SUITE, NULL))) { Tcl_SetResult(interp, "unable to create expat parser", NULL); return TCL_ERROR; } } } expat->status = TCL_OK; if (expat->result) { Tcl_DecrRefCount (expat->result); expat->result = NULL; } if (expat->cdata) { Tcl_DecrRefCount (expat->cdata); } expat->cdata = NULL; eContent = expat->eContents; while (eContent) { XML_FreeContentModel (expat->parser, eContent->content); eContentSave = eContent; eContent = eContent->next; FREE((char *) eContentSave); } expat->eContents = NULL; expat->finished = 0; expat->parsingState = 0; if (resetOptions) { expat->final = 1; expat->needWSCheck = 0; expat->noexpand = 0; expat->useForeignDTD = 0; expat->paramentityparsing = XML_PARAM_ENTITY_PARSING_NEVER; if (expat->baseURI) { Tcl_DecrRefCount (expat->baseURI); expat->baseURI = NULL; } } if (expat->baseURI) { XML_SetBase (expat->parser, Tcl_GetString (expat->baseURI)); Tcl_DecrRefCount (expat->baseURI); expat->baseURI = NULL; } /* * Set handlers for the parser to routines in this module. */ XML_SetElementHandler(expat->parser, (XML_StartElementHandler) TclGenExpatElementStartHandler, (XML_EndElementHandler) TclGenExpatElementEndHandler); XML_SetNamespaceDeclHandler(expat->parser, (XML_StartNamespaceDeclHandler) TclGenExpatStartNamespaceDeclHandler, (XML_EndNamespaceDeclHandler) TclGenExpatEndNamespaceDeclHandler); XML_SetCharacterDataHandler(expat->parser, (XML_CharacterDataHandler) TclGenExpatCharacterDataHandler); XML_SetProcessingInstructionHandler(expat->parser, (XML_ProcessingInstructionHandler) TclGenExpatProcessingInstructionHandler); XML_SetDefaultHandlerExpand(expat->parser, (XML_DefaultHandler) TclGenExpatDefaultHandler); XML_SetNotationDeclHandler(expat->parser, (XML_NotationDeclHandler) TclGenExpatNotationDeclHandler); XML_SetExternalEntityRefHandler(expat->parser, (XML_ExternalEntityRefHandler) TclGenExpatExternalEntityRefHandler); XML_SetUnknownEncodingHandler(expat->parser, (XML_UnknownEncodingHandler) TclGenExpatUnknownEncodingHandler, (void *) expat); XML_SetCommentHandler(expat->parser, TclGenExpatCommentHandler); XML_SetNotStandaloneHandler(expat->parser, TclGenExpatNotStandaloneHandler); XML_SetCdataSectionHandler(expat->parser, TclGenExpatStartCdataSectionHandler, TclGenExpatEndCdataSectionHandler); XML_SetElementDeclHandler(expat->parser, TclGenExpatElementDeclHandler); XML_SetAttlistDeclHandler(expat->parser, TclGenExpatAttlistDeclHandler); XML_SetDoctypeDeclHandler(expat->parser, TclGenExpatStartDoctypeDeclHandler, TclGenExpatEndDoctypeDeclHandler); XML_SetXmlDeclHandler (expat->parser, TclGenExpatXmlDeclHandler); XML_SetEntityDeclHandler (expat->parser, TclGenExpatEntityDeclHandler); if (expat->noexpand) { XML_SetDefaultHandlerExpand(expat->parser, NULL); XML_SetDefaultHandler(expat->parser, (XML_DefaultHandler) TclGenExpatDefaultHandler); } else { XML_SetDefaultHandler(expat->parser, NULL); XML_SetDefaultHandlerExpand(expat->parser, (XML_DefaultHandler) TclGenExpatDefaultHandler); } XML_SetUserData(expat->parser, (void *) expat); return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclExpatFreeParser -- * * Destroy the expat parser structure and frees the stored content models, * if there one. * * Results: * None. * * Side effects: * Frees any memory allocated for the XML parser and (if still present) * the stored content models. * *---------------------------------------------------------------------------- */ static void TclExpatFreeParser(expat) TclGenExpatInfo *expat; { ExpatElemContent *eContent, *eContentSave; eContent = expat->eContents; while (eContent) { XML_FreeContentModel (expat->parser, eContent->content); eContentSave = eContent; eContent = eContent->next; FREE((char *) eContentSave); } expat->eContents = NULL; XML_ParserFree(expat->parser); expat->parser = NULL; } /* *---------------------------------------------------------------------------- * * TclExpatInstanceCmd -- * * Implements instance command for expat class objects. * * Results: * Depends on the method. * * Side effects: * Depends on the method. * *---------------------------------------------------------------------------- */ static int TclExpatInstanceCmd (clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { TclGenExpatInfo *expat = (TclGenExpatInfo *) clientData; char *data; int len = 0, optionIndex, result = TCL_OK; static CONST84 char *options[] = { "configure", "cget", "free", "get", "parse", "parsechannel", "parsefile", "reset", NULL }; enum options { EXPAT_CONFIGURE, EXPAT_CGET, EXPAT_FREE, EXPAT_GET, EXPAT_PARSE, EXPAT_PARSECHANNEL, EXPAT_PARSEFILE, EXPAT_RESET }; if (objc < 2) { Tcl_SetResult (interp, "wrong # args: should be \"parserCmd method ?arg ...?\"", TCL_STATIC); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0, &optionIndex) != TCL_OK) { return TCL_ERROR; } switch ((enum options) optionIndex) { case EXPAT_CONFIGURE: if (objc < 3) { Tcl_SetResult (interp, "wrong # args: should be " "\"parserCmd configure