tclxml-3.3~svn11.orig/0000755000000000000000000000000011574742537013425 5ustar rootroottclxml-3.3~svn11.orig/tclxslt-libxslt.tcl0000644000000000000000000000133111113705304017257 0ustar rootroot# tclxslt.tcl -- # # Tcl library for TclXSLT package. # # Copyright (c) 2001-2003 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: tclxslt.tcl,v 1.4 2003/12/09 04:57:35 balls Exp $ namespace eval xslt { namespace export getprocs } proc xslt::getprocs ns { set functions {} set elements {} foreach proc [info commands ${ns}::*] { if {[regexp {::([^:]+)$} $proc discard name]} { if {[string equal [lindex [info args $proc] end] "args"]} { lappend functions $name } else { lappend elements $name } } } return [list $elements $functions] } tclxml-3.3~svn11.orig/tclxml-libxml2.c0000755000000000000000000006107011113705304016426 0ustar rootroot/* tcllibxml2.c -- * * A Tcl wrapper for libxml2. * * Copyright (c) 2005-2008 Explain. * http://www.explain.com.au/ * Copyright (c) 2003-2004 Zveno Pty Ltd * http://www.zveno.com/ * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * $Id: tcllibxml2.c,v 1.10.2.1 2005/12/28 06:49:51 balls Exp $ */ #include #include #include #include #include #include #include #include #include #define TCL_DOES_STUBS \ (TCL_MAJOR_VERSION > 8 || TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION > 1 || \ (TCL_MINOR_VERSION == 1 && TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE))) /* * The structure below is used to refer to a libxml2 parser object. */ typedef struct TclXMLlibxml2Info { Tcl_Interp *interp; /* Interpreter for this instance */ xmlTextReaderPtr reader; /* New TextReader interface */ Tcl_Obj *docObjPtr; /* Result of parsing */ TclXML_libxml2_DocumentHandling keep; /* Document handling flag */ Tcl_Obj *preserve; /* XPath for retaining (a portion of) the document */ Tcl_Obj *preservens; /* list of namespace declarations */ TclXML_Info *xmlinfo; /* Generic data structure */ Tcl_HashTable *scope; /* XML namespaces in scope */ } TclXMLlibxml2Info; /* * Forward declarations for private functions. */ static ClientData ReaderCreate _ANSI_ARGS_((Tcl_Interp *interp, TclXML_Info *xmlinfo)); static int ReaderReset _ANSI_ARGS_((ClientData clientData)); static int TclXMLlibxml2Delete _ANSI_ARGS_((ClientData clientData)); static int ReaderParse _ANSI_ARGS_((ClientData clientData, char *data, int len, int final)); static int TclXMLlibxml2Configure _ANSI_ARGS_((ClientData clientdata, Tcl_Obj *CONST optionPtr, Tcl_Obj *CONST valuePtr)); static int TclXMLlibxml2Get _ANSI_ARGS_((ClientData clientData, int objc, Tcl_Obj *CONST objv[])); static xmlParserInputPtr TclXMLlibxml2ExternalEntityLoader _ANSI_ARGS_((const char *URL, const char *ID, xmlParserCtxtPtr ctxt)); /* * Externally visible functions */ typedef struct ThreadSpecificData { int initialized; Tcl_Interp *interp; /* * Interpose on default external entity loader */ TclXMLlibxml2Info *current; xmlExternalEntityLoader defaultLoader; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * libxml2 is mostly thread-safe, but there are issues with error callbacks */ TCL_DECLARE_MUTEX(libxml2) #ifndef CONST84 #define CONST84 /* Before 8.4 no 'const' required */ #endif /* *---------------------------------------------------------------------------- * * Tclxml_libxml2_Init -- * * Initialisation routine for loadable module * * Results: * None. * * Side effects: * Creates commands in the interpreter, * *---------------------------------------------------------------------------- */ int Tclxml_libxml2_Init (interp) Tcl_Interp *interp; /* Interpreter to initialise */ { ThreadSpecificData *tsdPtr; TclXML_ParserClassInfo *classinfo; #ifdef USE_TCL_STUBS if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { return TCL_ERROR; } #endif #ifdef USE_TCLXML_STUBS if (TclXML_InitStubs(interp, TCLXML_VERSION, 1) == NULL) { return TCL_ERROR; } #endif classinfo = (TclXML_ParserClassInfo *) ckalloc(sizeof(TclXML_ParserClassInfo)); classinfo->name = Tcl_NewStringObj("libxml2", -1); classinfo->create = ReaderCreate; classinfo->createCmd = NULL; classinfo->createEntity = NULL; /* TclXMLlibxml2CreateEntityParser; */ classinfo->createEntityCmd = NULL; classinfo->parse = ReaderParse; classinfo->parseCmd = NULL; classinfo->configure = TclXMLlibxml2Configure; classinfo->configureCmd = NULL; classinfo->get = TclXMLlibxml2Get; classinfo->getCmd = NULL; classinfo->destroy = TclXMLlibxml2Delete; classinfo->destroyCmd = NULL; classinfo->reset = ReaderReset; classinfo->resetCmd = NULL; if (TclXML_RegisterXMLParser(interp, classinfo) != TCL_OK) { Tcl_SetResult(interp, "unable to register parser", NULL); return TCL_ERROR; } /* Configure the libxml2 parser */ Tcl_MutexLock(&libxml2); xmlInitParser(); xmlSubstituteEntitiesDefault(1); /* * TODO: provide configuration option for setting this value. */ xmlLoadExtDtdDefaultValue |= 1; xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS; /* * Override default entity loader so we can implement callbacks */ tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialized) { tsdPtr->initialized = 1; tsdPtr->interp = interp; tsdPtr->current = NULL; tsdPtr->defaultLoader = xmlGetExternalEntityLoader(); xmlSetExternalEntityLoader(TclXMLlibxml2ExternalEntityLoader); } /* only need to init the library once per process */ /* Setting the variable is insufficient - must create namespace too. */ if (Tcl_VarEval(interp, "namespace eval ::xml::libxml2 {variable libxml2version ", xmlParserVersion, "}\n", NULL) != TCL_OK) { return TCL_ERROR; } Tcl_MutexUnlock(&libxml2); TclXML_libxml2_InitDocObj(interp); #if (TCL_DOES_STUBS && USE_TCLXML_STUBS) { extern Tclxml_libxml2Stubs tclxml_libxml2Stubs; if (Tcl_PkgProvideEx(interp, "xml::libxml2", TCLXML_VERSION, (ClientData) &tclxml_libxml2Stubs) != TCL_OK) { return TCL_ERROR; } } #else if (Tcl_PkgProvide(interp, "xml::libxml2", TCLXML_VERSION) != TCL_OK) { return TCL_ERROR; } #endif return TCL_OK; } /* * TclXML/libxml2 is made safe by preventing the use of the default * external entity loader. */ int Tclxml_libxml2_SafeInit (interp) Tcl_Interp *interp; /* Interpreter to initialise */ { return Tclxml_libxml2_Init(interp); } /* *---------------------------------------------------------------------------- * * TclXMLlibxml2Create -- * * Prepare for parsing. * * Results: * Standard Tcl result. * * Side effects: * This creates a Text Reader. * *---------------------------------------------------------------------------- */ static ClientData ReaderCreate(interp, xmlinfo) Tcl_Interp *interp; TclXML_Info *xmlinfo; { TclXMLlibxml2Info *info; xmlParserInputBufferPtr inputPtr; if (!(info = (TclXMLlibxml2Info *) Tcl_Alloc(sizeof(TclXMLlibxml2Info)))) { Tcl_Free((char *) info); Tcl_SetResult(interp, "unable to create parser", NULL); return NULL; } info->interp = interp; info->xmlinfo = xmlinfo; info->preserve = NULL; info->preservens = NULL; /* Create a dummy input buffer for the purpose of creating the TextReader. * This will be replaced when we come to actually parse the document. */ Tcl_MutexLock(&libxml2); inputPtr = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE); if (inputPtr == NULL) { Tcl_MutexUnlock(&libxml2); Tcl_Free((char *) info); Tcl_SetResult(interp, "unable to create input buffer", NULL); return NULL; } info->reader = xmlNewTextReader(inputPtr, NULL); if (info->reader == NULL) { Tcl_MutexUnlock(&libxml2); Tcl_Free((char *) info); Tcl_SetResult(interp, "unable to create XML reader", NULL); return NULL; } xmlTextReaderSetStructuredErrorHandler(info->reader, (xmlStructuredErrorFunc) TclXML_libxml2_ErrorHandler, NULL); Tcl_MutexUnlock(&libxml2); info->docObjPtr = NULL; info->keep = TCLXML_LIBXML2_DOCUMENT_IMPLICIT; info->scope = (Tcl_HashTable *) Tcl_Alloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(info->scope, TCL_STRING_KEYS); return (ClientData) info; } /* *---------------------------------------------------------------------------- * * TclXMLlibxml2Delete -- * * Destroy the libxml2 parser structure. * * Results: * None. * * Side effects: * Frees any memory allocated for the XML parser. * *---------------------------------------------------------------------------- */ static int TclXMLlibxml2Delete(clientData) ClientData clientData; { TclXMLlibxml2Info *info = (TclXMLlibxml2Info *) clientData; if (info->reader) { xmlFreeTextReader(info->reader); } if (info->docObjPtr) { Tcl_DecrRefCount(info->docObjPtr); } if (info->preserve) { Tcl_DecrRefCount(info->preserve); } if (info->preservens) { Tcl_DecrRefCount(info->preservens); } Tcl_DeleteHashTable(info->scope); Tcl_Free((char *) info->scope); Tcl_Free((char *) info); return TCL_OK; } /* *---------------------------------------------------------------------------- * * ReaderReset -- * * Reset the libxml2 parser structure. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static int ReaderReset(clientData) ClientData clientData; { TclXML_Info *xmlinfo = (TclXML_Info *) clientData; if (xmlinfo->clientData == NULL) { xmlinfo->clientData = (ClientData) ReaderCreate(xmlinfo->interp, xmlinfo); if (xmlinfo->clientData == NULL) { return TCL_ERROR; } } return TCL_OK; } /* *---------------------------------------------------------------------------- * * ReaderParse -- * * Wrapper to invoke libxml2 parser and check return result. * * NB. Most of the logic from xmlSAXUserParseMemory is used here. * * Results: * TCL_OK if no errors, TCL_ERROR otherwise. * * Side effects: * Sets interpreter result as appropriate. * *---------------------------------------------------------------------------- */ static int ReaderParse(clientData, data, len, final) ClientData clientData; char *data; int len; int final; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); TclXMLlibxml2Info *info = (TclXMLlibxml2Info *) clientData; Tcl_Obj *nameObj, *nsObj, *nsdeclObj, *valueObj, *attrsObj, *errObj, *baseuriObj, *sysidObj, *extidObj; const char *baseuri, *encoding, *name, *ns, *value; xmlChar **preservens = NULL; int ret, result = TCL_OK, i, listlen, options = 0, empty; /* not used... at present (see case XML_READER_TYPE_DOCUMENT_TYPE) xmlNodePtr nodePtr; */ xmlEntityPtr entityPtr = NULL; if (final == 0) { Tcl_SetResult(info->interp, "partial input not yet supported", NULL); return TCL_ERROR; } if (info->preserve && info->preservens) { if (Tcl_ListObjLength(info->interp, info->preservens, &listlen) != TCL_OK) { return TCL_ERROR; } preservens = (xmlChar **) Tcl_Alloc(len * sizeof(xmlChar *) + 1); for (i = 0; i < listlen; i++) { Tcl_Obj *objPtr; const char *str; int strlen; if (Tcl_ListObjIndex(info->interp, info->preservens, i, &objPtr) != TCL_OK) { Tcl_Free((char *) preservens); return TCL_ERROR; } str = Tcl_GetStringFromObj(objPtr, &strlen); preservens[i] = xmlCharStrndup(str, strlen); } preservens[listlen] = NULL; } if (info->xmlinfo->base) { baseuri = Tcl_GetStringFromObj(info->xmlinfo->base, NULL); } else { baseuri = NULL; } if (info->xmlinfo->encoding) { encoding = Tcl_GetStringFromObj(info->xmlinfo->encoding, NULL); if (strcmp(encoding, "unknown") == 0) { encoding = NULL; } } else { encoding = "utf-8"; } TclXML_libxml2_ResetError(info->interp); options |= XML_PARSE_NOCDATA; tsdPtr->current = info; Tcl_MutexLock(&libxml2); if (info->xmlinfo->expandinternalentities) { options |= XML_PARSE_NOENT; xmlSubstituteEntitiesDefault(1); } else { xmlSubstituteEntitiesDefault(0); } if (info->xmlinfo->nowhitespace) { options |= XML_PARSE_NOBLANKS; } if (xmlReaderNewMemory(info->reader, data, len, baseuri, encoding, options) != 0) { Tcl_MutexUnlock(&libxml2); if (preservens) { int i; for (i = 0; preservens[i]; i++) { xmlFree(preservens[i]); } Tcl_Free((char *) preservens); } tsdPtr->current = NULL; Tcl_SetResult(info->interp, "unable to prepare parser", NULL); return TCL_ERROR; } if (info->preserve) { int preserveret; preserveret = xmlTextReaderPreservePattern(info->reader, (const xmlChar *) Tcl_GetStringFromObj(info->preserve, NULL), (const xmlChar **) preservens); if (preserveret < 0) { Tcl_MutexUnlock(&libxml2); if (preservens) { int i; for (i = 0; preservens[i]; i++) { xmlFree(preservens[i]); } Tcl_Free((char *) preservens); } tsdPtr->current = NULL; Tcl_ResetResult(info->interp); Tcl_AppendResult(info->interp, "preparation for parsing failed: unable to preserve pattern \"", Tcl_GetStringFromObj(info->preserve, NULL), "\"", NULL); return TCL_ERROR; } } for (ret = xmlTextReaderRead(info->reader); ret == 1; ret = xmlTextReaderRead(info->reader)) { result = TCL_OK; switch (xmlTextReaderNodeType(info->reader)) { case XML_READER_TYPE_ELEMENT: name = (const char *) xmlTextReaderConstLocalName(info->reader); ns = (const char *) xmlTextReaderConstNamespaceUri(info->reader); Tcl_MutexUnlock(&libxml2); if (name != NULL) { nameObj = Tcl_NewStringObj(name, -1); } else { nameObj = Tcl_NewObj(); } Tcl_IncrRefCount(nameObj); if (ns != NULL) { nsObj = Tcl_NewStringObj(ns, -1); } else { nsObj = Tcl_NewObj(); } Tcl_IncrRefCount(nsObj); attrsObj = Tcl_NewObj(); Tcl_IncrRefCount(attrsObj); Tcl_MutexLock(&libxml2); if (xmlTextReaderHasAttributes(info->reader)) { if (xmlTextReaderMoveToFirstAttribute(info->reader) == 1) { Tcl_Obj *itemObj; itemObj = Tcl_NewObj(); Tcl_SetStringObj(itemObj, (CONST char *) xmlTextReaderConstLocalName(info->reader), -1); Tcl_ListObjAppendElement(info->interp, attrsObj, itemObj); itemObj = Tcl_NewStringObj((CONST char *) xmlTextReaderConstValue(info->reader), -1); Tcl_ListObjAppendElement(info->interp, attrsObj, itemObj); while (xmlTextReaderMoveToNextAttribute(info->reader) == 1) { itemObj = Tcl_NewStringObj((CONST char *) xmlTextReaderConstLocalName(info->reader), -1); Tcl_ListObjAppendElement(info->interp, attrsObj, itemObj); itemObj = Tcl_NewStringObj((CONST char *) xmlTextReaderConstValue(info->reader), -1); Tcl_ListObjAppendElement(info->interp, attrsObj, itemObj); } } } empty = xmlTextReaderIsEmptyElement(info->reader); Tcl_MutexUnlock(&libxml2); nsdeclObj = Tcl_NewObj(); Tcl_IncrRefCount(nsdeclObj); TclXML_ElementStartHandler(info->xmlinfo, nameObj, nsObj, attrsObj, nsdeclObj); Tcl_DecrRefCount(nsdeclObj); if (empty) { TclXML_ElementEndHandler(info->xmlinfo, nameObj); } Tcl_DecrRefCount(nameObj); Tcl_DecrRefCount(nsObj); Tcl_DecrRefCount(attrsObj); break; case XML_READER_TYPE_END_ELEMENT: name = (const char *) xmlTextReaderConstLocalName(info->reader); ns = (const char *) xmlTextReaderConstNamespaceUri(info->reader); Tcl_MutexUnlock(&libxml2); if (name != NULL) { nameObj = Tcl_NewStringObj(name, -1); } else { nameObj = Tcl_NewObj(); } Tcl_IncrRefCount(nameObj); if (ns != NULL) { nsObj = Tcl_NewStringObj(ns, -1); } else { nsObj = Tcl_NewObj(); } Tcl_IncrRefCount(nsObj); TclXML_ElementEndHandler(info->xmlinfo, nameObj); Tcl_DecrRefCount(nameObj); Tcl_DecrRefCount(nsObj); break; case XML_READER_TYPE_TEXT: case XML_READER_TYPE_CDATA: case XML_READER_TYPE_WHITESPACE: case XML_READER_TYPE_SIGNIFICANT_WHITESPACE: value = (const char *) xmlTextReaderConstValue(info->reader); Tcl_MutexUnlock(&libxml2); if (value != NULL) { valueObj = Tcl_NewStringObj(value, -1); } else { valueObj = Tcl_NewObj(); } Tcl_IncrRefCount(valueObj); TclXML_CharacterDataHandler(info->xmlinfo, valueObj); Tcl_DecrRefCount(valueObj); break; case XML_READER_TYPE_COMMENT: value = (const char *) xmlTextReaderConstValue(info->reader); Tcl_MutexUnlock(&libxml2); if (value != NULL) { valueObj = Tcl_NewStringObj(value, -1); } else { valueObj = Tcl_NewObj(); } TclXML_CommentHandler(info->xmlinfo, valueObj); break; case XML_READER_TYPE_PROCESSING_INSTRUCTION: name = (const char *) xmlTextReaderConstName(info->reader); value = (const char *) xmlTextReaderConstValue(info->reader); Tcl_MutexUnlock(&libxml2); if (name != NULL) { nameObj = Tcl_NewStringObj(name, -1); } else { nameObj = Tcl_NewObj(); } if (value != NULL) { valueObj = Tcl_NewStringObj(value, -1); } else { valueObj = Tcl_NewObj(); } TclXML_ProcessingInstructionHandler(info->xmlinfo, nameObj, valueObj); break; case XML_READER_TYPE_ENTITY_REFERENCE: name = (const char *) xmlTextReaderConstName(info->reader); baseuri = (const char *) xmlTextReaderConstBaseUri(info->reader); entityPtr = xmlGetDocEntity(xmlTextReaderCurrentDoc(info->reader), (const xmlChar *) name); Tcl_MutexUnlock(&libxml2); nameObj = Tcl_NewStringObj(name, -1); Tcl_IncrRefCount(nameObj); baseuriObj = Tcl_NewStringObj(baseuri, -1); Tcl_IncrRefCount(baseuriObj); sysidObj = Tcl_NewStringObj((CONST char *) entityPtr->SystemID, -1); Tcl_IncrRefCount(sysidObj); extidObj = Tcl_NewStringObj((CONST char *) entityPtr->ExternalID, -1); Tcl_IncrRefCount(extidObj); result = TclXML_ExternalEntityRefHandler(info->xmlinfo, nameObj, baseuriObj, sysidObj, extidObj); Tcl_MutexLock(&libxml2); Tcl_DecrRefCount(nameObj); Tcl_DecrRefCount(baseuriObj); Tcl_DecrRefCount(sysidObj); Tcl_DecrRefCount(extidObj); if (result == TCL_ERROR || result == TCL_BREAK) { Tcl_MutexUnlock(&libxml2); xmlTextReaderClose(info->reader); break; } Tcl_MutexUnlock(&libxml2); break; case XML_READER_TYPE_DOCUMENT_TYPE: /* these are not used... at present name = xmlTextReaderName(info->reader); nodePtr = xmlTextReaderCurrentNode(info->reader); */ Tcl_MutexUnlock(&libxml2); default: break; } Tcl_MutexLock(&libxml2); } Tcl_MutexUnlock(&libxml2); if (preservens) { int i; for (i = 0; preservens[i]; i++) { xmlFree(preservens[i]); } Tcl_Free((char *) preservens); } if (ret != 0 || result != TCL_OK) { errObj = TclXML_libxml2_GetErrorObj(info->interp); if (errObj) { Tcl_SetObjResult(info->interp, errObj); } else { Tcl_SetResult(info->interp, "parsing error", NULL); } tsdPtr->current = NULL; return TCL_ERROR; } info->docObjPtr = TclXML_libxml2_CreateObjFromDoc(xmlTextReaderCurrentDoc(info->reader)); TclXML_libxml2_DocKeep(info->docObjPtr, info->keep); /* TODO: errObjPtr may contain warnings, flush them through */ tsdPtr->current = NULL; return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXMLlibxml2Configure -- * * Set options for the parser. * * Results: * None. * * Side effects: * None (there are no options to set). * *---------------------------------------------------------------------------- */ static int TclXMLlibxml2Configure(clientData, optionPtr, valuePtr) ClientData clientData; Tcl_Obj *CONST optionPtr; Tcl_Obj *CONST valuePtr; { TclXMLlibxml2Info *info = (TclXMLlibxml2Info *) clientData; int option, len; char *value; CONST84 char *Options[] = { "-keep", "-retainpath", "-retainpathns", NULL }; enum Options { OPTION_KEEP, OPTION_RETAINPATH, OPTION_RETAINPATHNS }; CONST84 char *KeepOptions[] = { "normal", "implicit", NULL }; enum KeepOptions { OPTION_KEEP_NORMAL, OPTION_KEEP_IMPLICIT }; if (Tcl_GetIndexFromObj(info->interp, optionPtr, Options, "option", 0, &option) != TCL_OK) { /* * Just ignore options we don't understand */ return TCL_OK; } switch ((enum Options) option) { case OPTION_KEEP: value = Tcl_GetStringFromObj(valuePtr, &len); if (len == 0) { info->keep = TCLXML_LIBXML2_DOCUMENT_KEEP; if (info->docObjPtr) { TclXML_libxml2_DocKeep(info->docObjPtr, TCLXML_LIBXML2_DOCUMENT_KEEP); return TCL_BREAK; } } else { if (Tcl_GetIndexFromObj(info->interp, valuePtr, KeepOptions, "value", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum KeepOptions) option) { case OPTION_KEEP_NORMAL: info->keep = TCLXML_LIBXML2_DOCUMENT_KEEP; if (info->docObjPtr) { TclXML_libxml2_DocKeep(info->docObjPtr, TCLXML_LIBXML2_DOCUMENT_KEEP); } return TCL_BREAK; case OPTION_KEEP_IMPLICIT: info->keep = TCLXML_LIBXML2_DOCUMENT_IMPLICIT; if (info->docObjPtr) { TclXML_libxml2_DocKeep(info->docObjPtr, TCLXML_LIBXML2_DOCUMENT_IMPLICIT); } return TCL_BREAK; default: Tcl_SetResult(info->interp, "bad value", NULL); return TCL_ERROR; } } break; case OPTION_RETAINPATH: if (info->preserve) { Tcl_DecrRefCount(info->preserve); } info->preserve = valuePtr; Tcl_IncrRefCount(valuePtr); return TCL_BREAK; case OPTION_RETAINPATHNS: if (info->preservens) { Tcl_DecrRefCount(info->preservens); } info->preservens = valuePtr; Tcl_IncrRefCount(valuePtr); return TCL_BREAK; default: Tcl_SetResult(info->interp, "no such option", NULL); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXMLlibxml2Get -- * * Retrieve data from the parser. * * Results: * Depends on argument. * * Side effects: * May create Tcl object. * *---------------------------------------------------------------------------- */ static int TclXMLlibxml2Get(clientData, objc, objv) ClientData clientData; int objc; Tcl_Obj *CONST objv[]; { TclXMLlibxml2Info *info = (TclXMLlibxml2Info *) clientData; CONST84 char *methods[] = { "document", NULL }; enum methods { TCLXML_LIBXML2_GET_DOCUMENT }; int option; if (objc != 1) { Tcl_WrongNumArgs(info->interp, 0, objv, "method"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(info->interp, objv[0], methods, "method", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum methods) option) { case TCLXML_LIBXML2_GET_DOCUMENT: if (info->docObjPtr) { Tcl_SetObjResult(info->interp, info->docObjPtr); } break; default: Tcl_SetResult(info->interp, "unknown method", NULL); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXMLlibxml2ExternalEntityLoader -- * * Retrieve an external entity, allowing interposing by the application. * * Results: * External entity parsed. * * Side effects: * Depends on application callback. * *---------------------------------------------------------------------------- */ static xmlParserInputPtr Result2ParserInput(interp, ctxt, URL) Tcl_Interp *interp; xmlParserCtxtPtr ctxt; const char *URL; { xmlParserInputPtr inputPtr = NULL; /* build our own xmlParserInput from returned data */ inputPtr = xmlNewStringInputStream(ctxt, (const xmlChar *) Tcl_GetStringFromObj(Tcl_GetObjResult(interp), NULL)); if (inputPtr == NULL) { Tcl_SetResult(interp, "unable to create input stream", NULL); Tcl_BackgroundError(interp); return NULL; } inputPtr->filename = (char *) xmlCanonicPath((const xmlChar *) URL); return inputPtr; } static xmlParserInputPtr TclXMLlibxml2ExternalEntityLoader(URL, ID, ctxt) const char *URL; const char *ID; xmlParserCtxtPtr ctxt; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); TclXMLlibxml2Info *info; Tcl_Interp *interp; int result; info = tsdPtr->current; if (info) { result = TclXML_ExternalEntityRefHandler(info->xmlinfo, NULL, NULL, Tcl_NewStringObj(URL, -1), Tcl_NewStringObj(ID, -1)); interp = info->interp; } else { result = TclXML_ExternalEntityRefHandler(NULL, NULL, NULL, Tcl_NewStringObj(URL, -1), Tcl_NewStringObj(ID, -1)); interp = tsdPtr->interp; } switch (result) { case TCL_OK: return Result2ParserInput(interp, ctxt, URL); case TCL_BREAK: return NULL; case TCL_CONTINUE: break; case TCL_ERROR: case TCL_RETURN: default: Tcl_BackgroundError(interp); return NULL; } if (Tcl_IsSafe(interp)) { return NULL; } else { return (tsdPtr->defaultLoader)(URL, ID, ctxt); } } tclxml-3.3~svn11.orig/tcldom-libxml2.c0000644000000000000000000060157311215700771016420 0ustar rootroot/* tcldom-libxml2.c -- * * A Tcl wrapper for libxml's node tree API, * conformant to the TclDOM API. * * Copyright (c) 2005-2009 by Explain. * http://www.explain.com.au/ * Copyright (c) 2001-2004 Zveno Pty Ltd * http://www.zveno.com/ * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * $Id: tcldomlibxml2.c,v 1.2 2005/05/24 21:09:56 balls Exp $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define TCL_DOES_STUBS \ (TCL_MAJOR_VERSION > 8 || TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION > 1 || \ (TCL_MINOR_VERSION == 1 && TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE))) #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT /* * Manage lists of Tcl_Obj's */ typedef struct ObjList { Tcl_Obj *objPtr; struct ObjList *next; } ObjList; /* * Forward declarations for private functions. */ static void FreeDocument _ANSI_ARGS_((ClientData clientData)); static TclDOM_libxml2_Document * GetDOMDocument _ANSI_ARGS_((Tcl_Interp *interp, TclXML_libxml2_Document *tDocPtr)); static void TclDOM_libxml2_DestroyNode _ANSI_ARGS_((Tcl_Interp *interp, TclDOM_libxml2_Node *tNodePtr)); static void TclDOM_libxml2_InvalidateNode _ANSI_ARGS_((TclDOM_libxml2_Node *tNodePtr)); static char * TclDOMLiveNodeListNode _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, char *name1, char *name2, int flags)); static char * TclDOMLiveNodeListDoc _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, char *name1, char *name2, int flags)); static char * TclDOMLiveNamedNodeMap _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, char *name1, char *name2, int flags)); static int TclDOMSetLiveNodeListNode _ANSI_ARGS_((Tcl_Interp *interp, char *varname, xmlNodePtr nodePtr)); static int TclDOMSetLiveNodeListDoc _ANSI_ARGS_((Tcl_Interp *interp, char *varname, xmlDocPtr docPtr)); static int TclDOMSetLiveNamedNodeMap _ANSI_ARGS_((Tcl_Interp *interp, char *varname, xmlNodePtr nodePtr)); /* * Forward declarations of commands */ static int TclDOMDOMImplementationCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclDOMDocumentCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static void DocumentNodeCmdDelete _ANSI_ARGS_((ClientData clientdata)); static int TclDOMNodeCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static void TclDOMNodeCommandDelete _ANSI_ARGS_((ClientData clientdata)); static int TclDOMElementCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclDOMEventCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static void TclDOMEventCommandDelete _ANSI_ARGS_((ClientData clientdata)); static Tcl_Obj * TclDOM_libxml2_NewEventObj _ANSI_ARGS_((Tcl_Interp *interp, xmlDocPtr docPtr, enum TclDOM_EventTypes type, Tcl_Obj *typeObjPtr)); /* * Functions that implement the TclDOM_Implementation interface */ static int TclDOM_HasFeatureCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclDOMCreateCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclDOMDestroyCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclDOMParseCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclDOMSerializeCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclDOMSelectNodeCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclDOMIsNodeCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclDOMAdoptCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); /* * Additional features */ static int TclDOMXIncludeCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclDOMPrefix2NSCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclDOMTrimCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static void TrimDocument _ANSI_ARGS_((Tcl_Interp *interp, xmlDocPtr docPtr)); static int AdoptDocument _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr)); static int DocumentCget _ANSI_ARGS_((Tcl_Interp *interp, xmlDocPtr docPtr, Tcl_Obj *CONST objPtr)); static int DocumentConfigure _ANSI_ARGS_((Tcl_Interp *interp, xmlDocPtr docPtr, int objc, Tcl_Obj *CONST objv[])); static int NodeCget _ANSI_ARGS_((Tcl_Interp *interp, xmlDocPtr docPtr, xmlNodePtr nodePtr, Tcl_Obj *CONST objPtr)); static int NodeConfigure _ANSI_ARGS_((Tcl_Interp *interp, xmlNodePtr nodePtr, int objc, Tcl_Obj *CONST objPtr[])); static int ElementCget _ANSI_ARGS_((Tcl_Interp *interp, xmlNodePtr nodePtr, Tcl_Obj *CONST objPtr)); static int TclDOM_NodeAppendChild _ANSI_ARGS_((Tcl_Interp *interp, xmlNodePtr nodePtr, xmlNodePtr newPtr)); static int TclDOM_NodeInsertBefore _ANSI_ARGS_((Tcl_Interp *interp, xmlNodePtr refPtr, xmlNodePtr newPtr)); static void PostMutationEvents _ANSI_ARGS_((Tcl_Interp *interp, TclXML_libxml2_Document *tDocPtr, xmlNodePtr nodePtr, xmlNodePtr refPtr, xmlNodePtr newPtr, xmlNodePtr oldParent, xmlNodePtr newParent)); static int DTDValidate _ANSI_ARGS_((Tcl_Interp *interp, TclDOM_libxml2_Document *domDocPtr)); static int SchemaCompile _ANSI_ARGS_((Tcl_Interp *interp, TclDOM_libxml2_Document *domDocPtr)); static int SchemaValidate _ANSI_ARGS_((Tcl_Interp *interp, TclDOM_libxml2_Document *domDocPtr, xmlDocPtr instancePtr)); static int RelaxNGCompile _ANSI_ARGS_((Tcl_Interp *interp, TclDOM_libxml2_Document *domDocPtr)); static int RelaxNGValidate _ANSI_ARGS_((Tcl_Interp *interp, TclDOM_libxml2_Document *domDocPtr, xmlDocPtr instance)); static void NodeAddObjRef _ANSI_ARGS_((TclDOM_libxml2_Node *tNodePtr, Tcl_Obj *objPtr)); #if 0 static void DumpNode _ANSI_ARGS_((TclDOM_libxml2_Node *tNodePtr)); #endif /* * Other utilities */ static Tcl_Obj * GetPath _ANSI_ARGS_((Tcl_Interp *interp, xmlNodePtr nodePtr)); /* * MS VC++ oddities */ #ifdef WIN32 #if !defined (__CYGWIN__) #define vsnprintf _vsnprintf #define snprintf _snprintf #endif /* __CYGWIN__ */ #endif /* WIN32 */ /* * Nodes as Tcl Objects (overloaded to also support event nodes). */ Tcl_FreeInternalRepProc NodeTypeFree; Tcl_DupInternalRepProc NodeTypeDup; Tcl_UpdateStringProc NodeTypeUpdate; Tcl_SetFromAnyProc NodeTypeSetFromAny; Tcl_ObjType NodeObjType = { "libxml2-node", NodeTypeFree, NodeTypeDup, NodeTypeUpdate, NodeTypeSetFromAny }; /* * For additional checks when creating nodes. * These are setup at initialisation-time, but thereafter are read-only. */ static Tcl_Obj *checkName; static Tcl_Obj *checkQName; /* * libxml2 is mostly thread-safe, but there are issues with error callbacks */ TCL_DECLARE_MUTEX(libxml2) /* * Statically include the definitions of option tables: * Due to linking problems on Windows, using MS VC++. */ #include "tcldom.c" /* *---------------------------------------------------------------------------- * * Tcldom_libxml2_Init -- * * Initialisation routine for module. * This is no longer loaded as a separate module. * * Results: * None. * * Side effects: * Creates commands in the interpreter, * *---------------------------------------------------------------------------- */ int Tcldom_libxml2_Init (interp) Tcl_Interp *interp; /* Interpreter to initialise */ { Tcl_MutexLock(&libxml2); xmlXPathInit(); Tcl_MutexUnlock(&libxml2); /* * Provide a handler for nodes for structured error reporting */ TclXML_libxml2_SetErrorNodeFunc(interp, (TclXML_ErrorNodeHandlerProc *) TclDOM_libxml2_CreateObjFromNode); /* * For each of the standard commands, register the command * in both the ::dom and ::dom::libxml2 Tcl namespaces - * they are equivalent. */ Tcl_CreateObjCommand(interp, "dom::libxml2::DOMImplementation", TclDOMDOMImplementationCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::DOMImplementation", TclDOMDOMImplementationCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::libxml2::hasfeature", TclDOM_HasFeatureCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::hasfeature", TclDOM_HasFeatureCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::libxml2::document", TclDOMDocumentCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::document", TclDOMDocumentCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::libxml2::node", TclDOMNodeCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::node", TclDOMNodeCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::libxml2::create", TclDOMCreateCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::create", TclDOMCreateCommand, NULL, NULL); /* * Implemented in Tcl (for the moment) Tcl_CreateObjCommand(interp, "dom::libxml2::parse", TclDOMParseCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::parse", TclDOMParseCommand, NULL, NULL); */ Tcl_CreateObjCommand(interp, "dom::libxml2::adoptdocument", TclDOMAdoptCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::libxml2::serialize", TclDOMSerializeCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::serialize", TclDOMSerializeCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::libxml2::selectnode", TclDOMSelectNodeCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::selectNode", TclDOMSelectNodeCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::libxml2::isNode", TclDOMIsNodeCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::isNode", TclDOMIsNodeCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::libxml2::element", TclDOMElementCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::element", TclDOMElementCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::libxml2::event", TclDOMEventCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::event", TclDOMEventCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::libxml2::xinclude", TclDOMXIncludeCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::xinclude", TclDOMXIncludeCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::libxml2::prefix2namespaceURI", TclDOMPrefix2NSCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::prefix2namespaceURI", TclDOMPrefix2NSCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::libxml2::destroy", TclDOMDestroyCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::destroy", TclDOMDestroyCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::libxml2::trim", TclDOMTrimCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "dom::trim", TclDOMTrimCommand, NULL, NULL); /* Setup name checking REs */ checkName = Tcl_NewStringObj("^", -1); Tcl_AppendObjToObj(checkName, Tcl_GetVar2Ex(interp, "::xml::Name", NULL, 0)); Tcl_AppendToObj(checkName, "$", -1); Tcl_IncrRefCount(checkName); checkQName = Tcl_NewStringObj("^", -1); Tcl_AppendObjToObj(checkQName, Tcl_GetVar2Ex(interp, "::xml::QName", NULL, 0)); Tcl_AppendToObj(checkQName, "$", -1); Tcl_IncrRefCount(checkQName); TclDOM_SetVars(interp); Tcl_RegisterObjType(&NodeObjType); return TCL_OK; } /* * DOM is safe, since it is merely an in-memory representation of the document tree. * However, XInclude is not safe. This is still OK because XInclude uses the external * entity mechanism to load remote documents and TclXML/libxml2 intercepts those calls. */ int Tcldom_libxml2_SafeInit (interp) Tcl_Interp *interp; /* Interpreter to initialise */ { return Tcldom_libxml2_Init(interp); } #if 0 void DumpDocNodeTable(domDocPtr) TclDOM_libxml2_Document *domDocPtr; { return; /* TclDOM_libxml2_Node *tNodePtr; Tcl_HashEntry *entryPtr; Tcl_HashSearch search; sprintf(dbgbuf, " Nodes in doc \"%s\":\n", domDocPtr->tDocPtr->token); Tcl_WriteChars(stderrChan, dbgbuf, -1); for (entryPtr = Tcl_FirstHashEntry(domDocPtr->nodes, &search); entryPtr; entryPtr = Tcl_NextHashEntry(&search)) { tNodePtr = (TclDOM_libxml2_Node *) Tcl_GetHashValue(entryPtr); sprintf(dbgbuf, " Hash entry \"%s\" (x%x)\n", Tcl_GetHashKey(domDocPtr->nodes, entryPtr), tNodePtr); Tcl_WriteChars(stderrChan, dbgbuf, -1); sprintf(dbgbuf, " Node \"%s\"\n", tNodePtr->token); Tcl_WriteChars(stderrChan, dbgbuf, -1); } */ } #endif /* *---------------------------------------------------------------------------- * * TclDOM_HasFeatureCommand -- * * Implements dom::libxml2::hasfeature command * * Results: * Returns boolean. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int TclDOM_HasFeatureCommand (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { if (objc != 3) { Tcl_WrongNumArgs(interp, 0, objv, "hasfeature feature version"); return TCL_ERROR; } if (Tcl_RegExpMatchObj(interp, objv[1], Tcl_NewStringObj("create|destroy|parse|query|serialize|trim|Events|UIEvents|isNode", -1)) == 1) { if (Tcl_StringMatch(Tcl_GetStringFromObj(objv[2], NULL), "1.0") == 1) { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1)); } else { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0)); } } else { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0)); } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclDOMCreateCommand -- * * Implements dom::libxml2::create command * * Results: * Creates a new document. * * Side effects: * Allocates memory. * *---------------------------------------------------------------------------- */ int TclDOMCreateCommand (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { Tcl_Obj *objPtr; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, ""); return TCL_ERROR; } objPtr = TclXML_libxml2_NewDocObj(interp); if (!objPtr) { return TCL_ERROR; } TclXML_libxml2_DocKeep(objPtr, TCLXML_LIBXML2_DOCUMENT_KEEP); if (AdoptDocument(interp, objPtr) != TCL_OK) { return TCL_ERROR; } return TCL_OK; } int AdoptDocument(interp, objPtr) Tcl_Interp *interp; Tcl_Obj *objPtr; { TclXML_libxml2_Document *tDocPtr; TclDOM_libxml2_Document *domDocPtr; /* * Claim this object so the document will not be destroyed * underneath us. */ Tcl_IncrRefCount(objPtr); if (TclXML_libxml2_GetTclDocFromObj(interp, objPtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } domDocPtr = (TclDOM_libxml2_Document *) Tcl_Alloc(sizeof(TclDOM_libxml2_Document)); domDocPtr->interp = interp; domDocPtr->tDocPtr = tDocPtr; domDocPtr->objPtr = objPtr; domDocPtr->schema = NULL; domDocPtr->relaxng = NULL; domDocPtr->nodes = (Tcl_HashTable *) Tcl_Alloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(domDocPtr->nodes, TCL_STRING_KEYS); domDocPtr->nodeCntr = 0; domDocPtr->captureListeners = (Tcl_HashTable *) Tcl_Alloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(domDocPtr->captureListeners, TCL_ONE_WORD_KEYS); domDocPtr->bubbleListeners = (Tcl_HashTable *) Tcl_Alloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(domDocPtr->bubbleListeners, TCL_ONE_WORD_KEYS); memset(domDocPtr->listening, 0, TCLDOM_NUM_EVENT_TYPES * sizeof(int)); /* * When the document is eventually destroyed, * make sure all memory is freed. */ tDocPtr->dom = (ClientData) domDocPtr; tDocPtr->domfree = FreeDocument; /* * Create a Tcl namespace for this document */ Tcl_VarEval(interp, "namespace eval ::dom::", tDocPtr->token, " {}\n", NULL); /* * Create a DOM command to control the document. */ domDocPtr->cmd = Tcl_CreateObjCommand(interp, tDocPtr->token, TclDOMDocumentCommand, (ClientData) domDocPtr, DocumentNodeCmdDelete); Tcl_SetObjResult(interp, objPtr); return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclDOM_libxml2_CreateObjFromDoc -- * * Wrapper for TclXML_libxml2_CreateObjFromDoc * * Results: * Returns Tcl_Obj. * * Side effects: * Allocates memory. * *---------------------------------------------------------------------------- */ Tcl_Obj * TclDOM_libxml2_CreateObjFromDoc (interp, docPtr) Tcl_Interp *interp; xmlDocPtr docPtr; { Tcl_Obj *newPtr; newPtr = TclXML_libxml2_CreateObjFromDoc(docPtr); if (AdoptDocument(interp, newPtr) != TCL_OK) { Tcl_DecrRefCount(newPtr); return NULL; } return newPtr; } /* *---------------------------------------------------------------------------- * * TclDOMDestroyCommand -- * * Implements dom::libxml2::destroy command * * Results: * Frees document or node. * * Side effects: * Deallocates memory. * *---------------------------------------------------------------------------- */ int TclDOMDestroyCommand (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { TclXML_libxml2_Document *tDocPtr; TclDOM_libxml2_Node *tNodePtr; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "token"); return TCL_ERROR; } if (TclXML_libxml2_GetTclDocFromObj(interp, objv[1], &tDocPtr) == TCL_OK) { TclDOM_libxml2_Document *domDocPtr = GetDOMDocument(interp, tDocPtr); if (domDocPtr == NULL) { /* This is an error! */ TclXML_libxml2_DestroyDocument(tDocPtr); } else { Tcl_DeleteCommandFromToken(interp, domDocPtr->cmd); } } else if (TclDOM_libxml2_GetTclNodeFromObj(interp, objv[1], &tNodePtr) == TCL_OK) { TclDOM_libxml2_DestroyNode(interp, tNodePtr); } else if (TclDOM_libxml2_GetTclEventFromObj(interp, objv[1], &tNodePtr) == TCL_OK) { TclDOM_libxml2_DestroyNode(interp, tNodePtr); } else { Tcl_SetResult(interp, "not a DOM node", NULL); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * DocumentNodeCmdDelete -- * * Invoked when a DOM document's command is deleted. * * Results: * Frees document. * * Side effects: * Deallocates memory. * *---------------------------------------------------------------------------- */ void DocumentNodeCmdDelete (clientData) ClientData clientData; { TclDOM_libxml2_Document *domDocPtr = (TclDOM_libxml2_Document *) clientData; #ifndef WIN32 TclXML_libxml2_DestroyDocument(domDocPtr->tDocPtr); #endif /* not WIN32 */ #ifdef WIN32 /* * Workaround bug in TclXML/libxml2. * This will, of course, leak memory. */ /* FreeDocument((ClientData) domDocPtr); */ #endif /* WIN32 */ } /* *---------------------------------------------------------------------------- * * FreeDocument -- * * Frees resources associated with a document. * * Results: * None. * * Side effects: * Deallocates memory. * *---------------------------------------------------------------------------- */ #ifdef WIN32 /* * Using Tcl internal functions appears to cause linking problems * when using MS VC++, so avoid the problem by invoking a script instead. */ void DeleteNamespace (interp, ns) Tcl_Interp *interp; char *ns; { Tcl_Obj *cmdPtr = Tcl_NewObj(); Tcl_AppendStringsToObj(cmdPtr, "namespace delete ", ns, NULL); Tcl_EvalObjEx(interp, cmdPtr, TCL_EVAL_GLOBAL); Tcl_DecrRefCount(cmdPtr); } #else /* not WIN32 */ /* * Internal Tcl functions */ #if (TCL_MAJOR_VERSION < 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 5)) /* * SRB: 2005-12-29: This should use #include , but private sources may not be available. */ EXTERN Tcl_Namespace * Tcl_FindNamespace _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_Namespace * contextNsPtr, int flags)); EXTERN void Tcl_DeleteNamespace _ANSI_ARGS_((Tcl_Namespace * nsPtr)); #endif /* Tcl < 8.5 */ void DeleteNamespace (interp, ns) Tcl_Interp *interp; char *ns; { Tcl_Namespace *namespacePtr; namespacePtr = Tcl_FindNamespace(interp, ns, (Tcl_Namespace *) NULL, 0); if (namespacePtr) { Tcl_DeleteNamespace(namespacePtr); } /* else internal error */ } #endif /* WIN32 */ void FreeDocument (clientData) ClientData clientData; { TclDOM_libxml2_Document *domDocPtr = (TclDOM_libxml2_Document *) clientData; char buf[1024]; snprintf(buf, 1023, "::dom::%s", domDocPtr->tDocPtr->token); DeleteNamespace(domDocPtr->interp, buf); /* * Deleting the namespace deletes all of the node commands, * which in turn invalidates the node references. * So no need to do it again here. * entry = Tcl_FirstHashEntry(domDocPtr->nodes, &search); while (entry) { tNodePtr = (TclDOM_libxml2_Node *) Tcl_GetHashValue(entry); TclDOM_libxml2_InvalidateNode(tNodePtr); entry = Tcl_NextHashEntry(&search); } */ Tcl_DeleteHashTable(domDocPtr->nodes); Tcl_Free((char *) domDocPtr->nodes); if (domDocPtr->schema) { Tcl_MutexLock(&libxml2); /* This also frees the copy of the document used by the schema context */ xmlSchemaFree(domDocPtr->schema); Tcl_MutexUnlock(&libxml2); } if (domDocPtr->relaxng) { Tcl_MutexLock(&libxml2); /* This also frees the copy of the document used by the schema context */ xmlRelaxNGFree(domDocPtr->relaxng); Tcl_MutexUnlock(&libxml2); } Tcl_Free((char *) domDocPtr->captureListeners); Tcl_Free((char *) domDocPtr->bubbleListeners); /* Workaround win32 destroy bug, see above */ #ifndef WIN32 Tcl_DecrRefCount(domDocPtr->objPtr); #endif /* not WIN32 */ Tcl_Free((char *) domDocPtr); } /* *---------------------------------------------------------------------------- * * GetDOMDocument -- * * Retrieves the DOM document structure associated with a libxml2 document. * libxslt synthesizes documents, so it is often the case that a node * must be processed that has not had its document "adopted". * * Results: * Returns pointer to DOM structure. * * Side effects: * Document is "adopted" if necessary. * *---------------------------------------------------------------------------- */ TclDOM_libxml2_Document * GetDOMDocument(interp, tDocPtr) Tcl_Interp *interp; TclXML_libxml2_Document *tDocPtr; { if (tDocPtr->dom != NULL) { return (TclDOM_libxml2_Document *) tDocPtr->dom; } else if (interp == NULL) { return NULL; } else { Tcl_Obj *objPtr; objPtr = TclXML_libxml2_CreateObjFromDoc(tDocPtr->docPtr); if (AdoptDocument(interp, objPtr) != TCL_OK) { Tcl_DecrRefCount(objPtr); return NULL; } else { return (TclDOM_libxml2_Document *) tDocPtr->dom; } } } /* *---------------------------------------------------------------------------- * * TclDOMParseCommand -- * * Implements dom::libxml2::parse command * * Not implemented here at present - calls Tcl script * * Results: * Depends on method. * * Side effects: * Depends on method. * *---------------------------------------------------------------------------- */ int TclDOMParseCommand (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { /* Tcl_Obj *objPtr; */ Tcl_Obj **newobjv; int i; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "xml ?args ...?"); return TCL_ERROR; } newobjv = (Tcl_Obj **) Tcl_Alloc((objc + 1) * sizeof(Tcl_Obj *)); newobjv[0] = Tcl_NewStringObj("::dom::libxml2::parse", -1); for (i = 1; i < objc; i++) { newobjv[i] = objv[i]; } newobjv[i] = NULL; return Tcl_EvalObjv(interp, objc, newobjv, 0); /* if (TclXML_CreateParser(interp, objc, objv) != TCL_OK) { return TCL_ERROR; } parserObj = Tcl_GetObjResult(interp); if (TclXML_Parse(interp, parserObj, objc, objv) != TCL_OK) { return TCL_ERROR; } if (TclXML_Get(interp, parserObj, "document") != TCL_OK) { return TCL_ERROR; } Tcl_SetObjResult(interp, objPtr); */ return TCL_OK; } int TclDOMAdoptCommand (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "doc"); return TCL_ERROR; } return AdoptDocument(interp, objv[1]); } /* *---------------------------------------------------------------------------- * * TclDOMSerializeCommand -- * * Implements dom::libxml2::serialize command * * Results: * Depends on method. * * Side effects: * Depends on method. * *---------------------------------------------------------------------------- */ int TclDOMSerializeCommand (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { xmlDocPtr docPtr; xmlNodePtr nodePtr; xmlBufferPtr bufptr = NULL; xmlSaveCtxtPtr savectxtptr = NULL; xmlChar *result = NULL; Tcl_Obj *encodingPtr = NULL; int option, method = TCLDOM_SERIALIZE_METHOD_XML, indent = 0, len = 0, omitXMLDeclaration = 0, saveoptions = 0; char *buf, *encoding; Tcl_Encoding tclencoding; Tcl_DString *serialized; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "node ?option value ...?"); return TCL_ERROR; } if (TclXML_libxml2_GetDocFromObj(interp, objv[1], &docPtr) != TCL_OK) { if (TclDOM_libxml2_GetNodeFromObj(interp, objv[1], &nodePtr) == TCL_OK) { /* Serialize just the node */ Tcl_SetResult(interp, "not yet implemented - serialize whole document", NULL); return TCL_ERROR; } else { Tcl_SetResult(interp, "not a libxml2 node", NULL); return TCL_ERROR; } } if (objc > 2) { objc -= 2; objv += 2; while (objc) { if (objc == 1) { Tcl_Obj *msgPtr; msgPtr = Tcl_NewStringObj("missing value for configuration option \"", -1); Tcl_AppendObjToObj(msgPtr, objv[0]); Tcl_AppendStringsToObj(msgPtr, "\"", (char *) NULL); Tcl_SetObjResult(interp, msgPtr); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[0], TclDOM_SerializeCommandOptions, "option", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_SerializeCommandOptions) option) { case TCLDOM_SERIALIZE_METHOD: buf = Tcl_GetStringFromObj(objv[1], &len); if (len == 0) { method = TCLDOM_SERIALIZE_METHOD_XML; } else if (Tcl_GetIndexFromObj(interp, objv[1], TclDOM_SerializeMethods, "method", 0, &method) != TCL_OK) { return TCL_ERROR; } break; case TCLDOM_SERIALIZE_INDENT: if (Tcl_GetBooleanFromObj(interp, objv[1], &indent) != TCL_OK) { return TCL_ERROR; } break; case TCLDOM_SERIALIZE_OMIT_XML_DECLARATION: if (Tcl_GetBooleanFromObj(interp, objv[1], &omitXMLDeclaration) != TCL_OK) { return TCL_ERROR; } break; case TCLDOM_SERIALIZE_ENCODING: encodingPtr = objv[1]; break; default: Tcl_SetResult(interp, "unknown option", NULL); return TCL_ERROR; } objc -= 2; objv += 2; } } switch ((enum TclDOM_SerializeMethods) method) { case TCLDOM_SERIALIZE_METHOD_XML: serialized = (Tcl_DString *) Tcl_Alloc(sizeof(Tcl_DString)); Tcl_DStringInit(serialized); if (encodingPtr) { encoding = Tcl_GetStringFromObj(encodingPtr, NULL); } else { encoding = "utf-8"; } tclencoding = Tcl_GetEncoding(interp, encoding); Tcl_MutexLock(&libxml2); if ((bufptr = xmlBufferCreate()) == NULL) { Tcl_MutexUnlock(&libxml2); Tcl_Free((void *)serialized); Tcl_SetResult(interp, "unable to allocate output buffer", NULL); return TCL_ERROR; } if (indent) { saveoptions |= XML_SAVE_FORMAT; } if (omitXMLDeclaration) { saveoptions |= XML_SAVE_NO_DECL; } if ((savectxtptr = xmlSaveToBuffer(bufptr, encoding, saveoptions)) == NULL) { Tcl_MutexUnlock(&libxml2); Tcl_Free((void *)serialized); xmlBufferFree(bufptr); Tcl_SetResult(interp, "unable to create save context", NULL); return TCL_ERROR; } xmlSaveDoc(savectxtptr, docPtr); xmlSaveClose(savectxtptr); Tcl_MutexUnlock(&libxml2); Tcl_ExternalToUtfDString(tclencoding, (CONST char *) xmlBufferContent(bufptr), xmlBufferLength(bufptr), serialized); Tcl_DStringResult(interp, serialized); Tcl_MutexLock(&libxml2); xmlBufferFree(bufptr); Tcl_MutexUnlock(&libxml2); break; case TCLDOM_SERIALIZE_METHOD_HTML: Tcl_MutexLock(&libxml2); htmlSetMetaEncoding(docPtr, (const xmlChar *) "UTF-8"); htmlDocDumpMemory(docPtr, &result, &len); Tcl_MutexUnlock(&libxml2); Tcl_SetObjResult(interp, Tcl_NewStringObj((CONST char *) result, len)); xmlFree(result); break; case TCLDOM_SERIALIZE_METHOD_TEXT: nodePtr = docPtr->children; while (nodePtr != NULL) { if (nodePtr->type == XML_TEXT_NODE) Tcl_AppendResult(interp, (char *) nodePtr->content, NULL); if (nodePtr->children != NULL) { if ((nodePtr->children->type != XML_ENTITY_DECL) && (nodePtr->children->type != XML_ENTITY_REF_NODE) && (nodePtr->children->type != XML_ENTITY_NODE)) { nodePtr = nodePtr->children; continue; } } if (nodePtr->next != NULL) { nodePtr = nodePtr->next; continue; } do { nodePtr = nodePtr->parent; if (nodePtr == NULL) break; if (nodePtr == (xmlNodePtr) docPtr) { nodePtr = NULL; break; } if (nodePtr->next != NULL) { nodePtr = nodePtr->next; break; } } while (nodePtr != NULL); } break; default: Tcl_SetResult(interp, "internal error", NULL); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclDOMDOMImplementationCommand -- * * Implements dom::libxml2::DOMImplementation command * * Results: * Depends on method. * * Side effects: * Depends on method. * *---------------------------------------------------------------------------- */ int TclDOMDOMImplementationCommand (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { int method; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "method ?args...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], TclDOM_DOMImplementationCommandMethods, "method", 0, &method) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_DOMImplementationCommandMethods) method) { case TCLDOM_IMPL_HASFEATURE: return TclDOM_HasFeatureCommand(dummy, interp, objc - 1, objv + 1); case TCLDOM_IMPL_CREATE: if (objc == 2) { return TclDOMCreateCommand(dummy, interp, 1, objv); } else if (objc == 3) { Tcl_Obj *objPtr; xmlDocPtr docPtr; xmlNodePtr nodePtr; if (TclDOMCreateCommand(dummy, interp, 0, NULL) != TCL_OK) { return TCL_ERROR; } objPtr = Tcl_GetObjResult(interp); TclXML_libxml2_GetDocFromObj(interp, objPtr, &docPtr); Tcl_MutexLock(&libxml2); nodePtr = xmlNewDocNode(docPtr, NULL, (const xmlChar *) Tcl_GetStringFromObj(objv[2], NULL), NULL); Tcl_MutexUnlock(&libxml2); if (nodePtr == NULL) { Tcl_SetResult(interp, "unable to create document element", NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, objPtr); } else { Tcl_WrongNumArgs(interp, 1, objv, "create ?doc?"); return TCL_ERROR; } break; case TCLDOM_IMPL_PARSE: return TclDOMParseCommand(dummy, interp, objc - 1, objv + 1); case TCLDOM_IMPL_SERIALIZE: return TclDOMSerializeCommand(dummy, interp, objc - 1, objv + 1); case TCLDOM_IMPL_SELECTNODE: return TclDOMSelectNodeCommand(dummy, interp, objc - 1, objv + 1); case TCLDOM_IMPL_DESTROY: return TclDOMDestroyCommand(dummy, interp, objc - 1, objv + 1); case TCLDOM_IMPL_ISNODE: return TclDOMIsNodeCommand(dummy, interp, objc - 1, objv + 1); default: Tcl_SetResult(interp, "method \"", NULL); Tcl_AppendResult(interp, Tcl_GetStringFromObj(objv[1], NULL)); Tcl_AppendResult(interp, "\" not yet implemented", NULL); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * [Schema|RNG][Compile|Validate] -- * * Implements DTD, XML Schema and RelaxNG parsing and validation * * Results: * Depends on method. * * Side effects: * May create or destroy validation contexts. * *---------------------------------------------------------------------------- */ int DTDValidate (interp, domDocPtr) Tcl_Interp *interp; TclDOM_libxml2_Document *domDocPtr; { xmlValidCtxtPtr ctxt; TclXML_libxml2_ResetError(interp); Tcl_MutexLock(&libxml2); ctxt = xmlNewValidCtxt(); if (ctxt == NULL) { Tcl_MutexUnlock(&libxml2); Tcl_SetResult(interp, "unable to prepare validation context", NULL); return TCL_ERROR; } Tcl_SetResult(interp, "document is not valid", NULL); if (xmlValidateDocument(ctxt, domDocPtr->tDocPtr->docPtr) == 0) { Tcl_Obj *errObjPtr; Tcl_MutexUnlock(&libxml2); errObjPtr = TclXML_libxml2_GetErrorObj(interp); if (errObjPtr) { Tcl_IncrRefCount(errObjPtr); Tcl_SetObjResult(interp, errObjPtr); } return TCL_ERROR; } Tcl_MutexUnlock(&libxml2); Tcl_ResetResult(interp); return TCL_OK; } int SchemaCompile (interp, domDocPtr) Tcl_Interp *interp; TclDOM_libxml2_Document *domDocPtr; { xmlDocPtr schemaDocPtr; xmlSchemaParserCtxtPtr ctxt = NULL; if (domDocPtr->schema) { /* Re-compile */ Tcl_MutexLock(&libxml2); xmlSchemaFree(domDocPtr->schema); Tcl_MutexUnlock(&libxml2); domDocPtr->schema = NULL; } Tcl_MutexLock(&libxml2); schemaDocPtr = xmlCopyDoc(domDocPtr->tDocPtr->docPtr, 1); if (schemaDocPtr == NULL) { Tcl_MutexUnlock(&libxml2); Tcl_SetResult(interp, "unable to prepare schema document", NULL); return TCL_ERROR; } ctxt = xmlSchemaNewDocParserCtxt(schemaDocPtr); if (ctxt == NULL) { xmlFreeDoc(schemaDocPtr); Tcl_MutexUnlock(&libxml2); Tcl_SetResult(interp, "unable to create schema context", NULL); return TCL_ERROR; } TclXML_libxml2_ResetError(interp); Tcl_SetResult(interp, "unable to parse schema document", NULL); domDocPtr->schema = xmlSchemaParse(ctxt); #if 0 xmlSchemaFreeParserCtxt(ctxt); /* This frees the doc */ #endif Tcl_MutexUnlock(&libxml2); if (domDocPtr->schema == NULL) { Tcl_Obj * errObjPtr = TclXML_libxml2_GetErrorObj(interp); if (errObjPtr) { Tcl_SetObjResult(interp, errObjPtr); } return TCL_ERROR; } Tcl_ResetResult(interp); return TCL_OK; } int SchemaValidate (interp, domDocPtr, instancePtr) Tcl_Interp *interp; TclDOM_libxml2_Document *domDocPtr; xmlDocPtr instancePtr; { xmlSchemaValidCtxtPtr ctxt = NULL; Tcl_Obj *errObjPtr; int ret; if (domDocPtr->schema == NULL) { Tcl_SetResult(interp, "schema not compiled", NULL); return TCL_ERROR; } TclXML_libxml2_ResetError(interp); Tcl_MutexLock(&libxml2); ctxt = xmlSchemaNewValidCtxt(domDocPtr->schema); Tcl_SetResult(interp, "document is not valid", NULL); ret = xmlSchemaValidateDoc(ctxt, instancePtr); errObjPtr = TclXML_libxml2_GetErrorObj(interp); if (ret > 0) { if (errObjPtr) { Tcl_SetObjResult(interp, errObjPtr); } goto error; } else if (ret < 0) { Tcl_SetResult(interp, "schema processor internal error", NULL); if (errObjPtr) { Tcl_SetObjResult(interp, errObjPtr); } goto error; } xmlSchemaFreeValidCtxt(ctxt); Tcl_MutexUnlock(&libxml2); /* There may be warnings */ if (errObjPtr) { Tcl_SetObjResult(interp, errObjPtr); } else { Tcl_ResetResult(interp); } return TCL_OK; error: if (ctxt) { xmlSchemaFreeValidCtxt(ctxt); } Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } /* * RelaxNG validation. */ int RelaxNGCompile (interp, domDocPtr) Tcl_Interp *interp; TclDOM_libxml2_Document *domDocPtr; { xmlDocPtr relaxNGDocPtr; xmlRelaxNGParserCtxtPtr ctxt = NULL; if (domDocPtr->relaxng) { /* Re-compile */ Tcl_MutexLock(&libxml2); xmlRelaxNGFree(domDocPtr->relaxng); Tcl_MutexUnlock(&libxml2); domDocPtr->relaxng = NULL; } Tcl_MutexLock(&libxml2); relaxNGDocPtr = xmlCopyDoc(domDocPtr->tDocPtr->docPtr, 1); if (relaxNGDocPtr == NULL) { Tcl_MutexUnlock(&libxml2); Tcl_SetResult(interp, "unable to prepare RELAX NG schema document", NULL); return TCL_ERROR; } ctxt = xmlRelaxNGNewDocParserCtxt(relaxNGDocPtr); if (ctxt == NULL) { xmlFreeDoc(relaxNGDocPtr); Tcl_MutexUnlock(&libxml2); Tcl_SetResult(interp, "unable to create RELAX NG schema context", NULL); return TCL_ERROR; } TclXML_libxml2_ResetError(interp); /* TODO: setup warning and error callbacks */ Tcl_SetResult(interp, "unable to parse RELAX NG schema document", NULL); domDocPtr->relaxng = xmlRelaxNGParse(ctxt); Tcl_MutexUnlock(&libxml2); if (domDocPtr->relaxng == NULL) { Tcl_Obj * errObjPtr = TclXML_libxml2_GetErrorObj(interp); if (errObjPtr) { Tcl_SetObjResult(interp, errObjPtr); } return TCL_ERROR; } Tcl_ResetResult(interp); return TCL_OK; } int RelaxNGValidate (interp, domDocPtr, instancePtr) Tcl_Interp *interp; TclDOM_libxml2_Document *domDocPtr; xmlDocPtr instancePtr; { xmlRelaxNGValidCtxtPtr ctxt = NULL; Tcl_Obj *errObjPtr; int ret; if (domDocPtr->relaxng == NULL) { Tcl_SetResult(interp, "RELAX NG schema not compiled", NULL); return TCL_ERROR; } TclXML_libxml2_ResetError(interp); Tcl_MutexLock(&libxml2); ctxt = xmlRelaxNGNewValidCtxt(domDocPtr->relaxng); Tcl_SetResult(interp, "document is not valid", NULL); ret = xmlRelaxNGValidateDoc(ctxt, instancePtr); errObjPtr = TclXML_libxml2_GetErrorObj(interp); if (ret > 0) { if (errObjPtr) { Tcl_SetObjResult(interp, errObjPtr); } goto error; } else if (ret < 0) { Tcl_SetResult(interp, "RELAX NG schema processor internal error", NULL); if (errObjPtr) { Tcl_SetObjResult(interp, errObjPtr); } goto error; } xmlRelaxNGFreeValidCtxt(ctxt); Tcl_MutexUnlock(&libxml2); /* There may be warnings */ if (errObjPtr) { Tcl_SetObjResult(interp, errObjPtr); } else { Tcl_ResetResult(interp); } return TCL_OK; error: if (ctxt) { xmlRelaxNGFreeValidCtxt(ctxt); } Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } int TclDOMTrimCommand (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { xmlDocPtr docPtr; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "doc"); } if (TclXML_libxml2_GetDocFromObj(interp, objv[1], &docPtr) != TCL_OK) { return TCL_ERROR; } TrimDocument(interp, docPtr); return TCL_OK; } /* * Remove all blank text nodes * * NB. This code mostly copied from xmlschemas.c */ /** Copied directly from xmlschemas.c: * * xmlSchemaIsBlank: * @str: a string * * Check if a string is ignorable * * Returns 1 if the string is NULL or made of blanks chars, 0 otherwise */ /* SRB: 2008-11-24: Updated against libxml2 2.7.2. */ #define IS_BLANK_NODE(n) \ (((n)->type == XML_TEXT_NODE) && (xmlSchemaIsBlank((n)->content, -1))) /* * SRB: 2008-06-12: Updated against libxml2 2.6.32. * See also SF bug 1943963. */ static int xmlSchemaIsBlank(xmlChar *str, int len) { if (str == NULL) return(1); if (len < 0) { while (*str != 0) { if (!(IS_BLANK_CH(*str))) return(0); str++; } } else { while ((*str != 0) && (len != 0)) { if (!(IS_BLANK_CH(*str))) return (0); str++; len--; } } return(1); } static void TrimDocument(interp, docPtr) Tcl_Interp *interp; xmlDocPtr docPtr; { xmlNodePtr root, cur, delete; Tcl_Obj *nodeObjPtr; TclDOM_libxml2_Node *tNodePtr = NULL; delete = NULL; root = xmlDocGetRootElement(docPtr); if (root == NULL) { return; } cur = root; while (cur != NULL) { if (delete != NULL) { nodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, delete); TclDOM_libxml2_GetTclNodeFromObj(interp, nodeObjPtr, &tNodePtr); TclDOM_libxml2_InvalidateNode(tNodePtr); Tcl_DecrRefCount(nodeObjPtr); xmlUnlinkNode(delete); xmlFreeNode(delete); delete = NULL; } if (cur->type == XML_TEXT_NODE) { if (IS_BLANK_NODE(cur)) { if (xmlNodeGetSpacePreserve(cur) != 1) { delete = cur; } } } else if ((cur->type != XML_ELEMENT_NODE) && (cur->type != XML_CDATA_SECTION_NODE)) { delete = cur; goto skip_children; } /* * Skip to next node */ if (cur->children != NULL) { if ((cur->children->type != XML_ENTITY_DECL) && (cur->children->type != XML_ENTITY_REF_NODE) && (cur->children->type != XML_ENTITY_NODE)) { cur = cur->children; continue; } } skip_children: if (cur->next != NULL) { cur = cur->next; continue; } do { cur = cur->parent; if (cur == NULL) break; if (cur == root) { cur = NULL; break; } if (cur->next != NULL) { cur = cur->next; break; } } while (cur != NULL); } if (delete != NULL) { nodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, delete); TclDOM_libxml2_GetTclNodeFromObj(interp, nodeObjPtr, &tNodePtr); TclDOM_libxml2_InvalidateNode(tNodePtr); Tcl_DecrRefCount(nodeObjPtr); xmlUnlinkNode(delete); xmlFreeNode(delete); delete = NULL; } return; } /* *---------------------------------------------------------------------------- * * TclDOMXIncludeCommand -- * * Implements dom::libxml2::xinclude command. * * Results: * Performs XInclude processing on a document. * * Side effects: * The supplied DOM tree may be modified. * *---------------------------------------------------------------------------- */ int TclDOMXIncludeCommand (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { xmlDocPtr docPtr; int subs; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "doc"); return TCL_ERROR; } if (TclXML_libxml2_GetDocFromObj(interp, objv[1], &docPtr) != TCL_OK) { return TCL_ERROR; } Tcl_MutexLock(&libxml2); subs = xmlXIncludeProcess(docPtr); Tcl_MutexUnlock(&libxml2); if (subs < 0) { Tcl_SetResult(interp, "unable to complete XInclude processing", NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewIntObj(subs)); return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclDOMPrefix2NSCommand -- * * Implements dom::libxml2::prefix2namespaceURI command. * * Results: * Returns namespace URI for a given prefix. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int TclDOMPrefix2NSCommand (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { xmlNodePtr nodePtr; xmlNsPtr nsPtr; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "node prefix"); return TCL_ERROR; } if (TclDOM_libxml2_GetNodeFromObj(interp, objv[1], &nodePtr) != TCL_OK) { return TCL_ERROR; } nsPtr = xmlSearchNs(nodePtr->doc, nodePtr, (const xmlChar *) Tcl_GetStringFromObj(objv[2], NULL)); if (!nsPtr) { Tcl_SetResult(interp, "no XML Namespace declaration", NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewStringObj((CONST char *) nsPtr->href, -1)); return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclDOMIsNodeCommand -- * * Implements dom::libxml2::isNode command. * * Results: * Returns boolean. * * Side effects: * Tcl object may be converted to internal rep. * *---------------------------------------------------------------------------- */ int TclDOMIsNodeCommand (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { xmlDocPtr docPtr; xmlNodePtr nodePtr; TclDOM_libxml2_Node *tNodePtr; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "token"); return TCL_ERROR; } if (TclDOM_libxml2_GetNodeFromObj(interp, objv[1], &nodePtr) != TCL_OK) { if (TclXML_libxml2_GetDocFromObj(interp, objv[1], &docPtr) != TCL_OK) { if (TclDOM_libxml2_GetTclEventFromObj(interp, objv[1], &tNodePtr) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0)); } else { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1)); } } else { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1)); } } else { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1)); } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclDOMSelectNodeCommand -- * * Implements dom::libxml2::selectnode command. * * Results: * Returns result of XPath expression evaluation. * * Side effects: * Memory is allocated for Tcl object to return result. * *---------------------------------------------------------------------------- */ int TclDOMSelectNodeCommand (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { int i, len, option; char *path; Tcl_Obj *objPtr, *nsOptPtr = NULL, *nodeObjPtr; xmlDocPtr docPtr; xmlNodePtr nodePtr = NULL; xmlXPathContextPtr ctxt = NULL; xmlXPathObjectPtr xpathObj = NULL; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "doc location-path ?option value...?"); return TCL_ERROR; } path = Tcl_GetStringFromObj(objv[2], &len); if (len == 0) { return TCL_OK; } if (TclXML_libxml2_GetDocFromObj(interp, objv[1], &docPtr) != TCL_OK) { if (TclDOM_libxml2_GetNodeFromObj(interp, objv[1], &nodePtr) == TCL_OK) { docPtr = nodePtr->doc; } else { return TCL_ERROR; } } for (i = 3; i < objc; i += 2) { if (i == objc - 1) { Tcl_AppendResult(interp, "missing value for option \"", Tcl_GetStringFromObj(objv[i], NULL), "\"", NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[i], TclDOM_SelectNodeOptions, "option", 0, &option) != TCL_OK) { goto opt_error; } switch ((enum TclDOM_SelectNodeOptions) option) { case TCLDOM_SELECTNODE_OPTION_NAMESPACES: if (nsOptPtr) { if (Tcl_ListObjAppendList(interp, nsOptPtr, objv[i + 1]) != TCL_OK) { Tcl_SetResult(interp, "-namespaces option value must be a list", NULL); goto opt_error; } } else { nsOptPtr = Tcl_DuplicateObj(objv[i + 1]); } if (Tcl_ListObjLength(interp, nsOptPtr, &len) != TCL_OK) { Tcl_SetResult(interp, "-namespaces option value must be a list", NULL); goto opt_error; } else if (len % 2 != 0) { Tcl_SetResult(interp, "value missing from namespaces list", NULL); goto opt_error; } break; default: Tcl_AppendResult(interp, "unknown option \"", Tcl_GetStringFromObj(objv[i], NULL), "\"", NULL); goto opt_error; } } Tcl_MutexLock(&libxml2); ctxt = xmlXPathNewContext(docPtr); if (ctxt == NULL) { Tcl_SetResult(interp, "unable to create XPath context", NULL); return TCL_ERROR; } if (nodePtr) { ctxt->node = nodePtr; } TclXML_libxml2_ResetError(interp); /* * Setup any XML Namespace prefixes given as arguments */ if (nsOptPtr) { Tcl_ListObjLength(interp, nsOptPtr, &len); for (i = 0; i < len; i += 2) { Tcl_Obj *prefixPtr, *nsURIPtr; Tcl_ListObjIndex(interp, nsOptPtr, i, &prefixPtr); Tcl_ListObjIndex(interp, nsOptPtr, i + 1, &nsURIPtr); if (xmlXPathRegisterNs(ctxt, (const xmlChar *) Tcl_GetStringFromObj(prefixPtr, NULL), (const xmlChar *) Tcl_GetStringFromObj(nsURIPtr, NULL))) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "unable to register XML Namespace \"", Tcl_GetStringFromObj(nsURIPtr, NULL), "\"", NULL); goto error; } } } xpathObj = xmlXPathEval((const xmlChar *) path, ctxt); if (xpathObj == NULL) { Tcl_Obj *errObjPtr = TclXML_libxml2_GetErrorObj(interp); if (errObjPtr) { Tcl_SetObjResult(interp, errObjPtr); goto error; } else { Tcl_SetResult(interp, "error evaluating XPath location path", NULL); goto error; } } objPtr = Tcl_NewObj(); switch (xpathObj->type) { case XPATH_NODESET: len = xmlXPathNodeSetGetLength(xpathObj->nodesetval); for (i = 0; i < len; i++) { nodePtr = xmlXPathNodeSetItem(xpathObj->nodesetval, i); nodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, nodePtr); if (nodeObjPtr != NULL) { Tcl_ListObjAppendElement(interp, objPtr, nodeObjPtr); } else { Tcl_MutexUnlock(&libxml2); Tcl_DecrRefCount(objPtr); return TCL_ERROR; } } break; case XPATH_BOOLEAN: Tcl_SetBooleanObj(objPtr, xpathObj->boolval); break; case XPATH_NUMBER: Tcl_SetDoubleObj(objPtr, xpathObj->floatval); break; case XPATH_STRING: Tcl_SetStringObj(objPtr, (CONST char *) xpathObj->stringval, strlen((char *) xpathObj->stringval)); break; default: Tcl_SetResult(interp, "bad XPath object type", NULL); goto error2; } if (nsOptPtr) { Tcl_DecrRefCount(nsOptPtr); } xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(ctxt); Tcl_MutexUnlock(&libxml2); Tcl_SetObjResult(interp, objPtr); return TCL_OK; opt_error: Tcl_MutexUnlock(&libxml2); if (nsOptPtr) { Tcl_DecrRefCount(nsOptPtr); return TCL_ERROR; } error2: if (nsOptPtr) { Tcl_DecrRefCount(nsOptPtr); } xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(ctxt); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; error: if (nsOptPtr) { Tcl_DecrRefCount(nsOptPtr); } xmlXPathFreeContext(ctxt); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } /* *---------------------------------------------------------------------------- * * TclDOMDocumentCommand -- * * Implements dom::libxml2::document command. * * Results: * Depends on method. * * Side effects: * Depends on method. * *---------------------------------------------------------------------------- */ int TclDOMDocumentCommand (clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { TclXML_libxml2_Document *tDocPtr; TclDOM_libxml2_Document *domDocPtr = NULL; enum TclDOM_EventTypes type; int method, optobjc, wrongidx = 1, postMutationEvent = 0, idx, len; xmlDocPtr docPtr = NULL; xmlNodePtr nodePtr = NULL, newNodePtr = NULL; xmlNsPtr nsPtr = NULL; Tcl_Obj *nodeObjPtr = NULL, *newNodeObjPtr = NULL; Tcl_Obj *CONST *optobjv; char *buf, *bufptr, *prefix; if (clientData == NULL) { if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "method token ?args...?"); return TCL_ERROR; } if (TclXML_libxml2_GetTclDocFromObj(interp, objv[2], &tDocPtr) != TCL_OK) { tDocPtr = NULL; docPtr = NULL; if (TclDOM_libxml2_GetNodeFromObj(interp, objv[2], &nodePtr) != TCL_OK) { return TCL_ERROR; } else { nodeObjPtr = objv[2]; if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } } } else { docPtr = tDocPtr->docPtr; domDocPtr = GetDOMDocument(interp, tDocPtr); if (domDocPtr == NULL) { Tcl_SetResult(interp, "internal error", NULL); return TCL_ERROR; } } optobjv = objv + 3; optobjc = objc - 3; wrongidx = 3; } else { if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "method ?args...?"); return TCL_ERROR; } domDocPtr = (TclDOM_libxml2_Document *) clientData; tDocPtr = domDocPtr->tDocPtr; docPtr = tDocPtr->docPtr; optobjv = objv + 2; optobjc = objc - 2; wrongidx = 2; } if (Tcl_GetIndexFromObj(interp, objv[1], TclDOM_DocumentCommandMethods, "method", 0, &method) != TCL_OK) { return TCL_ERROR; } Tcl_ResetResult(interp); switch ((enum TclDOM_DocumentCommandMethods) method) { case TCLDOM_DOCUMENT_CGET: if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "option"); return TCL_ERROR; } if (!docPtr) { Tcl_SetResult(interp, "not a document", NULL); return TCL_ERROR; } return DocumentCget(interp, docPtr, optobjv[0]); break; case TCLDOM_DOCUMENT_CONFIGURE: if (!docPtr) { Tcl_SetResult(interp, "not a document", NULL); return TCL_ERROR; } if (optobjc == 1) { return DocumentCget(interp, docPtr, optobjv[0]); } else { return DocumentConfigure(interp, docPtr, optobjc, optobjv); } break; case TCLDOM_DOCUMENT_CREATEELEMENTNS: if (optobjc != 2) { Tcl_WrongNumArgs(interp, wrongidx, objv, "nsuri qualname"); return TCL_ERROR; } /* * libxml2 doesn't check for invalid element name, * so must do that here. */ if (Tcl_RegExpMatchObj(interp, optobjv[1], checkQName) == 0) { Tcl_SetResult(interp, "invalid element name", NULL); return TCL_ERROR; } /* Find localName of element */ buf = Tcl_GetStringFromObj(optobjv[1], &len); for (idx = 0; buf[idx] != ':' && idx < len; idx++) ; if (idx == len) { /* no prefix was given */ bufptr = buf; } else { /* NB. name must have a local part, since it is a valid QName */ bufptr = &buf[idx + 1]; } if (docPtr && clientData == NULL) { /* We're creating the document element, so must create the namespace too */ xmlNodePtr old; Tcl_MutexLock(&libxml2); newNodePtr = xmlNewDocNode(docPtr, NULL, (const xmlChar *) bufptr, NULL); if (newNodePtr == NULL) { Tcl_SetResult(interp, "unable to create element node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } old = xmlDocSetRootElement(docPtr, newNodePtr); if (old) { xmlDocSetRootElement(docPtr, old); xmlFreeNode(newNodePtr); Tcl_SetResult(interp, "document element already exists", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } if (idx < len) { prefix = Tcl_Alloc(bufptr - buf); strncpy(prefix, buf, bufptr - buf - 1); prefix[bufptr - buf - 1] = '\0'; } else { /* synthesize prefix for this XML Namespace */ prefix = Tcl_Alloc(20); sprintf(prefix, "ns%d", domDocPtr->nodeCntr++); } nsPtr = xmlNewNs(newNodePtr, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL), (const xmlChar *) prefix); if (nsPtr == NULL) { Tcl_SetResult(interp, "unable to create XML Namespace", NULL); Tcl_Free(prefix); xmlUnlinkNode(newNodePtr); xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } xmlSetNs(newNodePtr, nsPtr); Tcl_MutexUnlock(&libxml2); newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { Tcl_MutexLock(&libxml2); xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } postMutationEvent = 1; } else if (docPtr && clientData != NULL) { /* Create an unattached element node */ Tcl_MutexLock(&libxml2); newNodePtr = xmlNewDocNode(docPtr, NULL, (const xmlChar *) bufptr, NULL); if (idx < len) { prefix = Tcl_Alloc(bufptr - buf); strncpy(prefix, buf, bufptr - buf - 1); prefix[bufptr - buf - 1] = '\0'; } else { /* synthesize prefix for this XML Namespace */ prefix = Tcl_Alloc(20); sprintf(prefix, "ns%d", domDocPtr->nodeCntr); } nsPtr = xmlNewNs(newNodePtr, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL), (const xmlChar *) prefix); if (nsPtr == NULL) { Tcl_SetResult(interp, "unable to create XML Namespace", NULL); Tcl_Free(prefix); xmlUnlinkNode(newNodePtr); xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } xmlSetNs(newNodePtr, nsPtr); Tcl_MutexUnlock(&libxml2); if (newNodePtr == NULL) { Tcl_SetResult(interp, "unable to create element node", NULL); return TCL_ERROR; } newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { Tcl_MutexLock(&libxml2); xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } else { Tcl_SetObjResult(interp, newNodeObjPtr); } /* * The tree hasn't changed yet, so no events need to be fired. */ postMutationEvent = 0; } else { Tcl_MutexLock(&libxml2); /* Find XML Namespace */ nsPtr = xmlSearchNsByHref(nodePtr->doc, nodePtr, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL)); if (nsPtr == NULL) { if (idx < len) { prefix = Tcl_Alloc(bufptr - buf); strncpy(prefix, buf, bufptr - buf - 1); prefix[bufptr - buf - 1] = '\0'; } else { prefix = Tcl_Alloc(20); sprintf(prefix, "ns%d", domDocPtr->nodeCntr++); } newNodePtr = xmlNewChild(nodePtr, NULL, (const xmlChar *) bufptr, NULL); nsPtr = xmlNewNs(newNodePtr, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL), (const xmlChar *) prefix); if (nsPtr == NULL) { Tcl_SetResult(interp, "unable to create XML Namespace", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } xmlSetNs(newNodePtr, nsPtr); } else { newNodePtr = xmlNewChild(nodePtr, nsPtr, (const xmlChar *) bufptr, NULL); if (newNodePtr == NULL) { Tcl_SetResult(interp, "unable to create element node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } } Tcl_MutexUnlock(&libxml2); newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { Tcl_MutexLock(&libxml2); xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } postMutationEvent = 1; } break; case TCLDOM_DOCUMENT_CREATEELEMENT: if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "name"); return TCL_ERROR; } /* * libxml2 doesn't check for invalid element name, * so must do that here. */ if (Tcl_RegExpMatchObj(interp, optobjv[0], checkName) == 0) { Tcl_AppendResult(interp, "invalid element name \"", Tcl_GetStringFromObj(optobjv[0], NULL), "\"", NULL); return TCL_ERROR; } Tcl_MutexLock(&libxml2); if (docPtr && clientData == NULL) { xmlNodePtr old; newNodePtr = xmlNewDocNode(docPtr, NULL, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL), NULL); if (newNodePtr == NULL) { Tcl_SetResult(interp, "unable to create element node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } old = xmlDocSetRootElement(docPtr, newNodePtr); if (old) { xmlDocSetRootElement(docPtr, old); xmlFreeNode(newNodePtr); Tcl_SetResult(interp, "document element already exists", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } postMutationEvent = 1; } else if (docPtr && clientData != NULL) { /* Create an unattached element node */ newNodePtr = xmlNewDocNode(docPtr, NULL, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL), NULL); if (newNodePtr == NULL) { Tcl_SetResult(interp, "unable to create element node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } else { Tcl_SetObjResult(interp, newNodeObjPtr); } /* * The tree hasn't changed yet, so no events need to be fired. */ postMutationEvent = 0; } else { newNodePtr = xmlNewChild(nodePtr, NULL, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL), NULL); if (newNodePtr == NULL) { Tcl_SetResult(interp, "unable to create element node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } postMutationEvent = 1; } Tcl_MutexUnlock(&libxml2); break; case TCLDOM_DOCUMENT_CREATEDOCUMENTFRAGMENT: if (optobjc != 0) { Tcl_WrongNumArgs(interp, wrongidx, objv, ""); return TCL_ERROR; } Tcl_MutexLock(&libxml2); if (docPtr) { newNodePtr = xmlNewDocFragment(docPtr); } else { newNodePtr = xmlNewDocFragment(nodePtr->doc); } if (newNodePtr == NULL) { Tcl_SetResult(interp, "unable to create document fragment", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } else { Tcl_SetObjResult(interp, newNodeObjPtr); } Tcl_MutexUnlock(&libxml2); /* The node hasn't been inserted into the tree yet */ postMutationEvent = 0; break; case TCLDOM_DOCUMENT_CREATETEXTNODE: if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "text"); return TCL_ERROR; } Tcl_MutexLock(&libxml2); if (docPtr) { char *content; int len; content = Tcl_GetStringFromObj(optobjv[0], &len); newNodePtr = xmlNewDocTextLen(docPtr, (const xmlChar *) content, len); if (newNodePtr == NULL) { Tcl_SetResult(interp, "unable to create text node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } else { Tcl_SetObjResult(interp, newNodeObjPtr); } Tcl_MutexUnlock(&libxml2); postMutationEvent = 0; } else { xmlNodePtr returnNode; char *content; int len; content = Tcl_GetStringFromObj(optobjv[0], &len); newNodePtr = xmlNewTextLen((const xmlChar *) content, len); if (newNodePtr == NULL) { Tcl_SetResult(interp, "creating text node failed", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } returnNode = xmlAddChild(nodePtr, newNodePtr); if (returnNode == NULL) { xmlFreeNode(newNodePtr); Tcl_SetResult(interp, "add child failed", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } Tcl_MutexUnlock(&libxml2); postMutationEvent = 1; } break; case TCLDOM_DOCUMENT_CREATECOMMENT: if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "data"); return TCL_ERROR; } Tcl_MutexLock(&libxml2); if (docPtr) { newNodePtr = xmlNewDocComment(docPtr, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL)); if (newNodePtr == NULL) { Tcl_SetResult(interp, "unable to create comment node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } else { Tcl_SetObjResult(interp, newNodeObjPtr); } postMutationEvent = 0; } else { newNodePtr = xmlNewDocComment(nodePtr->doc, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL)); if (newNodePtr == NULL) { Tcl_SetResult(interp, "unable to create comment node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } xmlAddChild(nodePtr, newNodePtr); newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } postMutationEvent = 1; } Tcl_MutexUnlock(&libxml2); break; case TCLDOM_DOCUMENT_CREATECDATASECTION: if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "text"); return TCL_ERROR; } Tcl_MutexLock(&libxml2); if (docPtr) { char *content; int len; content = Tcl_GetStringFromObj(optobjv[0], &len); newNodePtr = xmlNewDocTextLen(docPtr, (const xmlChar *) content, len); if (newNodePtr == NULL) { Tcl_SetResult(interp, "unable to create text node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } else { Tcl_SetObjResult(interp, newNodeObjPtr); } postMutationEvent = 0; } else { char *content; int len; content = Tcl_GetStringFromObj(optobjv[0], &len); newNodePtr = xmlNewTextLen((const xmlChar *) content, len); if (newNodePtr == NULL) { Tcl_SetResult(interp, "unable to create text node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } xmlAddChild(nodePtr, newNodePtr); newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } postMutationEvent = 1; } Tcl_MutexUnlock(&libxml2); break; case TCLDOM_DOCUMENT_CREATEPI: if (optobjc != 2) { Tcl_WrongNumArgs(interp, wrongidx, objv, "target data"); return TCL_ERROR; } Tcl_MutexLock(&libxml2); newNodePtr = xmlNewPI((const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL), (const xmlChar *) Tcl_GetStringFromObj(optobjv[1], NULL)); if (newNodePtr == NULL) { Tcl_SetResult(interp, "unable to create processing instruction node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } if (docPtr) { /* * libxml2 does not provide 'xmlNewDocPI' so the PI must be added to the tree * before we wrap it in an object. We'll use the document element as a placeholder * for the PI node; the user may move it from there. */ xmlNodePtr docElPtr = xmlDocGetRootElement(docPtr); if (docElPtr == NULL) { xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); Tcl_SetResult(interp, "document element must exist before adding a PI", NULL); return TCL_ERROR; } xmlAddNextSibling(docElPtr, newNodePtr); newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } else { Tcl_SetObjResult(interp, newNodeObjPtr); } postMutationEvent = 0; } else { xmlAddChild(nodePtr, newNodePtr); newNodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, newNodePtr); if (newNodeObjPtr == NULL) { xmlFreeNode(newNodePtr); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } postMutationEvent = 1; } Tcl_MutexUnlock(&libxml2); break; case TCLDOM_DOCUMENT_CREATEEVENT: if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "type"); return TCL_ERROR; } if (!docPtr) { docPtr = nodePtr->doc; } if (Tcl_GetIndexFromObj(interp, optobjv[0], TclDOM_EventTypes, "type", TCL_EXACT, &method) == TCL_OK) { type = (enum TclDOM_EventTypes) method; } else { type = TCLDOM_EVENT_USERDEFINED; } newNodeObjPtr = TclDOM_libxml2_NewEventObj(interp, docPtr, type, optobjv[0]); if (newNodeObjPtr == NULL) { return TCL_ERROR; } else { Tcl_SetObjResult(interp, newNodeObjPtr); } postMutationEvent = 0; break; case TCLDOM_DOCUMENT_SCHEMA: if (optobjc < 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "submethod ?args ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, optobjv[0], TclDOM_DocumentSchemaSubmethods, "submethod", 0, &method) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_DocumentSchemaSubmethods) method) { case TCLDOM_DOCUMENT_SCHEMA_COMPILE: if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "compile"); return TCL_ERROR; } return SchemaCompile(interp, domDocPtr); case TCLDOM_DOCUMENT_SCHEMA_VALIDATE: if (optobjc != 2) { Tcl_WrongNumArgs(interp, wrongidx, objv, "validate instance"); return TCL_ERROR; } else { xmlDocPtr instancePtr; if (TclXML_libxml2_GetDocFromObj(interp, optobjv[1], &instancePtr) != TCL_OK) { return TCL_ERROR; } return SchemaValidate(interp, domDocPtr, instancePtr); } break; default: Tcl_ResetResult(interp); Tcl_AppendResult(interp, "unknown submethod \"", Tcl_GetStringFromObj(optobjv[0], NULL), "\"", NULL); return TCL_ERROR; } break; case TCLDOM_DOCUMENT_RELAXNG: if (optobjc < 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "submethod ?args ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, optobjv[0], TclDOM_DocumentRelaxNGSubmethods, "submethod", 0, &method) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_DocumentRelaxNGSubmethods) method) { case TCLDOM_DOCUMENT_RELAXNG_COMPILE: if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "compile"); return TCL_ERROR; } return RelaxNGCompile(interp, domDocPtr); case TCLDOM_DOCUMENT_RELAXNG_VALIDATE: if (optobjc != 2) { Tcl_WrongNumArgs(interp, wrongidx, objv, "validate instance"); return TCL_ERROR; } else { xmlDocPtr instancePtr; if (TclXML_libxml2_GetDocFromObj(interp, optobjv[1], &instancePtr) != TCL_OK) { return TCL_ERROR; } return RelaxNGValidate(interp, domDocPtr, instancePtr); } break; default: Tcl_ResetResult(interp); Tcl_AppendResult(interp, "unknown submethod \"", Tcl_GetStringFromObj(optobjv[0], NULL), "\"", NULL); return TCL_ERROR; } break; case TCLDOM_DOCUMENT_DTD: if (optobjc < 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "submethod ?args...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, optobjv[0], TclDOM_DocumentDTDSubmethods, "submethod", 0, &method) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_DocumentDTDSubmethods) method) { case TCLDOM_DOCUMENT_DTD_VALIDATE: if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "validate"); return TCL_ERROR; } else { return DTDValidate(interp, domDocPtr); } default: Tcl_SetResult(interp, "unknown submethod", NULL); return TCL_ERROR; } break; case TCLDOM_DOCUMENT_CREATEATTRIBUTE: case TCLDOM_DOCUMENT_CREATEENTITY: case TCLDOM_DOCUMENT_CREATEENTITYREFERENCE: case TCLDOM_DOCUMENT_CREATEDOCTYPEDECL: default: Tcl_SetResult(interp, "method \"", NULL); Tcl_AppendResult(interp, Tcl_GetStringFromObj(objv[1], NULL), "\" not yet implemented", NULL); return TCL_ERROR; } if (postMutationEvent) { TclDOM_PostMutationEvent(interp, tDocPtr, newNodeObjPtr, TCLDOM_EVENT_DOMNODEINSERTED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), objv[2], NULL, NULL, NULL, NULL); TclDOM_PostMutationEvent(interp, tDocPtr, newNodeObjPtr, TCLDOM_EVENT_DOMNODEINSERTEDINTODOCUMENT, NULL, Tcl_NewIntObj(0), Tcl_NewIntObj(0), NULL, NULL, NULL, NULL, NULL); if (nodePtr) { TclDOM_PostMutationEvent(interp, tDocPtr, nodeObjPtr, TCLDOM_EVENT_DOMSUBTREEMODIFIED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), NULL, NULL, NULL, NULL, NULL); } else { /* * We just added the document element. */ } Tcl_SetObjResult(interp, newNodeObjPtr); } return TCL_OK; } int DocumentCget(interp, docPtr, optObj) Tcl_Interp *interp; xmlDocPtr docPtr; Tcl_Obj *CONST optObj; { TclXML_libxml2_Document *tDocPtr; xmlNodePtr nodePtr; int option; if (Tcl_GetIndexFromObj(interp, optObj, TclDOM_DocumentCommandOptions, "option", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_DocumentCommandOptions) option) { case TCLDOM_DOCUMENT_DOCTYPE: Tcl_SetResult(interp, "cget option \"", NULL); Tcl_AppendResult(interp, Tcl_GetStringFromObj(optObj, NULL), NULL); Tcl_AppendResult(interp, "\" not yet implemented", NULL); return TCL_ERROR; case TCLDOM_DOCUMENT_IMPLEMENTATION: Tcl_SetResult(interp, "::dom::libxml2::DOMImplementation", NULL); break; case TCLDOM_DOCUMENT_DOCELEMENT: Tcl_MutexLock(&libxml2); nodePtr = xmlDocGetRootElement(docPtr); Tcl_MutexUnlock(&libxml2); if (nodePtr) { Tcl_SetObjResult(interp, TclDOM_libxml2_CreateObjFromNode(interp, nodePtr)); } else { Tcl_ResetResult(interp); return TCL_OK; } break; case TCLDOM_DOCUMENT_KEEP: if (TclXML_libxml2_GetTclDocFromDoc(interp, docPtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } if (tDocPtr->keep == TCLXML_LIBXML2_DOCUMENT_KEEP) { Tcl_SetResult(interp, "normal", NULL); } else if (tDocPtr->keep == TCLXML_LIBXML2_DOCUMENT_IMPLICIT) { Tcl_SetResult(interp, "implicit", NULL); } else { Tcl_SetResult(interp, "internal error", NULL); return TCL_ERROR; } return TCL_OK; case TCLDOM_DOCUMENT_BASEURI: Tcl_SetObjResult(interp, TclXML_libxml2_GetBaseURIFromDoc(docPtr)); return TCL_OK; default: Tcl_SetResult(interp, "unknown option", NULL); return TCL_ERROR; } return TCL_OK; } int DocumentConfigure(interp, docPtr, objc, objv) Tcl_Interp *interp; xmlDocPtr docPtr; int objc; Tcl_Obj *CONST objv[]; { TclXML_libxml2_Document *tDocPtr; int option; /* TODO: set up these tables in the TclXML/libxml2 includes */ CONST84 char *KeepOptions[] = { "normal", "implicit", NULL }; enum KeepOptions { OPTION_KEEP_NORMAL, OPTION_KEEP_IMPLICIT }; if (objc <= 1) { Tcl_SetResult(interp, "missing option value", NULL); return TCL_ERROR; } while (objc > 1) { if (objc == 1) { Tcl_SetResult(interp, "missing option value", NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[0], TclDOM_DocumentCommandOptions, "option", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_DocumentCommandOptions) option) { case TCLDOM_DOCUMENT_KEEP: if (TclXML_libxml2_GetTclDocFromDoc(interp, docPtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], KeepOptions, "value", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum KeepOptions) option) { case OPTION_KEEP_NORMAL: tDocPtr->keep = TCLXML_LIBXML2_DOCUMENT_KEEP; break; case OPTION_KEEP_IMPLICIT: tDocPtr->keep = TCLXML_LIBXML2_DOCUMENT_IMPLICIT; break; default: Tcl_SetResult(interp, "unknown value", NULL); return TCL_ERROR; } break; case TCLDOM_DOCUMENT_BASEURI: Tcl_ResetResult(interp); if (TclXML_libxml2_SetBaseURI(interp, docPtr, objv[1]) != TCL_OK) { return TCL_ERROR; } break; default: Tcl_SetResult(interp, "read-only option", NULL); return TCL_ERROR; } objc -= 2; objv += 2; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TriggerEventListeners -- * * Iterates through the list of event listeners for * a node or document and fires events. * * Results: * Depends on listeners. * * Side effects: * Depends on listeners. * *---------------------------------------------------------------------------- */ static int TriggerEventListeners(interp, type, tokenPtr, eventObjPtr, eventPtr) Tcl_Interp *interp; Tcl_HashTable *type; void *tokenPtr; Tcl_Obj *eventObjPtr; TclDOM_libxml2_Event *eventPtr; { Tcl_HashTable *listenerTablePtr; Tcl_HashEntry *entryPtr, *listenerEntryPtr; Tcl_Obj *listenerListPtr; int listenerLen, listenerIdx; char *eventType; entryPtr = Tcl_FindHashEntry(type, tokenPtr); if (entryPtr == NULL) { return TCL_OK; } listenerTablePtr = (Tcl_HashTable *) Tcl_GetHashValue(entryPtr); if (eventPtr->type != TCLDOM_EVENT_USERDEFINED) { eventType = (char *) TclDOM_EventTypes[eventPtr->type]; } else { eventType = Tcl_GetStringFromObj(eventPtr->typeObjPtr, NULL); } listenerEntryPtr = Tcl_FindHashEntry(listenerTablePtr, eventType); if (listenerEntryPtr == NULL) { return TCL_OK; } listenerListPtr = (Tcl_Obj *) Tcl_GetHashValue(listenerEntryPtr); /* * DOM L2 specifies that the ancestors are determined * at the moment of event dispatch, so using a static * list is the correct thing to do. */ Tcl_ListObjLength(interp, listenerListPtr, &listenerLen); /* Preserve the event object until all listeners are triggered */ Tcl_IncrRefCount(eventObjPtr); for (listenerIdx = 0; listenerIdx < listenerLen; listenerIdx++) { Tcl_Obj *listenerObj, *cmdPtr; Tcl_ListObjIndex(interp, listenerListPtr, listenerIdx, &listenerObj); cmdPtr = Tcl_DuplicateObj(listenerObj); Tcl_IncrRefCount(cmdPtr); if (Tcl_ListObjAppendElement(interp, cmdPtr, eventObjPtr) != TCL_OK) { Tcl_DecrRefCount(eventObjPtr); Tcl_DecrRefCount(cmdPtr); return TCL_ERROR; } Tcl_Preserve((ClientData) interp); if (Tcl_GlobalEvalObj(interp, cmdPtr) != TCL_OK) { Tcl_BackgroundError(interp); } Tcl_Release((ClientData) interp); Tcl_DecrRefCount(cmdPtr); } /* Event object may be released now */ Tcl_DecrRefCount(eventObjPtr); return TCL_OK; } static int TclDOMSetLiveNodeListNode(interp, varName, nodePtr) Tcl_Interp *interp; char *varName; xmlNodePtr nodePtr; { Tcl_Obj *valuePtr = Tcl_NewListObj(0, NULL); xmlNodePtr childPtr; for (childPtr = nodePtr->children; childPtr; childPtr = childPtr->next) { Tcl_ListObjAppendElement(interp, valuePtr, TclDOM_libxml2_CreateObjFromNode(interp, childPtr)); } Tcl_SetVar2Ex(interp, varName, NULL, valuePtr, TCL_GLOBAL_ONLY); return TCL_OK; } static int TclDOMSetLiveNodeListDoc(interp, varName, docPtr) Tcl_Interp *interp; char *varName; xmlDocPtr docPtr; { Tcl_Obj *valuePtr = Tcl_NewListObj(0, NULL); xmlNodePtr childPtr; for (childPtr = docPtr->children; childPtr; childPtr = childPtr->next) { Tcl_ListObjAppendElement(interp, valuePtr, TclDOM_libxml2_CreateObjFromNode(interp, childPtr)); } Tcl_SetVar2Ex(interp, varName, NULL, valuePtr, TCL_GLOBAL_ONLY); return TCL_OK; } static char * TclDOMLiveNodeListNode(clientData, interp, name1, name2, flags) ClientData clientData; Tcl_Interp *interp; char *name1; char *name2; int flags; { xmlNodePtr nodePtr = (xmlNodePtr) clientData; if (flags & (TCL_INTERP_DESTROYED | TCL_TRACE_DESTROYED)) { return NULL; } else if (flags & TCL_TRACE_READS) { TclDOMSetLiveNodeListNode(interp, name1, nodePtr); } else if (flags & TCL_TRACE_WRITES) { TclDOMSetLiveNodeListNode(interp, name1, nodePtr); return "variable is read-only"; } else if (flags & TCL_TRACE_UNSETS) { } return NULL; } static char * TclDOMLiveNodeListDoc(clientData, interp, name1, name2, flags) ClientData clientData; Tcl_Interp *interp; char *name1; char *name2; int flags; { xmlDocPtr docPtr = (xmlDocPtr) clientData; if (flags & (TCL_INTERP_DESTROYED | TCL_TRACE_DESTROYED)) { return NULL; } else if (flags & TCL_TRACE_READS) { TclDOMSetLiveNodeListDoc(interp, name1, docPtr); } else if (flags & TCL_TRACE_WRITES) { TclDOMSetLiveNodeListDoc(interp, name1, docPtr); return "variable is read-only"; } else if (flags & TCL_TRACE_UNSETS) { } return NULL; } static int TclDOMSetLiveNamedNodeMap(interp, varName, nodePtr) Tcl_Interp *interp; char *varName; xmlNodePtr nodePtr; { xmlAttrPtr attrPtr; Tcl_UnsetVar(interp, varName, TCL_GLOBAL_ONLY); for (attrPtr = nodePtr->properties; attrPtr; attrPtr = attrPtr->next) { if (Tcl_SetVar2Ex(interp, varName, (char *) attrPtr->name, Tcl_NewStringObj((CONST char *) xmlGetProp(nodePtr, attrPtr->name), -1), TCL_GLOBAL_ONLY) == NULL) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "unable to set attribute \"", attrPtr->name, "\"", NULL); return TCL_ERROR; } if (Tcl_TraceVar2(interp, varName, (char *) attrPtr->name, TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS|TCL_GLOBAL_ONLY, (Tcl_VarTraceProc *) TclDOMLiveNamedNodeMap, (ClientData) nodePtr) != TCL_OK) { return TCL_ERROR; } } return TCL_OK; } static char * TclDOMLiveNamedNodeMap(clientData, interp, name1, name2, flags) ClientData clientData; Tcl_Interp *interp; char *name1; char *name2; int flags; { xmlNodePtr nodePtr = (xmlNodePtr) clientData; if (flags & (TCL_INTERP_DESTROYED | TCL_TRACE_DESTROYED)) { return NULL; } else if (flags & TCL_TRACE_READS && name2 == NULL) { TclDOMSetLiveNamedNodeMap(interp, name1, nodePtr); } else if (flags & TCL_TRACE_READS && name2 != NULL) { if (Tcl_SetVar2Ex(interp, name1, name2, Tcl_NewStringObj((CONST char *) xmlGetProp(nodePtr, (const xmlChar *) name2), -1), TCL_GLOBAL_ONLY) == NULL) { return "unable to set attribute"; } } else if (flags & TCL_TRACE_WRITES) { TclDOMSetLiveNamedNodeMap(interp, name1, nodePtr); return "variable is read-only"; } else if (flags & TCL_TRACE_UNSETS) { } return NULL; } /* *---------------------------------------------------------------------------- * * TclDOMNodeCommand -- * * Implements dom::libxml2::node command. * * Results: * Depends on method. * * Side effects: * Depends on method. * *---------------------------------------------------------------------------- */ int TclDOMNodeCommand (clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { TclXML_libxml2_Document *tDocPtr; TclDOM_libxml2_Node *tNodePtr; int method, optobjc, option, wrongidx, usecapture = 0; char *buf; xmlNodePtr nodePtr = NULL, childNodePtr, refPtr, newPtr, oldParent; xmlDocPtr docPtr = NULL; Tcl_Obj *nodeObjPtr = NULL; Tcl_Obj *docObjPtr = NULL; Tcl_Obj *resultPtr; Tcl_Obj *CONST *optobjv; if (clientData == NULL) { if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "method token ?arg ...?"); return TCL_ERROR; } if (TclDOM_libxml2_GetTclNodeFromObj(interp, objv[2], &tNodePtr) != TCL_OK) { if (TclXML_libxml2_GetTclDocFromObj(interp, objv[2], &tDocPtr) != TCL_OK) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "\"", Tcl_GetStringFromObj(objv[2], NULL), "\" is neither a DOM document nor a DOM node", NULL); return TCL_ERROR; } else { Tcl_ResetResult(interp); docObjPtr = objv[2]; docPtr = tDocPtr->docPtr; nodeObjPtr = NULL; nodePtr = NULL; } } else { nodePtr = tNodePtr->ptr.nodePtr; nodeObjPtr = objv[2]; docPtr = NULL; docObjPtr = NULL; if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } } optobjc = objc - 3; optobjv = objv + 3; wrongidx = 3; } else { if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "method ?arg ...?"); return TCL_ERROR; } tNodePtr = (TclDOM_libxml2_Node *) clientData; nodePtr = tNodePtr->ptr.nodePtr; nodeObjPtr = NULL; docPtr = NULL; docObjPtr = NULL; if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } optobjc = objc - 2; optobjv = objv + 2; wrongidx = 2; } if (Tcl_GetIndexFromObj(interp, objv[1], TclDOM_NodeCommandMethods, "method", 0, &method) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_NodeCommandMethods) method) { case TCLDOM_NODE_CGET: if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "option"); return TCL_ERROR; } NodeCget(interp, docPtr, nodePtr, optobjv[0]); break; case TCLDOM_NODE_PATH: if (docPtr) { Tcl_Obj *newobjv[2]; newobjv[0] = TclXML_libxml2_CreateObjFromDoc(docPtr); newobjv[1] = NULL; Tcl_SetObjResult(interp, Tcl_NewListObj(1, newobjv)); } else { Tcl_SetObjResult(interp, GetPath(interp, nodePtr)); } break; case TCLDOM_NODE_CONFIGURE: if (optobjc < 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "option ?value? ?option value ...?"); return TCL_ERROR; } if (optobjc == 1) { return NodeCget(interp, docPtr, nodePtr, optobjv[0]); } if (optobjc % 2 == 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "option ?value? ?option value ...?"); return TCL_ERROR; } return NodeConfigure(interp, nodePtr, optobjc, optobjv); break; case TCLDOM_NODE_INSERTBEFORE: if (optobjc < 1 || optobjc > 2) { Tcl_WrongNumArgs(interp, wrongidx, objv, "ref ?new?"); return TCL_ERROR; } else if (docPtr) { /* TODO: allow comments & PIs in document prologue */ Tcl_SetResult(interp, "document already has document element", NULL); return TCL_ERROR; } else if (optobjc == 1) { /* No reference child specified - new appended to child list */ if (TclDOM_libxml2_GetNodeFromObj(interp, optobjv[0], &newPtr) != TCL_OK) { return TCL_ERROR; } return TclDOM_NodeAppendChild(interp, nodePtr, newPtr); } else if (optobjc == 2) { if (TclDOM_libxml2_GetNodeFromObj(interp, optobjv[0], &newPtr) != TCL_OK) { return TCL_ERROR; } if (TclDOM_libxml2_GetNodeFromObj(interp, optobjv[1], &refPtr) != TCL_OK) { return TCL_ERROR; } return TclDOM_NodeInsertBefore(interp, refPtr, newPtr); } break; case TCLDOM_NODE_REPLACECHILD: if (optobjc != 2) { Tcl_WrongNumArgs(interp, wrongidx, objv, "new old"); return TCL_ERROR; } else if (docPtr) { /* TODO: allow replacing comments & PIs */ Tcl_SetResult(interp, "document already has document element", NULL); return TCL_ERROR; } else { if (TclDOM_libxml2_GetNodeFromObj(interp, optobjv[0], &newPtr) != TCL_OK) { return TCL_ERROR; } if (TclDOM_libxml2_GetNodeFromObj(interp, optobjv[1], &refPtr) != TCL_OK) { return TCL_ERROR; } oldParent = newPtr->parent; if (oldParent != refPtr->parent) { TclDOM_PostMutationEvent(interp, tDocPtr, TclDOM_libxml2_CreateObjFromNode(interp, newPtr), TCLDOM_EVENT_DOMNODEREMOVED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), TclDOM_libxml2_CreateObjFromNode(interp, newPtr->parent), NULL, NULL, NULL, NULL); } Tcl_MutexLock(&libxml2); if (xmlReplaceNode(refPtr, newPtr) == NULL) { Tcl_SetResult(interp, "unable to replace node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } Tcl_MutexUnlock(&libxml2); } PostMutationEvents(interp, tDocPtr, nodePtr, refPtr, newPtr, oldParent, refPtr->parent); Tcl_SetObjResult(interp, TclDOM_libxml2_CreateObjFromNode(interp, refPtr)); break; case TCLDOM_NODE_REMOVECHILD: if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "child"); return TCL_ERROR; } else if (docPtr) { /* TODO: allow removing comments & PIs */ Tcl_SetResult(interp, "document must have document element", NULL); return TCL_ERROR; } else { xmlNodePtr childPtr; if (TclDOM_libxml2_GetNodeFromObj(interp, optobjv[0], &childPtr) != TCL_OK) { return TCL_ERROR; } if (nodePtr != childPtr->parent) { Tcl_SetResult(interp, "not found: \"", NULL); Tcl_AppendResult(interp, Tcl_GetStringFromObj(optobjv[0], NULL), "\" is not a child", NULL); if (nodeObjPtr) { Tcl_AppendResult(interp, " of \"", Tcl_GetStringFromObj(nodeObjPtr, NULL), "\"", NULL); } return TCL_ERROR; } oldParent = childPtr->parent; TclDOM_PostMutationEvent(interp, tDocPtr, optobjv[0], TCLDOM_EVENT_DOMNODEREMOVED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), TclDOM_libxml2_CreateObjFromNode(interp, oldParent), NULL, NULL, NULL, NULL); TclDOM_PostMutationEvent(interp, tDocPtr, optobjv[0], TCLDOM_EVENT_DOMNODEREMOVEDFROMDOCUMENT, NULL, Tcl_NewIntObj(0), Tcl_NewIntObj(0), NULL, NULL, NULL, NULL, NULL); Tcl_MutexLock(&libxml2); xmlUnlinkNode(childPtr); Tcl_MutexUnlock(&libxml2); Tcl_SetObjResult(interp, optobjv[0]); TclDOM_PostMutationEvent(interp, tDocPtr, TclDOM_libxml2_CreateObjFromNode(interp, oldParent), TCLDOM_EVENT_DOMSUBTREEMODIFIED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), NULL, NULL, NULL, NULL, NULL); } break; case TCLDOM_NODE_APPENDCHILD: if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "child"); return TCL_ERROR; } else if (docPtr) { xmlNodePtr oldPtr; if (TclDOM_libxml2_GetNodeFromObj(interp, optobjv[0], &childNodePtr) != TCL_OK) { return TCL_ERROR; } Tcl_MutexLock(&libxml2); /* TODO: allow appending comments & PIs */ oldPtr = xmlDocSetRootElement(docPtr, childNodePtr); if (oldPtr) { xmlDocSetRootElement(docPtr, oldPtr); Tcl_SetResult(interp, "document element already exists", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } Tcl_MutexUnlock(&libxml2); Tcl_SetObjResult(interp, optobjv[0]); } else { if (TclDOM_libxml2_GetNodeFromObj(interp, optobjv[0], &childNodePtr) != TCL_OK) { return TCL_ERROR; } return TclDOM_NodeAppendChild(interp, nodePtr, childNodePtr); } break; case TCLDOM_NODE_HASCHILDNODES: if (docPtr) { if (docPtr->children) { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1)); } else { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0)); } } else { if (nodePtr->children) { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1)); } else { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0)); } } break; case TCLDOM_NODE_ISSAMENODE: /* DOM Level 3 method */ if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "ref"); return TCL_ERROR; } if (docPtr) { xmlDocPtr docRefPtr; if (TclXML_libxml2_GetDocFromObj(interp, optobjv[0], &docRefPtr) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0)); return TCL_OK; } Tcl_SetObjResult(interp, Tcl_NewBooleanObj(docPtr == docRefPtr)); } else { if (TclDOM_libxml2_GetNodeFromObj(interp, optobjv[0], &refPtr) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0)); return TCL_OK; } Tcl_SetObjResult(interp, Tcl_NewBooleanObj(nodePtr == refPtr)); } break; case TCLDOM_NODE_CLONENODE: if (optobjc != 0 && optobjc != 2) { Tcl_WrongNumArgs(interp, wrongidx, objv, "?-deep boolean?"); return TCL_ERROR; } else if (docPtr) { Tcl_SetResult(interp, "documents cannot be cloned", NULL); return TCL_ERROR; } else { int deep = 0; xmlNodePtr copyPtr; if (optobjc == 2) { if (Tcl_RegExpMatchObj(interp, optobjv[0], Tcl_NewStringObj("-de?e?p?", -1)) == 0) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "invalid option \"", Tcl_GetStringFromObj(optobjv[0], NULL), "\", must be \"-deep\"", NULL); return TCL_ERROR; } if (Tcl_GetBooleanFromObj(interp, optobjv[1], &deep) != TCL_OK) { return TCL_ERROR; } } Tcl_MutexLock(&libxml2); copyPtr = xmlDocCopyNode(nodePtr, nodePtr->doc, deep); Tcl_MutexUnlock(&libxml2); if (copyPtr == NULL) { Tcl_SetResult(interp, "unable to copy node", NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, TclDOM_libxml2_CreateObjFromNode(interp, copyPtr)); } break; case TCLDOM_NODE_PARENT: if (docPtr) { break; } if (nodePtr->parent) { Tcl_SetObjResult(interp, TclDOM_libxml2_CreateObjFromNode(interp, nodePtr->parent)); } else { Tcl_SetObjResult(interp, TclXML_libxml2_CreateObjFromDoc(nodePtr->doc)); } break; case TCLDOM_NODE_CHILDREN: resultPtr = Tcl_NewListObj(0, NULL); if (docPtr) { childNodePtr = docPtr->children; } else { childNodePtr = nodePtr->children; } while (childNodePtr) { Tcl_ListObjAppendElement(interp, resultPtr, TclDOM_libxml2_CreateObjFromNode(interp, childNodePtr)); childNodePtr = childNodePtr->next; } Tcl_SetObjResult(interp, resultPtr); break; case TCLDOM_NODE_ADDEVENTLISTENER: /* TODO: type optional, missing type returns all types that have a listener */ if (optobjc < 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "type ?listener? ?-usecapture boolean?"); return TCL_ERROR; } else { enum TclDOM_EventTypes type; Tcl_Obj *typeObjPtr, *listenerPtr = NULL; void *tokenPtr = NULL; if (nodePtr) { tokenPtr = (void *) nodePtr; } else { tokenPtr = (void *) docPtr; } if (Tcl_GetIndexFromObj(interp, optobjv[0], TclDOM_EventTypes, "type", TCL_EXACT, &option) == TCL_OK) { type = (enum TclDOM_EventTypes) option; } else { type = TCLDOM_EVENT_USERDEFINED; } typeObjPtr = optobjv[0]; Tcl_ResetResult(interp); optobjc -= 1; optobjv += 1; if (optobjc > 0 && *Tcl_GetStringFromObj(optobjv[0], NULL) != '-') { listenerPtr = optobjv[0]; optobjc -= 1; optobjv += 1; } /* else we will return the registered listener */ while (optobjc) { if (optobjc == 1) { Tcl_SetResult(interp, "missing value", NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, optobjv[0], TclDOM_NodeCommandAddEventListenerOptions, "option", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_NodeCommandAddEventListenerOptions) option) { case TCLDOM_NODE_ADDEVENTLISTENER_USECAPTURE: if (Tcl_GetBooleanFromObj(interp, optobjv[1], &usecapture) != TCL_OK) { return TCL_ERROR; } break; default: Tcl_SetResult(interp, "unknown option", NULL); return TCL_ERROR; } optobjc -= 2; optobjv += 2; } if (nodePtr) { docObjPtr = TclXML_libxml2_CreateObjFromDoc(nodePtr->doc); } else { docObjPtr = TclXML_libxml2_CreateObjFromDoc(docPtr); } TclXML_libxml2_GetTclDocFromObj(interp, docObjPtr, &tDocPtr); if (listenerPtr == NULL) { listenerPtr = TclDOM_GetEventListener(interp, tDocPtr, tokenPtr, type, typeObjPtr, usecapture); if (listenerPtr) { Tcl_SetObjResult(interp, listenerPtr); } else { Tcl_SetResult(interp, "unable to find listeners", NULL); return TCL_ERROR; } } else { return TclDOM_AddEventListener(interp, tDocPtr, tokenPtr, type, typeObjPtr, listenerPtr, usecapture); } } break; case TCLDOM_NODE_REMOVEEVENTLISTENER: if (optobjc < 2) { Tcl_WrongNumArgs(interp, wrongidx, objv, "type listener ?-usecapture boolean?"); return TCL_ERROR; } else { Tcl_Obj *typeObjPtr, *listenerPtr; void *tokenPtr = NULL; TclXML_libxml2_Document *tDocPtr; enum TclDOM_EventTypes type; if (nodePtr) { tokenPtr = (void *) nodePtr; } else { tokenPtr = (void *) docPtr; } typeObjPtr = optobjv[0]; if (Tcl_GetIndexFromObj(interp, optobjv[0], TclDOM_EventTypes, "type", TCL_EXACT, &option) == TCL_OK) { type = (enum TclDOM_EventTypes) option; } else { type = TCLDOM_EVENT_USERDEFINED; } listenerPtr = optobjv[1]; optobjc -= 2; optobjv += 2; while (optobjc) { if (Tcl_GetIndexFromObj(interp, optobjv[0], TclDOM_NodeCommandAddEventListenerOptions, "option", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_NodeCommandAddEventListenerOptions) option) { case TCLDOM_NODE_ADDEVENTLISTENER_USECAPTURE: if (Tcl_GetBooleanFromObj(interp, optobjv[1], &usecapture) != TCL_OK) { return TCL_ERROR; } break; default: Tcl_SetResult(interp, "unknown option", NULL); return TCL_ERROR; } optobjc -= 2; optobjv += 2; } if (nodePtr) { if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } } else { docObjPtr = TclXML_libxml2_CreateObjFromDoc(docPtr); if (TclXML_libxml2_GetTclDocFromObj(interp, docObjPtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } } return TclDOM_RemoveEventListener(interp, tDocPtr, tokenPtr, type, typeObjPtr, listenerPtr, usecapture); } break; case TCLDOM_NODE_DISPATCHEVENT: if (optobjc != 1) { Tcl_WrongNumArgs(interp, wrongidx, objv, "event"); return TCL_ERROR; } else { TclDOM_libxml2_Event *eventPtr; if (TclDOM_libxml2_GetEventFromObj(interp, optobjv[0], &eventPtr) != TCL_OK) { return TCL_ERROR; } if (nodeObjPtr) { return TclDOM_DispatchEvent(interp, nodeObjPtr, optobjv[0], eventPtr); } else if (nodePtr) { return TclDOM_DispatchEvent(interp, TclDOM_libxml2_CreateObjFromNode(interp, nodePtr), optobjv[0], eventPtr); } else if (docObjPtr) { return TclDOM_DispatchEvent(interp, docObjPtr, optobjv[0], eventPtr); } else { Tcl_SetResult(interp, "unable to dispatch event", NULL); return TCL_ERROR; } } break; case TCLDOM_NODE_STRINGVALUE: if (optobjc != 0) { Tcl_WrongNumArgs(interp, wrongidx, objv, ""); return TCL_ERROR; } Tcl_ResetResult(interp); Tcl_MutexLock(&libxml2); if (nodePtr) { buf = (char *) xmlNodeGetContent(nodePtr); Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1)); xmlFree (buf); } else if (docPtr) { nodePtr = xmlDocGetRootElement(docPtr); if (nodePtr) { buf = (char *) xmlNodeGetContent(nodePtr); Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1)); xmlFree (buf); } else { nodePtr = docPtr->children; while (nodePtr != NULL) { if (nodePtr->type == XML_TEXT_NODE) { Tcl_AppendResult(interp, (char *) nodePtr->content, NULL); } nodePtr = nodePtr->next; } } } else { Tcl_SetResult(interp, "cannot determine string value: internal error", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } Tcl_MutexUnlock(&libxml2); break; case TCLDOM_NODE_SELECTNODE: Tcl_ResetResult(interp); return TclDOMSelectNodeCommand(clientData, interp, objc - 1, objv + 1); break; default: Tcl_SetResult(interp, "method \"", NULL); Tcl_AppendResult(interp, Tcl_GetStringFromObj(objv[1], NULL), "\" not yet implemented", NULL); return TCL_ERROR; } return TCL_OK; } int NodeCget(interp, docPtr, nodePtr, optPtr) Tcl_Interp *interp; xmlDocPtr docPtr; xmlNodePtr nodePtr; Tcl_Obj *CONST optPtr; { TclXML_libxml2_Document *tDocPtr; TclDOM_libxml2_Document *domDocPtr; Tcl_Obj *objPtr; xmlNodePtr childNodePtr; int option; unsigned long val; char varname[100]; Tcl_Obj *livePtr; if (Tcl_GetIndexFromObj(interp, optPtr, TclDOM_NodeCommandOptions, "option", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_NodeCommandOptions) option) { case TCLDOM_NODE_NODETYPE: if (docPtr) { Tcl_SetResult(interp, "document", NULL); break; } switch (nodePtr->type) { case XML_ELEMENT_NODE: Tcl_SetResult(interp, "element", NULL); break; case XML_ATTRIBUTE_NODE: Tcl_SetResult(interp, "attribute", NULL); break; case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: Tcl_SetResult(interp, "textNode", NULL); break; case XML_ENTITY_REF_NODE: Tcl_SetResult(interp, "entityReference", NULL); break; case XML_ENTITY_NODE: Tcl_SetResult(interp, "entity", NULL); break; case XML_PI_NODE: Tcl_SetResult(interp, "processingInstruction", NULL); break; case XML_COMMENT_NODE: Tcl_SetResult(interp, "comment", NULL); break; case XML_DOCUMENT_NODE: Tcl_SetResult(interp, "document", NULL); break; case XML_DOCUMENT_TYPE_NODE: Tcl_SetResult(interp, "docType", NULL); break; case XML_DOCUMENT_FRAG_NODE: Tcl_SetResult(interp, "documentFragment", NULL); break; case XML_NOTATION_NODE: Tcl_SetResult(interp, "notation", NULL); break; case XML_HTML_DOCUMENT_NODE: Tcl_SetResult(interp, "HTMLdocument", NULL); break; case XML_DTD_NODE: Tcl_SetResult(interp, "dtd", NULL); break; case XML_ELEMENT_DECL: Tcl_SetResult(interp, "elementDecl", NULL); break; case XML_ATTRIBUTE_DECL: Tcl_SetResult(interp, "attributeDecl", NULL); break; case XML_ENTITY_DECL: Tcl_SetResult(interp, "entityDecl", NULL); break; case XML_NAMESPACE_DECL: Tcl_SetResult(interp, "namespaceDecl", NULL); break; case XML_XINCLUDE_START: Tcl_SetResult(interp, "xincludeStart", NULL); break; case XML_XINCLUDE_END: Tcl_SetResult(interp, "xincludeEnd", NULL); break; default: Tcl_SetResult(interp, "unknown", NULL); } break; case TCLDOM_NODE_LOCALNAME: case TCLDOM_NODE_NODENAME: /* This isn't quite right: nodeName should return the expanded name */ if (docPtr) { Tcl_SetResult(interp, "#document", NULL); break; } /* libxml2 doesn't maintain the correct DOM node name */ switch (nodePtr->type) { case XML_ELEMENT_NODE: case XML_ATTRIBUTE_NODE: case XML_ENTITY_REF_NODE: case XML_ENTITY_NODE: case XML_PI_NODE: case XML_DOCUMENT_TYPE_NODE: case XML_NOTATION_NODE: Tcl_SetObjResult(interp, Tcl_NewStringObj((CONST char *) nodePtr->name, -1)); break; case XML_TEXT_NODE: Tcl_SetResult(interp, "#text", NULL); break; case XML_CDATA_SECTION_NODE: Tcl_SetResult(interp, "#cdata-section", NULL); break; case XML_COMMENT_NODE: Tcl_SetResult(interp, "#comment", NULL); break; case XML_DOCUMENT_NODE: /* Already handled above */ Tcl_SetResult(interp, "#document", NULL); break; case XML_DOCUMENT_FRAG_NODE: Tcl_SetResult(interp, "#document-fragment", NULL); break; case XML_HTML_DOCUMENT_NODE: /* Not standard DOM */ Tcl_SetResult(interp, "#HTML-document", NULL); break; case XML_DTD_NODE: /* Not standard DOM */ Tcl_SetResult(interp, "#dtd", NULL); break; case XML_ELEMENT_DECL: /* Not standard DOM */ Tcl_SetResult(interp, "#element-declaration", NULL); break; case XML_ATTRIBUTE_DECL: /* Not standard DOM */ Tcl_SetResult(interp, "#attribute-declaration", NULL); break; case XML_ENTITY_DECL: /* Not standard DOM */ Tcl_SetResult(interp, "#entity-declaration", NULL); break; case XML_NAMESPACE_DECL: /* Not standard DOM */ Tcl_SetResult(interp, "#namespace-declaration", NULL); break; case XML_XINCLUDE_START: /* Not standard DOM */ Tcl_SetResult(interp, "#xinclude-start", NULL); break; case XML_XINCLUDE_END: /* Not standard DOM */ Tcl_SetResult(interp, "#xinclude-end", NULL); break; default: Tcl_SetResult(interp, "#unknown", NULL); } break; case TCLDOM_NODE_NODEVALUE: if (docPtr) { break; } Tcl_MutexLock(&libxml2); if (XML_GET_CONTENT(nodePtr) != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj((CONST char *) XML_GET_CONTENT(nodePtr), -1)); } Tcl_MutexUnlock(&libxml2); break; case TCLDOM_NODE_OWNERDOCUMENT: if (docPtr) { Tcl_SetObjResult(interp, TclXML_libxml2_CreateObjFromDoc(docPtr)); break; } Tcl_SetObjResult(interp, TclXML_libxml2_CreateObjFromDoc(nodePtr->doc)); break; case TCLDOM_NODE_PARENTNODE: if (docPtr) { Tcl_ResetResult(interp); break; } if (nodePtr->parent) { if (nodePtr->parent->type == XML_DOCUMENT_NODE || nodePtr->parent->type == XML_HTML_DOCUMENT_NODE) { Tcl_SetObjResult(interp, TclXML_libxml2_CreateObjFromDoc(nodePtr->doc)); } else { Tcl_SetObjResult(interp, TclDOM_libxml2_CreateObjFromNode(interp, nodePtr->parent)); } } else { Tcl_SetObjResult(interp, TclXML_libxml2_CreateObjFromDoc(nodePtr->doc)); } break; case TCLDOM_NODE_CHILDNODES: /* Set up live NodeList variable */ if (docPtr) { objPtr = TclXML_libxml2_CreateObjFromDoc(docPtr); if (TclXML_libxml2_GetTclDocFromObj(interp, objPtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } } else { if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } } domDocPtr = GetDOMDocument(interp, tDocPtr); if (domDocPtr == NULL) { Tcl_SetResult(interp, "internal error", NULL); return TCL_ERROR; } sprintf(varname, "::dom::%s::nodelist.%d", tDocPtr->token, domDocPtr->nodeCntr++); livePtr = Tcl_GetVar2Ex(interp, varname, NULL, TCL_GLOBAL_ONLY); if (!livePtr) { Tcl_Obj *nodelistPtr = Tcl_NewListObj(0, NULL); Tcl_SetVar2Ex(interp, varname, NULL, nodelistPtr, TCL_GLOBAL_ONLY); Tcl_IncrRefCount(nodelistPtr); if (docPtr) { if (Tcl_TraceVar(interp, varname, TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS|TCL_GLOBAL_ONLY, (Tcl_VarTraceProc *) TclDOMLiveNodeListDoc, (ClientData) docPtr) != TCL_OK) { Tcl_DecrRefCount(nodelistPtr); return TCL_ERROR; } else { TclDOMLiveNodeListDoc((ClientData) tDocPtr->docPtr, interp, varname, NULL, TCL_TRACE_READS); } } else { if (Tcl_TraceVar(interp, varname, TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS|TCL_GLOBAL_ONLY, (Tcl_VarTraceProc *) TclDOMLiveNodeListNode, (ClientData) nodePtr) != TCL_OK) { Tcl_DecrRefCount(nodelistPtr); return TCL_ERROR; } else { TclDOMLiveNodeListNode((ClientData) nodePtr, interp, varname, NULL, TCL_TRACE_READS); } } } Tcl_SetObjResult(interp, Tcl_NewStringObj(varname, -1)); break; case TCLDOM_NODE_FIRSTCHILD: /* * Handle case where no children are present * Bug #1089114 w/- patch by dwcollins */ if (docPtr) { childNodePtr = docPtr->children; } else { childNodePtr = nodePtr->children; } if (childNodePtr != NULL) { Tcl_SetObjResult(interp, TclDOM_libxml2_CreateObjFromNode(interp, childNodePtr)); } break; case TCLDOM_NODE_LASTCHILD: if (docPtr) { childNodePtr = docPtr->last; } else { Tcl_MutexLock(&libxml2); childNodePtr = xmlGetLastChild(nodePtr); Tcl_MutexUnlock(&libxml2); } if (childNodePtr != NULL) { Tcl_SetObjResult(interp, TclDOM_libxml2_CreateObjFromNode(interp, childNodePtr)); } break; case TCLDOM_NODE_NEXTSIBLING: if (!docPtr && nodePtr->next) { Tcl_SetObjResult(interp, TclDOM_libxml2_CreateObjFromNode(interp, nodePtr->next)); } break; case TCLDOM_NODE_PREVIOUSSIBLING: if (!docPtr && nodePtr->prev) { Tcl_SetObjResult(interp, TclDOM_libxml2_CreateObjFromNode(interp, nodePtr->prev)); } break; case TCLDOM_NODE_ATTRIBUTES: if (docPtr) { Tcl_ResetResult(interp); return TCL_OK; } else if (nodePtr->type != XML_ELEMENT_NODE) { Tcl_SetResult(interp, "wrong object type", NULL); return TCL_ERROR; } else { /* Set up live NamedNodeMap variable */ /* If there's already a variable, return it */ objPtr = TclXML_libxml2_CreateObjFromDoc(nodePtr->doc); TclXML_libxml2_GetTclDocFromObj(interp, objPtr, &tDocPtr); domDocPtr = GetDOMDocument(interp, tDocPtr); if (domDocPtr == NULL) { Tcl_SetResult(interp, "internal error", NULL); return TCL_ERROR; } sprintf(varname, "::dom::%s::att%d", tDocPtr->token, domDocPtr->nodeCntr++); livePtr = Tcl_GetVar2Ex(interp, varname, NULL, TCL_GLOBAL_ONLY); if (!livePtr) { if (TclDOMSetLiveNamedNodeMap(interp, varname, (ClientData) nodePtr) != TCL_OK) { Tcl_UnsetVar(interp, varname, TCL_GLOBAL_ONLY); return TCL_ERROR; } if (Tcl_TraceVar(interp, varname, TCL_TRACE_ARRAY|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS|TCL_GLOBAL_ONLY, (Tcl_VarTraceProc *) TclDOMLiveNamedNodeMap, (ClientData) nodePtr) != TCL_OK) { Tcl_UnsetVar(interp, varname, TCL_GLOBAL_ONLY); return TCL_ERROR; } } Tcl_SetObjResult(interp, Tcl_NewStringObj(varname, -1)); } break; case TCLDOM_NODE_NAMESPACEURI: if (!docPtr && nodePtr->ns) { if (nodePtr->ns->href) { Tcl_SetObjResult(interp, Tcl_NewStringObj((CONST char *) nodePtr->ns->href, -1)); } } break; case TCLDOM_NODE_PREFIX: if (!docPtr && nodePtr->ns) { if (nodePtr->ns->prefix) { Tcl_SetObjResult(interp, Tcl_NewStringObj((CONST char *) nodePtr->ns->prefix, -1)); } } break; case TCLDOM_NODE_ID: /* Code borrowed from libxslt-1.1.24 functions.c xsltGenerateIdFunction */ val = (unsigned long)((char *)nodePtr - (char *)0); val /= sizeof(xmlNode); sprintf(varname, "id%ld", val); Tcl_SetObjResult(interp, Tcl_NewStringObj(varname, -1)); break; default: Tcl_SetResult(interp, "unknown option or not yet implemented", NULL); return TCL_ERROR; } return TCL_OK; } int NodeConfigure(interp, nodePtr, objc, objv) Tcl_Interp *interp; xmlNodePtr nodePtr; int objc; Tcl_Obj *CONST objv[]; { TclXML_libxml2_Document *tDocPtr; Tcl_Obj *objPtr; char *buf; int option, len; while (objc) { if (objc == 1) { Tcl_SetResult(interp, "missing value", NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[0], TclDOM_NodeCommandOptions, "option", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_NodeCommandOptions) option) { case TCLDOM_NODE_NODETYPE: case TCLDOM_NODE_NODENAME: case TCLDOM_NODE_PARENTNODE: case TCLDOM_NODE_CHILDNODES: case TCLDOM_NODE_FIRSTCHILD: case TCLDOM_NODE_LASTCHILD: case TCLDOM_NODE_PREVIOUSSIBLING: case TCLDOM_NODE_NEXTSIBLING: case TCLDOM_NODE_ATTRIBUTES: case TCLDOM_NODE_NAMESPACEURI: case TCLDOM_NODE_PREFIX: case TCLDOM_NODE_LOCALNAME: case TCLDOM_NODE_OWNERDOCUMENT: case TCLDOM_NODE_ID: Tcl_ResetResult(interp); Tcl_AppendResult(interp, "attribute \"", Tcl_GetStringFromObj(objv[0], NULL), "\" is read-only", NULL); return TCL_ERROR; case TCLDOM_NODE_NODEVALUE: if (!nodePtr) { Tcl_ResetResult(interp); return TCL_OK; } switch (nodePtr->type) { case XML_ELEMENT_NODE: case XML_DOCUMENT_NODE: case XML_DOCUMENT_FRAG_NODE: case XML_DOCUMENT_TYPE_NODE: case XML_ENTITY_NODE: case XML_ENTITY_REF_NODE: case XML_NOTATION_NODE: case XML_HTML_DOCUMENT_NODE: case XML_DTD_NODE: case XML_ELEMENT_DECL: case XML_ATTRIBUTE_DECL: case XML_ENTITY_DECL: case XML_NAMESPACE_DECL: case XML_XINCLUDE_START: case XML_XINCLUDE_END: /* * DOM defines these nodes as not having a node value. * libxml2 clobbers existing content if the value is set, * so don't do it! */ Tcl_ResetResult(interp); return TCL_OK; default: /* fall-through */ break; } if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } Tcl_MutexLock(&libxml2); objPtr = Tcl_NewStringObj((CONST char *) xmlNodeGetContent(nodePtr), -1); buf = Tcl_GetStringFromObj(objv[1], &len); xmlNodeSetContentLen(nodePtr, (const xmlChar *) buf, len); Tcl_MutexUnlock(&libxml2); TclDOM_PostMutationEvent(interp, tDocPtr, TclDOM_libxml2_CreateObjFromNode(interp, nodePtr), TCLDOM_EVENT_DOMCHARACTERDATAMODIFIED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), NULL, objPtr, objv[1], NULL, NULL); Tcl_DecrRefCount(objPtr); break; case TCLDOM_NODE_CDATASECTION: break; } objc -= 2; objv += 2; } return TCL_OK; } int TclDOM_NodeAppendChild(interp, nodePtr, childPtr) Tcl_Interp *interp; xmlNodePtr nodePtr; xmlNodePtr childPtr; { TclXML_libxml2_Document *tDocPtr; xmlNodePtr oldParent; xmlNodePtr oldSibling; if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } oldParent = childPtr->parent; oldSibling = childPtr->next; if (oldParent && oldParent != nodePtr) { TclDOM_PostMutationEvent(interp, tDocPtr, TclDOM_libxml2_CreateObjFromNode(interp, childPtr), TCLDOM_EVENT_DOMNODEREMOVED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), TclDOM_libxml2_CreateObjFromNode(interp, oldParent), NULL, NULL, NULL, NULL); } Tcl_MutexLock(&libxml2); /* Although xmlAddChild claims to release the child from its previous context, * that doesn't appear to actually happen. */ xmlUnlinkNode(childPtr); if (xmlAddChild(nodePtr, childPtr) == NULL) { if (oldSibling) { xmlAddPrevSibling(oldSibling, childPtr); } else { xmlAddChild(oldParent, childPtr); } Tcl_SetResult(interp, "unable to insert node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } Tcl_MutexUnlock(&libxml2); PostMutationEvents(interp, tDocPtr, nodePtr, childPtr, childPtr, oldParent, childPtr->parent); Tcl_SetObjResult(interp, TclDOM_libxml2_CreateObjFromNode(interp, childPtr)); return TCL_OK; } int TclDOM_NodeInsertBefore(interp, refPtr, newPtr) Tcl_Interp *interp; xmlNodePtr refPtr; xmlNodePtr newPtr; { TclXML_libxml2_Document *tDocPtr; xmlNodePtr oldParent; if (TclXML_libxml2_GetTclDocFromNode(interp, refPtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } oldParent = newPtr->parent; if (oldParent != refPtr->parent) { TclDOM_PostMutationEvent(interp, tDocPtr, TclDOM_libxml2_CreateObjFromNode(interp, refPtr), TCLDOM_EVENT_DOMNODEREMOVED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), TclDOM_libxml2_CreateObjFromNode(interp, newPtr->parent), NULL, NULL, NULL, NULL); } Tcl_MutexLock(&libxml2); if (xmlAddPrevSibling(refPtr, newPtr) == NULL) { Tcl_SetResult(interp, "unable to insert node", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } Tcl_MutexUnlock(&libxml2); PostMutationEvents(interp, tDocPtr, refPtr, refPtr, newPtr, oldParent, refPtr->parent); return TCL_OK; } void PostMutationEvents(interp, tDocPtr, nodePtr, refPtr, newPtr, oldParent, newParent) Tcl_Interp *interp; TclXML_libxml2_Document *tDocPtr; xmlNodePtr nodePtr; xmlNodePtr refPtr; xmlNodePtr newPtr; xmlNodePtr oldParent; xmlNodePtr newParent; { /* If parent has changed, notify old parent */ if (oldParent != NULL && oldParent != newParent) { TclDOM_PostMutationEvent(interp, tDocPtr, TclDOM_libxml2_CreateObjFromNode(interp, oldParent), TCLDOM_EVENT_DOMSUBTREEMODIFIED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), NULL, NULL, NULL, NULL, NULL); } /* Notify new parent */ if (newParent != NULL) { TclDOM_PostMutationEvent(interp, tDocPtr, TclDOM_libxml2_CreateObjFromNode(interp, newParent), TCLDOM_EVENT_DOMSUBTREEMODIFIED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), NULL, NULL, NULL, NULL, NULL); } /* Inserted event */ if (newPtr != NULL) { TclDOM_PostMutationEvent(interp, tDocPtr, TclDOM_libxml2_CreateObjFromNode(interp, newPtr), TCLDOM_EVENT_DOMNODEINSERTED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), NULL, NULL, NULL, NULL, NULL); } } /* *---------------------------------------------------------------------------- * * TclDOM_AddEventListener -- * * Register an event listener. * * Results: * Success code. * * Side effects: * Event listener stored. * *---------------------------------------------------------------------------- */ int TclDOM_AddEventListener(interp, tDocPtr, tokenPtr, type, typeObjPtr, listenerPtr, capturer) Tcl_Interp *interp; TclXML_libxml2_Document *tDocPtr; void *tokenPtr; /* xmlNodePtr or xmlDocPtr */ enum TclDOM_EventTypes type; Tcl_Obj *typeObjPtr; Tcl_Obj *listenerPtr; int capturer; { TclDOM_libxml2_Document *domDocPtr; Tcl_HashTable *tablePtr, *listenerTablePtr; Tcl_HashEntry *entryPtr, *listenerEntryPtr; int new; domDocPtr = GetDOMDocument(interp, tDocPtr); if (domDocPtr == NULL) { Tcl_SetResult(interp, "internal error", NULL); return TCL_ERROR; } if (capturer) { tablePtr = domDocPtr->captureListeners; } else { tablePtr = domDocPtr->bubbleListeners; } entryPtr = Tcl_CreateHashEntry(tablePtr, tokenPtr, &new); if (new) { listenerTablePtr = (Tcl_HashTable *) Tcl_Alloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(listenerTablePtr, TCL_STRING_KEYS); Tcl_SetHashValue(entryPtr, (char *) listenerTablePtr); } else { listenerTablePtr = (Tcl_HashTable *) Tcl_GetHashValue(entryPtr); } if (type == TCLDOM_EVENT_USERDEFINED) { listenerEntryPtr = Tcl_CreateHashEntry(listenerTablePtr, Tcl_GetStringFromObj(typeObjPtr, NULL), &new); } else { listenerEntryPtr = Tcl_CreateHashEntry(listenerTablePtr, TclDOM_EventTypes[type], &new); } if (new) { Tcl_Obj *listPtr = Tcl_NewListObj(0, NULL); Tcl_IncrRefCount(listenerPtr); Tcl_IncrRefCount(listPtr); Tcl_ListObjAppendElement(interp, listPtr, listenerPtr); Tcl_SetHashValue(listenerEntryPtr, (char *) listPtr); } else { Tcl_Obj *listPtr = (Tcl_Obj *) Tcl_GetHashValue(listenerEntryPtr); Tcl_Obj *curPtr; int idx, len, listenerLen, len2; char *listenerBuf, *buf2; if (Tcl_ListObjLength(interp, listPtr, &len) != TCL_OK) { Tcl_SetResult(interp, "internal error - bad list", NULL); return TCL_ERROR; } listenerBuf = Tcl_GetStringFromObj(listenerPtr, &listenerLen); /* Don't allow duplicates in the list */ new = 0; for (idx = 0; idx < len; idx++) { Tcl_ListObjIndex(interp, listPtr, idx, &curPtr); buf2 = Tcl_GetStringFromObj(curPtr, &len2); if (listenerLen == len2 && !strncmp(listenerBuf, buf2, listenerLen)) { new = 1; break; } } if (Tcl_ListObjReplace(interp, listPtr, idx, new, 1, &listenerPtr) != TCL_OK) { return TCL_ERROR; } } /* * Performance optimization: * Keep track of which event types have listeners registered. * If there are no listeners for an event type, then there's * no point in dispatching that type of event. * NB. This does not keep track of user-defined events types. */ if (type != TCLDOM_EVENT_USERDEFINED) { domDocPtr->listening[type]++; } /* else this is a user-defined event type - it won't be tracked */ return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclDOM_GetEventListener -- * * Find the listener registered for an event type. * * Results: * Event listener returned. * * Side effects: * None. * *---------------------------------------------------------------------------- */ Tcl_Obj * TclDOM_GetEventListener(interp,tDocPtr, tokenPtr, type, typeObjPtr, capturer) Tcl_Interp *interp; TclXML_libxml2_Document *tDocPtr; void *tokenPtr; enum TclDOM_EventTypes type; Tcl_Obj *typeObjPtr; int capturer; { TclDOM_libxml2_Document *domDocPtr; Tcl_HashTable *tablePtr; Tcl_HashEntry *entryPtr; domDocPtr = GetDOMDocument(interp, tDocPtr); if (domDocPtr == NULL) { Tcl_SetResult(interp, "internal error", NULL); return NULL; } if (capturer) { tablePtr = domDocPtr->captureListeners; } else { tablePtr = domDocPtr->bubbleListeners; } entryPtr = Tcl_FindHashEntry(tablePtr, tokenPtr); if (entryPtr) { tablePtr = (Tcl_HashTable *) Tcl_GetHashValue(entryPtr); if (type == TCLDOM_EVENT_USERDEFINED) { entryPtr = Tcl_FindHashEntry(tablePtr, Tcl_GetStringFromObj(typeObjPtr, NULL)); } else { entryPtr = Tcl_FindHashEntry(tablePtr, TclDOM_EventTypes[type]); } if (entryPtr) { return (Tcl_Obj *) Tcl_GetHashValue(entryPtr); } } return Tcl_NewObj(); } /* *---------------------------------------------------------------------------- * * TclDOM_RemoveEventListener -- * * Deregister an event listener. * * Results: * Success code. * * Side effects: * May free Tcl objects. * *---------------------------------------------------------------------------- */ int TclDOM_RemoveEventListener(interp, tDocPtr, tokenPtr, type, typeObjPtr, listenerPtr, capturer) Tcl_Interp *interp; TclXML_libxml2_Document *tDocPtr; void *tokenPtr; enum TclDOM_EventTypes type; Tcl_Obj *typeObjPtr; Tcl_Obj *listenerPtr; int capturer; { TclDOM_libxml2_Document *domDocPtr; Tcl_HashTable *tablePtr; Tcl_HashEntry *entryPtr; domDocPtr = GetDOMDocument(interp, tDocPtr); if (domDocPtr == NULL) { Tcl_SetResult(interp, "internal error", NULL); return TCL_ERROR; } if (capturer) { tablePtr = domDocPtr->captureListeners; } else { tablePtr = domDocPtr->bubbleListeners; } entryPtr = Tcl_FindHashEntry(tablePtr, tokenPtr); if (entryPtr) { tablePtr = (Tcl_HashTable *) Tcl_GetHashValue(entryPtr); if (type == TCLDOM_EVENT_USERDEFINED) { entryPtr = Tcl_FindHashEntry(tablePtr, Tcl_GetStringFromObj(typeObjPtr, NULL)); } else { entryPtr = Tcl_FindHashEntry(tablePtr, TclDOM_EventTypes[type]); } if (entryPtr) { Tcl_Obj *listPtr = (Tcl_Obj *) Tcl_GetHashValue(entryPtr); Tcl_Obj *curPtr; int idx, listenerLen, len, len2, found; char *listenerBuf, *buf2; if (Tcl_ListObjLength(interp, listPtr, &len) != TCL_OK) { Tcl_SetResult(interp, "internal error - bad list", NULL); return TCL_ERROR; } listenerBuf = Tcl_GetStringFromObj(listenerPtr, &listenerLen); found = 0; for (idx = 0; idx < len; idx++) { Tcl_ListObjIndex(interp, listPtr, idx, &curPtr); buf2 = Tcl_GetStringFromObj(curPtr, &len2); if (listenerLen == len2 && !strncmp(listenerBuf, buf2, listenerLen)) { found = 1; break; } } if (!found) { Tcl_SetResult(interp, "listener not found", NULL); return TCL_ERROR; } else { Tcl_ListObjReplace(interp, listPtr, idx, 1, 0, NULL); /* * Keep track of which event types have listeners registered. */ if (type != TCLDOM_EVENT_USERDEFINED) { domDocPtr->listening[type]--; } /* else user-defined event type - not being tracked */ } } else { Tcl_SetResult(interp, "no listeners registered", NULL); return TCL_ERROR; } } else { Tcl_SetResult(interp, "no listeners registered", NULL); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * HasListener -- * * Check whether an event listener is registered for an event type. * * Results: * Returns boolean. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int HasListener(interp, tDocPtr, eventType) Tcl_Interp *interp; TclXML_libxml2_Document *tDocPtr; enum TclDOM_EventTypes eventType; { TclDOM_libxml2_Document *domDocPtr = GetDOMDocument(interp, tDocPtr); if (domDocPtr == NULL) { return 0; } if (eventType == TCLDOM_EVENT_USERDEFINED) { /* * We don't know whether there is a listener or not, * so play it safe. */ return 1; } if (domDocPtr->listening[eventType] > 0) { return 1; } return 0; } /* *---------------------------------------------------------------------------- * * TclDOM_DispatchEvent -- * * Dispatch an event object. * * Results: * Event propagates through the DOM tree. * * Side effects: * Depends on event listeners. * *---------------------------------------------------------------------------- */ int TclDOM_DispatchEvent(interp, nodeObjPtr, eventObjPtr, eventPtr) Tcl_Interp *interp; Tcl_Obj *nodeObjPtr; Tcl_Obj *eventObjPtr; TclDOM_libxml2_Event *eventPtr; { xmlNodePtr nodePtr; xmlDocPtr docPtr; TclXML_libxml2_Document *tDocPtr; TclDOM_libxml2_Document *domDocPtr; char *phase; Tcl_Obj *docObjPtr, *pathPtr = NULL; int idx, len, cancelable; void *tokenPtr; if (TclDOM_libxml2_GetNodeFromObj(interp, nodeObjPtr, &nodePtr) != TCL_OK) { if (TclXML_libxml2_GetTclDocFromObj(interp, nodeObjPtr, &tDocPtr) != TCL_OK) { Tcl_SetResult(interp, "unrecognised token", NULL); return TCL_ERROR; } else { docObjPtr = nodeObjPtr; docPtr = tDocPtr->docPtr; nodeObjPtr = NULL; nodePtr = NULL; tokenPtr = (void *) docPtr; } } else { docPtr = nodePtr->doc; docObjPtr = TclXML_libxml2_CreateObjFromDoc(docPtr); if (TclXML_libxml2_GetTclDocFromObj(interp, docObjPtr, &tDocPtr) != TCL_OK) { Tcl_SetResult(interp, "unknown document", NULL); return TCL_ERROR; } tokenPtr = (void *) nodePtr; } Tcl_ResetResult(interp); /* * Performance optimization: * If there are no listeners registered for this event type, * then there is no point in propagating the event. */ if (!HasListener(interp, tDocPtr, eventPtr->type)) { return TCL_OK; } domDocPtr = GetDOMDocument(interp, tDocPtr); if (domDocPtr == NULL) { Tcl_SetResult(interp, "internal error", NULL); return TCL_ERROR; } phase = Tcl_GetStringFromObj(eventPtr->eventPhase, &len); if (!len) { /* * This is the initial dispatch of the event. * First trigger any capturing event listeners * Starting from the root, proceed downward */ Tcl_SetStringObj(eventPtr->eventPhase, "capturing_phase", -1); eventPtr->target = nodeObjPtr; Tcl_IncrRefCount(nodeObjPtr); if (nodePtr) { pathPtr = GetPath(interp, nodePtr); } else { pathPtr = Tcl_NewObj(); } if (eventPtr->currentNode) { Tcl_DecrRefCount(eventPtr->currentNode); } eventPtr->currentNode = docObjPtr; Tcl_IncrRefCount(docObjPtr); if (TriggerEventListeners(interp, domDocPtr->captureListeners, (void *) docPtr, eventObjPtr, eventPtr) != TCL_OK) { Tcl_DecrRefCount(pathPtr); return TCL_ERROR; } if (Tcl_GetBooleanFromObj(interp, eventPtr->cancelable, &cancelable) != TCL_OK) { Tcl_DecrRefCount(pathPtr); return TCL_ERROR; } if (cancelable && eventPtr->stopPropagation) { goto stop_propagation; } Tcl_ListObjLength(interp, pathPtr, &len); Tcl_ListObjReplace(interp, pathPtr, len - 1, 1, 0, NULL); Tcl_ListObjReplace(interp, pathPtr, 0, 1, 0, NULL); Tcl_ListObjLength(interp, pathPtr, &len); for (idx = 0; idx < len; idx++) { Tcl_Obj *ancestorObjPtr; xmlNodePtr ancestorPtr; Tcl_ListObjIndex(interp, pathPtr, idx, &ancestorObjPtr); if (eventPtr->currentNode) { Tcl_DecrRefCount(eventPtr->currentNode); } eventPtr->currentNode = ancestorObjPtr; Tcl_IncrRefCount(ancestorObjPtr); if (TclDOM_libxml2_GetNodeFromObj(interp, ancestorObjPtr, &ancestorPtr) != TCL_OK) { Tcl_SetResult(interp, "cannot find ancestor node \"", NULL); Tcl_AppendResult(interp, Tcl_GetStringFromObj(ancestorObjPtr, NULL), "\"", NULL); return TCL_ERROR; } if (TriggerEventListeners(interp, domDocPtr->captureListeners, (void *) ancestorPtr, eventObjPtr, eventPtr) != TCL_OK) { return TCL_ERROR; } /* * A listener may stop propagation, * but we check here to let all of the * listeners at that level complete. */ if (Tcl_GetBooleanFromObj(interp, eventPtr->cancelable, &cancelable) != TCL_OK) { Tcl_DecrRefCount(ancestorObjPtr); return TCL_ERROR; } if (cancelable && eventPtr->stopPropagation) { Tcl_DecrRefCount(ancestorObjPtr); goto stop_propagation; } Tcl_DecrRefCount(ancestorObjPtr); } /* Prepare for the next phase */ if (Tcl_IsShared(eventPtr->eventPhase)) { Tcl_DecrRefCount(eventPtr->eventPhase); eventPtr->eventPhase = Tcl_NewStringObj("at_target", -1); Tcl_IncrRefCount(eventPtr->eventPhase); } else { Tcl_SetStringObj(eventPtr->eventPhase, "at_target", -1); } } if (eventPtr->currentNode) { Tcl_DecrRefCount(eventPtr->currentNode); } if (nodePtr) { eventPtr->currentNode = nodeObjPtr; tokenPtr = (void *) nodePtr; } else { eventPtr->currentNode = docObjPtr; tokenPtr = (void *) docPtr; } Tcl_IncrRefCount(eventPtr->currentNode); if (TriggerEventListeners(interp, domDocPtr->bubbleListeners, tokenPtr, eventObjPtr, eventPtr) != TCL_OK) { return TCL_ERROR; } if (Tcl_IsShared(eventPtr->eventPhase)) { Tcl_DecrRefCount(eventPtr->eventPhase); eventPtr->eventPhase = Tcl_NewStringObj("bubbling_phase", -1); Tcl_IncrRefCount(eventPtr->eventPhase); } else { Tcl_SetStringObj(eventPtr->eventPhase, "bubbling_phase", -1); } if (Tcl_GetBooleanFromObj(interp, eventPtr->cancelable, &cancelable) != TCL_OK) { return TCL_ERROR; } if (cancelable && eventPtr->stopPropagation) { /* Do no more */ } else if (nodePtr && nodePtr->parent && nodePtr->parent != (xmlNodePtr) nodePtr->doc) { Tcl_Obj *objPtr; objPtr = TclDOM_libxml2_CreateObjFromNode(interp, nodePtr->parent); if (objPtr == NULL) { return TCL_ERROR; } return TclDOM_DispatchEvent(interp, objPtr, eventObjPtr, eventPtr); } else if (nodePtr && nodePtr->parent) { Tcl_Obj *objPtr; objPtr = TclXML_libxml2_CreateObjFromDoc(nodePtr->doc); if (objPtr == NULL) { return TCL_ERROR; } return TclDOM_DispatchEvent(interp, objPtr, eventObjPtr, eventPtr); } stop_propagation: eventPtr->dispatched = 1; if (pathPtr) { Tcl_DecrRefCount(pathPtr); } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclDOMElementCommand -- * * Implements dom::libxml2::element command. * * Results: * Depends on method. * * Side effects: * Depends on method. * *---------------------------------------------------------------------------- */ int TclDOMElementCommand (clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { int method, optobjc; Tcl_Obj *CONST *optobjv; xmlNodePtr nodePtr; TclXML_libxml2_Document *tDocPtr; char *value; xmlAttrPtr attrPtr; xmlNsPtr nsPtr; if (clientData == NULL) { if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "method ?args...?"); return TCL_ERROR; } if (TclDOM_libxml2_GetNodeFromObj(interp, objv[2], &nodePtr) != TCL_OK) { return TCL_ERROR; } optobjv = objv + 3; optobjc = objc - 3; } else { nodePtr = (xmlNodePtr) clientData; optobjv = objv + 2; optobjc = objc - 2; } if (Tcl_GetIndexFromObj(interp, objv[1], TclDOM_ElementCommandMethods, "method", 0, &method) != TCL_OK) { return TCL_ERROR; } /* Should check that the node is of element type */ Tcl_ResetResult(interp); switch ((enum TclDOM_ElementCommandMethods) method) { case TCLDOM_ELEMENT_CGET: if (optobjc != 1) { Tcl_WrongNumArgs(interp, 1, objv, "option"); return TCL_ERROR; } return ElementCget(interp, nodePtr, optobjv[0]); break; case TCLDOM_ELEMENT_CONFIGURE: if (optobjc == 1) { return ElementCget(interp, nodePtr, optobjv[0]); } else { Tcl_AppendResult(interp, "option \"", Tcl_GetStringFromObj(optobjv[0], NULL), "\" cannot be modified", NULL); return TCL_ERROR; } break; case TCLDOM_ELEMENT_GETATTRIBUTE: if (optobjc != 1) { Tcl_WrongNumArgs(interp, 1, objv, "attr"); return TCL_ERROR; } Tcl_MutexLock(&libxml2); value = (char *) xmlGetProp(nodePtr, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL)); Tcl_MutexUnlock(&libxml2); if (value) { Tcl_SetObjResult(interp, Tcl_NewStringObj(value, -1)); } break; case TCLDOM_ELEMENT_GETATTRIBUTENS: if (optobjc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "ns attr"); return TCL_ERROR; } Tcl_MutexLock(&libxml2); value = (char *) xmlGetNsProp(nodePtr, (const xmlChar *) Tcl_GetStringFromObj(optobjv[1], NULL), (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL)); Tcl_MutexUnlock(&libxml2); if (value) { Tcl_SetObjResult(interp, Tcl_NewStringObj(value, -1)); } break; case TCLDOM_ELEMENT_SETATTRIBUTE: if (optobjc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "attr value"); return TCL_ERROR; } if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } Tcl_MutexLock(&libxml2); value = (char *) xmlGetProp(nodePtr, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL)); attrPtr = xmlSetProp(nodePtr, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL), (const xmlChar *) Tcl_GetStringFromObj(optobjv[1], NULL)); Tcl_MutexUnlock(&libxml2); if (!attrPtr) { Tcl_SetResult(interp, "unable to set attribute", NULL); return TCL_ERROR; } TclDOM_PostMutationEvent(interp, tDocPtr, objv[2], TCLDOM_EVENT_DOMATTRMODIFIED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), NULL, Tcl_NewStringObj(value, -1), optobjv[1], optobjv[0], value == NULL? Tcl_NewStringObj("modification", -1) : Tcl_NewStringObj("addition", -1)); Tcl_SetObjResult(interp, optobjv[1]); break; case TCLDOM_ELEMENT_SETATTRIBUTENS: if (optobjc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "ns attr value"); return TCL_ERROR; } if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } Tcl_MutexLock(&libxml2); nsPtr = xmlSearchNsByHref(nodePtr->doc, nodePtr, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL)); if (!nsPtr) { Tcl_SetResult(interp, "no XML Namespace declaration for namespace", NULL); Tcl_MutexUnlock(&libxml2); return TCL_ERROR; } value = (char *) xmlGetNsProp(nodePtr, (const xmlChar *) Tcl_GetStringFromObj(optobjv[1], NULL), (const xmlChar *) Tcl_GetStringFromObj(optobjv[2], NULL)); attrPtr = xmlSetNsProp(nodePtr, nsPtr, (const xmlChar *) Tcl_GetStringFromObj(optobjv[1], NULL), (const xmlChar *) Tcl_GetStringFromObj(optobjv[3], NULL)); Tcl_MutexUnlock(&libxml2); if (!attrPtr) { Tcl_SetResult(interp, "unable to set attribute", NULL); return TCL_ERROR; } TclDOM_PostMutationEvent(interp, tDocPtr, objv[2], TCLDOM_EVENT_DOMATTRMODIFIED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), NULL, Tcl_NewStringObj(value, -1), optobjv[3], optobjv[2], value == NULL? Tcl_NewStringObj("modification", -1) : Tcl_NewStringObj("addition", -1)); break; case TCLDOM_ELEMENT_REMOVEATTRIBUTE: if (optobjc != 1) { Tcl_WrongNumArgs(interp, 1, objv, "attr"); return TCL_ERROR; } if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } /* It doesn't matter if this fails due to a non-existant attribute */ Tcl_MutexLock(&libxml2); xmlUnsetProp(nodePtr, (const xmlChar *) Tcl_GetStringFromObj(optobjv[0], NULL)); Tcl_MutexUnlock(&libxml2); TclDOM_PostMutationEvent(interp, tDocPtr, objv[2], TCLDOM_EVENT_DOMATTRMODIFIED, NULL, Tcl_NewIntObj(1), Tcl_NewIntObj(0), NULL, NULL, NULL, optobjv[2], Tcl_NewStringObj("removed", -1)); break; default: Tcl_SetResult(interp, "method \"", NULL); Tcl_AppendResult(interp, Tcl_GetStringFromObj(objv[1], NULL), "\" not yet implemented", NULL); return TCL_ERROR; } return TCL_OK; } int ElementCget(interp, nodePtr, optObj) Tcl_Interp *interp; xmlNodePtr nodePtr; Tcl_Obj *CONST optObj; { int option; if (Tcl_GetIndexFromObj(interp, optObj, TclDOM_ElementCommandOptions, "option", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_ElementCommandOptions) option) { case TCLDOM_ELEMENT_TAGNAME: Tcl_SetObjResult(interp, Tcl_NewStringObj((CONST char *) nodePtr->name, -1)); break; case TCLDOM_ELEMENT_EMPTY: Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0)); break; default: Tcl_SetResult(interp, "unknown option", NULL); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclDOM_InitEvent -- * * Initializes an event object. * * Results: * Tcl_Obj references stored. * * Side effects: * Tcl_Obj's reference count changed. * *---------------------------------------------------------------------------- */ void TclDOM_InitEvent(eventPtr, type, typeObjPtr, bubblesPtr, cancelablePtr) TclDOM_libxml2_Event *eventPtr; enum TclDOM_EventTypes type; Tcl_Obj *typeObjPtr; Tcl_Obj *bubblesPtr; Tcl_Obj *cancelablePtr; { if (type != TCLDOM_EVENT_USERDEFINED) { if (eventPtr->type != type) { if (eventPtr->typeObjPtr) { Tcl_DecrRefCount(eventPtr->typeObjPtr); eventPtr->typeObjPtr = NULL; } eventPtr->type = type; } } else { char *oldType, *newType; int oldLen, newLen; oldType = Tcl_GetStringFromObj(eventPtr->typeObjPtr, &oldLen); newType = Tcl_GetStringFromObj(typeObjPtr, &newLen); if (oldLen != newLen || strncmp(oldType, newType, oldLen)) { Tcl_DecrRefCount(eventPtr->typeObjPtr); eventPtr->typeObjPtr = typeObjPtr; Tcl_IncrRefCount(typeObjPtr); eventPtr->type = TCLDOM_EVENT_USERDEFINED; } } if (bubblesPtr && eventPtr->bubbles != bubblesPtr) { Tcl_DecrRefCount(eventPtr->bubbles); eventPtr->bubbles = bubblesPtr; Tcl_IncrRefCount(eventPtr->bubbles); } if (cancelablePtr && eventPtr->cancelable != cancelablePtr) { Tcl_DecrRefCount(eventPtr->cancelable); eventPtr->cancelable = cancelablePtr; Tcl_IncrRefCount(eventPtr->cancelable); } } /* *---------------------------------------------------------------------------- * * TclDOM_InitUIEvent -- * * Initializes an event object. * * Results: * Tcl_Obj references stored. * * Side effects: * Tcl_Obj's reference count changed. * *---------------------------------------------------------------------------- */ void TclDOM_InitUIEvent(eventPtr, type, typeObjPtr, bubblesPtr, cancelablePtr, viewPtr, detailPtr) TclDOM_libxml2_Event *eventPtr; enum TclDOM_EventTypes type; Tcl_Obj *typeObjPtr; Tcl_Obj *bubblesPtr; Tcl_Obj *cancelablePtr; Tcl_Obj *viewPtr; Tcl_Obj *detailPtr; { TclDOM_InitEvent(eventPtr, type, typeObjPtr, bubblesPtr, cancelablePtr); if (viewPtr && eventPtr->view != viewPtr) { Tcl_DecrRefCount(eventPtr->view); eventPtr->view = viewPtr; Tcl_IncrRefCount(eventPtr->view); } if (detailPtr && eventPtr->detail != detailPtr) { Tcl_DecrRefCount(eventPtr->detail); eventPtr->detail = detailPtr; Tcl_IncrRefCount(eventPtr->detail); } else if (detailPtr == NULL) { Tcl_DecrRefCount(eventPtr->detail); eventPtr->detail = Tcl_NewObj(); } } /* *---------------------------------------------------------------------------- * * TclDOM_InitMouseEvent -- * * Initializes an event object. * * Results: * Tcl_Obj references stored. * * Side effects: * Tcl_Obj's reference count changed. * *---------------------------------------------------------------------------- */ void TclDOM_InitMouseEvent(eventPtr, type, typeObjPtr, bubblesPtr, cancelablePtr, viewPtr, detailPtr, screenXPtr, screenYPtr, clientXPtr, clientYPtr, ctrlKeyPtr, altKeyPtr, shiftKeyPtr, metaKeyPtr, buttonPtr, relatedNodePtr) TclDOM_libxml2_Event *eventPtr; enum TclDOM_EventTypes type; Tcl_Obj *typeObjPtr; Tcl_Obj *bubblesPtr; Tcl_Obj *cancelablePtr; Tcl_Obj *viewPtr; Tcl_Obj *detailPtr; Tcl_Obj *screenXPtr; Tcl_Obj *screenYPtr; Tcl_Obj *clientXPtr; Tcl_Obj *clientYPtr; Tcl_Obj *ctrlKeyPtr; Tcl_Obj *altKeyPtr; Tcl_Obj *shiftKeyPtr; Tcl_Obj *metaKeyPtr; Tcl_Obj *buttonPtr; Tcl_Obj *relatedNodePtr; { TclDOM_InitUIEvent(eventPtr, type, typeObjPtr, bubblesPtr, cancelablePtr, viewPtr, detailPtr); if (screenXPtr && eventPtr->screenX != screenXPtr) { Tcl_DecrRefCount(eventPtr->screenX); eventPtr->screenX = screenXPtr; Tcl_IncrRefCount(eventPtr->screenX); } if (screenYPtr && eventPtr->screenY != screenYPtr) { Tcl_DecrRefCount(eventPtr->screenY); eventPtr->screenY = screenYPtr; Tcl_IncrRefCount(eventPtr->screenY); } if (clientXPtr && eventPtr->clientX != clientXPtr) { Tcl_DecrRefCount(eventPtr->clientX); eventPtr->clientX = clientXPtr; Tcl_IncrRefCount(eventPtr->clientX); } if (clientYPtr && eventPtr->clientY != clientYPtr) { Tcl_DecrRefCount(eventPtr->clientY); eventPtr->clientY = clientYPtr; Tcl_IncrRefCount(eventPtr->clientY); } if (ctrlKeyPtr && eventPtr->ctrlKey != ctrlKeyPtr) { Tcl_DecrRefCount(eventPtr->ctrlKey); eventPtr->ctrlKey = ctrlKeyPtr; Tcl_IncrRefCount(eventPtr->ctrlKey); } if (altKeyPtr && eventPtr->altKey != altKeyPtr) { Tcl_DecrRefCount(eventPtr->altKey); eventPtr->altKey = altKeyPtr; Tcl_IncrRefCount(eventPtr->altKey); } if (shiftKeyPtr && eventPtr->shiftKey != shiftKeyPtr) { Tcl_DecrRefCount(eventPtr->shiftKey); eventPtr->shiftKey = shiftKeyPtr; Tcl_IncrRefCount(eventPtr->shiftKey); } if (metaKeyPtr && eventPtr->metaKey != metaKeyPtr) { Tcl_DecrRefCount(eventPtr->metaKey); eventPtr->metaKey = metaKeyPtr; Tcl_IncrRefCount(eventPtr->metaKey); } if (buttonPtr && eventPtr->button != buttonPtr) { Tcl_DecrRefCount(eventPtr->button); eventPtr->button = buttonPtr; Tcl_IncrRefCount(eventPtr->button); } if (relatedNodePtr && eventPtr->relatedNode != relatedNodePtr) { Tcl_DecrRefCount(eventPtr->relatedNode); eventPtr->relatedNode = relatedNodePtr; Tcl_IncrRefCount(eventPtr->relatedNode); } } /* *---------------------------------------------------------------------------- * * TclDOM_InitMutationEvent -- * * Initializes an event object. * * Results: * Tcl_Obj references stored. * * Side effects: * Tcl_Obj's reference count changed. * *---------------------------------------------------------------------------- */ void TclDOM_InitMutationEvent(eventPtr, type, typeObjPtr, bubblesPtr, cancelablePtr, relatedNodePtr, prevValuePtr, newValuePtr, attrNamePtr, attrChangePtr) TclDOM_libxml2_Event *eventPtr; enum TclDOM_EventTypes type; Tcl_Obj *typeObjPtr; Tcl_Obj *bubblesPtr; Tcl_Obj *cancelablePtr; Tcl_Obj *relatedNodePtr; Tcl_Obj *prevValuePtr; Tcl_Obj *newValuePtr; Tcl_Obj *attrNamePtr; Tcl_Obj *attrChangePtr; { TclDOM_InitEvent(eventPtr, type, typeObjPtr, bubblesPtr, cancelablePtr); if (relatedNodePtr && eventPtr->relatedNode != relatedNodePtr) { Tcl_DecrRefCount(eventPtr->relatedNode); eventPtr->relatedNode = relatedNodePtr; Tcl_IncrRefCount(eventPtr->relatedNode); } if (prevValuePtr && eventPtr->prevValue != prevValuePtr) { Tcl_DecrRefCount(eventPtr->prevValue); eventPtr->prevValue = prevValuePtr; Tcl_IncrRefCount(eventPtr->prevValue); } if (newValuePtr && eventPtr->newValue != newValuePtr) { Tcl_DecrRefCount(eventPtr->newValue); eventPtr->newValue = newValuePtr; Tcl_IncrRefCount(eventPtr->newValue); } if (attrNamePtr && eventPtr->attrName != attrNamePtr) { Tcl_DecrRefCount(eventPtr->attrName); eventPtr->attrName = attrNamePtr; Tcl_IncrRefCount(eventPtr->attrName); } if (attrChangePtr && eventPtr->attrChange != attrChangePtr) { Tcl_DecrRefCount(eventPtr->attrChange); eventPtr->attrChange = attrChangePtr; Tcl_IncrRefCount(eventPtr->attrChange); } } /* *---------------------------------------------------------------------------- * * TclDOM_PostUIEvent -- * * Post an event and cleanup afterward. * * Results: * Event created and propagated. * * Side effects: * Depends on event listeners. * *---------------------------------------------------------------------------- */ int TclDOM_PostUIEvent(interp, tDocPtr, nodeObjPtr, type, typeObjPtr, bubblesPtr, cancelablePtr, viewPtr, detailPtr) Tcl_Interp *interp; TclXML_libxml2_Document *tDocPtr; Tcl_Obj *nodeObjPtr; enum TclDOM_EventTypes type; Tcl_Obj *typeObjPtr; Tcl_Obj *bubblesPtr; Tcl_Obj *cancelablePtr; Tcl_Obj *viewPtr; Tcl_Obj *detailPtr; { Tcl_Obj *eventObj; TclDOM_libxml2_Event *eventPtr = NULL; int result; /* * Performance optimisation: if there are no event listeners for this * event type then don't bother creating an event. */ if (!HasListener(interp, tDocPtr, type)) { return TCL_OK; } eventObj = TclDOM_libxml2_NewEventObj(interp, tDocPtr->docPtr, type, typeObjPtr); if (eventObj == NULL) { Tcl_SetResult(interp, "unable to create event", NULL); return TCL_ERROR; } TclDOM_libxml2_GetEventFromObj(interp, eventObj, &eventPtr); TclDOM_InitUIEvent(eventPtr, type, typeObjPtr, bubblesPtr, cancelablePtr, viewPtr, detailPtr); Tcl_ResetResult(interp); result = TclDOM_DispatchEvent(interp, nodeObjPtr, eventObj, eventPtr); TclDOM_libxml2_DestroyNode(interp, eventPtr->tNodePtr); return result; } /* *---------------------------------------------------------------------------- * * TclDOM_PostMouseEvent -- * * Post an event and cleanup afterward. * * Results: * Event created and propagated. * * Side effects: * Depends on event listeners. * *---------------------------------------------------------------------------- */ int TclDOM_PostMouseEvent(interp, tDocPtr, nodeObjPtr, type, typeObjPtr, bubblesPtr, cancelablePtr, relatedNodePtr, viewPtr, detailPtr, screenXPtr, screenYPtr, clientXPtr, clientYPtr, ctrlKeyPtr, altKeyPtr, shiftKeyPtr, metaKeyPtr, buttonPtr) Tcl_Interp *interp; TclXML_libxml2_Document *tDocPtr; Tcl_Obj *nodeObjPtr; enum TclDOM_EventTypes type; Tcl_Obj *typeObjPtr; Tcl_Obj *bubblesPtr; Tcl_Obj *cancelablePtr; Tcl_Obj *relatedNodePtr; Tcl_Obj *viewPtr; Tcl_Obj *detailPtr; Tcl_Obj *screenXPtr; Tcl_Obj *screenYPtr; Tcl_Obj *clientXPtr; Tcl_Obj *clientYPtr; Tcl_Obj *ctrlKeyPtr; Tcl_Obj *altKeyPtr; Tcl_Obj *shiftKeyPtr; Tcl_Obj *metaKeyPtr; Tcl_Obj *buttonPtr; { Tcl_Obj *eventObj; TclDOM_libxml2_Event *eventPtr = NULL; int result; /* * Performance optimisation: if there are no event listeners for this * event type then don't bother creating an event. */ if (!HasListener(interp, tDocPtr, type)) { return TCL_OK; } eventObj = TclDOM_libxml2_NewEventObj(interp, tDocPtr->docPtr, type, typeObjPtr); if (eventObj == NULL) { Tcl_SetResult(interp, "unable to create event", NULL); return TCL_ERROR; } TclDOM_libxml2_GetEventFromObj(interp, eventObj, &eventPtr); TclDOM_InitMouseEvent(eventPtr, type, typeObjPtr, bubblesPtr, cancelablePtr, viewPtr, detailPtr, screenXPtr, screenYPtr, clientXPtr, clientYPtr, ctrlKeyPtr, altKeyPtr, shiftKeyPtr, metaKeyPtr, buttonPtr, relatedNodePtr); Tcl_ResetResult(interp); result = TclDOM_DispatchEvent(interp, nodeObjPtr, eventObj, eventPtr); TclDOM_libxml2_DestroyNode(interp, eventPtr->tNodePtr); return result; } /* *---------------------------------------------------------------------------- * * TclDOM_PostMutationEvent -- * * Post an event and cleanup afterward. * * Results: * Event created and propagated. * * Side effects: * Depends on event listeners. * *---------------------------------------------------------------------------- */ int TclDOM_PostMutationEvent(interp, tDocPtr, nodeObjPtr, type, typeObjPtr, bubblesPtr, cancelablePtr, relatedNodePtr, prevValuePtr, newValuePtr, attrNamePtr, attrChangePtr) Tcl_Interp *interp; TclXML_libxml2_Document *tDocPtr; Tcl_Obj *nodeObjPtr; enum TclDOM_EventTypes type; Tcl_Obj *typeObjPtr; Tcl_Obj *bubblesPtr; Tcl_Obj *cancelablePtr; Tcl_Obj *relatedNodePtr; Tcl_Obj *prevValuePtr; Tcl_Obj *newValuePtr; Tcl_Obj *attrNamePtr; Tcl_Obj *attrChangePtr; { Tcl_Obj *eventObj; TclDOM_libxml2_Event *eventPtr = NULL; int result; /* * Performance optimisation: if there are no event listeners for this * event type then don't bother creating an event. */ if (!HasListener(interp, tDocPtr, type)) { return TCL_OK; } eventObj = TclDOM_libxml2_NewEventObj(interp, tDocPtr->docPtr, type, typeObjPtr); if (eventObj == NULL) { Tcl_SetResult(interp, "unable to create event", NULL); return TCL_ERROR; } TclDOM_libxml2_GetEventFromObj(interp, eventObj, &eventPtr); TclDOM_InitMutationEvent(eventPtr, type, typeObjPtr, bubblesPtr, cancelablePtr, relatedNodePtr, prevValuePtr, newValuePtr, attrNamePtr, attrChangePtr); Tcl_ResetResult(interp); result = TclDOM_DispatchEvent(interp, nodeObjPtr, eventObj, eventPtr); TclDOM_libxml2_DestroyNode(interp, eventPtr->tNodePtr); return result; } /* *---------------------------------------------------------------------------- * * TclDOMEventCommand -- * * Implements dom::libxml2::event command. * * Results: * Depends on method. * * Side effects: * Depends on method. * *---------------------------------------------------------------------------- */ int TclDOMEventCommand (clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { int method, option; TclXML_libxml2_Document *tDocPtr; TclDOM_libxml2_Node *tNodePtr; TclDOM_libxml2_Event *eventPtr; xmlNodePtr nodePtr; enum TclDOM_EventTypes type; Tcl_Obj *typeObjPtr = NULL; Tcl_Obj *nodeObj; Tcl_Obj *bubblesPtr, *cancelablePtr, *viewPtr, *detailPtr; Tcl_Obj *relatedNodePtr, *screenXPtr, *screenYPtr, *clientXPtr, *clientYPtr; Tcl_Obj *ctrlKeyPtr, *shiftKeyPtr, *metaKeyPtr, *buttonPtr; Tcl_Obj *prevValuePtr, *newValuePtr, *attrNamePtr, *attrChangePtr; if (objc < 2) { if (clientData == NULL) { Tcl_WrongNumArgs(interp, 1, objv, "method token ?args...?"); } else { Tcl_WrongNumArgs(interp, 1, objv, "method ?args...?"); } return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], TclDOM_EventCommandMethods, "method", 0, &method) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_EventCommandMethods) method) { case TCLDOM_EVENT_CGET: if (clientData) { if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "cget option"); return TCL_ERROR; } tNodePtr = (TclDOM_libxml2_Node *) clientData; if (tNodePtr->type != TCLDOM_LIBXML2_NODE_EVENT) { Tcl_SetResult(interp, "bad event node", NULL); return TCL_ERROR; } eventPtr = tNodePtr->ptr.eventPtr; objc -= 2; objv += 2; } else { if (objc != 4) { Tcl_WrongNumArgs(interp, 3, objv, "cget event option"); return TCL_ERROR; } if (TclDOM_libxml2_GetEventFromObj(interp, objv[2], &eventPtr) != TCL_OK) { return TCL_ERROR; } objc -= 3; objv += 3; } if (Tcl_GetIndexFromObj(interp, objv[0], TclDOM_EventCommandOptions, "option", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum TclDOM_EventCommandOptions) option) { case TCLDOM_EVENT_ALTKEY: Tcl_SetObjResult(interp, eventPtr->altKey); break; case TCLDOM_EVENT_ATTRNAME: Tcl_SetObjResult(interp, eventPtr->attrName); break; case TCLDOM_EVENT_ATTRCHANGE: Tcl_SetObjResult(interp, eventPtr->attrChange); break; case TCLDOM_EVENT_BUBBLES: Tcl_SetObjResult(interp, eventPtr->bubbles); break; case TCLDOM_EVENT_BUTTON: Tcl_SetObjResult(interp, eventPtr->button); break; case TCLDOM_EVENT_CANCELABLE: Tcl_SetObjResult(interp, eventPtr->cancelable); break; case TCLDOM_EVENT_CLIENTX: Tcl_SetObjResult(interp, eventPtr->clientX); break; case TCLDOM_EVENT_CLIENTY: Tcl_SetObjResult(interp, eventPtr->clientY); break; case TCLDOM_EVENT_CTRLKEY: Tcl_SetObjResult(interp, eventPtr->ctrlKey); break; case TCLDOM_EVENT_CURRENTNODE: Tcl_SetObjResult(interp, eventPtr->currentNode); break; case TCLDOM_EVENT_DETAIL: Tcl_SetObjResult(interp, eventPtr->detail); break; case TCLDOM_EVENT_EVENTPHASE: Tcl_SetObjResult(interp, eventPtr->eventPhase); break; case TCLDOM_EVENT_METAKEY: Tcl_SetObjResult(interp, eventPtr->metaKey); break; case TCLDOM_EVENT_NEWVALUE: Tcl_SetObjResult(interp, eventPtr->newValue); break; case TCLDOM_EVENT_PREVVALUE: Tcl_SetObjResult(interp, eventPtr->prevValue); break; case TCLDOM_EVENT_RELATEDNODE: Tcl_SetObjResult(interp, eventPtr->relatedNode); break; case TCLDOM_EVENT_SCREENX: Tcl_SetObjResult(interp, eventPtr->screenX); break; case TCLDOM_EVENT_SCREENY: Tcl_SetObjResult(interp, eventPtr->screenY); break; case TCLDOM_EVENT_SHIFTKEY: Tcl_SetObjResult(interp, eventPtr->shiftKey); break; case TCLDOM_EVENT_TARGET: Tcl_SetObjResult(interp, eventPtr->target); break; case TCLDOM_EVENT_TIMESTAMP: Tcl_SetObjResult(interp, eventPtr->timeStamp); break; case TCLDOM_EVENT_TYPE: if (eventPtr->type == TCLDOM_EVENT_USERDEFINED) { Tcl_SetObjResult(interp, eventPtr->typeObjPtr); } else { Tcl_SetObjResult(interp, Tcl_NewStringObj(TclDOM_EventTypes[eventPtr->type], -1)); } break; case TCLDOM_EVENT_VIEW: Tcl_SetObjResult(interp, eventPtr->view); break; default: Tcl_SetResult(interp, "unknown option", NULL); return TCL_ERROR; } break; case TCLDOM_EVENT_CONFIGURE: if (objc < 2) { Tcl_WrongNumArgs(interp, 3, objv, "configure option ?value?"); return TCL_ERROR; } /* No event options are writable */ Tcl_SetResult(interp, "option cannot be modified", NULL); return TCL_ERROR; break; case TCLDOM_EVENT_STOPPROPAGATION: if (clientData) { if (objc != 2) { Tcl_WrongNumArgs(interp, 2, objv, ""); return TCL_ERROR; } tNodePtr = (TclDOM_libxml2_Node *) clientData; if (tNodePtr->type != TCLDOM_LIBXML2_NODE_EVENT) { Tcl_SetResult(interp, "bad event node", NULL); return TCL_ERROR; } eventPtr = tNodePtr->ptr.eventPtr; } else { if (objc != 3) { Tcl_WrongNumArgs(interp, 3, objv, ""); return TCL_ERROR; } if (TclDOM_libxml2_GetEventFromObj(interp, objv[2], &eventPtr) != TCL_OK) { return TCL_ERROR; } } eventPtr->stopPropagation = 1; break; case TCLDOM_EVENT_PREVENTDEFAULT: if (clientData) { if (objc != 2) { Tcl_WrongNumArgs(interp, 2, objv, ""); return TCL_ERROR; } tNodePtr = (TclDOM_libxml2_Node *) clientData; if (tNodePtr->type != TCLDOM_LIBXML2_NODE_EVENT) { Tcl_SetResult(interp, "bad event node", NULL); return TCL_ERROR; } eventPtr = tNodePtr->ptr.eventPtr; } else { if (objc != 3) { Tcl_WrongNumArgs(interp, 3, objv, ""); return TCL_ERROR; } if (TclDOM_libxml2_GetEventFromObj(interp, objv[2], &eventPtr) != TCL_OK) { return TCL_ERROR; } } eventPtr->preventDefault = 1; break; case TCLDOM_EVENT_INITEVENT: if (clientData) { if (objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "type bubbles cancelable"); return TCL_ERROR; } tNodePtr = (TclDOM_libxml2_Node *) clientData; if (tNodePtr->type != TCLDOM_LIBXML2_NODE_EVENT) { Tcl_SetResult(interp, "bad event node", NULL); return TCL_ERROR; } eventPtr = tNodePtr->ptr.eventPtr; objc -= 2; objv += 2; } else { if (objc != 6) { Tcl_WrongNumArgs(interp, 3, objv, "type bubbles cancelable"); return TCL_ERROR; } if (TclDOM_libxml2_GetEventFromObj(interp, objv[2], &eventPtr) != TCL_OK) { return TCL_ERROR; } objc -= 3; objv += 3; } if (eventPtr->dispatched) { Tcl_SetResult(interp, "event has been dispatched", NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[0], TclDOM_EventTypes, "type", TCL_EXACT, &option) == TCL_OK) { type = (enum TclDOM_EventTypes) option; } else { type = TCLDOM_EVENT_USERDEFINED; } Tcl_ResetResult(interp); TclDOM_InitEvent(eventPtr, type, objv[0], objv[1], objv[2]); break; case TCLDOM_EVENT_INITUIEVENT: if (clientData) { if (objc < 6 || objc > 7) { Tcl_WrongNumArgs(interp, 2, objv, "type bubbles cancelable view ?detail?"); return TCL_ERROR; } tNodePtr = (TclDOM_libxml2_Node *) clientData; if (tNodePtr->type != TCLDOM_LIBXML2_NODE_EVENT) { Tcl_SetResult(interp, "bad event node", NULL); return TCL_ERROR; } eventPtr = tNodePtr->ptr.eventPtr; objc -= 2; objv += 2; } else { if (objc < 7 || objc > 8) { Tcl_WrongNumArgs(interp, 3, objv, "type bubbles cancelable view ?detail?"); return TCL_ERROR; } if (TclDOM_libxml2_GetEventFromObj(interp, objv[2], &eventPtr) != TCL_OK) { return TCL_ERROR; } objc -= 3; objv += 3; } if (eventPtr->dispatched) { Tcl_SetResult(interp, "event has been dispatched", NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[0], TclDOM_EventTypes, "type", TCL_EXACT, &option) == TCL_OK) { type = (enum TclDOM_EventTypes) option; } else { type = TCLDOM_EVENT_USERDEFINED; } Tcl_ResetResult(interp); TclDOM_InitUIEvent(eventPtr, type, objv[0], objv[1], objv[2], objv[3], objc == 5 ? objv[4] : NULL); break; case TCLDOM_EVENT_INITMOUSEEVENT: if (clientData) { if (objc != 17) { Tcl_WrongNumArgs(interp, 2, objv, "type bubbles cancelable view detail screenX screenY clientX clientY ctrlKey altKey shiftKey metaKey button relatedNode"); return TCL_ERROR; } tNodePtr = (TclDOM_libxml2_Node *) clientData; if (tNodePtr->type != TCLDOM_LIBXML2_NODE_EVENT) { Tcl_SetResult(interp, "bad event node", NULL); return TCL_ERROR; } eventPtr = tNodePtr->ptr.eventPtr; objc -= 2; objv += 2; } else { if (objc != 18) { Tcl_WrongNumArgs(interp, 3, objv, "type bubbles cancelable view detail screenX screenY clientX clientY ctrlKey altKey shiftKey metaKey button relatedNode"); return TCL_ERROR; } if (TclDOM_libxml2_GetEventFromObj(interp, objv[2], &eventPtr) != TCL_OK) { return TCL_ERROR; } objc -= 3; objv += 3; } if (eventPtr->dispatched) { Tcl_SetResult(interp, "event has been dispatched", NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[0], TclDOM_EventTypes, "type", TCL_EXACT, &option) == TCL_OK) { type = (enum TclDOM_EventTypes) option; } else { type = TCLDOM_EVENT_USERDEFINED; } Tcl_ResetResult(interp); TclDOM_InitMouseEvent(eventPtr, type, objv[0], objv[1], objv[2], objv[3], objv[4], objv[5], objv[6], objv[7], objv[8], objv[9], objv[10], objv[11], objv[12], objv[13], objv[14]); break; case TCLDOM_EVENT_INITMUTATIONEVENT: if (clientData) { if (objc != 10) { Tcl_WrongNumArgs(interp, 2, objv, "type bubbles cancelable relatedNode prevValue newValue attrName attrChange"); return TCL_ERROR; } tNodePtr = (TclDOM_libxml2_Node *) clientData; if (tNodePtr->type != TCLDOM_LIBXML2_NODE_EVENT) { Tcl_SetResult(interp, "bad event node", NULL); return TCL_ERROR; } eventPtr = tNodePtr->ptr.eventPtr; objc -= 2; objv += 2; } else { if (objc != 11) { Tcl_WrongNumArgs(interp, 3, objv, "type bubbles cancelable relatedNode prevValue newValue attrName attrChange"); return TCL_ERROR; } if (TclDOM_libxml2_GetEventFromObj(interp, objv[2], &eventPtr) != TCL_OK) { return TCL_ERROR; } objc -= 3; objv += 3; } if (eventPtr->dispatched) { Tcl_SetResult(interp, "event has been dispatched", NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[0], TclDOM_EventTypes, "type", TCL_EXACT, &option) == TCL_OK) { type = (enum TclDOM_EventTypes) option; } else { type = TCLDOM_EVENT_USERDEFINED; } Tcl_ResetResult(interp); TclDOM_InitMutationEvent(eventPtr, type, objv[0], objv[1], objv[2], objv[3], objv[4], objv[5], objv[6], objv[7]); break; case TCLDOM_EVENT_POSTUIEVENT: if (clientData) { Tcl_SetResult(interp, "bad method for event", NULL); return TCL_ERROR; } if (objc < 4) { Tcl_WrongNumArgs(interp, 1, objv, "postUIEvent node type ?args ...?"); return TCL_ERROR; } if (TclDOM_libxml2_GetNodeFromObj(interp, objv[2], &nodePtr) != TCL_OK) { return TCL_ERROR; } nodeObj = objv[2]; if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[3], TclDOM_EventTypes, "type", TCL_EXACT, &option) == TCL_OK) { type = (enum TclDOM_EventTypes) option; } else { type = TCLDOM_EVENT_USERDEFINED; } typeObjPtr = objv[3]; Tcl_ResetResult(interp); bubblesPtr = Tcl_GetVar2Ex(interp, "::dom::bubbles", Tcl_GetStringFromObj(objv[3], NULL), TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); if (!bubblesPtr) { return TCL_ERROR; } Tcl_IncrRefCount(bubblesPtr); cancelablePtr = Tcl_GetVar2Ex(interp, "::dom::cancelable", Tcl_GetStringFromObj(objv[3], NULL), TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); if (!cancelablePtr) { Tcl_DecrRefCount(bubblesPtr); return TCL_ERROR; } Tcl_IncrRefCount(cancelablePtr); viewPtr = Tcl_NewObj(); detailPtr = Tcl_NewObj(); objc -= 4; objv += 4; while (objc) { if (objc == 1) { Tcl_SetResult(interp, "value missing", NULL); Tcl_DecrRefCount(bubblesPtr); Tcl_DecrRefCount(cancelablePtr); Tcl_DecrRefCount(viewPtr); Tcl_DecrRefCount(detailPtr); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[0], TclDOM_EventCommandOptions, "option", 0, &option) != TCL_OK) { Tcl_DecrRefCount(bubblesPtr); Tcl_DecrRefCount(cancelablePtr); Tcl_DecrRefCount(viewPtr); Tcl_DecrRefCount(detailPtr); return TCL_ERROR; } switch ((enum TclDOM_EventCommandOptions) option) { case TCLDOM_EVENT_BUBBLES: Tcl_DecrRefCount(bubblesPtr); bubblesPtr = objv[1]; Tcl_IncrRefCount(bubblesPtr); break; case TCLDOM_EVENT_CANCELABLE: Tcl_DecrRefCount(cancelablePtr); cancelablePtr = objv[1]; Tcl_IncrRefCount(cancelablePtr); break; case TCLDOM_EVENT_VIEW: Tcl_DecrRefCount(viewPtr); viewPtr = objv[1]; Tcl_IncrRefCount(viewPtr); break; case TCLDOM_EVENT_DETAIL: Tcl_DecrRefCount(detailPtr); detailPtr = objv[1]; Tcl_IncrRefCount(detailPtr); break; default: Tcl_SetResult(interp, "bad option", NULL); Tcl_DecrRefCount(bubblesPtr); Tcl_DecrRefCount(cancelablePtr); Tcl_DecrRefCount(viewPtr); Tcl_DecrRefCount(detailPtr); return TCL_ERROR; } objc -= 2; objv += 2; } if (TclDOM_PostUIEvent(interp, tDocPtr, nodeObj, type, typeObjPtr, bubblesPtr, cancelablePtr, viewPtr, detailPtr) != TCL_OK) { Tcl_DecrRefCount(bubblesPtr); Tcl_DecrRefCount(cancelablePtr); Tcl_DecrRefCount(viewPtr); Tcl_DecrRefCount(detailPtr); return TCL_ERROR; } break; case TCLDOM_EVENT_POSTMOUSEEVENT: if (clientData) { Tcl_SetResult(interp, "bad method for event", NULL); return TCL_ERROR; } if (objc < 4) { Tcl_WrongNumArgs(interp, 1, objv, "postMouseEvent node type ?args ...?"); return TCL_ERROR; } if (TclDOM_libxml2_GetNodeFromObj(interp, objv[2], &nodePtr) != TCL_OK) { return TCL_ERROR; } nodeObj = objv[2]; if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[3], TclDOM_EventTypes, "type", TCL_EXACT, &option) == TCL_OK) { type = (enum TclDOM_EventTypes) option; } else { type = TCLDOM_EVENT_USERDEFINED; } typeObjPtr = objv[3]; Tcl_ResetResult(interp); bubblesPtr = Tcl_GetVar2Ex(interp, "::dom::bubbles", Tcl_GetStringFromObj(objv[3], NULL), TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); if (!bubblesPtr) { return TCL_ERROR; } Tcl_IncrRefCount(bubblesPtr); cancelablePtr = Tcl_GetVar2Ex(interp, "::dom::cancelable", Tcl_GetStringFromObj(objv[3], NULL), TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); if (!cancelablePtr) { Tcl_DecrRefCount(bubblesPtr); return TCL_ERROR; } Tcl_IncrRefCount(cancelablePtr); viewPtr = Tcl_NewObj(); detailPtr = Tcl_NewObj(); relatedNodePtr = Tcl_NewObj(); screenXPtr = Tcl_NewObj(); screenYPtr = Tcl_NewObj(); clientXPtr = Tcl_NewObj(); clientYPtr = Tcl_NewObj(); ctrlKeyPtr = Tcl_NewObj(); shiftKeyPtr = Tcl_NewObj(); metaKeyPtr = Tcl_NewObj(); buttonPtr = Tcl_NewObj(); objc -= 4; objv += 4; while (objc) { if (objc == 1) { Tcl_SetResult(interp, "value missing", NULL); goto mouse_error; } if (Tcl_GetIndexFromObj(interp, objv[0], TclDOM_EventCommandOptions, "option", 0, &option) != TCL_OK) { goto mouse_error; } switch ((enum TclDOM_EventCommandOptions) option) { case TCLDOM_EVENT_BUBBLES: Tcl_DecrRefCount(bubblesPtr); bubblesPtr = objv[1]; Tcl_IncrRefCount(bubblesPtr); break; case TCLDOM_EVENT_CANCELABLE: Tcl_DecrRefCount(cancelablePtr); cancelablePtr = objv[1]; Tcl_IncrRefCount(cancelablePtr); break; case TCLDOM_EVENT_RELATEDNODE: Tcl_DecrRefCount(relatedNodePtr); relatedNodePtr = objv[1]; Tcl_IncrRefCount(relatedNodePtr); break; case TCLDOM_EVENT_VIEW: Tcl_DecrRefCount(viewPtr); viewPtr = objv[1]; Tcl_IncrRefCount(viewPtr); break; case TCLDOM_EVENT_DETAIL: Tcl_DecrRefCount(detailPtr); detailPtr = objv[1]; Tcl_IncrRefCount(detailPtr); break; case TCLDOM_EVENT_SCREENX: Tcl_DecrRefCount(screenXPtr); screenXPtr = objv[1]; Tcl_IncrRefCount(screenXPtr); break; case TCLDOM_EVENT_SCREENY: Tcl_DecrRefCount(screenYPtr); screenYPtr = objv[1]; Tcl_IncrRefCount(screenYPtr); break; case TCLDOM_EVENT_CLIENTX: Tcl_DecrRefCount(clientXPtr); clientXPtr = objv[1]; Tcl_IncrRefCount(clientXPtr); break; case TCLDOM_EVENT_CLIENTY: Tcl_DecrRefCount(clientYPtr); clientYPtr = objv[1]; Tcl_IncrRefCount(clientYPtr); break; case TCLDOM_EVENT_CTRLKEY: Tcl_DecrRefCount(ctrlKeyPtr); ctrlKeyPtr = objv[1]; Tcl_IncrRefCount(ctrlKeyPtr); break; case TCLDOM_EVENT_SHIFTKEY: Tcl_DecrRefCount(shiftKeyPtr); shiftKeyPtr = objv[1]; Tcl_IncrRefCount(shiftKeyPtr); break; case TCLDOM_EVENT_METAKEY: Tcl_DecrRefCount(metaKeyPtr); metaKeyPtr = objv[1]; Tcl_IncrRefCount(metaKeyPtr); break; case TCLDOM_EVENT_BUTTON: Tcl_DecrRefCount(buttonPtr); buttonPtr = objv[1]; Tcl_IncrRefCount(buttonPtr); break; default: Tcl_SetResult(interp, "bad option", NULL); goto mouse_error; } objc -= 2; objv += 2; } if (TclDOM_PostMouseEvent(interp, tDocPtr, nodeObj, type, typeObjPtr, bubblesPtr, cancelablePtr, relatedNodePtr, viewPtr, detailPtr, screenXPtr, screenYPtr, clientXPtr, clientYPtr, ctrlKeyPtr, shiftKeyPtr, metaKeyPtr, buttonPtr, relatedNodePtr) != TCL_OK) { goto mouse_error; } break; mouse_error: Tcl_DecrRefCount(bubblesPtr); Tcl_DecrRefCount(cancelablePtr); Tcl_DecrRefCount(viewPtr); Tcl_DecrRefCount(detailPtr); Tcl_DecrRefCount(relatedNodePtr); Tcl_DecrRefCount(screenXPtr); Tcl_DecrRefCount(screenYPtr); Tcl_DecrRefCount(clientXPtr); Tcl_DecrRefCount(clientYPtr); Tcl_DecrRefCount(ctrlKeyPtr); Tcl_DecrRefCount(shiftKeyPtr); Tcl_DecrRefCount(metaKeyPtr); Tcl_DecrRefCount(buttonPtr); return TCL_ERROR; case TCLDOM_EVENT_POSTMUTATIONEVENT: if (clientData) { Tcl_SetResult(interp, "bad method for event", NULL); return TCL_ERROR; } if (objc < 4) { Tcl_WrongNumArgs(interp, 1, objv, "postMutationEvent node type ?args ...?"); return TCL_ERROR; } if (TclDOM_libxml2_GetNodeFromObj(interp, objv[2], &nodePtr) != TCL_OK) { return TCL_ERROR; } nodeObj = objv[2]; if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[3], TclDOM_EventTypes, "type", TCL_EXACT, &option) == TCL_OK) { type = (enum TclDOM_EventTypes) option; } else { type = TCLDOM_EVENT_USERDEFINED; } typeObjPtr = objv[3]; Tcl_ResetResult(interp); bubblesPtr = Tcl_GetVar2Ex(interp, "::dom::bubbles", Tcl_GetStringFromObj(objv[3], NULL), TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); if (!bubblesPtr) { return TCL_ERROR; } Tcl_IncrRefCount(bubblesPtr); cancelablePtr = Tcl_GetVar2Ex(interp, "::dom::cancelable", Tcl_GetStringFromObj(objv[3], NULL), TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); if (!cancelablePtr) { Tcl_DecrRefCount(bubblesPtr); return TCL_ERROR; } Tcl_IncrRefCount(cancelablePtr); relatedNodePtr = Tcl_NewObj(); prevValuePtr = Tcl_NewObj(); newValuePtr = Tcl_NewObj(); attrNamePtr = Tcl_NewObj(); attrChangePtr = Tcl_NewObj(); objc -= 4; objv += 4; while (objc) { if (objc == 1) { Tcl_SetResult(interp, "value missing", NULL); goto mutation_error; } if (Tcl_GetIndexFromObj(interp, objv[0], TclDOM_EventCommandOptions, "option", 0, &option) != TCL_OK) { goto mutation_error; } switch ((enum TclDOM_EventCommandOptions) option) { case TCLDOM_EVENT_BUBBLES: Tcl_DecrRefCount(bubblesPtr); bubblesPtr = objv[1]; Tcl_IncrRefCount(bubblesPtr); break; case TCLDOM_EVENT_CANCELABLE: Tcl_DecrRefCount(cancelablePtr); cancelablePtr = objv[1]; Tcl_IncrRefCount(cancelablePtr); break; case TCLDOM_EVENT_RELATEDNODE: Tcl_DecrRefCount(relatedNodePtr); relatedNodePtr = objv[1]; Tcl_IncrRefCount(relatedNodePtr); break; case TCLDOM_EVENT_PREVVALUE: Tcl_DecrRefCount(prevValuePtr); prevValuePtr = objv[1]; Tcl_IncrRefCount(prevValuePtr); break; case TCLDOM_EVENT_NEWVALUE: Tcl_DecrRefCount(newValuePtr); newValuePtr = objv[1]; Tcl_IncrRefCount(newValuePtr); break; case TCLDOM_EVENT_ATTRNAME: Tcl_DecrRefCount(attrNamePtr); attrNamePtr = objv[1]; Tcl_IncrRefCount(attrNamePtr); break; case TCLDOM_EVENT_ATTRCHANGE: Tcl_DecrRefCount(attrChangePtr); attrChangePtr = objv[1]; Tcl_IncrRefCount(attrChangePtr); break; default: Tcl_SetResult(interp, "bad option", NULL); goto mutation_error; } objc -= 2; objv += 2; } if (TclDOM_PostMutationEvent(interp, tDocPtr, nodeObj, type, typeObjPtr, bubblesPtr, cancelablePtr, relatedNodePtr, prevValuePtr, newValuePtr, attrNamePtr, attrChangePtr) != TCL_OK) { goto mutation_error; } break; mutation_error: Tcl_DecrRefCount(bubblesPtr); Tcl_DecrRefCount(cancelablePtr); Tcl_DecrRefCount(relatedNodePtr); Tcl_DecrRefCount(prevValuePtr); Tcl_DecrRefCount(newValuePtr); Tcl_DecrRefCount(attrNamePtr); Tcl_DecrRefCount(attrChangePtr); return TCL_ERROR; default: Tcl_SetResult(interp, "unknown method", NULL); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * GetPath -- * * Constructs a list of ancestor nodes. * * Results: * Returns list as a Tcl_Obj. * * Side effects: * Allocates Tcl_Obj structures. * *---------------------------------------------------------------------------- */ static Tcl_Obj * GetPath (interp, nodePtr) Tcl_Interp *interp; xmlNodePtr nodePtr; { Tcl_Obj *listPtr, *resultPtr; Tcl_Obj *objv[2]; if (nodePtr) { if (nodePtr->type == XML_DOCUMENT_NODE) { objv[0] = TclXML_libxml2_CreateObjFromDoc((xmlDocPtr) nodePtr); } else { objv[0] = TclDOM_libxml2_CreateObjFromNode(interp, nodePtr); } objv[1] = NULL; listPtr = Tcl_NewListObj(1, objv); if (nodePtr->parent) { resultPtr = GetPath(interp, nodePtr->parent); Tcl_ListObjAppendList(interp, resultPtr, listPtr); } else { resultPtr = listPtr; } return resultPtr; } else { return Tcl_NewObj(); } } /* *---------------------------------------------------------------------------- * * Node (and event) Tcl Object management * *---------------------------------------------------------------------------- */ /* *---------------------------------------------------------------------------- * * TclDOM_libxml2_CreateObjFromNode -- * * Create a Tcl_Obj to wrap a tree node. * * Results: * Returns Tcl_Obj*. * * Side effects: * Allocates object. Creates node command. * *---------------------------------------------------------------------------- */ Tcl_Obj * TclDOM_libxml2_CreateObjFromNode (interp, nodePtr) Tcl_Interp *interp; xmlNodePtr nodePtr; { TclDOM_libxml2_Node *tNodePtr; TclXML_libxml2_Document *tDocPtr; TclDOM_libxml2_Document *domDocPtr; Tcl_Obj *objPtr; Tcl_HashEntry *entry; int new; if (TclXML_libxml2_GetTclDocFromNode(interp, nodePtr, &tDocPtr) != TCL_OK) { Tcl_SetResult(interp, "unable to find document for node", NULL); return NULL; } if ((domDocPtr = GetDOMDocument(interp, tDocPtr)) == NULL) { Tcl_SetResult(interp, "internal error", NULL); return NULL; } tNodePtr = (TclDOM_libxml2_Node *) Tcl_Alloc(sizeof(TclDOM_libxml2_Node)); tNodePtr->ptr.nodePtr = nodePtr; tNodePtr->type = TCLDOM_LIBXML2_NODE_NODE; tNodePtr->objs = NULL; tNodePtr->token = Tcl_Alloc(30); sprintf(tNodePtr->token, "::dom::%s::node%d", tDocPtr->token, domDocPtr->nodeCntr++); entry = Tcl_CreateHashEntry(domDocPtr->nodes, tNodePtr->token, &new); if (!new) { Tcl_Free((char *) tNodePtr->token); Tcl_Free((char *) tNodePtr); Tcl_SetResult(interp, "internal error", NULL); return NULL; } Tcl_SetHashValue(entry, (void *) tNodePtr); tNodePtr->cmd = Tcl_CreateObjCommand(interp, tNodePtr->token, TclDOMNodeCommand, (ClientData) tNodePtr, TclDOMNodeCommandDelete); objPtr = Tcl_NewObj(); objPtr->internalRep.otherValuePtr = (VOID *) tNodePtr; objPtr->typePtr = &NodeObjType; objPtr->bytes = Tcl_Alloc(strlen(tNodePtr->token) + 1); strcpy(objPtr->bytes, tNodePtr->token); objPtr->length = strlen(objPtr->bytes); NodeAddObjRef(tNodePtr, objPtr); return objPtr; } /* *---------------------------------------------------------------------------- * * NodeAddObjRef -- * * Add an object reference to a node wrapper. * * Results: * Adds a reference to the Tcl_Obj for the node. * * Side effects: * Allocates memory. * *---------------------------------------------------------------------------- */ static void NodeAddObjRef(tNodePtr, objPtr) TclDOM_libxml2_Node *tNodePtr; Tcl_Obj *objPtr; { ObjList *listPtr; listPtr = (ObjList *) Tcl_Alloc(sizeof(ObjList)); listPtr->next = tNodePtr->objs; listPtr->objPtr = objPtr; tNodePtr->objs = (void *) listPtr; } /* *---------------------------------------------------------------------------- * * TclDOMNodeCommandDelete -- * * Invoked when a DOM node's Tcl command is deleted. * * Results: * Invalidates the Tcl_Obj for the node, but doesn't actually destroy the node. * * Side effects: * Frees memory. * *---------------------------------------------------------------------------- */ void TclDOMNodeCommandDelete (clientData) ClientData clientData; { TclDOM_libxml2_Node *tNodePtr = (TclDOM_libxml2_Node *) clientData; TclDOM_libxml2_InvalidateNode(tNodePtr); } /* *---------------------------------------------------------------------------- * * TclDOM_libxml2_GetNodeFromObj -- * * Gets an xmlNodePtr from a Tcl_Obj. * * Results: * Returns success code. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int TclDOM_libxml2_GetNodeFromObj (interp, objPtr, nodePtrPtr) Tcl_Interp *interp; Tcl_Obj *objPtr; xmlNodePtr *nodePtrPtr; { TclDOM_libxml2_Node *tNodePtr; if (TclDOM_libxml2_GetTclNodeFromObj(interp, objPtr, &tNodePtr) != TCL_OK) { return TCL_ERROR; } *nodePtrPtr = tNodePtr->ptr.nodePtr; return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclDOM_libxml2_GetTclNodeFromObj -- * * Gets the TclDOM node structure from a Tcl_Obj. * * Results: * Returns success code. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int TclDOM_libxml2_GetTclNodeFromObj (interp, objPtr, tNodePtrPtr) Tcl_Interp *interp; Tcl_Obj *objPtr; TclDOM_libxml2_Node **tNodePtrPtr; { TclDOM_libxml2_Node *tNodePtr; if (objPtr->typePtr == &NodeObjType) { tNodePtr = (TclDOM_libxml2_Node *) objPtr->internalRep.otherValuePtr; } else if (NodeTypeSetFromAny(interp, objPtr) == TCL_OK) { tNodePtr = (TclDOM_libxml2_Node *) objPtr->internalRep.otherValuePtr; } else { return TCL_ERROR; } if (tNodePtr->type != TCLDOM_LIBXML2_NODE_NODE) { return TCL_ERROR; } *tNodePtrPtr = tNodePtr; return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclDOM_libxml2_GetEventFromObj -- * * Gets an eventPtr from a Tcl_Obj. * * Results: * Returns success code. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int TclDOM_libxml2_GetEventFromObj (interp, objPtr, eventPtrPtr) Tcl_Interp *interp; Tcl_Obj *objPtr; TclDOM_libxml2_Event **eventPtrPtr; { TclDOM_libxml2_Node *tNodePtr; if (TclDOM_libxml2_GetTclEventFromObj(interp, objPtr, &tNodePtr) != TCL_OK) { return TCL_ERROR; } *eventPtrPtr = tNodePtr->ptr.eventPtr; return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclDOM_libxml2_GetTclEventFromObj -- * * Gets the node structure for an event from a Tcl_Obj. * * Results: * Returns success code. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int TclDOM_libxml2_GetTclEventFromObj (interp, objPtr, nodePtrPtr) Tcl_Interp *interp; Tcl_Obj *objPtr; TclDOM_libxml2_Node **nodePtrPtr; { TclDOM_libxml2_Node *tNodePtr; if (objPtr->typePtr == &NodeObjType) { tNodePtr = (TclDOM_libxml2_Node *) objPtr->internalRep.otherValuePtr; } else if (NodeTypeSetFromAny(interp, objPtr) == TCL_OK) { tNodePtr = (TclDOM_libxml2_Node *) objPtr->internalRep.otherValuePtr; } else { return TCL_ERROR; } if (tNodePtr->type != TCLDOM_LIBXML2_NODE_EVENT) { return TCL_ERROR; } *nodePtrPtr = tNodePtr; return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclDOM_libxml2_DestroyNode -- * * Destroys a node * * Results: * Frees node. * * Side effects: * Deallocates memory. * *---------------------------------------------------------------------------- */ static void TclDOM_libxml2_DeleteNode(clientData) ClientData clientData; { TclDOM_libxml2_Node *tNodePtr = (TclDOM_libxml2_Node *) clientData; TclDOM_libxml2_Event *eventPtr; TclXML_libxml2_Document *tDocPtr; TclDOM_libxml2_Document *domDocPtr; Tcl_Obj *objPtr; xmlNodePtr nodePtr; Tcl_HashEntry *entry; if (tNodePtr->type == TCLDOM_LIBXML2_NODE_NODE) { nodePtr = tNodePtr->ptr.nodePtr; objPtr = TclXML_libxml2_CreateObjFromDoc(nodePtr->doc); TclXML_libxml2_GetTclDocFromObj(NULL, objPtr, &tDocPtr); domDocPtr = GetDOMDocument(NULL, tDocPtr); if (domDocPtr == NULL) { /* internal error */ return; } } else { eventPtr = tNodePtr->ptr.eventPtr; domDocPtr = eventPtr->ownerDocument; Tcl_Free((char *) eventPtr); } entry = Tcl_FindHashEntry(domDocPtr->nodes, tNodePtr->token); if (entry) { Tcl_DeleteHashEntry(entry); } else { fprintf(stderr, "cannot delete node hash entry!\n"); } TclDOM_libxml2_InvalidateNode(tNodePtr); if (tNodePtr->appfree) { (tNodePtr->appfree)(tNodePtr->apphook); } Tcl_Free((char *) tNodePtr); } void TclDOM_libxml2_DestroyNode (interp, tNodePtr) Tcl_Interp *interp; TclDOM_libxml2_Node *tNodePtr; { Tcl_DeleteCommandFromToken(interp, tNodePtr->cmd); } /* *---------------------------------------------------------------------------- * * TclDOM_libxml2_InvalidateNode -- * * Invalidates the internal representation of any Tcl_obj that refers to * this node. NB. This does not destroy the node, or delete the node command. * * Results: * Tcl_Obj internal reps changed. * * Side effects: * None. * *---------------------------------------------------------------------------- */ void TclDOM_libxml2_InvalidateNode (tNodePtr) TclDOM_libxml2_Node *tNodePtr; { ObjList *listPtr, *nextPtr; for (listPtr = (ObjList *) tNodePtr->objs; listPtr;) { listPtr->objPtr->internalRep.otherValuePtr = NULL; listPtr->objPtr->typePtr = NULL; nextPtr = listPtr->next; Tcl_Free((char *) listPtr); listPtr = nextPtr; } tNodePtr->objs = NULL; } /* *---------------------------------------------------------------------------- * * Node object type management * *---------------------------------------------------------------------------- */ /* * NodeTypeSetFromAny -- * * Sets the internal representation from the string rep. * * Results: * Success code. * * Side effects: * Changes internal rep. * *---------------------------------------------------------------------------- */ int NodeTypeSetFromAny(interp, objPtr) Tcl_Interp *interp; Tcl_Obj *objPtr; { Tcl_Obj *docObjPtr; TclXML_libxml2_Document *tDocPtr; TclDOM_libxml2_Document *domDocPtr; Tcl_HashEntry *entry; char *id, doc[21], node[21]; int i, idlen, len; /* Parse string rep for doc and node ids */ id = Tcl_GetStringFromObj(objPtr, &idlen); /* node tokens are prefixed with "::dom::" */ if (idlen < 7 || strncmp("::dom::", id, 7) != 0) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "malformed node token \"", id, "\"", NULL); return TCL_ERROR; } for (i = 0; i < idlen && id[i + 7] != ':' && i < 21; i++) { if (!((id[i + 7] >= 'a' && id[i + 7] <= 'z') || (id[i + 7] >= '0' && id[i + 7] <= '9'))) { /* only lowercase chars and digits are found in a token */ Tcl_ResetResult(interp); Tcl_AppendResult(interp, "malformed node token \"", id, "\"", NULL); return TCL_ERROR; } doc[i] = id[i + 7]; } if (i == idlen || id[i + 7] != ':') { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "malformed node token \"", id, "\"", NULL); return TCL_ERROR; } doc[i] = '\0'; i++; if (i == idlen || id[i + 7] != ':') { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "malformed node token \"", id, "\"", NULL); return TCL_ERROR; } i++; for (len = i + 7, i = 0; i + len < idlen && i < 21; i++) { node[i] = id[len + i]; } node[i] = '\0'; docObjPtr = Tcl_NewStringObj(doc, -1); if (TclXML_libxml2_GetTclDocFromObj(interp, docObjPtr, &tDocPtr) != TCL_OK) { Tcl_DecrRefCount(docObjPtr); Tcl_SetResult(interp, "invalid node token", NULL); return TCL_ERROR; } domDocPtr = GetDOMDocument(interp, tDocPtr); if (domDocPtr == NULL) { Tcl_SetResult(interp, "internal error", NULL); return TCL_ERROR; } entry = Tcl_FindHashEntry(domDocPtr->nodes, id); if (entry) { TclDOM_libxml2_Node *tNodePtr; if (objPtr->typePtr != NULL && objPtr->typePtr->freeIntRepProc != NULL) { objPtr->typePtr->freeIntRepProc(objPtr); } tNodePtr = (TclDOM_libxml2_Node *) Tcl_GetHashValue(entry); objPtr->internalRep.otherValuePtr = (void *) tNodePtr; objPtr->typePtr = &NodeObjType; NodeAddObjRef(tNodePtr, objPtr); } else { Tcl_DecrRefCount(docObjPtr); Tcl_SetResult(interp, "not a DOM node", NULL); return TCL_ERROR; } Tcl_DecrRefCount(docObjPtr); return TCL_OK; } void NodeTypeUpdate(objPtr) Tcl_Obj *objPtr; { TclDOM_libxml2_Node *tNodePtr = (TclDOM_libxml2_Node *) objPtr->internalRep.otherValuePtr; objPtr->bytes = Tcl_Alloc(strlen(tNodePtr->token) + 1); strcpy(objPtr->bytes, tNodePtr->token); objPtr->length = strlen(objPtr->bytes); } void NodeTypeDup(srcPtr, dstPtr) Tcl_Obj *srcPtr; Tcl_Obj *dstPtr; { TclDOM_libxml2_Node *tNodePtr = (TclDOM_libxml2_Node *) srcPtr->internalRep.otherValuePtr; if (dstPtr->typePtr != NULL && dstPtr->typePtr->freeIntRepProc != NULL) { dstPtr->typePtr->freeIntRepProc(dstPtr); } Tcl_InvalidateStringRep(dstPtr); dstPtr->internalRep.otherValuePtr = (ClientData) tNodePtr; dstPtr->typePtr = srcPtr->typePtr; NodeAddObjRef(tNodePtr, dstPtr); } /* * Unlike documents, nodes are not destroyed just because they have no Tcl_Obj's * referring to them. */ void NodeTypeFree(objPtr) Tcl_Obj *objPtr; { TclDOM_libxml2_Node *tNodePtr = (TclDOM_libxml2_Node *) objPtr->internalRep.otherValuePtr; ObjList *listPtr = tNodePtr->objs; ObjList *prevPtr = NULL; while (listPtr) { if (listPtr->objPtr == objPtr) { break; } prevPtr = listPtr; listPtr = listPtr->next; } if (listPtr == NULL) { /* internal error */ } else if (prevPtr == NULL) { tNodePtr->objs = listPtr->next; } else { prevPtr->next = listPtr->next; } Tcl_Free((char *) listPtr); objPtr->internalRep.otherValuePtr = NULL; objPtr->typePtr = NULL; } #if 0 static void DumpNode(tNodePtr) TclDOM_libxml2_Node *tNodePtr; { ObjList *listPtr; fprintf(stderr, " node token \"%s\" type %d ptr x%x\n", tNodePtr->token, tNodePtr->type, tNodePtr->ptr.nodePtr); listPtr = (ObjList *) tNodePtr->objs; if (listPtr) { fprintf(stderr, " objects:"); while (listPtr) { fprintf(stderr, " objPtr x%x", listPtr->objPtr); listPtr = listPtr->next; fprintf(stderr, "\n"); } } else { fprintf(stderr, " no objects\n"); } } #endif /* *---------------------------------------------------------------------------- * * TclDOM_libxml2_NewEventObj -- * * Create a Tcl_Obj for an event. * * Results: * Returns Tcl_Obj*. * * Side effects: * Allocates object. * *---------------------------------------------------------------------------- */ Tcl_Obj * TclDOM_libxml2_NewEventObj (interp, docPtr, type, typeObjPtr) Tcl_Interp *interp; xmlDocPtr docPtr; enum TclDOM_EventTypes type; Tcl_Obj *typeObjPtr; /* NULL for standard types */ { Tcl_Obj *objPtr, *docObjPtr; TclDOM_libxml2_Node *tNodePtr; TclDOM_libxml2_Event *eventPtr; TclXML_libxml2_Document *tDocPtr; TclDOM_libxml2_Document *domDocPtr; Tcl_HashEntry *entry; int new; docObjPtr = TclXML_libxml2_CreateObjFromDoc(docPtr); TclXML_libxml2_GetTclDocFromObj(interp, docObjPtr, &tDocPtr); domDocPtr = GetDOMDocument(interp, tDocPtr); if (domDocPtr == NULL) { Tcl_SetResult(interp, "internal error", NULL); return NULL; } tNodePtr = (TclDOM_libxml2_Node *) Tcl_Alloc(sizeof(TclDOM_libxml2_Node)); tNodePtr->token = Tcl_Alloc(30); sprintf(tNodePtr->token, "::dom::%s::event%d", tDocPtr->token, domDocPtr->nodeCntr++); tNodePtr->type = TCLDOM_LIBXML2_NODE_EVENT; tNodePtr->objs = NULL; tNodePtr->apphook = NULL; tNodePtr->appfree = NULL; entry = Tcl_CreateHashEntry(domDocPtr->nodes, tNodePtr->token, &new); if (!new) { Tcl_Free((char *) tNodePtr->token); Tcl_Free((char *) tNodePtr); return NULL; } Tcl_SetHashValue(entry, (void *) tNodePtr); tNodePtr->cmd = Tcl_CreateObjCommand(interp, tNodePtr->token, TclDOMEventCommand, (ClientData) tNodePtr, TclDOMEventCommandDelete); eventPtr = (TclDOM_libxml2_Event *) Tcl_Alloc(sizeof(TclDOM_libxml2_Event)); eventPtr->ownerDocument = domDocPtr; eventPtr->tNodePtr = tNodePtr; /* * Overload the node pointer to refer to the event structure. */ tNodePtr->ptr.eventPtr = eventPtr; objPtr = Tcl_NewObj(); objPtr->internalRep.otherValuePtr = (VOID *) tNodePtr; objPtr->typePtr = &NodeObjType; objPtr->bytes = Tcl_Alloc(strlen(tNodePtr->token) + 1); strcpy(objPtr->bytes, tNodePtr->token); objPtr->length = strlen(objPtr->bytes); NodeAddObjRef(tNodePtr, objPtr); eventPtr->type = type; if (type == TCLDOM_EVENT_USERDEFINED) { eventPtr->typeObjPtr = typeObjPtr; Tcl_IncrRefCount(eventPtr->typeObjPtr); } else { eventPtr->typeObjPtr = NULL; } eventPtr->stopPropagation = 0; eventPtr->preventDefault = 0; eventPtr->dispatched = 0; eventPtr->altKey = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->altKey); eventPtr->attrName = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->attrName); eventPtr->attrChange = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->attrChange); eventPtr->bubbles = Tcl_NewIntObj(1); Tcl_IncrRefCount(eventPtr->bubbles); eventPtr->button = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->button); eventPtr->cancelable = Tcl_NewIntObj(1); Tcl_IncrRefCount(eventPtr->cancelable); eventPtr->clientX = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->clientX); eventPtr->clientY = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->clientY); eventPtr->ctrlKey = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->ctrlKey); eventPtr->currentNode = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->currentNode); eventPtr->detail = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->detail); eventPtr->eventPhase = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->eventPhase); eventPtr->metaKey = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->metaKey); eventPtr->newValue = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->newValue); eventPtr->prevValue = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->prevValue); eventPtr->relatedNode = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->relatedNode); eventPtr->screenX = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->screenX); eventPtr->screenY = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->screenY); eventPtr->shiftKey = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->shiftKey); eventPtr->target = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->target); /* Timestamping of DOM events is not available in Tcl 8.3.x. * The required API (Tcl_GetTime) is public only since 8.4.0. */ eventPtr->timeStamp = Tcl_NewLongObj(0); #if (TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION > 3)) { Tcl_Time time; Tcl_GetTime(&time); Tcl_SetLongObj(eventPtr->timeStamp, time.sec*1000 + time.usec/1000); } #endif Tcl_IncrRefCount(eventPtr->timeStamp); eventPtr->view = Tcl_NewObj(); Tcl_IncrRefCount(eventPtr->view); return objPtr; } /* *---------------------------------------------------------------------------- * * TclDOMEventCommandDelete -- * * Invoked when a DOM event node's Tcl command is deleted. * * Results: * Destroy the node. * * Side effects: * Frees memory. * *---------------------------------------------------------------------------- */ void TclDOMEventCommandDelete (clientData) ClientData clientData; { TclDOM_libxml2_Node *tNodePtr = (TclDOM_libxml2_Node *) clientData; TclDOM_libxml2_Event *eventPtr; if (tNodePtr->type != TCLDOM_LIBXML2_NODE_EVENT) { return; /* internal error. should this panic? */ } eventPtr = tNodePtr->ptr.eventPtr; if (eventPtr->typeObjPtr) { Tcl_DecrRefCount(eventPtr->typeObjPtr); } if (eventPtr->altKey) { Tcl_DecrRefCount(eventPtr->altKey); } if (eventPtr->attrName) { Tcl_DecrRefCount(eventPtr->attrName); } if (eventPtr->attrChange) { Tcl_DecrRefCount(eventPtr->attrChange); } if (eventPtr->bubbles) { Tcl_DecrRefCount(eventPtr->bubbles); } if (eventPtr->button) { Tcl_DecrRefCount(eventPtr->button); } if (eventPtr->cancelable) { Tcl_DecrRefCount(eventPtr->cancelable); } if (eventPtr->clientX) { Tcl_DecrRefCount(eventPtr->clientX); } if (eventPtr->clientY) { Tcl_DecrRefCount(eventPtr->clientY); } if (eventPtr->ctrlKey) { Tcl_DecrRefCount(eventPtr->ctrlKey); } if (eventPtr->currentNode) { Tcl_DecrRefCount(eventPtr->currentNode); } if (eventPtr->detail) { Tcl_DecrRefCount(eventPtr->detail); } if (eventPtr->eventPhase) { Tcl_DecrRefCount(eventPtr->eventPhase); } if (eventPtr->metaKey) { Tcl_DecrRefCount(eventPtr->metaKey); } if (eventPtr->newValue) { Tcl_DecrRefCount(eventPtr->newValue); } if (eventPtr->prevValue) { Tcl_DecrRefCount(eventPtr->prevValue); } if (eventPtr->relatedNode) { Tcl_DecrRefCount(eventPtr->relatedNode); } if (eventPtr->screenX) { Tcl_DecrRefCount(eventPtr->screenX); } if (eventPtr->screenY) { Tcl_DecrRefCount(eventPtr->screenY); } if (eventPtr->shiftKey) { Tcl_DecrRefCount(eventPtr->shiftKey); } if (eventPtr->target) { Tcl_DecrRefCount(eventPtr->target); } if (eventPtr->timeStamp) { Tcl_DecrRefCount(eventPtr->timeStamp); } if (eventPtr->view) { Tcl_DecrRefCount(eventPtr->view); } /* Invalidates all referring objects and frees all data structures */ TclDOM_libxml2_DeleteNode((ClientData) tNodePtr); } tclxml-3.3~svn11.orig/ChangeLog0000755000000000000000000006272611215700771015201 0ustar rootroot2009-04-12 Steve Ball * tclxslt-libxslt.c (TclXSLTCompileCommand): Use xmlMalloc instead of Tcl_Alloc. 2009-04-02 Steve Ball * tcldom*.[ch]: added "-id" node option, added RELAX NG validation. * configure.in: prepare for 3.3 release. * examples/domtext.tcl, examples/domtree.tcl: updated for Tk 8.5. 2009-01-15 Steve Ball * pkgIndex.tcl.in: fixed utilities package number ============== Released version 3.2 16/12/2008 ============== 2008-12-04 Steve Ball * doc/html.xsl, doc/*.xml: Upgrade to DocBook v5.0. Eliminate dependency on DocBook XSL stylesheets. 2008-12-02 Steve Ball * configure.in, Makefie.in: fix build problems on Linux. 2008-11-26 Steve Ball * Makefile.in, tests/*: reorganised tests subdir and merged tests from all three packages. 2008-11-20 Steve Ball * tclxml-tcl/sgmlparser.tcl, tclxml-tcl/tclparser-8.1.tcl: Surround switch labels in braces (bug fix #812051). 2008-07-01 Steve Ball * Merged TclDOM and TclXSLT packages into a single TclXML package. Reorganised directory structure. Statically link libxml2 and libxslt libraries to the TclXML shared library. 2005-12-28 Steve Ball * Applied patches for TEA build. Patches courtesy Daniel Steffen (steffen@ics.mq.edu.au). ============== Released version 3.1 04/11/2005 ============== 2005-11-04 Steve Ball * libxml2/tcllibxml2.c: Cleaned-up memory leaks, bug #1251711 and patch #1112132. 2005-05-13 Steve Ball * libxml2/tcllibxml2.c: Added call to end element handler when element is empty. 2005-04-20 Steve Ball * tclxml.c, libxml2/tcllibxml2.c, doc/tclxml.xml: changed interpretation of TCL_CONTINUE return code for external entity command 2005-03-02 Steve Ball * libxml2/tcllibxml2.c (TclXMLlibxml2ExternalEntityLoader): externalentitycommand is evaluated and returns xmlParserInputPtr 2004-10-24 Steve Ball * win/makefile.vc: Use DLL on Windows 2004-09-24 Steve Ball * libxml2/docObj.c (TclXML_libxml2_CreateObjFromDoc): Added Tcl_IncrRefCount (bug fix #1032660, David Welton). 2004-09-15 Steve Ball * doc/tclxml.xml: Fixed docn bug (missing xml::parserclass info default) 2004-09-03 Steve Ball * win/makefile.vc: Changed link options for zlib-1.2.1. 2004-08-30 Steve Ball * libxml2/tcllibxml2.c (Parse): Added support for "-defaultexpandinternalentities" and "-nowhitespace" options. * tclxml.c: Fixed bug in setting -defaultexpandinternalentities option. 2004-08-13 Steve Ball * configure.in: Bumped version to 3.1 * libxml2/docObj.c: added check for intialization to SetErrorNodeFunc function. ============== Released version 3.0 11/07/2004 ============== 2004-07-11 Steve Ball * libxml2/configure.in: Modified configure help message to match proper usage. Changed usr/... to /usr/... * win/makefile.vc: Fixed bug in install target ============== Released version 3.0b2 26/02/2004 ============== 2004-02-20 Steve Ball * libxml2/docObj.c: Fixed bug in error object management. * tclxml.c: Fixed bug in continue return code handling. 2004-02-02 Steve Ball * libxml2/tcllibxml2.c: xmlTextReader interface now uses structured error reporting. 2004-01-28 Steve Ball * tclxml.c: Added "-encoding" option. If not utf-8 document text is treated as a byte array (ie. binary data). * libxml2/tcllibxml2.c: Use xmlTextReader interface. Added "-retainpath", "-retainpathns" options. 2003-12-17 Steve Ball * doc/README.xml: Updated Windows build instructions. * win/makefile.vc: Fixed building with libxml2-2.6.3 binary distro. ============== Released version 3.0b1 15/12/2003 ============== 2003-12-15 Steve Ball * doc/tclxml.xml: Added description of structured error messages. 2003-12-09 Steve Ball * LICENSE: Bug #838361: Clarified permission for copying and distribution. * various: Removed license terms and inserted pointer to LICENSE file. 2003-12-06 Steve Ball * tclexpat.c: Patch for bug #846987 * doc/README.txt: Update for v3.0b1 release 2003-12-03 Steve Ball * Makefile.in, libxml2/Makefile.in: Fix TEA build system 2003-11-03 Steve Ball * libxml2/docObj.c, libxml2/tcllibxml2.c: Upgraded to SAX2 interfaces. Use structured error reporting. 2003-09-10 Steve Ball * win/makefile.vc: Added for building on Windows using MS VS C++ 6.0. * Various changes for building on Windows. * libxml2/tcllibxml2.c: Include and remove explicit declaration of libxml2 variable. 2003-08-24 Steve Ball * tclexpat.c: Applied patch for bug #714316, fixes attribute list declaration handler. 2003-08-22 Steve Ball * Makefile.in: Fixed tests. * library/sgmlparser.tcl, tclparser-8.1.tcl: Fixed bug #676399 - resolving external entities. * doc/nroff.xsl: Fixed buggy nroff output, bug #693590. 2003-08-21 Steve Ball * library/sgmlparser.tcl: Fixed escaping bug when parsing comments, check for "xml" anywhere in PI target. Fixed bug #583947 by removing comments in DTD. * library/tclparser-*.tcl, sgmlparser.tcl: Added -baseuri option. -baseurl is deprecated. * tclxml.c: Fix bug parsing args for creating slave entity. 2003-08-19 Steve Ball * libxml2/tcllibxml2.c: Fix TEA setup for Linux build. 2003-08-12 Steve Ball * tclexpat.c: Updated Configure routine. * expat/configure.in, expat/Makefile.in: Update for v3.0. * libxml2/tcllibxml2.h: Fix header file configuration. * libxml2/configure.in, libxml2/Makefile.in, libxml2/docObj.h: Fix include dir. 2003-08-07 Steve Ball * tclxml.c: Added -baseuri option as a synonym for -baseurl. * libxml2/tcllibxml2.c: Set ::xml::libxml2::libxml2version variable to the version of libxml2 being used. 2003-08-04 Steve Ball * tclxml.c, libxml2/tcllibxml2.c: Fixed instance configuration. 2003-08-03 Steve Ball * tests/*: Completed upgrade, test all parser classes. 2003-07-28 Steve Ball * tclxml.c: Flush PCDATA when parse terminates. * libxml2/tcllibxml2.c, docObj.c: Bug fixes. * tests/*: Upgrade to tcltest v2.2 infrastructure. 2003-06-29 Steve Ball * libxml2/docObj.c: Improve C API for use with TclDOM/libxml2 2003-06-19 Steve Ball * tclxml.c, tclexpat.c, libxml2/tcllibxml2.c: Change access to global/static data to make the extension thread-oblivious. 2003-06-05 Steve Ball * libxml2/docObj.c: Initialise hash table. * libxml2/tcllibxml2.c: Call docObj init routine, fleshed out callbacks to generic layer. 2003-05-28 Steve Ball * libxml2/*: Added libxml2 wrapper. * Updated v3_0 branch for version 3.0. 2003-04-04 Andreas Kupries * expat/configure: Regenerated. * tclconfig/tcl.m4: Updated to newest tcl.m4, again. Added fallback for exec_prefix. 2003-04-03 Andreas Kupries * expat/configure: Regenerated. * tclconfig/tcl.m4: Updated to the newest version. ============== Released version 2.6 05/03/2003 ============== 2003-03-05 Steve Ball * win/build.data: Version number is taken from installation data. 2003-03-03 Steve Ball * install.tcl: removed debugging commands. 2003-02-07 Steve Ball * Prepare v2.6 release. 2003-02-22 Steve Ball * doc/README.xml: converted README to XML format. Added XSL stylesheet to create text format file. ============== Released version 2.5 10/12/2002 ============== 2002-12-10 Steve Ball * library/sgmlparser.tcl: Patch for -final option (ted@ags.ga.erq.sri.com) 2002-12-06 Steve Ball * Update for v2.5 release. * library/sgmlparser.tcl (ParseEvent:ElementOpen): fixed '>' in attribute value in an empty element, bug #620034. 2002-11-01 Andreas Kupries * Makefile.in: Removed code of target 'install-doc'. We have no manpages (.n files), and so the code removes everything in the mann directory in the installaltion area. ============== Released version 2.4 31/10/2002 ============== 2002-10-31 Steve Ball * README: Updated installation instructions. ============== Released version 2.4rc1 29/10/2002 ============== 2002-10-29 Steve Ball * install.tcl: Remove '-' from install directory, fixed UpdateTemplateCopy so that unspecified TEA variables don't prevent other variables from being substituted. * configure, library/pkgIndex.tcl.macosx: removed: generated files or no longer required. * library/tclparser-8.1.tcl (xml::tclparser::reset): Check if the parser has been properly initialised. Call create if it hasn't. 2002-10-28 Andreas Kupries * expat/xmlwf/readfilemap.c: Added prototypes missing on windows, and cast to ensure comparison of compatible types. Required for Windows debug builds as these use -WX, making warnings into errors. 2002-10-25 Andreas Kupries * tclxml.c (TclXMLResetParser): Added cast, removed unused variable 'i'. * tclxmlStubLib.c (TclXML_InitStubs): Provide un-const'ed version of 'version' to Tcl_PkgRequireEx to supress warnings. 2002-10-15 Jeff Hobbs * tclconfig/tcl.m4: * expat/configure: * expat/configure.in: * configure: * configure.in: move the CFLAGS definition into TEA_ENABLE_SHARED and make it pick up the env CFLAGS at configure time. 2002-10-15 Andreas Kupries * expat/configure.in: * configure.in: Changed to propagate an initial CFLAGS value to the final definition. A TEA condition (SHARED_BUILD == 1) squashed it, causing it the build system to loose the +DAportable we specify for the AS PA-RISC2.2 build host. This is a problem for _all_ TEA and TEA 2 based configure files. 2002-10-15 Steve Ball * *.in: Updated version numbers for v2.4. 2002-10-02 Andreas Kupries * Makefile.in ($($(PACKAGE)stub_LIB_FILE)): Corrected explicit usage of AR. 2002-09-27 Andreas Kupries * expat/configure.in: * expat/Makefile.in: Added code to pick up the tclxml configuration and stub library. * TclxmlConfig.sh.in: New file. * configure.in: Added code to generate a config.sh file. This will be used by the expat module to pick up the tclxml stub library. 2002-09-26 Andreas Kupries * expat/Makefile.in (Tclexpat_SOURCES): Corrected typo. It is xmltok.c, not .o. D'oh. * tclexpat.c (Tclexpat_Init): Added commands to initialize classinfo->reset and ->resetCmd. Without this trying to create an expat-based parser will segfault as the generic layer will jump through uninitialized pointers. Incomplete realization of the new option -resetcommand. 2002-09-25 Andreas Kupries * expat/Makefile.in: * expat/configure.in: * expat/aclocal.m4: Rewritten to use TEA 2 as base of the build system. This configure/makefile copiles the expat low-level stuff and the tcl binding in one go, into one library. The package index is separate from the generic xml layer. * Makefile.in: * configure.in: * library/pkgIndex.tcl.in: Rewritten to use TEA 2 as base of build system. Refactoring, taking out generation of tclexpat stuff, this will go into its own configure/Makefile in the expat directory => Less of a mess for configuring and compiling the two packages. * tools: * tclconfig: New directories. See above. * tclxml.h: Removed duplicate of TCL_EXTERN stuff. 2002-09-19 Steve Ball * tclxml.c (TclXMLParserClassCmd): Added -resetcommand to parserclass command. 2002-09-13 Andreas Kupries * Makefile.in ($(TCLXML_LIB_FILE)_OBJECTS): Added stub objects to link list for main library. Without we get unsatisfied symbols when trying to load the library. (tclxmlStubInit.$(OBJEXT)): (tclxmlStubLib.$(OBJEXT)): Added targets to compile the stub sources. 2002-09-12 Andreas Kupries * configure.in (MINOR_VERSION): Bumped to 3. Full version now 2.3. Additional changes to make compilation on AIX more robust. * Makefile.in: See above, AIX. ============== Released version 2.3 13/09/2002 ============== 2002-09-13 Steve Ball * tclxml.c, tclxml.h, Makefile.in, tclxmlDecls.h, tclxml.decls, tclxmlStubInit.c, tclxmlStubLib.c: Applied patches to improve building from Andreas Kupries and patches from David Gravereaux for stubs. 2002-09-09 Steve Ball * library/sgmlparser.tcl (sgml::tokenise): Patch from bug #596959. ============== Released version 2.3rc2 07/09/2002 ============== 2002-09-06 Steve Ball * tests/parser.test, library/sgmlparser.tcl, library/tclparser-8.1.tcl: Fixed bug #579264 by implementing -ignorewhitespace option. * Added check for illegal Unicode characters in PCDATA. 2002-09-04 Steve Ball * library/tclparser-8.1.tcl (xml::tclparser::reset): Added reset function. * library/xml__tcl.tcl (xml::ParserCmd): Invoke reset command, rather than just deleting and creating a parser. 2002-08-30 Steve Ball * tclexpat.c: Fixed crash in element decl handler. 2002-08-28 Steve Ball * library/xml-8.1.tcl, library/xml-8.0.tcl: Added definition of XML Namespace URI 2002-06-28 Mats Bengtsson * library/sgmlparser.tcl: fixes for -final 0 bug #413341. corrected list structure of all -errorcommand callbacks bug #467785. catch & -code in -elmentendcallback bug #521740. checks for state(line) instead for state to handle inits for -final 0 correctly * library/tclparser-8.1.tcl: fixes for -final 0 bug #413341. changed xml::tclparse::configure and calls it in xml::tclparse::parse 2002-06-19 Steve Ball * library/xml__tcl.tcl (xml::ParserCmd): free method removes command in caller's namespace. Bug #510418. 2002-06-17 Steve Ball * library/sgmlparser.tcl (sgml::DeProtect1): Applied patch #521642. 2002-06-14 Steve Ball * library/xpath.tcl (xpath::ParseExpr): Fixed bug #568354 - abbreviated node-type test in predicate. 2002-06-11 Steve Ball * library/tclparser-8.1.tcl (xml::tclparser::ParseAttrs): Fixed bug in character entity dereferencing. Bug #546295. * library/sgmlparser.tcl (sgml::parseEvent): Applied patch for bug #566452 to fix PIs 2002-05-27 Andreas Kupries * library/sgmlparser.tcl (sgml::Entity): Fixed code defining 'entities' if not defined, using code in parseEvent] as template. * library/tclparser-8.1.tcl (xml::tclparser::NormalizeAttValue:DeRef): Fixed the errors in the calls to [string range] (first two branches of the switch). * install.tcl (line 306): args needs no default value of empty. Is empty as per definition of 'args' when used as last argument. 2002-05-20 Steve Ball * install.data, library/sgmlparser.tcl: Fixed bug 513985. Replaced 'package require tcllib' with 'package require uri'. * library/sgmlparser.tcl: Fixed bug 495427 (applied suggested patch). * LICENSE: Added 2002-02-19 Andreas Kupries * Makefile.in (install-lib-binaries): Changed INSTALL_DATA to INSTALL_PROGRAM to prevent the copy operation from removing the executable flag for libraries on platforms which do need it. Like HPUX. * tclxml.c (TclXMLCreateParserCmd): Fixed SF TclXML Bug 513909. The code now handles multiple occurences of "-parser class" and also takes care to hide them when it comes to the general configuration during creation. 2002-02-06 Andreas Kupries * tclxml.c (TclXMLConfigureParserInstance): Copied code from "TclXMLInstanceConfigure" providing the clientdata/instance name to the parser to configure. This fixes bug 514045. * configure: * configure.in: * tclxml.m4: Applied patch 508718 to allow building of expat on Windows. * tclxml.h: * tclexpat.c: * tclxml.c: Updated to TIP 27 (CONST'ness of string tables for Tcl_GetIndexFromObj). 2002-01-27 Steve Ball * library/xpath.tcl Fixed bug in expression parsing. Reported by Gerard LEDOUBLET. 2001-11-13 Steve Ball * library/sgmlparser.tcl, tests/pcdata.test: Fixed bug #468029 report by Kenneth Cox. 2001-11-09 Steve Ball * library/sgmlparser.tcl, library/tclparser-8.1.tcl, tests/attribute.test: Added handling of entity references within an attribute value. 2001-09-05 Andreas Kupries * Makefile.in (GENERIC_SCRIPTS): Added xpath.tcl to the list of scripts to install. Fixes [458864]. 2001-08-28 Andreas Kupries * tclxml.c (TclXMLInstanceDeleteCmd): Applied the patch fixing SF Item [456321]. This removes a double free of xmlinfo and also avoids to access the structure after it was freed. * tclxml.c (TclXMLInstanceConfigure): Added a 'Tcl_ResetResult' before the loop processing the option. This forces the interp result into a known, unshared state. This also adds Pat Thoyts's changes to 'instanceConfigureSwitches' declaring some new '-*command' options and additional argument checks for 'entityparser'. SF Patch [454204]. 2001-08-10 Peter Farmer * Makefile.in ($(GENERIC_SCRIPTS)): Fixed bugs in earlier code removed by Andreas and put it back. .2001-08-02 Steve Ball --- Released TclXML 2.1theta --- 2001-07-31 Andreas Kupries * Makefile.in ($(GENERIC_SCRIPTS)): Removed creation of soft-link. When using a builddirectory below the toplevel directory the created link is circular and the following cp operations fails [SF 446485]. 2001-07-30 Steve Ball * library/sgmlparser.tcl Fixed bug #434304: whitespace not accepted in XML Declaration. Side-effect is to improve WF checking. * library/sgmlparser.tcl Fixed bug #431353: entity references plus Tcl specials 2001-02-26 Peter Farmer * library/tclparser-8.?.tcl Added missing arg to pass -final thru to document instance parser 2001-02-12 Steve Ball * library/sgmlparser.tcl * tests/cdata.test, tests/pi.test, tests/decls.test, * tests/entity.test, tests/doctype.test Fixed bug #131878: XML test documents not well-formed. Fixing the tests revealed bugs in the parser. 2001-02-09 Steve Ball * library/sgmlparser.tcl, tests/cdata.test * library/xmldep.tcl Fixed bug #130127: backslashes in CDATA sections. Added xmldep package (dependency discovery) 2001-02-06 Peter Farmer * install.tcl, install.data, win/build.data, win/install.bat * library/pkgIndex.tcl.in, library/xml__tcl.tcl, tests/* _Many_ significant improvements in the installer. Can now install windows build as well as Unices. Now uses TEA config files & .in templates, if the build has them, to extract installation info. Test suite now more portable to new/alternate versions and can test tcl only parser with other parsers present. 2001-01-19 Steve Ball * library/xpath.tcl Fixed bug in parsing @ abbreviation 2001-01-17 Steve Ball --- Released TclXML v2.0theta --- 2001-01-17 Steve Ball * install.tcl, install.data Generalised PF's pure-Tcl installer. It now reads the installation data from an external file (script). 2001-01-10 Steve Ball * library/sgmlparser.tcl, tests/decls.test, tests/entity.test Fixed bugs in external entity parsing and test suite. 2000-12-10 Steve Ball * library/xml-8.1.tcl Added QName, allWsp 2000-12-01 Steve Ball * library/xpath.tcl Support for parsing and constructing XPath location paths. Partial initial implementation. 2000-08-14 Steve Ball * doc/tclxml.xml, doc/html.xsl, doc/nroff.xsl Updated doco and added XSL stylesheets to produce HTML and NROFF output. 2000-08-01 Steve Ball * library/sgmlparser.tcl Added support for XML Namespaces 2000-07-24 Steve Ball * library/tclparser-8.1.tcl Fixed double backslashes in attribute values 2000-06-15 Steve Ball * tclxml.*, tclxerces.cpp, tclexpat.c, library/tclparser-8.1.tcl Fixed automatic selection of default parser. Fixed registration and running of Tcl-based parser classes. 2000-06-10 Steve Ball * library/sgmlparser.tcl, tests/*.test Removed -entityparser option. Minor fixes to test scripts. 2000-06-01 Steve Ball * doc/tclxml.xml Completed documenting xml::parser command. 2000-05-18 Steve Ball * tclxml.c, tclxerces.cpp, README, doc/tclxml.xml Added -validate configuration option. TclXerces sets the parser object to validate when performing parsing. Don't have a test, yet. Also updated README and started documentation (in DocBook). 2000-04-22 Steve Ball * library/sgmlparser.tcl, library/tclparser-8.1.tcl, tests/decls.test Added support for external entities. 2000-04-16 Steve Ball * library/sgmlparser.tcl, library/tclparser-8.1.tcl, tests/decls.test Added markup declaration support. Partial implementation. Also supporting entity substitution. 2000-04-05 Steve Ball * Makefile.in, configure.in, library/* Fixed Tcl-only package setup and installation. Added Tcl-only parser class framework. Changed Tcl parser implementation to use new parser class framework. 2000-02-10 Steve Ball * tclXerces.cpp, tclXercesHandlers.cpp, tclXercesHandlers.hpp. Added these files. They implement the "xerces" parser class, providing a wrapper for the Xerces-C (XML4C) XML parser. 2000-01-23 Steve Ball * tclxml.c, tclxml.h: Added these files. These are the entry points for the tclxml package. They provide a generic front-end for specific parser class implementations. * tclexpat.c: This has been stripped down and is now a back-end parser class implementation. 1999-12-27 Steve Ball * tclexpat.c: Changed class creation command to xml::parser. Propagate error code from application callback, patch from Marshall Rose. Load xml package on initialisation. Assign unique parser instance command if none given. * library/*.tcl, pkgIndex.tcl.in, Makefile.in: Merged TclXML Tcl scripts into this package. * configure.in: Updated to version 2.0 1999-12-12 Steve Ball * tclexpat.c: Accumulate PCDATA in a string object for a single call to -characterdatacommand callback, instead of a call for each line of data. * tclexpat.c: Added -ignorewhitespace option. 1999-09-14 Eric Melski * tclexpat.c: In TclExpatAttlistDeclHandler, added a test on attributes to verify that it doesn't point to nothing (ie, a null attlist decl). This addresses bug 2831. 1999-09-14 Eric Melski * tclexpat.c: Added support for several new callbacks: attlistdecl, elementdecl, {start|end}doctypedecl. Fixed support for external entity parsing by adding a subcommand (entityparser) to the "instance" command, which allows creation of an external entity parser. Some minor fixes like removing unused variables. Added a "free" command to the instance command, which allows user initiated freeing of the parser (required for external entity parsing to function properly). Fixed a compiler warning about const char * and assigning it to a char *. 1999-08-24 Scott Stanton * tclexpat.c: Changed to avoid generating errors on non-standalone documents when no handler is defined. 1999-08-20 Scott Stanton * tclexpat.c: Various lint. Changed to automatically export public symbols. * configure.in: Bumped version number to 1.1 * Makefile.in: Various changes to support Windows builds. 1999-08-17 Scott Stanton * tclexpat.c: added TCL_STORAGE_CLASS macros to automatically export the _Init symbol. 1999-08-11 Scott Stanton * tclexpat.c: Changed to use Tcl stubs. Fixed various bugs. Eliminated conditional code for old pre-release versions of 8.1. tclxml-3.3~svn11.orig/tclxml.c0000755000000000000000000027676611113705304015103 0ustar rootroot/* * tclxml.c -- * * Entry point for XML parsers, DOM and XSLT. * * Copyright (c) 2005-2007 Steve Ball, explain * http://www.explain.com.au/ * Copyright (c) 1998-2004 Steve Ball, Zveno Pty Ltd * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * $Id: tclxml.c,v 1.32.2.1 2005/12/28 06:49:50 balls Exp $ * */ #include #include #include #include #include #define TCL_DOES_STUBS \ (TCL_MAJOR_VERSION > 8 || TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION > 1 || \ (TCL_MINOR_VERSION == 1 && TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE))) #ifdef USE_TCLXML_STUBS #ifndef TCLXML_DOES_STUBS # define TCLXML_DOES_STUBS TCL_DOES_STUBS #endif /* USE_TCLXML_STUBS */ #endif /* TCL_DOES_STUBS */ /* * The structure below is used to manage package options. */ typedef struct ThreadSpecificData { int initialized; TclXML_ParserClassInfo *defaultParser; /* Current default parser */ Tcl_HashTable *registeredParsers; /* All known parser classes */ /* * Retain a pointer to the whitespace variable */ Tcl_Obj *whitespaceRE; /* * Counter to generate unique command names */ int uniqueCounter; /* * Callback for external entity resolution */ Tcl_Obj *externalentitycmd; Tcl_Interp *interp; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* This string is a backup. Value should be defined in xml package. */ static char whitespace[] = " \t\r\n"; /* * Configuration option tables */ static CONST84 char *globalConfigureSwitches[] = { "-externalentitycommand", (char *) NULL }; enum globalConfigureSwitches { TCLXML_GLOBAL_EXTERNALENTITYCOMMAND }; static CONST84 char *instanceConfigureSwitches[] = { "-final", "-validate", "-baseurl", "-baseuri", "-encoding", "-elementstartcommand", "-elementendcommand", "-characterdatacommand", "-processinginstructioncommand", "-defaultcommand", "-unparsedentitydeclcommand", "-notationdeclcommand", "-externalentitycommand", "-unknownencodingcommand", "-commentcommand", "-notstandalonecommand", "-startcdatasectioncommand", "-endcdatasectioncommand", "-defaultexpandinternalentities", "-elementdeclcommand", "-attlistdeclcommand", "-startdoctypedeclcommand", "-enddoctypedeclcommand", "-paramentityparsing", "-ignorewhitespace", "-reportempty", "-entitydeclcommand", /* added to avoid exception */ "-parameterentitydeclcommand", /* added to avoid exception */ "-doctypecommand", /* added to avoid exception */ "-entityreferencecommand", /* added to avoid exception */ "-xmldeclcommand", /* added to avoid exception */ (char *) NULL }; enum instanceConfigureSwitches { TCLXML_FINAL, TCLXML_VALIDATE, TCLXML_BASEURL, TCLXML_BASEURI, TCLXML_ENCODING, TCLXML_ELEMENTSTARTCMD, TCLXML_ELEMENTENDCMD, TCLXML_DATACMD, TCLXML_PICMD, TCLXML_DEFAULTCMD, TCLXML_UNPARSEDENTITYCMD, TCLXML_NOTATIONCMD, TCLXML_EXTERNALENTITYCMD, TCLXML_UNKNOWNENCODINGCMD, TCLXML_COMMENTCMD, TCLXML_NOTSTANDALONECMD, TCLXML_STARTCDATASECTIONCMD, TCLXML_ENDCDATASECTIONCMD, TCLXML_DEFAULTEXPANDINTERNALENTITIES, TCLXML_ELEMENTDECLCMD, TCLXML_ATTLISTDECLCMD, TCLXML_STARTDOCTYPEDECLCMD, TCLXML_ENDDOCTYPEDECLCMD, TCLXML_PARAMENTITYPARSING, TCLXML_NOWHITESPACE, TCLXML_REPORTEMPTY, TCLXML_ENTITYDECLCMD, TCLXML_PARAMENTITYDECLCMD, TCLXML_DOCTYPECMD, TCLXML_ENTITYREFCMD, TCLXML_XMLDECLCMD }; /* * Prototypes for procedures defined later in this file: */ static void TclXMLInstanceDeleteCmd _ANSI_ARGS_((ClientData clientData)); static int TclXMLDestroyParserInstance _ANSI_ARGS_((TclXML_Info *xmlinfo)); static int TclXMLInstanceCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, struct Tcl_Obj *CONST objv[])); static int TclXMLCreateParserCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclXMLParserClassCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclXMLResetParser _ANSI_ARGS_((Tcl_Interp *interp, TclXML_Info *xmlinfo)); static int TclXMLConfigureCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static Tcl_Obj* FindUniqueCmdName _ANSI_ARGS_((Tcl_Interp *interp)); static int TclXMLInstanceConfigure _ANSI_ARGS_((Tcl_Interp *interp, TclXML_Info *xmlinfo, int objc, Tcl_Obj *CONST objv[])); static int TclXMLCget _ANSI_ARGS_((Tcl_Interp *interp, TclXML_Info *xmlinfo, int objc, Tcl_Obj *CONST objv[])); static int TclXMLConfigureParserInstance _ANSI_ARGS_(( TclXML_Info *xmlinfo, Tcl_Obj *option, Tcl_Obj *value)); static int TclXMLGet _ANSI_ARGS_((Tcl_Interp *interp, TclXML_Info *xmlinfo, int objc, Tcl_Obj *CONST objv[])); static int TclXMLParse _ANSI_ARGS_((Tcl_Interp *interp, TclXML_Info *xmlinfo, char *data, int len)); static void TclXMLDispatchPCDATA _ANSI_ARGS_((TclXML_Info *xmlinfo)); #if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0) /* *---------------------------------------------------------------------------- * * Tcl_GetString -- * * Compatibility routine for Tcl 8.0 * * Results: * String representation of object.. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static char * Tcl_GetString (obj) Tcl_Obj *obj; /* Object to retrieve string from. */ { char *s; int i; s = Tcl_GetStringFromObj(obj, &i); return s; } #endif /* TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 */ /* *---------------------------------------------------------------------------- * * Tclxml_Init -- * * Initialisation routine for loadable module. * Also calls the initialisation routines for TclDOM and TclXSLT, * as these were originally separate modules. * * Results: * None. * * Side effects: * Creates commands in the interpreter, * loads xml, dom and xslt packages. * *---------------------------------------------------------------------------- */ int Tclxml_Init (interp) Tcl_Interp *interp; /* Interpreter to initialise. */ { ThreadSpecificData *tsdPtr; #ifdef USE_TCL_STUBS if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { return TCL_ERROR; } #endif tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); tsdPtr->initialized = 1; tsdPtr->defaultParser = NULL; tsdPtr->uniqueCounter = 0; tsdPtr->whitespaceRE = Tcl_GetVar2Ex(interp, "::xml::Wsp", NULL, TCL_GLOBAL_ONLY); if (tsdPtr->whitespaceRE == NULL) { tsdPtr->whitespaceRE = Tcl_SetVar2Ex(interp, "::xml::Wsp", NULL, Tcl_NewStringObj(whitespace, -1), TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); if (tsdPtr->whitespaceRE == NULL) { return TCL_ERROR; } } Tcl_IncrRefCount(tsdPtr->whitespaceRE); tsdPtr->registeredParsers = (Tcl_HashTable *) Tcl_Alloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(tsdPtr->registeredParsers, TCL_STRING_KEYS); tsdPtr->externalentitycmd = NULL; tsdPtr->interp = interp; Tcl_CreateObjCommand(interp, "xml::configure", TclXMLConfigureCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "xml::parser", TclXMLCreateParserCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "xml::parserclass", TclXMLParserClassCmd, NULL, NULL); if (Tclxml_libxml2_Init(interp) != TCL_OK) { return TCL_ERROR; } if (Tcldom_libxml2_Init(interp) != TCL_OK) { return TCL_ERROR; } if (Tclxslt_libxslt_Init(interp) != TCL_OK) { return TCL_ERROR; } #if TCLXML_DOES_STUBS { extern TclxmlStubs tclxmlStubs; if (Tcl_PkgProvideEx(interp, "xml::c", TCLXML_VERSION, (ClientData) &tclxmlStubs) != TCL_OK) { return TCL_ERROR; } } #else if (Tcl_PkgProvide(interp, "xml::c", TCLXML_VERSION) != TCL_OK) { return TCL_ERROR; } #endif return TCL_OK; } /* *---------------------------------------------------------------------------- * * Tclxml_SafeInit -- * * Initialisation routine for loadable module in a safe interpreter. * * Results: * None. * * Side effects: * Creates commands in the interpreter, * loads xml package. * *---------------------------------------------------------------------------- */ int Tclxml_SafeInit (interp) Tcl_Interp *interp; /* Interpreter to initialise. */ { return Tclxml_Init(interp); } /* *---------------------------------------------------------------------------- * * TclXMLConfigureCmd -- * * Command for xml::configure command. * * Results: * Depends on method. * * Side effects: * Depends on method. * *---------------------------------------------------------------------------- */ static int TclXMLConfigureCmd(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); int index; if (objc < 3) { Tcl_SetResult(interp, "must specify option", NULL); return TCL_ERROR; } else if (objc == 3) { /* TODO: retrieve option's value */ return TCL_OK; } else if (objc % 2 == 1) { Tcl_SetResult(interp, "value for option missing", NULL); return TCL_ERROR; } for (objc -= 2, objv += 2; objc; objc -= 2, objv += 2) { if (Tcl_GetIndexFromObj(interp, objv[0], globalConfigureSwitches, "switch", 0, &index) != TCL_OK) { return TCL_ERROR; } switch ((enum globalConfigureSwitches) index) { case TCLXML_GLOBAL_EXTERNALENTITYCOMMAND: tsdPtr->externalentitycmd = objv[1]; Tcl_IncrRefCount(tsdPtr->externalentitycmd); break; default: return TCL_ERROR; } } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXMLParserClassCmd -- * * Command for xml::parserclass command. * * Results: * Depends on method. * * Side effects: * Depends on method. * *---------------------------------------------------------------------------- */ static int TclXMLParserClassCmd(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); TclXML_ParserClassInfo *classinfo; int method, index; Tcl_Obj *listPtr; Tcl_HashEntry *entryPtr; Tcl_HashSearch search; static CONST84 char *methods[] = { "create", "destroy", "info", NULL }; enum methods { TCLXML_CREATE, TCLXML_DESTROY, TCLXML_INFO }; static CONST84 char *createOptions[] = { "-createcommand", "-createentityparsercommand", "-parsecommand", "-configurecommand", "-deletecommand", "-resetcommand", NULL }; enum createOptions { TCLXML_CREATEPROC, TCLXML_CREATE_ENTITY_PARSER, TCLXML_PARSEPROC, TCLXML_CONFIGUREPROC, TCLXML_DELETEPROC, TCLXML_RESETPROC }; static CONST84 char *infoMethods[] = { "names", "default", NULL }; enum infoMethods { TCLXML_INFO_NAMES, TCLXML_INFO_DEFAULT }; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "method ?args?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], methods, "method", 0, &method) != TCL_OK) { return TCL_ERROR; } switch ((enum methods) method) { case TCLXML_CREATE: if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "create name ?args?"); return TCL_ERROR; } classinfo = (TclXML_ParserClassInfo *) Tcl_Alloc(sizeof(TclXML_ParserClassInfo)); classinfo->name = objv[2]; Tcl_IncrRefCount(classinfo->name); classinfo->create = NULL; classinfo->createCmd = NULL; classinfo->createEntity = NULL; classinfo->createEntityCmd = NULL; classinfo->parse = NULL; classinfo->parseCmd = NULL; classinfo->configure = NULL; classinfo->configureCmd = NULL; classinfo->reset = NULL; classinfo->resetCmd = NULL; classinfo->destroy = NULL; classinfo->destroyCmd = NULL; objv += 3; objc -= 3; while (objc > 1) { if (Tcl_GetIndexFromObj(interp, objv[0], createOptions, "options", 0, &index) != TCL_OK) { return TCL_ERROR; } Tcl_IncrRefCount(objv[1]); switch ((enum createOptions) index) { case TCLXML_CREATEPROC: classinfo->createCmd = objv[1]; break; case TCLXML_CREATE_ENTITY_PARSER: classinfo->createEntityCmd = objv[1]; break; case TCLXML_PARSEPROC: classinfo->parseCmd = objv[1]; break; case TCLXML_CONFIGUREPROC: classinfo->configureCmd = objv[1]; break; case TCLXML_RESETPROC: classinfo->resetCmd = objv[1]; break; case TCLXML_DELETEPROC: classinfo->destroyCmd = objv[1]; break; default: Tcl_AppendResult(interp, "unknown option \"", Tcl_GetStringFromObj(objv[0], NULL), "\"", NULL); Tcl_DecrRefCount(objv[1]); Tcl_DecrRefCount(classinfo->name); Tcl_Free((char *)classinfo); return TCL_ERROR; } objc -= 2; objv += 2; } if (TclXML_RegisterXMLParser(interp, classinfo) != TCL_OK) { Tcl_Free((char *)classinfo); return TCL_ERROR; } break; case TCLXML_DESTROY: /* Not yet implemented */ break; case TCLXML_INFO: if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "method"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[2], infoMethods, "method", 0, &index) != TCL_OK) { return TCL_ERROR; } switch ((enum infoMethods) index) { case TCLXML_INFO_NAMES: listPtr = Tcl_NewListObj(0, NULL); entryPtr = Tcl_FirstHashEntry(tsdPtr->registeredParsers, &search); while (entryPtr != NULL) { Tcl_ListObjAppendElement(interp, listPtr, Tcl_NewStringObj(Tcl_GetHashKey(tsdPtr->registeredParsers, entryPtr), -1)); entryPtr = Tcl_NextHashEntry(&search); } Tcl_SetObjResult(interp, listPtr); break; case TCLXML_INFO_DEFAULT: if (!tsdPtr->defaultParser) { Tcl_SetResult(interp, "", NULL); } else { Tcl_SetObjResult(interp, tsdPtr->defaultParser->name); } break; default: Tcl_SetResult(interp, "unknown method", NULL); return TCL_ERROR; } break; default: Tcl_SetResult(interp, "unknown method", NULL); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXML_RegisterXMLParser -- * * Adds a new XML parser. * * Results: * Standard Tcl return code. * * Side effects: * New parser is available for use in parser instances. * *---------------------------------------------------------------------------- */ int TclXML_RegisterXMLParser(interp, classinfo) Tcl_Interp *interp; TclXML_ParserClassInfo *classinfo; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); int new; Tcl_HashEntry *entryPtr; entryPtr = Tcl_CreateHashEntry(tsdPtr->registeredParsers, Tcl_GetStringFromObj(classinfo->name, NULL), &new); if (!new) { Tcl_Obj *ptr = Tcl_NewStringObj("parser class \"", -1); Tcl_AppendObjToObj(ptr, classinfo->name); Tcl_AppendObjToObj(ptr, Tcl_NewStringObj("\" already registered", -1)); Tcl_ResetResult(interp); Tcl_SetObjResult(interp, ptr); return TCL_ERROR; } Tcl_SetHashValue(entryPtr, (ClientData) classinfo); /* * Set default parser - last wins */ tsdPtr->defaultParser = classinfo; return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXMLCreateParserCmd -- * * Creation command for xml::parser command. * * Results: * The name of the newly created parser instance. * * Side effects: * This creates a parser instance. * *---------------------------------------------------------------------------- */ static int TclXMLCreateParserCmd(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); TclXML_Info *xmlinfo; int found, i, index, poption; static CONST84 char *switches[] = { "-parser", (char *) NULL }; enum switches { TCLXML_PARSER }; if (tsdPtr == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("TclXML package improperly initialised", -1)); return TCL_ERROR; } if (!tsdPtr->defaultParser) { Tcl_SetResult(interp, "no parsers available", NULL); return TCL_ERROR; } /* * Create the data structures for this parser. */ if (!(xmlinfo = (TclXML_Info *) Tcl_Alloc(sizeof(TclXML_Info)))) { Tcl_SetResult(interp, "unable to create parser", NULL); return TCL_ERROR; } xmlinfo->interp = interp; xmlinfo->clientData = NULL; xmlinfo->base = NULL; xmlinfo->encoding = Tcl_NewStringObj("utf-8", -1); /* * Find unique command name */ if (objc < 2) { xmlinfo->name = FindUniqueCmdName(interp); } else { xmlinfo->name = objv[1]; if (*(Tcl_GetStringFromObj(xmlinfo->name, NULL)) != '-') { Tcl_IncrRefCount(xmlinfo->name); objv++; objc--; } else { xmlinfo->name = FindUniqueCmdName(interp); } } xmlinfo->validate = 0; xmlinfo->elementstartcommand = NULL; xmlinfo->elementstart = NULL; xmlinfo->elementstartdata = 0; xmlinfo->elementendcommand = NULL; xmlinfo->elementend = NULL; xmlinfo->elementenddata = 0; xmlinfo->datacommand = NULL; xmlinfo->cdatacb = NULL; xmlinfo->cdatacbdata = 0; xmlinfo->picommand = NULL; xmlinfo->pi = NULL; xmlinfo->pidata = 0; xmlinfo->defaultcommand = NULL; xmlinfo->defaultcb = NULL; xmlinfo->defaultdata = 0; xmlinfo->unparsedcommand = NULL; xmlinfo->unparsed = NULL; xmlinfo->unparseddata = 0; xmlinfo->notationcommand = NULL; xmlinfo->notation = NULL; xmlinfo->notationdata = 0; xmlinfo->entitycommand = NULL; xmlinfo->entity = NULL; xmlinfo->entitydata = 0; xmlinfo->unknownencodingcommand = NULL; xmlinfo->unknownencoding = NULL; xmlinfo->unknownencodingdata = 0; /* ericm@scriptics.com */ xmlinfo->commentCommand = NULL; xmlinfo->comment = NULL; xmlinfo->commentdata = 0; xmlinfo->notStandaloneCommand = NULL; xmlinfo->notStandalone = NULL; xmlinfo->notstandalonedata = 0; xmlinfo->elementDeclCommand = NULL; xmlinfo->elementDecl = NULL; xmlinfo->elementdecldata = 0; xmlinfo->attlistDeclCommand = NULL; xmlinfo->attlistDecl = NULL; xmlinfo->attlistdecldata = 0; xmlinfo->startDoctypeDeclCommand = NULL; xmlinfo->startDoctypeDecl = NULL; xmlinfo->startdoctypedecldata = 0; xmlinfo->endDoctypeDeclCommand = NULL; xmlinfo->endDoctypeDecl = NULL; xmlinfo->enddoctypedecldata = 0; #ifdef TCLXML_CDATASECTIONS xmlinfo->startCDATASectionCommand = NULL; xmlinfo->startCDATASection = NULL; xmlinfo->startcdatasectiondata = 0; xmlinfo->endCdataSectionCommand = NULL; xmlinfo->endCdataSection = NULL; xmlinfo->endcdatasectiondata = 0; #endif /* * Options may include an explicit desired parser class * * SF TclXML Bug 513909 ... * Start search at first argument! If there was a parser name * specified we already skipped over it. * * Changing the search. Do not stop at the first occurence of * "-parser". There can be more than one instance of the option in * the argument list and it is the last instance that counts. */ found = 0; i = 1; poption = -1; while (i < objc) { Tcl_ResetResult (interp); if (Tcl_GetIndexFromObj(interp, objv[i], switches, "option", 0, &index) == TCL_OK) { poption = i; found = 1; } i += 2; } Tcl_ResetResult (interp); if (found) { Tcl_HashEntry *pentry; if (poption == (objc - 1)) { Tcl_SetResult(interp, "no value for option", NULL); goto error; } /* * Use given parser class */ pentry = Tcl_FindHashEntry(tsdPtr->registeredParsers, Tcl_GetStringFromObj(objv[poption + 1], NULL)); if (pentry != NULL) { xmlinfo->parserClass = Tcl_GetHashValue(pentry); } else { Tcl_AppendResult(interp, "no such parser class \"", Tcl_GetStringFromObj(objv[poption + 1], NULL), "\"", NULL); goto error; } } else { /* * Use default parser */ xmlinfo->parserClass = tsdPtr->defaultParser; } if (TclXMLResetParser(interp, xmlinfo) != TCL_OK) { /* this may leak memory... Tcl_Free((char *)xmlinfo); */ return TCL_ERROR; } /* * Register a Tcl command for this parser instance. */ Tcl_CreateObjCommand(interp, Tcl_GetStringFromObj(xmlinfo->name, NULL), TclXMLInstanceCmd, (ClientData) xmlinfo, TclXMLInstanceDeleteCmd); /* * Handle configuration options * * SF TclXML Bug 513909 ... * Note: If the caller used "-parser" to specify a parser class we * have to take care that it and its argument are *not* seen by * "TclXMLInstanceConfigure" because this option is not allowed * during general configuration. */ if (objc > 1) { if (found) { /* * The options contained at least one instance of "-parser * class". We now go through the whole list of arguments and * build a new list which contains only the non-"-parser" * switches. The 'ResetResult' takes care of clearing the * interpreter result before "Tcl_GetIndexFromObj" tries to * use it again. */ int res; int cfgc = 0; Tcl_Obj** cfgv = (Tcl_Obj**) Tcl_Alloc (objc * sizeof (Tcl_Obj*)); i = 1; while (i < objc) { Tcl_ResetResult (interp); if (Tcl_GetIndexFromObj(interp, objv[i], switches, "option", 0, &index) == TCL_OK) { /* Ignore "-parser" during copying */ i += 2; continue; } cfgv [cfgc] = objv [i]; i++ ; cfgc++ ; /* copy option ... */ cfgv [cfgc] = objv [i]; i++ ; cfgc++ ; /* ... and value */ } Tcl_ResetResult (interp); res = TclXMLInstanceConfigure(interp, xmlinfo, cfgc, cfgv); Tcl_Free ((char*) cfgv); if (res == TCL_ERROR) { return TCL_ERROR; } } else { /* * The options contained no "-parser class" specification. We * can propagate it unchanged. */ if (TclXMLInstanceConfigure(interp, xmlinfo, objc - 1, objv + 1) == TCL_ERROR) { return TCL_ERROR; } } } Tcl_SetObjResult(interp, xmlinfo->name); return TCL_OK; error: /* this may leak memory Tcl_Free((char*)xmlinfo); */ return TCL_ERROR; } /* *---------------------------------------------------------------------------- * * 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; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_Obj *name; Tcl_CmdInfo cmdinfo; char s[20]; name = Tcl_NewObj(); Tcl_IncrRefCount(name); do { sprintf(s, "xmlparser%d", tsdPtr->uniqueCounter++); Tcl_SetStringObj(name, s, -1); } while (Tcl_GetCommandInfo(interp, Tcl_GetStringFromObj(name, NULL), &cmdinfo)); return name; } /* *---------------------------------------------------------------------------- * * TclXMLResetParser -- * * (Re-)Initialise the parser instance structure. * * Results: * Parser made ready for parsing. * * Side effects: * Destroys and creates a parser instance. * Modifies TclXML_Info fields. * *---------------------------------------------------------------------------- */ static int TclXMLResetParser(interp, xmlinfo) Tcl_Interp *interp; TclXML_Info *xmlinfo; { TclXML_ParserClassInfo *classInfo = (TclXML_ParserClassInfo *) xmlinfo->parserClass; if (xmlinfo->base) { Tcl_DecrRefCount(xmlinfo->base); xmlinfo->base = NULL; } xmlinfo->final = 1; xmlinfo->status = TCL_OK; xmlinfo->result = NULL; xmlinfo->continueCount = 0; xmlinfo->context = NULL; xmlinfo->cdata = NULL; xmlinfo->nowhitespace = 0; xmlinfo->reportempty = 0; xmlinfo->expandinternalentities = 1; xmlinfo->paramentities = 1; if (classInfo->reset) { if ((*classInfo->reset)((ClientData) xmlinfo) != TCL_OK) { return TCL_ERROR; } } else if (classInfo->resetCmd) { Tcl_Obj *cmdPtr = Tcl_DuplicateObj(classInfo->resetCmd); int result; Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) interp); Tcl_ListObjAppendElement(interp, cmdPtr, xmlinfo->name); result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) interp); if (result != TCL_OK) { Tcl_Free((char*)xmlinfo); return TCL_ERROR; } } else if (classInfo->create) { /* * Otherwise destroy and then create a fresh parser instance */ /* * Destroy the old parser instance, if it exists * Could probably just reset it, but this approach * is pretty much guaranteed to work. */ if (TclXMLDestroyParserInstance(xmlinfo) != TCL_OK) { return TCL_ERROR; } /* * Directly invoke the create routine */ if ((xmlinfo->clientData = (*classInfo->create)(interp, xmlinfo)) == NULL) { Tcl_Free((char*)xmlinfo); return TCL_ERROR; } } else if (classInfo->createCmd) { Tcl_Obj *cmdPtr = Tcl_DuplicateObj(classInfo->createCmd); int result, i; Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) interp); Tcl_ListObjAppendElement(interp, cmdPtr, xmlinfo->name); result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) interp); if (result != TCL_OK) { Tcl_Free((char*)xmlinfo); return TCL_ERROR; } else { /* * Return result is parser instance argument */ xmlinfo->clientData = (ClientData) Tcl_GetObjResult(interp); Tcl_IncrRefCount((Tcl_Obj *) xmlinfo->clientData); /* * Add all of the currently configured callbacks to the * creation command line. Destroying the parser instance * just clobbered all of these settings. */ cmdPtr = Tcl_DuplicateObj(classInfo->configureCmd); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) interp); Tcl_ListObjAppendElement(interp, cmdPtr, xmlinfo->name); for (i = 0; instanceConfigureSwitches[i]; i++) { Tcl_Obj *objPtr = Tcl_NewStringObj(instanceConfigureSwitches[i], -1); Tcl_ListObjAppendElement(interp, cmdPtr, objPtr); TclXMLCget(interp, xmlinfo, 1, &objPtr); Tcl_ListObjAppendElement(interp, cmdPtr, Tcl_GetObjResult(interp)); } result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) interp); if (result != TCL_OK) { Tcl_Free((char *)xmlinfo); return TCL_ERROR; } } } else { Tcl_SetResult(interp, "bad parser class data", NULL); Tcl_Free((char*)xmlinfo); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------- * * TclXMLCreateEntityParser -- * * Create an entity parser, based on the original * parser referred to by parent. * * Results: * New entity parser created and initialized. * * Side effects: * The TclXML_Info struct pointed to by external is modified. * *---------------------------------------------------------------------- */ static int TclXMLCreateEntityParser(interp, external, parent) Tcl_Interp *interp; TclXML_Info *external; TclXML_Info *parent; { TclXML_ParserClassInfo *extClassInfo; external->parserClass = parent->parserClass; extClassInfo = (TclXML_ParserClassInfo *) external->parserClass; if (!extClassInfo->createEntity || !extClassInfo->createEntityCmd) { Tcl_SetResult(interp, "cannot create entity parser", NULL); return TCL_ERROR; } if (parent->elementstartcommand) { Tcl_IncrRefCount(parent->elementstartcommand); } if (parent->elementendcommand) { Tcl_IncrRefCount(parent->elementendcommand); } if (parent->datacommand) { Tcl_IncrRefCount(parent->datacommand); } if (parent->picommand) { Tcl_IncrRefCount(parent->picommand); } if (parent->defaultcommand) { Tcl_IncrRefCount(parent->defaultcommand); } if (parent->unparsedcommand) { Tcl_IncrRefCount(parent->unparsedcommand); } if (parent->notationcommand) { Tcl_IncrRefCount(parent->notationcommand); } if (parent->entitycommand) { Tcl_IncrRefCount(parent->entitycommand); } if (parent->unknownencodingcommand) { Tcl_IncrRefCount(parent->unknownencodingcommand); } if (parent->commentCommand) { Tcl_IncrRefCount(parent->commentCommand); } if (parent->notStandaloneCommand) { Tcl_IncrRefCount(parent->notStandaloneCommand); } #ifdef TCLXML_CDATASECTIONS if (parent->startCdataSectionCommand) { Tcl_IncrRefCount(parent->startCdataSectionCommand); } if (parent->endCdataSectionCommand) { Tcl_IncrRefCount(parent->endCdataSectionCommand); } #endif if (parent->elementDeclCommand) { Tcl_IncrRefCount(parent->elementDeclCommand); } if (parent->attlistDeclCommand) { Tcl_IncrRefCount(parent->attlistDeclCommand); } if (parent->startDoctypeDeclCommand) { Tcl_IncrRefCount(parent->startDoctypeDeclCommand); } if (parent->endDoctypeDeclCommand) { Tcl_IncrRefCount(parent->endDoctypeDeclCommand); } external->elementstartcommand = parent->elementstartcommand; external->elementstart = parent->elementstart; external->elementendcommand = parent->elementendcommand; external->elementend = parent->elementend; external->datacommand = parent->datacommand; external->cdatacb = parent->cdatacb; external->picommand = parent->picommand; external->pi = parent->pi; external->defaultcommand = parent->defaultcommand; external->defaultcb = parent->defaultcb; external->unparsedcommand = parent->unparsedcommand; external->unparsed = parent->unparsed; external->notationcommand = parent->notationcommand; external->notation = parent->notation; external->entitycommand = parent->entitycommand; external->entity = parent->entity; external->unknownencodingcommand = parent->unknownencodingcommand; external->unknownencoding = parent->unknownencoding; external->commentCommand = parent->commentCommand; external->comment = parent->comment; external->notStandaloneCommand = parent->notStandaloneCommand; external->notStandalone = parent->notStandalone; external->elementDeclCommand = parent->elementDeclCommand; external->elementDecl = parent->elementDecl; external->attlistDeclCommand = parent->attlistDeclCommand; external->attlistDecl = parent->attlistDecl; external->startDoctypeDeclCommand = parent->startDoctypeDeclCommand; external->startDoctypeDecl = parent->startDoctypeDecl; external->endDoctypeDeclCommand = parent->endDoctypeDeclCommand; external->endDoctypeDecl = parent->endDoctypeDecl; #ifdef TCLXML_CDATASECTIONS external->startCdataSectionCommand = parent->startCdataSectionCommand; external->startCdataSection = parent->startCdataSection; external->endCdataSectionCommand = parent->endCdataSectionCommand; external->endCdataSection = parent->endCdataSection; #endif external->final = 1; external->validate = parent->validate; external->status = TCL_OK; external->result = NULL; external->continueCount = 0; external->context = NULL; external->cdata = NULL; external->nowhitespace = parent->nowhitespace; if (parent->encoding) { external->encoding = Tcl_DuplicateObj(parent->encoding); } else { external->encoding = Tcl_NewStringObj("utf-8", -1); } if (extClassInfo->createEntity) { /* * Directly invoke the create routine */ if ((external->clientData = (*extClassInfo->createEntity)(interp, (ClientData) external)) == NULL) { Tcl_Free((char*)external); return TCL_ERROR; } } else if (extClassInfo->createEntityCmd) { int result; result = Tcl_GlobalEvalObj(interp, extClassInfo->createEntityCmd); if (result != TCL_OK) { Tcl_Free((char*)external); return TCL_ERROR; } else { /* * Return result is parser instance argument */ external->clientData = (ClientData) Tcl_GetObjResult(interp); Tcl_IncrRefCount((Tcl_Obj *) external->clientData); } } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXMLDestroyParserInstance -- * * Destroys the parser instance. * * Results: * None. * * Side effects: * Depends on class destroy proc. * *---------------------------------------------------------------------------- */ static int TclXMLDestroyParserInstance(xmlinfo) TclXML_Info *xmlinfo; { TclXML_ParserClassInfo *classInfo = (TclXML_ParserClassInfo *) xmlinfo->parserClass; if (xmlinfo->clientData) { if (classInfo->destroy) { if ((*classInfo->destroy)(xmlinfo->clientData) != TCL_OK) { if (xmlinfo->encoding) { Tcl_DecrRefCount(xmlinfo->encoding); } Tcl_Free((char *)xmlinfo); return TCL_ERROR; } } else if (classInfo->destroyCmd) { Tcl_Obj *cmdPtr = Tcl_DuplicateObj(classInfo->destroyCmd); int result; Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, (Tcl_Obj *) xmlinfo->clientData); result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); if (result != TCL_OK) { if (xmlinfo->encoding) { Tcl_DecrRefCount(xmlinfo->encoding); } Tcl_Free((char *)xmlinfo); return TCL_ERROR; } Tcl_DecrRefCount((Tcl_Obj *) xmlinfo->clientData); } xmlinfo->clientData = NULL; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXMLFreeParser -- * * Destroy the parser instance structure. * * Results: * None. * * Side effects: * Frees any memory allocated for the XML parser instance. * *---------------------------------------------------------------------------- */ static void TclXMLFreeParser(xmlinfo) TclXML_Info *xmlinfo; { if (TclXMLDestroyParserInstance(xmlinfo) == TCL_OK) { if (xmlinfo->encoding) { Tcl_DecrRefCount(xmlinfo->encoding); } Tcl_Free((char*)xmlinfo); } } /* *---------------------------------------------------------------------------- * * TclXMLInstanceCmd -- * * Implements instance command for XML parsers. * * Results: * Depends on the method. * * Side effects: * Depends on the method. * *---------------------------------------------------------------------------- */ static int TclXMLInstanceCmd (clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { TclXML_Info *xmlinfo = (TclXML_Info *) clientData; TclXML_Info *child; char *encoding, *data; int len, index, result = TCL_OK; Tcl_Obj *childNamePtr; static CONST84 char *options[] = { "configure", "cget", "entityparser", "free", "get", "parse", "reset", NULL }; enum options { TCLXML_CONFIGURE, TCLXML_CGET, TCLXML_ENTITYPARSER, TCLXML_FREE, TCLXML_GET, TCLXML_PARSE, TCLXML_RESET }; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "method ?args?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0, &index) != TCL_OK) { return TCL_ERROR; } switch ((enum options) index) { case TCLXML_CONFIGURE: result = TclXMLInstanceConfigure(interp, xmlinfo, objc - 2, objv + 2); break; case TCLXML_CGET: if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "cget option"); return TCL_ERROR; } result = TclXMLCget(interp, xmlinfo, objc - 2, objv + 2); break; case TCLXML_ENTITYPARSER: /* ericm@scriptics.com, 1999.9.13 */ /* check for args - Pat Thoyts */ if (objc == 2) { childNamePtr = FindUniqueCmdName(interp); } else if (objc == 3) { childNamePtr = objv[2]; } else { Tcl_WrongNumArgs(interp, 1, objv, "entityparser ?args?"); return TCL_ERROR; } /* * Create the data structures for this parser. */ if (!(child = (TclXML_Info *) Tcl_Alloc(sizeof(TclXML_Info)))) { Tcl_Free((char*)child); Tcl_SetResult(interp, "unable to create parser", NULL); return TCL_ERROR; } child->interp = interp; Tcl_IncrRefCount(childNamePtr); child->name = childNamePtr; /* Actually create the parser instance */ if (TclXMLCreateEntityParser(interp, child, xmlinfo) != TCL_OK) { Tcl_DecrRefCount(childNamePtr); Tcl_Free((char*)child); return TCL_ERROR; } /* Register a Tcl command for this parser instance */ Tcl_CreateObjCommand(interp, Tcl_GetString(child->name), TclXMLInstanceCmd, (ClientData) child, TclXMLInstanceDeleteCmd); Tcl_SetObjResult(interp, child->name); result = TCL_OK; break; case TCLXML_FREE: /* ericm@scriptics.com, 1999.9.13 */ Tcl_DeleteCommand(interp, Tcl_GetString(xmlinfo->name)); result = TCL_OK; break; case TCLXML_GET: /* ericm@scriptics.com, 1999.6.28 */ result = TclXMLGet(interp, xmlinfo, objc - 2, objv + 2); break; case TCLXML_PARSE: if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "data"); return TCL_ERROR; } if (xmlinfo->encoding) { encoding = Tcl_GetStringFromObj(xmlinfo->encoding, NULL); } else { encoding = "utf-8"; } if (strlen(encoding) == 0 || strcmp(encoding, "utf-8") == 0) { data = Tcl_GetStringFromObj(objv[2], &len); } else { data = (char *) Tcl_GetByteArrayFromObj(objv[2], &len); } result = TclXMLParse(interp, xmlinfo, data, len); break; case TCLXML_RESET: if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, ""); return TCL_ERROR; } TclXMLResetParser(interp, xmlinfo); break; default: Tcl_SetResult(interp, "unknown method", NULL); return TCL_ERROR; } return result; } /* *---------------------------------------------------------------------------- * * TclXMLParse -- * * Invoke parser class' parse proc and check return result. * * Results: * TCL_OK if no errors, TCL_ERROR otherwise. * * Side effects: * Sets interpreter result as appropriate. * *---------------------------------------------------------------------------- */ static int TclXMLParse (interp, xmlinfo, data, len) Tcl_Interp *interp; TclXML_Info *xmlinfo; char *data; int len; { int result; TclXML_ParserClassInfo *classInfo = (TclXML_ParserClassInfo *) xmlinfo->parserClass; xmlinfo->status = TCL_OK; if (xmlinfo->result != NULL) { Tcl_DecrRefCount(xmlinfo->result); } xmlinfo->result = NULL; if (classInfo->parse) { if ((*classInfo->parse)(xmlinfo->clientData, data, len, xmlinfo->final) != TCL_OK) { return TCL_ERROR; } } else if (classInfo->parseCmd) { Tcl_Obj *cmdPtr = Tcl_DuplicateObj(classInfo->parseCmd); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); if (xmlinfo->clientData) { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, (Tcl_Obj *) xmlinfo->clientData); } else if (xmlinfo->name) { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, xmlinfo->name); } Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, Tcl_NewStringObj(data, len)); result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); if (result != TCL_OK) { return TCL_ERROR; } } else { Tcl_SetResult(interp, "XML parser cannot parse", NULL); return TCL_ERROR; } switch (xmlinfo->status) { case TCL_OK: case TCL_BREAK: case TCL_CONTINUE: TclXMLDispatchPCDATA(xmlinfo); Tcl_ResetResult(interp); return TCL_OK; case TCL_ERROR: Tcl_SetObjResult(interp, xmlinfo->result); return TCL_ERROR; default: /* * Propagate application-specific error condition. * Patch by Marshall Rose */ Tcl_SetObjResult(interp, xmlinfo->result); return xmlinfo->status; } } /* *---------------------------------------------------------------------------- * * TclXMLInstanceConfigure -- * * Configures a XML parser instance. * * Results: * Depends on the method. * * Side effects: * Depends on the method. * *---------------------------------------------------------------------------- */ static int TclXMLInstanceConfigure (interp, xmlinfo, objc, objv) Tcl_Interp *interp; TclXML_Info *xmlinfo; int objc; Tcl_Obj *CONST objv[]; { int index, bool, doParse = 0, result; TclXML_ParserClassInfo *classinfo = (TclXML_ParserClassInfo *) xmlinfo->parserClass; while (objc > 1) { /* * Firstly, pass the option to the parser's own * configuration management routine. * It may pass back an error or break code to * stop us from further processing the options. */ if (classinfo->configure) { result = (*classinfo->configure)(xmlinfo->clientData, objv[0], objv[1]); if (result == TCL_BREAK) { objc -= 2; objv += 2; continue; } if (result != TCL_OK) { return TCL_ERROR; } } else if (classinfo->configureCmd) { Tcl_Obj *cmdPtr = Tcl_DuplicateObj(classinfo->configureCmd); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) interp); if (xmlinfo->clientData) { Tcl_ListObjAppendElement(interp, cmdPtr, (Tcl_Obj *) xmlinfo->clientData); } else if (xmlinfo->name) { Tcl_ListObjAppendElement(interp, cmdPtr, xmlinfo->name); } Tcl_ListObjAppendElement(interp, cmdPtr, objv[0]); Tcl_ListObjAppendElement(interp, cmdPtr, objv[1]); result = Tcl_GlobalEvalObj(interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) interp); if (result == TCL_BREAK) { objc -= 2; objv += 2; continue; } else if (result != TCL_OK) { return TCL_ERROR; } } Tcl_ResetResult (interp); if (Tcl_GetIndexFromObj(interp, objv[0], instanceConfigureSwitches, "switch", 0, &index) != TCL_OK) { return TCL_ERROR; } switch ((enum instanceConfigureSwitches) index) { case TCLXML_FINAL: /* -final */ if (Tcl_GetBooleanFromObj(interp, objv[1], &bool) != TCL_OK) { return TCL_ERROR; } if (bool && !xmlinfo->final) { doParse = 1; } else if (!bool && xmlinfo->final) { /* * Reset the parser for new input */ TclXMLResetParser(interp, xmlinfo); doParse = 0; } xmlinfo->final = bool; break; case TCLXML_ENCODING: /* -encoding */ if (xmlinfo->encoding) { Tcl_DecrRefCount(xmlinfo->encoding); } xmlinfo->encoding = objv[1]; Tcl_IncrRefCount(xmlinfo->encoding); break; case TCLXML_VALIDATE: /* -validate */ if (Tcl_GetBooleanFromObj(interp, objv[1], &bool) != TCL_OK) { return TCL_ERROR; } /* * If the parser is in the middle of parsing a document, * this will be ignored. Perhaps an error should be returned? */ xmlinfo->validate = bool; break; case TCLXML_BASEURL: /* -baseurl, -baseuri */ case TCLXML_BASEURI: if (xmlinfo->base != NULL) { Tcl_DecrRefCount(xmlinfo->base); } xmlinfo->base = objv[1]; Tcl_IncrRefCount(xmlinfo->base); break; case TCLXML_DEFAULTEXPANDINTERNALENTITIES: /* -defaultexpandinternalentities */ /* ericm@scriptics */ if (Tcl_GetBooleanFromObj(interp, objv[1], &bool) != TCL_OK) { return TCL_ERROR; } xmlinfo->expandinternalentities = bool; break; case TCLXML_PARAMENTITYPARSING: /* ericm@scriptics */ case TCLXML_NOWHITESPACE: case TCLXML_REPORTEMPTY: /* * All of these get passed through to the instance's * configure procedure. */ if (TclXMLConfigureParserInstance(xmlinfo, objv[0], objv[1]) != TCL_OK) { return TCL_ERROR; } break; case TCLXML_ELEMENTSTARTCMD: /* -elementstartcommand */ if (xmlinfo->elementstartcommand != NULL) { Tcl_DecrRefCount(xmlinfo->elementstartcommand); } xmlinfo->elementstart = NULL; xmlinfo->elementstartcommand = objv[1]; Tcl_IncrRefCount(xmlinfo->elementstartcommand); break; case TCLXML_ELEMENTENDCMD: /* -elementendcommand */ if (xmlinfo->elementendcommand != NULL) { Tcl_DecrRefCount(xmlinfo->elementendcommand); } xmlinfo->elementend = NULL; xmlinfo->elementendcommand = objv[1]; Tcl_IncrRefCount(xmlinfo->elementendcommand); break; case TCLXML_DATACMD: /* -characterdatacommand */ if (xmlinfo->datacommand != NULL) { Tcl_DecrRefCount(xmlinfo->datacommand); } xmlinfo->cdatacb = NULL; xmlinfo->datacommand = objv[1]; Tcl_IncrRefCount(xmlinfo->datacommand); break; case TCLXML_PICMD: /* -processinginstructioncommand */ if (xmlinfo->picommand != NULL) { Tcl_DecrRefCount(xmlinfo->picommand); } xmlinfo->pi = NULL; xmlinfo->picommand = objv[1]; Tcl_IncrRefCount(xmlinfo->picommand); break; case TCLXML_DEFAULTCMD: /* -defaultcommand */ if (xmlinfo->defaultcommand != NULL) { Tcl_DecrRefCount(xmlinfo->defaultcommand); } xmlinfo->defaultcb = NULL; xmlinfo->defaultcommand = objv[1]; Tcl_IncrRefCount(xmlinfo->defaultcommand); break; case TCLXML_UNPARSEDENTITYCMD: /* -unparsedentitydeclcommand */ if (xmlinfo->unparsedcommand != NULL) { Tcl_DecrRefCount(xmlinfo->unparsedcommand); } xmlinfo->unparsed = NULL; xmlinfo->unparsedcommand = objv[1]; Tcl_IncrRefCount(xmlinfo->unparsedcommand); break; case TCLXML_NOTATIONCMD: /* -notationdeclcommand */ if (xmlinfo->notationcommand != NULL) { Tcl_DecrRefCount(xmlinfo->notationcommand); } xmlinfo->notation = NULL; xmlinfo->notationcommand = objv[1]; Tcl_IncrRefCount(xmlinfo->notationcommand); break; case TCLXML_EXTERNALENTITYCMD: /* -externalentitycommand */ if (xmlinfo->entitycommand != NULL) { Tcl_DecrRefCount(xmlinfo->entitycommand); } xmlinfo->entity = NULL; xmlinfo->entitycommand = objv[1]; Tcl_IncrRefCount(xmlinfo->entitycommand); break; case TCLXML_UNKNOWNENCODINGCMD: /* -unknownencodingcommand */ /* Not implemented */ break; if (xmlinfo->unknownencodingcommand != NULL) { Tcl_DecrRefCount(xmlinfo->unknownencodingcommand); } xmlinfo->unknownencoding = NULL; xmlinfo->unknownencodingcommand = objv[1]; Tcl_IncrRefCount(xmlinfo->unknownencodingcommand); break; case TCLXML_COMMENTCMD: /* -commentcommand */ /* ericm@scriptics.com */ if (xmlinfo->commentCommand != NULL) { Tcl_DecrRefCount(xmlinfo->commentCommand); } xmlinfo->comment = NULL; xmlinfo->commentCommand = objv[1]; Tcl_IncrRefCount(xmlinfo->commentCommand); break; case TCLXML_NOTSTANDALONECMD: /* -notstandalonecommand */ /* ericm@scriptics.com */ if (xmlinfo->notStandaloneCommand != NULL) { Tcl_DecrRefCount(xmlinfo->notStandaloneCommand); } xmlinfo->notStandalone = NULL; xmlinfo->notStandaloneCommand = objv[1]; Tcl_IncrRefCount(xmlinfo->notStandaloneCommand); break; #ifdef TCLXML_CDATASECTIONS case TCLXML_STARTCDATASECTIONCMD: /* -startcdatasectioncommand */ /* ericm@scriptics */ if (xmlinfo->startCdataSectionCommand != NULL) { Tcl_DecrRefCount(xmlinfo->startCdataSectionCommand); } xmlinfo->startCDATASection = NULL; xmlinfo->startCdataSectionCommand = objv[1]; Tcl_IncrRefCount(xmlinfo->startCdataSectionCommand); break; case TCLXML_ENDCDATASECTIONCMD: /* -endcdatasectioncommand */ /* ericm@scriptics */ if (xmlinfo->endCdataSectionCommand != NULL) { Tcl_DecrRefCount(xmlinfo->endCdataSectionCommand); } xmlinfo->endCDATASection = NULL; xmlinfo->endCdataSectionCommand = objv[1]; Tcl_IncrRefCount(xmlinfo->endCdataSectionCommand); break; #endif case TCLXML_ELEMENTDECLCMD: /* -elementdeclcommand */ /* ericm@scriptics.com */ if (xmlinfo->elementDeclCommand != NULL) { Tcl_DecrRefCount(xmlinfo->elementDeclCommand); } xmlinfo->elementDecl = NULL; xmlinfo->elementDeclCommand = objv[1]; Tcl_IncrRefCount(xmlinfo->elementDeclCommand); break; case TCLXML_ATTLISTDECLCMD: /* -attlistdeclcommand */ /* ericm@scriptics.com */ if (xmlinfo->attlistDeclCommand != NULL) { Tcl_DecrRefCount(xmlinfo->attlistDeclCommand); } xmlinfo->attlistDecl = NULL; xmlinfo->attlistDeclCommand = objv[1]; Tcl_IncrRefCount(xmlinfo->attlistDeclCommand); break; case TCLXML_STARTDOCTYPEDECLCMD: /* -startdoctypedeclcommand */ /* ericm@scriptics.com */ if (xmlinfo->startDoctypeDeclCommand != NULL) { Tcl_DecrRefCount(xmlinfo->startDoctypeDeclCommand); } xmlinfo->startDoctypeDecl = NULL; xmlinfo->startDoctypeDeclCommand = objv[1]; Tcl_IncrRefCount(xmlinfo->startDoctypeDeclCommand); break; case TCLXML_ENDDOCTYPEDECLCMD: /* -enddoctypedeclcommand */ /* ericm@scriptics.com */ if (xmlinfo->endDoctypeDeclCommand != NULL) { Tcl_DecrRefCount(xmlinfo->endDoctypeDeclCommand); } xmlinfo->endDoctypeDecl = NULL; xmlinfo->endDoctypeDeclCommand = objv[1]; Tcl_IncrRefCount(xmlinfo->endDoctypeDeclCommand); break; case TCLXML_ENTITYDECLCMD: /* -entitydeclcommand */ case TCLXML_PARAMENTITYDECLCMD: /* -parameterentitydeclcommand */ case TCLXML_DOCTYPECMD: /* -doctypecommand */ case TCLXML_ENTITYREFCMD: /* -entityreferencecommand */ case TCLXML_XMLDECLCMD: /* -xmldeclcommand */ /* commands used by tcldom, but not here yet */ break; default: return TCL_ERROR; break; } objv += 2; objc -= 2; } if (doParse) { return TclXMLParse(interp, xmlinfo, "", 0); } else { return TCL_OK; } } /* *---------------------------------------------------------------------------- * * TclXMLCget -- * * Returns setting of configuration option. * * Results: * Option value. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static int TclXMLCget (interp, xmlinfo, objc, objv) Tcl_Interp *interp; TclXML_Info *xmlinfo; int objc; Tcl_Obj *CONST objv[]; { int index; if (Tcl_GetIndexFromObj(interp, objv[0], instanceConfigureSwitches, "switch", 0, &index) != TCL_OK) { return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewObj()); switch ((enum instanceConfigureSwitches) index) { case TCLXML_FINAL: Tcl_SetObjResult(interp, Tcl_NewBooleanObj(xmlinfo->final)); break; case TCLXML_VALIDATE: Tcl_SetObjResult(interp, Tcl_NewBooleanObj(xmlinfo->validate)); break; case TCLXML_DEFAULTEXPANDINTERNALENTITIES: Tcl_SetObjResult(interp, Tcl_NewBooleanObj(xmlinfo->expandinternalentities)); break; case TCLXML_REPORTEMPTY: Tcl_SetObjResult(interp, Tcl_NewBooleanObj(xmlinfo->reportempty)); break; case TCLXML_PARAMENTITYPARSING: Tcl_SetObjResult(interp, Tcl_NewBooleanObj(xmlinfo->paramentities)); break; case TCLXML_NOWHITESPACE: Tcl_SetObjResult(interp, Tcl_NewBooleanObj(xmlinfo->nowhitespace)); break; case TCLXML_BASEURL: case TCLXML_BASEURI: if (xmlinfo->base) { Tcl_SetObjResult(interp, xmlinfo->base); } break; case TCLXML_ENCODING: if (xmlinfo->encoding) { Tcl_SetObjResult(interp, xmlinfo->encoding); } break; case TCLXML_ELEMENTSTARTCMD: if (xmlinfo->elementstartcommand) { Tcl_SetObjResult(interp, xmlinfo->elementstartcommand); } break; case TCLXML_ELEMENTENDCMD: if (xmlinfo->elementendcommand) { Tcl_SetObjResult(interp, xmlinfo->elementendcommand); } break; case TCLXML_DATACMD: if (xmlinfo->datacommand) { Tcl_SetObjResult(interp, xmlinfo->datacommand); } break; case TCLXML_PICMD: if (xmlinfo->picommand) { Tcl_SetObjResult(interp, xmlinfo->picommand); } break; case TCLXML_DEFAULTCMD: if (xmlinfo->defaultcommand) { Tcl_SetObjResult(interp, xmlinfo->defaultcommand); } break; case TCLXML_UNPARSEDENTITYCMD: if (xmlinfo->unparsedcommand) { Tcl_SetObjResult(interp, xmlinfo->unparsedcommand); } break; case TCLXML_NOTATIONCMD: if (xmlinfo->notationcommand) { Tcl_SetObjResult(interp, xmlinfo->notationcommand); } break; case TCLXML_EXTERNALENTITYCMD: if (xmlinfo->entitycommand) { Tcl_SetObjResult(interp, xmlinfo->entitycommand); } break; case TCLXML_UNKNOWNENCODINGCMD: if (xmlinfo->unknownencodingcommand) { Tcl_SetObjResult(interp, xmlinfo->unknownencodingcommand); } break; case TCLXML_COMMENTCMD: if (xmlinfo->commentCommand) { Tcl_SetObjResult(interp, xmlinfo->commentCommand); } break; case TCLXML_NOTSTANDALONECMD: if (xmlinfo->notStandaloneCommand) { Tcl_SetObjResult(interp, xmlinfo->notStandaloneCommand); } break; #ifdef TCLXML_CDATASECTIONS case TCLXML_STARTCDATASECTIONCMD: if (xmlinfo->startCdataSectionCommand) { Tcl_SetObjResult(interp, xmlinfo->startCdataSectionCommand); } break; case TCLXML_ENDCDATASECTIONCMD: if (xmlinfo->endCdataSectionCommand) { Tcl_SetObjResult(interp, xmlinfo->endCdataSectionCommand); } break; #else case TCLXML_STARTCDATASECTIONCMD: case TCLXML_ENDCDATASECTIONCMD: break; #endif case TCLXML_ELEMENTDECLCMD: if (xmlinfo->elementDeclCommand) { Tcl_SetObjResult(interp, xmlinfo->elementDeclCommand); } break; case TCLXML_ATTLISTDECLCMD: if (xmlinfo->attlistDeclCommand) { Tcl_SetObjResult(interp, xmlinfo->attlistDeclCommand); } break; case TCLXML_STARTDOCTYPEDECLCMD: if (xmlinfo->startDoctypeDeclCommand) { Tcl_SetObjResult(interp, xmlinfo->startDoctypeDeclCommand); } break; case TCLXML_ENDDOCTYPEDECLCMD: if (xmlinfo->endDoctypeDeclCommand) { Tcl_SetObjResult(interp, xmlinfo->endDoctypeDeclCommand); } break; case TCLXML_ENTITYDECLCMD: case TCLXML_PARAMENTITYDECLCMD: case TCLXML_DOCTYPECMD: case TCLXML_ENTITYREFCMD: case TCLXML_XMLDECLCMD: /* These are not (yet) supported) */ break; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXMLConfigureParserInstance -- * * Set an option in a parser instance. * * Results: * Standard Tcl result. * * Side effects: * Depends on parser class. * *---------------------------------------------------------------------------- */ static int TclXMLConfigureParserInstance (xmlinfo, option, value) TclXML_Info *xmlinfo; Tcl_Obj *option; Tcl_Obj *value; { TclXML_ParserClassInfo *classInfo = (TclXML_ParserClassInfo *) xmlinfo->parserClass; if (classInfo->configure) { if ((*classInfo->configure)(xmlinfo->clientData, option, value) != TCL_OK) { return TCL_ERROR; } } else if (classInfo->configureCmd) { Tcl_Obj *cmdPtr = Tcl_DuplicateObj(classInfo->configureCmd); int result; Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); /* SF Bug 514045. */ if (xmlinfo->clientData) { Tcl_ListObjAppendElement(NULL, cmdPtr, (Tcl_Obj *) xmlinfo->clientData); } else if (xmlinfo->name) { Tcl_ListObjAppendElement(NULL, cmdPtr, xmlinfo->name); } Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, option); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, value); result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); if (result != TCL_OK) { return TCL_ERROR; } } else { Tcl_SetResult(xmlinfo->interp, "no configure procedure for parser", NULL); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXMLGet -- * * Returns runtime parser information, depending on option * ericm@scriptics.com, 1999.6.28 * * Results: * Option value. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static int TclXMLGet (interp, xmlinfo, objc, objv) Tcl_Interp *interp; TclXML_Info *xmlinfo; int objc; Tcl_Obj *CONST objv[]; { TclXML_ParserClassInfo *classInfo = (TclXML_ParserClassInfo *) xmlinfo->parserClass; if (classInfo->get) { return (*classInfo->get)(xmlinfo->clientData, objc, objv); } else if (classInfo->getCmd) { Tcl_Obj *cmdPtr = Tcl_DuplicateObj(classInfo->getCmd); int i, result; Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); for (i = 0; i < objc; i++) { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, objv[i]); } result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); return result; } else { Tcl_SetResult(interp, "parser has no get procedure", NULL); return TCL_ERROR; } } /* *---------------------------------------------------------------------------- * * TclXMLHandlerResult -- * * Manage the result of the application callback. * * Results: * None. * * Side Effects: * Further invocation of callback scripts may be inhibited. * *---------------------------------------------------------------------------- */ static void TclXMLHandlerResult(xmlinfo, result) TclXML_Info *xmlinfo; int result; { switch (result) { case TCL_OK: xmlinfo->status = TCL_OK; break; case TCL_CONTINUE: /* * Skip callbacks until the matching end element event * occurs for the currently open element. * Keep a reference count to handle nested * elements. */ xmlinfo->status = TCL_CONTINUE; xmlinfo->continueCount = 0; break; case TCL_BREAK: /* * Skip all further callbacks, but return OK. */ xmlinfo->status = TCL_BREAK; break; case TCL_ERROR: default: /* * Skip all further callbacks, and return error. */ xmlinfo->status = TCL_ERROR; xmlinfo->result = Tcl_GetObjResult(xmlinfo->interp); Tcl_IncrRefCount(xmlinfo->result); break; } } /* *---------------------------------------------------------------------------- * * TclXML_ElementStartHandler -- * * Called by parser instance for each start tag. * * Results: * None. * * Side Effects: * Callback script is invoked. * *---------------------------------------------------------------------------- */ void TclXML_ElementStartHandler(userData, name, nsuri, atts, nsDecls) void *userData; Tcl_Obj *name; Tcl_Obj *nsuri; Tcl_Obj *atts; Tcl_Obj *nsDecls; { TclXML_Info *xmlinfo = (TclXML_Info *) userData; int result = TCL_OK; TclXMLDispatchPCDATA(xmlinfo); if (xmlinfo->status == TCL_CONTINUE) { /* * We're currently skipping elements looking for the * close of the continued element. */ xmlinfo->continueCount++; return; } if ((xmlinfo->elementstartcommand == NULL && xmlinfo->elementstart == NULL) || xmlinfo->status != TCL_OK) { return; } if (xmlinfo->elementstart) { result = (xmlinfo->elementstart)(xmlinfo->interp, xmlinfo->elementstartdata, name, nsuri, atts, nsDecls); } else if (xmlinfo->elementstartcommand) { Tcl_Obj *cmdPtr; /* * Take a copy of the callback script so that arguments may be appended. */ cmdPtr = Tcl_DuplicateObj(xmlinfo->elementstartcommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, name); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, atts); if (nsuri) { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, Tcl_NewStringObj("-namespace", -1)); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, nsuri); } if (nsDecls) { int len; if ((Tcl_ListObjLength(xmlinfo->interp, nsDecls, &len) == TCL_OK) && (len > 0)) { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, Tcl_NewStringObj("-namespacedecls", -1)); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, nsDecls); } } /* * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); } /* *---------------------------------------------------------------------------- * * TclXML_ElementEndHandler -- * * Called by parser instance for each end tag. * * Results: * None. * * Side Effects: * Callback script is invoked. * *---------------------------------------------------------------------------- */ void TclXML_ElementEndHandler(userData, name) void *userData; Tcl_Obj *name; { TclXML_Info *xmlinfo = (TclXML_Info *) userData; int result = TCL_OK;; TclXMLDispatchPCDATA(xmlinfo); if (xmlinfo->status == TCL_CONTINUE) { /* * We're currently skipping elements looking for the * end of the currently open element. */ if (!--(xmlinfo->continueCount)) { xmlinfo->status = TCL_OK; } else { return; } } if ((xmlinfo->elementend == NULL && xmlinfo->elementendcommand == NULL) || xmlinfo->status != TCL_OK) { return; } if (xmlinfo->elementend) { result = (xmlinfo->elementend)(xmlinfo->interp, xmlinfo->elementenddata, name); } else if (xmlinfo->elementendcommand) { Tcl_Obj *cmdPtr; /* * Take a copy of the callback script so that arguments may be appended. */ cmdPtr = Tcl_DuplicateObj(xmlinfo->elementendcommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, name); /* * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); return; } /* *---------------------------------------------------------------------------- * * TclXML_CharacterDataHandler -- * * Called by parser instance for character data. * * Results: * None. * * Side Effects: * Character data is accumulated in a string object * *---------------------------------------------------------------------------- */ void TclXML_CharacterDataHandler(userData, s) void *userData; Tcl_Obj *s; { TclXML_Info *xmlinfo = (TclXML_Info *) userData; if (xmlinfo->cdata == NULL) { xmlinfo->cdata = s; Tcl_IncrRefCount(xmlinfo->cdata); } else { Tcl_AppendObjToObj(xmlinfo->cdata, s); } } /* *---------------------------------------------------------------------------- * * TclXMLDispatchPCDATA -- * * Called to check whether any accumulated character data * exists, and if so invoke the callback. * * Results: * None. * * Side Effects: * Callback script evaluated. * *---------------------------------------------------------------------------- */ static void TclXMLDispatchPCDATA(xmlinfo) TclXML_Info *xmlinfo; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); int result = TCL_OK; if (xmlinfo->cdata == NULL || (xmlinfo->datacommand == NULL && xmlinfo->cdatacb == NULL) || xmlinfo->status != TCL_OK) { return; } /* * Optionally ignore white-space-only PCDATA */ if (xmlinfo->nowhitespace) { if (!Tcl_RegExpMatchObj(xmlinfo->interp, xmlinfo->cdata, tsdPtr->whitespaceRE)) { goto finish; } } if (xmlinfo->cdatacb) { result = (xmlinfo->cdatacb)(xmlinfo->interp, xmlinfo->cdatacbdata, xmlinfo->cdata); } else if (xmlinfo->datacommand) { Tcl_Obj *cmdPtr; /* * Take a copy of the callback script so that arguments may be appended. */ cmdPtr = Tcl_DuplicateObj(xmlinfo->datacommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); if (Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, xmlinfo->cdata) != TCL_OK) { xmlinfo->status = TCL_ERROR; return; } /* * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); finish: Tcl_DecrRefCount(xmlinfo->cdata); xmlinfo->cdata = NULL; return; } /* *---------------------------------------------------------------------------- * * TclXML_ProcessingInstructionHandler -- * * Called by parser instance for processing instructions. * * Results: * None. * * Side Effects: * Callback script is invoked. * *---------------------------------------------------------------------------- */ void TclXML_ProcessingInstructionHandler(userData, target, data) void *userData; Tcl_Obj *target; Tcl_Obj *data; { TclXML_Info *xmlinfo = (TclXML_Info *) userData; int result = TCL_OK; TclXMLDispatchPCDATA(xmlinfo); if ((xmlinfo->picommand == NULL && xmlinfo->pi == NULL) || xmlinfo->status != TCL_OK) { return; } if (xmlinfo->pi) { result = (xmlinfo->pi)(xmlinfo->interp, xmlinfo->pidata, target, data); } else if (xmlinfo->picommand) { Tcl_Obj *cmdPtr; /* * Take a copy of the callback script so that arguments may be appended. */ cmdPtr = Tcl_DuplicateObj(xmlinfo->picommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, target); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, data); /* * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); return; } /* *---------------------------------------------------------------------------- * * TclXML_DefaultHandler -- * * Called by parser instance for processing data which has no other handler. * * Results: * None. * * Side Effects: * Callback script is invoked. * *---------------------------------------------------------------------------- */ void TclXML_DefaultHandler(userData, s) void *userData; Tcl_Obj *s; { TclXML_Info *xmlinfo = (TclXML_Info *) userData; int result = TCL_OK; TclXMLDispatchPCDATA(xmlinfo); if ((xmlinfo->defaultcommand == NULL && xmlinfo->defaultcb == NULL) || xmlinfo->status != TCL_OK) { return; } if (xmlinfo->defaultcb) { result = (xmlinfo->defaultcb)(xmlinfo->interp, xmlinfo->defaultdata, s); } else if (xmlinfo->defaultcommand) { Tcl_Obj *cmdPtr; /* * Take a copy of the callback script so that arguments may be appended. */ cmdPtr = Tcl_DuplicateObj(xmlinfo->defaultcommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, s); /* * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); return; } /* *---------------------------------------------------------------------------- * * TclXML_UnparsedDeclHandler -- * * Called by parser instance for processing an unparsed entity references. * * Results: * None. * * Side Effects: * Callback script is invoked. * *---------------------------------------------------------------------------- */ void TclXML_UnparsedDeclHandler(userData, entityName, base, systemId, publicId, notationName) void *userData; Tcl_Obj *entityName; Tcl_Obj *base; Tcl_Obj *systemId; Tcl_Obj *publicId; Tcl_Obj *notationName; { TclXML_Info *xmlinfo = (TclXML_Info *) userData; int result = TCL_OK; TclXMLDispatchPCDATA(xmlinfo); if ((xmlinfo->unparsedcommand == NULL && xmlinfo->unparsed == NULL) || xmlinfo->status != TCL_OK) { return; } if (xmlinfo->unparsed) { result = (xmlinfo->unparsed)(xmlinfo->interp, xmlinfo->unparseddata, entityName, base, systemId, publicId, notationName); } else if (xmlinfo->unparsedcommand) { Tcl_Obj *cmdPtr; /* * Take a copy of the callback script so that arguments may be appended. */ cmdPtr = Tcl_DuplicateObj(xmlinfo->unparsedcommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, entityName); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, base); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, systemId); if (publicId == NULL) { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, Tcl_NewObj()); } else { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, publicId); } if (notationName == NULL) { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, Tcl_NewObj()); } else { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, notationName); } /* * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); return; } /* *---------------------------------------------------------------------------- * * TclXML_NotationDeclHandler -- * * Called by parser instance for processing a notation declaration. * * Results: * None. * * Side Effects: * Callback script is invoked. * *---------------------------------------------------------------------------- */ void TclXML_NotationDeclHandler(userData, notationName, base, systemId, publicId) void *userData; Tcl_Obj *notationName; Tcl_Obj *base; Tcl_Obj *systemId; Tcl_Obj *publicId; { TclXML_Info *xmlinfo = (TclXML_Info *) userData; int result = TCL_OK; TclXMLDispatchPCDATA(xmlinfo); if ((xmlinfo->notationcommand == NULL && xmlinfo->notation == NULL) || xmlinfo->status != TCL_OK) { return; } if (xmlinfo->notation) { result = (xmlinfo->notation)(xmlinfo->interp, xmlinfo->notationdata, notationName, base, systemId, publicId); } else if (xmlinfo->notationcommand) { Tcl_Obj *cmdPtr; /* * Take a copy of the callback script so that arguments may be appended. */ cmdPtr = Tcl_DuplicateObj(xmlinfo->notationcommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, notationName); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, base); if (systemId == NULL) { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, Tcl_NewObj()); } else { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, systemId); } if (publicId == NULL) { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, Tcl_NewObj()); } else { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, publicId); } /* * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); return; } /* *---------------------------------------------------------------------------- * * TclXML_UnknownEncodingHandler -- * * Called by parser instance for processing a reference to a character in an * unknown encoding. * * Results: * None. * * Side Effects: * Callback script is invoked. * *---------------------------------------------------------------------------- */ int TclXML_UnknownEncodingHandler(encodingHandlerData, name, info) void *encodingHandlerData; Tcl_Obj *name; void *info; { TclXML_Info *xmlinfo = (TclXML_Info *) encodingHandlerData; int result = TCL_OK; TclXMLDispatchPCDATA(xmlinfo); Tcl_SetResult(xmlinfo->interp, "not implemented", NULL); return 0; if ((xmlinfo->unknownencodingcommand == NULL && xmlinfo->unknownencoding == NULL) || xmlinfo->status != TCL_OK) { return 0; } if (xmlinfo->unknownencoding) { result = (xmlinfo->unknownencoding)(xmlinfo->interp, xmlinfo->unknownencodingdata, name, info); } else if (xmlinfo->unknownencodingcommand) { Tcl_Obj *cmdPtr; /* * Take a copy of the callback script so that arguments may be appended. */ cmdPtr = Tcl_DuplicateObj(xmlinfo->unknownencodingcommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); /* * Setup the arguments */ /* * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); return 0; } /* *---------------------------------------------------------------------------- * * TclXML_ExternalEntityRefHandler -- * * Called by parser instance for processing external entity references. * May also be called outside the context of a parser for XInclude * or XSLT import/include. * * Results: * Returns success code. * * Side Effects: * Callback script is invoked. * *---------------------------------------------------------------------------- */ int TclXML_ExternalEntityRefHandler(userData, openEntityNames, base, systemId, publicId) ClientData userData; /* NULL if not in parser context, current interp gets result */ Tcl_Obj *openEntityNames; Tcl_Obj *base; Tcl_Obj *systemId; Tcl_Obj *publicId; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); TclXML_Info *xmlinfo = (TclXML_Info *) userData; int result = TCL_OK; Tcl_Obj *oldContext; if (xmlinfo != NULL) { TclXMLDispatchPCDATA(xmlinfo); if (xmlinfo->entitycommand == NULL && xmlinfo->entity == NULL) { if (Tcl_IsSafe(xmlinfo->interp)) { return TCL_BREAK; } else { return TCL_CONTINUE; } } if (xmlinfo->status != TCL_OK) { return xmlinfo->status; } oldContext = xmlinfo->context; xmlinfo->context = openEntityNames; if (xmlinfo->entity) { result = (xmlinfo->entity)(xmlinfo->interp, xmlinfo->entitydata, xmlinfo->name, base, systemId, publicId); } else if (xmlinfo->entitycommand) { Tcl_Obj *cmdPtr; /* * Take a copy of the callback script so that arguments may be appended. */ cmdPtr = Tcl_DuplicateObj(xmlinfo->entitycommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, xmlinfo->name); if (base) { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, base); } else { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, Tcl_NewObj()); } Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, systemId); if (publicId) { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, publicId); } else { Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, Tcl_NewObj()); } /* * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } /* * Return results have a different meaning for external entities, * so don't retain the result for later use. * TclXMLHandlerResult(xmlinfo, result); */ xmlinfo->context = oldContext; } else { /* * No parser context */ if (tsdPtr->externalentitycmd) { Tcl_Obj *cmdPtr; /* * Take a copy of the callback script so that arguments may be appended. */ cmdPtr = Tcl_DuplicateObj(tsdPtr->externalentitycmd); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) tsdPtr->interp); if (base) { Tcl_ListObjAppendElement(tsdPtr->interp, cmdPtr, base); } else { Tcl_ListObjAppendElement(tsdPtr->interp, cmdPtr, Tcl_NewObj()); } Tcl_ListObjAppendElement(tsdPtr->interp, cmdPtr, systemId); if (publicId) { Tcl_ListObjAppendElement(tsdPtr->interp, cmdPtr, publicId); } else { Tcl_ListObjAppendElement(tsdPtr->interp, cmdPtr, Tcl_NewObj()); } /* * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ result = Tcl_GlobalEvalObj(tsdPtr->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) tsdPtr->interp); } else if (Tcl_IsSafe(tsdPtr->interp)) { return TCL_BREAK; } else { return TCL_CONTINUE; } } return result; } /* *---------------------------------------------------------------------------- * * TclXML_CommentHandler -- * * Called by parser instance to handle comments encountered while parsing * Added by ericm@scriptics.com, 1999.6.25. * * Results: * None. * * Side Effects: * Callback script is invoked. * *---------------------------------------------------------------------------- */ void TclXML_CommentHandler(userData, data) void *userData; Tcl_Obj *data; { TclXML_Info *xmlinfo = (TclXML_Info *) userData; int result = TCL_OK; TclXMLDispatchPCDATA(xmlinfo); if (xmlinfo->status == TCL_CONTINUE) { /* Currently skipping elements, looking for the close of the * continued element. Comments don't have an end tag, so * don't increment xmlinfo->continueCount */ return; } if ((xmlinfo->commentCommand == NULL && xmlinfo->comment == NULL) || xmlinfo->status != TCL_OK) { return; } if (xmlinfo->comment) { result = (xmlinfo->comment)(xmlinfo->interp, xmlinfo->commentdata, data); } else if (xmlinfo->commentCommand) { Tcl_Obj *cmdPtr; cmdPtr = Tcl_DuplicateObj(xmlinfo->commentCommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, data); result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); return; } /* *---------------------------------------------------------------------------- * * TclXML_NotStandaloneHandler -- * * Called by parser instance to handle "not standalone" documents (ie, documents * that have an external subset or a reference to a parameter entity, * but do not have standalone="yes") * Added by ericm@scriptics.com, 1999.6.25. * * Results: * None. * * Side Effects: * Callback script is invoked. * *---------------------------------------------------------------------------- */ int TclXML_NotStandaloneHandler(userData) void *userData; { TclXML_Info *xmlinfo = (TclXML_Info *) userData; int result = TCL_OK; TclXMLDispatchPCDATA(xmlinfo); if (xmlinfo->status != TCL_OK) { return 0; } else if (xmlinfo->notStandaloneCommand == NULL && xmlinfo->notStandalone == NULL) { return 1; } if (xmlinfo->notStandalone) { result = (xmlinfo->notStandalone)(xmlinfo->interp, xmlinfo->notstandalonedata); } else if (xmlinfo->notStandaloneCommand) { Tcl_Obj *cmdPtr; cmdPtr = Tcl_DuplicateObj(xmlinfo->notStandaloneCommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); return 1; } /* *---------------------------------------------------------------------- * * TclXML_ElementDeclHandler -- * * Called by expat to handle elementDeclCommand == NULL && xmlinfo->elementDecl == NULL) || xmlinfo->status != TCL_OK) { return; } if (xmlinfo->elementDecl) { result = (xmlinfo->elementDecl)(xmlinfo->interp, xmlinfo->elementdecldata, name, contentspec); } else if (xmlinfo->elementDeclCommand) { Tcl_Obj *cmdPtr; cmdPtr = Tcl_DuplicateObj(xmlinfo->elementDeclCommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, name); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, contentspec); result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); return; } /* *---------------------------------------------------------------------- * * TclXML_AttlistDeclHandler -- * * Called by parser instance to handle attlistDeclCommand == NULL && xmlinfo->attlistDecl == NULL) || xmlinfo->status != TCL_OK) { return; } if (xmlinfo->attlistDecl) { result = (xmlinfo->attlistDecl)(xmlinfo->interp, xmlinfo->attlistdecldata, name, attributes); } else if (xmlinfo->attlistDeclCommand) { Tcl_Obj *cmdPtr; cmdPtr = Tcl_DuplicateObj(xmlinfo->attlistDeclCommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, name); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, attributes); result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); return; } /* *---------------------------------------------------------------------- * * TclXML_StartDoctypeDeclHandler -- * * Called by parser instance to handle the start of startDoctypeDeclCommand == NULL && xmlinfo->startDoctypeDecl == NULL) || xmlinfo->status != TCL_OK) { return; } if (xmlinfo->startDoctypeDecl) { result = (xmlinfo->startDoctypeDecl)(xmlinfo->interp, xmlinfo->startdoctypedecldata, name); } else if (xmlinfo->startDoctypeDeclCommand) { Tcl_Obj *cmdPtr; cmdPtr = Tcl_DuplicateObj(xmlinfo->startDoctypeDeclCommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); Tcl_ListObjAppendElement(xmlinfo->interp, cmdPtr, name); result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); return; } /* *---------------------------------------------------------------------- * * TclXML_EndDoctypeDeclHandler -- * * Called by parser instance to handle the end of endDoctypeDeclCommand == NULL && xmlinfo->endDoctypeDecl == NULL) || xmlinfo->status != TCL_OK) { return; } if (xmlinfo->endDoctypeDecl) { result = (xmlinfo->endDoctypeDecl)(xmlinfo->interp, xmlinfo->enddoctypedecldata); } else if (xmlinfo->endDoctypeDeclCommand) { Tcl_Obj *cmdPtr; cmdPtr = Tcl_DuplicateObj(xmlinfo->endDoctypeDeclCommand); Tcl_IncrRefCount(cmdPtr); Tcl_Preserve((ClientData) xmlinfo->interp); result = Tcl_GlobalEvalObj(xmlinfo->interp, cmdPtr); Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) xmlinfo->interp); } TclXMLHandlerResult(xmlinfo, result); return; } /* *---------------------------------------------------------------------------- * * TclXMLInstanceDeleteCmd -- * * Called when a parser instance is deleted. * * Results: * None. * * Side Effects: * Memory structures are freed. * *---------------------------------------------------------------------------- */ static void TclXMLInstanceDeleteCmd(clientData) ClientData clientData; { TclXML_Info *xmlinfo = (TclXML_Info *) clientData; Tcl_DecrRefCount(xmlinfo->name); if (xmlinfo->cdata) { Tcl_DecrRefCount(xmlinfo->cdata); xmlinfo->cdata = NULL; } if (xmlinfo->elementstartcommand) { Tcl_DecrRefCount(xmlinfo->elementstartcommand); } if (xmlinfo->elementendcommand) { Tcl_DecrRefCount(xmlinfo->elementendcommand); } if (xmlinfo->datacommand) { Tcl_DecrRefCount(xmlinfo->datacommand); } if (xmlinfo->picommand) { Tcl_DecrRefCount(xmlinfo->picommand); } if (xmlinfo->entitycommand) { Tcl_DecrRefCount(xmlinfo->entitycommand); } if (xmlinfo->unknownencodingcommand) { Tcl_DecrRefCount(xmlinfo->unknownencodingcommand); } if (xmlinfo->commentCommand) { Tcl_DecrRefCount(xmlinfo->commentCommand); } if (xmlinfo->notStandaloneCommand) { Tcl_DecrRefCount(xmlinfo->notStandaloneCommand); } if (xmlinfo->elementDeclCommand) { Tcl_DecrRefCount(xmlinfo->elementDeclCommand); } if (xmlinfo->attlistDeclCommand) { Tcl_DecrRefCount(xmlinfo->attlistDeclCommand); } if (xmlinfo->startDoctypeDeclCommand) { Tcl_DecrRefCount(xmlinfo->startDoctypeDeclCommand); } if (xmlinfo->endDoctypeDeclCommand) { Tcl_DecrRefCount(xmlinfo->endDoctypeDeclCommand); } TclXMLFreeParser(xmlinfo); } /* *---------------------------------------------------------------------------- * * TclXML_Register*Cmd -- * * Configures a direct callback handler. * * Results: * None. * * Side Effects: * Parser data structure modified. * *---------------------------------------------------------------------------- */ int TclXML_RegisterElementStartProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_ElementStartProc *callback; { parser->elementstart = callback; parser->elementstartdata = clientData; if (parser->elementstartcommand) { Tcl_DecrRefCount(parser->elementstartcommand); parser->elementstartcommand = NULL; } return TCL_OK; } int TclXML_RegisterElementEndProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_ElementEndProc *callback; { parser->elementend = callback; parser->elementenddata = clientData; if (parser->elementendcommand) { Tcl_DecrRefCount(parser->elementendcommand); parser->elementendcommand = NULL; } return TCL_OK; } int TclXML_RegisterCharacterDataProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_CharacterDataProc *callback; { parser->cdatacb = callback; parser->cdatacbdata = clientData; if (parser->datacommand) { Tcl_DecrRefCount(parser->datacommand); parser->datacommand = NULL; } return TCL_OK; } int TclXML_RegisterPIProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_PIProc *callback; { parser->pi = callback; parser->pidata = clientData; if (parser->picommand) { Tcl_DecrRefCount(parser->picommand); parser->picommand = NULL; } return TCL_OK; } int TclXML_RegisterDefaultProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_DefaultProc *callback; { parser->defaultcb = callback; parser->defaultdata = clientData; if (parser->defaultcommand) { Tcl_DecrRefCount(parser->defaultcommand); parser->defaultcommand = NULL; } return TCL_OK; } int TclXML_RegisterUnparsedProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_UnparsedProc *callback; { parser->unparsed = callback; parser->unparseddata = clientData; if (parser->unparsedcommand) { Tcl_DecrRefCount(parser->unparsedcommand); parser->unparsedcommand = NULL; } return TCL_OK; } int TclXML_RegisterNotationDeclProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_NotationDeclProc *callback; { parser->notation = callback; parser->notationdata = clientData; if (parser->notationcommand) { Tcl_DecrRefCount(parser->notationcommand); parser->notationcommand = NULL; } return TCL_OK; } int TclXML_RegisterEntityProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_EntityProc *callback; { parser->entity = callback; parser->entitydata = clientData; if (parser->entitycommand) { Tcl_DecrRefCount(parser->entitycommand); parser->entitycommand = NULL; } return TCL_OK; } int TclXML_RegisterUnknownEncodingProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_UnknownEncodingProc *callback; { parser->unknownencoding = callback; parser->unknownencodingdata = clientData; if (parser->unknownencodingcommand) { Tcl_DecrRefCount(parser->unknownencodingcommand); parser->unknownencodingcommand = NULL; } return TCL_OK; } int TclXML_RegisterCommentProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_CommentProc *callback; { parser->comment = callback; parser->commentdata = clientData; if (parser->commentCommand) { Tcl_DecrRefCount(parser->commentCommand); parser->commentCommand = NULL; } return TCL_OK; } int TclXML_RegisterNotStandaloneProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_NotStandaloneProc *callback; { parser->notStandalone = callback; parser->notstandalonedata = clientData; if (parser->notStandaloneCommand) { Tcl_DecrRefCount(parser->notStandaloneCommand); parser->notStandaloneCommand = NULL; } return TCL_OK; } int TclXML_RegisterElementDeclProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_ElementDeclProc *callback; { parser->elementDecl = callback; parser->elementdecldata = clientData; if (parser->elementDeclCommand) { Tcl_DecrRefCount(parser->elementDeclCommand); parser->elementDeclCommand = NULL; } return TCL_OK; } int TclXML_RegisterAttListDeclProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_AttlistDeclProc *callback; { parser->attlistDecl = callback; parser->attlistdecldata = clientData; if (parser->attlistDeclCommand) { Tcl_DecrRefCount(parser->attlistDeclCommand); parser->attlistDeclCommand = NULL; } return TCL_OK; } int TclXML_RegisterStartDoctypeDeclProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_StartDoctypeDeclProc *callback; { parser->startDoctypeDecl = callback; parser->startdoctypedecldata = clientData; if (parser->startDoctypeDeclCommand) { Tcl_DecrRefCount(parser->startDoctypeDeclCommand); parser->startDoctypeDeclCommand = NULL; } return TCL_OK; } int TclXML_RegisterEndDoctypeDeclProc(interp, parser, clientData, callback) Tcl_Interp *interp; TclXML_Info *parser; ClientData clientData; TclXML_EndDoctypeDeclProc *callback; { parser->endDoctypeDecl = callback; parser->enddoctypedecldata = clientData; if (parser->endDoctypeDeclCommand) { Tcl_DecrRefCount(parser->endDoctypeDeclCommand); parser->endDoctypeDeclCommand = NULL; } return TCL_OK; } tclxml-3.3~svn11.orig/tcldom-tcl/0000755000000000000000000000000011574742511015457 5ustar rootroottclxml-3.3~svn11.orig/tcldom-tcl/dommap.tcl0000644000000000000000000000514011113705304017424 0ustar rootroot# dommap.tcl -- # # Apply a mapping function to a DOM structure # # Copyright (c) 1998-2003 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: dommap.tcl,v 1.5 2003/12/09 04:56:43 balls Exp $ package provide dommap 1.0 # We need the DOM package require dom 2.6 namespace eval dommap { namespace export map } # dommap::apply -- # # Apply a function to a DOM document. # # The callback command is invoked with the node ID of the # matching DOM node as its argument. The command may return # an error, continue or break code to alter the processing # of further nodes. # # Filter functions may be applied to match particular # nodes. Valid functions include: # # -nodeType regexp # -nodeName regexp # -nodeValue regexp # -attribute {regexp regexp} # # If a filter is specified then the node must match for the # callback command to be invoked. If a filter is not specified # then all nodes match that filter. # # Arguments: # node DOM document node # cmd callback command # args configuration options # # Results: # Depends on callback command proc dommap::apply {node cmd args} { array set opts $args # Does this node match? set match 1 catch {set match [expr $match && [regexp $opts(-nodeType) [::dom::node cget $node -nodeType]]]} catch {set match [expr $match && [regexp $opts(-nodeName) [::dom::node cget $node -nodeName]]]} catch {set match [expr $match && [regexp $opts(-nodeValue) [::dom::node cget $node -nodeValue]]]} if {$match && ![string compare [::dom::node cget $node -nodeType] element]} { set match 0 foreach {attrName attrValue} [array get [::dom::node cget $node -attributes]] { set match 1 catch {set match [expr $match && [regexp [lindex $opts(-attribute) 0] $attrName]]} catch {set match [expr $match && [regexp [lindex $opts(-attribute) 1] $attrValue]]} if {$match} break } } if {$match && [set code [catch {eval $cmd [list $node]} msg]]} { switch $code { 0 {} 3 { return -code break } 4 { return -code continue } default { return -code error $msg } } } # Process children foreach child [::dom::node children $node] { switch [catch {eval apply [list $child] [list $cmd] $args} msg] { 0 { # No action required } 3 { # break return -code break } 4 { # continue - skip processing of siblings return } 1 - 2 - default { # propagate the error message return -code error $msg } } } return {} } tclxml-3.3~svn11.orig/tcldom-tcl/dom.tcl0000644000000000000000000032330211113705304016731 0ustar rootroot# dom.tcl -- # # This file implements the Tcl language binding for the DOM - # the Document Object Model. Support for the core specification # is given here. Layered support for specific languages, # such as HTML, will be in separate modules. # # Copyright (c) 1998-2004 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: dom.tcl,v 1.23 2004/02/25 20:10:28 balls Exp $ # We need the xml package, so that we get Name defined package require xml 3.0 package provide dom::tcl 3.0 # Define generic constants namespace eval dom { namespace export DOMImplementation namespace export hasFeature createDocument create createDocumentType namespace export createNode destroy isNode parse selectNode serialize namespace export trim namespace export document documentFragment node namespace export element textNode attribute namespace export processingInstruction namespace export documenttype namespace export event variable maxSpecials if {![info exists maxSpecials]} { set maxSpecials 10 } variable strictDOM 0 # Default -indentspec value # spaces-per-indent-level {collapse-re collapse-value} variable indentspec [list 2 [list { } \t]] # The Namespace URI for XML Namespace declarations variable xmlnsURI http://www.w3.org/2000/xmlns/ # DOM Level 2 Event defaults variable bubbles array set bubbles { DOMFocusIn 1 DOMFocusOut 1 DOMActivate 1 click 1 mousedown 1 mouseup 1 mouseover 1 mousemove 1 mouseout 1 DOMSubtreeModified 1 DOMNodeInserted 1 DOMNodeRemoved 1 DOMNodeInsertedIntoDocument 0 DOMNodeRemovedFromDocument 0 DOMAttrModified 1 DOMAttrRemoved 1 DOMCharacterDataModified 1 } variable cancelable array set cancelable { DOMFocusIn 0 DOMFocusOut 0 DOMActivate 1 click 1 mousedown 1 mouseup 1 mouseover 1 mousemove 0 mouseout 1 DOMSubtreeModified 0 DOMNodeInserted 0 DOMNodeRemoved 0 DOMNodeInsertedIntoDocument 0 DOMNodeRemovedFromDocument 0 DOMAttrModified 0 DOMAttrRemoved 0 DOMCharacterDataModified 0 } } namespace eval dom::tcl { namespace export DOMImplementation namespace export hasFeature createDocument create createDocumentType namespace export createNode destroy isNode parse selectNode serialize namespace export trim namespace export document documentFragment node namespace export element textNode attribute namespace export processingInstruction namespace export event } foreach p {DOMImplementation hasFeature createDocument create createDocumentType createNode destroy isNode parse selectNode serialize trim document documentFragment node element textNode attribute processingInstruction event documenttype} { proc dom::$p args "return \[eval tcl::$p \$args\]" } # Data structures # # Documents are stored in a Tcl namespace within the ::dom namespace. # The Document array variable stores data for the document itself. # Each node has an array variable for its data. # # "Live" data objects are stored as a separate Tcl variable. # Lists, such as child node lists, are Tcl list variables (ie scalar) # and keyed-value lists, such as attribute lists, are Tcl array # variables. The accessor function returns the variable name, # which the application should treat as a read-only object. # # A token is a FQ Tcl variable name. # dom::tcl::DOMImplementation -- # # Implementation-dependent functions. # Most importantly, this command provides a function to # create a document instance. # # Arguments: # method method to invoke # token token for node # args arguments for method # # Results: # Depends on method used. namespace eval dom::tcl { variable DOMImplementationOptions {} variable DOMImplementationCounter if {![info exists DOMImplementationCounter]} { set DOMImplementationCounter 0 } } proc dom::tcl::DOMImplementation {method args} { variable DOMImplementationOptions variable DOMImplementationCounter switch -- $method { hasFeature { if {[llength $args] != 2} { return -code error "wrong # args: should be dom::DOMImplementation method args..." } # Later on, could use Tcl package facility if {[regexp {create|destroy|parse|query|serialize|trim|Events|UIEvents|isNode} [lindex $args 0]]} { if {![string compare [lindex $args 1] "1.0"]} { return 1 } else { return 0 } } else { return 0 } } createDocument { # createDocument introduced in DOM Level 2 if {[llength $args] != 3} { return -code error "wrong # args: should be DOMImplementation nsURI name doctype" } set doc [DOMImplementation create] if {[string length [lindex $args 2]]} { array set $doc [list document:doctype [lindex $args 2]] } document createElementNS $doc [lindex $args 0] [lindex $args 1] return $doc } create { # Non-standard method (see createDocument) # Bootstrap a document instance if {[llength $args] > 0} { return -code error "wrong # args: should be DOMImplementation create" } # Allocate unique document array name set ns [namespace current]::document[incr DOMImplementationCounter] set name ${ns}::Document # Create the Tcl namespace for this document namespace eval $ns { namespace export Document } set varPrefix ${name}var set arrayPrefix ${name}arr array set $name [list counter 1 \ node:nodeType document \ node:parentNode {} \ node:nodeName #document \ node:nodeValue {} \ node:childNodes ${varPrefix}1 \ documentFragment:masterDoc $name \ document:implementation [namespace current]::DOMImplementation \ document:xmldecl {version 1.0} \ document:documentElement {} \ document:doctype {} \ ] # Initialise child node list set $varPrefix {} # Create a Tcl command for the document proc $name {method args} "return \[eval [namespace current]::document \[list \$method\] $name \$args\]" # Capture destruction of the document trace add command $name delete [namespace code [list Document:Delete $name]] # Return the new toplevel node return $name } createDocumentType { # Introduced in DOM Level 2 # Patch from c.l.t., Richard Calmbach (rc@hnc.com ) if {[llength $args] < 3 || [llength $args] > 4} { return -code error "wrong # args: should be: DOMImplementation createDocumentType qname publicid systemid ?internaldtd?" } return [eval CreateDocType $args] } createNode { # Non-standard method # Creates node(s) in the given document given an XPath expression if {[llength $args] != 2} { return -code error "wrong # args: should be dom::DOMImplementation createNode xpath" } package require xpath return [XPath:CreateNode [lindex $args 0] [lindex $args 1]] } destroy { # Free all memory associated with a node if {[llength $args] != 1} { return -code error "wrong # args: should be dom::DOMImplementation destroy token" } if {[catch {upvar #0 [lindex $args 0] node}]} { # If the document is being destroyed then the Tcl namespace no longer exists return {} } switch $node(node:nodeType) { document - documentFragment { if {[string length $node(node:parentNode)]} { unset $node(node:childNodes) # Dispatch events event postMutationEvent $node(node:parentNode) DOMSubtreeModified return {} } # else this is the root document node, # and we can optimize the cleanup. # No need to dispatch events. # First remove all command traces foreach nodecmd [info commands [namespace qualifiers [lindex $args 0]]::*] { trace remove command $nodecmd delete [namespace code [list Node:Delete $nodecmd]] } namespace delete [namespace qualifiers [lindex $args 0]] } documentType { trace remove command [lindex $args 0] delete [namespace code [list DocumentType:Delete [lindex $args 0]]] rename [lindex $args 0] {} unset [lindex $args 0] } element { # First make sure the node is removed from the tree if {[string length $node(node:parentNode)]} { node removeChild $node(node:parentNode) [lindex $args 0] } unset $node(node:childNodes) unset $node(element:attributeList) unset node set name [lindex $args 0] trace remove command $name delete [namespace code [list Node:Delete $name]] rename $name {} # Don't dispatch events here - # already done by removeChild } event { set name [lindex $args 0] trace remove command $name delete [namespace code [list Node:Delete $name]] rename $name {} unset node } default { # Store the parent for later set parent $node(node:parentNode) # First make sure the node is removed from the tree if {[string length $node(node:parentNode)]} { node removeChild $node(node:parentNode) [lindex $args 0] } unset node set name [lindex $args 0] trace remove command $name delete [namespace code [list Node:Delete $name]] rename $name {} # Dispatch events event postMutationEvent $parent DOMSubtreeModified } } return {} } isNode { # isNode - non-standard method # Sometimes it is useful to check if an arbitrary string # refers to a DOM node upvar #0 [lindex $args 0] node if {![info exists node]} { return 0 } elseif {[info exists node(node:nodeType)]} { return 1 } else { return 0 } } parse { # This implementation uses TclXML version 2.0. # TclXML can choose the best installed parser. if {[llength $args] < 1} { return -code error "wrong # args: should be dom::DOMImplementation parse xml ?args...?" } array set opts {-parser {} -progresscommand {} -chunksize 8196} if {[catch {array set opts [lrange $args 1 end]}]} { return -code error "bad configuration options" } # Create a state array for this parse session set state [namespace current]::parse[incr DOMImplementationCounter] array set $state [array get opts -*] array set $state [list progCounter 0] set errorCleanup {} if {[string length $opts(-parser)]} { set parserOpt [list -parser $opts(-parser)] } else { set parserOpt {} } if {[catch {package require xml} version]} { eval $errorCleanup return -code error "unable to load XML parsing package" } set parser [eval xml::parser $parserOpt] $parser configure \ -elementstartcommand [namespace code [list ParseElementStart $state]] \ -elementendcommand [namespace code [list ParseElementEnd $state]] \ -characterdatacommand [namespace code [list ParseCharacterData $state]] \ -processinginstructioncommand [namespace code [list ParseProcessingInstruction $state]] \ -commentcommand [namespace code [list ParseComment $state]] \ -entityreferencecommand [namespace code [list ParseEntityReference $state]] \ -xmldeclcommand [namespace code [list ParseXMLDeclaration $state]] \ -doctypecommand [namespace code [list ParseDocType $state]] \ -final 1 # Create top-level document array set $state [list docNode [DOMImplementation create]] array set $state [list current [lindex [array get $state docNode] 1]] # Parse data # Bug in TclExpat - doesn't handle non-final inputs if {0 && [string length $opts(-progresscommand)]} { $parser configure -final false while {[string length [lindex $args 0]]} { $parser parse [string range [lindex $args 0] 0 $opts(-chunksize)] set args [lreplace $args 0 0 \ [string range [lindex $args 0] $opts(-chunksize) end]] uplevel #0 $opts(-progresscommand) } $parser configure -final true } elseif {[catch {$parser parse [lindex $args 0]} err]} { catch {rename $parser {}} catch {unset $state} return -code error $err } # Free data structures which are no longer required $parser free catch {rename $parser {}} set doc [lindex [array get $state docNode] 1] unset $state return $doc } selectNode { # Non-standard method # Returns nodeset in the given document matching an XPath expression if {[llength $args] != 2} { return -code error "wrong # args: should be dom::DOMImplementation selectNode token xpath" } package require xpath return [XPath:SelectNode [lindex $args 0] [lindex $args 1]] } serialize { if {[llength $args] < 1} { return -code error "wrong # args: should be dom::DOMImplementation serialize token" } upvar #0 [lindex $args 0] node return [eval [list Serialize:$node(node:nodeType)] $args] } trim { # Removes textNodes that only contain white space if {[llength $args] != 1} { return -code error "wrong # args: should be dom::DOMImplementation trim token" } Trim [lindex $args 0] # Dispatch DOMSubtreeModified event once here? return {} } default { return -code error "unknown method \"$method\"" } } return {} } namespace eval dom::tcl { foreach method {hasFeature createDocument create createDocumentType createNode destroy isNode parse selectNode serialize trim} { proc $method args "eval [namespace current]::DOMImplementation $method \$args" } } # dom::tcl::Document:Delete -- # # Handle destruction of a document # # Arguments: # name document token # old ) # new ) args added by trace command # op ) proc dom::tcl::Document:Delete {name old new op} { DOMImplementation destroy $name return {} } # dom::tcl::document -- # # Functions for a document node. # # Arguments: # method method to invoke # token token for node # args arguments for method # # Results: # Depends on method used. namespace eval dom::tcl { variable documentOptionsRO doctype|implementation|documentElement variable documentOptionsRW actualEncoding|encoding|standalone|version } proc dom::tcl::document {method token args} { variable documentOptionsRO variable documentOptionsRW upvar #0 $token node set result {} switch -- $method { cget { if {[llength $args] != 1} { return -code error "wrong # args: should be \"dom::document method token ?args ...?\"" } if {[regexp [format {^-(%s)$} $documentOptionsRO] [lindex $args 0] discard option]} { return $node(document:$option) } elseif {[regexp [format {^-(%s)$} $documentOptionsRW] [lindex $args 0] discard option]} { switch -- $option { encoding - version - standalone { array set xmldecl $node(document:xmldecl) return $xmldecl($option) } default { return $node(document:$option) } } } else { return -code error "bad option \"[lindex $args 0]\"" } } configure { if {[llength $args] == 1} { return [document cget $token [lindex $args 0]] } elseif {[expr [llength $args] % 2]} { return -code error "no value specified for option \"[lindex $args end]\"" } else { foreach {option value} $args { if {[regexp [format {^-(%s)$} $documentOptionsRW] $option discard opt]} { switch -- $opt { encoding { catch {unset xmldecl} array set xmldecl $node(document:xmldecl) set xmldecl(encoding) $value set node(document:xmldecl) [array get xmldecl] } standalone { if {[string is boolean $value]} { catch {unset xmldecl} array set xmldecl $node(document:xmldecl) if {[string is true $value]} { set xmldecl(standalone) yes } else { set xmldecl(standalone) no } set node(document:xmldecl) [array get xmldecl] } else { return -code error "unsupported value for option \"$option\" - must be boolean" } } version { if {$value == "1.0"} { catch {unset xmldecl} array set xmldecl $node(document:xmldecl) set xmldecl(version) $value set node(document:xmldecl) [array get xmldecl] } else { return -code error "unsupported value for option \"$option\"" } } default { set node(document:$opt) $value } } } elseif {[regexp [format {^-(%s)$} $documentOptionsRO] $option discard opt]} { return -code error "attribute \"$option\" is read-only" } else { return -code error "bad option \"$option\"" } } } } createElement { if {[llength $args] != 1} { return -code error "wrong # args: should be \"document createElement token name\"" } # Check that the element name is kosher if {![regexp ^$::xml::Name\$ [lindex $args 0]]} { return -code error "invalid element name \"[lindex $args 0]\"" } # Invoke internal factory function set result [CreateElement $token [lindex $args 0] {}] } createDocumentFragment { if {[llength $args]} { return -code error "wrong # args: should be \"document createDocumentFragment token\"" } set result [CreateGeneric $token node:nodeType documentFragment node:nodeName #document-fragment node:nodeValue {}] } createTextNode { if {[llength $args] != 1} { return -code error "wrong # args: should be \"document createTextNode token text\"" } set result [CreateTextNode $token [lindex $args 0]] } createComment { if {[llength $args] != 1} { return -code error "wrong # args: should be \"document createComment token data\"" } set result [CreateGeneric $token node:nodeType comment node:nodeName #comment node:nodeValue [lindex $args 0]] } createCDATASection { if {[llength $args] != 1} { return -code error "wrong # args: should be \"document createCDATASection token data\"" } set result [CreateTextNode $token [lindex $args 0]] node configure $result -cdatasection 1 } createProcessingInstruction { if {[llength $args] != 2} { return -code error "wrong # args: should be \"document createProcessingInstruction token target data\"" } set result [CreateGeneric $token node:nodeType processingInstruction \ node:nodeName [lindex $args 0] node:nodeValue [lindex $args 1]] } createAttribute { if {[llength $args] != 1} { return -code error "wrong # args: should be \"document createAttributes token name\"" } # Check that the attribute name is kosher if {![regexp ^$::xml::Name\$ [lindex $args 0]]} { return -code error "invalid attribute name \"[lindex $args 0]\"" } set result [CreateGeneric $token node:nodeType attribute node:nodeName [lindex $args 0]] } createEntity { set result [CreateGeneric $token node:nodeType entity] } createEntityReference { if {[llength $args] != 1} { return -code error "wrong # args: should be \"document createEntityReference token name\"" } set result [CreateGeneric $token node:nodeType entityReference node:nodeName [lindex $args 0]] } importNode { # Introduced in DOM Level 2 if {[llength $args] < 1} { return -code error "wrong # args: should be \"importNode token ?-deep boolean?\"" } array set opts { -deep 1 } array set opts [lrange $args 1 end] set opts(-deep) [Boolean $opts(-deep)] if {[namespace qualifiers [lindex $args 0]] == [namespace qualifiers $token]} { return -code error "source node \"[lindex $args 0]\" is in the same document" } switch [node cget [lindex $args 0] -nodeType] { document - documentType { return -code error "node type \"[node cget [lindex $args 0] -type]\" cannot be imported" } documentFragment { set result [document createDocumentFragment $token] if {$opts(-deep)} { foreach child [node children [lindex $args 0]] { $result appendChild [$token importNode $child -deep 1] } } } element { set result [CreateElement {} [node cget [lindex $args 0] -nodeName] [array get [node cget [lindex $args 0] -attributes]] -document $token] if {$opts(-deep)} { foreach child [node children [lindex $args 0]] { $result appendChild [$token importNode $child -deep 1] } } } textNode { set result [CreateTextNode {} [node cget [lindex $args 0] -nodeValue] -document $token] } attribute - processingInstruction - comment { set result [CreateGeneric {} -document $token node:nodeType [node cget [lindex $args 0] -nodeType] node:nodeName [node cget [lindex $args 0] -nodeName] node:nodeValue [node cget [lindex $args 0] -nodeValue]] } } } createElementNS { # Introduced in DOM Level 2 if {[llength $args] != 2} { return -code error "wrong # args: should be: \"createElementNS nsuri qualname\"" } # Check that the qualified name is kosher if {[catch {foreach {prefix localname} [::xml::qnamesplit [lindex $args 1]] break} err]} { return -code error "invalid qualified name \"[lindex $args 1]\" due to \"$err\"" } # Invoke internal factory function set result [CreateElement $token [lindex $args 1] {} -prefix $prefix -namespace [lindex $args 0] -localname $localname] } createAttributeNS { # Introduced in DOM Level 2 return -code error "not yet implemented" } getElementsByTagNameNS { # Introduced in DOM Level 2 return -code error "not yet implemented" } getElementsById { # Introduced in DOM Level 2 return -code error "not yet implemented" } createEvent { # Introduced in DOM Level 2 if {[llength $args] != 1} { return -code error "wrong # args: should be \"document createEvent token type\"" } set result [CreateEvent $token [lindex $args 0]] } getElementsByTagName { if {[llength $args] < 1} { return -code error "wrong # args: should be \"document getElementsByTagName token what\"" } return [eval Element:GetByTagName [list $token [lindex $args 0]] \ [lrange $args 1 end]] } default { return -code error "unknown method \"$method\"" } } # Dispatch events # Node insertion events are generated here instead of the # internal factory procedures. This is because the factory # procedures are meant to be mean-and-lean during the parsing # phase, and dispatching events at that time would be an # excessive overhead. The factory methods here are pretty # heavyweight anyway. if {[string match create* $method] && [string compare $method "createEvent"]} { event postMutationEvent $result DOMNodeInserted -relatedNode $token event postMutationEvent $result DOMNodeInsertedIntoDocument event postMutationEvent $token DOMSubtreeModified } return $result } ### Factory methods ### ### These are lean-and-mean for fastest possible tree building # dom::tcl::CreateElement -- # # Append an element to the given (parent) node (if any) # # Arguments: # token parent node (if empty -document option is mandatory) # name element name (no checking performed here) # aList attribute list # args configuration options # # Results: # New node created, parent optionally modified proc dom::tcl::CreateElement {token name aList args} { array set opts $args if {[string length $token]} { upvar #0 $token parent upvar #0 [namespace qualifiers $token]::Document document set child [namespace qualifiers $token]::node[incr document(counter)] } elseif {[info exists opts(-document)]} { upvar #0 $opts(-document) document set child [namespace qualifiers $opts(-document)]::node[incr document(counter)] } else { return -code error "no parent or document specified" } upvar #0 $child new # Create the new node # NB. normally we'd use Node:create here, # but inline it instead for performance array set new [list \ node:parentNode $token \ node:childNodes ${child}var \ node:nodeType element \ node:nodeName $name \ node:namespaceURI {} \ node:prefix {} \ node:localName $name \ node:nodeValue {} \ element:attributeList ${child}arr \ element:attributeNodes {} \ ] catch {set new(node:namespaceURI) $opts(-namespace)} catch {set new(node:localName) $opts(-localname)} catch {set new(node:prefix) $opts(-prefix)} # Initialise associated variables set ${child}var {} array set ${child}arr $aList catch { foreach {ns nsAttrList} $opts(-namespaceattributelists) { foreach {attrName attrValue} $nsAttrList { array set ${child}arr [list $ns^$attrName $attrValue] } } } # Update parent record # Does this element qualify as the document element? # If so, then has a document element already been set? if {[string length $token] && [string equal $parent(node:nodeType) document]} { if {$token == $parent(documentFragment:masterDoc)} { if {[info exists parent(document:documentElement)] && \ [string length $parent(document:documentElement)]} { # Do not attach to the tree set new(node:parentNode) {} } else { # Check against document type decl if {[string length $parent(document:doctype)]} { upvar #0 $parent(document:doctype) doctypedecl if {[string compare $name $doctypedecl(doctype:name)]} { return -code error "mismatch between root element type in document type declaration \"$doctypedecl(doctype:name)\" and root element \"$name\"" } } else { # Synthesize document type declaration set doctype [CreateDocType $name {} {}] set document(document:doctype) $doctype } set parent(document:documentElement) $child catch {lappend $parent(node:childNodes) $child} } } else { catch {lappend $parent(node:childNodes) $child} } } else { catch {lappend $parent(node:childNodes) $child} } proc $child {method args} "return \[eval [namespace current]::node \[list \$method\] $child \$args\]" trace add command $child delete [namespace code [list Node:Delete $child]] return $child } # dom::tcl::CreateTextNode -- # # Append a textNode node to the given (parent) node (if any). # # This factory function can also be performed by # CreateGeneric, but text nodes are created so often # that this specific factory procedure speeds things up. # # Arguments: # token parent node (if empty -document option is mandatory) # text initial text # args additional configuration options # # Results: # New node created, parent optionally modified proc dom::tcl::CreateTextNode {token text args} { array set opts $args if {[string length $token]} { upvar #0 $token parent upvar #0 [namespace qualifiers $token]::Document document set child [namespace qualifiers $token]::node[incr document(counter)] } elseif {[info exists opts(-document)]} { upvar #0 $opts(-document) document set child [namespace qualifiers $opts(-document)]::node[incr document(counter)] } else { return -code error "no parent or document specified" } upvar #0 $child new # Create the new node # NB. normally we'd use Node:create here, # but inline it instead for performance # Text nodes never have children, so don't create a variable array set new [list \ node:parentNode $token \ node:childNodes ${child}var \ node:nodeType textNode \ node:nodeValue $text \ node:nodeName #text \ node:cdatasection 0 \ ] set ${child}var {} # Update parent record catch {lappend $parent(node:childNodes) $child} proc $child {method args} "return \[eval [namespace current]::node \[list \$method\] $child \$args\]" trace add command $child delete [namespace code [list Node:Delete $child]] return $child } # dom::tcl::CreateGeneric -- # # This is a template used for type-specific factory procedures # # Arguments: # token parent node (if empty -document option is mandatory) # args optional values # # Results: # New node created, parent modified proc dom::tcl::CreateGeneric {token args} { array set opts $args if {[string length $token]} { upvar #0 $token parent upvar #0 [namespace qualifiers $token]::Document document set child [namespace qualifiers $token]::node[incr document(counter)] } elseif {[info exists opts(-document)]} { upvar #0 $opts(-document) document set child [namespace qualifiers $opts(-document)]::node[incr document(counter)] } else { return -code error "no parent or document specified" } upvar #0 $child new # Create the new node # NB. normally we'd use Node:create here, # but inline it instead for performance array set new [eval list [list \ node:parentNode $token \ node:childNodes ${child}var ] \ $args \ ] set ${child}var {} switch -glob -- [string length $token],$opts(node:nodeType) { 0,* - *,attribute - *,namespace { # These type of nodes are not children of their parent } default { # Update parent record lappend $parent(node:childNodes) $child } } proc $child {method args} "return \[eval [namespace current]::node \[list \$method\] $child \$args\]" trace add command $child delete [namespace code [list Node:Delete $child]] return $child } ### Specials # dom::tcl::CreateDocType -- # # Create a Document Type Declaration node. # # Arguments: # name root element type # publicid public identifier # systemid system identifier # internaldtd internal DTD subset # # Results: # Returns node id of the newly created node. proc dom::tcl::CreateDocType {name publicid systemid {internaldtd {}}} { if {![regexp ^$::xml::QName\$ $name]} { return -code error "invalid QName \"$name\"" } set nodename [namespace current]::$name upvar #0 $nodename doctype if {[info exists doctype]} { return $nodename } if {[llength $internaldtd] == 1 && [string length [lindex $internaldtd 0]] == 0} { set dtd {} } array set doctype [list \ node:childNodes {} \ node:nodeType documentType \ node:nodeName $name \ node:nodeValue {} \ doctype:name $name \ doctype:entities {} \ doctype:notations {} \ doctype:publicId $publicid \ doctype:systemId $systemid \ doctype:internalSubset $internaldtd \ ] proc $nodename {method args} "return \[eval [namespace current]::documenttype \[list \$method\] $nodename \$args\]" trace add command $nodename delete [namespace code [list DocumentType:Delete $nodename]] return $nodename } # dom::tcl::documenttype -- # # Functions for a document type declaration node. # # Arguments: # method method to invoke # token token for node # args arguments for method # # Results: # Depends on method used. namespace eval dom::tcl { variable documenttypeOptionsRO name|entities|notations|publicId|systemId|internalSubset variable documenttypeOptionsRW {} } proc dom::tcl::documenttype {method token args} { variable documenttypeOptionsRO variable documenttypeOptionsRW upvar #0 $token node set result {} switch -- $method { cget { if {[llength $args] != 1} { return -code error "wrong # args: should be \"dom::documenttype method token ?args ...?\"" } if {[regexp [format {^-(%s)$} $documenttypeOptionsRO] [lindex $args 0] discard option]} { switch -- $option { name { return $node(node:nodeName) } default { return $node(doctype:$option) } } } elseif {[regexp [format {^-(%s)$} $documenttypeOptionsRW] [lindex $args 0] discard option]} { return $node(doctype:$option) } else { return -code error "bad option \"[lindex $args 0]\"" } } configure { if {[llength $args] == 1} { return [documenttype cget $token [lindex $args 0]] } elseif {[expr [llength $args] % 2]} { return -code error "no value specified for option \"[lindex $args end]\"" } else { foreach {option value} $args { if {[regexp [format {^-(%s)$} $documenttypeOptionsRW] $option discard opt]} { switch -- $opt { default { set node(doctype:$opt) $value } } } elseif {[regexp [format {^-(%s)$} $documenttypeOptionsRO] $option discard opt]} { return -code error "attribute \"$option\" is read-only" } else { return -code error "bad option \"$option\"" } } } } } return $result } # dom::tcl::DocumentType:Delete -- # # Handle node destruction # # Arguments: # name node token # old ) # new ) arguments appended by trace command # op ) # # Results: # Node is destroyed proc dom::tcl::DocumentType:Delete {name old new op} { DOMImplementation destroy $name } # dom::tcl::node -- # # Functions for a general node. # # Implements EventTarget Interface - introduced in DOM Level 2 # # Arguments: # method method to invoke # token token for node # args arguments for method # # Results: # Depends on method used. namespace eval dom::tcl { variable nodeOptionsRO nodeType|parentNode|childNodes|firstChild|lastChild|previousSibling|nextSibling|attributes|namespaceURI|prefix|localName|ownerDocument variable nodeOptionsRW nodeValue|cdatasection # Allowing nodeName to be rw is not standard DOM. # A validating implementation would have to be very careful # in allowing this feature if {$::dom::strictDOM} { append nodeOptionsRO |nodeName } else { append nodeOptionsRW |nodeName } } # NB. cdatasection is not a standard DOM option proc dom::tcl::node {method token args} { variable nodeOptionsRO variable nodeOptionsRW upvar #0 $token node set result {} switch -glob -- $method { cg* { # cget # Some read-only configuration options are computed if {[llength $args] != 1} { return -code error "wrong # args: should be \"dom::node cget token option\"" } if {[regexp [format {^-(%s)$} $nodeOptionsRO] [lindex $args 0] discard option]} { switch $option { nodeName { set result $node(node:nodeName) switch $node(node:nodeType) { textNode { catch {set result [expr {$node(node:cdatasection) ? "#cdata-section" : $node(node:nodeName)}]} } default { } } } childNodes { # How are we going to handle documentElement? set result $node(node:childNodes) } firstChild { upvar #0 $node(node:childNodes) children switch $node(node:nodeType) { document { set result [lindex $children 0] catch {set result $node(document:documentElement)} } default { set result [lindex $children 0] } } } lastChild { upvar #0 $node(node:childNodes) children switch $node(node:nodeType) { document { set result [lindex $children end] catch {set result $node(document:documentElement)} } default { set result [lindex $children end] } } } previousSibling { # BUG: must take documentElement into account # Find the parent node upvar #0 $node(node:parentNode) parent upvar #0 $parent(node:childNodes) children set idx [lsearch $children $token] if {$idx >= 0} { set sib [lindex $children [incr idx -1]] if {[llength $sib]} { set result $sib } else { set result {} } } else { set result {} } } nextSibling { # BUG: must take documentElement into account # Find the parent node upvar #0 $node(node:parentNode) parent upvar #0 $parent(node:childNodes) children set idx [lsearch $children $token] if {$idx >= 0} { set sib [lindex $children [incr idx]] if {[llength $sib]} { set result $sib } else { set result {} } } else { set result {} } } attributes { if {[string compare $node(node:nodeType) element]} { set result {} } else { set result $node(element:attributeList) } } ownerDocument { if {[string compare $node(node:parentNode) {}]} { return [namespace qualifiers $token]::Document } else { return $token } } default { return [GetField node(node:$option)] } } } elseif {[regexp [format {^-(%s)$} $nodeOptionsRW] [lindex $args 0] discard option]} { return [GetField node(node:$option)] } else { return -code error "unknown option \"[lindex $args 0]\"" } } co* { # configure if {[llength $args] == 1} { return [node cget $token [lindex $args 0]] } elseif {[expr [llength $args] % 2]} { return -code error "wrong \# args: should be \"::dom::node configure node option\"" } else { foreach {option value} $args { if {[regexp [format {^-(%s)$} $nodeOptionsRW] $option discard opt]} { switch $opt,$node(node:nodeType) { nodeValue,textNode - nodeValue,processingInstruction { # Dispatch event set evid [CreateEvent $token DOMCharacterDataModified] event initMutationEvent $evid DOMCharacterDataModified 1 0 {} $node(node:nodeValue) $value {} {} set node(node:nodeValue) $value node dispatchEvent $token $evid DOMImplementation destroy $evid } default { set node(node:$opt) $value } } } elseif {[regexp [format {^-(%s)$} $nodeOptionsRO] $option discard opt]} { return -code error "attribute \"$option\" is read-only" } else { return -code error "unknown option \"$option\"" } } } } in* { # insertBefore # Previous and next sibling relationships are OK, # because they are dynamically determined if {[llength $args] < 1 || [llength $args] > 2} { return -code error "wrong # args: should be \"dom::node insertBefore token new ?ref?\"" } upvar #0 [lindex $args 0] newChild if {[string compare [namespace qualifiers [lindex $args 0]] [namespace qualifiers $token]]} { return -code error "new node must be in the same document" } switch [llength $args] { 1 { # Append as the last node if {[string length $newChild(node:parentNode)]} { node removeChild $newChild(node:parentNode) [lindex $args 0] } lappend $node(node:childNodes) [lindex $args 0] set newChild(node:parentNode) $token } 2 { upvar #0 [lindex $args 1] refChild if {[string compare [namespace qualifiers [lindex $args 1]] [namespace qualifiers [lindex $args 0]]]} { return -code error "nodes must be in the same document" } set idx [lsearch [set $node(node:childNodes)] [lindex $args 1]] if {$idx < 0} { return -code error "no such reference child" } else { # Remove from previous parent if {[string length $newChild(node:parentNode)]} { node removeChild $newChild(node:parentNode) [lindex $args 0] } # Insert into new node set $node(node:childNodes) \ [linsert [set $node(node:childNodes)] $idx [lindex $args 0]] set newChild(node:parentNode) $token } } } event postMutationEvent [lindex $args 0] DOMNodeInserted -relatedNode $token FireNodeInsertedEvents [lindex $args 0] event postMutationEvent $token DOMSubtreeModified set result [lindex $args 0] } rep* { # replaceChild if {[llength $args] != 2} { return -code error "wrong # args: should be \"dom::node replaceChild token new old\"" } upvar #0 [lindex $args 0] newChild upvar #0 [lindex $args 1] oldChild upvar #0 $node(node:childNodes) children # Find where to insert new child set idx [lsearch $children [lindex $args 1]] if {$idx < 0} { return -code error "no such old child" } # Remove new child from current parent if {[string length $newChild(node:parentNode)]} { node removeChild $newChild(node:parentNode) [lindex $args 0] } set children \ [lreplace $children $idx $idx [lindex $args 0]] set newChild(node:parentNode) $token # Update old child to reflect lack of parentage set oldChild(node:parentNode) {} set result [lindex $args 1] event postMutationEvent [lindex $args 0] DOMNodeInserted -relatedNode $token FireNodeInsertedEvents [lindex $args 0] event postMutationEvent $token DOMSubtreeModified } removeC* { # removeChild if {[llength $args] != 1} { return -code error "wrong # args: should be \"dom::node removeChild token child\"" } upvar #0 [lindex $args 0] oldChild if {[string compare [namespace qualifiers [lindex $args 0]] [namespace qualifiers $token]]} { return -code error "node \"[lindex $args 0]\" is not a child" } # Remove the child from the parent upvar #0 $node(node:childNodes) myChildren if {[set idx [lsearch $myChildren [lindex $args 0]]] < 0} { return -code error "node \"[lindex $args 0]\" is not a child" } set myChildren [lreplace $myChildren $idx $idx] # Update the child to reflect lack of parentage set oldChild(node:parentNode) {} set result [lindex $args 0] # Event propagation has a problem here: # Nodes that until recently were ancestors may # want to capture the event, but we've just removed # the parentage information. They get a DOMSubtreeModified # instead. event postMutationEvent [lindex $args 0] DOMNodeRemoved -relatedNode $token FireNodeRemovedEvents [lindex $args 0] event postMutationEvent $token DOMSubtreeModified } ap* { # appendChild if {[llength $args] != 1} { return -code error "wrong # args: should be \"dom::node appendChild token child\"" } # Add to new parent node insertBefore $token [lindex $args 0] set result [lindex $args 0] } hasChildNodes { set result [Min 1 [llength [set $node(node:childNodes)]]] } isSameNode { # Introduced in DOM Level 3 switch [llength $args] { 1 { return [expr {$token == [lindex $args 0]}] } default { return -code error "wrong # args: should be \"dom::node isSameNode token ref\"" } } } cl* { # cloneNode # May need to pay closer attention to generation of events here set deep 0 switch [llength $args] { 0 { } 2 { foreach {opt value} $args { switch -- $opt { -deep { set deep [Boolean $value] } default { return -code error "bad option \"$opt\"" } } } } default { return -code error "wrong # args: should be \"dom::node cloneNode token ?-deep boolean?\"" } } switch $node(node:nodeType) { element { set result [CreateElement {} $node(node:nodeName) [array get $node(element:attributeList)] -document [namespace qualifiers $token]::Document] if {$deep} { foreach child [set $node(node:childNodes)] { node appendChild $result [node cloneNode $child -deep 1] } } } textNode { set result [CreateTextNode {} $node(node:nodeValue) -document [namespace qualifiers $token]::Document] } document { set result [DOMImplementation create] upvar #0 $result clonedDoc array set clonedDoc [array get node document:doctype] if {$deep} { foreach child [set $node(node:childNodes)] { node appendChild $result [document importNode $result $child -deep 1] } } } documentFragment - default { set result [CreateGeneric {} node:nodeType $node(node:nodeType) -document [namespace qualifiers $token]::Document] if {$deep} { foreach child [set $node(node:childNodes)] { node appendChild $result [node cloneNode $child -deep 1] } } } } } ch* { # children -- non-standard method # If this is a textNode, then catch the error set result {} catch {set result [set $node(node:childNodes)]} } par* { # parent -- non-standard method return $node(node:parentNode) } pat* { # path -- non-standard method for { set ancestor $token upvar #0 $token ancestorNd set result {} } {[string length $ancestorNd(node:parentNode)]} { set ancestor $ancestorNd(node:parentNode) upvar #0 $ancestor ancestorNd } { set result [linsert $result 0 $ancestor] } # The last node is the document node set result [linsert $result 0 $ancestor] } createNode { # createNode -- non-standard method # Creates node(s) in this document given an XPath expression. # Relative location paths have this node as their initial context. if {[llength $args] != 1} { return -code error "wrong # args: should be \"dom::node createNode token path\"" } package require xpath return [XPath:CreateNode $token [lindex $args 0]] } selectNode { # selectNode -- non-standard method # Returns nodeset in this document matching an XPath expression. # Relative location paths have this node as their initial context. if {[llength $args] != 1} { return -code error "wrong # args: should be \"dom::node selectNode token path\"" } package require xpath return [XPath:SelectNode $token [lindex $args 0]] } stringValue { # stringValue -- non-standard method # Returns string value of a node, as defined by XPath Rec. if {[llength $args] > 0} { return -code error "wrong # args: should be \"dom::node stringValue token\"" } switch $node(node:nodeType) { document - documentFragment - element { set value {} foreach child [set $node(node:childNodes)] { switch [node cget $child -nodeType] { element - textNode { append value [node stringValue $child] } default { # Other nodes are not considered } } } return $value } attribute - textNode - processingInstruction - comment { return $node(node:nodeValue) } default { return {} } } } addEv* { # addEventListener -- introduced in DOM Level 2 if {[llength $args] < 1} { return -code error "wrong # args: should be \"dom::node addEventListener token type ?listener? ?option value...?\"" } set type [lindex $args 0] set args [lrange $args 1 end] set listener [lindex $args 0] if {[llength $args] == 1} { set args {} } elseif {[llength $args] > 1} { if {[string match -* $listener]} { set listener {} } else { set args [lrange $args 1 end] } } array set opts {-usecapture 0} if {[catch {array set opts $args}]} { return -code error "missing value for option \"[lindex $args end]\"" } set opts(-usecapture) [Boolean $opts(-usecapture)] set listenerType [expr {$opts(-usecapture) ? "capturer" : "listener"}] if {[string length $listener]} { if {![info exists node(event:$type:$listenerType)] || \ [lsearch $node(event:$type:$listenerType) $listener] < 0} { lappend node(event:$type:$listenerType) $listener } # else avoid registering same listener twice } else { # List all listeners set result {} catch {set result $node(event:$type:$listenerType)} return $result } } removeE* { # removeEventListener -- introduced in DOM Level 2 if {[llength $args] < 2} { return -code error "wrong # args: should be \"dom::node removeEventListener token type listener ?option value...?\"" } set type [lindex $args 0] set listener [lindex $args 1] array set opts {-usecapture 0} array set opts [lrange $args 2 end] set opts(-usecapture) [Boolean $opts(-usecapture)] set listenerType [expr {$opts(-usecapture) ? "capturer" : "listener"}] set idx [lsearch $node(event:$type:$listenerType) $listener] if {$idx >= 0} { set node(event:$type:$listenerType) [lreplace $node(event:$type:$listenerType) $idx $idx] } } disp* { # dispatchEvent -- introduced in DOM Level 2 # This is where the fun happens! # Check to see if there one or more event listener, # if so trigger the listener(s). # Then pass the event up to the ancestor. # This may be modified by event capturing and bubbling. if {[llength $args] != 1} { return -code error "wrong # args: should be \"dom::node dispatchEvent token eventnode\"" } set eventId [lindex $args 0] upvar #0 $eventId event set type $event(type) if {![string length $event(eventPhase)]} { # This is the initial dispatch of the event. # First trigger any capturing event listeners # Starting from the root, proceed downward set event(eventPhase) capturing_phase set event(target) $token # DOM L2 specifies that the ancestors are determined # at the moment of event dispatch, so using a static # list is the correct thing to do foreach ancestor [lreplace [node path $token] end end] { set event(currentNode) $ancestor upvar #0 $ancestor ancNode if {[info exists ancNode(event:$type:capturer)]} { foreach capturer $ancNode(event:$type:capturer) { if {[catch {uplevel #0 $capturer [list $eventId]} capturerError]} { bgerror "error in capturer \"$capturerError\"" } } # A listener may stop propagation, # but we check here to let all of the # listeners at that level complete if {$event(cancelable) && $event(stopPropagation)} { break } } } # Prepare for next phase set event(eventPhase) at_target } set event(currentNode) $token if {[info exists node(event:$type:listener)]} { foreach listener $node(event:$type:listener) { if {[catch {uplevel #0 $listener [list $eventId]} listenerError]} { bgerror "error in listener \"$listenerError\"" } } } set event(eventPhase) bubbling_phase # Now propagate the event if {$event(cancelable) && $event(stopPropagation)} { # Event has been cancelled } elseif {[llength $node(node:parentNode)]} { # Go ahead and propagate node dispatchEvent $node(node:parentNode) $eventId } set event(dispatched) 1 } default { return -code error "unknown method \"$method\"" } } return $result } # dom::tcl::Node:create -- # # Generic node creation. # See also CreateElement, CreateTextNode, CreateGeneric. # # Arguments: # pVar array in caller which contains parent details # args configuration options # # Results: # New child node created. proc dom::tcl::Node:create {pVar args} { upvar #0 $pVar parent array set opts {-name {} -value {}} array set opts $args upvar #0 [namespace qualifiers $pVar]::Document document # Create new node if {![info exists opts(-id)]} { set opts(-id) node[incr document(counter)] } set child [namespace qualifiers $pVar]::$opts(-id) upvar #0 $child new array set new [list \ node:parentNode $opts(-parent) \ node:childNodes ${child}var \ node:nodeType $opts(-type) \ node:nodeName $opts(-name) \ node:nodeValue $opts(-value) \ element:attributeList ${child}arr \ ] set ${child}var {} array set ${child}arr {} # Update parent node if {![info exists parent(document:documentElement)]} { lappend parent(node:childNodes) $child } proc $child {method args} "return \[eval [namespace current]::node \[list \$method\] $child \$args\]" trace add command $child delete [namespace code [list Node:Delete $child]] return $child } # dom::tcl::Node:set -- # # Generic node update # # Arguments: # token node token # args configuration options # # Results: # Node modified. proc dom::tcl::Node:set {token args} { upvar #0 $token node foreach {key value} $args { set node($key) $value } return {} } # dom::tcl::Node:Delete -- # # Handle node destruction # # Arguments: # name node token # old ) # new ) arguments appended by trace command # op ) # # Results: # Node is destroyed proc dom::tcl::Node:Delete {name old new op} { if {[catch {DOMImplementation destroy $name} ret]} { # Document has been deleted... namespace has been destroyed } else { return $ret } } # dom::tcl::FireNodeInsertedEvents -- # # Recursively descend the tree triggering DOMNodeInserted # events as we go. # # Arguments: # nodeid Node ID # # Results: # DOM L2 DOMNodeInserted events posted proc dom::tcl::FireNodeInsertedEvents nodeid { event postMutationEvent $nodeid DOMNodeInsertedIntoDocument foreach child [node children $nodeid] { FireNodeInsertedEvents $child } return {} } # dom::tcl::FireNodeRemovedEvents -- # # Recursively descend the tree triggering DOMNodeRemoved # events as we go. # # Arguments: # nodeid Node ID # # Results: # DOM L2 DOMNodeRemoved events posted proc dom::tcl::FireNodeRemovedEvents nodeid { event postMutationEvent $nodeid DOMNodeRemovedFromDocument foreach child [node children $nodeid] { FireNodeRemovedEvents $child } return {} } # dom::tcl::element -- # # Functions for an element. # # Arguments: # method method to invoke # token token for node # args arguments for method # # Results: # Depends on method used. namespace eval dom::tcl { variable elementOptionsRO tagName|empty variable elementOptionsRW {} } proc dom::tcl::element {method token args} { variable elementOptionsRO variable elementOptionsRW upvar #0 $token node if {[string compare $node(node:nodeType) "element"]} { return -code error "malformed node token \"$token\"" } set result {} switch -- $method { cget { # Some read-only configuration options are computed if {[llength $args] != 1} { return -code error "wrong # args: should be \"dom::element cget token option\"" } if {[regexp [format {^-(%s)$} $elementOptionsRO] [lindex $args 0] discard option]} { switch $option { tagName { set result [lindex $node(node:nodeName) 0] } empty { if {![info exists node(element:empty)]} { return 0 } else { return $node(element:empty) } } default { return $node(node:$option) } } } elseif {[regexp [format {^-(%s)$} $elementOptionsRW] [lindex $args 0] discard option]} { return $node(node:$option) } else { return -code error "bad option \"[lindex $args 0]\"" } } configure { if {[llength $args] == 1} { return [document cget $token [lindex $args 0]] } elseif {[expr [llength $args] % 2]} { return -code error "no value specified for option \"[lindex $args end]\"" } else { foreach {option value} $args { if {[regexp [format {^-(%s)$} $elementOptionsRO] $option discard opt]} { return -code error "option \"$option\" cannot be modified" } elseif {[regexp [format {^-(%s)$} $elementOptionsRW] $option discard opt]} { return -code error "not implemented" } else { return -code error "bad option \"$option\"" } } } } getAttribute { if {[llength $args] != 1} { return -code error "wrong # args: should be \"dom::element getAttribute token name\"" } set result {} upvar #0 $node(element:attributeList) attrList catch {set result $attrList([lindex $args 0])} return $result } setAttribute { if {[llength $args] != 2} { return -code error "wrong # args: should be \"dom::element setAttribute token name value\"" } # Check that the attribute name is kosher if {![regexp ^$::xml::Name\$ [lindex $args 0]]} { return -code error "invalid attribute name \"[lindex $args 0]\"" } upvar #0 $node(element:attributeList) attrList set evid [CreateEvent $token DOMAttrModified] set oldValue {} catch {set oldValue $attrList([lindex $args 0])} event initMutationEvent $evid DOMAttrModified 1 0 $token $oldValue [lindex $args 1] [lindex $args 0] [expr {[info exists attrList([lindex $args 0])] ? "modification" : "addition"}] set result [set attrList([lindex $args 0]) [lindex $args 1]] node dispatchEvent $token $evid DOMImplementation destroy $evid } removeAttribute { if {[llength $args] != 1} { return -code error "wrong # args: should be \"dom::element removeAttribute token name\"" } upvar #0 $node(element:attributeList) attrList catch {unset attrList([lindex $args 0])} event postMutationEvent $token DOMAttrRemoved -attrName [lindex $args 0] -attrChange removal } getAttributeNS { if {[llength $args] != 2} { return -code error "wrong # args: should be \"dom::element getAttributeNS token ns name\"" } set result {} upvar #0 $node(element:attributeList) attrList catch {set result $attrList([lindex $args 0]^[lindex $args 1])} return $result } setAttributeNS { if {[llength $args] != 3} { return -code error "wrong # args: should be \"dom::element setAttributeNS token ns attr value\"" } # Check that the attribute name is kosher if {![regexp ^$::xml::QName\$ [lindex $args 1] discard prefix localName]} { return -code error "invalid qualified attribute name \"[lindex $args 1]\"" } # BUG: At the moment the prefix is ignored upvar #0 $node(element:attributeList) attrList set evid [CreateEvent $token DOMAttrModified] set oldValue {} catch {set oldValue $attrList([lindex $args 0]^$localName)} event initMutationEvent $evid DOMAttrModified 1 0 $token $oldValue [lindex $args 2] [lindex $args 0]^localName [expr {[info exists attrList([lindex $args 0]^$localName)] ? "modification" : "addition"}] set result [set attrList([lindex $args 0]^$localName) [lindex $args 2]] node dispatchEvent $token $evid DOMImplementation destroy $evid } removeAttributeNS { if {[llength $args] != 2} { return -code error "wrong # args: should be \"dom::element removeAttributeNS token ns name\"" } upvar #0 $node(element:attributeList) attrList catch {unset attrList([lindex $args 0]^[lindex $args 1])} event postMutationEvent $token DOMAttrRemoved -attrName [lindex $args 0]^[lindex $args 1] -attrChange removal } getAttributeNode { array set tmp [array get $node(element:attributeList)] if {![info exists tmp([lindex $args 0])]} { return {} } # Synthesize an attribute node if one doesn't already exist array set attrNodes $node(element:attributeNodes) if {[catch {set result $attrNodes([lindex $args 0])}]} { set result [CreateGeneric $token node:nodeType attribute node:nodeName [lindex $args 0] node:nodeValue $tmp([lindex $args 0])] lappend node(element:attributeNodes) [lindex $args 0] $result } } setAttributeNode - removeAttributeNode - getAttributeNodeNS - setAttributeNodeNS - removeAttributeNodeNS { return -code error "not yet implemented" } getElementsByTagName { if {[llength $args] < 1} { return -code error "wrong # args: should be \"dom::element getElementsByTagName token name\"" } return [eval Element:GetByTagName [list $token [lindex $args 0]] \ [lrange $args 1 end]] } normalize { if {[llength $args]} { return -code error "wrong # args: should be dom::element normalize token" } Element:Normalize node [set $node(node:childNodes)] } default { return -code error "bad method \"$method\": should be cget, configure, getAttribute, setAttribute, removeAttribute, getAttributeNS, setAttributeNS, removeAttributeNS, getAttributeNode, setAttributeNode, removeAttributeNode, getAttributeNodeNS, setAttributeNodeNS, removeAttributeNodeNS, getElementsByTagName or normalize" } } return $result } # dom::tcl::Element:GetByTagName -- # # Search for (child) elements # # This used to be non-recursive, but then I read the DOM spec # properly and discovered that it should recurse. The -deep # option allows for backward-compatibility, and defaults to the # DOM-specified value of true. # # Arguments: # token parent node # name element type to search for # args configuration options # # Results: # The name of the variable containing the list of matching node tokens proc dom::tcl::Element:GetByTagName {token name args} { upvar #0 $token node upvar #0 [namespace qualifiers $token]::Document document array set cfg {-deep 1} array set cfg $args set cfg(-deep) [Boolean $cfg(-deep)] # Guard against arbitrary glob characters # Checking that name is a legal XML Name does this # However, '*' is permitted if {![regexp ^$::xml::Name\$ $name] && [string compare $name "*"]} { return -code error "invalid element name" } # Allocate variable name for this search set searchVar ${token}search[incr document(counter)] upvar \#0 $searchVar search # Make list live by interposing on variable reads # I don't think we need to interpose on unsets, # and writing to this variable by the application is # not permitted. trace variable $searchVar w [namespace code Element:GetByTagName:Error] if {[string compare $node(node:nodeType) "document"]} { trace variable $searchVar r [namespace code [list Element:GetByTagName:Search [set $node(node:childNodes)] $name $cfg(-deep)]] } elseif {[llength $node(document:documentElement)]} { # Document Element must exist and must be an element type node trace variable $searchVar r [namespace code [list Element:GetByTagName:Search $node(document:documentElement) $name $cfg(-deep)]] } return $searchVar } # dom::tcl::Element:GetByTagName:Search -- # # Search for elements. This does the real work. # Because this procedure is invoked everytime # the variable is read, it returns the live list. # # Arguments: # tokens nodes to search (inclusive) # name element type to search for # deep whether to search recursively # name1 \ # name2 > appended by trace command # op / # # Results: # List of matching node tokens proc dom::tcl::Element:GetByTagName:Search {tokens name deep name1 name2 op} { set result {} foreach tok $tokens { upvar #0 $tok nodeInfo switch -- $nodeInfo(node:nodeType) { element { if {[string match $name [GetField nodeInfo(node:nodeName)]]} { lappend result $tok } if {$deep} { set childResult [Element:GetByTagName:Search [set $nodeInfo(node:childNodes)] $name $deep {} {} {}] if {[llength $childResult]} { eval lappend result $childResult } } } } } if {[string length $name1]} { set $name1 $result return {} } else { return $result } } # dom::tcl::Element:GetByTagName:Error -- # # Complain about the application writing to a variable # that this package maintains. # # Arguments: # name1 \ # name2 > appended by trace command # op / # # Results: # Error code returned. proc dom::tcl::Element:GetByTagName:Error {name1 name2 op} { return -code error "dom: Read-only variable" } # dom::tcl::Element:Normalize -- # # Normalize the text nodes # # Arguments: # pVar parent array variable in caller # nodes list of node tokens # # Results: # Adjacent text nodes are coalesced proc dom::tcl::Element:Normalize {pVar nodes} { upvar #0 $pVar parent set textNode {} foreach n $nodes { upvar #0 $n child set cleanup {} switch $child(node:nodeType) { textNode { if {[llength $textNode]} { # Coalesce into previous node set evid [CreateEvent $n DOMCharacterDataModified] event initMutationEvent $evid DOMCharacterDataModified 1 0 {} $text(node:nodeValue) $text(node:nodeValue)$child(node:nodeValue) {} {} append text(node:nodeValue) $child(node:nodeValue) node dispatchEvent $n $evid DOMImplementation destroy $evid # Remove this child upvar #0 $parent(node:childNodes) childNodes set idx [lsearch $childNodes $n] set childNodes [lreplace $childNodes $idx $idx] unset $n set cleanup [list event postMutationEvent [node parent $n] DOMSubtreeModified] event postMutationEvent $n DOMNodeRemoved set $textNode [array get text] } else { set textNode $n catch {unset text} array set text [array get child] } } element - document - documentFragment { set textNode {} Element:Normalize child [set $child(node:childNodes)] } default { set textNode {} } } eval $cleanup } return {} } # dom::tcl::processinginstruction -- # # Functions for a processing intruction. # # Arguments: # method method to invoke # token token for node # args arguments for method # # Results: # Depends on method used. namespace eval dom::tcl { variable piOptionsRO target variable piOptionsRW data } proc dom::tcl::processinginstruction {method token args} { variable piOptionsRO variable piOptionsRW upvar #0 $token node set result {} switch -- $method { cget { # Some read-only configuration options are computed if {[llength $args] != 1} { return -code error "too many arguments" } if {[regexp [format {^-(%s)$} $elementOptionsRO] [lindex $args 0] discard option]} { switch $option { target { set result [lindex $node(node:nodeName) 0] } default { return $node(node:$option) } } } elseif {[regexp [format {^-(%s)$} $elementOptionsRW] [lindex $args 0] discard option]} { switch $option { data { return $node(node:nodeValue) } default { return $node(node:$option) } } } else { return -code error "unknown option \"[lindex $args 0]\"" } } configure { if {[llength $args] == 1} { return [document cget $token [lindex $args 0]] } elseif {[expr [llength $args] % 2]} { return -code error "no value specified for option \"[lindex $args end]\"" } else { foreach {option value} $args { if {[regexp [format {^-(%s)$} $elementOptionsRO] $option discard opt]} { return -code error "attribute \"$option\" is read-only" } elseif {[regexp [format {^-(%s)$} $elementOptionsRW] $option discard opt]} { switch $opt { data { set evid [CreateEvent $token DOMCharacterDataModified] event initMutationEvent $evid DOMCharacterModified 1 0 {} $node(node:nodeValue) $value {} {} set node(node:nodeValue) $value node dispatchEvent $token $evid DOMImplementation destroy $evid } default { set node(node:$opt) $value } } } else { return -code error "unknown option \"$option\"" } } } } default { return -code error "unknown method \"$method\"" } } return $result } ################################################# # # DOM Level 2 Interfaces # ################################################# # dom::tcl::event -- # # Implements Event Interface # # Subclassed Interfaces are also defined here, # such as UIEvents. # # Arguments: # method method to invoke # token token for event # args arguments for method # # Results: # Depends on method used. namespace eval dom::tcl { variable eventOptionsRO type|target|currentNode|eventPhase|bubbles|cancelable|timeStamp|detail|view|screenX|screenY|clientX|clientY|ctrlKey|shiftKey|altKey|metaKey|button|relatedNode|prevValue|newValue|attrName|attrChange variable eventOptionsRW {} # Issue: should the attributes belonging to the subclassed Interface # be separated out? variable uieventOptionsRO detail|view variable uieventOptionsRW {} variable mouseeventOptionsRO screenX|screenY|clientX|clientY|ctrlKey|shiftKey|altKey|metaKey|button|relatedNode variable mouseeventOptionsRW {} variable mutationeventOptionsRO relatedNode|prevValue|newValue|attrName variable mutationeventOptionsRW {} } proc dom::tcl::event {method token args} { variable eventOptionsRO variable eventOptionsRW upvar #0 $token event set result {} switch -glob -- $method { cg* { # cget if {[llength $args] != 1} { return -code error "too many arguments" } if {[regexp [format {^-(%s)$} $eventOptionsRO] [lindex $args 0] discard option]} { return $event($option) } elseif {[regexp [format {^-(%s)$} $eventOptionsRW] [lindex $args 0] discard option]} { return $event($option) } else { return -code error "unknown option \"[lindex $args 0]\"" } } co* { # configure if {[llength $args] == 1} { return [event cget $token [lindex $args 0]] } elseif {[expr [llength $args] % 2]} { return -code error "no value specified for option \"[lindex $args end]\"" } else { foreach {option value} $args { if {[regexp [format {^-(%s)$} $eventOptionsRW] $option discard opt]} { set event($opt) $value } elseif {[regexp [format {^-(%s)$} $eventOptionsRO] $option discard opt]} { return -code error "attribute \"$option\" is read-only" } else { return -code error "unknown option \"$option\"" } } } } st* { # stopPropagation set event(stopPropagation) 1 } pr* { # preventDefault set event(preventDefault) 1 } initE* { # initEvent if {[llength $args] != 3} { return -code error "wrong # args: should be dom::event initEvent token type bubbles cancelable" } if {$event(dispatched)} { return -code error "event has been dispatched" } foreach {event(type) event(bubbles) event(cancelable)} $args break } initU* { # initUIEvent if {[llength $args] < 4 || [llength $args] > 5} { return -code error "wrong # args: should be dom::event initUIEvent token type bubbles cancelable view detail" } if {$event(dispatched)} { return -code error "event has been dispatched" } set event(detail) 0 foreach {event(type) event(bubbles) event(cancelable) event(view) event(detail)} $args break } initMo* { # initMouseEvent if {[llength $args] != 15} { return -code error "wrong # args: should be dom::event initMouseEvent token type bubbles cancelable view detail screenX screenY clientX clientY ctrlKey altKey shiftKey metaKey button relatedNode" } if {$event(dispatched)} { return -code error "event has been dispatched" } set event(detail) 1 foreach {event(type) event(bubbles) event(cancelable) event(view) event(detail) event(screenX) event(screenY) event(clientX) event(clientY) event(ctrlKey) event(altKey) event(shiftKey) event(metaKey) event(button) event(relatedNode)} $args break } initMu* { # initMutationEvent if {[llength $args] != 8} { return -code error "wrong # args: should be dom::event initMutationEvent token type bubbles cancelable relatedNode prevValue newValue attrName attrChange" } if {$event(dispatched)} { return -code error "event has been dispatched" } foreach {event(type) event(bubbles) event(cancelable) event(relatedNode) event(prevValue) event(newValue) event(attrName) event(attrChange)} $args break } postUI* { # postUIEvent, non-standard convenience method set evType [lindex $args 0] array set evOpts [list \ -bubbles $::dom::bubbles($evType) -cancelable $::dom::cancelable($evType) \ -view {} \ -detail {} \ ] array set evOpts [lrange $args 1 end] set evid [CreateEvent $token $evType] event initUIEvent $evid $evType $evOpts(-bubbles) $evOpts(-cancelable) $evOpts(-view) $evOpts(-detail) node dispatchEvent $token $evid DOMImplementation destroy $evid } postMo* { # postMouseEvent, non-standard convenience method set evType [lindex $args 0] array set evOpts [list \ -bubbles $::dom::bubbles($evType) -cancelable $::dom::cancelable($evType) \ -view {} \ -detail {} \ -screenX {} \ -screenY {} \ -clientX {} \ -clientY {} \ -ctrlKey {} \ -altKey {} \ -shiftKey {} \ -metaKey {} \ -button {} \ -relatedNode {} \ ] array set evOpts [lrange $args 1 end] set evid [CreateEvent $token $evType] event initMouseEvent $evid $evType $evOpts(-bubbles) $evOpts(-cancelable) $evOpts(-view) $evOpts(-detail) $evOpts(-screenX) $evOpts(-screenY) $evOpts(-clientX) $evOpts(-clientY) $evOpts(-ctrlKey) $evOpts(-altKey) $evOpts(-shiftKey) $evOpts(-metaKey) $evOpts(-button) $evOpts(-relatedNode) node dispatchEvent $token $evid DOMImplementation destroy $evid } postMu* { # postMutationEvent, non-standard convenience method set evType [lindex $args 0] array set evOpts [list \ -bubbles $::dom::bubbles($evType) -cancelable $::dom::cancelable($evType) \ -relatedNode {} \ -prevValue {} -newValue {} \ -attrName {} -attrChange {} \ ] array set evOpts [lrange $args 1 end] set evid [CreateEvent $token $evType] event initMutationEvent $evid $evType $evOpts(-bubbles) $evOpts(-cancelable) $evOpts(-relatedNode) $evOpts(-prevValue) $evOpts(-newValue) $evOpts(-attrName) $evOpts(-attrChange) node dispatchEvent $token $evid DOMImplementation destroy $evid } default { return -code error "unknown method \"$method\"" } } return $result } # dom::tcl::CreateEvent -- # # Create an event object # # Arguments: # token parent node # type event type # args configuration options # # Results: # Returns event token proc dom::tcl::CreateEvent {token type args} { array set opts $args if {[string length $token]} { upvar #0 $token parent upvar #0 [namespace qualifiers $token]::Document document set child [namespace qualifiers $token]::event[incr document(counter)] } elseif {[info exists $opts(-document)]} { upvar #0 $opts(-document) document set child [namespace qualifiers $opts(-document)]::event[incr document(counter)] } upvar #0 $child event # Create the event array set event [list \ node:nodeType event \ type $type \ target {} \ currentNode {} \ cancelable 1 \ stopPropagation 0 \ preventDefault 0 \ dispatched 0 \ bubbles 1 \ eventPhase {} \ timeStamp [clock clicks -milliseconds] \ ] proc $child {method args} "return \[eval [namespace current]::event \[list \$method\] $child \$args\]" trace add command $child delete [namespace code [list Node:Delete $child]] return $child } ################################################# # # Serialisation # ################################################# # dom::tcl::Serialize:documentFragment -- # # Produce text for documentFragment. # # Arguments: # token node token # args configuration options # # Results: # XML format text. proc dom::tcl::Serialize:documentFragment {token args} { upvar #0 $token node if {[string compare "Document" [namespace tail $token]]} { return [eval [list Serialize:node $token] $args] } else { if {[string compare {} [GetField node(document:documentElement)]]} { return [eval Serialize:document [list $token] $args] } else { return -code error "document has no document element" } } } # dom::tcl::Serialize:document -- # # Produce text for document. # # Arguments: # token node token # args configuration options # # Results: # XML format text. proc dom::tcl::Serialize:document {token args} { upvar #0 $token node array set opts { -showxmldecl 1 -showdoctypedecl 1 } array set opts $args set result {} if {[string length $node(document:doctype)]} { upvar #0 $node(document:doctype) doctype # Bug fix: can't use Serialize:attributeList for XML declaration, # since attributes must occur in a given order (XML 2.8 [23]) set result {} if {$opts(-showxmldecl)} { append result \n } if {$opts(-showdoctypedecl)} { # Is document element in an XML Namespace? # If so then include prefix in doctype decl foreach {prefix localName} [::xml::qnamesplit $doctype(doctype:name)] break if {![string length $prefix]} { # The prefix may not have been allocated yet upvar #0 $node(document:documentElement) docel if {[info exists docel(node:namespaceURI)] && \ [string length $docel(node:namespaceURI)]} { set declPrefix [GetNamespacePrefix $node(document:documentElement) $docel(node:namespaceURI)] set docelName $declPrefix:$doctype(doctype:name) } else { set docelName $doctype(doctype:name) } } else { set docelName $doctype(doctype:name) } # Applied patch by Marco Gonnelli, bug #590914 append result \n } } # BUG #525505: Want to serialize all children including the # document element. if {[info exists $node(node:childNodes)]} { foreach child [set $node(node:childNodes)] { append result [eval Serialize:[node cget $child -nodeType] [list $child] $args] } } return $result } # dom::tcl::Serialize:ExternalID -- # # Returned appropriately quoted external identifiers # # Arguments: # publicid public identifier # systemid system identifier # # Results: # text proc dom::tcl::Serialize:ExternalID {publicid systemid} { switch -glob -- [string length $publicid],[string length $systemid] { 0,0 { return {} } 0,* { return " SYSTEM \"$systemid\"" } *,* { # Patch from c.l.t., Richard Calmbach (rc@hnc.com ) return " PUBLIC \"$publicid\" \"$systemid\"" } } return {} } # dom::tcl::Serialize:XMLDecl -- # # Produce text for XML Declaration attribute. # Order is determine by document serialisation procedure. # # Arguments: # attr required attribute # attList attribute list # # Results: # XML format text. proc dom::tcl::Serialize:XMLDecl {attr attrList} { array set data $attrList if {![info exists data($attr)]} { return {} } elseif {[string length $data($attr)]} { return " $attr='$data($attr)'" } else { return {} } } # dom::tcl::Serialize:node -- # # Produce text for an arbitrary node. # This simply serializes the child nodes of the node. # # Arguments: # token node token # args configuration options # # Results: # XML format text. proc dom::tcl::Serialize:node {token args} { upvar #0 $token node array set opts $args if {[info exists opts(-indent)]} { # NB. 0|1 cannot be used as booleans - mention this in docn if {[regexp {^false|no|off$} $opts(-indent)]} { # No action required } elseif {[regexp {^true|yes|on$} $opts(-indent)]} { set opts(-indent) 1 } else { incr opts(-indent) } } set result {} foreach childToken [set $node(node:childNodes)] { upvar #0 $childToken child append result [eval [list Serialize:$child(node:nodeType) $childToken] [array get opts]] } return $result } # dom::tcl::Serialize:element -- # # Produce text for an element. # # Arguments: # token node token # args configuration options # # Results: # XML format text. proc dom::tcl::Serialize:element {token args} { upvar #0 $token node array set opts {-newline {}} array set opts $args set result {} set newline {} if {[lsearch $opts(-newline) $node(node:nodeName)] >= 0} { append result \n set newline \n } append result [eval Serialize:Indent [array get opts]] switch [info exists node(node:namespaceURI)],[info exists node(node:prefix)] { 1,1 { # XML Namespace is in scope, prefix supplied if {[string length $node(node:prefix)]} { # Make sure that there's a declaration for this XML Namespace set declPrefix [GetNamespacePrefix $token $node(node:namespaceURI) -prefix $node(node:prefix)] # ASSERTION: $declPrefix == $node(node:prefix) set nsPrefix $node(node:prefix): } elseif {[string length $node(node:namespaceURI)]} { set nsPrefix [GetNamespacePrefix $token $node(node:namespaceURI)]: } else { set nsPrefix {} } } 1,0 { # XML Namespace is in scope, no prefix set nsPrefix [GetNamespacePrefix $token $node(node:namespaceURI)]: if {![string compare $nsPrefix :]} { set nsPrefix {} } } 0,1 { # Internal error set nsPrefix {} } 0,0 - default { # No XML Namespace is in scope set nsPrefix {} } } append result <$nsPrefix$node(node:localName) append result [Serialize:attributeList [array get $node(element:attributeList)]] if {![llength [set $node(node:childNodes)]]} { append result />$newline } else { append result >$newline # Do the children if {[hasmixedcontent $token]} { set opts(-indent) no } append result [eval Serialize:node [list $token] [array get opts]] append result [eval Serialize:Indent [array get opts]] append result "$newline$newline" } return $result } # dom::tcl::GetNamespacePrefix -- # # Determine the XML Namespace prefix for a Namespace URI # # Arguments: # token node token # nsuri XML Namespace URI # args configuration options # # Results: # Returns prefix. # May add prefix information to node proc dom::tcl::GetNamespacePrefix {token nsuri args} { upvar #0 $token node array set options $args GetNamespaceDecl $token $nsuri declNode prefix if {[llength $declNode]} { # A declaration was found for this Namespace URI return $prefix } else { # No declaration found. Allocate a prefix # and add XML Namespace declaration set prefix {} catch {set prefix $options(-prefix)} if {![string compare $prefix {}]} { upvar #0 [namespace qualifiers $token]::Document document set prefix ns[incr document(counter)] } set node(node:prefix) $prefix upvar \#0 $node(element:attributeList) attrs set attrs(${::dom::xmlnsURI}^$prefix) $nsuri return $prefix } } # dom::tcl::GetNamespaceDecl -- # # Find the XML Namespace declaration. # # Arguments: # token node token # nsuri XML Namespace URI # nodeVar Variable name for declaration # prefVar Variable for prefix # # Results: # If the declaration is found returns node and prefix proc dom::tcl::GetNamespaceDecl {token nsuri nodeVar prefVar} { upvar #0 $token node upvar $nodeVar declNode upvar $prefVar prefix while {[string length $node(node:parentNode)]} { # Check this node's XML Namespace declarations catch {unset attrs} array set attrs [array get $node(element:attributeList)] foreach {nsdecl decluri} [array get attrs ${::dom::xmlnsURI}^*] { if {![string compare $decluri $nsuri]} { regexp [format {%s\^(.*)} $::dom::xmlnsURI] $nsdecl dummy prefix set declNode $token return } } # Move up to parent set token $node(node:parentNode) upvar #0 $token node } # Got to Document node and didn't find XML NS decl set prefix {} set declNode {} } # dom::tcl::Serialize:textNode -- # # Produce text for a text node. This procedure may # return a CDATA section where appropriate. # # Arguments: # token node token # args configuration options # # Results: # XML format text. proc dom::tcl::Serialize:textNode {token args} { upvar #0 $token node if {$node(node:cdatasection)} { return [Serialize:CDATASection $node(node:nodeValue)] } elseif {[Serialize:ExceedsThreshold $node(node:nodeValue)]} { return [Serialize:CDATASection $node(node:nodeValue)] } else { return [Encode $node(node:nodeValue)] } } # dom::tcl::Serialize:ExceedsThreshold -- # # Applies heuristic(s) to determine whether a text node # should be formatted as a CDATA section. # # Arguments: # text node text # # Results: # Boolean. proc dom::tcl::Serialize:ExceedsThreshold {text} { return [expr {[regsub -all {[<>&]} $text {} discard] > $::dom::maxSpecials}] } # dom::tcl::Serialize:CDATASection -- # # Formats a CDATA section. # # Arguments: # text node text # # Results: # XML text. proc dom::tcl::Serialize:CDATASection {text} { set result {} while {[regexp {(.*)]]>(.*)} $text discard text trailing]} { set result \]\]>\;$result } return $result } # dom::tcl::Serialize:processingInstruction -- # # Produce text for a PI node. # # Arguments: # token node token # args configuration options # # Results: # XML format text. proc dom::tcl::Serialize:processingInstruction {token args} { upvar #0 $token node return "[eval Serialize:Indent $args]" } # dom::tcl::Serialize:comment -- # # Produce text for a comment node. # # Arguments: # token node token # args configuration options # # Results: # XML format text. proc dom::tcl::Serialize:comment {token args} { upvar #0 $token node return [eval Serialize:Indent $args] } # dom::tcl::Serialize:entityReference -- # # Produce text for an entity reference. # # Arguments: # token node token # args configuration options # # Results: # XML format text. proc dom::tcl::Serialize:entityReference {token args} { upvar #0 $token node return &$node(node:nodeName)\; } # dom::tcl::Encode -- # # Encode special characters # # Arguments: # value text value # # Results: # XML format text. proc dom::tcl::Encode value { array set Entity { $ $ < < > > & & \" " ' ' } regsub -all {([$<>&"'])} $value {$Entity(\1)} value return [subst -nocommand -nobackslash $value] } # dom::tcl::Serialize:attributeList -- # # Produce text for an attribute list. # # Arguments: # l name/value paired list # # Results: # XML format text. proc dom::tcl::Serialize:attributeList {l} { set result {} foreach {name value} $l { if {[regexp {^([^^]+)\^(.*)$} $name discard nsuri prefix]} { if {[string compare $nsuri $::dom::xmlnsURI]} { # Need the node token to resolve the Namespace URI append result { } ?:$prefix = } else { # A Namespace declaration append result { } xmlns:$prefix = } } else { append result { } $name = } # Handle special characters regsub -all & $value {\&} value regsub -all < $value {\<} value if {![string match *\"* $value]} { append result \"$value\" } elseif {![string match *'* $value]} { append result '$value' } else { regsub -all \" $value {\"} value append result \"$value\" } } return $result } # dom::tcl::Serialize:Indent -- # # Calculate the indentation required, if any # # Arguments: # args configuration options, which may specify -indent # # Results: # May return white space proc dom::tcl::Serialize:Indent args { array set opts [list -indentspec $::dom::indentspec] array set opts $args if {![info exists opts(-indent)] || \ [regexp {^false|no|off$} $opts(-indent)]} { return {} } if {[regexp {^true|yes|on$} $opts(-indent)]} { # Default indent level is 0 return \n } if {!$opts(-indent)} { return \n } set ws [format \n%\ [expr $opts(-indent) * [lindex $opts(-indentspec) 0]]s { }] regsub -all [lindex [lindex $opts(-indentspec) 1] 0] $ws [lindex [lindex $opts(-indentspec) 1] 1] ws return $ws } ################################################# # # Parsing # ################################################# # dom::tcl::ParseElementStart -- # # Push a new element onto the stack. # # Arguments: # stateVar global state array variable # name element name # attrList attribute list # args configuration options # # Results: # An element is created within the currently open element. proc dom::tcl::ParseElementStart {stateVar name attrList args} { upvar #0 $stateVar state array set opts $args # Push namespace declarations # We need to be able to map namespaceURI's back to prefixes set nsattrlists {} catch { foreach {namespaceURI prefix} $opts(-namespacedecls) { lappend state(NS:$namespaceURI) $prefix # Also, synthesize namespace declaration attributes # TclXML is a little too clever when it parses them away! lappend nsattrlists $prefix $namespaceURI } lappend opts(-namespaceattributelists) $::dom::xmlnsURI $nsattrlists } set nsarg {} catch { lappend nsarg -namespace $opts(-namespace) lappend nsarg -localname $name lappend nsarg -prefix [lindex $state(NS:$opts(-namespace)) end] } lappend state(current) \ [eval CreateElement [list [lindex $state(current) end] $name $attrList] $nsarg [array get opts -namespaceattributelists]] if {[info exists opts(-empty)] && $opts(-empty)} { # Flag this node as being an empty element upvar #0 [lindex $state(current) end] node set node(element:empty) 1 } # Temporary: implement -progresscommand here, because of broken parser if {[string length $state(-progresscommand)]} { if {!([incr state(progCounter)] % $state(-chunksize))} { uplevel #0 $state(-progresscommand) } } } # dom::tcl::ParseElementEnd -- # # Pop an element from the stack. # # Arguments: # stateVar global state array variable # name element name # args configuration options # # Results: # Currently open element is closed. proc dom::tcl::ParseElementEnd {stateVar name args} { upvar #0 $stateVar state set state(current) [lreplace $state(current) end end] } # dom::tcl::ParseCharacterData -- # # Add a textNode to the currently open element. # # Arguments: # stateVar global state array variable # data character data # # Results: # A textNode is created. proc dom::tcl::ParseCharacterData {stateVar data} { upvar #0 $stateVar state CreateTextNode [lindex $state(current) end] $data } # dom::tcl::ParseProcessingInstruction -- # # Add a PI to the currently open element. # # Arguments: # stateVar global state array variable # name PI name # target PI target # # Results: # A processingInstruction node is created. proc dom::tcl::ParseProcessingInstruction {stateVar name target} { upvar #0 $stateVar state CreateGeneric [lindex $state(current) end] node:nodeType processingInstruction node:nodeName $name node:nodeValue $target } # dom::tcl::ParseXMLDeclaration -- # # Add information from the XML Declaration to the document. # # Arguments: # stateVar global state array variable # version version identifier # encoding character encoding # standalone standalone document declaration # # Results: # Document node modified. proc dom::tcl::ParseXMLDeclaration {stateVar version encoding standalone} { upvar #0 $stateVar state upvar #0 $state(docNode) document array set xmldecl $document(document:xmldecl) array set xmldecl [list version $version \ standalone $standalone \ encoding $encoding \ ] set document(document:xmldecl) [array get xmldecl] return {} } # dom::tcl::ParseDocType -- # # Add a Document Type Declaration node to the document. # # Arguments: # stateVar global state array variable # root root element type # publit public identifier literal # systemlist system identifier literal # dtd internal DTD subset # # Results: # DocType node added proc dom::tcl::ParseDocType {stateVar root {publit {}} {systemlit {}} {dtd {}} args} { upvar #0 $stateVar state upvar #0 $state(docNode) document set document(document:doctype) [CreateDocType $state(docNode) $publit $systemlit $dtd] return {} } # dom::tcl::ParseComment -- # # Parse comment # # Arguments: # stateVar state array # data comment data # # Results: # Comment node added to DOM tree proc dom::tcl::ParseComment {stateVar data} { upvar #0 $stateVar state CreateGeneric [lindex $state(current) end] node:nodeType comment node:nodeValue $data return {} } # dom::tcl::ParseEntityReference -- # # Parse an entity reference # # Arguments: # stateVar state variable # ref entity # # Results: # Entity reference node added to DOM tree proc dom::tcl::ParseEntityReference {stateVar ref} { upvar #0 $stateVar state CreateGeneric [lindex $state(current) end] node:nodeType entityReference node:nodeName $ref return {} } ################################################# # # Trim white space # ################################################# # dom::tcl::Trim -- # # Remove textNodes that only contain white space # # Arguments: # nodeid node to trim # # Results: # textNode nodes may be removed (from descendants) proc dom::tcl::Trim nodeid { upvar #0 $nodeid node switch $node(node:nodeType) { textNode { if {![string length [string trim $node(node:nodeValue)]]} { node removeChild $node(node:parentNode) $nodeid } } default { # Some nodes have no child list. Reported by Jim Hollister set children {} catch {set children [set $node(node:childNodes)]} foreach child $children { Trim $child } } } return {} } ################################################# # # XPath support # ################################################# # dom::tcl::XPath:CreateNode -- # # Given an XPath expression, create the node # referred to by the expression. Nodes required # as steps of the path are created if they do # not exist. # # Arguments: # node context node # path location path # # Results: # Node(s) created in the DOM tree. # Returns token for deepest node in the expression. proc dom::tcl::XPath:CreateNode {node path} { set root [::dom::node cget $node -ownerDocument] set spath [::xpath::split $path] if {[llength $spath] <= 1} { # / - do nothing return $root } if {![llength [lindex $spath 0]]} { # Absolute location path set context $root set spath [lrange $spath 1 end] set contexttype document } else { set context $node set contexttype [::dom::node cget $node -nodeType] } foreach step $spath { # Sanity check on path switch $contexttype { document - documentFragment - element {} default { return -code error "node type \"$contexttype\" have no children" } } switch [lindex $step 0] { child { if {[llength [lindex $step 1]] > 1} { foreach {nodetype discard} [lindex $step 1] break switch -- $nodetype { text { set posn [CreateNode:FindPosition [lindex $step 2]] set count 0 set targetNode {} foreach child [::dom::node children $context] { switch [::dom::node cget $child -nodeType] { textNode { incr count if {$count == $posn} { set targetNode $child break } } default {} } } if {[string length $targetNode]} { set context $targetNode } else { # Creating sequential textNodes doesn't make sense set context [::dom::document createTextNode $context {}] } set contexttype textNode } default { return -code error "node type test \"${nodetype}()\" not supported" } } } else { # Find the child element set posn [CreateNode:FindPosition [lindex $step 2]] set count 0 set targetNode {} foreach child [::dom::node children $context] { switch [node cget $child -nodeType] { element { if {![string compare [lindex $step 1] [::dom::node cget $child -nodeName]]} { incr count if {$count == $posn} { set targetNode $child break } } } default {} } } if {[string length $targetNode]} { set context $targetNode } else { # Didn't find it so create required elements while {$count < $posn} { set child [::dom::document createElement $context [lindex $step 1]] incr count } set context $child } set contexttype element } } default { return -code error "axis \"[lindex $step 0]\" is not supported" } } } return $context } # dom::tcl::CreateNode:FindPosition -- proc dom::tcl::CreateNode:FindPosition predicates { switch [llength $predicates] { 0 { return 1 } 1 { # Fall-through } default { return -code error "multiple predicates not yet supported" } } set predicate [lindex $predicates 0] switch -- [lindex [lindex $predicate 0] 0] { function { switch -- [lindex [lindex $predicate 0] 1] { position { if {[lindex $predicate 1] == "="} { if {[string compare [lindex [lindex $predicate 2] 0] "number"]} { return -code error "operand must be a number" } else { set posn [lindex [lindex $predicate 2] 1] } } else { return -code error "operator must be \"=\"" } } default { return -code error "predicate function \"[lindex [lindex $predicate 0] 1]\" not supported" } } } default { return -code error "predicate must be position() function" } } return $posn } # dom::tcl::XPath:SelectNode -- # # Match nodes with an XPath location path # # Arguments: # ctxt context - Tcl list # path location path # # Results: # Returns Tcl list of matching nodes proc dom::tcl::XPath:SelectNode {ctxt path} { if {![llength $ctxt]} { return {} } set spath [xpath::split $path] if {[string length [node parent [lindex $ctxt 0]]]} { set root [namespace qualifiers [lindex $ctxt 0]]::Document } else { set root [lindex $ctxt 0] } if {[llength $spath] == 0} { return $root } if {[llength $spath] == 1 && [llength [lindex $spath 0]] == 0} { return $root } if {![llength [lindex $spath 0]]} { set ctxt $root set spath [lrange $spath 1 end] } return [XPath:SelectNode:Rel $ctxt $spath] } # dom::tcl::XPath:SelectNode:Rel -- # # Match nodes with an XPath location path # # Arguments: # ctxt context - Tcl list # path split location path # # Results: # Returns Tcl list of matching nodes proc dom::tcl::XPath:SelectNode:Rel {ctxt spath} { if {![llength $spath]} { return $ctxt } set step [lindex $spath 0] set result {} switch [lindex $step 0] { child { # All children are candidates set children {} foreach node [XPath:SN:GetElementTypeNodes $ctxt] { eval lappend children [node children $node] } # Now apply node test to each child foreach node $children { if {[XPath:SN:ApplyNodeTest $node [lindex $step 1]]} { lappend result $node } } } descendant-or-self { foreach node $ctxt { if {[XPath:SN:ApplyNodeTest $node [lindex $step 1]]} { lappend result $node } eval lappend result [XPath:SN:DescendAndTest [node children $node] [lindex $step 1]] } } descendant { foreach node $ctxt { eval lappend result [XPath:SN:DescendAndTest [node children $node] [lindex $step 1]] } } attribute { if {[string compare [lindex $step 1] "*"]} { foreach node $ctxt { set attrNode [element getAttributeNode $node [lindex $step 1]] if {[llength $attrNode]} { lappend result $attrNode } } } else { # All attributes are returned foreach node $ctxt { foreach attrName [array names [node cget $node -attributes]] { set attrNode [element getAttributeNode $node $attrName] if {[llength $attrNode]} { lappend result $attrNode } } } } } default { return -code error "axis \"[lindex $step 0]\" is not supported" } } # Now apply predicates set result [XPath:ApplyPredicates $result [lindex $step 2]] # Apply the next location step return [XPath:SelectNode:Rel $result [lrange $spath 1 end]] } # dom::tcl::XPath:SN:GetElementTypeNodes -- # # Reduce nodeset to those nodes of element type # # Arguments: # nodeset set of nodes # # Results: # Returns nodeset in which all nodes are element type proc dom::tcl::XPath:SN:GetElementTypeNodes nodeset { set result {} foreach node $nodeset { switch [node cget $node -nodeType] { document - documentFragment - element { lappend result $node } default {} } } return $result } # dom::tcl::XPath:SN:ApplyNodeTest -- # # Apply the node test to a node # # Arguments: # node DOM node to test # test node test # # Results: # 1 if node passes, 0 otherwise proc dom::tcl::XPath:SN:ApplyNodeTest {node test} { if {[llength $test] > 1} { foreach {name typetest} $test break # Node type test switch -glob -- $name,[node cget $node -nodeType] { node,* { return 1 } text,textNode - comment,comment - processing-instruction,processingInstruction { return 1 } text,* - comment,* - processing-instruction,* { return 0 } default { return -code error "illegal node type test \"[lindex $step 1]\"" } } } else { # Node name test switch -glob -- $test,[node cget $node -nodeType],[node cget $node -nodeName] \ \\*,element,* { return 1 } \ \\*,* { return 0 } \ *,element,$test { return 1 } } return 0 } # dom::tcl::XPath:SN:DescendAndTest -- # # Descend the element hierarchy, # apply the node test as we go # # Arguments: # nodeset nodes to be tested and descended # test node test # # Results: # Returned nodeset of nodes which pass the test proc dom::tcl::XPath:SN:DescendAndTest {nodeset test} { set result {} foreach node $nodeset { if {[XPath:SN:ApplyNodeTest $node $test]} { lappend result $node } switch [node cget $node -nodeType] { document - documentFragment - element { eval lappend result [XPath:SN:DescendAndTest [node children $node] $test] } } } return $result } # dom::tcl::XPath:ApplyPredicates -- # # Filter a nodeset with predicates # # Arguments: # ctxt current context nodeset # preds list of predicates # # Results: # Returns new (possibly reduced) context nodeset proc dom::tcl::XPath:ApplyPredicates {ctxt preds} { set result {} foreach node $ctxt { set passed 1 foreach predicate $preds { if {![XPath:ApplyPredicate $node $predicate]} { set passed 0 break } } if {$passed} { lappend result $node } } return $result } # dom::tcl::XPath:ApplyPredicate -- # # Filter a node with a single predicate # # Arguments: # node current context node # pred predicate # # Results: # Returns boolean proc dom::tcl::XPath:ApplyPredicate {node pred} { switch -- [lindex $pred 0] { = - != - >= - <= - > - > { if {[llength $pred] != 3} { return -code error "malformed expression" } set operand1 [XPath:Pred:ResolveExpr $node [lindex $pred 1]] set operand2 [XPath:Pred:ResolveExpr $node [lindex $pred 2]] # Convert operands to the correct type, if necessary switch -glob [lindex $operand1 0],[lindex $operand2 0] { literal,literal { return [XPath:Pred:CompareLiterals [lindex $pred 0] [lindex $operand1 1] [lindex $operand2 1]] } number,number - literal,number - number,literal { # Compare as numbers return [XPath:Pred:CompareNumbers [lindex $pred 0] [lindex $operand1 1] [lindex $operand2 1]] } boolean,boolean { # Compare as booleans return -code error "boolean comparison not yet implemented" } node,node { # Nodeset comparison return -code error "nodeset comparison not yet implemented" } node,* { set value {} if {[llength [lindex $operand1 1]]} { set value [node stringValue [lindex [lindex $operand1 1] 0]] } return [XPath:Pred:CompareLiterals [lindex $pred 0] $value [lindex $operand2 1]] } *,node { set value {} if {[llength [lindex $operand2 1]]} { set value [node stringValue [lindex [lindex $operand2 1] 0]] } return [XPath:Pred:CompareLiterals [lindex $pred 0] $value [lindex $operand1 1]] } default { return -code error "can't compare [lindex $operand1 0] to [lindex $operand2 0]" } } } function { return -code error "invalid predicate" } number - literal { return -code error "invalid predicate" } path { set nodeset [XPath:SelectNode:Rel $node [lindex $pred 1]] return [expr {[llength $nodeset] > 0 ? 1 : 0}] } } return 1 } # dom::tcl::XPath:Pred:Compare -- proc dom::tcl::XPath:Pred:CompareLiterals {op operand1 operand2} { set result [string compare $operand1 $operand2] # The obvious: #return [expr {$result $opMap($op) 0}] # doesn't compile switch $op { = { return [expr {$result == 0}] } != { return [expr {$result != 0}] } <= { return [expr {$result <= 0}] } >= { return [expr {$result >= 0}] } < { return [expr {$result < 0}] } > { return [expr {$result > 0}] } } return -code error "internal error" } # dom::tcl::XPath:Pred:ResolveExpr -- proc dom::tcl::XPath:Pred:ResolveExpr {node expr} { switch [lindex $expr 0] { path { return [list node [XPath:SelectNode:Rel $node [lindex $expr 1]]] } function - group { return -code error "[lindex $expr 0] not yet implemented" } literal - number - boolean { return $expr } default { return -code error "internal error" } } return {} } ################################################# # # Miscellaneous # ################################################# # dom::tcl::hasmixedcontent -- # # Determine whether an element contains mixed content # # Arguments: # token dom node # # Results: # Returns 1 if element contains mixed content, # 0 otherwise proc dom::tcl::hasmixedcontent token { upvar #0 $token node if {[string compare $node(node:nodeType) "element"]} { # Really undefined return 0 } foreach child [set $node(node:childNodes)] { upvar #0 $child childnode if {![string compare $childnode(node:nodeType) "textNode"]} { return 1 } } return 0 } # dom::tcl::prefix2namespaceURI -- # # Given an XML Namespace prefix, find the corresponding Namespace URI # # Arguments: # node DOM Node # prefix XML Namespace prefix # # Results: # Returns URI proc dom::tcl::prefix2namespaceURI {node prefix} { # Search this node and its ancestors for the appropriate # XML Namespace declaration set parent [dom::node parent $node] set nsuri [dom::element getAttributeNS $node $::dom::xmlnsURI $prefix] if {[string length $parent] && ![string length $nsuri]} { set nsuri [dom::element getAttributeNS $parent $::dom::xmlnsURI $prefix] set parent [dom::node parent $parent] } if {[string length $nsuri]} { return $nsuri } else { return -code error "unable to find namespace URI for prefix \"$prefix\"" } } # dom::tcl::namespaceURI2prefix -- # # Given an XML Namespace URI, find the corresponding prefix # # Arguments: # node DOM Node # nsuri XML Namespace URI # # Results: # Returns prefix proc dom::tcl::namespaceURI2prefix {node nsuri} { # Search this node and its ancestors for the desired # XML Namespace declaration set found 0 set prefix {} set parent [dom::node parent $node] while {[string length $parent]} { upvar #0 $node nodeinfo catch {unset attrs} array set attrs [array get $nodeinfo(element:attributeList)] foreach {nsdecl declNSuri} [array get attrs ${::dom::xmlnsURI}^*] { if {![string compare $declNSuri $nsuri]} { set found 1 set prefix [lindex [split $nsdecl ^] 1] break } } if {$found} { break } set node $parent set parent [dom::node parent $node] } if {$found} { return $prefix } else { return -code error "unable to find prefix for namespace URI \"$nsuri\"" } } # dom::tcl::GetField -- # # Return a value, or empty string if not defined # # Arguments: # var name of variable to return # # Results: # Returns the value, or empty string if variable is not defined. proc dom::tcl::GetField var { upvar $var v if {[info exists v]} { return $v } else { return {} } } # dom::tcl::Min -- # # Return the minimum of two numeric values # # Arguments: # a a value # b another value # # Results: # Returns the value which is lower than the other. proc dom::tcl::Min {a b} { return [expr {$a < $b ? $a : $b}] } # dom::tcl::Max -- # # Return the maximum of two numeric values # # Arguments: # a a value # b another value # # Results: # Returns the value which is greater than the other. proc dom::tcl::Max {a b} { return [expr {$a > $b ? $a : $b}] } # dom::tcl::Boolean -- # # Return a boolean value # # Arguments: # b value # # Results: # Returns 0 or 1 proc dom::tcl::Boolean b { regsub -nocase {^(true|yes|1|on)$} $b 1 b regsub -nocase {^(false|no|0|off)$} $b 0 b return $b } tclxml-3.3~svn11.orig/tcldom-tcl/xmlswitch.tcl0000644000000000000000000002661211215700771020206 0ustar rootroot# xmlswitch.tcl -- # # This file implements a control structure for Tcl. # 'xmlswitch' iterates over an XML document. Features in # the document may be specified using XPath location paths, # and these will trigger Tcl scripts when matched. # # Copyright (c) 2008-2009 Explain # http://www.explain.com.au/ # Copyright (c) 2000-2003 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: xmlswitch.tcl,v 1.6 2003/12/09 04:56:43 balls Exp $ package provide xmlswitch 3.3 # We need the xml, dom and xpath packages package require xml 3.3 package require dom 3.3 package require xpath 1.0 namespace eval xmlswitch { namespace export xmlswitch xmlswitchcont xmlswitchend namespace export domswitch namespace export free rootnode variable counter 0 variable typemap array set typemap { text textNode comment comment processing-instruction processingInstruction } } # xmlswitch::xmlswitch -- # # Parse XML data, matching for XPath locations along the way # and (possibly) triggering callbacks. # # A DOM tree is built as a side-effect (necessary for resolving # XPath location paths). # # Arguments: # xml XML document # args configuration options, # plus a single path/script expression, or multiple expressions # # Results: # Tcl callbacks may be invoked. # If -async option is true returns a token for this "process". proc xmlswitch::xmlswitch {xml args} { variable counter set stateVarName [namespace current]::State[incr counter] upvar #0 $stateVarName state set state(stateVarName) $stateVarName set state(-async) 0 set state(pathArray) ${stateVarName}Paths upvar #0 $state(pathArray) paths array set paths {} set cleanup { unset state unset paths } # Find configuration options and remove set numOpts 0 foreach {opt value} $args { switch -glob -- $opt { -* { set state($opt) $value incr numOpts 2 } default { set args [lrange $args $numOpts end] break } } } switch -- [llength $args] { 0 { # Nothing to do eval $cleanup return $stateVarName } 1 { foreach {path script} [lindex $args 0] { set paths([xpath::split $path]) $script } } default { if {[llength $args] % 2} { eval $cleanup return -code error "no script matching location path \"[lindex $args end]\"" } foreach {path script} $args { set paths([xpath::split $path]) $script } } } set root [set state(root) [dom::DOMImplementation create]] set state(current) $root # Parse the document # We're going to do this incrementally, so the caller can # break at any time set state(parser) [eval xml::parser [array get state -parser]] #append cleanup "\n $parser destroy\n" $state(parser) configure \ -elementstartcommand [namespace code [list ParseElementStart $stateVarName]] \ -elementendcommand [namespace code [list ParseElementEnd $stateVarName]] \ -characterdatacommand [namespace code [list ParseCharacterData $stateVarName]] \ -final 0 # -processinginstructioncommand [namespace code [list ParsePI $stateVarName]] \ # -commentcommand [namespace code [list ParseComment]] if {[catch {$state(parser) parse $xml} err]} { eval $cleanup return -code error $err } if {$state(-async)} { return $stateVarName } else { eval $cleanup return {} } } # xmlswitch::xmlswitchcont -- # # Provide more XML data to parse # # Arguments: # token state variable name # xml XML data # # Results: # More parsing proc xmlswitch::xmlswitchcont {token xml} { upvar #0 $token state $state(parser) parse $xml return {} } # xmlswitch::xmlswitchend -- # # Signal that no further data is available # # Arguments: # token state array # # Results: # Parser configuration changed proc xmlswitch::xmlswitchend token { upvar #0 $token state $state(parser) configure -final true return {} } # xmlswitch::rootnode -- # # Get the root node # # Arguments: # token state array # # Results: # Returns root node token proc xmlswitch::rootnode token { upvar #0 $token state return $state(root) } # xmlswitch::free -- # # Free resources EXCEPT the DOM tree. # "-all" causes DOM tree to be destroyed too. # # Arguments: # token state array # args options # # Results: # Resources freed. proc xmlswitch::free {token args} { upvar #0 $token state if {[lsearch $args "-all"] >= 0} { dom::DOMImplementation destroy $state(root) } catch {unset $state(pathArray)} catch {unset state} catch {$state(parser) free} return {} } # xmlswitch::ParseElementStart -- # # Handle element start tag # # Arguments: # token state array # name element type # attrList attribute list # args options # Results: # All XPath location paths are checked for a match, # and script evaluated for matching XPath. # DOM tree node added. proc xmlswitch::ParseElementStart:dbgdisabled {token name attrList args} { if {[catch {eval ParseElementStart:dbg [list $token $name $attrList] $args} msg]} { puts stderr [list ParseElementStart failed with msg $msg] puts stderr $::errorInfo return -code error $msg } else { puts stderr [list ParseElementStart returned OK] } return $msg } proc xmlswitch::ParseElementStart {token name attrList args} { upvar #0 $token state array set opts $args #puts stderr [list xmlswitch::ParseElementStart $token $name $attrList $args] lappend state(current) \ [dom::document createElement [lindex $state(current) end] $name] foreach {name value} $attrList { dom::element setAttribute [lindex $state(current) end] $name $value } MatchTemplates $token [lindex $state(current) end] return {} } # xmlswitch::ParseElementEnd -- # # Handle element end tag # # Arguments: # token state array # name element type # args options # Results: # State changed proc xmlswitch::ParseElementEnd {token name args} { upvar #0 $token state set state(current) [lreplace $state(current) end end] return {} } # xmlswitch::ParseCharacterData -- # # Handle character data # # Arguments: # token state array # data pcdata # # Results: # All XPath location paths are checked for a match, # and script evaluated for matching XPath. # DOM tree node added. proc xmlswitch::ParseCharacterData {token data} { upvar #0 $token state lappend state(current) \ [dom::document createTextNode [lindex $state(current) end] $data] MatchTemplates $token [lindex $state(current) end] set state(current) [lreplace $state(current) end end] return {} } # xmlswitch::domswitch -- # # Similar to xmlswitch above, but iterates over a pre-built # DOM tree. # # Arguments: # xml XML document # args a single path/script expression, or multiple expressions # # Results: # Tcl callbacks may be invoked. proc xmlswitch::domswitch {xml args} { } # xmlswitch::MatchTemplates -- # # Check all templates for one which matches # the current node. # # Arguments: # token state array # node Current DOM node # # Results: # If a template matches, its script is evaluated proc xmlswitch::MatchTemplates {token node} { upvar #0 $token state upvar #0 $state(pathArray) paths #puts stderr [list xmlswitch::MatchTemplates $token $node (type: [dom::node cget $node -nodeType]) (name: [dom::node cget $node -nodeName])] set matches {} foreach {path script} [array get paths] { #puts stderr [list checking path $path for a match] set context $node # Work backwards along the path, reversing each axis set match 0 set i [llength $path] #puts stderr [list $i steps to be tested] while {[incr i -1] >= 0} { #puts stderr [list step $i [lindex $path $i]] switch -glob [llength [lindex $path $i]],$i { 0,0 { #puts stderr [list absolute path, end of steps - am I at the root?] if {![string length [dom::node parent $context]]} { #puts stderr [list absolute path matched] lappend matches [list $path $script] } else { #puts stderr [list absolute path did not match] } } *,0 { #puts stderr [list last step, relative path] switch [lindex [lindex $path $i] 0] { child { if {[NodeTest [lindex $path $i] $context] && \ [CheckPredicates [lindex $path $i] $context]} { #puts stderr [list relative path matched] lappend matches [list $path $script] } else { #puts stderr [list relative path did not match] } } default { return -code error "axis \"[lindex [lindex $path $i] 0]\" not supported" } } } default { #puts stderr [list continuing checking steps] switch [lindex [lindex $path $i] 0] { child { if {[NodeTest [lindex $path $i] $context] && \ [CheckPredicates [lindex $path $i] $context]} { set context [dom::node parent $context] } else { #puts stderr [list no match] } } default { return -code error "axis \"[lindex [lindex $path $i] 0]\" not supported" } } } } } } # TODO: If there are multiple matches then we must pick the # most specific match if {[llength $matches] > 1} { # For the moment we'll just take the first match set matches [list [lindex $matches 0]] } if {[llength $matches]} { #puts stderr [list evaluating callback at level [info level]] uplevel 3 [lindex [lindex $matches 0] 1] } return {} } # xmlswitch::NodeTest -- # # Check that the node passes the node (type) test # # Arguments: # step Location step # node DOM node # # Results: # Boolean proc xmlswitch::NodeTest {step node} { if {[llength [lindex $step 1]] > 1} { switch -glob -- [lindex [lindex $step 1] 0],[dom::node cget $node -nodeType] { node,* - text,textNode - comment,comment - processing-instruction,processingInstruction { return 1 } default { return 0 } } } elseif {![string compare [lindex $step 1] "*"]} { return 1 } elseif {![string compare [lindex $step 1] [dom::node cget $node -nodeName]]} { return 1 } else { return 0 } } # xmlswitch::CheckPredicates -- # # Check that the node passes the predicates # # Arguments: # step Location step # node DOM node # # Results: # Boolean proc xmlswitch::CheckPredicates {step node} { variable typemap set predicates [lindex $step 2] # Shortcut: no predicates means everything passes if {![llength $predicates]} { return 1 } # Get the context node set switch [lindex $step 0] { child { set nodeset {} if {[llength [lindex $step 1]]} { foreach {name typetest} [lindex $step 1] break switch -- $name { node { set nodeset [dom::node children [dom::node parent $node]] } text - comment - processing-instruction { foreach child [dom::node children [dom::node parent $node]] { if {![string compare [dom::node cget $child -nodeType] $typemap($name)]} { lappend nodeset $child } } } default { # Error } } } else { foreach child [dom::node children [dom::node parent $node]] { if {![string compare [lindex $step 1] [dom::node cget $child -nodeName]]} { lappend nodeset $child } } } } default { return -code error "axis \"[lindex $step 0]\" not supported" } } foreach predicate $predicates { # position() is the only supported predicate if {[lsearch $nodeset $node] + 1 == $predicate} { # continue } else { return 0 } } return 1 } tclxml-3.3~svn11.orig/autom4te.cache/0000755000000000000000000000000011574742537016231 5ustar rootroottclxml-3.3~svn11.orig/autom4te.cache/traces.00000644000000000000000000015274011215700771017566 0ustar rootrootm4trace:configure.in:21: -1- AC_INIT([Tclxml], [3.3]) m4trace:configure.in:21: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.in:21: -1- m4_pattern_forbid([_AC_]) m4trace:configure.in:21: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) m4trace:configure.in:21: -1- m4_pattern_allow([^AS_FLAGS$]) m4trace:configure.in:21: -1- m4_pattern_forbid([^_?m4_]) m4trace:configure.in:21: -1- m4_pattern_forbid([^dnl$]) m4trace:configure.in:21: -1- m4_pattern_forbid([^_?AS_]) m4trace:configure.in:21: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([SHELL]) m4trace:configure.in:21: -1- m4_pattern_allow([^SHELL$]) m4trace:configure.in:21: -1- AC_SUBST([PATH_SEPARATOR]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) m4trace:configure.in:21: -1- m4_pattern_allow([^PATH_SEPARATOR$]) m4trace:configure.in:21: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([PACKAGE_NAME]) m4trace:configure.in:21: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.in:21: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) m4trace:configure.in:21: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.in:21: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) m4trace:configure.in:21: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.in:21: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([PACKAGE_STRING]) m4trace:configure.in:21: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.in:21: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) m4trace:configure.in:21: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.in:21: -1- AC_SUBST([exec_prefix], [NONE]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([exec_prefix]) m4trace:configure.in:21: -1- m4_pattern_allow([^exec_prefix$]) m4trace:configure.in:21: -1- AC_SUBST([prefix], [NONE]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([prefix]) m4trace:configure.in:21: -1- m4_pattern_allow([^prefix$]) m4trace:configure.in:21: -1- AC_SUBST([program_transform_name], [s,x,x,]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([program_transform_name]) m4trace:configure.in:21: -1- m4_pattern_allow([^program_transform_name$]) m4trace:configure.in:21: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([bindir]) m4trace:configure.in:21: -1- m4_pattern_allow([^bindir$]) m4trace:configure.in:21: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([sbindir]) m4trace:configure.in:21: -1- m4_pattern_allow([^sbindir$]) m4trace:configure.in:21: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([libexecdir]) m4trace:configure.in:21: -1- m4_pattern_allow([^libexecdir$]) m4trace:configure.in:21: -1- AC_SUBST([datarootdir], ['${prefix}/share']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([datarootdir]) m4trace:configure.in:21: -1- m4_pattern_allow([^datarootdir$]) m4trace:configure.in:21: -1- AC_SUBST([datadir], ['${datarootdir}']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([datadir]) m4trace:configure.in:21: -1- m4_pattern_allow([^datadir$]) m4trace:configure.in:21: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([sysconfdir]) m4trace:configure.in:21: -1- m4_pattern_allow([^sysconfdir$]) m4trace:configure.in:21: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([sharedstatedir]) m4trace:configure.in:21: -1- m4_pattern_allow([^sharedstatedir$]) m4trace:configure.in:21: -1- AC_SUBST([localstatedir], ['${prefix}/var']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([localstatedir]) m4trace:configure.in:21: -1- m4_pattern_allow([^localstatedir$]) m4trace:configure.in:21: -1- AC_SUBST([includedir], ['${prefix}/include']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([includedir]) m4trace:configure.in:21: -1- m4_pattern_allow([^includedir$]) m4trace:configure.in:21: -1- AC_SUBST([oldincludedir], ['/usr/include']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([oldincludedir]) m4trace:configure.in:21: -1- m4_pattern_allow([^oldincludedir$]) m4trace:configure.in:21: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], ['${datarootdir}/doc/${PACKAGE_TARNAME}'], ['${datarootdir}/doc/${PACKAGE}'])]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([docdir]) m4trace:configure.in:21: -1- m4_pattern_allow([^docdir$]) m4trace:configure.in:21: -1- AC_SUBST([infodir], ['${datarootdir}/info']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([infodir]) m4trace:configure.in:21: -1- m4_pattern_allow([^infodir$]) m4trace:configure.in:21: -1- AC_SUBST([htmldir], ['${docdir}']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([htmldir]) m4trace:configure.in:21: -1- m4_pattern_allow([^htmldir$]) m4trace:configure.in:21: -1- AC_SUBST([dvidir], ['${docdir}']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([dvidir]) m4trace:configure.in:21: -1- m4_pattern_allow([^dvidir$]) m4trace:configure.in:21: -1- AC_SUBST([pdfdir], ['${docdir}']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([pdfdir]) m4trace:configure.in:21: -1- m4_pattern_allow([^pdfdir$]) m4trace:configure.in:21: -1- AC_SUBST([psdir], ['${docdir}']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([psdir]) m4trace:configure.in:21: -1- m4_pattern_allow([^psdir$]) m4trace:configure.in:21: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([libdir]) m4trace:configure.in:21: -1- m4_pattern_allow([^libdir$]) m4trace:configure.in:21: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([localedir]) m4trace:configure.in:21: -1- m4_pattern_allow([^localedir$]) m4trace:configure.in:21: -1- AC_SUBST([mandir], ['${datarootdir}/man']) m4trace:configure.in:21: -1- AC_SUBST_TRACE([mandir]) m4trace:configure.in:21: -1- m4_pattern_allow([^mandir$]) m4trace:configure.in:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) m4trace:configure.in:21: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.in:21: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ #undef PACKAGE_NAME]) m4trace:configure.in:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) m4trace:configure.in:21: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.in:21: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME]) m4trace:configure.in:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) m4trace:configure.in:21: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.in:21: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ #undef PACKAGE_VERSION]) m4trace:configure.in:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) m4trace:configure.in:21: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.in:21: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ #undef PACKAGE_STRING]) m4trace:configure.in:21: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) m4trace:configure.in:21: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.in:21: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT]) m4trace:configure.in:21: -1- AC_SUBST([DEFS]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([DEFS]) m4trace:configure.in:21: -1- m4_pattern_allow([^DEFS$]) m4trace:configure.in:21: -1- AC_SUBST([ECHO_C]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([ECHO_C]) m4trace:configure.in:21: -1- m4_pattern_allow([^ECHO_C$]) m4trace:configure.in:21: -1- AC_SUBST([ECHO_N]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([ECHO_N]) m4trace:configure.in:21: -1- m4_pattern_allow([^ECHO_N$]) m4trace:configure.in:21: -1- AC_SUBST([ECHO_T]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([ECHO_T]) m4trace:configure.in:21: -1- m4_pattern_allow([^ECHO_T$]) m4trace:configure.in:21: -1- AC_SUBST([LIBS]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([LIBS]) m4trace:configure.in:21: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.in:21: -1- AC_SUBST([build_alias]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([build_alias]) m4trace:configure.in:21: -1- m4_pattern_allow([^build_alias$]) m4trace:configure.in:21: -1- AC_SUBST([host_alias]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([host_alias]) m4trace:configure.in:21: -1- m4_pattern_allow([^host_alias$]) m4trace:configure.in:21: -1- AC_SUBST([target_alias]) m4trace:configure.in:21: -1- AC_SUBST_TRACE([target_alias]) m4trace:configure.in:21: -1- m4_pattern_allow([^target_alias$]) m4trace:configure.in:25: -1- AC_SUBST([CYGPATH]) m4trace:configure.in:25: -1- AC_SUBST_TRACE([CYGPATH]) m4trace:configure.in:25: -1- m4_pattern_allow([^CYGPATH$]) m4trace:configure.in:25: -1- AC_SUBST([EXEEXT]) m4trace:configure.in:25: -1- AC_SUBST_TRACE([EXEEXT]) m4trace:configure.in:25: -1- m4_pattern_allow([^EXEEXT$]) m4trace:configure.in:25: -1- AC_SUBST([CYGPATH]) m4trace:configure.in:25: -1- AC_SUBST_TRACE([CYGPATH]) m4trace:configure.in:25: -1- m4_pattern_allow([^CYGPATH$]) m4trace:configure.in:25: -1- AC_SUBST([PKG_LIB_FILE]) m4trace:configure.in:25: -1- AC_SUBST_TRACE([PKG_LIB_FILE]) m4trace:configure.in:25: -1- m4_pattern_allow([^PKG_LIB_FILE$]) m4trace:configure.in:25: -1- AC_SUBST([PKG_STUB_LIB_FILE]) m4trace:configure.in:25: -1- AC_SUBST_TRACE([PKG_STUB_LIB_FILE]) m4trace:configure.in:25: -1- m4_pattern_allow([^PKG_STUB_LIB_FILE$]) m4trace:configure.in:25: -1- AC_SUBST([PKG_STUB_SOURCES]) m4trace:configure.in:25: -1- AC_SUBST_TRACE([PKG_STUB_SOURCES]) m4trace:configure.in:25: -1- m4_pattern_allow([^PKG_STUB_SOURCES$]) m4trace:configure.in:25: -1- AC_SUBST([PKG_STUB_OBJECTS]) m4trace:configure.in:25: -1- AC_SUBST_TRACE([PKG_STUB_OBJECTS]) m4trace:configure.in:25: -1- m4_pattern_allow([^PKG_STUB_OBJECTS$]) m4trace:configure.in:25: -1- AC_SUBST([PKG_TCL_SOURCES]) m4trace:configure.in:25: -1- AC_SUBST_TRACE([PKG_TCL_SOURCES]) m4trace:configure.in:25: -1- m4_pattern_allow([^PKG_TCL_SOURCES$]) m4trace:configure.in:25: -1- AC_SUBST([PKG_HEADERS]) m4trace:configure.in:25: -1- AC_SUBST_TRACE([PKG_HEADERS]) m4trace:configure.in:25: -1- m4_pattern_allow([^PKG_HEADERS$]) m4trace:configure.in:25: -1- AC_SUBST([PKG_INCLUDES]) m4trace:configure.in:25: -1- AC_SUBST_TRACE([PKG_INCLUDES]) m4trace:configure.in:25: -1- m4_pattern_allow([^PKG_INCLUDES$]) m4trace:configure.in:25: -1- AC_SUBST([PKG_LIBS]) m4trace:configure.in:25: -1- AC_SUBST_TRACE([PKG_LIBS]) m4trace:configure.in:25: -1- m4_pattern_allow([^PKG_LIBS$]) m4trace:configure.in:25: -1- AC_SUBST([PKG_CFLAGS]) m4trace:configure.in:25: -1- AC_SUBST_TRACE([PKG_CFLAGS]) m4trace:configure.in:25: -1- m4_pattern_allow([^PKG_CFLAGS$]) m4trace:configure.in:26: -1- AC_CONFIG_AUX_DIR([tclconfig]) m4trace:configure.in:28: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... tclconfig/tcl.m4:172: TEA_PATH_TCLCONFIG is expanded from... configure.in:28: the top level]) m4trace:configure.in:29: -1- AC_SUBST([TCL_VERSION]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_VERSION]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_VERSION$]) m4trace:configure.in:29: -1- AC_SUBST([TCL_BIN_DIR]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_BIN_DIR]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_BIN_DIR$]) m4trace:configure.in:29: -1- AC_SUBST([TCL_SRC_DIR]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_SRC_DIR]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_SRC_DIR$]) m4trace:configure.in:29: -1- AC_SUBST([TCL_LIB_FILE]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_LIB_FILE]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_LIB_FILE$]) m4trace:configure.in:29: -1- AC_SUBST([TCL_LIB_FLAG]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_LIB_FLAG]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_LIB_FLAG$]) m4trace:configure.in:29: -1- AC_SUBST([TCL_LIB_SPEC]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_LIB_SPEC]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_LIB_SPEC$]) m4trace:configure.in:29: -1- AC_SUBST([TCL_STUB_LIB_FILE]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_STUB_LIB_FILE]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_STUB_LIB_FILE$]) m4trace:configure.in:29: -1- AC_SUBST([TCL_STUB_LIB_FLAG]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_STUB_LIB_FLAG]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_STUB_LIB_FLAG$]) m4trace:configure.in:29: -1- AC_SUBST([TCL_STUB_LIB_SPEC]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_STUB_LIB_SPEC]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_STUB_LIB_SPEC$]) m4trace:configure.in:29: -1- AC_SUBST([TCL_LIBS]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_LIBS]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_LIBS$]) m4trace:configure.in:29: -1- AC_SUBST([TCL_DEFS]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_DEFS]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_DEFS$]) m4trace:configure.in:29: -1- AC_SUBST([TCL_EXTRA_CFLAGS]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_EXTRA_CFLAGS]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_EXTRA_CFLAGS$]) m4trace:configure.in:29: -1- AC_SUBST([TCL_LD_FLAGS]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_LD_FLAGS]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_LD_FLAGS$]) m4trace:configure.in:29: -1- AC_SUBST([TCL_SHLIB_LD_LIBS]) m4trace:configure.in:29: -1- AC_SUBST_TRACE([TCL_SHLIB_LD_LIBS]) m4trace:configure.in:29: -1- m4_pattern_allow([^TCL_SHLIB_LD_LIBS$]) m4trace:configure.in:33: -1- AC_SUBST([CC]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([CC]) m4trace:configure.in:33: -1- m4_pattern_allow([^CC$]) m4trace:configure.in:33: -1- AC_SUBST([CFLAGS]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([CFLAGS]) m4trace:configure.in:33: -1- m4_pattern_allow([^CFLAGS$]) m4trace:configure.in:33: -1- AC_SUBST([LDFLAGS]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([LDFLAGS]) m4trace:configure.in:33: -1- m4_pattern_allow([^LDFLAGS$]) m4trace:configure.in:33: -1- AC_SUBST([LIBS]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([LIBS]) m4trace:configure.in:33: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.in:33: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([CPPFLAGS]) m4trace:configure.in:33: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.in:33: -1- AC_SUBST([CC]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([CC]) m4trace:configure.in:33: -1- m4_pattern_allow([^CC$]) m4trace:configure.in:33: -1- AC_SUBST([CC]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([CC]) m4trace:configure.in:33: -1- m4_pattern_allow([^CC$]) m4trace:configure.in:33: -1- AC_SUBST([CC]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([CC]) m4trace:configure.in:33: -1- m4_pattern_allow([^CC$]) m4trace:configure.in:33: -1- AC_SUBST([CC]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([CC]) m4trace:configure.in:33: -1- m4_pattern_allow([^CC$]) m4trace:configure.in:33: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([ac_ct_CC]) m4trace:configure.in:33: -1- m4_pattern_allow([^ac_ct_CC$]) m4trace:configure.in:33: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([EXEEXT]) m4trace:configure.in:33: -1- m4_pattern_allow([^EXEEXT$]) m4trace:configure.in:33: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([OBJEXT]) m4trace:configure.in:33: -1- m4_pattern_allow([^OBJEXT$]) m4trace:configure.in:33: -1- AC_SUBST([CPP]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([CPP]) m4trace:configure.in:33: -1- m4_pattern_allow([^CPP$]) m4trace:configure.in:33: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([CPPFLAGS]) m4trace:configure.in:33: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.in:33: -1- AC_SUBST([CPP]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([CPP]) m4trace:configure.in:33: -1- m4_pattern_allow([^CPP$]) m4trace:configure.in:33: -1- AC_REQUIRE_AUX_FILE([install-sh]) m4trace:configure.in:33: -1- AC_SUBST([INSTALL_PROGRAM]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) m4trace:configure.in:33: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) m4trace:configure.in:33: -1- AC_SUBST([INSTALL_SCRIPT]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) m4trace:configure.in:33: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) m4trace:configure.in:33: -1- AC_SUBST([INSTALL_DATA]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([INSTALL_DATA]) m4trace:configure.in:33: -1- m4_pattern_allow([^INSTALL_DATA$]) m4trace:configure.in:33: -1- AC_SUBST([SET_MAKE]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([SET_MAKE]) m4trace:configure.in:33: -1- m4_pattern_allow([^SET_MAKE$]) m4trace:configure.in:33: -1- AC_SUBST([RANLIB]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([RANLIB]) m4trace:configure.in:33: -1- m4_pattern_allow([^RANLIB$]) m4trace:configure.in:33: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2368: AC_TRY_COMPILE is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/m4sugar/m4sh.m4:523: AS_IF is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1905: AC_CACHE_VAL is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1918: AC_CACHE_CHECK is expanded from... tclconfig/tcl.m4:3187: TEA_SETUP_COMPILER is expanded from... configure.in:33: the top level]) m4trace:configure.in:33: -1- AC_SUBST([GREP]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([GREP]) m4trace:configure.in:33: -1- m4_pattern_allow([^GREP$]) m4trace:configure.in:33: -1- AC_SUBST([GREP]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([GREP]) m4trace:configure.in:33: -1- m4_pattern_allow([^GREP$]) m4trace:configure.in:33: -1- AC_SUBST([EGREP]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([EGREP]) m4trace:configure.in:33: -1- m4_pattern_allow([^EGREP$]) m4trace:configure.in:33: -1- AC_SUBST([EGREP]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([EGREP]) m4trace:configure.in:33: -1- m4_pattern_allow([^EGREP$]) m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) m4trace:configure.in:33: -1- m4_pattern_allow([^STDC_HEADERS$]) m4trace:configure.in:33: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS]) m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H]) m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H]) m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H]) m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STRING_H]) m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H]) m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H]) m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H]) m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H]) m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H]) m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([WORDS_BIGENDIAN]) m4trace:configure.in:33: -1- m4_pattern_allow([^WORDS_BIGENDIAN$]) m4trace:configure.in:33: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN]) m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NET_ERRNO_H]) m4trace:configure.in:33: -1- m4_pattern_allow([^HAVE_NET_ERRNO_H$]) m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_NET_ERRNO_H], [/* Do we have ? */ #undef HAVE_NET_ERRNO_H]) m4trace:configure.in:33: -1- AC_SUBST([TCL_LIBS]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([TCL_LIBS]) m4trace:configure.in:33: -1- m4_pattern_allow([^TCL_LIBS$]) m4trace:configure.in:33: -1- AC_SUBST([MATH_LIBS]) m4trace:configure.in:33: -1- AC_SUBST_TRACE([MATH_LIBS]) m4trace:configure.in:33: -1- m4_pattern_allow([^MATH_LIBS$]) m4trace:configure.in:33: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2415: AC_TRY_LINK is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/m4sugar/m4sh.m4:523: AS_IF is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1905: AC_CACHE_VAL is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1918: AC_CACHE_CHECK is expanded from... tclconfig/tcl.m4:2268: TEA_MISSING_POSIX_HEADERS is expanded from... tclconfig/tcl.m4:3187: TEA_SETUP_COMPILER is expanded from... configure.in:33: the top level]) m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([NO_DIRENT_H]) m4trace:configure.in:33: -1- m4_pattern_allow([^NO_DIRENT_H$]) m4trace:configure.in:33: -1- AH_OUTPUT([NO_DIRENT_H], [/* Do we have ? */ #undef NO_DIRENT_H]) m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([NO_ERRNO_H]) m4trace:configure.in:33: -1- m4_pattern_allow([^NO_ERRNO_H$]) m4trace:configure.in:33: -1- AH_OUTPUT([NO_ERRNO_H], [/* Do we have ? */ #undef NO_ERRNO_H]) m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([NO_FLOAT_H]) m4trace:configure.in:33: -1- m4_pattern_allow([^NO_FLOAT_H$]) m4trace:configure.in:33: -1- AH_OUTPUT([NO_FLOAT_H], [/* Do we have ? */ #undef NO_FLOAT_H]) m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([NO_VALUES_H]) m4trace:configure.in:33: -1- m4_pattern_allow([^NO_VALUES_H$]) m4trace:configure.in:33: -1- AH_OUTPUT([NO_VALUES_H], [/* Do we have ? */ #undef NO_VALUES_H]) m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIMITS_H]) m4trace:configure.in:33: -1- m4_pattern_allow([^HAVE_LIMITS_H$]) m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_LIMITS_H], [/* Do we have ? */ #undef HAVE_LIMITS_H]) m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([NO_LIMITS_H]) m4trace:configure.in:33: -1- m4_pattern_allow([^NO_LIMITS_H$]) m4trace:configure.in:33: -1- AH_OUTPUT([NO_LIMITS_H], [/* Do we have ? */ #undef NO_LIMITS_H]) m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([NO_STDLIB_H]) m4trace:configure.in:33: -1- m4_pattern_allow([^NO_STDLIB_H$]) m4trace:configure.in:33: -1- AH_OUTPUT([NO_STDLIB_H], [/* Do we have ? */ #undef NO_STDLIB_H]) m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([NO_STRING_H]) m4trace:configure.in:33: -1- m4_pattern_allow([^NO_STRING_H$]) m4trace:configure.in:33: -1- AH_OUTPUT([NO_STRING_H], [/* Do we have ? */ #undef NO_STRING_H]) m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([NO_SYS_WAIT_H]) m4trace:configure.in:33: -1- m4_pattern_allow([^NO_SYS_WAIT_H$]) m4trace:configure.in:33: -1- AH_OUTPUT([NO_SYS_WAIT_H], [/* Do we have ? */ #undef NO_SYS_WAIT_H]) m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([NO_DLFCN_H]) m4trace:configure.in:33: -1- m4_pattern_allow([^NO_DLFCN_H$]) m4trace:configure.in:33: -1- AH_OUTPUT([NO_DLFCN_H], [/* Do we have ? */ #undef NO_DLFCN_H]) m4trace:configure.in:33: -1- _m4_warn([obsolete], [The macro `AC_HAVE_HEADERS' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/oldnames.m4:56: AC_HAVE_HEADERS is expanded from... tclconfig/tcl.m4:2268: TEA_MISSING_POSIX_HEADERS is expanded from... tclconfig/tcl.m4:3187: TEA_SETUP_COMPILER is expanded from... configure.in:33: the top level]) m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_SYS_PARAM_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H]) m4trace:configure.in:44: -1- AC_SUBST([PKG_SOURCES]) m4trace:configure.in:44: -1- AC_SUBST_TRACE([PKG_SOURCES]) m4trace:configure.in:44: -1- m4_pattern_allow([^PKG_SOURCES$]) m4trace:configure.in:44: -1- AC_SUBST([PKG_OBJECTS]) m4trace:configure.in:44: -1- AC_SUBST_TRACE([PKG_OBJECTS]) m4trace:configure.in:44: -1- m4_pattern_allow([^PKG_OBJECTS$]) m4trace:configure.in:45: -1- AC_SUBST([PKG_HEADERS]) m4trace:configure.in:45: -1- AC_SUBST_TRACE([PKG_HEADERS]) m4trace:configure.in:45: -1- m4_pattern_allow([^PKG_HEADERS$]) m4trace:configure.in:46: -1- AC_SUBST([PKG_INCLUDES]) m4trace:configure.in:46: -1- AC_SUBST_TRACE([PKG_INCLUDES]) m4trace:configure.in:46: -1- m4_pattern_allow([^PKG_INCLUDES$]) m4trace:configure.in:48: -1- AC_SUBST([PKG_LIBS]) m4trace:configure.in:48: -1- AC_SUBST_TRACE([PKG_LIBS]) m4trace:configure.in:48: -1- m4_pattern_allow([^PKG_LIBS$]) m4trace:configure.in:49: -1- AC_SUBST([PKG_CFLAGS]) m4trace:configure.in:49: -1- AC_SUBST_TRACE([PKG_CFLAGS]) m4trace:configure.in:49: -1- m4_pattern_allow([^PKG_CFLAGS$]) m4trace:configure.in:50: -1- AC_SUBST([PKG_STUB_SOURCES]) m4trace:configure.in:50: -1- AC_SUBST_TRACE([PKG_STUB_SOURCES]) m4trace:configure.in:50: -1- m4_pattern_allow([^PKG_STUB_SOURCES$]) m4trace:configure.in:50: -1- AC_SUBST([PKG_STUB_OBJECTS]) m4trace:configure.in:50: -1- AC_SUBST_TRACE([PKG_STUB_OBJECTS]) m4trace:configure.in:50: -1- m4_pattern_allow([^PKG_STUB_OBJECTS$]) m4trace:configure.in:51: -1- AC_SUBST([PKG_TCL_SOURCES]) m4trace:configure.in:51: -1- AC_SUBST_TRACE([PKG_TCL_SOURCES]) m4trace:configure.in:51: -1- m4_pattern_allow([^PKG_TCL_SOURCES$]) m4trace:configure.in:68: -1- AC_DEFINE_TRACE_LITERAL([BUILD_Tclxml]) m4trace:configure.in:68: -1- m4_pattern_allow([^BUILD_Tclxml$]) m4trace:configure.in:68: -1- AH_OUTPUT([BUILD_Tclxml], [/* Build windows export dll */ #undef BUILD_Tclxml]) m4trace:configure.in:73: -1- AC_SUBST([CLEANFILES]) m4trace:configure.in:73: -1- AC_SUBST_TRACE([CLEANFILES]) m4trace:configure.in:73: -1- m4_pattern_allow([^CLEANFILES$]) m4trace:configure.in:75: -1- AC_SUBST([TCL_INCLUDES]) m4trace:configure.in:75: -1- AC_SUBST_TRACE([TCL_INCLUDES]) m4trace:configure.in:75: -1- m4_pattern_allow([^TCL_INCLUDES$]) m4trace:configure.in:82: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... tclconfig/tcl.m4:684: TEA_ENABLE_THREADS is expanded from... configure.in:82: the top level]) m4trace:configure.in:82: -1- AC_DEFINE_TRACE_LITERAL([USE_THREAD_ALLOC]) m4trace:configure.in:82: -1- m4_pattern_allow([^USE_THREAD_ALLOC$]) m4trace:configure.in:82: -1- AH_OUTPUT([USE_THREAD_ALLOC], [/* Do we want to use the threaded memory allocator? */ #undef USE_THREAD_ALLOC]) m4trace:configure.in:82: -1- AC_DEFINE_TRACE_LITERAL([_REENTRANT]) m4trace:configure.in:82: -1- m4_pattern_allow([^_REENTRANT$]) m4trace:configure.in:82: -1- AH_OUTPUT([_REENTRANT], [/* Do we want the reentrant OS API? */ #undef _REENTRANT]) m4trace:configure.in:82: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_PTHREAD_SEMANTICS]) m4trace:configure.in:82: -1- m4_pattern_allow([^_POSIX_PTHREAD_SEMANTICS$]) m4trace:configure.in:82: -1- AH_OUTPUT([_POSIX_PTHREAD_SEMANTICS], [/* Do we really want to follow the standard? Yes we do! */ #undef _POSIX_PTHREAD_SEMANTICS]) m4trace:configure.in:82: -1- AC_DEFINE_TRACE_LITERAL([_THREAD_SAFE]) m4trace:configure.in:82: -1- m4_pattern_allow([^_THREAD_SAFE$]) m4trace:configure.in:82: -1- AH_OUTPUT([_THREAD_SAFE], [/* Do we want the thread-safe OS API? */ #undef _THREAD_SAFE]) m4trace:configure.in:82: -1- AC_DEFINE_TRACE_LITERAL([TCL_THREADS]) m4trace:configure.in:82: -1- m4_pattern_allow([^TCL_THREADS$]) m4trace:configure.in:82: -1- AH_OUTPUT([TCL_THREADS], [/* Are we building with threads enabled? */ #undef TCL_THREADS]) m4trace:configure.in:82: -1- AC_SUBST([TCL_THREADS]) m4trace:configure.in:82: -1- AC_SUBST_TRACE([TCL_THREADS]) m4trace:configure.in:82: -1- m4_pattern_allow([^TCL_THREADS$]) m4trace:configure.in:89: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... tclconfig/tcl.m4:552: TEA_ENABLE_SHARED is expanded from... configure.in:89: the top level]) m4trace:configure.in:89: -1- AC_DEFINE_TRACE_LITERAL([STATIC_BUILD]) m4trace:configure.in:89: -1- m4_pattern_allow([^STATIC_BUILD$]) m4trace:configure.in:89: -1- AH_OUTPUT([STATIC_BUILD], [/* Is this a static build? */ #undef STATIC_BUILD]) m4trace:configure.in:89: -1- AC_SUBST([SHARED_BUILD]) m4trace:configure.in:89: -1- AC_SUBST_TRACE([SHARED_BUILD]) m4trace:configure.in:89: -1- m4_pattern_allow([^SHARED_BUILD$]) m4trace:configure.in:97: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- AC_SUBST([AR]) m4trace:configure.in:97: -1- AC_SUBST_TRACE([AR]) m4trace:configure.in:97: -1- m4_pattern_allow([^AR$]) m4trace:configure.in:97: -1- AC_SUBST([PKG_LIBS]) m4trace:configure.in:97: -1- AC_SUBST_TRACE([PKG_LIBS]) m4trace:configure.in:97: -1- m4_pattern_allow([^PKG_LIBS$]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([_WIN32_WCE]) m4trace:configure.in:97: -1- m4_pattern_allow([^_WIN32_WCE$]) m4trace:configure.in:97: -1- AH_OUTPUT([_WIN32_WCE], [/* _WIN32_WCE version */ #undef _WIN32_WCE]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([UNDER_CE]) m4trace:configure.in:97: -1- m4_pattern_allow([^UNDER_CE$]) m4trace:configure.in:97: -1- AH_OUTPUT([UNDER_CE], [/* UNDER_CE version */ #undef UNDER_CE]) m4trace:configure.in:97: -1- AC_SUBST([CELIB_DIR]) m4trace:configure.in:97: -1- AC_SUBST_TRACE([CELIB_DIR]) m4trace:configure.in:97: -1- m4_pattern_allow([^CELIB_DIR$]) m4trace:configure.in:97: -1- AC_LIBSOURCE([tclLoadAix.c]) m4trace:configure.in:97: -1- AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS tclLoadAix.$ac_objext"]) m4trace:configure.in:97: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) m4trace:configure.in:97: -1- m4_pattern_allow([^LIB@&t@OBJS$]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([USE_DELTA_FOR_TZ]) m4trace:configure.in:97: -1- m4_pattern_allow([^USE_DELTA_FOR_TZ$]) m4trace:configure.in:97: -1- AH_OUTPUT([USE_DELTA_FOR_TZ], [/* Do we need a special AIX hack for timezones? */ #undef USE_DELTA_FOR_TZ]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([_XOPEN_SOURCE_EXTENDED]) m4trace:configure.in:97: -1- m4_pattern_allow([^_XOPEN_SOURCE_EXTENDED$]) m4trace:configure.in:97: -1- AH_OUTPUT([_XOPEN_SOURCE_EXTENDED], [/* Do we want to use the XOPEN network library? */ #undef _XOPEN_SOURCE_EXTENDED]) m4trace:configure.in:97: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2415: AC_TRY_LINK is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/m4sugar/m4sh.m4:523: AS_IF is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1905: AC_CACHE_VAL is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1918: AC_CACHE_CHECK is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2415: AC_TRY_LINK is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/m4sugar/m4sh.m4:523: AS_IF is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1905: AC_CACHE_VAL is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1918: AC_CACHE_CHECK is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2415: AC_TRY_LINK is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/m4sugar/m4sh.m4:523: AS_IF is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1905: AC_CACHE_VAL is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1918: AC_CACHE_CHECK is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2415: AC_TRY_LINK is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/m4sugar/m4sh.m4:523: AS_IF is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1905: AC_CACHE_VAL is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1918: AC_CACHE_CHECK is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2415: AC_TRY_LINK is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/m4sugar/m4sh.m4:523: AS_IF is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1905: AC_CACHE_VAL is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1918: AC_CACHE_CHECK is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([_OE_SOCKETS]) m4trace:configure.in:97: -1- m4_pattern_allow([^_OE_SOCKETS$]) m4trace:configure.in:97: -1- AH_OUTPUT([_OE_SOCKETS], [/* # needed in sys/socket.h Should OS/390 do the right thing with sockets? */ #undef _OE_SOCKETS]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([_REENTRANT]) m4trace:configure.in:97: -1- m4_pattern_allow([^_REENTRANT$]) m4trace:configure.in:97: -1- AH_OUTPUT([_REENTRANT], [/* Do we want the reentrant OS API? */ #undef _REENTRANT]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_PTHREAD_SEMANTICS]) m4trace:configure.in:97: -1- m4_pattern_allow([^_POSIX_PTHREAD_SEMANTICS$]) m4trace:configure.in:97: -1- AH_OUTPUT([_POSIX_PTHREAD_SEMANTICS], [/* Do we really want to follow the standard? Yes we do! */ #undef _POSIX_PTHREAD_SEMANTICS]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([_REENTRANT]) m4trace:configure.in:97: -1- m4_pattern_allow([^_REENTRANT$]) m4trace:configure.in:97: -1- AH_OUTPUT([_REENTRANT], [/* Do we want the reentrant OS API? */ #undef _REENTRANT]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_PTHREAD_SEMANTICS]) m4trace:configure.in:97: -1- m4_pattern_allow([^_POSIX_PTHREAD_SEMANTICS$]) m4trace:configure.in:97: -1- AH_OUTPUT([_POSIX_PTHREAD_SEMANTICS], [/* Do we really want to follow the standard? Yes we do! */ #undef _POSIX_PTHREAD_SEMANTICS]) m4trace:configure.in:97: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2415: AC_TRY_LINK is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/m4sugar/m4sh.m4:523: AS_IF is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1905: AC_CACHE_VAL is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1918: AC_CACHE_CHECK is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- AC_SUBST([DL_LIBS]) m4trace:configure.in:97: -1- AC_SUBST_TRACE([DL_LIBS]) m4trace:configure.in:97: -1- m4_pattern_allow([^DL_LIBS$]) m4trace:configure.in:97: -1- AC_SUBST([CFLAGS_DEBUG]) m4trace:configure.in:97: -1- AC_SUBST_TRACE([CFLAGS_DEBUG]) m4trace:configure.in:97: -1- m4_pattern_allow([^CFLAGS_DEBUG$]) m4trace:configure.in:97: -1- AC_SUBST([CFLAGS_OPTIMIZE]) m4trace:configure.in:97: -1- AC_SUBST_TRACE([CFLAGS_OPTIMIZE]) m4trace:configure.in:97: -1- m4_pattern_allow([^CFLAGS_OPTIMIZE$]) m4trace:configure.in:97: -1- AC_SUBST([CFLAGS_WARNING]) m4trace:configure.in:97: -1- AC_SUBST_TRACE([CFLAGS_WARNING]) m4trace:configure.in:97: -1- m4_pattern_allow([^CFLAGS_WARNING$]) m4trace:configure.in:97: -1- AC_SUBST([STLIB_LD]) m4trace:configure.in:97: -1- AC_SUBST_TRACE([STLIB_LD]) m4trace:configure.in:97: -1- m4_pattern_allow([^STLIB_LD$]) m4trace:configure.in:97: -1- AC_SUBST([SHLIB_LD]) m4trace:configure.in:97: -1- AC_SUBST_TRACE([SHLIB_LD]) m4trace:configure.in:97: -1- m4_pattern_allow([^SHLIB_LD$]) m4trace:configure.in:97: -1- AC_SUBST([SHLIB_LD_LIBS]) m4trace:configure.in:97: -1- AC_SUBST_TRACE([SHLIB_LD_LIBS]) m4trace:configure.in:97: -1- m4_pattern_allow([^SHLIB_LD_LIBS$]) m4trace:configure.in:97: -1- AC_SUBST([SHLIB_CFLAGS]) m4trace:configure.in:97: -1- AC_SUBST_TRACE([SHLIB_CFLAGS]) m4trace:configure.in:97: -1- m4_pattern_allow([^SHLIB_CFLAGS$]) m4trace:configure.in:97: -1- AC_SUBST([LD_LIBRARY_PATH_VAR]) m4trace:configure.in:97: -1- AC_SUBST_TRACE([LD_LIBRARY_PATH_VAR]) m4trace:configure.in:97: -1- m4_pattern_allow([^LD_LIBRARY_PATH_VAR$]) m4trace:configure.in:97: -3- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2368: AC_TRY_COMPILE is expanded from... tclconfig/tcl.m4:2652: TEA_TCL_EARLY_FLAG is expanded from... tclconfig/tcl.m4:2668: TEA_TCL_EARLY_FLAGS is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -2- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2368: AC_TRY_COMPILE is expanded from... tclconfig/tcl.m4:2652: TEA_TCL_EARLY_FLAG is expanded from... tclconfig/tcl.m4:2668: TEA_TCL_EARLY_FLAGS is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([_ISOC99_SOURCE]) m4trace:configure.in:97: -1- m4_pattern_allow([^_ISOC99_SOURCE$]) m4trace:configure.in:97: -1- AH_OUTPUT([_ISOC99_SOURCE], [/* Add the _ISOC99_SOURCE flag when building */ #undef _ISOC99_SOURCE]) m4trace:configure.in:97: -3- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2368: AC_TRY_COMPILE is expanded from... tclconfig/tcl.m4:2652: TEA_TCL_EARLY_FLAG is expanded from... tclconfig/tcl.m4:2668: TEA_TCL_EARLY_FLAGS is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -2- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2368: AC_TRY_COMPILE is expanded from... tclconfig/tcl.m4:2652: TEA_TCL_EARLY_FLAG is expanded from... tclconfig/tcl.m4:2668: TEA_TCL_EARLY_FLAGS is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([_LARGEFILE64_SOURCE]) m4trace:configure.in:97: -1- m4_pattern_allow([^_LARGEFILE64_SOURCE$]) m4trace:configure.in:97: -1- AH_OUTPUT([_LARGEFILE64_SOURCE], [/* Add the _LARGEFILE64_SOURCE flag when building */ #undef _LARGEFILE64_SOURCE]) m4trace:configure.in:97: -3- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2368: AC_TRY_COMPILE is expanded from... tclconfig/tcl.m4:2652: TEA_TCL_EARLY_FLAG is expanded from... tclconfig/tcl.m4:2668: TEA_TCL_EARLY_FLAGS is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -2- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2368: AC_TRY_COMPILE is expanded from... tclconfig/tcl.m4:2652: TEA_TCL_EARLY_FLAG is expanded from... tclconfig/tcl.m4:2668: TEA_TCL_EARLY_FLAGS is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([_LARGEFILE_SOURCE64]) m4trace:configure.in:97: -1- m4_pattern_allow([^_LARGEFILE_SOURCE64$]) m4trace:configure.in:97: -1- AH_OUTPUT([_LARGEFILE_SOURCE64], [/* Add the _LARGEFILE_SOURCE64 flag when building */ #undef _LARGEFILE_SOURCE64]) m4trace:configure.in:97: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2368: AC_TRY_COMPILE is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/m4sugar/m4sh.m4:523: AS_IF is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1905: AC_CACHE_VAL is expanded from... tclconfig/tcl.m4:2749: TEA_TCL_64BIT_FLAGS is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2368: AC_TRY_COMPILE is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/m4sugar/m4sh.m4:523: AS_IF is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1905: AC_CACHE_VAL is expanded from... tclconfig/tcl.m4:2749: TEA_TCL_64BIT_FLAGS is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([TCL_WIDE_INT_IS_LONG]) m4trace:configure.in:97: -1- m4_pattern_allow([^TCL_WIDE_INT_IS_LONG$]) m4trace:configure.in:97: -1- AH_OUTPUT([TCL_WIDE_INT_IS_LONG], [/* Are wide integers to be implemented with C \'long\'s? */ #undef TCL_WIDE_INT_IS_LONG]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([TCL_WIDE_INT_TYPE]) m4trace:configure.in:97: -1- m4_pattern_allow([^TCL_WIDE_INT_TYPE$]) m4trace:configure.in:97: -1- AH_OUTPUT([TCL_WIDE_INT_TYPE], [/* What type should be used to define wide integers? */ #undef TCL_WIDE_INT_TYPE]) m4trace:configure.in:97: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2368: AC_TRY_COMPILE is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/m4sugar/m4sh.m4:523: AS_IF is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1905: AC_CACHE_VAL is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1918: AC_CACHE_CHECK is expanded from... tclconfig/tcl.m4:2749: TEA_TCL_64BIT_FLAGS is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_DIRENT64]) m4trace:configure.in:97: -1- m4_pattern_allow([^HAVE_STRUCT_DIRENT64$]) m4trace:configure.in:97: -1- AH_OUTPUT([HAVE_STRUCT_DIRENT64], [/* Is \'struct dirent64\' in ? */ #undef HAVE_STRUCT_DIRENT64]) m4trace:configure.in:97: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2368: AC_TRY_COMPILE is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/m4sugar/m4sh.m4:523: AS_IF is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1905: AC_CACHE_VAL is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1918: AC_CACHE_CHECK is expanded from... tclconfig/tcl.m4:2749: TEA_TCL_64BIT_FLAGS is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT64]) m4trace:configure.in:97: -1- m4_pattern_allow([^HAVE_STRUCT_STAT64$]) m4trace:configure.in:97: -1- AH_OUTPUT([HAVE_STRUCT_STAT64], [/* Is \'struct stat64\' in ? */ #undef HAVE_STRUCT_STAT64]) m4trace:configure.in:97: -1- AH_OUTPUT([HAVE_OPEN64], [/* Define to 1 if you have the `open64\' function. */ #undef HAVE_OPEN64]) m4trace:configure.in:97: -1- AH_OUTPUT([HAVE_LSEEK64], [/* Define to 1 if you have the `lseek64\' function. */ #undef HAVE_LSEEK64]) m4trace:configure.in:97: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:2368: AC_TRY_COMPILE is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/m4sugar/m4sh.m4:523: AS_IF is expanded from... /var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:1905: AC_CACHE_VAL is expanded from... tclconfig/tcl.m4:2749: TEA_TCL_64BIT_FLAGS is expanded from... tclconfig/tcl.m4:2060: TEA_CONFIG_CFLAGS is expanded from... configure.in:97: the top level]) m4trace:configure.in:97: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TYPE_OFF64_T]) m4trace:configure.in:97: -1- m4_pattern_allow([^HAVE_TYPE_OFF64_T$]) m4trace:configure.in:97: -1- AH_OUTPUT([HAVE_TYPE_OFF64_T], [/* Is off64_t in ? */ #undef HAVE_TYPE_OFF64_T]) m4trace:configure.in:103: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~104/SRC/autoconf/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... tclconfig/tcl.m4:755: TEA_ENABLE_SYMBOLS is expanded from... configure.in:103: the top level]) m4trace:configure.in:103: -1- AC_SUBST([TCL_DBGX]) m4trace:configure.in:103: -1- AC_SUBST_TRACE([TCL_DBGX]) m4trace:configure.in:103: -1- m4_pattern_allow([^TCL_DBGX$]) m4trace:configure.in:103: -1- AC_SUBST([CFLAGS_DEFAULT]) m4trace:configure.in:103: -1- AC_SUBST_TRACE([CFLAGS_DEFAULT]) m4trace:configure.in:103: -1- m4_pattern_allow([^CFLAGS_DEFAULT$]) m4trace:configure.in:103: -1- AC_SUBST([LDFLAGS_DEFAULT]) m4trace:configure.in:103: -1- AC_SUBST_TRACE([LDFLAGS_DEFAULT]) m4trace:configure.in:103: -1- m4_pattern_allow([^LDFLAGS_DEFAULT$]) m4trace:configure.in:103: -1- AC_DEFINE_TRACE_LITERAL([TCL_MEM_DEBUG]) m4trace:configure.in:103: -1- m4_pattern_allow([^TCL_MEM_DEBUG$]) m4trace:configure.in:103: -1- AH_OUTPUT([TCL_MEM_DEBUG], [/* Is memory debugging enabled? */ #undef TCL_MEM_DEBUG]) m4trace:configure.in:112: -1- AC_DEFINE_TRACE_LITERAL([USE_TCL_STUBS]) m4trace:configure.in:112: -1- m4_pattern_allow([^USE_TCL_STUBS$]) m4trace:configure.in:112: -1- AH_OUTPUT([USE_TCL_STUBS], [/* Use Tcl stubs */ #undef USE_TCL_STUBS]) m4trace:configure.in:120: -1- AC_SUBST([MAKE_LIB]) m4trace:configure.in:120: -1- AC_SUBST_TRACE([MAKE_LIB]) m4trace:configure.in:120: -1- m4_pattern_allow([^MAKE_LIB$]) m4trace:configure.in:120: -1- AC_SUBST([MAKE_SHARED_LIB]) m4trace:configure.in:120: -1- AC_SUBST_TRACE([MAKE_SHARED_LIB]) m4trace:configure.in:120: -1- m4_pattern_allow([^MAKE_SHARED_LIB$]) m4trace:configure.in:120: -1- AC_SUBST([MAKE_STATIC_LIB]) m4trace:configure.in:120: -1- AC_SUBST_TRACE([MAKE_STATIC_LIB]) m4trace:configure.in:120: -1- m4_pattern_allow([^MAKE_STATIC_LIB$]) m4trace:configure.in:120: -1- AC_SUBST([MAKE_STUB_LIB]) m4trace:configure.in:120: -1- AC_SUBST_TRACE([MAKE_STUB_LIB]) m4trace:configure.in:120: -1- m4_pattern_allow([^MAKE_STUB_LIB$]) m4trace:configure.in:120: -1- AC_SUBST([RANLIB_STUB]) m4trace:configure.in:120: -1- AC_SUBST_TRACE([RANLIB_STUB]) m4trace:configure.in:120: -1- m4_pattern_allow([^RANLIB_STUB$]) m4trace:configure.in:166: -1- AC_SUBST([XML2_PREFIX]) m4trace:configure.in:166: -1- AC_SUBST_TRACE([XML2_PREFIX]) m4trace:configure.in:166: -1- m4_pattern_allow([^XML2_PREFIX$]) m4trace:configure.in:167: -1- AC_SUBST([XML2_CFLAGS]) m4trace:configure.in:167: -1- AC_SUBST_TRACE([XML2_CFLAGS]) m4trace:configure.in:167: -1- m4_pattern_allow([^XML2_CFLAGS$]) m4trace:configure.in:168: -1- AC_SUBST([XML2_VERSION]) m4trace:configure.in:168: -1- AC_SUBST_TRACE([XML2_VERSION]) m4trace:configure.in:168: -1- m4_pattern_allow([^XML2_VERSION$]) m4trace:configure.in:215: -1- AC_SUBST([XSLT_VERSION]) m4trace:configure.in:215: -1- AC_SUBST_TRACE([XSLT_VERSION]) m4trace:configure.in:215: -1- m4_pattern_allow([^XSLT_VERSION$]) m4trace:configure.in:216: -1- AC_SUBST([XSLT_PREFIX]) m4trace:configure.in:216: -1- AC_SUBST_TRACE([XSLT_PREFIX]) m4trace:configure.in:216: -1- m4_pattern_allow([^XSLT_PREFIX$]) m4trace:configure.in:217: -1- AC_SUBST([XSLT_CFLAGS]) m4trace:configure.in:217: -1- AC_SUBST_TRACE([XSLT_CFLAGS]) m4trace:configure.in:217: -1- m4_pattern_allow([^XSLT_CFLAGS$]) m4trace:configure.in:238: -1- AC_SUBST([XML_STATIC]) m4trace:configure.in:238: -1- AC_SUBST_TRACE([XML_STATIC]) m4trace:configure.in:238: -1- m4_pattern_allow([^XML_STATIC$]) m4trace:configure.in:267: -1- AC_SUBST([XML2_LIBS]) m4trace:configure.in:267: -1- AC_SUBST_TRACE([XML2_LIBS]) m4trace:configure.in:267: -1- m4_pattern_allow([^XML2_LIBS$]) m4trace:configure.in:268: -1- AC_SUBST([XSLT_LIBS]) m4trace:configure.in:268: -1- AC_SUBST_TRACE([XSLT_LIBS]) m4trace:configure.in:268: -1- m4_pattern_allow([^XSLT_LIBS$]) m4trace:configure.in:269: -1- AC_SUBST([FIX_LIB]) m4trace:configure.in:269: -1- AC_SUBST_TRACE([FIX_LIB]) m4trace:configure.in:269: -1- m4_pattern_allow([^FIX_LIB$]) m4trace:configure.in:280: -1- AC_SUBST([TCLSH_PROG]) m4trace:configure.in:280: -1- AC_SUBST_TRACE([TCLSH_PROG]) m4trace:configure.in:280: -1- m4_pattern_allow([^TCLSH_PROG$]) m4trace:configure.in:308: -1- AC_SUBST([Tclxml_BUILD_LIB_SPEC]) m4trace:configure.in:308: -1- AC_SUBST_TRACE([Tclxml_BUILD_LIB_SPEC]) m4trace:configure.in:308: -1- m4_pattern_allow([^Tclxml_BUILD_LIB_SPEC$]) m4trace:configure.in:309: -1- AC_SUBST([Tclxml_LIB_SPEC]) m4trace:configure.in:309: -1- AC_SUBST_TRACE([Tclxml_LIB_SPEC]) m4trace:configure.in:309: -1- m4_pattern_allow([^Tclxml_LIB_SPEC$]) m4trace:configure.in:310: -1- AC_SUBST([Tclxml_BUILD_STUB_LIB_SPEC]) m4trace:configure.in:310: -1- AC_SUBST_TRACE([Tclxml_BUILD_STUB_LIB_SPEC]) m4trace:configure.in:310: -1- m4_pattern_allow([^Tclxml_BUILD_STUB_LIB_SPEC$]) m4trace:configure.in:311: -1- AC_SUBST([Tclxml_STUB_LIB_SPEC]) m4trace:configure.in:311: -1- AC_SUBST_TRACE([Tclxml_STUB_LIB_SPEC]) m4trace:configure.in:311: -1- m4_pattern_allow([^Tclxml_STUB_LIB_SPEC$]) m4trace:configure.in:312: -1- AC_SUBST([Tclxml_BUILD_STUB_LIB_PATH]) m4trace:configure.in:312: -1- AC_SUBST_TRACE([Tclxml_BUILD_STUB_LIB_PATH]) m4trace:configure.in:312: -1- m4_pattern_allow([^Tclxml_BUILD_STUB_LIB_PATH$]) m4trace:configure.in:313: -1- AC_SUBST([Tclxml_STUB_LIB_PATH]) m4trace:configure.in:313: -1- AC_SUBST_TRACE([Tclxml_STUB_LIB_PATH]) m4trace:configure.in:313: -1- m4_pattern_allow([^Tclxml_STUB_LIB_PATH$]) m4trace:configure.in:314: -1- AC_SUBST([Tclxml_INCLUDE_SPEC]) m4trace:configure.in:314: -1- AC_SUBST_TRACE([Tclxml_INCLUDE_SPEC]) m4trace:configure.in:314: -1- m4_pattern_allow([^Tclxml_INCLUDE_SPEC$]) m4trace:configure.in:321: -1- AC_SUBST([XSLTPROC]) m4trace:configure.in:321: -1- AC_SUBST_TRACE([XSLTPROC]) m4trace:configure.in:321: -1- m4_pattern_allow([^XSLTPROC$]) m4trace:configure.in:329: -1- AC_CONFIG_FILES([Makefile Makefile.macosx pkgIndex.tcl TclxmlConfig.sh include/tclxml/tclxml.h doc/tclxml.xml doc/tcldom.xml doc/tclxslt.xml doc/README.xml]) m4trace:configure.in:329: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. You should run autoupdate.], []) m4trace:configure.in:329: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) m4trace:configure.in:329: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) m4trace:configure.in:329: -1- m4_pattern_allow([^LIB@&t@OBJS$]) m4trace:configure.in:329: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) m4trace:configure.in:329: -1- AC_SUBST_TRACE([LTLIBOBJS]) m4trace:configure.in:329: -1- m4_pattern_allow([^LTLIBOBJS$]) m4trace:configure.in:329: -1- AC_SUBST_TRACE([top_builddir]) m4trace:configure.in:329: -1- AC_SUBST_TRACE([srcdir]) m4trace:configure.in:329: -1- AC_SUBST_TRACE([abs_srcdir]) m4trace:configure.in:329: -1- AC_SUBST_TRACE([top_srcdir]) m4trace:configure.in:329: -1- AC_SUBST_TRACE([abs_top_srcdir]) m4trace:configure.in:329: -1- AC_SUBST_TRACE([builddir]) m4trace:configure.in:329: -1- AC_SUBST_TRACE([abs_builddir]) m4trace:configure.in:329: -1- AC_SUBST_TRACE([abs_top_builddir]) m4trace:configure.in:329: -1- AC_SUBST_TRACE([INSTALL]) tclxml-3.3~svn11.orig/autom4te.cache/output.00000644000000000000000000121702711215700771017646 0ustar rootroot@%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. @%:@ Generated by GNU Autoconf 2.61 for Tclxml 3.3. @%:@ @%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @%:@ 2002, 2003, 2004, 2005, 2006 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # 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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done 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) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= 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=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' 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$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" exec 7<&0 &1 # 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` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIB@&t@OBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='Tclxml' PACKAGE_TARNAME='tclxml' PACKAGE_VERSION='3.3' PACKAGE_STRING='Tclxml 3.3' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef 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 datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias 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 GREP EGREP MATH_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIB@&t@OBJS DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS LD_LIBRARY_PATH_VAR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB XML2_PREFIX XML2_CFLAGS XML2_VERSION XSLT_VERSION XSLT_PREFIX XSLT_CFLAGS XML_STATIC XML2_LIBS XSLT_LIBS FIX_LIB TCLSH_PROG Tclxml_BUILD_LIB_SPEC Tclxml_LIB_SPEC Tclxml_BUILD_STUB_LIB_SPEC Tclxml_STUB_LIB_SPEC Tclxml_BUILD_STUB_LIB_PATH Tclxml_STUB_LIB_PATH Tclxml_INCLUDE_SPEC XSLTPROC LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$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 ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -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'` 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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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'` 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; }; } 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 directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 the parent directory. ac_confdir=`$as_dirname -- "$0" || $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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 Tclxml 3.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 \`..'] 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] --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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root @<:@DATAROOTDIR/doc/tclxml@:>@ --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Tclxml 3.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-framework build as a Mac OS X framework 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-tclinclude directory containing the public Tcl header files --with-celib=DIR use Windows/CE support library from DIR --with-xml2-config the xml2-config configuration script --with-xslt-config the xslt-config configuration script --with-xml-static statically link the XML libraries 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 LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective 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 ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested 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 else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Tclxml configure 3.3 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Tclxml $as_me 3.3, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { 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` /usr/bin/hostinfo = `(/usr/bin/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 IFS=$as_save_IFS } >&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_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_arg'" ;; 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. 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, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX @%:@@%:@ ----------------- @%:@@%:@ @%:@@%:@ Output variables. @%:@@%:@ @%:@@%:@ ----------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX @%:@@%:@ ------------------- @%:@@%:@ @%:@@%:@ File substitutions. @%:@@%:@ @%:@@%:@ ------------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX @%:@@%:@ ----------- @%:@@%:@ @%:@@%:@ confdefs.h. @%:@@%:@ @%:@@%:@ ----------- @%:@@%:@ _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r 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 -f -r conftest* 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 -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file 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 $ac_precious_vars; 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 PACKAGE_NAME=Tclxml PACKAGE_VERSION=3.3 # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_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 "$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 # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # # 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 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 # Bug fix #1367779 (by Wart) 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/lib64 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}\"" 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 # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_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 $@%:@ != 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then 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 # Check that 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' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { 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 ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag 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 ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 IFS=$as_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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. 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 x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_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_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 #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)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 core.conftest.* 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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ $ac_includes_default @%:@include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f core 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return sin (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return setsockopt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char setsockopt (); int main () { return setsockopt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return accept (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 #----------------------------------------------------------------------- # 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="tclxml.c docObj.c tclxml-libxml2.c nodeObj.c tcldom-libxml2.c tclxslt-libxslt.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="include/tclxml-libxml2/docObj.h include/tclxml-libxml2/tclxml-libxml2.h include/tcldom/tcldom.h include/tcldom-libxml2/tcldom-libxml2.h include/tclxslt/tclxslt.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="-Iinclude" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done #TEA_ADD_LIBS([-lexslt]) 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 PKG_CFLAGS="$PKG_CFLAGS " vars="tclxmlStubInit.c tclxmlStubLib.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="tclxml-tcl/xml__tcl.tcl tclxml-tcl/sgml-8.0.tcl tclxml-tcl/sgml-8.1.tcl tclxml-tcl/xml-8.0.tcl tclxml-tcl/xml-8.1.tcl tclxml-tcl/sgmlparser.tcl tclxml-tcl/tclparser-8.0.tcl tclxml-tcl/tclparser-8.1.tcl tclxml-tcl/xmldep.tcl tclxml-tcl/xpath.tcl tcldom-libxml2.tcl tcldom-tcl/xmlswitch.tcl tclxslt/process.tcl tclxslt/resources.tcl tclxslt/utilities.tcl tclxslt/xsltcache.tcl tclxslt-libxslt.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 #-------------------------------------------------------------------- # A few miscellaneous platform-specific items: # # We have to define a special symbol for Windows (BUILD_Tclxml 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. # We can add more files to clean if our extension creates any extra # files in the future. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- CLEANFILES=pkgIndex.tcl if test "${TEA_PLATFORM}" = "windows" ; then cat >>confdefs.h <<\_ACEOF @%:@define BUILD_Tclxml 1 _ACEOF CLEANFILES="$CLEANFILES *.lib *.dll *.exp *.ilk *.pdb vc*.pch" else : fi { 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 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}\" #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # So far only Tcl responds to this one. #-------------------------------------------------------------------- # Check whether --enable-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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char __pthread_mutex_init (); int main () { return __pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 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 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 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 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 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 " $LIB@&t@OBJS " in *" tclLoadAix.$ac_objext "* ) ;; *) LIB@&t@OBJS="$LIB@&t@OBJS 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gettimeofday (); int main () { return gettimeofday (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (); int main () { return inet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { as_var=$as_ac_var; eval "test \"\${$as_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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 #-------------------------------------------------------------------- # 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 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. #-------------------------------------------------------------------- cat >>confdefs.h <<\_ACEOF @%:@define USE_TCL_STUBS 1 _ACEOF #-------------------------------------------------------------------- # 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 #-------------------------------------------------------------------- # On Mac OS X we may want to build as a framework. # This affects the location and naming of headers and libaries. #-------------------------------------------------------------------- # Check whether --enable-framework was given. if test "${enable_framework+set}" = set; then enableval=$enable_framework; tcl_ok=$enableval else tcl_ok=$1 fi #-------------------------------------------------------------------- # Load libxml2 configuration #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking for xml2-config script" >&5 echo $ECHO_N "checking for xml2-config script... $ECHO_C" >&6; } # Check whether --with-xml2-config was given. if test "${with_xml2_config+set}" = set; then withval=$with_xml2_config; with_xml2_config=${withval} fi LIBXML2_CONFIG= if test "x${with_xml2_config}" = "x" ; then for c in \ /Library/Frameworks/libxml.framework/Resources/Scripts/xml2-config \ ${prefix}/bin/xml2-config \ /usr/bin/xml2-config \ /usr/local/bin/xml2-config do if test -x "$c" ; then LIBXML2_CONFIG="$c" break fi done else LIBXML2_CONFIG="${with_xml2_config}" fi if test "x$LIBXML2_CONFIG" = "x" ; then { { echo "$as_me:$LINENO: error: unable to find xml2-config" >&5 echo "$as_me: error: unable to find xml2-config" >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: result: ${LIBXML2_CONFIG}" >&5 echo "${ECHO_T}${LIBXML2_CONFIG}" >&6; } XML2_VERSION=`${LIBXML2_CONFIG} --version` XML2_PREFIX=`${LIBXML2_CONFIG} --prefix` XML2_LIBS="`${LIBXML2_CONFIG} --libs`" XML2_CFLAGS=`${LIBXML2_CONFIG} --cflags` fi #-------------------------------------------------------------------- # Load libxslt configuration #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking for xslt-config script" >&5 echo $ECHO_N "checking for xslt-config script... $ECHO_C" >&6; } # Check whether --with-xslt-config was given. if test "${with_xslt_config+set}" = set; then withval=$with_xslt_config; with_xslt_config=${withval} fi LIBXSLT_CONFIG= if test "x${with_xslt_config}" = "x" ; then if test "x${with_xml2_config}" = "x" ; then : else if test -x "`dirname ${with_xml2_config}`/xslt-config" ; then LIBXSLT_CONFIG="`dirname ${with_xml2_config}`/xslt-config" fi fi else LIBXSLT_CONFIG="${with_xslt_config}" fi if test "x${LIBXSLT_CONFIG}" = "x" ; then for c in \ /Library/Frameworks/libxslt.framework/Resources/Scripts/xslt-config \ ${prefix}/bin/xslt-config \ /usr/bin/xslt-config \ /usr/local/bin/xslt-config do if test -x "$c" ; then LIBXSLT_CONFIG="$c" break fi done fi if test "x$LIBXSLT_CONFIG" = "x" ; then { { echo "$as_me:$LINENO: error: unable to find xslt-config script" >&5 echo "$as_me: error: unable to find xslt-config script" >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: result: ${LIBXSLT_CONFIG}" >&5 echo "${ECHO_T}${LIBXSLT_CONFIG}" >&6; } XSLT_VERSION=`${LIBXSLT_CONFIG} --version` XSLT_PREFIX=`${LIBXSLT_CONFIG} --prefix` XSLT_CFLAGS=`${LIBXSLT_CONFIG} --cflags` XSLT_LIBS="`${LIBXSLT_CONFIG} --libs` -lexslt" fi #-------------------------------------------------------------------- # See if we want to statically link the libxml2 and libxslt # libraries. This is desirable for Tclkit. #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking for static linking of XML/XSLT libraries" >&5 echo $ECHO_N "checking for static linking of XML/XSLT libraries... $ECHO_C" >&6; } # Check whether --with-xml-static was given. if test "${with_xml_static+set}" = set; then withval=$with_xml_static; with_xml_static=${withval} fi XML_STATIC="0" if test "${with_xml_static}" = "1" ; then XML_STATIC="1" { echo "$as_me:$LINENO: result: use static linking" >&5 echo "${ECHO_T}use static linking" >&6; } else { echo "$as_me:$LINENO: result: use dynamic linking" >&5 echo "${ECHO_T}use dynamic linking" >&6; } fi #-------------------------------------------------------------------- # __CHANGE__ # Add platform libs to LIBS or SHLIB_LD_LIBS as necessary. #-------------------------------------------------------------------- FIX_LIB=":" if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${LIBXSLT_LIBDIR}/libxslt.lib`\"" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${LIBXSLT_LIBDIR}/libexslt.lib`\"" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${LIBXML2_LIBDIR}/libxml2.lib`\"" else if test "${XML_STATIC}" = "0" ; then echo "setting up dynamic linking" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \${XSLT_LIBS}" else SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${XSLT_PREFIX}/lib/libexslt.a" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${XSLT_PREFIX}/lib/libxslt.a" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${XML2_PREFIX}/lib/libxml2.a" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -L/usr/lib -lgcrypt -lgpg-error -lz -lm" XML2_LIBS= XSLT_LIBS= FIX_LIB="chcon -t texrel_shlib_t" fi fi # Enabling static linking modifies the setting of the libraries, # so delay substitution until this point. #-------------------------------------------------------------------- # 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; } #-------------------------------------------------------------------- # These are for tclxmlConfig.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 Tclxml_LIB_FLAG="-l${PACKAGE_NAME}${PACKAGE_VERSION}${DBGX}" else eval Tclxml_LIB_FLAG="-l${PACKAGE_NAME}`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}" fi Tclxml_BUILD_LIB_SPEC="-L`pwd` ${Tclxml_LIB_FLAG}" Tclxml_LIB_SPEC="-L${pkglibdir} ${Tclxml_LIB_FLAG}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval Tclxml_STUB_LIB_FLAG="-l${PACKAGE_NAME}stub${PACKAGE_VERSION}${DBGX}" else eval Tclxml_STUB_LIB_FLAG="-l${PACKAGE_NAME}stub`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}" fi Tclxml_BUILD_STUB_LIB_SPEC="-L`pwd` ${Tclxml_STUB_LIB_FLAG}" Tclxml_STUB_LIB_SPEC="-L${pkglibdir} ${Tclxml_STUB_LIB_FLAG}" Tclxml_BUILD_STUB_LIB_PATH="`pwd`/${Tclxmlstub_LIB_FILE}" Tclxml_STUB_LIB_PATH="${pkglibdir}/${Tclxmlstub_LIB_FILE}" eval pkgincludedir="${includedir}" Tclxml_INCLUDE_SPEC="-I${pkgincludedir}" #-------------------------------------------------------------------- # TODO: search for an appropriate xsltproc to use #-------------------------------------------------------------------- XSLTPROC=xsltproc #-------------------------------------------------------------------- # 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 Makefile.macosx pkgIndex.tcl TclxmlConfig.sh include/tclxml/tclxml.h doc/tclxml.xml doc/tcldom.xml doc/tclxslt.xml doc/README.xml" 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end 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 "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' # 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 branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIB@&t@OBJS=$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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # 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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done 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) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' 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$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by Tclxml $as_me 3.3, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF 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 and configuration settings, 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="\\ Tclxml config.status 3.3 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' 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 ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { 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" ac_need_defaults=false ;; 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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX @%:@@%:@ Running $as_me. @%:@@%:@ _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Makefile.macosx") CONFIG_FILES="$CONFIG_FILES Makefile.macosx" ;; "pkgIndex.tcl") CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; "TclxmlConfig.sh") CONFIG_FILES="$CONFIG_FILES TclxmlConfig.sh" ;; "include/tclxml/tclxml.h") CONFIG_FILES="$CONFIG_FILES include/tclxml/tclxml.h" ;; "doc/tclxml.xml") CONFIG_FILES="$CONFIG_FILES doc/tclxml.xml" ;; "doc/tcldom.xml") CONFIG_FILES="$CONFIG_FILES doc/tcldom.xml" ;; "doc/tclxslt.xml") CONFIG_FILES="$CONFIG_FILES doc/tclxslt.xml" ;; "doc/README.xml") CONFIG_FILES="$CONFIG_FILES doc/README.xml" ;; *) { { 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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for 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 _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CYGPATH!$CYGPATH$ac_delim EXEEXT!$EXEEXT$ac_delim PKG_LIB_FILE!$PKG_LIB_FILE$ac_delim PKG_STUB_LIB_FILE!$PKG_STUB_LIB_FILE$ac_delim PKG_STUB_SOURCES!$PKG_STUB_SOURCES$ac_delim PKG_STUB_OBJECTS!$PKG_STUB_OBJECTS$ac_delim PKG_TCL_SOURCES!$PKG_TCL_SOURCES$ac_delim PKG_HEADERS!$PKG_HEADERS$ac_delim PKG_INCLUDES!$PKG_INCLUDES$ac_delim PKG_LIBS!$PKG_LIBS$ac_delim PKG_CFLAGS!$PKG_CFLAGS$ac_delim TCL_VERSION!$TCL_VERSION$ac_delim TCL_BIN_DIR!$TCL_BIN_DIR$ac_delim TCL_SRC_DIR!$TCL_SRC_DIR$ac_delim TCL_LIB_FILE!$TCL_LIB_FILE$ac_delim TCL_LIB_FLAG!$TCL_LIB_FLAG$ac_delim TCL_LIB_SPEC!$TCL_LIB_SPEC$ac_delim TCL_STUB_LIB_FILE!$TCL_STUB_LIB_FILE$ac_delim TCL_STUB_LIB_FLAG!$TCL_STUB_LIB_FLAG$ac_delim TCL_STUB_LIB_SPEC!$TCL_STUB_LIB_SPEC$ac_delim TCL_LIBS!$TCL_LIBS$ac_delim TCL_DEFS!$TCL_DEFS$ac_delim TCL_EXTRA_CFLAGS!$TCL_EXTRA_CFLAGS$ac_delim TCL_LD_FLAGS!$TCL_LD_FLAGS$ac_delim TCL_SHLIB_LD_LIBS!$TCL_SHLIB_LD_LIBS$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim SET_MAKE!$SET_MAKE$ac_delim RANLIB!$RANLIB$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim MATH_LIBS!$MATH_LIBS$ac_delim PKG_SOURCES!$PKG_SOURCES$ac_delim PKG_OBJECTS!$PKG_OBJECTS$ac_delim CLEANFILES!$CLEANFILES$ac_delim TCL_INCLUDES!$TCL_INCLUDES$ac_delim TCL_THREADS!$TCL_THREADS$ac_delim SHARED_BUILD!$SHARED_BUILD$ac_delim AR!$AR$ac_delim CELIB_DIR!$CELIB_DIR$ac_delim LIB@&t@OBJS!$LIB@&t@OBJS$ac_delim DL_LIBS!$DL_LIBS$ac_delim CFLAGS_DEBUG!$CFLAGS_DEBUG$ac_delim CFLAGS_OPTIMIZE!$CFLAGS_OPTIMIZE$ac_delim CFLAGS_WARNING!$CFLAGS_WARNING$ac_delim STLIB_LD!$STLIB_LD$ac_delim SHLIB_LD!$SHLIB_LD$ac_delim SHLIB_LD_LIBS!$SHLIB_LD_LIBS$ac_delim SHLIB_CFLAGS!$SHLIB_CFLAGS$ac_delim LD_LIBRARY_PATH_VAR!$LD_LIBRARY_PATH_VAR$ac_delim TCL_DBGX!$TCL_DBGX$ac_delim CFLAGS_DEFAULT!$CFLAGS_DEFAULT$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF LDFLAGS_DEFAULT!$LDFLAGS_DEFAULT$ac_delim MAKE_LIB!$MAKE_LIB$ac_delim MAKE_SHARED_LIB!$MAKE_SHARED_LIB$ac_delim MAKE_STATIC_LIB!$MAKE_STATIC_LIB$ac_delim MAKE_STUB_LIB!$MAKE_STUB_LIB$ac_delim RANLIB_STUB!$RANLIB_STUB$ac_delim XML2_PREFIX!$XML2_PREFIX$ac_delim XML2_CFLAGS!$XML2_CFLAGS$ac_delim XML2_VERSION!$XML2_VERSION$ac_delim XSLT_VERSION!$XSLT_VERSION$ac_delim XSLT_PREFIX!$XSLT_PREFIX$ac_delim XSLT_CFLAGS!$XSLT_CFLAGS$ac_delim XML_STATIC!$XML_STATIC$ac_delim XML2_LIBS!$XML2_LIBS$ac_delim XSLT_LIBS!$XSLT_LIBS$ac_delim FIX_LIB!$FIX_LIB$ac_delim TCLSH_PROG!$TCLSH_PROG$ac_delim Tclxml_BUILD_LIB_SPEC!$Tclxml_BUILD_LIB_SPEC$ac_delim Tclxml_LIB_SPEC!$Tclxml_LIB_SPEC$ac_delim Tclxml_BUILD_STUB_LIB_SPEC!$Tclxml_BUILD_STUB_LIB_SPEC$ac_delim Tclxml_STUB_LIB_SPEC!$Tclxml_STUB_LIB_SPEC$ac_delim Tclxml_BUILD_STUB_LIB_PATH!$Tclxml_BUILD_STUB_LIB_PATH$ac_delim Tclxml_STUB_LIB_PATH!$Tclxml_STUB_LIB_PATH$ac_delim Tclxml_INCLUDE_SPEC!$Tclxml_INCLUDE_SPEC$ac_delim XSLTPROC!$XSLTPROC$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 26; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # 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 cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # 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. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $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'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $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'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? 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&@top_builddir@&$ac_top_builddir_sub&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (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 #-------------------------------------------------------------------- tclxml-3.3~svn11.orig/autom4te.cache/requests0000644000000000000000000000514211215700771020013 0ustar rootroot# This file was generated. # It contains the lists of macros which have been traced. # It can be safely removed. @request = ( bless( [ '0', 1, [ '/usr/share/autoconf' ], [ '/usr/share/autoconf/autoconf/autoconf.m4f', 'aclocal.m4', 'configure.in' ], { 'AM_PROG_F77_C_O' => 1, '_LT_AC_TAGCONFIG' => 1, 'm4_pattern_forbid' => 1, 'AC_INIT' => 1, 'AC_CANONICAL_TARGET' => 1, 'AC_CONFIG_LIBOBJ_DIR' => 1, 'AC_SUBST' => 1, 'AC_CANONICAL_HOST' => 1, 'AC_FC_SRCEXT' => 1, 'AC_PROG_LIBTOOL' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AC_CONFIG_SUBDIRS' => 1, 'AM_AUTOMAKE_VERSION' => 1, 'LT_CONFIG_LTDL_DIR' => 1, 'AC_REQUIRE_AUX_FILE' => 1, 'AC_CONFIG_LINKS' => 1, 'LT_SUPPORTED_TAG' => 1, 'm4_sinclude' => 1, 'AM_MAINTAINER_MODE' => 1, 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, '_m4_warn' => 1, 'AM_PROG_CXX_C_O' => 1, 'AM_ENABLE_MULTILIB' => 1, 'AC_CONFIG_FILES' => 1, 'include' => 1, 'LT_INIT' => 1, 'AM_GNU_GETTEXT' => 1, 'AC_LIBSOURCE' => 1, 'AM_PROG_FC_C_O' => 1, 'AC_CANONICAL_BUILD' => 1, 'AC_FC_FREEFORM' => 1, 'AH_OUTPUT' => 1, '_AM_SUBST_NOTMAKE' => 1, 'AC_CONFIG_AUX_DIR' => 1, 'AM_PROG_CC_C_O' => 1, 'm4_pattern_allow' => 1, 'sinclude' => 1, 'AM_CONDITIONAL' => 1, 'AC_CANONICAL_SYSTEM' => 1, 'AC_CONFIG_HEADERS' => 1, 'AC_DEFINE_TRACE_LITERAL' => 1, 'm4_include' => 1, 'AC_SUBST_TRACE' => 1 } ], 'Autom4te::Request' ) ); tclxml-3.3~svn11.orig/win/0000755000000000000000000000000011574742531014214 5ustar rootroottclxml-3.3~svn11.orig/win/makefile.vc0000644000000000000000000004455711215700771016332 0ustar rootroot# makefile.vc -- -*- Makefile -*- # # Makefile for TclXML # # Copyright (c) 2009 Explain # # Microsoft Visual C++ makefile for use with nmake.exe v1.62+ (VC++ 5.0+) # # This makefile is based upon the Tcl 8.4 Makefile.vc and modified to # make it suitable as a general package makefile. Look for the word EDIT # which marks sections that may need modification. As a minumum you will # need to change the PROJECT, DOTVERSION and DLLOBJS variables to values # relevant to your package. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. # Copyright (c) 2001 ActiveState Corporation. # Copyright (c) 2001-2002 David Gravereaux. # Copyright (c) 2003-2006 Pat Thoyts # #------------------------------------------------------------------------- # RCS: @(#)$Id: makefile.vc,v 1.10 2008/06/18 11:01:39 patthoyts Exp $ #------------------------------------------------------------------------- # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) # or with the MS Platform SDK (MSSDK). Visual Studio .NET 2003 and 2005 define # VCINSTALLDIR instead. The MSVC Toolkit release defines yet another. !if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(MSSDK) && !defined(VCINSTALLDIR) && !defined(VCToolkitInstallDir) MSG = ^ You need to run vcvars32.bat from Developer Studio or setenv.bat from the^ Platform SDK first to setup the environment. Jump to this line to read^ the build instructions. !error $(MSG) !endif #------------------------------------------------------------------------------ # HOW TO USE this makefile: # # 1) It is now necessary to have %MSVCDir% set in the environment. This is # used as a check to see if vcvars32.bat had been run prior to running # nmake or during the installation of Microsoft Visual C++, MSVCDir had # been set globally and the PATH adjusted. Either way is valid. # # You'll need to run vcvars32.bat contained in the MsDev's vc(98)/bin # directory to setup the proper environment, if needed, for your current # setup. This is a needed bootstrap requirement and allows the swapping of # different environments to be easier. # # 2) To use the Platform SDK (not expressly needed), run setenv.bat after # vcvars32.bat according to the instructions for it. This can also turn on # the 64-bit compiler, if your SDK has it. # # 3) Targets are: # all -- Builds everything. # -- Builds the project (eg: nmake sample) # test -- Builds and runs the test suite. # install -- Installs the built binaries and libraries to $(INSTALLDIR) # in an appropriate subdirectory. # clean/realclean/distclean -- varying levels of cleaning. # # 4) Macros usable on the commandline: # INSTALLDIR= # Sets where to install Tcl from the built binaries. # C:\Progra~1\Tcl is assumed when not specified. # # OPTS=static,msvcrt,staticpkg,threads,symbols,profile,loimpact,none # Sets special options for the core. The default is for none. # Any combination of the above may be used (comma separated). # 'none' will over-ride everything to nothing. # # static = Builds a static library of the core instead of a # dll. The shell will be static (and large), as well. # msvcrt = Effects the static option only to switch it from # using libcmt(d) as the C runtime [by default] to # msvcrt(d). This is useful for static embedding # support. # staticpkg = Effects the static option only to switch # tclshXX.exe to have the dde and reg extension linked # inside it. # nothreads = Turns off multithreading support (not recommended) # thrdalloc = Use the thread allocator (shared global free pool). # symbols = Adds symbols for step debugging. # profile = Adds profiling hooks. Map file is assumed. # loimpact = Adds a flag for how NT treats the heap to keep memory # in use, low. This is said to impact alloc performance. # # STATS=memdbg,compdbg,none # Sets optional memory and bytecode compiler debugging code added # to the core. The default is for none. Any combination of the # above may be used (comma separated). 'none' will over-ride # everything to nothing. # # memdbg = Enables the debugging memory allocator. # compdbg = Enables byte compilation logging. # # MACHINE=(IX86|IA64|ALPHA|AMD64) # Set the machine type used for the compiler, linker, and # resource compiler. This hook is needed to tell the tools # when alternate platforms are requested. IX86 is the default # when not specified. If the CPU environment variable has been # set (ie: recent Platform SDK) then MACHINE is set from CPU. # # TMP_DIR= # OUT_DIR= # Hooks to allow the intermediate and output directories to be # changed. $(OUT_DIR) is assumed to be # $(BINROOT)\(Release|Debug) based on if symbols are requested. # $(TMP_DIR) will de $(OUT_DIR)\ by default. # # TESTPAT= # Reads the tests requested to be run from this file. # # CFG_ENCODING=encoding # name of encoding for configuration information. Defaults # to cp1252 # # 5) Examples: # # Basic syntax of calling nmake looks like this: # nmake [-nologo] -f makefile.vc [target|macrodef [target|macrodef] [...]] # # Standard (no frills) # c:\tcl_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat # Setting environment for using Microsoft Visual C++ tools. # c:\tcl_src\win\>nmake -f makefile.vc all # c:\tcl_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl # # Building for Win64 # c:\tcl_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat # Setting environment for using Microsoft Visual C++ tools. # c:\tcl_src\win\>c:\progra~1\platfo~1\setenv.bat /pre64 /RETAIL # Targeting Windows pre64 RETAIL # c:\tcl_src\win\>nmake -f makefile.vc MACHINE=IA64 # #------------------------------------------------------------------------------ #============================================================================== ############################################################################### #------------------------------------------------------------------------------ !if !exist("makefile.vc") MSG = ^ You must run this makefile only from the directory it is in.^ Please `cd` to its location first. !error $(MSG) !endif #------------------------------------------------------------------------- # Project specific information (EDIT) # # You should edit this with the name and version of your project. This # information is used to generate the name of the package library and # it's install location. # # For example, the sample extension is going to build sample04.dll and # would install it into $(INSTALLDIR)\lib\sample04 # # You need to specify the object files that need to be linked into your # binary here. # #------------------------------------------------------------------------- PROJECT = Tclxml !include "rules.vc" DOTVERSION = 3.3 VERSION = $(DOTVERSION:.=) STUBPREFIX = $(PROJECT)stub DLLOBJS = \ $(TMP_DIR)\tclxml.obj \ $(TMP_DIR)\tclxml-libxml2.obj \ $(TMP_DIR)\tcldom-libxml2.obj \ $(TMP_DIR)\tclxslt-libxslt.obj \ $(TMP_DIR)\docObj.obj \ $(TMP_DIR)\nodeObj.obj \ !if !$(STATIC_BUILD) $(TMP_DIR)\tclxml.res !endif #------------------------------------------------------------------------- # Target names and paths ( shouldn't need changing ) #------------------------------------------------------------------------- BINROOT = . ROOT = .. PRJIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib PRJLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT) PRJLIB = $(OUT_DIR)\$(PRJLIBNAME) PRJSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib PRJSTUBLIB = $(OUT_DIR)\$(PRJSTUBLIBNAME) ### Make sure we use backslash only. PRJ_INSTALL_DIR = $(_INSTALLDIR)\$(PROJECT)$(DOTVERSION) LIB_INSTALL_DIR = $(PRJ_INSTALL_DIR) BIN_INSTALL_DIR = $(PRJ_INSTALL_DIR) DOC_INSTALL_DIR = $(PRJ_INSTALL_DIR) SCRIPT_INSTALL_DIR = $(PRJ_INSTALL_DIR) INCLUDE_INSTALL_DIR = $(_TCLDIR)\include ### The following paths CANNOT have spaces in them. GENERICDIR = $(ROOT) WINDIR = $(ROOT)\win LIBDIR = $(ROOT) DOCDIR = $(ROOT)\doc TOOLSDIR = $(ROOT)\tools COMPATDIR = $(ROOT)\compat #--------------------------------------------------------------------- # Compile flags #--------------------------------------------------------------------- !if !$(DEBUG) !if $(OPTIMIZING) ### This cranks the optimization level to maximize speed cdebug = $(OPTIMIZATIONS) !else cdebug = !endif !else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" ### Warnings are too many, can't support warnings into errors. cdebug = -Zi -Od $(DEBUGFLAGS) !else cdebug = -Zi -WX $(DEBUGFLAGS) !endif ### Declarations common to all compiler options cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ !if $(MSVCRT) !if $(DEBUG) && !$(UNCHECKED) crt = -MDd !else crt = -MD !endif !else !if $(DEBUG) && !$(UNCHECKED) crt = -MTd !else crt = -MT !endif !endif !if !$(STATIC_BUILD) cflags = $(cflags) -DUSE_TCL_STUBS !if defined(TKSTUBLIB) cflags = $(cflags) -DUSE_TK_STUBS !endif !endif #---------------------------------------------------------- # TclXML/libxml2 needs libz, libiconv and libxml2 headers #---------------------------------------------------------- !if !defined(LIBZDIR) MSG=^ Don't know where libz is. Set the LIBZDIR macro. !error $(MSG) !else _LIBZDIR = $(LIBZDIR:/=\) !if !exist("$(_LIBZDIR)\include\zlib.h") MSG=^ Don't know where zlib.h is. The LIBZDIR macro doesn't appear to be correct. !error $(MSG) !endif !endif !if !defined(LIBICONVDIR) MSG=^ Don't know where libiconv is. Set the LIBICONVDIR macro. !error $(MSG) !else _LIBICONVDIR = $(LIBICONVDIR:/=\) !if !exist("$(_LIBICONVDIR)\include\iconv.h") MSG=^ Don't know where iconv.h is. The LIBICONVDIR macro doesn't appear to be correct. !error $(MSG) !endif !endif !if !defined(LIBXML2DIR) MSG=^ Don't know where libxml2 is. Set the LIBXML2DIR macro. !error $(MSG) !else _LIBXML2DIR = $(LIBXML2DIR:/=\) !if !exist("$(_LIBXML2DIR)\include\libxml\tree.h") MSG=^ Don't know where libxml2 tree.h is. The LIBXML2DIR macro doesn't appear to be correct. !error $(MSG) !endif !endif !if !defined(LIBXSLTDIR) MSG=^ Don't know where libxslt is. Set the LIBXSLTDIR macro. !error $(MSG) !else _LIBXSLTDIR = $(LIBXSLTDIR:/=\) !if !exist("$(_LIBXSLTDIR)\include\libxslt\xslt.h") MSG=^ Don't know where libxslt xslt.h is. The LIBXSLTDIR macro doesn't appear to be correct. !error $(MSG) !endif !endif INCLUDES = $(TCL_INCLUDES) -I"$(WINDIR)" -I"$(GENERICDIR)\include" \ -I"$(LIBZDIR)\include" -I"$(LIBICONVDIR)\include" \ -I"$(LIBXML2DIR)\include" -I"$(LIBXSLTDIR)\include" BASE_CFLAGS = $(cflags) $(cdebug) $(crt) $(INCLUDES) CON_CFLAGS = $(cflags) $(cdebug) $(crt) -DCONSOLE TCL_CFLAGS = -DPACKAGE_NAME="\"$(PROJECT)\"" \ -DPACKAGE_VERSION="\"$(DOTVERSION)\"" \ -DBUILD_$(PROJECT) \ -DTCLXML_LIBXML2_VERSION="\"$(DOTVERSION)\"" \ -DLIBXML_STATIC \ $(BASE_CFLAGS) $(OPTDEFINES) #--------------------------------------------------------------------- # Link flags #--------------------------------------------------------------------- !if $(DEBUG) ldebug = -debug:full -debugtype:cv !if $(MSVCRT) ldebug = $(ldebug) -nodefaultlib:msvcrt !endif !else ldebug = -release -opt:ref -opt:icf,3 !endif ### Declarations common to all linker options lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) !if $(PROFILE) lflags = $(lflags) -profile !endif !if $(ALIGN98_HACK) && !$(STATIC_BUILD) ### Align sections for PE size savings. lflags = $(lflags) -opt:nowin98 !else if !$(ALIGN98_HACK) && $(STATIC_BUILD) ### Align sections for speed in loading by choosing the virtual page size. lflags = $(lflags) -align:4096 !endif !if $(LOIMPACT) lflags = $(lflags) -ws:aggressive !endif dlllflags = $(lflags) -dll conlflags = $(lflags) -subsystem:console guilflags = $(lflags) -subsystem:windows !if !$(STATIC_BUILD) baselibs = $(TCLSTUBLIB) !if defined(TKSTUBLIB) baselibs = $(baselibs) $(TKSTUBLIB) !endif !endif # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" !if $(VCVERSION) >= 1400 && $(VCVERSION) < 1500 baselibs = $(baselibs) bufferoverflowU.lib !endif !endif baselibs = $(baselibs) user32.lib gdi32.lib $(LIBZDIR)\lib\zlib.lib $(LIBICONVDIR)\lib\iconv_a.lib $(LIBXML2DIR)\lib\libxml2_a.lib $(LIBXSLTDIR)\lib\libxslt_a.lib $(LIBXSLTDIR)\lib\libexslt_a.lib #--------------------------------------------------------------------- # TclTest flags #--------------------------------------------------------------------- !IF "$(TESTPAT)" != "" TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) !ENDIF #--------------------------------------------------------------------- # Project specific targets (EDIT) #--------------------------------------------------------------------- all: setup $(PROJECT) $(PROJECT): setup pkgIndex $(PRJLIB) #install: install-binaries install-libraries install-docs install: install-binaries install-libraries pkgIndex: $(OUT_DIR)\pkgIndex.tcl test: setup $(PROJECT) @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) @set TCLLIBPATH=$(OUT_DIR_PATH:\=/) !if $(TCLINSTALL) @set PATH=$(_TCLDIR)\bin;$(PATH) !else @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif !if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" $(DEBUGGER) $(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) !else @echo Please wait while the tests are collected... $(DEBUGGER) $(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) > tests.log type tests.log | more !endif shell: setup $(PROJECT) @set VLERQ_LIBRARY=$(LIBDIR:\=/) @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) @set TCLLIBPATH=$(OUT_DIR_PATH:\=/) !if $(TCLINSTALL) @set PATH=$(_TCLDIR)\bin;$(PATH) !else @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif $(DEBUGGER) $(TCLSH) $(SCRIPT) setup: $(GENERICDIR)\include\tclxml\tclxml.h $(ROOT)\README.TXT $(DOCDIR)\tclxml.xml $(DOCDIR)\tcldom.xml $(DOCDIR)\tclxslt.xml @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) # See /win/coffbase.txt for extension base addresses. $(PRJLIB): $(DLLOBJS) !if $(STATIC_BUILD) $(lib32) -nologo -out:$@ @<< $** << !else $(link32) $(dlllflags) -base:0x10000000 -out:$@ $(baselibs) @<< $** << $(_VC_MANIFEST_EMBED_DLL) -@del $*.exp !endif $(PRJSTUBLIB): $(PRJSTUBOBJS) $(lib32) -nologo -out:$@ $(PRJSTUBOBJS) #--------------------------------------------------------------------- # Implicit rules #--------------------------------------------------------------------- {$(WINDIR)}.c{$(TMP_DIR)}.obj:: $(cc32) $(TCL_CFLAGS) -DBUILD_$(PROJECT) -Fo$(TMP_DIR)\ @<< $< << {$(GENERICDIR)}.c{$(TMP_DIR)}.obj:: $(cc32) $(TCL_CFLAGS) -DBUILD_$(PROJECT) -Fo$(TMP_DIR)\ @<< $< << {$(COMPATDIR)}.c{$(TMP_DIR)}.obj:: $(cc32) $(TCL_CFLAGS) -DBUILD_$(PROJECT) -Fo$(TMP_DIR)\ @<< $< << {$(WINDIR)}.rc{$(TMP_DIR)}.res: $(rc32) -fo $@ -r -i "$(GENERICDIR)" -D__WIN32__ \ -DCOMMAVERSION=$(DOTVERSION:.=,),0,0 \ -DDOTVERSION=\"$(DOTVERSION)\" \ -DVERSION=\"$(VERSION)$(SUFX)\" \ !if $(DEBUG) -d DEBUG \ !endif !if $(TCL_THREADS) -d TCL_THREADS \ !endif !if $(STATIC_BUILD) -d STATIC_BUILD \ !endif $< .SUFFIXES: .SUFFIXES:.c .rc #------------------------------------------------------------------------- # Explicit dependency rules # #------------------------------------------------------------------------- $(OUT_DIR)\pkgIndex.tcl: $(ROOT)\pkgIndex.tcl.in @nmakehlp.exe -s << $** > $@ @PACKAGE_VERSION@ $(DOTVERSION) @PACKAGE_NAME@ $(PROJECT) @PKG_LIB_FILE@ $(PRJLIBNAME) << $(GENERICDIR)\include\tclxml\tclxml.h: $(GENERICDIR)\include\tclxml\tclxml.h.in @nmakehlp.exe -s << $** > $@ @PACKAGE_VERSION@ $(DOTVERSION) << $(ROOT)\README.TXT: $(DOCDIR)\README.xml.in @nmakehlp.exe -s << $** > $@ @PACKAGE_VERSION@ $(DOTVERSION) << $(DOCDIR)\tclxml.xml: $(DOCDIR)\tclxml.xml.in @nmakehlp.exe -s << $** > $@ @PACKAGE_VERSION@ $(DOTVERSION) << $(DOCDIR)\tcldom.xml: $(DOCDIR)\tcldom.xml.in @nmakehlp.exe -s << $** > $@ @PACKAGE_VERSION@ $(DOTVERSION) << $(DOCDIR)\tclxslt.xml: $(DOCDIR)\tclxslt.xml.in @nmakehlp.exe -s << $** > $@ @PACKAGE_VERSION@ $(DOTVERSION) << #--------------------------------------------------------------------- # Installation. (EDIT) # # You may need to modify this section to reflect the final distribution # of your files and possibly to generate documentation. # #--------------------------------------------------------------------- install-binaries: @echo Installing binaries to '$(SCRIPT_INSTALL_DIR)' @if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)" @$(CPY) $(PRJLIB) "$(SCRIPT_INSTALL_DIR)" >NUL install-libraries: $(OUT_DIR)\pkgIndex.tcl @echo Installing libraries to '$(SCRIPT_INSTALL_DIR)' @if exist $(LIBDIR) $(CPY) $(LIBDIR)\*.tcl "$(SCRIPT_INSTALL_DIR)" @if exist $(LIBDIR)\tcldom-tcl $(CPY) $(LIBDIR)\tcldom-tcl\*.tcl "$(SCRIPT_INSTALL_DIR)" @if exist $(LIBDIR)\tclxml-tcl $(CPY) $(LIBDIR)\tclxml-tcl\*.tcl "$(SCRIPT_INSTALL_DIR)" @if exist $(LIBDIR)\tclxslt $(CPY) $(LIBDIR)\tclxslt\*.tcl "$(SCRIPT_INSTALL_DIR)" @echo Installing package index in '$(SCRIPT_INSTALL_DIR)' @$(CPY) $(OUT_DIR)\pkgIndex.tcl $(SCRIPT_INSTALL_DIR) install-docs: $(DOCDIR)\tclxml.html $(DOCDIR)\tcldom.html $(DOCDIR)\tclxslt.html @echo Installing documentation files to '$(DOC_INSTALL_DIR)' @if exist $(DOCDIR) $(CPY) $(DOCDIR)\*.html "$(DOC_INSTALL_DIR)" $(DOCDIR)\tclxml.html: $(DOCDIR)\tclxml.xml $(TCLSH) $(DOCDIR)\transform.tcl $(DOCDIR)\tclxml.xml $(DOCDIR)\html.xsl $@ $(DOCDIR)\tcldom.html: $(DOCDIR)\tcldom.xml $(TCLSH) $(DOCDIR)\transform.tcl $(DOCDIR)\tcldom.xml $(DOCDIR)\html.xsl $@ $(DOCDIR)\tclxslt.html: $(DOCDIR)\tclxslt.xml $(TCLSH) $(DOCDIR)\transform.tcl $(DOCDIR)\tclxslt.xml $(DOCDIR)\html.xsl $@ #--------------------------------------------------------------------- # Clean up #--------------------------------------------------------------------- clean: @if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR) @if exist $(WINDIR)\version.vc del $(WINDIR)\version.vc @if exist $(WINDIR)\vercl.i del $(WINDIR)\vercl.i @if exist $(WINDIR)\vercl.x del $(WINDIR)\vercl.x @if exist $(WINDIR)\_junk.pch del $(WINDIR)\_junk.pch realclean: clean @if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR) distclean: realclean @if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe @if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj tclxml-3.3~svn11.orig/win/nmakehlp.c0000644000000000000000000004440411215700771016155 0ustar rootroot/* * ---------------------------------------------------------------------------- * nmakehlp.c -- * * This is used to fix limitations within nmake and the environment. * * Copyright (c) 2002 by David Gravereaux. * Copyright (c) 2006 by Pat Thoyts * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * * ---------------------------------------------------------------------------- * RCS: @(#) $Id: nmakehlp.c,v 1.7 2008/06/18 11:01:42 patthoyts Exp $ * ---------------------------------------------------------------------------- */ #define _CRT_SECURE_NO_DEPRECATE #include #define NO_SHLWAPI_GDI #define NO_SHLWAPI_STREAM #define NO_SHLWAPI_REG #include #pragma comment (lib, "user32.lib") #pragma comment (lib, "kernel32.lib") #pragma comment (lib, "shlwapi.lib") #include #include /* * This library is required for x64 builds with _some_ versions of MSVC */ #if defined(_M_IA64) || defined(_M_AMD64) #if _MSC_VER >= 1400 && _MSC_VER < 1500 #pragma comment(lib, "bufferoverflowU") #endif #endif /* ISO hack for dumb VC++ */ #ifdef _MSC_VER #define snprintf _snprintf #endif /* protos */ int CheckForCompilerFeature(const char *option); int CheckForLinkerFeature(const char *option); int IsIn(const char *string, const char *substring); int GrepForDefine(const char *file, const char *string); int SubstituteFile(const char *substs, const char *filename); int QualifyPath(const char *path); const char * GetVersionFromFile(const char *filename, const char *match); DWORD WINAPI ReadFromPipe(LPVOID args); /* globals */ #define CHUNK 25 #define STATICBUFFERSIZE 1000 typedef struct { HANDLE pipe; char buffer[STATICBUFFERSIZE]; } pipeinfo; pipeinfo Out = {INVALID_HANDLE_VALUE, '\0'}; pipeinfo Err = {INVALID_HANDLE_VALUE, '\0'}; /* * exitcodes: 0 == no, 1 == yes, 2 == error */ int main( int argc, char *argv[]) { char msg[300]; DWORD dwWritten; int chars; /* * Make sure children (cl.exe and link.exe) are kept quiet. */ SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); /* * Make sure the compiler and linker aren't effected by the outside world. */ SetEnvironmentVariable("CL", ""); SetEnvironmentVariable("LINK", ""); if (argc > 1 && *argv[1] == '-') { switch (*(argv[1]+1)) { case 'c': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -c \n" "Tests for whether cl.exe supports an option\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return CheckForCompilerFeature(argv[2]); case 'l': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -l \n" "Tests for whether link.exe supports an option\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return CheckForLinkerFeature(argv[2]); case 'f': if (argc == 2) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -f \n" "Find a substring within another\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } else if (argc == 3) { /* * If the string is blank, there is no match. */ return 0; } else { return IsIn(argv[2], argv[3]); } case 'g': if (argc == 2) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -g \n" "grep for a #define\n" "exitcodes: integer of the found string (no decimals)\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return GrepForDefine(argv[2], argv[3]); case 's': if (argc == 2) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -s \n" "Perform a set of string map type substutitions on a file\n" "exitcodes: 0\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return SubstituteFile(argv[2], argv[3]); case 'V': if (argc != 4) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -V filename matchstring\n" "Extract a version from a file:\n" "eg: pkgIndex.tcl \"package ifneeded http\"", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 0; } printf("%s\n", GetVersionFromFile(argv[2], argv[3])); return 0; case 'Q': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -q path\n" "Emit the fully qualified path\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return QualifyPath(argv[2]); } } chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -c|-l|-f|-g|-V|-s|-Q ...\n" "This is a little helper app to equalize shell differences between WinNT and\n" "Win9x and get nmake.exe to accomplish its job.\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } int CheckForCompilerFeature( const char *option) { STARTUPINFO si; PROCESS_INFORMATION pi; SECURITY_ATTRIBUTES sa; DWORD threadID; char msg[300]; BOOL ok; HANDLE hProcess, h, pipeThreads[2]; char cmdline[100]; hProcess = GetCurrentProcess(); ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); ZeroMemory(&si, sizeof(STARTUPINFO)); si.cb = sizeof(STARTUPINFO); si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = INVALID_HANDLE_VALUE; ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES)); sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = FALSE; /* * Create a non-inheritible pipe. */ CreatePipe(&Out.pipe, &h, &sa, 0); /* * Dupe the write side, make it inheritible, and close the original. */ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Same as above, but for the error side. */ CreatePipe(&Err.pipe, &h, &sa, 0); DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Base command line. */ lstrcpy(cmdline, "cl.exe -nologo -c -TC -Zs -X -Fp.\\_junk.pch "); /* * Append our option for testing */ lstrcat(cmdline, option); /* * Filename to compile, which exists, but is nothing and empty. */ lstrcat(cmdline, " .\\nul"); ok = CreateProcess( NULL, /* Module name. */ cmdline, /* Command line. */ NULL, /* Process handle not inheritable. */ NULL, /* Thread handle not inheritable. */ TRUE, /* yes, inherit handles. */ DETACHED_PROCESS, /* No console for you. */ NULL, /* Use parent's environment block. */ NULL, /* Use parent's starting directory. */ &si, /* Pointer to STARTUPINFO structure. */ &pi); /* Pointer to PROCESS_INFORMATION structure. */ if (!ok) { DWORD err = GetLastError(); int chars = snprintf(msg, sizeof(msg) - 1, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], (300-chars), 0); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg,lstrlen(msg), &err,NULL); return 2; } /* * Close our references to the write handles that have now been inherited. */ CloseHandle(si.hStdOutput); CloseHandle(si.hStdError); WaitForInputIdle(pi.hProcess, 5000); CloseHandle(pi.hThread); /* * Start the pipe reader threads. */ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID); pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID); /* * Block waiting for the process to end. */ WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); /* * Wait for our pipe to get done reading, should it be a little slow. */ WaitForMultipleObjects(2, pipeThreads, TRUE, 500); CloseHandle(pipeThreads[0]); CloseHandle(pipeThreads[1]); /* * Look for the commandline warning code in both streams. * - in MSVC 6 & 7 we get D4002, in MSVC 8 we get D9002. */ return !(strstr(Out.buffer, "D4002") != NULL || strstr(Err.buffer, "D4002") != NULL || strstr(Out.buffer, "D9002") != NULL || strstr(Err.buffer, "D9002") != NULL || strstr(Out.buffer, "D2021") != NULL || strstr(Err.buffer, "D2021") != NULL); } int CheckForLinkerFeature( const char *option) { STARTUPINFO si; PROCESS_INFORMATION pi; SECURITY_ATTRIBUTES sa; DWORD threadID; char msg[300]; BOOL ok; HANDLE hProcess, h, pipeThreads[2]; char cmdline[100]; hProcess = GetCurrentProcess(); ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); ZeroMemory(&si, sizeof(STARTUPINFO)); si.cb = sizeof(STARTUPINFO); si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = INVALID_HANDLE_VALUE; ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES)); sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = TRUE; /* * Create a non-inheritible pipe. */ CreatePipe(&Out.pipe, &h, &sa, 0); /* * Dupe the write side, make it inheritible, and close the original. */ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Same as above, but for the error side. */ CreatePipe(&Err.pipe, &h, &sa, 0); DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Base command line. */ lstrcpy(cmdline, "link.exe -nologo "); /* * Append our option for testing. */ lstrcat(cmdline, option); ok = CreateProcess( NULL, /* Module name. */ cmdline, /* Command line. */ NULL, /* Process handle not inheritable. */ NULL, /* Thread handle not inheritable. */ TRUE, /* yes, inherit handles. */ DETACHED_PROCESS, /* No console for you. */ NULL, /* Use parent's environment block. */ NULL, /* Use parent's starting directory. */ &si, /* Pointer to STARTUPINFO structure. */ &pi); /* Pointer to PROCESS_INFORMATION structure. */ if (!ok) { DWORD err = GetLastError(); int chars = snprintf(msg, sizeof(msg) - 1, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], (300-chars), 0); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg,lstrlen(msg), &err,NULL); return 2; } /* * Close our references to the write handles that have now been inherited. */ CloseHandle(si.hStdOutput); CloseHandle(si.hStdError); WaitForInputIdle(pi.hProcess, 5000); CloseHandle(pi.hThread); /* * Start the pipe reader threads. */ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID); pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID); /* * Block waiting for the process to end. */ WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); /* * Wait for our pipe to get done reading, should it be a little slow. */ WaitForMultipleObjects(2, pipeThreads, TRUE, 500); CloseHandle(pipeThreads[0]); CloseHandle(pipeThreads[1]); /* * Look for the commandline warning code in the stderr stream. */ return !(strstr(Out.buffer, "LNK1117") != NULL || strstr(Err.buffer, "LNK1117") != NULL || strstr(Out.buffer, "LNK4044") != NULL || strstr(Err.buffer, "LNK4044") != NULL); } DWORD WINAPI ReadFromPipe( LPVOID args) { pipeinfo *pi = (pipeinfo *) args; char *lastBuf = pi->buffer; DWORD dwRead; BOOL ok; again: if (lastBuf - pi->buffer + CHUNK > STATICBUFFERSIZE) { CloseHandle(pi->pipe); return (DWORD)-1; } ok = ReadFile(pi->pipe, lastBuf, CHUNK, &dwRead, 0L); if (!ok || dwRead == 0) { CloseHandle(pi->pipe); return 0; } lastBuf += dwRead; goto again; return 0; /* makes the compiler happy */ } int IsIn( const char *string, const char *substring) { return (strstr(string, substring) != NULL); } /* * Find a specified #define by name. * * If the line is '#define TCL_VERSION "8.5"', it returns 85 as the result. */ int GrepForDefine( const char *file, const char *string) { char s1[51], s2[51], s3[51]; FILE *f = fopen(file, "rt"); if (f == NULL) { return 0; } do { int r = fscanf(f, "%50s", s1); if (r == 1 && !strcmp(s1, "#define")) { /* * Get next two words. */ r = fscanf(f, "%50s %50s", s2, s3); if (r != 2) { continue; } /* * Is the first word what we're looking for? */ if (!strcmp(s2, string)) { double d1; fclose(f); /* * Add 1 past first double quote char. "8.5" */ d1 = atof(s3 + 1); /* 8.5 */ while (floor(d1) != d1) { d1 *= 10.0; } return ((int) d1); /* 85 */ } } } while (!feof(f)); fclose(f); return 0; } /* * GetVersionFromFile -- * Looks for a match string in a file and then returns the version * following the match where a version is anything acceptable to * package provide or package ifneeded. */ const char * GetVersionFromFile( const char *filename, const char *match) { size_t cbBuffer = 100; static char szBuffer[100]; char *szResult = NULL; FILE *fp = fopen(filename, "rt"); if (fp != NULL) { /* * Read data until we see our match string. */ while (fgets(szBuffer, cbBuffer, fp) != NULL) { LPSTR p, q; p = strstr(szBuffer, match); if (p != NULL) { /* * Skip to first digit. */ while (*p && !isdigit(*p)) { ++p; } /* * Find ending whitespace. */ q = p; while (*q && (isalnum(*q) || *q == '.')) { ++q; } memcpy(szBuffer, p, q - p); szBuffer[q-p] = 0; szResult = szBuffer; break; } } fclose(fp); } return szResult; } /* * List helpers for the SubstituteFile function */ typedef struct list_item_t { struct list_item_t *nextPtr; char * key; char * value; } list_item_t; /* insert a list item into the list (list may be null) */ static list_item_t * list_insert(list_item_t **listPtrPtr, const char *key, const char *value) { list_item_t *itemPtr = malloc(sizeof(list_item_t)); if (itemPtr) { itemPtr->key = strdup(key); itemPtr->value = strdup(value); itemPtr->nextPtr = NULL; while(*listPtrPtr) { listPtrPtr = &(*listPtrPtr)->nextPtr; } *listPtrPtr = itemPtr; } return itemPtr; } static void list_free(list_item_t **listPtrPtr) { list_item_t *tmpPtr, *listPtr = *listPtrPtr; while (listPtr) { tmpPtr = listPtr; listPtr = listPtr->nextPtr; free(tmpPtr->key); free(tmpPtr->value); free(tmpPtr); } } /* * SubstituteFile -- * As windows doesn't provide anything useful like sed and it's unreliable * to use the tclsh you are building against (consider x-platform builds - * eg compiling AMD64 target from IX86) we provide a simple substitution * option here to handle autoconf style substitutions. * The substitution file is whitespace and line delimited. The file should * consist of lines matching the regular expression: * \s*\S+\s+\S*$ * * Usage is something like: * nmakehlp -S << $** > $@ * @PACKAGE_NAME@ $(PACKAGE_NAME) * @PACKAGE_VERSION@ $(PACKAGE_VERSION) * << */ int SubstituteFile( const char *substitutions, const char *filename) { size_t cbBuffer = 1024; static char szBuffer[1024], szCopy[1024]; char *szResult = NULL; list_item_t *substPtr = NULL; FILE *fp, *sp; fp = fopen(filename, "rt"); if (fp != NULL) { /* * Build a list of substutitions from the first filename */ sp = fopen(substitutions, "rt"); if (sp != NULL) { while (fgets(szBuffer, cbBuffer, sp) != NULL) { char *ks, *ke, *vs, *ve; ks = szBuffer; while (ks && *ks && isspace(*ks)) ++ks; ke = ks; while (ke && *ke && !isspace(*ke)) ++ke; vs = ke; while (vs && *vs && isspace(*vs)) ++vs; ve = vs; while (ve && *ve && !(*ve == '\r' || *ve == '\n')) ++ve; *ke = 0, *ve = 0; list_insert(&substPtr, ks, vs); } fclose(sp); } /* debug: dump the list */ #ifdef _DEBUG { int n = 0; list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr, ++n) { fprintf(stderr, "% 3d '%s' => '%s'\n", n, p->key, p->value); } } #endif /* * Run the substitutions over each line of the input */ while (fgets(szBuffer, cbBuffer, fp) != NULL) { list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr) { char *m = strstr(szBuffer, p->key); if (m) { char *cp, *op, *sp; cp = szCopy; op = szBuffer; while (op != m) *cp++ = *op++; sp = p->value; while (sp && *sp) *cp++ = *sp++; op += strlen(p->key); while (*op) *cp++ = *op++; *cp = 0; memcpy(szBuffer, szCopy, sizeof(szCopy)); } } printf(szBuffer); } list_free(&substPtr); } fclose(fp); return 0; } /* * QualifyPath -- * * This composes the current working directory with a provided path * and returns the fully qualified and normalized path. * Mostly needed to setup paths for testing. */ int QualifyPath( const char *szPath) { char szCwd[MAX_PATH + 1]; char szTmp[MAX_PATH + 1]; char *p; GetCurrentDirectory(MAX_PATH, szCwd); while ((p = strchr(szPath, '/')) && *p) *p = '\\'; PathCombine(szTmp, szCwd, szPath); PathCanonicalize(szCwd, szTmp); printf("%s\n", szCwd); return 0; } /* * Local variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * indent-tabs-mode: t * tab-width: 8 * End: */ tclxml-3.3~svn11.orig/win/mkPkgIndex.tcl0000644000000000000000000000130511113705304016742 0ustar rootroot# mkPkgIndex.tcl -- # # Helper script for non-TEA installion on Windows. # This script resolves configure symbols. # # Copyright (c) 2003 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: mkPkgIndex.tcl,v 1.1 2004/01/15 07:38:40 balls Exp $ set infile [lindex $argv 0] set outfile [lindex $argv 1] set ch [open $infile] set script [read $ch] close $ch set ch [open $outfile w] foreach parameter [lrange $argv 2 end] { regexp {^([^=]+)=(.*)$} $parameter dummy name value regsub -all @${name}@ $script $value script } puts $ch $script close $ch exit 0 tclxml-3.3~svn11.orig/win/rules.vc0000644000000000000000000003703511215700771015700 0ustar rootroot#------------------------------------------------------------------------------ # rules.vc -- # # Microsoft Visual C++ makefile include for decoding the commandline # macros. This file does not need editing to build Tcl. # # This version is modified from the Tcl source version to support # building extensions using nmake. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Copyright (c) 2001-2002 David Gravereaux. # Copyright (c) 2003-2008 Patrick Thoyts # #------------------------------------------------------------------------------ # RCS: @(#) $Id: rules.vc,v 1.8 2008/06/18 11:02:11 patthoyts Exp $ #------------------------------------------------------------------------------ !ifndef _RULES_VC _RULES_VC = 1 cc32 = $(CC) # built-in default. link32 = link lib32 = lib rc32 = $(RC) # built-in default. !ifndef INSTALLDIR ### Assume the normal default. _INSTALLDIR = C:\Program Files\Tcl !else ### Fix the path separators. _INSTALLDIR = $(INSTALLDIR:/=\) !endif !ifndef MACHINE !if "$(CPU)" == "" || "$(CPU)" == "i386" MACHINE = IX86 !else MACHINE = $(CPU) !endif !endif !ifndef CFG_ENCODING CFG_ENCODING = \"cp1252\" !endif #---------------------------------------------------------- # Set the proper copy method to avoid overwrite questions # to the user when copying files and selecting the right # "delete all" method. #---------------------------------------------------------- !if "$(OS)" == "Windows_NT" RMDIR = rmdir /S /Q ERRNULL = 2>NUL !if ![ver | find "4.0" > nul] CPY = echo y | xcopy /i >NUL COPY = copy >NUL !else CPY = xcopy /i /y >NUL COPY = copy /y >NUL !endif !else # "$(OS)" != "Windows_NT" CPY = xcopy /i >_JUNK.OUT # On Win98 NUL does not work here. COPY = copy >_JUNK.OUT # On Win98 NUL does not work here. RMDIR = deltree /Y NULL = \NUL # Used in testing directory existence ERRNULL = >NUL # Win9x shell cannot redirect stderr !endif MKDIR = mkdir !message =============================================================================== #---------------------------------------------------------- # build the helper app we need to overcome nmake's limiting # environment. #---------------------------------------------------------- !if !exist(nmakehlp.exe) !if [$(cc32) -nologo nmakehlp.c -link -subsystem:console > nul] !endif !endif #---------------------------------------------------------- # Test for compiler features #---------------------------------------------------------- ### test for optimizations !if [nmakehlp.exe -c -Ot] !message *** Compiler has 'Optimizations' OPTIMIZING = 1 !else !message *** Compiler does not have 'Optimizations' OPTIMIZING = 0 !endif OPTIMIZATIONS = !if [nmakehlp.exe -c -Ot] OPTIMIZATIONS = $(OPTIMIZATIONS) -Ot !endif !if [nmakehlp.exe -c -Oi] OPTIMIZATIONS = $(OPTIMIZATIONS) -Oi !endif !if [nmakehlp.exe -c -Op] OPTIMIZATIONS = $(OPTIMIZATIONS) -Op !endif !if [nmakehlp.exe -c -fp:strict] OPTIMIZATIONS = $(OPTIMIZATIONS) -fp:strict !endif !if [nmakehlp.exe -c -Gs] OPTIMIZATIONS = $(OPTIMIZATIONS) -Gs !endif !if [nmakehlp.exe -c -GS] OPTIMIZATIONS = $(OPTIMIZATIONS) -GS !endif !if [nmakehlp.exe -c -GL] OPTIMIZATIONS = $(OPTIMIZATIONS) -GL !endif DEBUGFLAGS = !if [nmakehlp.exe -c -RTC1] DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 !elseif [nmakehlp.exe -c -GZ] DEBUGFLAGS = $(DEBUGFLAGS) -GZ !endif COMPILERFLAGS =-W3 # In v13 -GL and -YX are incompatible. !if [nmakehlp.exe -c -YX] !if ![nmakehlp.exe -c -GL] OPTIMIZATIONS = $(OPTIMIZATIONS) -YX !endif !endif !if "$(MACHINE)" == "IX86" ### test for pentium errata !if [nmakehlp.exe -c -QI0f] !message *** Compiler has 'Pentium 0x0f fix' COMPILERFLAGS = $(COMPILERFLAGSS) -QI0f !else !message *** Compiler does not have 'Pentium 0x0f fix' !endif !endif !if "$(MACHINE)" == "IA64" ### test for Itanium errata !if [nmakehlp.exe -c -QIA64_Bx] !message *** Compiler has 'B-stepping errata workarounds' COMPILERFLAGS = $(COMPILERFLAGS) -QIA64_Bx !else !message *** Compiler does not have 'B-stepping errata workarounds' !endif !endif !if "$(MACHINE)" == "IX86" ### test for -align:4096, when align:512 will do. !if [nmakehlp.exe -l -opt:nowin98] !message *** Linker has 'Win98 alignment problem' ALIGN98_HACK = 1 !else !message *** Linker does not have 'Win98 alignment problem' ALIGN98_HACK = 0 !endif !else ALIGN98_HACK = 0 !endif LINKERFLAGS = !if [nmakehlp.exe -l -ltcg] LINKERFLAGS =-ltcg !endif #---------------------------------------------------------- # MSVC8 (ships with Visual Studio 2005) generates a manifest # file that we should link into the binaries. This is how. #---------------------------------------------------------- _VC_MANIFEST_EMBED_EXE= _VC_MANIFEST_EMBED_DLL= VCVER=0 !if ![echo VCVERSION=_MSC_VER > vercl.x] \ && ![cl -nologo -TC -P vercl.x $(ERRNULL)] !include vercl.i !if $(VCVERSION) >= 1500 VCVER=9 !elseif $(VCVERSION) >= 1400 VCVER=8 !elseif $(VCVERSION) >= 1300 VCVER=7 !elseif $(VCVERSION) >= 1200 VCVER=6 !endif !endif # Since MSVC8 we must deal with manifest resources. !if $(VCVERSION) >= 1400 _VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 _VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 !endif #---------------------------------------------------------- # Decode the options requested. #---------------------------------------------------------- !if "$(OPTS)" == "" || [nmakehlp.exe -f "$(OPTS)" "none"] STATIC_BUILD = 0 TCL_THREADS = 1 DEBUG = 0 PROFILE = 0 MSVCRT = 0 LOIMPACT = 0 TCL_USE_STATIC_PACKAGES = 0 USE_THREAD_ALLOC = 1 USE_THREAD_STORAGE = 1 UNCHECKED = 0 !else !if [nmakehlp.exe -f $(OPTS) "static"] !message *** Doing static STATIC_BUILD = 1 !else STATIC_BUILD = 0 !endif !if [nmakehlp.exe -f $(OPTS) "msvcrt"] !message *** Doing msvcrt MSVCRT = 1 !else MSVCRT = 0 !endif !if [nmakehlp.exe -f $(OPTS) "staticpkg"] !message *** Doing staticpkg TCL_USE_STATIC_PACKAGES = 1 !else TCL_USE_STATIC_PACKAGES = 0 !endif !if [nmakehlp.exe -f $(OPTS) "nothreads"] !message *** Compile explicitly for non-threaded tcl TCL_THREADS = 0 !else TCL_THREADS = 1 !endif !if [nmakehlp.exe -f $(OPTS) "symbols"] !message *** Doing symbols DEBUG = 1 !else DEBUG = 0 !endif !if [nmakehlp.exe -f $(OPTS) "profile"] !message *** Doing profile PROFILE = 1 !else PROFILE = 0 !endif !if [nmakehlp.exe -f $(OPTS) "loimpact"] !message *** Doing loimpact LOIMPACT = 1 !else LOIMPACT = 0 !endif !if [nmakehlp.exe -f $(OPTS) "thrdalloc"] !message *** Doing thrdalloc USE_THREAD_ALLOC = 1 !else USE_THREAD_ALLOC = 0 !endif !if [nmakehlp.exe -f $(OPTS) "thrdstorage"] !message *** Doing thrdstorage USE_THREAD_STORAGE = 1 !else USE_THREAD_STORAGE = 0 !endif !if [nmakehlp.exe -f $(OPTS) "unchecked"] !message *** Doing unchecked UNCHECKED = 1 !else UNCHECKED = 0 !endif !endif !if !$(STATIC_BUILD) # Make sure we don't build overly fat DLLs. MSVCRT = 1 # We shouldn't statically put the extensions inside the shell when dynamic. TCL_USE_STATIC_PACKAGES = 0 !endif #---------------------------------------------------------- # Figure-out how to name our intermediate and output directories. # We wouldn't want different builds to use the same .obj files # by accident. #---------------------------------------------------------- #---------------------------------------- # Naming convention: # t = full thread support. # s = static library (as opposed to an # import library) # g = linked to the debug enabled C # run-time. # x = special static build when it # links to the dynamic C run-time. #---------------------------------------- SUFX = sgx !if $(DEBUG) BUILDDIRTOP = Debug !else BUILDDIRTOP = Release !endif !if "$(MACHINE)" != "IX86" BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE) !endif !if $(VCVER) > 6 BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) !endif !if !$(DEBUG) || $(DEBUG) && $(UNCHECKED) SUFX = $(SUFX:g=) !endif TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX !if !$(STATIC_BUILD) TMP_DIRFULL = $(TMP_DIRFULL:Static=) SUFX = $(SUFX:s=) EXT = dll !if $(MSVCRT) TMP_DIRFULL = $(TMP_DIRFULL:X=) SUFX = $(SUFX:x=) !endif !else TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=) EXT = lib !if !$(MSVCRT) TMP_DIRFULL = $(TMP_DIRFULL:X=) SUFX = $(SUFX:x=) !endif !endif !if !$(TCL_THREADS) TMP_DIRFULL = $(TMP_DIRFULL:Threaded=) SUFX = $(SUFX:t=) !endif !ifndef TMP_DIR TMP_DIR = $(TMP_DIRFULL) !ifndef OUT_DIR OUT_DIR = .\$(BUILDDIRTOP) !endif !else !ifndef OUT_DIR OUT_DIR = $(TMP_DIR) !endif !endif #---------------------------------------------------------- # Decode the statistics requested. #---------------------------------------------------------- !if "$(STATS)" == "" || [nmakehlp.exe -f "$(STATS)" "none"] TCL_MEM_DEBUG = 0 TCL_COMPILE_DEBUG = 0 !else !if [nmakehlp.exe -f $(STATS) "memdbg"] !message *** Doing memdbg TCL_MEM_DEBUG = 1 !else TCL_MEM_DEBUG = 0 !endif !if [nmakehlp.exe -f $(STATS) "compdbg"] !message *** Doing compdbg TCL_COMPILE_DEBUG = 1 !else TCL_COMPILE_DEBUG = 0 !endif !endif #---------------------------------------------------------- # Decode the checks requested. #---------------------------------------------------------- !if "$(CHECKS)" == "" || [nmakehlp.exe -f "$(CHECKS)" "none"] TCL_NO_DEPRECATED = 0 WARNINGS = -W3 !else !if [nmakehlp.exe -f $(CHECKS) "nodep"] !message *** Doing nodep check TCL_NO_DEPRECATED = 1 !else TCL_NO_DEPRECATED = 0 !endif !if [nmakehlp.exe -f $(CHECKS) "fullwarn"] !message *** Doing full warnings check WARNINGS = -W4 !if [nmakehlp.exe -l -warn:3] LINKERFLAGS = $(LINKERFLAGS) -warn:3 !endif !else WARNINGS = -W3 !endif !if [nmakehlp.exe -f $(CHECKS) "64bit"] && [nmakehlp.exe -c -Wp64] !message *** Doing 64bit portability warnings WARNINGS = $(WARNINGS) -Wp64 !endif !endif #---------------------------------------------------------- # Set our defines now armed with our options. #---------------------------------------------------------- OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) -DSTDC_HEADERS !if $(TCL_MEM_DEBUG) OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG !endif !if $(TCL_COMPILE_DEBUG) OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS !endif !if $(TCL_THREADS) OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1 !if $(USE_THREAD_ALLOC) OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1 !endif !if $(USE_THREAD_STORAGE) OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_STORAGE=1 !endif !endif !if $(STATIC_BUILD) OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD !endif !if $(TCL_NO_DEPRECATED) OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED !endif !if $(DEBUG) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DEBUG !elseif $(OPTIMIZING) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED !endif !if $(PROFILE) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED !endif !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT !endif #---------------------------------------------------------- # Get common info used when building extensions. #---------------------------------------------------------- !if "$(PROJECT)" != "tcl" # If INSTALLDIR set to tcl root dir then reset to the lib dir. !if exist("$(_INSTALLDIR)\include\tcl.h") _INSTALLDIR=$(_INSTALLDIR)\lib !endif !if !defined(TCLDIR) !if exist("$(_INSTALLDIR)\..\include\tcl.h") TCLINSTALL = 1 _TCLDIR = $(_INSTALLDIR)\.. _TCL_H = $(_INSTALLDIR)\..\include\tcl.h TCLDIR = $(_INSTALLDIR)\.. !else MSG=^ Failed to find tcl.h. Set the TCLDIR macro. !error $(MSG) !endif !else _TCLDIR = $(TCLDIR:/=\) !if exist("$(_TCLDIR)\include\tcl.h") TCLINSTALL = 1 _TCL_H = $(_TCLDIR)\include\tcl.h !elseif exist("$(_TCLDIR)\generic\tcl.h") TCLINSTALL = 0 _TCL_H = $(_TCLDIR)\generic\tcl.h !else MSG =^ Failed to find tcl.h. The TCLDIR macro does not appear correct. !error $(MSG) !endif !endif !if [echo REM = This file is generated from rules.vc > version.vc] !endif !if exist("$(_TCL_H)") !if [echo TCL_DOTVERSION = \>> version.vc] \ && [nmakehlp.exe -V "$(_TCL_H)" TCL_VERSION >> version.vc] !endif !endif !include version.vc TCL_VERSION = $(TCL_DOTVERSION:.=) !if $(TCLINSTALL) TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe" !if !exist($(TCLSH)) && $(TCL_THREADS) TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX).exe" !endif TCLSTUBLIB = "$(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib" TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib" TCL_LIBRARY = $(_TCLDIR)\lib TCL_INCLUDES = -I"$(_TCLDIR)\include" !else TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe" !if !exist($(TCLSH)) && $(TCL_THREADS) TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX).exe" !endif TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib" TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib" TCL_LIBRARY = $(_TCLDIR)\library TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" !endif !endif #---------------------------------------------------------- # Optionally check for Tk info for building extensions. #---------------------------------------------------------- !ifdef PROJECT_REQUIRES_TK !if "$(PROJECT)" != "tcl" && "$(PROJECT)" != "tk" !if !defined(TKDIR) !if exist("$(_INSTALLDIR)\..\include\tk.h") TKINSTALL = 1 _TKDIR = $(_INSTALLDIR)\.. _TK_H = $(_TKDIR)\include\tk.h TKDIR = $(_TKDIR) !elseif exist("$(_TCLDIR)\include\tk.h") TKINSTALL = 1 _TKDIR = $(_TCLDIR) _TK_H = $(_TKDIR)\include\tk.h TKDIR = $(_TKDIR) !endif !else _TKDIR = $(TKDIR:/=\) !if exist("$(_TKDIR)\include\tk.h") TKINSTALL = 1 _TK_H = $(_TKDIR)\include\tk.h !elseif exist("$(_TKDIR)\generic\tk.h") TKINSTALL = 0 _TK_H = $(_TKDIR)\generic\tk.h !else MSG =^ Failed to find tk.h. The TKDIR macro does not appear correct. !error $(MSG) !endif !endif !if defined(TKDIR) TK_DOTVERSION = 8.4 !if exist("$(_TK_H)") !if [echo TK_DOTVERSION = \>> version.vc] \ && [nmakehlp.exe -V "$(_TK_H)" TK_VERSION >> version.vc] !endif !endif !include version.vc TK_VERSION = $(TK_DOTVERSION:.=) !if $(TKINSTALL) WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX).exe" !if !exist($(WISH)) && $(TCL_THREADS) WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)t$(SUFX).exe" !endif TKSTUBLIB = "$(_TKDIR)\lib\tkstub$(TK_VERSION).lib" TKIMPLIB = "$(_TKDIR)\lib\tk$(TK_VERSION)$(SUFX).lib" TK_INCLUDES = -I"$(_TKDIR)\include" TK_LIBRARY = $(_TKDIR)\lib !else WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX).exe" !if !exist($(WISH)) && $(TCL_THREADS) WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)t$(SUFX).exe" !endif TKSTUBLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib" TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX).lib" TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" TK_LIBRARY = $(_TKDIR)\library !endif !endif !endif !endif #---------------------------------------------------------- # Setup the fully qualified OUT_DIR path as OUT_DIR_PATH #---------------------------------------------------------- !if [echo OUT_DIR_PATH = \>> version.vc] \ && [nmakehlp.exe -Q "$(OUT_DIR)" >> version.vc] !endif !include version.vc #---------------------------------------------------------- # Display stats being used. #---------------------------------------------------------- !message *** Intermediate directory will be '$(TMP_DIR)' !message *** Output directory will be '$(OUT_DIR)' !message *** Suffix for binaries will be '$(SUFX)' !message *** Optional defines are '$(OPTDEFINES)' !message *** Compiler version $(VCVER). Target machine is $(MACHINE) !message *** Compiler options '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS) $(WARNINGS)' !message *** Link options '$(LINKERFLAGS)' !endif tclxml-3.3~svn11.orig/win/tclxml.rc0000644000000000000000000000204211215700771016033 0ustar rootroot// tclxml.rc - Copyright (c) 2009 Explain // Based on sample.rc - Copyright (C) 2006 Pat Thoyts // // There is no need to modify this file. // #include VS_VERSION_INFO VERSIONINFO FILEVERSION COMMAVERSION PRODUCTVERSION COMMAVERSION FILEFLAGSMASK 0x3fL #ifdef DEBUG FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0x0L #endif FILEOS VOS__WINDOWS32 FILETYPE VFT_DLL FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "TclXML Extension " DOTVERSION "\0" VALUE "OriginalFilename", "tclxml" VERSION ".dll\0" VALUE "CompanyName", "Explain\0" VALUE "FileVersion", DOTVERSION "\0" VALUE "LegalCopyright", "Copyright \251 2009 Explain.\0" VALUE "ProductName", "TclXML Extension " DOTVERSION "\0" VALUE "ProductVersion", DOTVERSION "\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END tclxml-3.3~svn11.orig/ANNOUNCE0000644000000000000000000000122511215700771014540 0ustar rootrootTclXML version 3.3 is now available. TclXML is a package that provides XML parsing for the Tcl scripting language. It has two implementations of XML parsers: one written purely in Tcl and a wrapper for the Gnome libxml2 C library. The TclXML package now incorporates the TclDOM and TclXSLT packages. TclDOM and TclXSLT were previously distributed as separate packages. The three packages may still be used as if they were standalone. Sources, and binaries for Mac OS X and MS Windows, are available now. These packages may be downloaded from the TclXML website: http://tclxml.sourceforge.net/ Enjoy, Steve Ball Explain http://www.explain.com.au/ tclxml-3.3~svn11.orig/aclocal.m40000755000000000000000000000022311113705304015241 0ustar rootroot# # Include the TEA standard macro set # builtin(include,tclconfig/tcl.m4) # # Add here whatever m4 macros you want to define for your package # tclxml-3.3~svn11.orig/TclxmlConfig.sh0000644000000000000000000000427511215700771016344 0ustar rootroot# tclxmlConfig.sh -- # # This shell script (for sh) is generated automatically by Tclxml's # configure script. It will create shell variables for most of # the configuration options discovered by the configure script. # This script is intended to be included by the configure scripts # for Tclxml extensions so that they don't have to figure this all # out for themselves. This file does not duplicate information # already provided by tclConfig.sh, so you may need to use that # file in addition to this one. # # The information in this file is specific to a single platform. # Tclxml's version number. Tclxml_VERSION='3.3' # The name of the Tclxml library (may be either a .a file or a shared library): Tclxml_LIB_FILE='libTclxml3.3.dylib' # String to pass to linker to pick up the Tclxml library from its # build directory. Tclxml_BUILD_LIB_SPEC='-L/Users/steve/Projects/tclxml-repos -lTclxml3.3' # String to pass to linker to pick up the Tclxml library from its # installed directory. Tclxml_LIB_SPEC='-L/usr/lib/Tclxml3.3 -lTclxml3.3' # The name of the Tclxml stub library (a .a file): Tclxml_STUB_LIB_FILE='libTclxmlstub3.3.a' # String to pass to linker to pick up the Tclxml stub library from its # build directory. Tclxml_BUILD_STUB_LIB_SPEC='-L/Users/steve/Projects/tclxml-repos -lTclxmlstub3.3' # String to pass to linker to pick up the Tclxml stub library from its # installed directory. Tclxml_STUB_LIB_SPEC='-L/usr/lib/Tclxml3.3 -lTclxmlstub3.3' # String to pass to linker to pick up the Tclxml stub library from its # build directory. Tclxml_BUILD_STUB_LIB_PATH='/Users/steve/Projects/tclxml-repos/' # String to pass to linker to pick up the Tclxml stub library from its # installed directory. Tclxml_STUB_LIB_PATH='/usr/lib/Tclxml3.3/' # String to pass to the compiler so that an extension can find # installed header. Tclxml_INCLUDE_SPEC='-I/usr/include' # Location of the top-level source directories from which [incr Tcl] # was built. This is the directory that contains generic, unix, etc. # If [incr Tcl] was compiled in a different place than the directory # containing the source files, this points to the location of the sources, # not the location where [incr Tcl] was compiled. Tclxml_SRC_DIR='.' tclxml-3.3~svn11.orig/Makefile.in0000755000000000000000000004435611117300450015462 0ustar rootroot# Makefile.in -- # # This file is a Makefile for Tclxml 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) 2007-2008 Explain/Packaged Press. # Copyright (c) 2004 Zveno Pty Ltd. # Copyright (c) 2002 ActiveState SRL. # Copyright (c) 1999 Scriptics 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.22 2005/05/20 12:02:01 balls Exp $ #======================================================================== # 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_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@ XML2_VERSION = @XML2_VERSION@ XML2_PREFIX = @XML2_PREFIX@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ XSLT_VERSION = @XSLT_VERSION@ XSLT_PREFIX = @XSLT_PREFIX@ XSLT_LIBS = @XSLT_LIBS@ XSLT_CFLAGS = @XSLT_CFLAGS@ XML_STATIC = @XML_STATIC@ FIX_LIB = @FIX_LIB@ #======================================================================== # "PKG_LIB_FILE" refers to the library (dynamic or static as per # configuration options) composed of the named objects. #======================================================================== 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@ datarootdir = @datarootdir@ 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@ 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) SHARED_BUILD = @SHARED_BUILD@ INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ #INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ PKG_CFLAGS = @PKG_CFLAGS@ $(XML2_CFLAGS) $(XSLT_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) # Move pkgIndex.tcl to 'BINARIES' var if it is generated in the Makefile CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl include/tclxml/tclxml.h CLEANFILES = @CLEANFILES@ CPPFLAGS = @CPPFLAGS@ LIBS = @PKG_LIBS@ @LIBS@ @XML2_LIBS@ @XSLT_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. #======================================================================== # Do not build the documentation by default, since it requires # additional dependencies that may not be installed. all: binaries libraries #======================================================================== # 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) 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: -$(TCLSH) doc/transform.tcl doc/tclxml.xml doc/html.xsl doc/tclxml.html -$(TCLSH) doc/transform.tcl doc/tclxml.xml doc/nroff.xsl doc/tclxml.n -$(TCLSH) doc/transform.tcl doc/tcldom.xml doc/html.xsl doc/tcldom.html -$(TCLSH) doc/transform.tcl doc/tcldom.xml doc/nroff.xsl doc/tcldom.n -$(TCLSH) doc/transform.tcl doc/tclxslt.xml doc/html.xsl doc/tclxslt.html -$(TCLSH) doc/transform.tcl doc/tclxslt.xml doc/nroff.xsl doc/tclxslt.n -$(TCLSH) doc/transform.tcl doc/README.xml doc/html.xsl README.html -$(TCLSH) doc/transform.tcl doc/README.xml doc/txt.xsl -o README # Do not install the documentation by default, # since it may not have been built (see above). install: all install-binaries install-libraries install-binaries: binaries install-lib-binaries install-bin-binaries if test "x$(SHARED_BUILD)" = "x1"; then \ $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ fi #======================================================================== # 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)/tclxml @echo "Installing header files in $(DESTDIR)$(includedir)/tclxml" @list='$(PKG_HEADERS)'; for i in $$list; do \ echo "Installing $(srcdir)/$$i" ; \ $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/tclxml ; \ done; @echo "libraries 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 testshell = $(TCLSH_PROG) $(srcdir)/testshell #test: binaries libraries # $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) # $(testshell) \ # -load 'load ./$(Tclxml_LIB_FILE)' \ # -testdir $(srcdir)/tea.tests test: test-tclxml test-tcldom test-tclxslt test-tclxml: (cd $(srcdir)/tests/tclxml; $(TCLSH) all.tcl) test-tcldom: (cd $(srcdir)/tests/tcldom; $(TCLSH) all.tcl) test-tclxslt: (cd $(srcdir)/tests/tclxslt; $(TCLSH) all.tcl) 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) $(FIX_LIB) $(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: # # Tclxml.$(OBJEXT): $(srcdir)/generic/Tclxml.c # $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/Tclxml.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)/generic:$(srcdir)/unix:$(srcdir)/win .c.@OBJEXT@: $(COMPILE) -c `@CYGPATH@ $<` -o $@ #======================================================================== # 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 doc mkdir -p $(DIST_DIR) cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/doc/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='htdocs/art demos generic library mac tests unix win tea.tests tools tools/rules'; \ for p in $$list; do \ if test -d $(srcdir)/$$p ; then \ mkdir -p $(DIST_DIR)/$$p; \ cp -p $(srcdir)/$$p/*.* $(srcdir)/$$p/* $(DIST_DIR)/$$p/; \ fi; \ done -list='doc'; \ for p in $$list; do \ if test -d $$p ; then \ mkdir -p $(DIST_DIR)/$$p; \ cp -p $$p/*.* $$p/* $(DIST_DIR)/$$p/; \ fi; \ done -mv $(DIST_DIR)/htdocs/art $(DIST_DIR)/doc/art rm -rf $(DIST_DIR)/htdocs (cd $(DIST_ROOT); $(COMPRESS);) dist_orig: rm -rf $(PKG_DIR)* ls -d $(srcdir)/* > __FILES mkdir $(PKG_DIR) cp -rf `cat __FILES | grep -v __FILES` $(PKG_DIR) rm __FILES find $(PKG_DIR) -name CVS -prune -exec rm -rf {} \; cd $(PKG_DIR) ; $(TCLSH_PROG) PREPARE -tar cf - $(PKG_DIR) | gzip --best > $(PKG_DIR).tar.gz -tar cf - $(PKG_DIR) | bzip2 > $(PKG_DIR).tar.bz2 -zip -r $(PKG_DIR).zip $(PKG_DIR) rm -rf $(PKG_DIR) release: autoconf #======================================================================== # 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: @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 \ s=`basename $$p`; \ echo " Install $$p $(DESTDIR)$(pkglibdir)/$$s"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$s; \ fi; \ done $(INSTALL_DATA) TclxmlConfig.sh $(DESTDIR)$(libdir) $(FIX_LIB) $(DESTDIR)$(pkglibdir)/$(PKG_LIB_FILE) #======================================================================== # 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: @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=`basenme $$p`; \ rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done list='$(bin_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/$$p; \ done #======================================================================== # # Target to regenerate header files and stub files from the *.decls tables. # #======================================================================== genstubs: $(TCLSH_PROG) \ $(srcdir)/tools/genStubs.tcl $(srcdir) \ $(srcdir)/tclxml.decls #======================================================================== # # Target to check that all exported functions have an entry in the stubs # tables. # #======================================================================== Tclxml_DECLS = \ $(srcdir)/tclxml.decls checkstubs: -@for i in `nm -p $(Tclxml_LIB_FILE) | awk '$$2 ~ /T/ { print $$3 }' \ | sort -n`; do \ match=0; \ for j in $(Tclxml_DECLS); do \ if [ `grep -c $$i $$j` -gt 0 ]; then \ match=1; \ fi; \ done; \ if [ $$match -eq 0 ]; then echo $$i; fi \ 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: tclxml-3.3~svn11.orig/tclxslt/0000755000000000000000000000000011574742533015116 5ustar rootroottclxml-3.3~svn11.orig/tclxslt/resources.tcl0000644000000000000000000001730611113705304017623 0ustar rootroot# resources.tcl -- # # XSLT extension providing access to resources. # # Copyright (c) 2005-2008 Explain # http://www.explain.com.au/ # Copyright (c) 2001-2004 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: resources.tcl,v 1.2 2005/11/04 06:41:56 balls Exp $ catch { package require base64 } package provide xslt::resources 1.3 namespace eval xslt::resources { namespace export list type exists modified } # xslt::resources::list -- # # List the resources available at a given location # # Arguments: # locn Resource path to list # basedir Base directory # args not needed # # Results: # Returns list of resources proc xslt::resources::list {locnNd {baseNd {}} args} { # What kind of resource is this? file, http, ftp, etc? if {[llength $args]} { return -code error "too many arguments" } set locn $locnNd # The resource may be passed in as a nodeset catch {set locn [dom::node stringValue [lindex $locnNd 0]]} set base $baseNd catch {set base [dom::node stringValue [lindex $baseNd 0]]} if {[string match /* $base]} { regsub {^(/)} $locn {} locn } set result {} foreach entry [glob -nocomplain [file join $base $locn *]] { lappend result [file tail $entry] } return $result } # xslt::resources::type -- # # Gives the type of the resource # # Arguments: # locn Resource path to type # args not needed # # Results: # Returns string describing resource proc xslt::resources::type {locnNd args} { if {[llength $args]} { return -code error "too many arguments" } set locn $locnNd catch {set locn [dom::node stringValue [lindex $locnNd 0]]} if {[file isdir $locn]} { return directory } elseif {[file isfile $locn]} { return file } else { return other } } # xslt::resources::exists -- # # Check whether a resource exists # # Arguments: # locn Resource path to type # args not needed # # Results: # Returns boolean proc xslt::resources::exists {locnNd args} { if {[llength $args]} { return -code error "too many arguments" } set locn $locnNd catch {set locn [dom::node stringValue [lindex $locnNd 0]]} if {[file exists $locn]} { return 1 } else { return 0 } } # xslt::resources::modified -- # # Report last modification time of a resource # # Arguments: # locn Resource path # args not needed # # Results: # Returns ISO standard date-time string proc xslt::resources::modified {locnNd args} { if {[llength $args]} { return -code error "too many arguments" } set locn $locnNd catch {set locn [dom::node stringValue [lindex $locnNd 0]]} if {[file exists $locn]} { return [clock format [file mtime $locn] -format {%Y-%m-%dT%H:%M:%S}] } else { return {} } } # xslt::resources::mkdir -- # # Create a directory hierarchy. # # Arguments: # locn Resource path for directory # args not needed # # Results: # Returns directory created or empty string if unsuccessful proc xslt::resources::mkdir {locnNd args} { if {[llength $args]} { return {} } set locn $locnNd catch {set locn [dom::node stringValue [lindex $locnNd 0]]} set dir [file split $locn] set current [lindex $dir 0] set remaining [lrange $dir 1 end] while {[llength $remaining]} { set current [file join $current [lindex $remaining 0]] set remaining [lrange $remaining 1 end] if {[file exists $current]} { if {![file isdir $current]} { return {} } } elseif {[file isdir $current]} { continue } else { if {[catch {file mkdir $current}]} { return {} } } } return $locn } # xslt::resources::copy -- # # Copy a resource. # # Arguments: # src Resource to copy # dest Destination for resource # args not needed # # Results: # Resource copied proc xslt::resources::copy {srcNd destNd args} { set src $srcNd catch {set src [dom::node stringValue [lindex $srcNd 0]]} set dest $destNd catch {set dest [dom::node stringValue [lindex $destNd 0]]} if {[catch {file copy -force $src $dest} msg]} { catch { package require log log::log error "copy failed due to \"$msg\"" } return 0 } else { return 1 } } # xslt::resources::move -- # # Move (rename) a resource. # # Arguments: # src Resource to move # dest Destination for resource # args not needed # # Results: # Resource renamed proc xslt::resources::move {srcNd destNd args} { set src $srcNd catch {set src [dom::node stringValue [lindex $srcNd 0]]} set dest $destNd catch {set dest [dom::node stringValue [lindex $destNd 0]]} if {[catch {file rename -force $src $dest}]} { return 0 } else { return 1 } } # xslt::resources::file-attributes -- # # Change attributes of a resource. # # Arguments: # src Resource to change # what Attribute to change # detail Attribute value # args not needed # # Results: # Resource attribute changed proc xslt::resources::file-set-attributes {srcNd whatNd detailNd args} { set src $srcNd catch {set src [dom::node stringValue [lindex $srcNd 0]]} set what $whatNd catch {set what [dom::node stringValue [lindex $whatNd 0]]} set detail $detailNd catch {set detail [dom::node stringValue [lindex $detailNd 0]]} if {[catch {file attributes $src -$what $detail} result]} { return {} } else { return $result } } # xslt::resources::delete -- # # Delete a resource # # Arguments: # locn Resource path to type # args not needed # # Results: # Returns boolean proc xslt::resources::delete {locnNd args} { if {[llength $args]} { return -code error "too many arguments" } set locn $locnNd catch {set locn [dom::node stringValue [lindex $locnNd 0]]} if {[catch {file delete -force $locn} msg]} { catch { package require log log::log error "delete failed due to \"$msg\"" } return 0 } else { return 1 } } # xslt::resources::link -- # # Link a resource. # # Arguments: # from Link to create # to Target of link # args not needed # # Results: # Symbolic link created proc xslt::resources::link {fromNd toNd args} { set from $fromNd catch {set from [dom::node stringValue [lindex $fromNd 0]]} set to $toNd catch {set to [dom::node stringValue [lindex $toNd 0]]} if {[catch {file link $from $to}]} { return 0 } else { return 1 } } # xslt::resources::write-base64 -- # # Decode base64 encoded data and write the binary data to a file # # Arguments: # fname Filename # b64 base64 encoded data # args not needed # # Results: # File opened for writing and binary data written. # Returns 1 if file successfully written, 0 otherwise. proc xslt::resources::write-base64 {fnameNd b64Nd args} { set fname $fnameNd catch {set fname [dom::node stringValue [lindex $fnameNd 0]]} set b64 $b64Nd catch {set b64 [dom::node stringValue [lindex $b64Nd 0]]} if {[catch {package require base64}]} { return 0 } if {[catch {open $fname w} ch]} { return 0 } else { set binarydata [base64::decode $b64] fconfigure $ch -trans binary -encoding binary puts -nonewline $ch $binarydata close $ch return 1 } } # xslt::resources::read-base64 -- # # Read binary data from a file and base64 encode it # # Arguments: # fname Filename # args not needed # # Results: # File opened for readng and contents read. # Returns content as base64-encoded data. proc xslt::resources::read-base64 {fnameNd args} { set fname $fnameNd catch {set fname [dom::node stringValue [lindex $fnameNd 0]]} if {[catch {package require base64}]} { return 0 } if {[catch {open $fname} ch]} { return 0 } else { fconfigure $ch -trans binary -encoding binary set binarydata [read $ch] close $ch return [base64::encode $binarydata] } } tclxml-3.3~svn11.orig/tclxslt/xsltcache.tcl0000644000000000000000000002143211215700771017570 0ustar rootroot# xsltcache.tcl -- # # Handles performing XSLT transformations, # caching documents and results. # # Copyright (c) 2005-2009 Steve Ball # http://www.packagedpress.com/staff/Steve.Ball # Copyright (c) 2002-2003 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: xsltcache.tcl,v 1.10 2005/11/04 06:41:56 balls Exp $ package require xslt 3.3 package require uri package provide xslt::cache 3.3 namespace eval xslt::cache { namespace export transform transformdoc flush namespace export parse_depend namespace export loadstylesheet variable sources array set sources {} variable stylesheets array set stylesheets {} variable results array set results {} } # xslt::cache::transform -- # # Perform an XSLT transformation. # # Arguments: # src Filename of source document # ssheet Filename of stylesheet document # args Configuration options, stylesheet parameters # # Results: # Result document token proc xslt::cache::transform {src ssheet args} { variable sources variable stylesheets variable results # Separate parameters from options set parameters {} set options {} foreach {key value} $args { switch -glob -- $key { -* { lappend options $key $value } default { lappend parameters $key $value } } } # Normalize the parameter list array set paramArray $parameters set parameters {} foreach name [lsort [array names paramArray]] { lappend parameters $name $paramArray($name) } set hash $src.$ssheet.$parameters array set opts { -xmlinclude 1 } array set opts $options set readSource [ReadXML $src -xmlinclude $opts(-xmlinclude)] set readStylesheet 1 if {[info exists stylesheets($ssheet)]} { if {[file mtime $ssheet] < $stylesheets($ssheet,time)} { set readStylesheet 0 } } if {$readStylesheet} { catch {rename $stylesheets($ssheet) {}} ReadXML $ssheet -xmlinclude $opts(-xmlinclude) set stylesheets($ssheet) [xslt::compile $sources($ssheet)] set stylesheets($ssheet,time) [clock seconds] } if {$readSource || $readStylesheet || ![info exists results($hash)]} { set results($hash) [eval [list $stylesheets($ssheet)] transform [list $sources($src)] $parameters] set results($hash,time) [clock seconds] } return $results($hash) } # xslt::cache::loadstylesheet -- # # Read, parse and compile an XSLT stylesheet. # # Arguments: # src Filename for the stylesheet document # args options # # Results: # Returns compiled stylesheet token. Adds reference to stylesheet to cache. proc xslt::cache::loadstylesheet {src args} { variable sources variable stylesheets array set options { -keepsource 0 -xmlinclude 0 } array set options $args eval ReadXML [list $src] [array get options -xmlinclude] set stylesheets($src) [xslt::compile $sources($src)] set stylesheets($src,time) [clock seconds] if {!$options(-keepsource)} { flush $src {} } # TODO: set command trace so that if the stylesheet is deleted # the cache is invalidated return $stylesheets($src) } # xslt::cache::ReadXML -- # # Internal proc to manage parsing a document. # Used for both source and stylesheet documents. # # Arguments: # src Filename of source document # args Configuration options # # Results: # Returns 1 if document was read. Returns 0 if document is cached. proc xslt::cache::ReadXML {src args} { variable sources array set opts { -xmlinclude 1 } array set opts $args set readSource 1 if {[info exists sources($src)]} { if {[file mtime $src] < $sources($src,time)} { set readSource 0 } } if {$readSource} { catch {dom::destroy $sources($src)} set ch [open $src] set sources($src) [dom::parse [read $ch] -baseuri file://$src] close $ch if {$opts(-xmlinclude)} { dom::xinclude $sources($src) } set sources($src,time) [clock seconds] } return $readSource } # xslt::cache::transformdoc -- # # Perform an XSLT transformation on a DOM document. # # Arguments: # src DOM token of source document # ssheet Filename of stylesheet document # args Configuration options, stylesheet parameters # # Results: # Result document token proc xslt::cache::transformdoc {src ssheet args} { variable sources variable stylesheets # Separate parameters from options set parameters {} set options {} foreach {key value} $args { switch -glob -- $key { -* { lappend options $key $value } default { lappend parameters $key $value } } } # Normalize the parameter list array set paramArray $parameters set parameters {} foreach name [lsort [array names paramArray]] { lappend parameters $name $paramArray($name) } array set opts { -xmlinclude 1 } array set opts $options set readStylesheet 1 if {[info exists stylesheets($ssheet)]} { if {[file mtime $ssheet] < $stylesheets($ssheet,time)} { set readStylesheet 0 } } if {$readStylesheet} { catch {rename $stylesheets($ssheet) {}} ReadXML $ssheet -xmlinclude $opts(-xmlinclude) set stylesheets($ssheet) [xslt::compile $sources($ssheet)] set stylesheets($ssheet,time) [clock seconds] } set result [eval [list $stylesheets($ssheet)] transform [list $src] $parameters] return $result } # ::xslt::cache::parse_depend -- # # Parse a document while determining its dependencies. # # Arguments: # uri Document's URI # depVar Global variable name for dependency document # # Results: # Returns parsed document token. # Document token for dependency document is stored in depVar. proc xslt::cache::parse_depend {uri depVar} { upvar #0 $depVar dep set dep [dom::create] dom::document createElement $dep dependencies array set uriParsed [uri::split $uri] switch -- $uriParsed(scheme) { file { set ch [open $uriParsed(path)] set doc [dom::parse [read $ch] -baseuri $uri -externalentitycommand [namespace code [list ParseDepend_Entity $depVar]]] close $ch ParseDepend_XInclude $doc $depVar ParseDepend_XSLT $doc $depVar } http { return -code error "URI scheme \"http\" not yet implemented" } dom { set doc $uriParsed(dom) # Can't determine external entities, but can find XInclude # and XSL stylesheet includes/imports. ParseDepend_XInclude $uriParsed(dom) $depVar ParseDepend_XSLT $uriParsed(dom) $depVar } default { return -code error "URI scheme \"$uriParsed(scheme)\" not supported" } } return $doc } # xslt::cache::ParseDepend_Entity -- # # Callback for external entity inclusion. # # Arguments: # depVar Global variable of dependency document # pubId Public identifier # sysId System identifier # # Results: # Dependency added to dependency document proc xslt::cache::ParseDepend_Entity {depVar pubId sysId} { upvar #0 $depVar dep dom::document createNode $dep /dependencies/external-entities/entity } # ::xslt::cache::flush -- # # Flush the cache # # Arguments: # src source document filename # ssheet stylesheet document filename # args parameters # # Results: # Returns the empty string. # If all arguments are given then all entries corresponding # to that transformation are destroyed. # If the source and/or stylesheet are given then all # entries corresponding to those documents are destroyed. proc xslt::cache::flush {src ssheet args} { variable sources variable stylesheets variable results # Normalize parameter list array set paramArray $args set parameters {} foreach name [lsort [array names paramArray]] { lappend parameters $name $paramArray($name) } set hash $src.$ssheet.$parameters switch -glob [string length $src],[string length $ssheet],[llength $args] { 0,0,* { # Special case: flush all unset sources array set sources {} unset stylesheets array set stylesheets {} unset results array set results {} } 0,*,0 { # Flush all entries for the given stylesheet catch {rename $stylesheets($ssheet) {}} catch {unset stylesheets($ssheet)} catch {unset stylesheets($ssheet,time)} foreach entry [array names results *.$ssheet.*] { catch {dom::destroy $results($entry)} catch {unset results($entry)} catch {unset results($entry,time)} } } *,0,0 { # Flush all entries for the given source document catch {dom::destroy $sources($src)} catch {unset sources($src)} catch {unset sources($src,time)} foreach entry [array names results $src.*] { catch {dom::destroy $results($entry)} catch {unset results($entry)} catch {unset results($entry,time)} } } default { # Flush specific entry catch {dom::destroy $results($hash)} catch {unset results($hash)} catch {unset results($hash,time)} } } } tclxml-3.3~svn11.orig/tclxslt/utilities.tcl0000644000000000000000000000611311113705304017616 0ustar rootroot# utilities.tcl -- # # Miscellaneous extension functions for XSLT. # # Copyright (c) 2007 Explain # http://www.explain.com.au/ # Copyright (c) 2004 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: utilities.tcl,v 1.1 2004/09/29 23:51:57 balls Exp $ package provide xslt::utilities 1.2 namespace eval xslt::utilities { namespace export character-first decode-base64 } # xslt::utilities::character-first -- # # Returns the character that occurs first from a string # of possible characters. # # Arguments: # src source string # chars characters to find # args not needed # # Results: # Returns a character or empty string. proc xslt::utilities::character-first {srcNd charsNd args} { if {[llength $args]} { return -code error "too many arguments" } set src $srcNd catch {set src [dom::node stringValue [lindex $srcNd 0]]} set chars $charsNd catch {set chars [dom::node stringValue [lindex $charsNd 0]]} regsub -all {([\\\[\]^$-])} $chars {\\\1} chars if {[regexp [format {([%s])} $chars] $src dummy theChar]} { return $theChar } return {} } # xslt::utilities::decode-base64 -- # # Returns decoded (binary) base64-encoded data. # # Arguments: # src source string # args not needed # # Results: # Returns binary data. proc xslt::utilities::decode-base64 {srcNd args} { if {[llength $args]} { return -code error "too many arguments" } if {[catch {package require base64}]} { return {} } set src $srcNd catch {set src [dom::node stringValue [lindex $srcNd 0]]} return [base64::decode $src] } # xslt::utilities::binary-document -- # # Writes binary data into a document # (this should be an extension element) # # Arguments: # fname filename # data binary data # args not needed # # Results: # File opened for writing and data written. # Returns 1 on success, 0 otherwise proc xslt::utilities::binary-document {fnameNd srcNd args} { if {[llength $args]} { return -code error "too many arguments" } set fname $fnameNd catch {set fname [dom::node stringValue [lindex $fnameNd 0]]} set data $dataNd catch {set data [dom::node stringValue [lindex $dataNd 0]]} if {[catch {open $fname w} ch]} { return 0 } fconfigure $ch -trans binary -encoding binary puts -nonewline $ch $data close $ch return 1 } # xslt::utilities::base64-binary-document -- # # Returns base64-encoded data from a file. # # Arguments: # fname filename # args not needed # # Results: # Returns text. Returns empty string on error. proc xslt::utilities::base64-binary-document {fnameNd args} { if {[llength $args]} { return -code error "too many arguments" } if {[catch {package require base64}]} { return {} } set fname $fnameNd catch {set fname [dom::node stringValue [lindex $fnameNd 0]]} if {[catch {open $fname} ch]} { return {} } fconfigure $ch -trans binary -encoding binary set data [read $ch] close $ch return [base64::encode $data] } tclxml-3.3~svn11.orig/tclxslt/process.tcl0000644000000000000000000001712511215700771017274 0ustar rootroot# process.tcl -- # # XSLT extension providing processing functions # # Copyright (c) 2007-2009 Packaged Press # http://www.packagedpress.com/ # Copyright (c) 2002-2004 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: process.tcl,v 1.1 2004/07/11 12:18:03 balls Exp $ package provide xslt::process 1.1 package require uri 1.1 package require xslt::cache 3.3 namespace eval xslt::process { namespace export transform fop namespace export transform-result namespace export dtd-valid } # Add support for the dom: URI scheme. # # This scheme allows a script to reference an in-memory DOM tree. proc ::uri::SplitDom url { return [list dom $url] } proc ::uri::JoinDom args { array set components { dom {} } array set components $args return dom:$components(dom) } # xslt::process::transform -- # # Perform an XSL Transformation. # # TODO: # Return messages # Cache source and stylesheet documents. # Generate dependency documents. # # Arguments: # src Location of source document # ssheet Location of stylesheet # result Location for result document # params Parameters (nodelist) # args not needed # # Results: # Returns empty string for success # This version forks a process proc xslt::process::transform_fork {src ssheet result {params {}} args} { if {[catch {exec tclxsltproc -config /Users/steve/scms/lib/config.tcl --xinclude -o $result $ssheet $src} out]} { return $out } else { return {} } } # This version performs the transformation in-process. proc xslt::process::transform:dbg {src ssheet result {params {}} args} { puts stderr [list process::transform $src $ssheet $result $params $args] if {[catch {eval transform:dbg [list $src $ssheet $result] $params $args} msg]} { puts stderr "\nprocess::transform returned error $msg\nStack trace:$::errorInfo\n" return -code error $msg } else { puts stderr [list process::transform ran OK] return $msg } } proc xslt::process::transform {srcNd ssheetNd resultNd {params {}} args} { # The filenames may be passed in as nodesets set src $srcNd catch {set src [dom::node stringValue [lindex $srcNd 0]]} set ssheet $ssheetNd catch {set ssheet [dom::node stringValue [lindex $ssheetNd 0]]} set result $resultNd catch {set result [dom::node stringValue [lindex $resultNd 0]]} # params will be a nodeset consisting of name/value pairs. # These must be converted to strings set parameterList {} switch [llength $params] { 1 { puts stderr [list xslt::process::transform params nodeType [dom::node cget $params -nodeType]] set pNdList [dom::node children $params] } default { set pNdList $params } } foreach paramNd $pNdList { set name [set value {}] foreach child [dom::node children $paramNd] { set nameNd [dom::node selectNode $child name] set name [dom::node stringValue $nameNd] set valueNd [dom::node selectNode $child value] set value [dom::node stringValue $valueNd] } if {[string compare $name {}]} { lappend parameterList $name $value } } puts stderr [list xslt::process::transform parameters: $parameterList] set cleanup {} if {[catch {open $src} ch]} { # eval $cleanup return "unable to open source document \"$src\" for reading due to \"$ch\"" } if {[catch {::dom::parse [read $ch] -baseuri $src} sourcedoc]} { # eval $cleanup return "unable to parse source document \"$src\" due to \"$sourcedoc\"" } close $ch append cleanup "dom::destroy $sourcedoc" \n dom::xinclude $sourcedoc if {[catch {open $ssheet} ch]} { eval $cleanup return "unable to open stylesheet document \"$ssheet\" for reading due to \"$ch\"" } if {[catch {::dom::parse [read $ch] -baseuri $ssheet} styledoc]} { eval $cleanup return "unable to parse stylesheet document \"$ssheet\" due to \"$styledoc\"" } close $ch append cleanup "dom::destroy $styledoc" \n if {[catch {xslt::compile $styledoc} style]} { eval $cleanup return "unable to compile stylesheet \"$ssheet\" due to \"$style\"" } append cleanup "rename $style {}" \n if {[catch {eval [list $style] transform [list $sourcedoc] $parameterList} resultdoc]} { eval $cleanup return "unable to transform document \"$src\" with stylesheet \"$ssheet\" due to \"$resultdoc\"" } append cleanup "dom::destroy $resultdoc" \n if {[catch {open $result w} ch]} { eval $cleanup return "unable to save result document \"$result\" due to \"$ch\"" } puts $ch [dom::serialize $resultdoc -method [$style cget -method]] close $ch catch { uplevel \#0 $cleanup } return {} } # xslt::process::transform-result -- # # Perform an XSL Transformation. # This version returns the result document. # # Arguments: # src Location of source document # ssheet Location of stylesheet # params Parameters (nodelist) # args not needed # # Results: # Returns result document. proc xslt::process::transform-result {srcNd ssheetNd {params {}} args} { # The filenames may be passed in as nodesets set src $srcNd catch {set src [dom::node stringValue [lindex $srcNd 0]]} set ssheet $ssheetNd catch {set ssheet [dom::node stringValue [lindex $ssheetNd 0]]} # params will be a nodeset consisting of name/value pairs. # These must be converted to strings set parameterList {} foreach paramNd $params { set name [set value {}] foreach child [dom::node children $paramNd] { set nameNd [dom::node selectNode $child name] set name [dom::node stringValue $nameNd] set valueNd [dom::node selectNode $child value] set value [dom::node stringValue $valueNd] } if {[string compare $name {}]} { lappend parameterList $name $value } } if {[catch {eval xslt::cache::transform [list $src $ssheet] $parameterList} rd]} { return "unable to perform transformation due to \"$rd\"" } return $rd } # xslt::process::checkwffdoc -- # # Test a document for well-formedness # # Arguments: # doc DOM token for document to check # args not needed # # Results: # Returns success message proc xslt::process::checkwffdoc {doc args} { return "of course it's well-formed, it's a DOM tree!" } # xslt::process::dtd-valid -- # # Test a document for (DTD) validity # # Arguments: # uri URI for document to check, supports dom: scheme # args not needed # # Results: # Returns success/failure message proc xslt::process::dtd-valid {uri args} { array set components [uri::split $uri] switch -- $components(scheme) { file { set ch [open $components(path)] set xmldata [read $ch] close $ch set doc [dom::parse $xmldata -baseuri $uri] set cleanup [list dom::destroy $doc] } dom { set doc $components(dom) set cleanup {} } default { # TODO: support http: scheme return -code error "unable to resolve entity $uri" } } if {[catch {dom::validate $doc} msg]} { set result $msg } else { set result {document is valid} } eval $cleanup return $result } # xslt::process::fop -- # # Format an XSL FO document using FOP # # Arguments: # fo Location of FO document # pdf Location for PDF document # params Parameters (nodelist) # args not needed # # Results: # Returns success message proc xslt::process::fop {fo pdf params args} { return "format fo $fo to produce $pdf" } # xslt::process::log -- # # Emit a log message. The application is expected to override this. # # Arguments: # msg Log message # args not needed # # Results: # None proc xslt::process::log {msg args} { Stderr Log:\ $msg return {} } tclxml-3.3~svn11.orig/tclxslt/tclxslt.tcl0000644000000000000000000000133111113705304017275 0ustar rootroot# tclxslt.tcl -- # # Tcl library for TclXSLT package. # # Copyright (c) 2001-2003 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: tclxslt.tcl,v 1.4 2003/12/09 04:57:35 balls Exp $ namespace eval xslt { namespace export getprocs } proc xslt::getprocs ns { set functions {} set elements {} foreach proc [info commands ${ns}::*] { if {[regexp {::([^:]+)$} $proc discard name]} { if {[string equal [lindex [info args $proc] end] "args"]} { lappend functions $name } else { lappend elements $name } } } return [list $elements $functions] } tclxml-3.3~svn11.orig/tcldom-libxml2.tcl0000644000000000000000000000136611113705304016744 0ustar rootroot# impl.tcl -- # # Support script for libxml2 implementation. # # Std disclaimer # # $Id: impl.tcl,v 1.4 2005/05/20 14:07:35 balls Exp $ namespace eval ::dom { variable strictDOM 1 } proc dom::libxml2::parse {xml args} { array set options { -keep normal -retainpath /* } array set options $args if {[catch {eval ::xml::parser -parser libxml2 [array get options]} parser]} { return -code error "unable to create XML parser due to \"$parser\"" } if {[catch {$parser parse $xml} msg]} { return -code error $msg } set doc [$parser get document] set dom [dom::libxml2::adoptdocument $doc] $parser free return $dom } proc dom::parse {xml args} { return [eval ::dom::libxml2::parse [list $xml] $args] } tclxml-3.3~svn11.orig/macosx/0000755000000000000000000000000011574742527014716 5ustar rootroottclxml-3.3~svn11.orig/macosx/Info-tclxml__Upgraded_.plist0000644000000000000000000000146611113705304022264 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable CFBundleGetInfoString TclXML v3.0 CFBundleIconFile CFBundleIdentifier com.zveno.tclxml CFBundleInfoDictionaryVersion 6.0 CFBundleName TclXML CFBundlePackageType FMWK CFBundleShortVersionString 3.0 CFBundleSignature ???? CFBundleVersion 3.1 tclxml-3.3~svn11.orig/macosx/Tclxml.xcodeproj/0000755000000000000000000000000011574742527020155 5ustar rootroottclxml-3.3~svn11.orig/macosx/Tclxml.xcodeproj/steve.mode10000644000000000000000000011333211113705304022212 0ustar rootroot ActivePerspectiveName Project AllowedModules BundleLoadPath MaxInstances n Module PBXSmartGroupTreeModule Name Groups and Files Outline View BundleLoadPath MaxInstances n Module PBXNavigatorGroup Name Editor BundleLoadPath MaxInstances n Module XCTaskListModule Name Task List BundleLoadPath MaxInstances n Module XCDetailModule Name File and Smart Group Detail Viewer BundleLoadPath MaxInstances 1 Module PBXBuildResultsModule Name Detailed Build Results Viewer BundleLoadPath MaxInstances 1 Module PBXProjectFindModule Name Project Batch Find Tool BundleLoadPath MaxInstances n Module PBXRunSessionModule Name Run Log BundleLoadPath MaxInstances n Module PBXBookmarksModule Name Bookmarks Tool BundleLoadPath MaxInstances n Module PBXClassBrowserModule Name Class Browser BundleLoadPath MaxInstances n Module PBXCVSModule Name Source Code Control Tool BundleLoadPath MaxInstances n Module PBXDebugBreakpointsModule Name Debug Breakpoints Tool BundleLoadPath MaxInstances n Module XCDockableInspector Name Inspector BundleLoadPath MaxInstances n Module PBXOpenQuicklyModule Name Open Quickly Tool BundleLoadPath MaxInstances 1 Module PBXDebugSessionModule Name Debugger BundleLoadPath MaxInstances 1 Module PBXDebugCLIModule Name Debug Console Description DefaultDescriptionKey DockingSystemVisible Extension mode1 FavBarConfig PBXProjectModuleGUID AA68C5AA0C902DA500D12438 XCBarModuleItemNames XCBarModuleItems FirstTimeWindowDisplayed Identifier com.apple.perspectives.project.mode1 MajorVersion 31 MinorVersion 1 Name Default Notifications OpenEditors PerspectiveWidths -1 -1 Perspectives ChosenToolbarItems active-target-popup action NSToolbarFlexibleSpaceItem buildOrClean build-and-runOrDebug com.apple.ide.PBXToolbarStopButton get-info toggle-editor NSToolbarFlexibleSpaceItem com.apple.pbx.toolbar.searchfield ControllerClassBaseName IconName WindowOfProjectWithEditor Identifier perspective.project IsVertical Layout BecomeActive ContentConfiguration PBXBottomSmartGroupGIDs 1C37FBAC04509CD000000102 1C37FAAC04509CD000000102 1C08E77C0454961000C914BD 1C37FABC05509CD000000102 1C37FABC05539CD112110102 E2644B35053B69B200211256 1C37FABC04509CD000100104 1CC0EA4004350EF90044410B 1CC0EA4004350EF90041110B PBXProjectModuleGUID 1CE0B1FE06471DED0097A5F4 PBXProjectModuleLabel Files PBXProjectStructureProvided yes PBXSmartGroupTreeModuleColumnData PBXSmartGroupTreeModuleColumnWidthsKey 212 PBXSmartGroupTreeModuleColumnsKey_v4 MainColumn PBXSmartGroupTreeModuleOutlineStateKey_v7 PBXSmartGroupTreeModuleOutlineStateExpansionKey 0867D691FE84028FC02AAC07 1C37FBAC04509CD000000102 AAF4A0890CBA19EA00B05FEF 1C37FABC05509CD000000102 PBXSmartGroupTreeModuleOutlineStateSelectionKey 18 12 10 PBXSmartGroupTreeModuleOutlineStateVisibleRectKey {{0, 0}, {212, 697}} PBXTopSmartGroupGIDs XCIncludePerspectivesSwitch XCSharingToken com.apple.Xcode.GFSharingToken GeometryConfiguration Frame {{0, 0}, {229, 715}} GroupTreeTableConfiguration MainColumn 212 RubberWindowFrame 1 66 771 756 0 0 1440 878 Module PBXSmartGroupTreeModule Proportion 229pt Dock ContentConfiguration PBXProjectModuleGUID 1CE0B20306471E060097A5F4 PBXProjectModuleLabel MyNewFile14.java PBXSplitModuleInNavigatorKey Split0 PBXProjectModuleGUID 1CE0B20406471E060097A5F4 PBXProjectModuleLabel MyNewFile14.java SplitCount 1 StatusBarVisibility GeometryConfiguration Frame {{0, 0}, {537, 0}} RubberWindowFrame 1 66 771 756 0 0 1440 878 Module PBXNavigatorGroup Proportion 0pt ContentConfiguration PBXProjectModuleGUID 1CE0B20506471E060097A5F4 PBXProjectModuleLabel Detail GeometryConfiguration Frame {{0, 5}, {537, 710}} RubberWindowFrame 1 66 771 756 0 0 1440 878 Module XCDetailModule Proportion 710pt Proportion 537pt Name Project ServiceClasses XCModuleDock PBXSmartGroupTreeModule XCModuleDock PBXNavigatorGroup XCDetailModule TableOfContents AAF4A08A0CBA1A0600B05FEF 1CE0B1FE06471DED0097A5F4 AAF4A08B0CBA1A0600B05FEF 1CE0B20306471E060097A5F4 1CE0B20506471E060097A5F4 ToolbarConfiguration xcode.toolbar.config.default ControllerClassBaseName IconName WindowOfProject Identifier perspective.morph IsVertical 0 Layout BecomeActive 1 ContentConfiguration PBXBottomSmartGroupGIDs 1C37FBAC04509CD000000102 1C37FAAC04509CD000000102 1C08E77C0454961000C914BD 1C37FABC05509CD000000102 1C37FABC05539CD112110102 E2644B35053B69B200211256 1C37FABC04509CD000100104 1CC0EA4004350EF90044410B 1CC0EA4004350EF90041110B PBXProjectModuleGUID 11E0B1FE06471DED0097A5F4 PBXProjectModuleLabel Files PBXProjectStructureProvided yes PBXSmartGroupTreeModuleColumnData PBXSmartGroupTreeModuleColumnWidthsKey 186 PBXSmartGroupTreeModuleColumnsKey_v4 MainColumn PBXSmartGroupTreeModuleOutlineStateKey_v7 PBXSmartGroupTreeModuleOutlineStateExpansionKey 29B97314FDCFA39411CA2CEA 1C37FABC05509CD000000102 PBXSmartGroupTreeModuleOutlineStateSelectionKey 0 PBXSmartGroupTreeModuleOutlineStateVisibleRectKey {{0, 0}, {186, 337}} PBXTopSmartGroupGIDs XCIncludePerspectivesSwitch 1 XCSharingToken com.apple.Xcode.GFSharingToken GeometryConfiguration Frame {{0, 0}, {203, 355}} GroupTreeTableConfiguration MainColumn 186 RubberWindowFrame 373 269 690 397 0 0 1440 878 Module PBXSmartGroupTreeModule Proportion 100% Name Morph PreferredWidth 300 ServiceClasses XCModuleDock PBXSmartGroupTreeModule TableOfContents 11E0B1FE06471DED0097A5F4 ToolbarConfiguration xcode.toolbar.config.default.short PerspectivesBarVisible ShelfIsVisible SourceDescription file at '/System/Library/PrivateFrameworks/DevToolsInterface.framework/Versions/A/Resources/XCPerspectivesSpecificationMode1.xcperspec' StatusbarIsVisible TimeStamp 0.0 ToolbarDisplayMode 1 ToolbarIsVisible ToolbarSizeMode 1 Type Perspectives UpdateMessage The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? WindowJustification 5 WindowOrderList /Users/steve/Projects/tclxml-3.2/macosx/Tclxml.xcodeproj AA68C7030C9103FD00D12438 WindowString 1 66 771 756 0 0 1440 878 WindowTools FirstTimeWindowDisplayed Identifier windowTool.build IsVertical Layout Dock ContentConfiguration PBXProjectModuleGUID 1CD0528F0623707200166675 PBXProjectModuleLabel StatusBarVisibility GeometryConfiguration Frame {{0, 0}, {586, 0}} RubberWindowFrame 697 202 586 676 0 0 1440 878 Module PBXNavigatorGroup Proportion 0pt BecomeActive ContentConfiguration PBXBuildLogShowsTranscriptDefaultKey {{0, 102}, {586, 528}} PBXProjectModuleGUID XCMainBuildResultsModuleGUID PBXProjectModuleLabel Build XCBuildResultsTrigger_Collapse 1021 XCBuildResultsTrigger_Open 1011 GeometryConfiguration Frame {{0, 5}, {586, 630}} RubberWindowFrame 697 202 586 676 0 0 1440 878 Module PBXBuildResultsModule Proportion 630pt Proportion 635pt Name Build Results ServiceClasses PBXBuildResultsModule StatusbarIsVisible TableOfContents AA68C7030C9103FD00D12438 AAF4A08E0CBA1A8B00B05FEF 1CD0528F0623707200166675 XCMainBuildResultsModuleGUID ToolbarConfiguration xcode.toolbar.config.build WindowString 697 202 586 676 0 0 1440 878 WindowToolGUID AA68C7030C9103FD00D12438 WindowToolIsVisible Identifier windowTool.debugger Layout Dock ContentConfiguration Debugger HorizontalSplitView _collapsingFrameDimension 0.0 _indexOfCollapsedView 0 _percentageOfCollapsedView 0.0 isCollapsed yes sizes {{0, 0}, {317, 164}} {{317, 0}, {377, 164}} VerticalSplitView _collapsingFrameDimension 0.0 _indexOfCollapsedView 0 _percentageOfCollapsedView 0.0 isCollapsed yes sizes {{0, 0}, {694, 164}} {{0, 164}, {694, 216}} LauncherConfigVersion 8 PBXProjectModuleGUID 1C162984064C10D400B95A72 PBXProjectModuleLabel Debug - GLUTExamples (Underwater) GeometryConfiguration DebugConsoleDrawerSize {100, 120} DebugConsoleVisible None DebugConsoleWindowFrame {{200, 200}, {500, 300}} DebugSTDIOWindowFrame {{200, 200}, {500, 300}} Frame {{0, 0}, {694, 380}} RubberWindowFrame 321 238 694 422 0 0 1440 878 Module PBXDebugSessionModule Proportion 100% Proportion 100% Name Debugger ServiceClasses PBXDebugSessionModule StatusbarIsVisible 1 TableOfContents 1CD10A99069EF8BA00B06720 1C0AD2AB069F1E9B00FABCE6 1C162984064C10D400B95A72 1C0AD2AC069F1E9B00FABCE6 ToolbarConfiguration xcode.toolbar.config.debug WindowString 321 238 694 422 0 0 1440 878 WindowToolGUID 1CD10A99069EF8BA00B06720 WindowToolIsVisible 0 Identifier windowTool.find Layout Dock Dock ContentConfiguration PBXProjectModuleGUID 1CDD528C0622207200134675 PBXProjectModuleLabel <No Editor> PBXSplitModuleInNavigatorKey Split0 PBXProjectModuleGUID 1CD0528D0623707200166675 SplitCount 1 StatusBarVisibility 1 GeometryConfiguration Frame {{0, 0}, {781, 167}} RubberWindowFrame 62 385 781 470 0 0 1440 878 Module PBXNavigatorGroup Proportion 781pt Proportion 50% BecomeActive 1 ContentConfiguration PBXProjectModuleGUID 1CD0528E0623707200166675 PBXProjectModuleLabel Project Find GeometryConfiguration Frame {{8, 0}, {773, 254}} RubberWindowFrame 62 385 781 470 0 0 1440 878 Module PBXProjectFindModule Proportion 50% Proportion 428pt Name Project Find ServiceClasses PBXProjectFindModule StatusbarIsVisible 1 TableOfContents 1C530D57069F1CE1000CFCEE 1C530D58069F1CE1000CFCEE 1C530D59069F1CE1000CFCEE 1CDD528C0622207200134675 1C530D5A069F1CE1000CFCEE 1CE0B1FE06471DED0097A5F4 1CD0528E0623707200166675 WindowString 62 385 781 470 0 0 1440 878 WindowToolGUID 1C530D57069F1CE1000CFCEE WindowToolIsVisible 0 Identifier MENUSEPARATOR Identifier windowTool.debuggerConsole Layout Dock BecomeActive 1 ContentConfiguration PBXProjectModuleGUID 1C78EAAC065D492600B07095 PBXProjectModuleLabel Debugger Console GeometryConfiguration Frame {{0, 0}, {440, 358}} RubberWindowFrame 650 41 440 400 0 0 1280 1002 Module PBXDebugCLIModule Proportion 358pt Proportion 358pt Name Debugger Console ServiceClasses PBXDebugCLIModule StatusbarIsVisible 1 TableOfContents 1C78EAAD065D492600B07095 1C78EAAE065D492600B07095 1C78EAAC065D492600B07095 WindowString 650 41 440 400 0 0 1280 1002 Identifier windowTool.run Layout Dock ContentConfiguration LauncherConfigVersion 3 PBXProjectModuleGUID 1CD0528B0623707200166675 PBXProjectModuleLabel Run Runner HorizontalSplitView _collapsingFrameDimension 0.0 _indexOfCollapsedView 0 _percentageOfCollapsedView 0.0 isCollapsed yes sizes {{0, 0}, {493, 167}} {{0, 176}, {493, 267}} VerticalSplitView _collapsingFrameDimension 0.0 _indexOfCollapsedView 0 _percentageOfCollapsedView 0.0 isCollapsed yes sizes {{0, 0}, {405, 443}} {{414, 0}, {514, 443}} GeometryConfiguration Frame {{0, 0}, {460, 159}} RubberWindowFrame 316 696 459 200 0 0 1280 1002 Module PBXRunSessionModule Proportion 159pt Proportion 159pt Name Run Log ServiceClasses PBXRunSessionModule StatusbarIsVisible 1 TableOfContents 1C0AD2B3069F1EA900FABCE6 1C0AD2B4069F1EA900FABCE6 1CD0528B0623707200166675 1C0AD2B5069F1EA900FABCE6 ToolbarConfiguration xcode.toolbar.config.run WindowString 316 696 459 200 0 0 1280 1002 WindowToolGUID 1C0AD2B3069F1EA900FABCE6 WindowToolIsVisible 0 Identifier windowTool.scm Layout Dock ContentConfiguration PBXProjectModuleGUID 1C78EAB2065D492600B07095 PBXProjectModuleLabel <No Editor> PBXSplitModuleInNavigatorKey Split0 PBXProjectModuleGUID 1C78EAB3065D492600B07095 SplitCount 1 StatusBarVisibility 1 GeometryConfiguration Frame {{0, 0}, {452, 0}} RubberWindowFrame 743 379 452 308 0 0 1280 1002 Module PBXNavigatorGroup Proportion 0pt BecomeActive 1 ContentConfiguration PBXProjectModuleGUID 1CD052920623707200166675 PBXProjectModuleLabel SCM GeometryConfiguration ConsoleFrame {{0, 259}, {452, 0}} Frame {{0, 7}, {452, 259}} RubberWindowFrame 743 379 452 308 0 0 1280 1002 TableConfiguration Status 30 FileName 199 Path 197.09500122070312 TableFrame {{0, 0}, {452, 250}} Module PBXCVSModule Proportion 262pt Proportion 266pt Name SCM ServiceClasses PBXCVSModule StatusbarIsVisible 1 TableOfContents 1C78EAB4065D492600B07095 1C78EAB5065D492600B07095 1C78EAB2065D492600B07095 1CD052920623707200166675 ToolbarConfiguration xcode.toolbar.config.scm WindowString 743 379 452 308 0 0 1280 1002 Identifier windowTool.breakpoints IsVertical 0 Layout Dock BecomeActive 1 ContentConfiguration PBXBottomSmartGroupGIDs 1C77FABC04509CD000000102 PBXProjectModuleGUID 1CE0B1FE06471DED0097A5F4 PBXProjectModuleLabel Files PBXProjectStructureProvided no PBXSmartGroupTreeModuleColumnData PBXSmartGroupTreeModuleColumnWidthsKey 168 PBXSmartGroupTreeModuleColumnsKey_v4 MainColumn PBXSmartGroupTreeModuleOutlineStateKey_v7 PBXSmartGroupTreeModuleOutlineStateExpansionKey 1C77FABC04509CD000000102 PBXSmartGroupTreeModuleOutlineStateSelectionKey 0 PBXSmartGroupTreeModuleOutlineStateVisibleRectKey {{0, 0}, {168, 350}} PBXTopSmartGroupGIDs XCIncludePerspectivesSwitch 0 GeometryConfiguration Frame {{0, 0}, {185, 368}} GroupTreeTableConfiguration MainColumn 168 RubberWindowFrame 315 424 744 409 0 0 1440 878 Module PBXSmartGroupTreeModule Proportion 185pt ContentConfiguration PBXProjectModuleGUID 1CA1AED706398EBD00589147 PBXProjectModuleLabel Detail GeometryConfiguration Frame {{190, 0}, {554, 368}} RubberWindowFrame 315 424 744 409 0 0 1440 878 Module XCDetailModule Proportion 554pt Proportion 368pt MajorVersion 2 MinorVersion 0 Name Breakpoints ServiceClasses PBXSmartGroupTreeModule XCDetailModule StatusbarIsVisible 1 TableOfContents 1CDDB66807F98D9800BB5817 1CDDB66907F98D9800BB5817 1CE0B1FE06471DED0097A5F4 1CA1AED706398EBD00589147 ToolbarConfiguration xcode.toolbar.config.breakpoints WindowString 315 424 744 409 0 0 1440 878 WindowToolGUID 1CDDB66807F98D9800BB5817 WindowToolIsVisible 1 Identifier windowTool.debugAnimator Layout Dock Module PBXNavigatorGroup Proportion 100% Proportion 100% Name Debug Visualizer ServiceClasses PBXNavigatorGroup StatusbarIsVisible 1 ToolbarConfiguration xcode.toolbar.config.debugAnimator WindowString 100 100 700 500 0 0 1280 1002 Identifier windowTool.bookmarks Layout Dock Module PBXBookmarksModule Proportion 100% Proportion 100% Name Bookmarks ServiceClasses PBXBookmarksModule StatusbarIsVisible 0 WindowString 538 42 401 187 0 0 1280 1002 Identifier windowTool.classBrowser Layout Dock BecomeActive 1 ContentConfiguration OptionsSetName Hierarchy, all classes PBXProjectModuleGUID 1CA6456E063B45B4001379D8 PBXProjectModuleLabel Class Browser - NSObject GeometryConfiguration ClassesFrame {{0, 0}, {374, 96}} ClassesTreeTableConfiguration PBXClassNameColumnIdentifier 208 PBXClassBookColumnIdentifier 22 Frame {{0, 0}, {630, 331}} MembersFrame {{0, 105}, {374, 395}} MembersTreeTableConfiguration PBXMemberTypeIconColumnIdentifier 22 PBXMemberNameColumnIdentifier 216 PBXMemberTypeColumnIdentifier 97 PBXMemberBookColumnIdentifier 22 PBXModuleWindowStatusBarHidden2 1 RubberWindowFrame 385 179 630 352 0 0 1440 878 Module PBXClassBrowserModule Proportion 332pt Proportion 332pt Name Class Browser ServiceClasses PBXClassBrowserModule StatusbarIsVisible 0 TableOfContents 1C0AD2AF069F1E9B00FABCE6 1C0AD2B0069F1E9B00FABCE6 1CA6456E063B45B4001379D8 ToolbarConfiguration xcode.toolbar.config.classbrowser WindowString 385 179 630 352 0 0 1440 878 WindowToolGUID 1C0AD2AF069F1E9B00FABCE6 WindowToolIsVisible 0 tclxml-3.3~svn11.orig/macosx/Tclxml.xcodeproj/project.pbxproj0000644000000000000000000007626011215700771023227 0ustar rootroot// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 42; objects = { /* Begin PBXAggregateTarget section */ AA68C6640C90EA8700D12438 /* configure */ = { isa = PBXAggregateTarget; buildConfigurationList = AA68C6670C90EAB000D12438 /* Build configuration list for PBXAggregateTarget "configure" */; buildPhases = ( AA68C6630C90EA8700D12438 /* ShellScript */, ); dependencies = ( ); name = configure; productName = configure; }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ AA13408D0CACF8FA006C8E84 /* pkgIndex.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA13408C0CACF8FA006C8E84 /* pkgIndex.tcl */; }; AA1340B30CB49786006C8E84 /* tclxslt.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA1340B20CB49786006C8E84 /* tclxslt.tcl */; }; AA68C5CA0C90302900D12438 /* libxml.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA68C5C90C90302900D12438 /* libxml.framework */; }; AA68C5CD0C90304400D12438 /* libxslt.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA68C5CC0C90304400D12438 /* libxslt.framework */; }; AA68C5D00C90305E00D12438 /* libexslt.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA68C5CF0C90305E00D12438 /* libexslt.framework */; }; AA68C5D30C9031C400D12438 /* tclxml.c in Sources */ = {isa = PBXBuildFile; fileRef = AA68C5D20C9031C400D12438 /* tclxml.c */; }; AA68C5D50C9031EA00D12438 /* tclxml.h in Headers */ = {isa = PBXBuildFile; fileRef = AA68C5D40C9031EA00D12438 /* tclxml.h */; settings = {ATTRIBUTES = (Public, ); }; }; AA68C5E60C9032E400D12438 /* sgml-8.0.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C5DC0C9032E400D12438 /* sgml-8.0.tcl */; }; AA68C5E70C9032E400D12438 /* sgml-8.1.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C5DD0C9032E400D12438 /* sgml-8.1.tcl */; }; AA68C5E80C9032E400D12438 /* sgmlparser.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C5DE0C9032E400D12438 /* sgmlparser.tcl */; }; AA68C5E90C9032E400D12438 /* tclparser-8.0.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C5DF0C9032E400D12438 /* tclparser-8.0.tcl */; }; AA68C5EA0C9032E400D12438 /* tclparser-8.1.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C5E00C9032E400D12438 /* tclparser-8.1.tcl */; }; AA68C5EB0C9032E400D12438 /* xml__tcl.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C5E10C9032E400D12438 /* xml__tcl.tcl */; }; AA68C5EC0C9032E400D12438 /* xml-8.0.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C5E20C9032E400D12438 /* xml-8.0.tcl */; }; AA68C5ED0C9032E400D12438 /* xml-8.1.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C5E30C9032E400D12438 /* xml-8.1.tcl */; }; AA68C5EE0C9032E400D12438 /* xmldep.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C5E40C9032E400D12438 /* xmldep.tcl */; }; AA68C5EF0C9032E400D12438 /* xpath.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C5E50C9032E400D12438 /* xpath.tcl */; }; AA68C5F10C90331D00D12438 /* tclxml-libxml2.c in Sources */ = {isa = PBXBuildFile; fileRef = AA68C5F00C90331D00D12438 /* tclxml-libxml2.c */; }; AA68C5F30C90332A00D12438 /* docObj.c in Sources */ = {isa = PBXBuildFile; fileRef = AA68C5F20C90332A00D12438 /* docObj.c */; }; AA68C5F50C90333E00D12438 /* docObj.h in Headers */ = {isa = PBXBuildFile; fileRef = AA68C5F40C90333E00D12438 /* docObj.h */; settings = {ATTRIBUTES = (Public, ); }; }; AA68C5F70C90334D00D12438 /* tclxml-libxml2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA68C5F60C90334D00D12438 /* tclxml-libxml2.h */; settings = {ATTRIBUTES = (Public, ); }; }; AA68C5F90C90336200D12438 /* tcldom.h in Headers */ = {isa = PBXBuildFile; fileRef = AA68C5F80C90336200D12438 /* tcldom.h */; settings = {ATTRIBUTES = (Public, ); }; }; AA68C5FB0C90337C00D12438 /* tcldom-libxml2.c in Sources */ = {isa = PBXBuildFile; fileRef = AA68C5FA0C90337C00D12438 /* tcldom-libxml2.c */; }; AA68C5FD0C90338B00D12438 /* nodeObj.c in Sources */ = {isa = PBXBuildFile; fileRef = AA68C5FC0C90338B00D12438 /* nodeObj.c */; }; AA68C6000C90339C00D12438 /* nodeObj.h in Headers */ = {isa = PBXBuildFile; fileRef = AA68C5FE0C90339C00D12438 /* nodeObj.h */; settings = {ATTRIBUTES = (Public, ); }; }; AA68C6010C90339C00D12438 /* tcldom-libxml2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA68C5FF0C90339C00D12438 /* tcldom-libxml2.h */; settings = {ATTRIBUTES = (Public, ); }; }; AA68C6030C9033AC00D12438 /* tcldom-libxml2.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C6020C9033AC00D12438 /* tcldom-libxml2.tcl */; }; AA68C6050C9033C900D12438 /* tclxslt.h in Headers */ = {isa = PBXBuildFile; fileRef = AA68C6040C9033C900D12438 /* tclxslt.h */; settings = {ATTRIBUTES = (Public, ); }; }; AA68C6070C9033E300D12438 /* tclxslt-libxslt.c in Sources */ = {isa = PBXBuildFile; fileRef = AA68C6060C9033E300D12438 /* tclxslt-libxslt.c */; }; AA68C6090C9033F300D12438 /* tclxslt-libxslt.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C6080C9033F300D12438 /* tclxslt-libxslt.tcl */; }; AA68C60E0C90340D00D12438 /* process.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C60A0C90340D00D12438 /* process.tcl */; }; AA68C60F0C90340D00D12438 /* resources.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C60B0C90340D00D12438 /* resources.tcl */; }; AA68C6100C90340D00D12438 /* utilities.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C60C0C90340D00D12438 /* utilities.tcl */; }; AA68C6110C90340D00D12438 /* xsltcache.tcl in Resources */ = {isa = PBXBuildFile; fileRef = AA68C60D0C90340D00D12438 /* xsltcache.tcl */; }; AA68C6F60C91035400D12438 /* Tclxml-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = AA68C6F50C91035400D12438 /* Tclxml-Info.plist */; }; AAE9DF4E0DBFE1EB00A29434 /* Tcl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AAE9DF4D0DBFE1EB00A29434 /* Tcl.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ AA68C6650C90EA9200D12438 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; proxyType = 1; remoteGlobalIDString = AA68C6640C90EA8700D12438; remoteInfo = configure; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 8DC2EF5B0486A6940098B216 /* Tclxml.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Tclxml.framework; sourceTree = BUILT_PRODUCTS_DIR; }; AA13408C0CACF8FA006C8E84 /* pkgIndex.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = pkgIndex.tcl; path = ../pkgIndex.tcl; sourceTree = SOURCE_ROOT; }; AA1340B20CB49786006C8E84 /* tclxslt.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = tclxslt.tcl; path = ../tclxslt/tclxslt.tcl; sourceTree = SOURCE_ROOT; }; AA68C5C90C90302900D12438 /* libxml.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libxml.framework; path = ../Release/libxml.framework; sourceTree = BUILT_PRODUCTS_DIR; }; AA68C5CC0C90304400D12438 /* libxslt.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libxslt.framework; path = ../Release/libxslt.framework; sourceTree = BUILT_PRODUCTS_DIR; }; AA68C5CF0C90305E00D12438 /* libexslt.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libexslt.framework; path = ../Release/libexslt.framework; sourceTree = BUILT_PRODUCTS_DIR; }; AA68C5D20C9031C400D12438 /* tclxml.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = tclxml.c; path = ../tclxml.c; sourceTree = SOURCE_ROOT; }; AA68C5D40C9031EA00D12438 /* tclxml.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = tclxml.h; path = ../include/tclxml/tclxml.h; sourceTree = SOURCE_ROOT; }; AA68C5DC0C9032E400D12438 /* sgml-8.0.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "sgml-8.0.tcl"; path = "../tclxml-tcl/sgml-8.0.tcl"; sourceTree = SOURCE_ROOT; }; AA68C5DD0C9032E400D12438 /* sgml-8.1.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "sgml-8.1.tcl"; path = "../tclxml-tcl/sgml-8.1.tcl"; sourceTree = SOURCE_ROOT; }; AA68C5DE0C9032E400D12438 /* sgmlparser.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = sgmlparser.tcl; path = "../tclxml-tcl/sgmlparser.tcl"; sourceTree = SOURCE_ROOT; }; AA68C5DF0C9032E400D12438 /* tclparser-8.0.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "tclparser-8.0.tcl"; path = "../tclxml-tcl/tclparser-8.0.tcl"; sourceTree = SOURCE_ROOT; }; AA68C5E00C9032E400D12438 /* tclparser-8.1.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "tclparser-8.1.tcl"; path = "../tclxml-tcl/tclparser-8.1.tcl"; sourceTree = SOURCE_ROOT; }; AA68C5E10C9032E400D12438 /* xml__tcl.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = xml__tcl.tcl; path = "../tclxml-tcl/xml__tcl.tcl"; sourceTree = SOURCE_ROOT; }; AA68C5E20C9032E400D12438 /* xml-8.0.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "xml-8.0.tcl"; path = "../tclxml-tcl/xml-8.0.tcl"; sourceTree = SOURCE_ROOT; }; AA68C5E30C9032E400D12438 /* xml-8.1.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "xml-8.1.tcl"; path = "../tclxml-tcl/xml-8.1.tcl"; sourceTree = SOURCE_ROOT; }; AA68C5E40C9032E400D12438 /* xmldep.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = xmldep.tcl; path = "../tclxml-tcl/xmldep.tcl"; sourceTree = SOURCE_ROOT; }; AA68C5E50C9032E400D12438 /* xpath.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = xpath.tcl; path = "../tclxml-tcl/xpath.tcl"; sourceTree = SOURCE_ROOT; }; AA68C5F00C90331D00D12438 /* tclxml-libxml2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = "tclxml-libxml2.c"; path = "../tclxml-libxml2.c"; sourceTree = SOURCE_ROOT; }; AA68C5F20C90332A00D12438 /* docObj.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = docObj.c; path = ../docObj.c; sourceTree = SOURCE_ROOT; }; AA68C5F40C90333E00D12438 /* docObj.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = docObj.h; path = "../include/tclxml-libxml2/docObj.h"; sourceTree = SOURCE_ROOT; }; AA68C5F60C90334D00D12438 /* tclxml-libxml2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "tclxml-libxml2.h"; path = "../include/tclxml-libxml2/tclxml-libxml2.h"; sourceTree = SOURCE_ROOT; }; AA68C5F80C90336200D12438 /* tcldom.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = tcldom.h; path = ../include/tcldom/tcldom.h; sourceTree = SOURCE_ROOT; }; AA68C5FA0C90337C00D12438 /* tcldom-libxml2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = "tcldom-libxml2.c"; path = "../tcldom-libxml2.c"; sourceTree = SOURCE_ROOT; }; AA68C5FC0C90338B00D12438 /* nodeObj.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = nodeObj.c; path = ../nodeObj.c; sourceTree = SOURCE_ROOT; }; AA68C5FE0C90339C00D12438 /* nodeObj.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = nodeObj.h; path = "../include/tcldom-libxml2/nodeObj.h"; sourceTree = SOURCE_ROOT; }; AA68C5FF0C90339C00D12438 /* tcldom-libxml2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "tcldom-libxml2.h"; path = "../include/tcldom-libxml2/tcldom-libxml2.h"; sourceTree = SOURCE_ROOT; }; AA68C6020C9033AC00D12438 /* tcldom-libxml2.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "tcldom-libxml2.tcl"; path = "../tcldom-libxml2.tcl"; sourceTree = SOURCE_ROOT; }; AA68C6040C9033C900D12438 /* tclxslt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = tclxslt.h; path = ../include/tclxslt/tclxslt.h; sourceTree = SOURCE_ROOT; }; AA68C6060C9033E300D12438 /* tclxslt-libxslt.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = "tclxslt-libxslt.c"; path = "../tclxslt-libxslt.c"; sourceTree = SOURCE_ROOT; }; AA68C6080C9033F300D12438 /* tclxslt-libxslt.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "tclxslt-libxslt.tcl"; path = "../tclxslt-libxslt.tcl"; sourceTree = SOURCE_ROOT; }; AA68C60A0C90340D00D12438 /* process.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = process.tcl; path = ../tclxslt/process.tcl; sourceTree = SOURCE_ROOT; }; AA68C60B0C90340D00D12438 /* resources.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = resources.tcl; path = ../tclxslt/resources.tcl; sourceTree = SOURCE_ROOT; }; AA68C60C0C90340D00D12438 /* utilities.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = utilities.tcl; path = ../tclxslt/utilities.tcl; sourceTree = SOURCE_ROOT; }; AA68C60D0C90340D00D12438 /* xsltcache.tcl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = xsltcache.tcl; path = ../tclxslt/xsltcache.tcl; sourceTree = SOURCE_ROOT; }; AA68C6F50C91035400D12438 /* Tclxml-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "Tclxml-Info.plist"; sourceTree = SOURCE_ROOT; }; AAE9DF4D0DBFE1EB00A29434 /* Tcl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Tcl.framework; path = ../../../Library/Frameworks/Tcl.framework; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 8DC2EF560486A6940098B216 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( AA68C5CA0C90302900D12438 /* libxml.framework in Frameworks */, AA68C5CD0C90304400D12438 /* libxslt.framework in Frameworks */, AA68C5D00C90305E00D12438 /* libexslt.framework in Frameworks */, AAE9DF4E0DBFE1EB00A29434 /* Tcl.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 034768DFFF38A50411DB9C8B /* Products */ = { isa = PBXGroup; children = ( AA68C6F50C91035400D12438 /* Tclxml-Info.plist */, 8DC2EF5B0486A6940098B216 /* Tclxml.framework */, ); name = Products; sourceTree = ""; }; 0867D691FE84028FC02AAC07 /* Tclxml */ = { isa = PBXGroup; children = ( AA68C57F0C902A1700D12438 /* TclXML */, AA68C58B0C902A4800D12438 /* TclXML-tcl */, AA68C5880C902A3C00D12438 /* TclXML-libxml2 */, AA68C5820C902A2000D12438 /* TclDOM */, AA68C58E0C902A5500D12438 /* TclDOM-libxml2 */, AA68C5850C902A2700D12438 /* TclXSLT */, AA68C5920C902A6C00D12438 /* TclXSLT-libxslt */, 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */, 034768DFFF38A50411DB9C8B /* Products */, ); name = Tclxml; sourceTree = ""; }; 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = { isa = PBXGroup; children = ( 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */, ); name = "External Frameworks and Libraries"; sourceTree = ""; }; 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( AAE9DF4D0DBFE1EB00A29434 /* Tcl.framework */, AA68C5CF0C90305E00D12438 /* libexslt.framework */, AA68C5CC0C90304400D12438 /* libxslt.framework */, AA68C5C90C90302900D12438 /* libxml.framework */, ); name = "Linked Frameworks"; sourceTree = ""; }; AA68C57F0C902A1700D12438 /* TclXML */ = { isa = PBXGroup; children = ( AA68C5950C902D0A00D12438 /* Sources */, AA68C5980C902D1300D12438 /* Headers */, AA68C59B0C902D2D00D12438 /* Scripts */, ); name = TclXML; sourceTree = ""; }; AA68C5820C902A2000D12438 /* TclDOM */ = { isa = PBXGroup; children = ( AA68C5B00C902F0200D12438 /* Headers */, AA68C5AD0C902EF800D12438 /* Scripts */, ); name = TclDOM; sourceTree = ""; }; AA68C5850C902A2700D12438 /* TclXSLT */ = { isa = PBXGroup; children = ( AA68C5BF0C902F3600D12438 /* Headers */, AA68C5BC0C902F2D00D12438 /* Scripts */, ); name = TclXSLT; sourceTree = ""; }; AA68C5880C902A3C00D12438 /* TclXML-libxml2 */ = { isa = PBXGroup; children = ( AA68C5A70C902D8C00D12438 /* Sources */, AA68C5A40C902D8400D12438 /* Headers */, AA68C5A10C902D7D00D12438 /* Scripts */, ); name = "TclXML-libxml2"; sourceTree = ""; }; AA68C58B0C902A4800D12438 /* TclXML-tcl */ = { isa = PBXGroup; children = ( AA68C59E0C902D3800D12438 /* Scripts */, ); name = "TclXML-tcl"; sourceTree = ""; }; AA68C58E0C902A5500D12438 /* TclDOM-libxml2 */ = { isa = PBXGroup; children = ( AA68C5B90C902F1D00D12438 /* Sources */, AA68C5B60C902F1500D12438 /* Headers */, AA68C5B30C902F0E00D12438 /* Scripts */, ); name = "TclDOM-libxml2"; sourceTree = ""; }; AA68C5920C902A6C00D12438 /* TclXSLT-libxslt */ = { isa = PBXGroup; children = ( AA68C5C80C902F5400D12438 /* Sources */, AA68C5C50C902F4900D12438 /* Headers */, AA68C5C20C902F4100D12438 /* Scripts */, ); name = "TclXSLT-libxslt"; sourceTree = ""; }; AA68C5950C902D0A00D12438 /* Sources */ = { isa = PBXGroup; children = ( AA68C5D20C9031C400D12438 /* tclxml.c */, ); name = Sources; sourceTree = ""; }; AA68C5980C902D1300D12438 /* Headers */ = { isa = PBXGroup; children = ( AA68C5D40C9031EA00D12438 /* tclxml.h */, ); name = Headers; sourceTree = ""; }; AA68C59B0C902D2D00D12438 /* Scripts */ = { isa = PBXGroup; children = ( AA13408C0CACF8FA006C8E84 /* pkgIndex.tcl */, ); name = Scripts; sourceTree = ""; }; AA68C59E0C902D3800D12438 /* Scripts */ = { isa = PBXGroup; children = ( AA68C5DC0C9032E400D12438 /* sgml-8.0.tcl */, AA68C5DD0C9032E400D12438 /* sgml-8.1.tcl */, AA68C5DE0C9032E400D12438 /* sgmlparser.tcl */, AA68C5DF0C9032E400D12438 /* tclparser-8.0.tcl */, AA68C5E00C9032E400D12438 /* tclparser-8.1.tcl */, AA68C5E10C9032E400D12438 /* xml__tcl.tcl */, AA68C5E20C9032E400D12438 /* xml-8.0.tcl */, AA68C5E30C9032E400D12438 /* xml-8.1.tcl */, AA68C5E40C9032E400D12438 /* xmldep.tcl */, AA68C5E50C9032E400D12438 /* xpath.tcl */, ); name = Scripts; sourceTree = ""; }; AA68C5A10C902D7D00D12438 /* Scripts */ = { isa = PBXGroup; children = ( ); name = Scripts; sourceTree = ""; }; AA68C5A40C902D8400D12438 /* Headers */ = { isa = PBXGroup; children = ( AA68C5F60C90334D00D12438 /* tclxml-libxml2.h */, AA68C5F40C90333E00D12438 /* docObj.h */, ); name = Headers; sourceTree = ""; }; AA68C5A70C902D8C00D12438 /* Sources */ = { isa = PBXGroup; children = ( AA68C5F20C90332A00D12438 /* docObj.c */, AA68C5F00C90331D00D12438 /* tclxml-libxml2.c */, ); name = Sources; sourceTree = ""; }; AA68C5AD0C902EF800D12438 /* Scripts */ = { isa = PBXGroup; children = ( ); name = Scripts; sourceTree = ""; }; AA68C5B00C902F0200D12438 /* Headers */ = { isa = PBXGroup; children = ( AA68C5F80C90336200D12438 /* tcldom.h */, ); name = Headers; sourceTree = ""; }; AA68C5B30C902F0E00D12438 /* Scripts */ = { isa = PBXGroup; children = ( AA68C6020C9033AC00D12438 /* tcldom-libxml2.tcl */, ); name = Scripts; sourceTree = ""; }; AA68C5B60C902F1500D12438 /* Headers */ = { isa = PBXGroup; children = ( AA68C5FE0C90339C00D12438 /* nodeObj.h */, AA68C5FF0C90339C00D12438 /* tcldom-libxml2.h */, ); name = Headers; sourceTree = ""; }; AA68C5B90C902F1D00D12438 /* Sources */ = { isa = PBXGroup; children = ( AA68C5FC0C90338B00D12438 /* nodeObj.c */, AA68C5FA0C90337C00D12438 /* tcldom-libxml2.c */, ); name = Sources; sourceTree = ""; }; AA68C5BC0C902F2D00D12438 /* Scripts */ = { isa = PBXGroup; children = ( AA1340B20CB49786006C8E84 /* tclxslt.tcl */, AA68C60A0C90340D00D12438 /* process.tcl */, AA68C60B0C90340D00D12438 /* resources.tcl */, AA68C60C0C90340D00D12438 /* utilities.tcl */, AA68C60D0C90340D00D12438 /* xsltcache.tcl */, ); name = Scripts; sourceTree = ""; }; AA68C5BF0C902F3600D12438 /* Headers */ = { isa = PBXGroup; children = ( AA68C6040C9033C900D12438 /* tclxslt.h */, ); name = Headers; sourceTree = ""; }; AA68C5C20C902F4100D12438 /* Scripts */ = { isa = PBXGroup; children = ( AA68C6080C9033F300D12438 /* tclxslt-libxslt.tcl */, ); name = Scripts; sourceTree = ""; }; AA68C5C50C902F4900D12438 /* Headers */ = { isa = PBXGroup; children = ( ); name = Headers; sourceTree = ""; }; AA68C5C80C902F5400D12438 /* Sources */ = { isa = PBXGroup; children = ( AA68C6060C9033E300D12438 /* tclxslt-libxslt.c */, ); name = Sources; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 8DC2EF500486A6940098B216 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( AA68C5D50C9031EA00D12438 /* tclxml.h in Headers */, AA68C5F50C90333E00D12438 /* docObj.h in Headers */, AA68C5F70C90334D00D12438 /* tclxml-libxml2.h in Headers */, AA68C5F90C90336200D12438 /* tcldom.h in Headers */, AA68C6000C90339C00D12438 /* nodeObj.h in Headers */, AA68C6010C90339C00D12438 /* tcldom-libxml2.h in Headers */, AA68C6050C9033C900D12438 /* tclxslt.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 8DC2EF4F0486A6940098B216 /* Tclxml */ = { isa = PBXNativeTarget; buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Tclxml" */; buildPhases = ( 8DC2EF500486A6940098B216 /* Headers */, 8DC2EF520486A6940098B216 /* Resources */, 8DC2EF540486A6940098B216 /* Sources */, 8DC2EF560486A6940098B216 /* Frameworks */, AA1340960CAE527B006C8E84 /* ShellScript */, ); buildRules = ( ); dependencies = ( AA68C6660C90EA9200D12438 /* PBXTargetDependency */, ); name = Tclxml; productInstallPath = "$(HOME)/Library/Frameworks"; productName = Tclxml; productReference = 8DC2EF5B0486A6940098B216 /* Tclxml.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Tclxml" */; compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; mainGroup = 0867D691FE84028FC02AAC07 /* Tclxml */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( AA68C6640C90EA8700D12438 /* configure */, 8DC2EF4F0486A6940098B216 /* Tclxml */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 8DC2EF520486A6940098B216 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( AA68C5E60C9032E400D12438 /* sgml-8.0.tcl in Resources */, AA68C5E70C9032E400D12438 /* sgml-8.1.tcl in Resources */, AA68C5E80C9032E400D12438 /* sgmlparser.tcl in Resources */, AA68C5E90C9032E400D12438 /* tclparser-8.0.tcl in Resources */, AA68C5EA0C9032E400D12438 /* tclparser-8.1.tcl in Resources */, AA68C5EB0C9032E400D12438 /* xml__tcl.tcl in Resources */, AA68C5EC0C9032E400D12438 /* xml-8.0.tcl in Resources */, AA68C5ED0C9032E400D12438 /* xml-8.1.tcl in Resources */, AA68C5EE0C9032E400D12438 /* xmldep.tcl in Resources */, AA68C5EF0C9032E400D12438 /* xpath.tcl in Resources */, AA68C6030C9033AC00D12438 /* tcldom-libxml2.tcl in Resources */, AA68C6090C9033F300D12438 /* tclxslt-libxslt.tcl in Resources */, AA68C60E0C90340D00D12438 /* process.tcl in Resources */, AA68C60F0C90340D00D12438 /* resources.tcl in Resources */, AA68C6100C90340D00D12438 /* utilities.tcl in Resources */, AA68C6110C90340D00D12438 /* xsltcache.tcl in Resources */, AA68C6F60C91035400D12438 /* Tclxml-Info.plist in Resources */, AA13408D0CACF8FA006C8E84 /* pkgIndex.tcl in Resources */, AA1340B30CB49786006C8E84 /* tclxslt.tcl in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ AA1340960CAE527B006C8E84 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "mkdir -p ${TARGET_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/Resources/Scripts\nmv ${TARGET_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/Resources/*.tcl ${TARGET_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/Resources/Scripts\n"; }; AA68C6630C90EA8700D12438 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "cd ${SRCROOT}/..; ./configure --with-xml2-config=${BUILT_PRODUCTS_DIR}/libxml.framework/Resources/Scripts/xml2-config --with-xslt-config=${BUILT_PRODUCTS_DIR}/libxslt.framework/Resources/Scripts/xslt-config --enable-framework"; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 8DC2EF540486A6940098B216 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( AA68C5D30C9031C400D12438 /* tclxml.c in Sources */, AA68C5F10C90331D00D12438 /* tclxml-libxml2.c in Sources */, AA68C5F30C90332A00D12438 /* docObj.c in Sources */, AA68C5FB0C90337C00D12438 /* tcldom-libxml2.c in Sources */, AA68C5FD0C90338B00D12438 /* nodeObj.c in Sources */, AA68C6070C9033E300D12438 /* tclxslt-libxslt.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ AA68C6660C90EA9200D12438 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = AA68C6640C90EA8700D12438 /* configure */; targetProxy = AA68C6650C90EA9200D12438 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ 1DEB91AE08733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; DEPLOYMENT_POSTPROCESSING = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", ); FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../Library/Frameworks\""; FRAMEWORK_VERSION = 3.3; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; HEADER_SEARCH_PATHS = "$(SRCROOT)/../include"; INFOPLIST_FILE = "Tclxml-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LIBXML2_VERSION = 2.7.2; LIBXSLT_VERSION = 1.1.24; MACH_O_TYPE = mh_dylib; PACKAGE_VERSION = 3.3; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; PRODUCT_NAME = Tclxml; WRAPPER_EXTENSION = framework; ZERO_LINK = YES; }; name = Debug; }; 1DEB91AF08733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = i386; DEPLOYMENT_POSTPROCESSING = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", ); FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../Library/Frameworks\""; FRAMEWORK_VERSION = 3.3; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; HEADER_SEARCH_PATHS = "$(SRCROOT)/../include"; INFOPLIST_FILE = "Tclxml-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LIBXML2_VERSION = 2.7.2; LIBXSLT_VERSION = 1.1.24; MACH_O_TYPE = mh_dylib; PACKAGE_VERSION = 3.3; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; PRODUCT_NAME = Tclxml; WRAPPER_EXTENSION = framework; }; name = Release; }; 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH)"; FRAMEWORK_VERSION = 3.3; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; PREBINDING = NO; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; name = Debug; }; 1DEB91B308733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = i386; DEPLOYMENT_POSTPROCESSING = YES; FRAMEWORK_VERSION = 3.3; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; PREBINDING = NO; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; name = Release; }; AA68C6680C90EAB000D12438 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; FRAMEWORK_VERSION = 3.3; GCC_DYNAMIC_NO_PIC = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; PRODUCT_NAME = configure; }; name = Debug; }; AA68C6690C90EAB000D12438 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; FRAMEWORK_VERSION = 3.3; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; PRODUCT_NAME = configure; ZERO_LINK = NO; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Tclxml" */ = { isa = XCConfigurationList; buildConfigurations = ( 1DEB91AE08733DA50010E9CD /* Debug */, 1DEB91AF08733DA50010E9CD /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Tclxml" */ = { isa = XCConfigurationList; buildConfigurations = ( 1DEB91B208733DA50010E9CD /* Debug */, 1DEB91B308733DA50010E9CD /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; AA68C6670C90EAB000D12438 /* Build configuration list for PBXAggregateTarget "configure" */ = { isa = XCConfigurationList; buildConfigurations = ( AA68C6680C90EAB000D12438 /* Debug */, AA68C6690C90EAB000D12438 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 0867D690FE84028FC02AAC07 /* Project object */; } tclxml-3.3~svn11.orig/macosx/Tclxml.xcodeproj/steve.pbxuser0000644000000000000000000001477411215700771022715 0ustar rootroot// !$*UTF8*$! { 0867D690FE84028FC02AAC07 /* Project object */ = { activeBuildConfigurationName = Release; activeTarget = 8DC2EF4F0486A6940098B216 /* Tclxml */; addToTargets = ( 8DC2EF4F0486A6940098B216 /* Tclxml */, ); codeSenseManager = AA68C5710C8FA6C900D12438 /* Code sense */; perUserDictionary = { PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID; PBXFileTableDataSourceColumnWidthsKey = ( 22, 300, 259.5835, ); PBXFileTableDataSourceColumnsKey = ( PBXExecutablesDataSource_ActiveFlagID, PBXExecutablesDataSource_NameID, PBXExecutablesDataSource_CommentsID, ); }; PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, 298, 20, 48, 43, 43, 20, ); PBXFileTableDataSourceColumnsKey = ( PBXFileDataSource_FiletypeID, PBXFileDataSource_Filename_ColumnID, PBXFileDataSource_Built_ColumnID, PBXFileDataSource_ObjectSize_ColumnID, PBXFileDataSource_Errors_ColumnID, PBXFileDataSource_Warnings_ColumnID, PBXFileDataSource_Target_ColumnID, ); }; PBXConfiguration.PBXFileTableDataSource3.PBXSymbolsDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXSymbolsDataSource_SymbolNameID; PBXFileTableDataSourceColumnWidthsKey = ( 16, 200, 50, 238, ); PBXFileTableDataSourceColumnsKey = ( PBXSymbolsDataSource_SymbolTypeIconID, PBXSymbolsDataSource_SymbolNameID, PBXSymbolsDataSource_SymbolTypeID, PBXSymbolsDataSource_ReferenceNameID, ); }; PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, 258, 60, 20, 48, 43, 43, ); PBXFileTableDataSourceColumnsKey = ( PBXFileDataSource_FiletypeID, PBXFileDataSource_Filename_ColumnID, PBXTargetDataSource_PrimaryAttribute, PBXFileDataSource_Built_ColumnID, PBXFileDataSource_ObjectSize_ColumnID, PBXFileDataSource_Errors_ColumnID, PBXFileDataSource_Warnings_ColumnID, ); }; PBXPerProjectTemplateStateSaveDate = 264906051; PBXWorkspaceStateSaveDate = 264906051; }; sourceControlManager = AA68C5700C8FA6C900D12438 /* Source Control */; userBuildSettings = { }; }; 8DC2EF4F0486A6940098B216 /* Tclxml */ = { activeExec = 0; }; AA68C5700C8FA6C900D12438 /* Source Control */ = { isa = PBXSourceControlManager; fallbackIsa = XCSourceControlManager; isSCMEnabled = 0; scmConfiguration = { }; scmType = ""; }; AA68C5710C8FA6C900D12438 /* Code sense */ = { isa = PBXCodeSenseManager; indexTemplatePath = ""; }; AA68C5D20C9031C400D12438 /* tclxml.c */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {848, 51870}}"; sepNavSelRange = "{8172, 0}"; sepNavVisRect = "{{0, 3464}, {738, 647}}"; sepNavWindowFrame = "{{67, 8}, {777, 776}}"; }; }; AA68C5E20C9032E400D12438 /* xml-8.0.tcl */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {738, 1302}}"; sepNavSelRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {738, 647}}"; sepNavWindowFrame = "{{-1356, 180}, {777, 776}}"; }; }; AA68C5E30C9032E400D12438 /* xml-8.1.tcl */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {738, 1904}}"; sepNavSelRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {738, 647}}"; sepNavWindowFrame = "{{126, 102}, {777, 776}}"; }; }; AA68C5F00C90331D00D12438 /* tclxml-libxml2.c */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {788, 13762}}"; sepNavSelRange = "{18, 0}"; sepNavVisRect = "{{0, 0}, {738, 647}}"; sepNavWindowFrame = "{{10, 32}, {777, 776}}"; }; }; AA68C5F20C90332A00D12438 /* docObj.c */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {686, 27272}}"; sepNavSelRange = "{65905, 0}"; sepNavVisRange = "{14065, 372}"; sepNavVisRect = "{{0, 3240}, {738, 647}}"; sepNavWindowFrame = "{{28, 28}, {777, 776}}"; }; }; AA68C5F60C90334D00D12438 /* tclxml-libxml2.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {738, 1414}}"; sepNavSelRange = "{2529, 0}"; sepNavVisRect = "{{0, 767}, {738, 647}}"; sepNavWindowFrame = "{{471, 30}, {777, 776}}"; }; }; AA68C5F80C90336200D12438 /* tcldom.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {738, 4116}}"; sepNavSelRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {738, 647}}"; sepNavWindowFrame = "{{66, 61}, {777, 776}}"; }; }; AA68C5FA0C90337C00D12438 /* tcldom-libxml2.c */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {476, 106386}}"; sepNavSelRange = "{197499, 0}"; sepNavVisRange = "{0, 0}"; sepNavVisRect = "{{0, 96312}, {738, 647}}"; sepNavWindowFrame = "{{40, 30}, {777, 776}}"; }; }; AA68C5FC0C90338B00D12438 /* nodeObj.c */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {738, 826}}"; sepNavSelRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {738, 647}}"; sepNavWindowFrame = "{{35, 11}, {777, 776}}"; }; }; AA68C5FF0C90339C00D12438 /* tcldom-libxml2.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {476, 3808}}"; sepNavSelRange = "{3291, 48}"; sepNavVisRange = "{0, 0}"; sepNavVisRect = "{{0, 2419}, {738, 647}}"; sepNavWindowFrame = "{{501, 4}, {777, 776}}"; }; }; AA68C6020C9033AC00D12438 /* tcldom-libxml2.tcl */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {738, 647}}"; sepNavSelRange = "{137, 0}"; sepNavVisRect = "{{0, 0}, {738, 647}}"; sepNavWindowFrame = "{{-1310, 138}, {777, 776}}"; }; }; AA68C6060C9033E300D12438 /* tclxslt-libxslt.c */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {852, 37618}}"; sepNavSelRange = "{59785, 141}"; sepNavVisRange = "{59628, 440}"; sepNavVisRect = "{{0, 13978}, {738, 647}}"; sepNavWindowFrame = "{{54, 33}, {777, 776}}"; }; }; AA68C6640C90EA8700D12438 /* configure */ = { activeExec = 0; }; AA68C6F50C91035400D12438 /* Tclxml-Info.plist */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {738, 647}}"; sepNavSelRange = "{555, 0}"; sepNavVisRect = "{{0, 0}, {738, 647}}"; sepNavWindowFrame = "{{-1425, 243}, {777, 776}}"; }; }; } tclxml-3.3~svn11.orig/macosx/Tclxml.xcodeproj/steve.mode1v30000644000000000000000000011401111215700771022464 0ustar rootroot ActivePerspectiveName Project AllowedModules BundleLoadPath MaxInstances n Module PBXSmartGroupTreeModule Name Groups and Files Outline View BundleLoadPath MaxInstances n Module PBXNavigatorGroup Name Editor BundleLoadPath MaxInstances n Module XCTaskListModule Name Task List BundleLoadPath MaxInstances n Module XCDetailModule Name File and Smart Group Detail Viewer BundleLoadPath MaxInstances 1 Module PBXBuildResultsModule Name Detailed Build Results Viewer BundleLoadPath MaxInstances 1 Module PBXProjectFindModule Name Project Batch Find Tool BundleLoadPath MaxInstances n Module XCProjectFormatConflictsModule Name Project Format Conflicts List BundleLoadPath MaxInstances n Module PBXBookmarksModule Name Bookmarks Tool BundleLoadPath MaxInstances n Module PBXClassBrowserModule Name Class Browser BundleLoadPath MaxInstances n Module PBXCVSModule Name Source Code Control Tool BundleLoadPath MaxInstances n Module PBXDebugBreakpointsModule Name Debug Breakpoints Tool BundleLoadPath MaxInstances n Module XCDockableInspector Name Inspector BundleLoadPath MaxInstances n Module PBXOpenQuicklyModule Name Open Quickly Tool BundleLoadPath MaxInstances 1 Module PBXDebugSessionModule Name Debugger BundleLoadPath MaxInstances 1 Module PBXDebugCLIModule Name Debug Console BundleLoadPath MaxInstances n Module XCSnapshotModule Name Snapshots Tool Description DefaultDescriptionKey DockingSystemVisible Extension mode1v3 FavBarConfig PBXProjectModuleGUID AA3A6C2E0DBBE97E0042AA78 XCBarModuleItemNames XCBarModuleItems FirstTimeWindowDisplayed Identifier com.apple.perspectives.project.mode1v3 MajorVersion 33 MinorVersion 0 Name Default Notifications OpenEditors PerspectiveWidths -1 -1 Perspectives ChosenToolbarItems active-target-popup active-buildstyle-popup action NSToolbarFlexibleSpaceItem buildOrClean build-and-goOrGo com.apple.ide.PBXToolbarStopButton get-info toggle-editor NSToolbarFlexibleSpaceItem com.apple.pbx.toolbar.searchfield ControllerClassBaseName IconName WindowOfProjectWithEditor Identifier perspective.project IsVertical Layout BecomeActive ContentConfiguration PBXBottomSmartGroupGIDs 1C37FBAC04509CD000000102 1C37FAAC04509CD000000102 1C08E77C0454961000C914BD 1C37FABC05509CD000000102 1C37FABC05539CD112110102 E2644B35053B69B200211256 1C37FABC04509CD000100104 1CC0EA4004350EF90044410B 1CC0EA4004350EF90041110B PBXProjectModuleGUID 1CE0B1FE06471DED0097A5F4 PBXProjectModuleLabel Files PBXProjectStructureProvided yes PBXSmartGroupTreeModuleColumnData PBXSmartGroupTreeModuleColumnWidthsKey 212 PBXSmartGroupTreeModuleColumnsKey_v4 MainColumn PBXSmartGroupTreeModuleOutlineStateKey_v7 PBXSmartGroupTreeModuleOutlineStateExpansionKey 0867D691FE84028FC02AAC07 1C37FBAC04509CD000000102 1C37FABC05509CD000000102 PBXSmartGroupTreeModuleOutlineStateSelectionKey 12 10 PBXSmartGroupTreeModuleOutlineStateVisibleRectKey {{0, 0}, {212, 464}} PBXTopSmartGroupGIDs XCIncludePerspectivesSwitch XCSharingToken com.apple.Xcode.GFSharingToken GeometryConfiguration Frame {{0, 0}, {229, 482}} GroupTreeTableConfiguration MainColumn 212 RubberWindowFrame -1235 677 771 523 -1280 400 1280 800 Module PBXSmartGroupTreeModule Proportion 229pt Dock ContentConfiguration PBXProjectModuleGUID 1CE0B20306471E060097A5F4 PBXProjectModuleLabel <No Editor> PBXSplitModuleInNavigatorKey Split0 PBXProjectModuleGUID 1CE0B20406471E060097A5F4 SplitCount 1 StatusBarVisibility GeometryConfiguration Frame {{0, 0}, {537, 0}} RubberWindowFrame -1235 677 771 523 -1280 400 1280 800 Module PBXNavigatorGroup Proportion 0pt ContentConfiguration PBXProjectModuleGUID 1CE0B20506471E060097A5F4 PBXProjectModuleLabel Detail GeometryConfiguration Frame {{0, 5}, {537, 477}} RubberWindowFrame -1235 677 771 523 -1280 400 1280 800 Module XCDetailModule Proportion 477pt Proportion 537pt Name Project ServiceClasses XCModuleDock PBXSmartGroupTreeModule XCModuleDock PBXNavigatorGroup XCDetailModule TableOfContents AA03D4F10FCA2EA50036C0A7 1CE0B1FE06471DED0097A5F4 AA03D4F20FCA2EA50036C0A7 1CE0B20306471E060097A5F4 1CE0B20506471E060097A5F4 ToolbarConfiguration xcode.toolbar.config.defaultV3 ControllerClassBaseName IconName WindowOfProject Identifier perspective.morph IsVertical Layout BecomeActive 1 ContentConfiguration PBXBottomSmartGroupGIDs 1C37FBAC04509CD000000102 1C37FAAC04509CD000000102 1C08E77C0454961000C914BD 1C37FABC05509CD000000102 1C37FABC05539CD112110102 E2644B35053B69B200211256 1C37FABC04509CD000100104 1CC0EA4004350EF90044410B 1CC0EA4004350EF90041110B PBXProjectModuleGUID 11E0B1FE06471DED0097A5F4 PBXProjectModuleLabel Files PBXProjectStructureProvided yes PBXSmartGroupTreeModuleColumnData PBXSmartGroupTreeModuleColumnWidthsKey 186 PBXSmartGroupTreeModuleColumnsKey_v4 MainColumn PBXSmartGroupTreeModuleOutlineStateKey_v7 PBXSmartGroupTreeModuleOutlineStateExpansionKey 29B97314FDCFA39411CA2CEA 1C37FABC05509CD000000102 PBXSmartGroupTreeModuleOutlineStateSelectionKey 0 PBXSmartGroupTreeModuleOutlineStateVisibleRectKey {{0, 0}, {186, 337}} PBXTopSmartGroupGIDs XCIncludePerspectivesSwitch 1 XCSharingToken com.apple.Xcode.GFSharingToken GeometryConfiguration Frame {{0, 0}, {203, 355}} GroupTreeTableConfiguration MainColumn 186 RubberWindowFrame 373 269 690 397 0 0 1440 878 Module PBXSmartGroupTreeModule Proportion 100% Name Morph PreferredWidth 300 ServiceClasses XCModuleDock PBXSmartGroupTreeModule TableOfContents 11E0B1FE06471DED0097A5F4 ToolbarConfiguration xcode.toolbar.config.default.shortV3 PerspectivesBarVisible ShelfIsVisible StatusbarIsVisible TimeStamp 0.0 ToolbarDisplayMode 1 ToolbarIsVisible ToolbarSizeMode 1 Type Perspectives UpdateMessage The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? WindowJustification 5 WindowOrderList AAE9E0620DC0626100A29434 /Users/steve/Projects/tclxml-repos/macosx/Tclxml.xcodeproj WindowString -1235 677 771 523 -1280 400 1280 800 WindowToolsV3 FirstTimeWindowDisplayed Identifier windowTool.build IsVertical Layout Dock ContentConfiguration PBXProjectModuleGUID 1CD0528F0623707200166675 PBXProjectModuleLabel <No Editor> StatusBarVisibility GeometryConfiguration Frame {{0, 0}, {747, 0}} RubberWindowFrame 526 60 747 718 0 0 1920 1178 Module PBXNavigatorGroup Proportion 0pt BecomeActive ContentConfiguration PBXBuildLogShowsTranscriptDefaultKey {{0, 202}, {747, 470}} PBXProjectModuleGUID XCMainBuildResultsModuleGUID PBXProjectModuleLabel Build XCBuildResultsTrigger_Collapse 1021 XCBuildResultsTrigger_Open 1011 GeometryConfiguration Frame {{0, 5}, {747, 672}} RubberWindowFrame 526 60 747 718 0 0 1920 1178 Module PBXBuildResultsModule Proportion 672pt Proportion 677pt Name Build Results ServiceClasses PBXBuildResultsModule StatusbarIsVisible TableOfContents AAE9E0620DC0626100A29434 AA03D4F70FCA2FD10036C0A7 1CD0528F0623707200166675 XCMainBuildResultsModuleGUID ToolbarConfiguration xcode.toolbar.config.buildV3 WindowString 526 60 747 718 0 0 1920 1178 WindowToolGUID AAE9E0620DC0626100A29434 WindowToolIsVisible FirstTimeWindowDisplayed Identifier windowTool.debugger Layout Dock ContentConfiguration Debugger HorizontalSplitView _collapsingFrameDimension 0.0 _indexOfCollapsedView 0 _percentageOfCollapsedView 0.0 isCollapsed yes sizes {{0, 0}, {317, 164}} {{317, 0}, {377, 164}} VerticalSplitView _collapsingFrameDimension 0.0 _indexOfCollapsedView 0 _percentageOfCollapsedView 0.0 isCollapsed yes sizes {{0, 0}, {694, 164}} {{0, 164}, {694, 216}} LauncherConfigVersion 8 PBXProjectModuleGUID 1C162984064C10D400B95A72 PBXProjectModuleLabel Debug - GLUTExamples (Underwater) GeometryConfiguration DebugConsoleDrawerSize {100, 120} DebugConsoleVisible None DebugConsoleWindowFrame {{200, 200}, {500, 300}} DebugSTDIOWindowFrame {{200, 200}, {500, 300}} Frame {{0, 0}, {694, 380}} RubberWindowFrame 321 238 694 422 0 0 1440 878 Module PBXDebugSessionModule Proportion 100% Proportion 100% Name Debugger ServiceClasses PBXDebugSessionModule StatusbarIsVisible TableOfContents 1CD10A99069EF8BA00B06720 1C0AD2AB069F1E9B00FABCE6 1C162984064C10D400B95A72 1C0AD2AC069F1E9B00FABCE6 ToolbarConfiguration xcode.toolbar.config.debugV3 WindowString 321 238 694 422 0 0 1440 878 WindowToolGUID 1CD10A99069EF8BA00B06720 WindowToolIsVisible FirstTimeWindowDisplayed Identifier windowTool.find Layout Dock Dock ContentConfiguration PBXProjectModuleGUID 1CDD528C0622207200134675 PBXProjectModuleLabel <No Editor> PBXSplitModuleInNavigatorKey Split0 PBXProjectModuleGUID 1CD0528D0623707200166675 SplitCount 1 StatusBarVisibility 1 GeometryConfiguration Frame {{0, 0}, {781, 167}} RubberWindowFrame 62 385 781 470 0 0 1440 878 Module PBXNavigatorGroup Proportion 781pt Proportion 50% BecomeActive 1 ContentConfiguration PBXProjectModuleGUID 1CD0528E0623707200166675 PBXProjectModuleLabel Project Find GeometryConfiguration Frame {{8, 0}, {773, 254}} RubberWindowFrame 62 385 781 470 0 0 1440 878 Module PBXProjectFindModule Proportion 50% Proportion 428pt Name Project Find ServiceClasses PBXProjectFindModule StatusbarIsVisible TableOfContents 1C530D57069F1CE1000CFCEE 1C530D58069F1CE1000CFCEE 1C530D59069F1CE1000CFCEE 1CDD528C0622207200134675 1C530D5A069F1CE1000CFCEE 1CE0B1FE06471DED0097A5F4 1CD0528E0623707200166675 WindowString 62 385 781 470 0 0 1440 878 WindowToolGUID 1C530D57069F1CE1000CFCEE WindowToolIsVisible FirstTimeWindowDisplayed Identifier MENUSEPARATOR FirstTimeWindowDisplayed Identifier windowTool.debuggerConsole Layout Dock BecomeActive 1 ContentConfiguration PBXProjectModuleGUID 1C78EAAC065D492600B07095 PBXProjectModuleLabel Debugger Console GeometryConfiguration Frame {{0, 0}, {440, 358}} RubberWindowFrame 650 41 440 400 0 0 1280 1002 Module PBXDebugCLIModule Proportion 358pt Proportion 358pt Name Debugger Console ServiceClasses PBXDebugCLIModule StatusbarIsVisible TableOfContents 1C78EAAD065D492600B07095 1C78EAAE065D492600B07095 1C78EAAC065D492600B07095 ToolbarConfiguration xcode.toolbar.config.consoleV3 WindowString 650 41 440 400 0 0 1280 1002 WindowToolGUID 1C78EAAD065D492600B07095 WindowToolIsVisible Identifier windowTool.snapshots Layout Dock Module XCSnapshotModule Proportion 100% Proportion 100% Name Snapshots ServiceClasses XCSnapshotModule StatusbarIsVisible Yes ToolbarConfiguration xcode.toolbar.config.snapshots WindowString 315 824 300 550 0 0 1440 878 WindowToolIsVisible Yes FirstTimeWindowDisplayed Identifier windowTool.scm Layout Dock ContentConfiguration PBXProjectModuleGUID 1C78EAB2065D492600B07095 PBXProjectModuleLabel <No Editor> PBXSplitModuleInNavigatorKey Split0 PBXProjectModuleGUID 1C78EAB3065D492600B07095 SplitCount 1 StatusBarVisibility 1 GeometryConfiguration Frame {{0, 0}, {452, 0}} RubberWindowFrame 743 379 452 308 0 0 1280 1002 Module PBXNavigatorGroup Proportion 0pt BecomeActive 1 ContentConfiguration PBXProjectModuleGUID 1CD052920623707200166675 PBXProjectModuleLabel SCM GeometryConfiguration ConsoleFrame {{0, 259}, {452, 0}} Frame {{0, 7}, {452, 259}} RubberWindowFrame 743 379 452 308 0 0 1280 1002 TableConfiguration Status 30 FileName 199 Path 197.09500122070312 TableFrame {{0, 0}, {452, 250}} Module PBXCVSModule Proportion 262pt Proportion 266pt Name SCM ServiceClasses PBXCVSModule StatusbarIsVisible TableOfContents 1C78EAB4065D492600B07095 1C78EAB5065D492600B07095 1C78EAB2065D492600B07095 1CD052920623707200166675 ToolbarConfiguration xcode.toolbar.config.scm WindowString 743 379 452 308 0 0 1280 1002 FirstTimeWindowDisplayed Identifier windowTool.breakpoints IsVertical Layout Dock BecomeActive 1 ContentConfiguration PBXBottomSmartGroupGIDs 1C77FABC04509CD000000102 PBXProjectModuleGUID 1CE0B1FE06471DED0097A5F4 PBXProjectModuleLabel Files PBXProjectStructureProvided no PBXSmartGroupTreeModuleColumnData PBXSmartGroupTreeModuleColumnWidthsKey 168 PBXSmartGroupTreeModuleColumnsKey_v4 MainColumn PBXSmartGroupTreeModuleOutlineStateKey_v7 PBXSmartGroupTreeModuleOutlineStateExpansionKey 1C77FABC04509CD000000102 PBXSmartGroupTreeModuleOutlineStateSelectionKey 0 PBXSmartGroupTreeModuleOutlineStateVisibleRectKey {{0, 0}, {168, 350}} PBXTopSmartGroupGIDs XCIncludePerspectivesSwitch 0 GeometryConfiguration Frame {{0, 0}, {185, 368}} GroupTreeTableConfiguration MainColumn 168 RubberWindowFrame 315 424 744 409 0 0 1440 878 Module PBXSmartGroupTreeModule Proportion 185pt ContentConfiguration PBXProjectModuleGUID 1CA1AED706398EBD00589147 PBXProjectModuleLabel Detail GeometryConfiguration Frame {{190, 0}, {554, 368}} RubberWindowFrame 315 424 744 409 0 0 1440 878 Module XCDetailModule Proportion 554pt Proportion 368pt MajorVersion 3 MinorVersion 0 Name Breakpoints ServiceClasses PBXSmartGroupTreeModule XCDetailModule StatusbarIsVisible TableOfContents 1CDDB66807F98D9800BB5817 1CDDB66907F98D9800BB5817 1CE0B1FE06471DED0097A5F4 1CA1AED706398EBD00589147 ToolbarConfiguration xcode.toolbar.config.breakpointsV3 WindowString 315 424 744 409 0 0 1440 878 WindowToolGUID 1CDDB66807F98D9800BB5817 WindowToolIsVisible FirstTimeWindowDisplayed Identifier windowTool.debugAnimator Layout Dock Module PBXNavigatorGroup Proportion 100% Proportion 100% Name Debug Visualizer ServiceClasses PBXNavigatorGroup StatusbarIsVisible ToolbarConfiguration xcode.toolbar.config.debugAnimatorV3 WindowString 100 100 700 500 0 0 1280 1002 FirstTimeWindowDisplayed Identifier windowTool.bookmarks Layout Dock Module PBXBookmarksModule Proportion 100% Proportion 100% Name Bookmarks ServiceClasses PBXBookmarksModule StatusbarIsVisible WindowString 538 42 401 187 0 0 1280 1002 Identifier windowTool.projectFormatConflicts Layout Dock Module XCProjectFormatConflictsModule Proportion 100% Proportion 100% Name Project Format Conflicts ServiceClasses XCProjectFormatConflictsModule StatusbarIsVisible WindowContentMinSize 450 300 WindowString 50 850 472 307 0 0 1440 877 FirstTimeWindowDisplayed Identifier windowTool.classBrowser Layout Dock BecomeActive 1 ContentConfiguration OptionsSetName Hierarchy, all classes PBXProjectModuleGUID 1CA6456E063B45B4001379D8 PBXProjectModuleLabel Class Browser - NSObject GeometryConfiguration ClassesFrame {{0, 0}, {374, 96}} ClassesTreeTableConfiguration PBXClassNameColumnIdentifier 208 PBXClassBookColumnIdentifier 22 Frame {{0, 0}, {630, 331}} MembersFrame {{0, 105}, {374, 395}} MembersTreeTableConfiguration PBXMemberTypeIconColumnIdentifier 22 PBXMemberNameColumnIdentifier 216 PBXMemberTypeColumnIdentifier 97 PBXMemberBookColumnIdentifier 22 PBXModuleWindowStatusBarHidden2 1 RubberWindowFrame 385 179 630 352 0 0 1440 878 Module PBXClassBrowserModule Proportion 332pt Proportion 332pt Name Class Browser ServiceClasses PBXClassBrowserModule StatusbarIsVisible TableOfContents 1C0AD2AF069F1E9B00FABCE6 1C0AD2B0069F1E9B00FABCE6 1CA6456E063B45B4001379D8 ToolbarConfiguration xcode.toolbar.config.classbrowser WindowString 385 179 630 352 0 0 1440 878 WindowToolGUID 1C0AD2AF069F1E9B00FABCE6 WindowToolIsVisible Identifier windowTool.refactoring IncludeInToolsMenu Layout Dock BecomeActive GeometryConfiguration Frame {0, 0}, {500, 335} RubberWindowFrame {0, 0}, {500, 335} Module XCRefactoringModule Proportion 100% Proportion 100% Name Refactoring ServiceClasses XCRefactoringModule WindowString 200 200 500 356 0 0 1920 1200 tclxml-3.3~svn11.orig/macosx/Tclxml-Info.plist0000644000000000000000000000117611113705304020111 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier net.sourceforge.tclxml CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleSignature ???? CFBundleVersion ${PACKAGE_VERSION} tclxml-3.3~svn11.orig/macosx/English.lproj/0000755000000000000000000000000011574742527017434 5ustar rootroottclxml-3.3~svn11.orig/macosx/Info-expat__Upgraded_.plist0000644000000000000000000000151011113705304022070 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable CFBundleGetInfoString TclXML/expat v3.0 CFBundleIconFile CFBundleIdentifier com.zveno.tclxml.expat CFBundleInfoDictionaryVersion 6.0 CFBundleName TclXML expat CFBundlePackageType FMWK CFBundleShortVersionString 3.0 CFBundleSignature ???? CFBundleVersion 3.0 tclxml-3.3~svn11.orig/macosx/Info-tclxml_libxml2__Upgraded_.plist0000644000000000000000000000153511113705304023712 0ustar rootroot CFBundleDevelopmentRegion English CFBundleExecutable tclxml-libxml2 CFBundleGetInfoString TclXML/libxml2 v3.0 CFBundleIconFile CFBundleIdentifier com.zveno.tclxml.libxml2 CFBundleInfoDictionaryVersion 6.0 CFBundleName TclXML libxml2 CFBundlePackageType FMWK CFBundleShortVersionString v3.0 CFBundleSignature ???? CFBundleVersion 3.0 tclxml-3.3~svn11.orig/tclconfig/0000755000000000000000000000000011574742523015370 5ustar rootroottclxml-3.3~svn11.orig/tclconfig/ChangeLog0000644000000000000000000001245011113705304017125 0ustar rootroot2002-07-20 Zoran Vasiljevic * tcl.m4: Added MINGW32 to list of systems checked for Windows build. Also, fixes some indentation issues with "--with-XXX" options. 2002-04-23 Jeff Hobbs * tcl.m4 (TEA_ENABLE_THREADS): added USE_THREAD_ALLOC define to use new threaded allocatory by default on Unix for Tcl 8.4. (TEA_CONFIG_CFLAGS): corrected LD_SEARCH_FLAGS for FreeBSD-3+. 2002-04-22 Jeff Hobbs * tcl.m4 (TEA_SETUP_COMPILER): removed call to AC_CYGWIN so that we can use autoconf 2.5x as well as 2.13. This prevents us from being able to warn against the use of cygwin gcc at configure time, but allows autoconf 2.5x, which is what is shipped with most newer systems. 2002-04-11 Jeff Hobbs * tcl.m4: Enabled COFF as well as CV style debug info with --enable-symbols to allow Dr. Watson users to see function info. More info on debugging levels can be obtained at: http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp 2002-04-03 Jeff Hobbs * tcl.m4: change all SC_* macros to TEA_*. The SC_ was for Scriptics, which is no more. TEA represents a better, independent prefix that won't need changing. Added preliminary mingw gcc support. [Patch #538772] Added TEA_PREFIX macro that handles defaulting the prefix and exec_prefix vars to those used by Tcl if none were specified. Added TEA_SETUP_COMPILER macro that encompasses the AC_PROG_CC check and several other basic AC_PROG checks needed for making executables. This greatly simplifies user's configure.in files. Collapsed AIX-5 defines into AIX-* with extra checks for doing the ELF stuff on AIX-5-ia64. Updated TEA_ENABLE_THREADS to take an optional arg to allow switching it on by default (for Thread) and add sanity checking to warn the user if configuring threads incompatibly. 2002-03-29 Jeff Hobbs * tcl.m4: made sure that SHLIB_LDFLAGS was set to LDFLAGS_DEFAULT. Removed --enable-64bit support for AIX-4 because it wasn't correct. Added -MT or -MD Windows linker switches to properly support symbols-enabled builds. 2002-03-28 Jeff Hobbs * tcl.m4: called AC_MSG_ERROR when SC_TEA_INIT wasn't called first instead of calling it as that inlines it each time in shell code. Changed Windows CFLAGS_OPTIMIZE to use -O2 instead of -Oti. Noted TCL_LIB_VERSIONS_OK=nodots for Windows builds. A few changes to support itcl (and perhaps others): Added support for making your own stub libraries to SC_MAKE_LIB. New SC_PATH_CONFIG and SC_LOAD_CONFIG that take a package name arg and find that ${pkg}Config.sh file. itk uses this for itcl. 2002-03-27 Jeff Hobbs * tcl.m4: made SC_LOAD_TKCONFIG recognize when working with a Tk build dir setup. Added EXTRA_CFLAGS and SHLIB_LD_LIBS substs to SC_CONFIG_CFLAGS. Added XLIBSW onto LIBS when it is defined. Remove TCL_LIBS from MAKE_LIB and correctly use SHLIB_LD_LIBS instead to not rely as much on tclConfig.sh cached info. Add TK_BIN_DIR to paths to find wish in SC_PROG_WISH. These move towards making TEA much more independent of *Config.sh. 2002-03-19 Jeff Hobbs * tcl.m4: corrected forgotten (UN)SHARED_LIB_SUFFIX and SHLIB_SUFFIX defines for Win. (SC_PATH_X): made this only do the check on unix platforms. 2002-03-12 Jeff Hobbs * README.txt: updated to reflect fewer files 2002-03-06 Jeff Hobbs * config.guess (removed): * config.sub (removed): removed unnecessary files * installFile.tcl (removed): * mkinstalldirs (removed): these aren't really necessary for making TEA work * tcl.m4 (SC_PUBLIC_TCL_HEADERS, SC_PUBLIC_TK_HEADERS): don't check /usr(/local)/include for includes on Windows when not using gcc 2002-03-05 Jeff Hobbs * tcl.m4: added warnings on Windows, removed RELPATH define and added TCL_LIBS to MAKE_LIB macro. This import represents 2.0.0, or a new start at attempting to make TEA much easier for C extension developers. **** moved from tclpro project to core tcl project, **** **** renamed to 'tclconfig' **** 2001-03-15 Karl Lehenbauer * installFile.tcl: Added updating of the modification time of the target file whether we overwrote it or decided that it hadn't changed. This was necessary for us to be able to determine whether or not a module install touched the file. 2001-03-08 Karl Lehenbauer * installFile.tcl: Added support for converting new-style (1.1+) Cygnus drive paths to Tcl-style. 2001-01-15 * tcl.m4: Added FreeBSD clause. 2001-01-03 * tcl.m4: Fixed typo in SC_LIB_SPEC where it is checking for exec-prefix. 2000-12-01 * tcl.m4: Concatenated most of the Ajuba acsite.m4 file so we don't need to modify the autoconf installation. * config.guess: * config.sub: * installFile.tcl: Added files from the itcl config subdirectory, which should go away. 2000-7-29 * Fixed the use of TCL_SRC_DIR and TK_SRC_DIR within TCL_PRIVATE_INCLUDES and TK_PRIVATE_INCLUDES to match their recent change from $(srcdir) to $(srcdir)/.. tclxml-3.3~svn11.orig/tclconfig/README.txt0000644000000000000000000000145311113705304017052 0ustar rootrootThese files comprise the basic building blocks for a Tcl Extension Architecture (TEA) extension. For more information on TEA see: http://www.tcl.tk/doc/tea/ This package is part of the Tcl project at SourceForge, and latest sources should be available there: http://tcl.sourceforge.net/ This package is a freely available open source package. You can do virtually anything you like with it, such as modifying it, redistributing it, and selling it either in whole or in part. CONTENTS ======== The following is a short description of the files you will find in the sample extension. README.txt This file install-sh Program used for copying binaries and script files to their install locations. tcl.m4 Collection of Tcl autoconf macros. Included by a package's aclocal.m4 to define SC_* macros. tclxml-3.3~svn11.orig/tclconfig/install-sh0000755000000000000000000000421211113705304017354 0ustar rootroot#!/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 tclxml-3.3~svn11.orig/tclconfig/tcl.m40000644000000000000000000036777611113705304016427 0ustar rootroot# 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.111 2007/06/25 19:15:14 hobbs 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 # Bug fix #1367779 (by Wart) 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/lib64 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: tclxml-3.3~svn11.orig/tclxml-tcl/0000755000000000000000000000000011574742526015506 5ustar rootroottclxml-3.3~svn11.orig/tclxml-tcl/xpath.tcl0000644000000000000000000002370411113705304017322 0ustar rootroot# xpath.tcl -- # # Provides an XPath parser for Tcl, # plus various support procedures # # Copyright (c) 2000-2003 Zveno Pty Ltd # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: xpath.tcl,v 1.8 2003/12/09 04:43:15 balls Exp $ package provide xpath 1.0 # We need the XML package for definition of Names package require xml namespace eval xpath { namespace export split join createnode variable axes { ancestor ancestor-or-self attribute child descendant descendant-or-self following following-sibling namespace parent preceding preceding-sibling self } variable nodeTypes { comment text processing-instruction node } # NB. QName has parens for prefix variable nodetestExpr ^(${::xml::QName})${::xml::allWsp}(\\(${::xml::allWsp}(("|')(.*?)\\5)?${::xml::allWsp}\\))?${::xml::allWsp}(.*) variable nodetestExpr2 ((($::xml::QName)${::xml::allWsp}(\\(${::xml::allWsp}(("|')(.*?)\\7)?${::xml::allWsp}\\))?)|${::xml::allWsp}(\\*))${::xml::allWsp}(.*) } # xpath::split -- # # Parse an XPath location path # # Arguments: # locpath location path # # Results: # A Tcl list representing the location path. # The list has the form: {{axis node-test {predicate predicate ...}} ...} # Where each list item is a location step. proc xpath::split locpath { set leftover {} set result [InnerSplit $locpath leftover] if {[string length [string trim $leftover]]} { return -code error "unexpected text \"$leftover\"" } return $result } proc xpath::InnerSplit {locpath leftoverVar} { upvar $leftoverVar leftover variable axes variable nodetestExpr variable nodetestExpr2 # First determine whether we have an absolute location path if {[regexp {^/(.*)} $locpath discard locpath]} { set path {{}} } else { set path {} } while {[string length [string trimleft $locpath]]} { if {[regexp {^\.\.(.*)} $locpath discard locpath]} { # .. abbreviation set axis parent set nodetest * } elseif {[regexp {^/(.*)} $locpath discard locpath]} { # // abbreviation set axis descendant-or-self if {[regexp ^$nodetestExpr2 [string trimleft $locpath] discard discard discard nodetest discard typetest discard discard literal wildcard locpath]} { set nodetest [ResolveWildcard $nodetest $typetest $wildcard $literal] } else { set leftover $locpath return $path } } elseif {[regexp ^\\.${::xml::allWsp}(.*) $locpath discard locpath]} { # . abbreviation set axis self set nodetest * } elseif {[regexp ^@($::xml::QName)${::xml::allWsp}=${::xml::allWsp}"(\[^"\])"(.*) $locpath discard attrName discard attrValue locpath]} { # @ abbreviation set axis attribute set nodetest $attrName } elseif {[regexp ^@($::xml::QName)${::xml::allWsp}=${::xml::allWsp}'(\[^'\])'(.*) $locpath discard attrName discard attrValue locpath]} { # @ abbreviation set axis attribute set nodetest $attrName } elseif {[regexp ^@($::xml::QName)(.*) $locpath discard attrName discard2 locpath]} { # @ abbreviation set axis attribute set nodetest $attrName } elseif {[regexp ^((${::xml::QName})${::xml::allWsp}::${::xml::allWsp})?\\*(.*) $locpath discard discard axis discard locpath]} { # wildcard specified set nodetest * if {![string length $axis]} { set axis child } } elseif {[regexp ^((${::xml::QName})${::xml::allWsp}::${::xml::allWsp})?$nodetestExpr2 $locpath discard discard axis discard discard discard nodetest discard typetest discard discard literal wildcard locpath]} { # nodetest, with or without axis if {![string length $axis]} { set axis child } set nodetest [ResolveWildcard $nodetest $typetest $wildcard $literal] } else { set leftover $locpath return $path } # ParsePredicates set predicates {} set locpath [string trimleft $locpath] while {[regexp {^\[(.*)} $locpath discard locpath]} { if {[regexp {^([0-9]+)(\].*)} [string trim $locpath] discard posn locpath]} { set predicate [list = {function position {}} [list number $posn]] } else { set leftover2 {} set predicate [ParseExpr $locpath leftover2] set locpath $leftover2 unset leftover2 } if {[regexp {^\](.*)} [string trimleft $locpath] discard locpath]} { lappend predicates $predicate } else { return -code error "unexpected text in predicate \"$locpath\"" } } set axis [string trim $axis] set nodetest [string trim $nodetest] # This step completed if {[lsearch $axes $axis] < 0} { return -code error "invalid axis \"$axis\"" } lappend path [list $axis $nodetest $predicates] # Move to next step if {[string length $locpath] && ![regexp ^/(.*) $locpath discard locpath]} { set leftover $locpath return $path } } return $path } # xpath::ParseExpr -- # # Parse one expression in a predicate # # Arguments: # locpath location path to parse # leftoverVar Name of variable in which to store remaining path # # Results: # Returns parsed expression as a Tcl list proc xpath::ParseExpr {locpath leftoverVar} { upvar $leftoverVar leftover variable nodeTypes set expr {} set mode expr set stack {} while {[string index [string trimleft $locpath] 0] != "\]"} { set locpath [string trimleft $locpath] switch $mode { expr { # We're looking for a term if {[regexp ^-(.*) $locpath discard locpath]} { # UnaryExpr lappend stack "-" } elseif {[regexp ^\\\$({$::xml::QName})(.*) $locpath discard varname discard locpath]} { # VariableReference lappend stack [list varRef $varname] set mode term } elseif {[regexp {^\((.*)} $locpath discard locpath]} { # Start grouping set leftover2 {} lappend stack [list group [ParseExpr $locpath leftover2]] set locpath $leftover2 unset leftover2 if {[regexp {^\)(.*)} [string trimleft $locpath] discard locpath]} { set mode term } else { return -code error "unexpected text \"$locpath\", expected \")\"" } } elseif {[regexp {^"([^"]*)"(.*)} $locpath discard literal locpath]} { # Literal (" delimited) lappend stack [list literal $literal] set mode term } elseif {[regexp {^'([^']*)'(.*)} $locpath discard literal locpath]} { # Literal (' delimited) lappend stack [list literal $literal] set mode term } elseif {[regexp {^([0-9]+(\.[0-9]+)?)(.*)} $locpath discard number discard locpath]} { # Number lappend stack [list number $number] set mode term } elseif {[regexp {^(\.[0-9]+)(.*)} $locpath discard number locpath]} { # Number lappend stack [list number $number] set mode term } elseif {[regexp ^(${::xml::QName})\\(${::xml::allWsp}(.*) $locpath discard functionName discard locpath]} { # Function call start or abbreviated node-type test if {[lsearch $nodeTypes $functionName] >= 0} { # Looking like a node-type test if {[regexp ^\\)${::xml::allWsp}(.*) $locpath discard locpath]} { lappend stack [list path [list child [list $functionName ()] {}]] set mode term } else { return -code error "invalid node-type test \"$functionName\"" } } else { if {[regexp ^\\)${::xml::allWsp}(.*) $locpath discard locpath]} { set parameters {} } else { set leftover2 {} set parameters [ParseExpr $locpath leftover2] set locpath $leftover2 unset leftover2 while {[regexp {^,(.*)} $locpath discard locpath]} { set leftover2 {} lappend parameters [ParseExpr $locpath leftover2] set locpath $leftover2 unset leftover2 } if {![regexp ^\\)${::xml::allWsp}(.*) [string trimleft $locpath] discard locpath]} { return -code error "unexpected text \"locpath\" - expected \")\"" } } lappend stack [list function $functionName $parameters] set mode term } } else { # LocationPath set leftover2 {} lappend stack [list path [InnerSplit $locpath leftover2]] set locpath $leftover2 unset leftover2 set mode term } } term { # We're looking for an expression operator if {[regexp ^-(.*) $locpath discard locpath]} { # UnaryExpr set stack [linsert $stack 0 expr "-"] set mode expr } elseif {[regexp ^(and|or|\\=|!\\=|<|>|<\\=|>\\=|\\||\\+|\\-|\\*|div|mod)(.*) $locpath discard exprtype locpath]} { # AndExpr, OrExpr, EqualityExpr, RelationalExpr or UnionExpr set stack [linsert $stack 0 $exprtype] set mode expr } else { return -code error "unexpected text \"$locpath\", expecting operator" } } default { # Should never be here! return -code error "internal error" } } } set leftover $locpath return $stack } # xpath::ResolveWildcard -- proc xpath::ResolveWildcard {nodetest typetest wildcard literal} { variable nodeTypes switch -glob -- [string length $nodetest],[string length $typetest],[string length $wildcard],[string length $literal] { 0,0,0,* { return -code error "bad location step (nothing parsed)" } 0,0,* { # Name wildcard specified return * } *,0,0,* { # Element type test - nothing to do return $nodetest } *,0,*,* { # Internal error? return -code error "bad location step (found both nodetest and wildcard)" } *,*,0,0 { # Node type test if {[lsearch $nodeTypes $nodetest] < 0} { return -code error "unknown node type \"$typetest\"" } return [list $nodetest $typetest] } *,*,0,* { # Node type test if {[lsearch $nodeTypes $nodetest] < 0} { return -code error "unknown node type \"$typetest\"" } return [list $nodetest $literal] } default { # Internal error? return -code error "bad location step" } } } # xpath::join -- # # Reconstitute an XPath location path from a # Tcl list representation. # # Arguments: # spath split path # # Results: # Returns an Xpath location path proc xpath::join spath { return -code error "not yet implemented" } tclxml-3.3~svn11.orig/tclxml-tcl/xml__tcl.tcl0000644000000000000000000001371711215700771020010 0ustar rootroot# xml__tcl.tcl -- # # This file provides a Tcl implementation of the parser # class support found in ../tclxml.c. It is only used # when the C implementation is not installed (for some reason). # # Copyright (c) 2005-2009 by Explain. # http://www.explain.com.au/ # Copyright (c) 2000-2004 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: xml__tcl.tcl,v 1.15.2.1 2005/12/28 06:49:51 balls Exp $ package provide xml::tcl 3.3 namespace eval xml { namespace export configure parser parserclass # Parser implementation classes variable classes array set classes {} # Default parser class variable default {} # Counter for generating unique names variable counter 0 } # xml::configure -- # # Configure the xml package # # Arguments: # None # # Results: # None (not yet implemented) proc xml::configure args {} # xml::parserclass -- # # Implements the xml::parserclass command for managing # parser implementations. # # Arguments: # method subcommand # args method arguments # # Results: # Depends on method proc xml::parserclass {method args} { variable classes variable default switch -- $method { create { if {[llength $args] < 1} { return -code error "wrong number of arguments, should be xml::parserclass create name ?args?" } set name [lindex $args 0] if {[llength [lrange $args 1 end]] % 2} { return -code error "missing value for option \"[lindex $args end]\"" } array set classes [list $name [list \ -createcommand [namespace current]::noop \ -createentityparsercommand [namespace current]::noop \ -parsecommand [namespace current]::noop \ -configurecommand [namespace current]::noop \ -getcommand [namespace current]::noop \ -deletecommand [namespace current]::noop \ ]] # BUG: we're not checking that the arguments are kosher set classes($name) [lrange $args 1 end] set default $name } destroy { if {[llength $args] < 1} { return -code error "wrong number of arguments, should be xml::parserclass destroy name" } if {[info exists classes([lindex $args 0])]} { unset classes([lindex $args 0]) } else { return -code error "no such parser class \"[lindex $args 0]\"" } } info { if {[llength $args] < 1} { return -code error "wrong number of arguments, should be xml::parserclass info method" } switch -- [lindex $args 0] { names { return [array names classes] } default { return $default } } } default { return -code error "unknown method \"$method\"" } } return {} } # xml::parser -- # # Create a parser object instance # # Arguments: # args optional name, configuration options # # Results: # Returns object name. Parser instance created. proc xml::parser args { variable classes variable default if {[llength $args] < 1} { # Create unique name, no options set parserName [FindUniqueName] } else { if {[string index [lindex $args 0] 0] == "-"} { # Create unique name, have options set parserName [FindUniqueName] } else { # Given name, optional options set parserName [lindex $args 0] set args [lrange $args 1 end] } } array set options [list \ -parser $default ] array set options $args if {![info exists classes($options(-parser))]} { return -code error "no such parser class \"$options(-parser)\"" } # Now create the parser instance command and data structure # The command must be created in the caller's namespace uplevel 1 [list proc $parserName {method args} "eval [namespace current]::ParserCmd [list $parserName] \[list \$method\] \$args"] upvar #0 [namespace current]::$parserName data array set data [list class $options(-parser)] array set classinfo $classes($options(-parser)) if {[string compare $classinfo(-createcommand) ""]} { eval $classinfo(-createcommand) [list $parserName] } if {[string compare $classinfo(-configurecommand) ""] && \ [llength $args]} { eval $classinfo(-configurecommand) [list $parserName] $args } return $parserName } # xml::FindUniqueName -- # # Generate unique object name # # Arguments: # None # # Results: # Returns string. proc xml::FindUniqueName {} { variable counter return xmlparser[incr counter] } # xml::ParserCmd -- # # Implements parser object command # # Arguments: # name object reference # method subcommand # args method arguments # # Results: # Depends on method proc xml::ParserCmd {name method args} { variable classes upvar #0 [namespace current]::$name data array set classinfo $classes($data(class)) switch -- $method { configure { # BUG: We're not checking for legal options array set data $args eval $classinfo(-configurecommand) [list $name] $args return {} } cget { return $data([lindex $args 0]) } entityparser { set new [FindUniqueName] upvar #0 [namespace current]::$name parent upvar #0 [namespace current]::$new data array set data [array get parent] uplevel 1 [list proc $new {method args} "eval [namespace current]::ParserCmd [list $new] \[list \$method\] \$args"] return [eval $classinfo(-createentityparsercommand) [list $name $new] $args] } free { eval $classinfo(-deletecommand) [list $name] unset data uplevel 1 [list rename $name {}] } get { eval $classinfo(-getcommand) [list $name] $args } parse { if {[llength $args] < 1} { return -code error "wrong number of arguments, should be $name parse xml ?options?" } eval $classinfo(-parsecommand) [list $name] $args } reset { eval $classinfo(-resetcommand) [list $name] } default { return -code error "unknown method" } } return {} } # xml::noop -- # # Do nothing utility proc # # Arguments: # args whatever # # Results: # Nothing happens proc xml::noop args {} tclxml-3.3~svn11.orig/tclxml-tcl/tclparser-8.0.tcl0000755000000000000000000002072311215700771020507 0ustar rootroot# tclparser-8.0.tcl -- # # This file provides a Tcl implementation of a XML parser. # This file supports Tcl 8.0. # # See xml-8.[01].tcl for definitions of character sets and # regular expressions. # # Copyright (c) 2005-2009 by Explain. # http://www.explain.com.au/ # Copyright (c) 1998-2004 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: tclparser-8.0.tcl,v 1.10.2.1 2005/12/28 06:49:51 balls Exp $ package require -exact Tcl 8.0 package require xmldefs 3.3 package require sgmlparser 1.0 package provide xml::tclparser 3.3 namespace eval xml { # Procedures for parsing XML documents namespace export parser # Procedures for parsing XML DTDs namespace export DTDparser # Counter for creating unique parser objects variable ParserCounter 0 } # xml::parser -- # # Creates XML parser object. # # Arguments: # args Unique name for parser object # plus option/value pairs # # Recognised Options: # -final Indicates end of document data # -elementstartcommand Called when an element starts # -elementendcommand Called when an element ends # -characterdatacommand Called when character data occurs # -processinginstructioncommand Called when a PI occurs # -externalentityrefcommand Called for an external entity reference # # (Not compatible with expat) # -xmldeclcommand Called when the XML declaration occurs # -doctypecommand Called when the document type declaration occurs # # -errorcommand Script to evaluate for a fatal error # -warningcommand Script to evaluate for a reportable warning # -statevariable global state variable # -reportempty whether to provide empty element indication # # Results: # The state variable is initialised. proc xml::parser {args} { variable ParserCounter if {[llength $args] > 0} { set name [lindex $args 0] set args [lreplace $args 0 0] } else { set name parser[incr ParserCounter] } if {[info command [namespace current]::$name] != {}} { return -code error "unable to create parser object \"[namespace current]::$name\" command" } # Initialise state variable and object command upvar \#0 [namespace current]::$name parser set sgml_ns [namespace parent]::sgml array set parser [list name $name \ -final 1 \ -elementstartcommand ${sgml_ns}::noop \ -elementendcommand ${sgml_ns}::noop \ -characterdatacommand ${sgml_ns}::noop \ -processinginstructioncommand ${sgml_ns}::noop \ -externalentityrefcommand ${sgml_ns}::noop \ -xmldeclcommand ${sgml_ns}::noop \ -doctypecommand ${sgml_ns}::noop \ -warningcommand ${sgml_ns}::noop \ -statevariable [namespace current]::$name \ -reportempty 0 \ internaldtd {} \ ] proc [namespace current]::$name {method args} \ "eval ParseCommand $name \$method \$args" eval ParseCommand [list $name] configure $args return [namespace current]::$name } # xml::ParseCommand -- # # Handles parse object command invocations # # Valid Methods: # cget # configure # parse # reset # # Arguments: # parser parser object # method minor command # args other arguments # # Results: # Depends on method proc xml::ParseCommand {parser method args} { upvar \#0 [namespace current]::$parser state switch -- $method { cget { return $state([lindex $args 0]) } configure { foreach {opt value} $args { set state($opt) $value } } parse { ParseCommand_parse $parser [lindex $args 0] } reset { if {[llength $args]} { return -code error "too many arguments" } ParseCommand_reset $parser } default { return -code error "unknown method \"$method\"" } } return {} } # xml::ParseCommand_parse -- # # Parses document instance data # # Arguments: # object parser object # xml data # # Results: # Callbacks are invoked, if any are defined proc xml::ParseCommand_parse {object xml} { upvar \#0 [namespace current]::$object parser variable Wsp variable tokExpr variable substExpr set parent [namespace parent] if {![string compare :: $parent]} { set parent {} } set tokenised [lrange \ [${parent}::sgml::tokenise $xml \ $tokExpr \ $substExpr \ -internaldtdvariable [namespace current]::${object}(internaldtd)] \ 4 end] eval ${parent}::sgml::parseEvent \ [list $tokenised \ -emptyelement [namespace code ParseEmpty] \ -parseattributelistcommand [namespace code ParseAttrs]] \ [array get parser -*command] \ [array get parser -entityvariable] \ [array get parser -reportempty] \ [array get parser -final] \ -normalize 0 \ -internaldtd [list $parser(internaldtd)] return {} } # xml::ParseEmpty -- Tcl 8.0 version # # Used by parser to determine whether an element is empty. # This should be dead easy in XML. The only complication is # that the RE above can't catch the trailing slash, so we have # to dig it out of the tag name or attribute list. # # Tcl 8.1 REs should fix this. # # Arguments: # tag element name # attr attribute list (raw) # e End tag delimiter. # # Results: # "/" if the trailing slash is found. Optionally, return a list # containing new values for the tag name and/or attribute list. proc xml::ParseEmpty {tag attr e} { if {[string match */ [string trimright $tag]] && \ ![string length $attr]} { regsub {/$} $tag {} tag return [list / $tag $attr] } elseif {[string match */ [string trimright $attr]]} { regsub {/$} [string trimright $attr] {} attr return [list / $tag $attr] } else { return {} } } # xml::ParseAttrs -- # # Parse element attributes. # # There are two forms for name-value pairs: # # name="value" # name='value' # # Watch out for the trailing slash on empty elements. # # Arguments: # attrs attribute string given in a tag # # Results: # Returns a Tcl list representing the name-value pairs in the # attribute string proc xml::ParseAttrs attrs { variable Wsp variable Name # First check whether there's any work to do if {![string compare {} [string trim $attrs]]} { return {} } # Strip the trailing slash on empty elements regsub [format {/[%s]*$} " \t\n\r"] $attrs {} atList set mode name set result {} foreach component [split $atList =] { switch $mode { name { set component [string trim $component] if {[regexp $Name $component]} { lappend result $component } else { return -code error "invalid attribute name \"$component\"" } set mode value:start } value:start { set component [string trimleft $component] set delimiter [string index $component 0] set value {} switch -- $delimiter { \" - ' { if {[regexp [format {%s([^%s]*)%s(.*)} $delimiter $delimiter $delimiter] $component discard value remainder]} { lappend result $value set remainder [string trim $remainder] if {[string length $remainder]} { if {[regexp $Name $remainder]} { lappend result $remainder set mode value:start } else { return -code error "invalid attribute name \"$remainder\"" } } else { set mode end } } else { set value [string range $component 1 end] set mode value:continue } } default { return -code error "invalid value for attribute \"[lindex $result end]\"" } } } value:continue { if {[regexp [format {([^%s]*)%s(.*)} $delimiter $delimiter] $component discard valuepart remainder]} { append value = $valuepart lappend result $value set remainder [string trim $remainder] if {[string length $remainder]} { if {[regexp $Name $remainder]} { lappend result $remainder set mode value:start } else { return -code error "invalid attribute name \"$remainder\"" } } else { set mode end } } else { append value = $component } } end { return -code error "unexpected data found after end of attribute list" } } } switch $mode { name - end { # This is normal } default { return -code error "unexpected end of attribute list" } } return $result } # xml::ParseCommand_reset -- # # Initialize parser data # # Arguments: # object parser object # # Results: # Parser data structure initialised proc xml::ParseCommand_reset object { upvar \#0 [namespace current]::$object parser array set parser [list \ -final 1 \ internaldtd {} \ ] } tclxml-3.3~svn11.orig/tclxml-tcl/xml-8.0.tcl0000755000000000000000000000365411215700771017314 0ustar rootroot# xml-8.0.tcl -- # # This file provides generic XML services for all implementations. # This file supports Tcl 8.0 regular expressions. # # See xmlparse.tcl for the Tcl implementation of a XML parser. # # Copyright (c) 2005-2009 by Explain. # http://www.explain.com.au/ # Copyright (c) 1998-2004 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: xml-8.0.tcl,v 1.7.2.1 2005/12/28 06:49:51 balls Exp $ package require -exact Tcl 8.0 package require sgml 1.8 package provide xmldefs 3.3 namespace eval xml { # Convenience routine proc cl x { return "\[$x\]" } # Define various regular expressions # Characters variable Char $::sgml::Char # white space variable Wsp " \t\r\n" variable noWsp [cl ^$Wsp] # Various XML names and tokens variable NameChar $::sgml::NameChar variable Name $::sgml::Name variable Names $::sgml::Names variable Nmtoken $::sgml::Nmtoken variable Nmtokens $::sgml::Nmtokens # The definition of the Namespace URI for XML Namespaces themselves. # The prefix 'xml' is automatically bound to this URI. variable xmlnsNS http://www.w3.org/XML/1998/namespace # Tokenising expressions variable tokExpr <(/?)([cl ^$Wsp>/]+)([cl $Wsp]*[cl ^>]*)> variable substExpr "\}\n{\\2} {\\1} {\\3} \{" # table of predefined entities variable EntityPredef array set EntityPredef { lt < gt > amp & quot \" apos ' } } ### ### General utility procedures ### # xml::noop -- # # A do-nothing proc proc xml::noop args {} ### Following procedures are based on html_library # xml::zapWhite -- # # Convert multiple white space into a single space. # # Arguments: # data plain text # # Results: # As above proc xml::zapWhite data { regsub -all "\[ \t\r\n\]+" $data { } data return $data } tclxml-3.3~svn11.orig/tclxml-tcl/xml-8.1.tcl0000755000000000000000000000575611215700771017322 0ustar rootroot# xml.tcl -- # # This file provides generic XML services for all implementations. # This file supports Tcl 8.1 regular expressions. # # See tclparser.tcl for the Tcl implementation of a XML parser. # # Copyright (c) 2005-2009 by Explain. # http://www.explain.com.au/ # Copyright (c) 1998-2004 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: xml-8.1.tcl,v 1.16.2.1 2005/12/28 06:49:51 balls Exp $ package require Tcl 8.1 package provide xmldefs 3.3 package require sgml 1.8 namespace eval xml { namespace export qnamesplit # Convenience routine proc cl x { return "\[$x\]" } # Define various regular expressions # Characters variable Char $::sgml::Char # white space variable Wsp " \t\r\n" variable allWsp [cl $Wsp]* variable noWsp [cl ^$Wsp] # Various XML names and tokens variable NameChar $::sgml::NameChar variable Name $::sgml::Name variable Names $::sgml::Names variable Nmtoken $::sgml::Nmtoken variable Nmtokens $::sgml::Nmtokens # XML Namespaces names # NCName ::= Name - ':' variable NCName $::sgml::Name regsub -all : $NCName {} NCName variable QName (${NCName}:)?$NCName ;# (Prefix ':')? LocalPart # The definition of the Namespace URI for XML Namespaces themselves. # The prefix 'xml' is automatically bound to this URI. variable xmlnsNS http://www.w3.org/XML/1998/namespace # table of predefined entities variable EntityPredef array set EntityPredef { lt < gt > amp & quot \" apos ' } # Expressions for pulling things apart variable tokExpr <(/?)([::xml::cl ^$::xml::Wsp>/]+)([::xml::cl $::xml::Wsp]*[::xml::cl ^>]*)> variable substExpr "\}\n{\\2} {\\1} {\\3} \{" } ### ### Exported procedures ### # xml::qnamesplit -- # # Split a QName into its constituent parts: # the XML Namespace prefix and the Local-name # # Arguments: # qname XML Qualified Name (see XML Namespaces [6]) # # Results: # Returns prefix and local-name as a Tcl list. # Error condition returned if the prefix or local-name # are not valid NCNames (XML Name) proc xml::qnamesplit qname { variable NCName variable Name set prefix {} set localname $qname if {[regexp : $qname]} { if {![regexp ^($NCName)?:($NCName)\$ $qname discard prefix localname]} { return -code error "name \"$qname\" is not a valid QName" } } elseif {![regexp ^$Name\$ $qname]} { return -code error "name \"$qname\" is not a valid Name" } return [list $prefix $localname] } ### ### General utility procedures ### # xml::noop -- # # A do-nothing proc proc xml::noop args {} ### Following procedures are based on html_library # xml::zapWhite -- # # Convert multiple white space into a single space. # # Arguments: # data plain text # # Results: # As above proc xml::zapWhite data { regsub -all "\[ \t\r\n\]+" $data { } data return $data } tclxml-3.3~svn11.orig/tclxml-tcl/sgmlparser.tcl0000755000000000000000000024223611113705304020363 0ustar rootroot# sgmlparser.tcl -- # # This file provides the generic part of a parser for SGML-based # languages, namely HTML and XML. # # NB. It is a misnomer. There is no support for parsing # arbitrary SGML as such. # # See sgml.tcl for variable definitions. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 1998-2003 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: sgmlparser.tcl,v 1.32 2003/12/09 04:43:15 balls Exp $ package require sgml 1.9 package require uri 1.1 package provide sgmlparser 1.1 namespace eval sgml { namespace export tokenise parseEvent namespace export parseDTD # NB. Most namespace variables are defined in sgml-8.[01].tcl # to account for differences between versions of Tcl. # This especially includes the regular expressions used. variable ParseEventNum if {![info exists ParseEventNum]} { set ParseEventNum 0 } variable ParseDTDnum if {![info exists ParseDTDNum]} { set ParseDTDNum 0 } variable declExpr [cl $::sgml::Wsp]*([cl ^$::sgml::Wsp]+)[cl $::sgml::Wsp]*([cl ^>]*) variable EntityExpr [cl $::sgml::Wsp]*(%[cl $::sgml::Wsp])?[cl $::sgml::Wsp]*($::sgml::Name)[cl $::sgml::Wsp]+(.*) #variable MarkupDeclExpr <([cl ^$::sgml::Wsp>]+)[cl $::sgml::Wsp]*([cl ^$::sgml::Wsp]+)[cl $::sgml::Wsp]*([cl ^>]*)> #variable MarkupDeclSub "} {\\1} {\\2} {\\3} {" variable MarkupDeclExpr <[cl $::sgml::Wsp]*([cl ^$::sgml::Wsp>]+)[cl $::sgml::Wsp]*([cl ^>]*)> variable MarkupDeclSub "\} {\\1} {\\2} \{" variable ExternalEntityExpr ^(PUBLIC|SYSTEM)[cl $::sgml::Wsp]+("|')(.*?)\\2([cl $::sgml::Wsp]+("|')(.*?)\\2)?([cl $::sgml::Wsp]+NDATA[cl $::sgml::Wsp]+($::xml::Name))?\$ variable StdOptions array set StdOptions [list \ -elementstartcommand [namespace current]::noop \ -elementendcommand [namespace current]::noop \ -characterdatacommand [namespace current]::noop \ -processinginstructioncommand [namespace current]::noop \ -externalentitycommand {} \ -xmldeclcommand [namespace current]::noop \ -doctypecommand [namespace current]::noop \ -commentcommand [namespace current]::noop \ -entitydeclcommand [namespace current]::noop \ -unparsedentitydeclcommand [namespace current]::noop \ -parameterentitydeclcommand [namespace current]::noop \ -notationdeclcommand [namespace current]::noop \ -elementdeclcommand [namespace current]::noop \ -attlistdeclcommand [namespace current]::noop \ -paramentityparsing 1 \ -defaultexpandinternalentities 1 \ -startdoctypedeclcommand [namespace current]::noop \ -enddoctypedeclcommand [namespace current]::noop \ -entityreferencecommand {} \ -warningcommand [namespace current]::noop \ -errorcommand [namespace current]::Error \ -final 1 \ -validate 0 \ -baseuri {} \ -name {} \ -cmd {} \ -emptyelement [namespace current]::EmptyElement \ -parseattributelistcommand [namespace current]::noop \ -parseentitydeclcommand [namespace current]::noop \ -normalize 1 \ -internaldtd {} \ -reportempty 0 \ -ignorewhitespace 0 \ ] } # sgml::tokenise -- # # Transform the given HTML/XML text into a Tcl list. # # Arguments: # sgml text to tokenize # elemExpr RE to recognise tags # elemSub transform for matched tags # args options # # Valid Options: # -internaldtdvariable # -final boolean True if no more data is to be supplied # -statevariable varName Name of a variable used to store info # # Results: # Returns a Tcl list representing the document. proc sgml::tokenise {sgml elemExpr elemSub args} { array set options {-final 1} array set options $args set options(-final) [Boolean $options(-final)] # If the data is not final then there must be a variable to store # unused data. if {!$options(-final) && ![info exists options(-statevariable)]} { return -code error {option "-statevariable" required if not final} } # Pre-process stage # # Extract the internal DTD subset, if any catch {upvar #0 $options(-internaldtdvariable) dtd} if {[regexp {]*$)} [lindex $sgml end] x text rest]} { set sgml [lreplace $sgml end end $text] # Mats: unmatched stuff means that it is chopped off. Cache it for next round. set state(leftover) $rest } # Patch from bug report #596959, Marshall Rose if {[string compare [lindex $sgml 4] ""]} { set sgml [linsert $sgml 0 {} {} {} {} {}] } } else { # Performance note (Tcl 8.0): # In this case, no conversion to list object is performed # Mats: This fails if not -final and $sgml is chopped off right in a tag. regsub -all $elemExpr $sgml $elemSub sgml set sgml "{} {} {} \{$sgml\}" } return $sgml } # sgml::parseEvent -- # # Produces an event stream for a XML/HTML document, # given the Tcl list format returned by tokenise. # # This procedure checks that the document is well-formed, # and throws an error if the document is found to be not # well formed. Warnings are passed via the -warningcommand script. # # The procedure only check for well-formedness, # no DTD is required. However, facilities are provided for entity expansion. # # Arguments: # sgml Instance data, as a Tcl list. # args option/value pairs # # Valid Options: # -final Indicates end of document data # -validate Boolean to enable validation # -baseuri URL for resolving relative URLs # -elementstartcommand Called when an element starts # -elementendcommand Called when an element ends # -characterdatacommand Called when character data occurs # -entityreferencecommand Called when an entity reference occurs # -processinginstructioncommand Called when a PI occurs # -externalentitycommand Called for an external entity reference # # -xmldeclcommand Called when the XML declaration occurs # -doctypecommand Called when the document type declaration occurs # -commentcommand Called when a comment occurs # -entitydeclcommand Called when a parsed entity is declared # -unparsedentitydeclcommand Called when an unparsed external entity is declared # -parameterentitydeclcommand Called when a parameter entity is declared # -notationdeclcommand Called when a notation is declared # -elementdeclcommand Called when an element is declared # -attlistdeclcommand Called when an attribute list is declared # -paramentityparsing Boolean to enable/disable parameter entity substitution # -defaultexpandinternalentities Boolean to enable/disable expansion of entities declared in internal DTD subset # # -startdoctypedeclcommand Called when the Doc Type declaration starts (see also -doctypecommand) # -enddoctypedeclcommand Called when the Doc Type declaration ends (see also -doctypecommand) # # -errorcommand Script to evaluate for a fatal error # -warningcommand Script to evaluate for a reportable warning # -statevariable global state variable # -normalize whether to normalize names # -reportempty whether to include an indication of empty elements # -ignorewhitespace whether to automatically strip whitespace # # Results: # The various callback scripts are invoked. # Returns empty string. # # BUGS: # If command options are set to empty string then they should not be invoked. proc sgml::parseEvent {sgml args} { variable Wsp variable noWsp variable Nmtoken variable Name variable ParseEventNum variable StdOptions array set options [array get StdOptions] catch {array set options $args} # Mats: # If the data is not final then there must be a variable to persistently store the parse state. if {!$options(-final) && ![info exists options(-statevariable)]} { return -code error {option "-statevariable" required if not final} } foreach {opt value} [array get options *command] { if {[string compare $opt "-externalentitycommand"] && ![string length $value]} { set options($opt) [namespace current]::noop } } if {![info exists options(-statevariable)]} { set options(-statevariable) [namespace current]::ParseEvent[incr ParseEventNum] } if {![info exists options(entities)]} { set options(entities) [namespace current]::Entities$ParseEventNum array set $options(entities) [array get [namespace current]::EntityPredef] } if {![info exists options(extentities)]} { set options(extentities) [namespace current]::ExtEntities$ParseEventNum } if {![info exists options(parameterentities)]} { set options(parameterentities) [namespace current]::ParamEntities$ParseEventNum } if {![info exists options(externalparameterentities)]} { set options(externalparameterentities) [namespace current]::ExtParamEntities$ParseEventNum } if {![info exists options(elementdecls)]} { set options(elementdecls) [namespace current]::ElementDecls$ParseEventNum } if {![info exists options(attlistdecls)]} { set options(attlistdecls) [namespace current]::AttListDecls$ParseEventNum } if {![info exists options(notationdecls)]} { set options(notationdecls) [namespace current]::NotationDecls$ParseEventNum } if {![info exists options(namespaces)]} { set options(namespaces) [namespace current]::Namespaces$ParseEventNum } # For backward-compatibility catch {set options(-baseuri) $options(-baseurl)} # Choose an external entity resolver if {![string length $options(-externalentitycommand)]} { if {$options(-validate)} { set options(-externalentitycommand) [namespace code ResolveEntity] } else { set options(-externalentitycommand) [namespace code noop] } } upvar #0 $options(-statevariable) state upvar #0 $options(entities) entities # Mats: # The problem is that the state is not maintained when -final 0 ! # I've switched back to an older version here. if {![info exists state(line)]} { # Initialise the state variable array set state { mode normal haveXMLDecl 0 haveDocElement 0 inDTD 0 context {} stack {} line 0 defaultNS {} defaultNSURI {} } } foreach {tag close param text} $sgml { # Keep track of lines in the input incr state(line) [regsub -all \n $param {} discard] incr state(line) [regsub -all \n $text {} discard] # If the current mode is cdata or comment then we must undo what the # regsub has done to reconstitute the data set empty {} switch $state(mode) { comment { # This had "[string length $param] && " as a guard - # can't remember why :-( if {[regexp ([cl ^-]*)--\$ $tag discard comm1]} { # end of comment (in tag) set tag {} set close {} set state(mode) normal DeProtect1 $options(-commentcommand) $state(commentdata)<$comm1 unset state(commentdata) } elseif {[regexp ([cl ^-]*)--\$ $param discard comm1]} { # end of comment (in attributes) DeProtect1 $options(-commentcommand) $state(commentdata)<$close$tag>$comm1 unset state(commentdata) set tag {} set param {} set close {} set state(mode) normal } elseif {[regexp ([cl ^-]*)-->(.*) $text discard comm1 text]} { # end of comment (in text) DeProtect1 $options(-commentcommand) $state(commentdata)<$close$tag$param>$comm1 unset state(commentdata) set tag {} set param {} set close {} set state(mode) normal } else { # comment continues append state(commentdata) <$close$tag$param>$text continue } } cdata { if {[string length $param] && [regexp ([cl ^\]]*)\]\][cl $Wsp]*\$ $tag discard cdata1]} { # end of CDATA (in tag) PCDATA [array get options] $state(cdata)<[subst -nocommand -novariable $close$cdata1] set text [subst -novariable -nocommand $text] set tag {} unset state(cdata) set state(mode) normal } elseif {[regexp ([cl ^\]]*)\]\][cl $Wsp]*\$ $param discard cdata1]} { # end of CDATA (in attributes) PCDATA [array get options] $state(cdata)<[subst -nocommand -novariable $close$tag$cdata1] set text [subst -novariable -nocommand $text] set tag {} set param {} unset state(cdata) set state(mode) normal } elseif {[regexp (.*)\]\][cl $Wsp]*>(.*) $text discard cdata1 text]} { # end of CDATA (in text) PCDATA [array get options] $state(cdata)<[subst -nocommand -novariable $close$tag$param>$cdata1] set text [subst -novariable -nocommand $text] set tag {} set param {} set close {} unset state(cdata) set state(mode) normal } else { # CDATA continues append state(cdata) [subst -nocommand -novariable <$close$tag$param>$text] continue } } continue { # We're skipping elements looking for the close tag switch -glob -- [string length $tag],[regexp {^\?|!.*} $tag],$close { 0,* { continue } *,0, { if {![string compare $tag $state(continue:tag)]} { set empty [uplevel #0 $options(-emptyelement) [list $tag $param $empty]] if {![string length $empty]} { incr state(continue:level) } } continue } *,0,/ { if {![string compare $tag $state(continue:tag)]} { incr state(continue:level) -1 } if {!$state(continue:level)} { unset state(continue:tag) unset state(continue:level) set state(mode) {} } } default { continue } } } default { # The trailing slash on empty elements can't be automatically separated out # in the RE, so we must do it here. regexp (.*)(/)[cl $Wsp]*$ $param discard param empty } } # default: normal mode # Bug: if the attribute list has a right angle bracket then the empty # element marker will not be seen set empty [uplevel #0 $options(-emptyelement) [list $tag $param $empty]] switch -glob -- [string length $tag],[regexp {^\?|!.*} $tag],$close,$empty { 0,0,, { # Ignore empty tag - dealt with non-normal mode above } *,0,, { # Start tag for an element. # Check if the internal DTD entity is in an attribute value regsub -all &xml:intdtd\; $param \[$options(-internaldtd)\] param set code [catch {ParseEvent:ElementOpen $tag $param [array get options]} msg] set state(haveDocElement) 1 switch $code { 0 {# OK} 3 { # break return {} } 4 { # continue # Remember this tag and look for its close set state(continue:tag) $tag set state(continue:level) 1 set state(mode) continue continue } default { return -code $code -errorinfo $::errorInfo $msg } } } *,0,/, { # End tag for an element. set code [catch {ParseEvent:ElementClose $tag [array get options]} msg] switch $code { 0 {# OK} 3 { # break return {} } 4 { # continue # skip sibling nodes set state(continue:tag) [lindex $state(stack) end] set state(continue:level) 1 set state(mode) continue continue } default { return -code $code -errorinfo $::errorInfo $msg } } } *,0,,/ { # Empty element # The trailing slash sneaks through into the param variable regsub -all /[cl $::sgml::Wsp]*\$ $param {} param set code [catch {ParseEvent:ElementOpen $tag $param [array get options] -empty 1} msg] set state(haveDocElement) 1 switch $code { 0 {# OK} 3 { # break return {} } 4 { # continue # Pretty useless since it closes straightaway } default { return -code $code -errorinfo $::errorInfo $msg } } set code [catch {ParseEvent:ElementClose $tag [array get options] -empty 1} msg] switch $code { 0 {# OK} 3 { # break return {} } 4 { # continue # skip sibling nodes set state(continue:tag) [lindex $state(stack) end] set state(continue:level) 1 set state(mode) continue continue } default { return -code $code -errorinfo $::errorInfo $msg } } } *,1,* { # Processing instructions or XML declaration switch -glob -- $tag { {\?xml} { # XML Declaration if {$state(haveXMLDecl)} { uplevel #0 $options(-errorcommand) [list illegalcharacter "unexpected characters \"<$tag\" around line $state(line)"] } elseif {![regexp {\?$} $param]} { uplevel #0 $options(-errorcommand) [list missingcharacters "XML Declaration missing characters \"?>\" around line $state(line)"] } else { # We can do the parsing in one step with Tcl 8.1 RE's # This has the benefit of performing better WF checking set adv_re [format {^[%s]*version[%s]*=[%s]*("|')(-+|[a-zA-Z0-9_.:]+)\1([%s]+encoding[%s]*=[%s]*("|')([A-Za-z][-A-Za-z0-9._]*)\4)?([%s]*standalone[%s]*=[%s]*("|')(yes|no)\7)?[%s]*\?$} $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp] if {[catch {regexp $adv_re $param discard delimiter version discard delimiter encoding discard delimiter standalone} matches]} { # Otherwise we must fallback to 8.0. # This won't detect certain well-formedness errors # Get the version number if {[regexp [format {[%s]*version[%s]*=[%s]*"(-+|[a-zA-Z0-9_.:]+)"[%s]*} $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp] $param discard version] || [regexp [format {[%s]*version[%s]*=[%s]*'(-+|[a-zA-Z0-9_.:]+)'[%s]*} $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp] $param discard version]} { if {[string compare $version "1.0"]} { # Should we support future versions? # At least 1.X? uplevel #0 $options(-errorcommand) [list versionincompatibility "document XML version \"$version\" is incompatible with XML version 1.0"] } } else { uplevel #0 $options(-errorcommand) [list missingversion "XML Declaration missing version information around line $state(line)"] } # Get the encoding declaration set encoding {} regexp [format {[%s]*encoding[%s]*=[%s]*"([A-Za-z]([A-Za-z0-9._]|-)*)"[%s]*} $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp] $param discard encoding regexp [format {[%s]*encoding[%s]*=[%s]*'([A-Za-z]([A-Za-z0-9._]|-)*)'[%s]*} $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp] $param discard encoding # Get the standalone declaration set standalone {} regexp [format {[%s]*standalone[%s]*=[%s]*"(yes|no)"[%s]*} $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp] $param discard standalone regexp [format {[%s]*standalone[%s]*=[%s]*'(yes|no)'[%s]*} $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp $::sgml::Wsp] $param discard standalone # Invoke the callback uplevel #0 $options(-xmldeclcommand) [list $version $encoding $standalone] } elseif {$matches == 0} { uplevel #0 $options(-errorcommand) [list illformeddeclaration "XML Declaration not well-formed around line $state(line)"] } else { # Invoke the callback uplevel #0 $options(-xmldeclcommand) [list $version $encoding $standalone] } } } {\?*} { # Processing instruction set tag [string range $tag 1 end] if {[regsub {\?$} $tag {} tag]} { if {[string length [string trim $param]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$param\" in processing instruction around line $state(line)"] } } elseif {![regexp ^$Name\$ $tag]} { uplevel #0 $options(-errorcommand) [list illegalcharacter "illegal character in processing instruction target \"$tag\""] } elseif {[regexp {[xX][mM][lL]} $tag]} { uplevel #0 $options(-errorcommand) [list illegalcharacters "characters \"xml\" not permitted in processing instruction target \"$tag\""] } elseif {![regsub {\?$} $param {} param]} { uplevel #0 $options(-errorcommand) [list missingquestion "PI: expected '?' character around line $state(line)"] } set code [catch {uplevel #0 $options(-processinginstructioncommand) [list $tag [string trimleft $param]]} msg] switch $code { 0 {# OK} 3 { # break return {} } 4 { # continue # skip sibling nodes set state(continue:tag) [lindex $state(stack) end] set state(continue:level) 1 set state(mode) continue continue } default { return -code $code -errorinfo $::errorInfo $msg } } } !DOCTYPE { # External entity reference # This should move into xml.tcl # Parse the params supplied. Looking for Name, ExternalID and MarkupDecl set matched [regexp ^[cl $Wsp]*($Name)[cl $Wsp]*(.*) $param x state(doc_name) param] set state(doc_name) [Normalize $state(doc_name) $options(-normalize)] set externalID {} set pubidlit {} set systemlit {} set externalID {} if {[regexp -nocase ^[cl $Wsp]*(SYSTEM|PUBLIC)(.*) $param x id param]} { switch [string toupper $id] { SYSTEM { if {[regexp ^[cl $Wsp]+"([cl ^"]*)"(.*) $param x systemlit param] || [regexp ^[cl $Wsp]+'([cl ^']*)'(.*) $param x systemlit param]} { set externalID [list SYSTEM $systemlit] ;# " } else { uplevel #0 $options(-errorcommand) {syntaxerror {syntax error: SYSTEM identifier not followed by literal}} } } PUBLIC { if {[regexp ^[cl $Wsp]+"([cl ^"]*)"(.*) $param x pubidlit param] || [regexp ^[cl $Wsp]+'([cl ^']*)'(.*) $param x pubidlit param]} { if {[regexp ^[cl $Wsp]+"([cl ^"]*)"(.*) $param x systemlit param] || [regexp ^[cl $Wsp]+'([cl ^']*)'(.*) $param x systemlit param]} { set externalID [list PUBLIC $pubidlit $systemlit] } else { uplevel #0 $options(-errorcommand) [list syntaxerror "syntax error: PUBLIC identifier not followed by system literal around line $state(line)"] } } else { uplevel #0 $options(-errorcommand) [list syntaxerror "syntax error: PUBLIC identifier not followed by literal around line $state(line)"] } } } if {[regexp -nocase ^[cl $Wsp]+NDATA[cl $Wsp]+($Name)(.*) $param x notation param]} { lappend externalID $notation } } set state(inDTD) 1 ParseEvent:DocTypeDecl [array get options] $state(doc_name) $pubidlit $systemlit $options(-internaldtd) set state(inDTD) 0 } !--* { # Start of a comment # See if it ends in the same tag, otherwise change the # parsing mode regexp {!--(.*)} $tag discard comm1 if {[regexp ([cl ^-]*)--[cl $Wsp]*\$ $comm1 discard comm1_1]} { # processed comment (end in tag) uplevel #0 $options(-commentcommand) [list $comm1_1] } elseif {[regexp ([cl ^-]*)--[cl $Wsp]*\$ $param discard comm2]} { # processed comment (end in attributes) uplevel #0 $options(-commentcommand) [list $comm1$comm2] } elseif {[regexp ([cl ^-]*)-->(.*) $text discard comm2 text]} { # processed comment (end in text) uplevel #0 $options(-commentcommand) [list $comm1$param$empty>$comm2] } else { # start of comment set state(mode) comment set state(commentdata) "$comm1$param$empty>$text" continue } } {!\[CDATA\[*} { regexp {!\[CDATA\[(.*)} $tag discard cdata1 if {[regexp {(.*)]]$} $cdata1 discard cdata2]} { # processed CDATA (end in tag) PCDATA [array get options] [subst -novariable -nocommand $cdata2] set text [subst -novariable -nocommand $text] } elseif {[regexp {(.*)]]$} $param discard cdata2]} { # processed CDATA (end in attribute) # Backslashes in param are quoted at this stage PCDATA [array get options] $cdata1[subst -novariable -nocommand $cdata2] set text [subst -novariable -nocommand $text] } elseif {[regexp {(.*)]]>(.*)} $text discard cdata2 text]} { # processed CDATA (end in text) # Backslashes in param and text are quoted at this stage PCDATA [array get options] $cdata1[subst -novariable -nocommand $param]$empty>[subst -novariable -nocommand $cdata2] set text [subst -novariable -nocommand $text] } else { # start CDATA set state(cdata) "$cdata1$param>$text" set state(mode) cdata continue } } !ELEMENT - !ATTLIST - !ENTITY - !NOTATION { uplevel #0 $options(-errorcommand) [list illegaldeclaration "[string range $tag 1 end] declaration not expected in document instance around line $state(line)"] } default { uplevel #0 $options(-errorcommand) [list unknowninstruction "unknown processing instruction \"<$tag>\" around line $state(line)"] } } } *,1,* - *,0,/,/ { # Syntax error uplevel #0 $options(-errorcommand) [list syntaxerror "syntax error: closed/empty tag: tag $tag param $param empty $empty close $close around line $state(line)"] } } # Process character data if {$state(haveDocElement) && [llength $state(stack)]} { # Check if the internal DTD entity is in the text regsub -all &xml:intdtd\; $text \[$options(-internaldtd)\] text # Look for entity references if {([array size entities] || \ [string length $options(-entityreferencecommand)]) && \ $options(-defaultexpandinternalentities) && \ [regexp {&[^;]+;} $text]} { # protect Tcl specials # NB. braces and backslashes may already be protected regsub -all {\\({|}|\\)} $text {\1} text regsub -all {([][$\\{}])} $text {\\\1} text # Mark entity references regsub -all {&([^;]+);} $text [format {%s; %s {\1} ; %s %s} \}\} [namespace code [list Entity [array get options] $options(-entityreferencecommand) [namespace code [list PCDATA [array get options]]] $options(entities)]] [namespace code [list DeProtect [namespace code [list PCDATA [array get options]]]]] \{\{] text set text "uplevel #0 [namespace code [list DeProtect1 [namespace code [list PCDATA [array get options]]]]] {{$text}}" eval $text } else { # Restore protected special characters regsub -all {\\([][{}\\])} $text {\1} text PCDATA [array get options] $text } } elseif {[string length [string trim $text]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$text\" in document prolog around line $state(line)"] } } # If this is the end of the document, close all open containers if {$options(-final) && [llength $state(stack)]} { eval $options(-errorcommand) [list unclosedelement "element [lindex $state(stack) end] remains unclosed around line $state(line)"] } return {} } # sgml::DeProtect -- # # Invoke given command after removing protecting backslashes # from given text. # # Arguments: # cmd Command to invoke # text Text to deprotect # # Results: # Depends on command proc sgml::DeProtect1 {cmd text} { if {[string compare {} $text]} { regsub -all {\\([]$[{}\\])} $text {\1} text uplevel #0 $cmd [list $text] } } proc sgml::DeProtect {cmd text} { set text [lindex $text 0] if {[string compare {} $text]} { regsub -all {\\([]$[{}\\])} $text {\1} text uplevel #0 $cmd [list $text] } } # sgml::ParserDelete -- # # Free all memory associated with parser # # Arguments: # var global state array # # Results: # Variables unset proc sgml::ParserDelete var { upvar #0 $var state if {![info exists state]} { return -code error "unknown parser" } catch {unset $state(entities)} catch {unset $state(parameterentities)} catch {unset $state(elementdecls)} catch {unset $state(attlistdecls)} catch {unset $state(notationdecls)} catch {unset $state(namespaces)} unset state return {} } # sgml::ParseEvent:ElementOpen -- # # Start of an element. # # Arguments: # tag Element name # attr Attribute list # opts Options # args further configuration options # # Options: # -empty boolean # indicates whether the element was an empty element # # Results: # Modify state and invoke callback proc sgml::ParseEvent:ElementOpen {tag attr opts args} { variable Name variable Wsp array set options $opts upvar #0 $options(-statevariable) state array set cfg {-empty 0} array set cfg $args set handleEmpty 0 if {$options(-normalize)} { set tag [string toupper $tag] } # Update state lappend state(stack) $tag # Parse attribute list into a key-value representation if {[string compare $options(-parseattributelistcommand) {}]} { if {[catch {uplevel #0 $options(-parseattributelistcommand) [list $opts $attr]} attr]} { if {[string compare [lindex $attr 0] "unterminated attribute value"]} { uplevel #0 $options(-errorcommand) [list unterminatedattribute "$attr around line $state(line)"] set attr {} } else { # It is most likely that a ">" character was in an attribute value. # This manifests itself by ">" appearing in the element's text. # In this case the callback should return a three element list; # the message "unterminated attribute value", the attribute list it # did manage to parse and the remainder of the attribute list. foreach {msg attlist brokenattr} $attr break upvar text elemText if {[string first > $elemText] >= 0} { # Now piece the attribute list back together regexp [cl $Wsp]*($Name)[cl $Wsp]*=[cl $Wsp]*("|')(.*) $brokenattr discard attname delimiter attvalue regexp (.*)>([cl ^>]*)\$ $elemText discard remattlist elemText regexp ([cl ^$delimiter]*)${delimiter}(.*) $remattlist discard remattvalue remattlist # Gotcha: watch out for empty element syntax if {[string match */ [string trimright $remattlist]]} { set remattlist [string range $remattlist 0 end-1] set handleEmpty 1 set cfg(-empty) 1 } append attvalue >$remattvalue lappend attlist $attname $attvalue # Complete parsing the attribute list if {[catch {uplevel #0 $options(-parseattributelistcommand) [list $options(-statevariable) $remattlist]} attr]} { uplevel #0 $options(-errorcommand) [list unterminatedattribute "$attr around line $state(line)"] set attr {} set attlist {} } else { eval lappend attlist $attr } set attr $attlist } else { uplevel #0 $options(-errorcommand) [list unterminatedattribute "$attr around line $state(line)"] set attr {} } } } } set empty {} if {$cfg(-empty) && $options(-reportempty)} { set empty {-empty 1} } # Check for namespace declarations upvar #0 $options(namespaces) namespaces set nsdecls {} if {[llength $attr]} { array set attrlist $attr foreach {attrName attrValue} [array get attrlist xmlns*] { unset attrlist($attrName) set colon [set prefix {}] if {[regexp {^xmlns(:(.+))?$} $attrName discard colon prefix]} { switch -glob [string length $colon],[string length $prefix] { 0,0 { # default NS declaration lappend state(defaultNSURI) $attrValue lappend state(defaultNS) [llength $state(stack)] lappend nsdecls $attrValue {} } 0,* { # Huh? } *,0 { # Error uplevel #0 $state(-warningcommand) "no prefix specified for namespace URI \"$attrValue\" in element \"$tag\"" } default { set namespaces($prefix,[llength $state(stack)]) $attrValue lappend nsdecls $attrValue $prefix } } } } if {[llength $nsdecls]} { set nsdecls [list -namespacedecls $nsdecls] } set attr [array get attrlist] } # Check whether this element has an expanded name set ns {} if {[regexp {([^:]+):(.*)$} $tag discard prefix tag]} { set nsspec [lsort -dictionary -decreasing [array names namespaces $prefix,*]] if {[llength $nsspec]} { set nsuri $namespaces([lindex $nsspec 0]) set ns [list -namespace $nsuri] } else { uplevel #0 $options(-errorcommand) [list namespaceundeclared "no namespace declared for prefix \"$prefix\" in element $tag"] } } elseif {[llength $state(defaultNSURI)]} { set ns [list -namespace [lindex $state(defaultNSURI) end]] } # Invoke callback set code [catch {uplevel #0 $options(-elementstartcommand) [list $tag $attr] $empty $ns $nsdecls} msg] # Sometimes empty elements must be handled here (see above) if {$code == 0 && $handleEmpty} { ParseEvent:ElementClose $tag $opts -empty 1 } return -code $code -errorinfo $::errorInfo $msg } # sgml::ParseEvent:ElementClose -- # # End of an element. # # Arguments: # tag Element name # opts Options # args further configuration options # # Options: # -empty boolean # indicates whether the element as an empty element # # Results: # Modify state and invoke callback proc sgml::ParseEvent:ElementClose {tag opts args} { array set options $opts upvar #0 $options(-statevariable) state array set cfg {-empty 0} array set cfg $args # WF check if {[string compare $tag [lindex $state(stack) end]]} { uplevel #0 $options(-errorcommand) [list illegalendtag "end tag \"$tag\" does not match open element \"[lindex $state(stack) end]\" around line $state(line)"] return } # Check whether this element has an expanded name upvar #0 $options(namespaces) namespaces set ns {} if {[regexp {([^:]+):(.*)$} $tag discard prefix tag]} { set nsuri $namespaces([lindex [lsort -dictionary -decreasing [array names namespaces $prefix,*]] 0]) set ns [list -namespace $nsuri] } elseif {[llength $state(defaultNSURI)]} { set ns [list -namespace [lindex $state(defaultNSURI) end]] } # Pop namespace stacks, if any if {[llength $state(defaultNS)]} { if {[llength $state(stack)] == [lindex $state(defaultNS) end]} { set state(defaultNS) [lreplace $state(defaultNS) end end] } } foreach nsspec [array names namespaces *,[llength $state(stack)]] { unset namespaces($nsspec) } # Update state set state(stack) [lreplace $state(stack) end end] set empty {} if {$cfg(-empty) && $options(-reportempty)} { set empty {-empty 1} } # Invoke callback # Mats: Shall be same as sgml::ParseEvent:ElementOpen to handle exceptions in callback. set code [catch {uplevel #0 $options(-elementendcommand) [list $tag] $empty $ns} msg] return -code $code -errorinfo $::errorInfo $msg } # sgml::PCDATA -- # # Process PCDATA before passing to application # # Arguments: # opts options # pcdata Character data to be processed # # Results: # Checks that characters are legal, # checks -ignorewhitespace setting. proc sgml::PCDATA {opts pcdata} { array set options $opts if {$options(-ignorewhitespace) && \ ![string length [string trim $pcdata]]} { return {} } if {![regexp ^[cl $::sgml::Char]*\$ $pcdata]} { upvar \#0 $options(-statevariable) state uplevel \#0 $options(-errorcommand) [list illegalcharacters "illegal, non-Unicode characters found in text \"$pcdata\" around line $state(line)"] } uplevel \#0 $options(-characterdatacommand) [list $pcdata] } # sgml::Normalize -- # # Perform name normalization if required # # Arguments: # name name to normalize # req normalization required # # Results: # Name returned as upper-case if normalization required proc sgml::Normalize {name req} { if {$req} { return [string toupper $name] } else { return $name } } # sgml::Entity -- # # Resolve XML entity references (syntax: &xxx;). # # Arguments: # opts options # entityrefcmd application callback for entity references # pcdatacmd application callback for character data # entities name of array containing entity definitions. # ref entity reference (the "xxx" bit) # # Results: # Returns substitution text for given entity. proc sgml::Entity {opts entityrefcmd pcdatacmd entities ref} { array set options $opts upvar #0 $options(-statevariable) state if {![string length $entities]} { set entities [namespace current]::EntityPredef } # SRB: Bug fix 2008-11-18 #812051: surround case labels in braces for compatibility with Freewrap switch -glob -- $ref { {%*} { # Parameter entity - not recognised outside of a DTD } {#x*} { # Character entity - hex if {[catch {format %c [scan [string range $ref 2 end] %x tmp; set tmp]} char]} { return -code error "malformed character entity \"$ref\"" } uplevel #0 $pcdatacmd [list $char] return {} } {#*} { # Character entity - decimal if {[catch {format %c [scan [string range $ref 1 end] %d tmp; set tmp]} char]} { return -code error "malformed character entity \"$ref\"" } uplevel #0 $pcdatacmd [list $char] return {} } default { # General entity upvar #0 $entities map if {[info exists map($ref)]} { if {![regexp {<|&} $map($ref)]} { # Simple text replacement - optimise uplevel #0 $pcdatacmd [list $map($ref)] return {} } # Otherwise an additional round of parsing is required. # This only applies to XML, since HTML doesn't have general entities # Must parse the replacement text for start & end tags, etc # This text must be self-contained: balanced closing tags, and so on set tokenised [tokenise $map($ref) $::xml::tokExpr $::xml::substExpr] set options(-final) 0 eval parseEvent [list $tokenised] [array get options] return {} } elseif {[string compare $entityrefcmd "::sgml::noop"]} { set result [uplevel #0 $entityrefcmd [list $ref]] if {[string length $result]} { uplevel #0 $pcdatacmd [list $result] } return {} } else { # Reconstitute entity reference uplevel #0 $options(-errorcommand) [list illegalentity "undefined entity reference \"$ref\""] return {} } } } # If all else fails leave the entity reference untouched uplevel #0 $pcdatacmd [list &$ref\;] return {} } #################################### # # DTD parser for SGML (XML). # # This DTD actually only handles XML DTDs. Other language's # DTD's, such as HTML, must be written in terms of a XML DTD. # #################################### # sgml::ParseEvent:DocTypeDecl -- # # Entry point for DTD parsing # # Arguments: # opts configuration options # docEl document element name # pubId public identifier # sysId system identifier (a URI) # intSSet internal DTD subset proc sgml::ParseEvent:DocTypeDecl {opts docEl pubId sysId intSSet} { array set options {} array set options $opts set code [catch {uplevel #0 $options(-doctypecommand) [list $docEl $pubId $sysId $intSSet]} err] switch $code { 3 { # break return {} } 0 - 4 { # continue } default { return -code $code $err } } # Otherwise we'll parse the DTD and report it piecemeal # The internal DTD subset is processed first (XML 2.8) # During this stage, parameter entities are only allowed # between markup declarations ParseDTD:Internal [array get options] $intSSet # The external DTD subset is processed last (XML 2.8) # During this stage, parameter entities may occur anywhere # We must resolve the external identifier to obtain the # DTD data. The application may supply its own resolver. if {[string length $pubId] || [string length $sysId]} { uplevel #0 $options(-externalentitycommand) [list $options(-cmd) $options(-baseuri) $sysId $pubId] } return {} } # sgml::ParseDTD:Internal -- # # Parse the internal DTD subset. # # Parameter entities are only allowed between markup declarations. # # Arguments: # opts configuration options # dtd DTD data # # Results: # Markup declarations parsed may cause callback invocation proc sgml::ParseDTD:Internal {opts dtd} { variable MarkupDeclExpr variable MarkupDeclSub array set options {} array set options $opts upvar #0 $options(-statevariable) state upvar #0 $options(parameterentities) PEnts upvar #0 $options(externalparameterentities) ExtPEnts # Bug 583947: remove comments before further processing regsub -all {} $dtd {} dtd # Tokenize the DTD # Protect Tcl special characters regsub -all {([{}\\])} $dtd {\\\1} dtd regsub -all $MarkupDeclExpr $dtd $MarkupDeclSub dtd # Entities may have angle brackets in their replacement # text, which breaks the RE processing. So, we must # use a similar technique to processing doc instances # to rebuild the declarations from the pieces set mode {} ;# normal set delimiter {} set name {} set param {} set state(inInternalDTD) 1 # Process the tokens foreach {decl value text} [lrange "{} {} \{$dtd\}" 3 end] { # Keep track of line numbers incr state(line) [regsub -all \n $text {} discard] ParseDTD:EntityMode [array get options] mode replText decl value text $delimiter $name $param ParseDTD:ProcessMarkupDecl [array get options] decl value delimiter name mode replText text param # There may be parameter entity references between markup decls if {[regexp {%.*;} $text]} { # Protect Tcl special characters regsub -all {([{}\\])} $text {\\\1} text regsub -all %($::sgml::Name)\; $text "\} {\\1} \{" text set PElist "\{$text\}" set PElist [lreplace $PElist end end] foreach {text entref} $PElist { if {[string length [string trim $text]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text in internal DTD subset around line $state(line)"] } # Expand parameter entity and recursively parse # BUG: no checks yet for recursive entity references if {[info exists PEnts($entref)]} { set externalParser [$options(-cmd) entityparser] $externalParser parse $PEnts($entref) -dtdsubset internal } elseif {[info exists ExtPEnts($entref)]} { set externalParser [$options(-cmd) entityparser] $externalParser parse $ExtPEnts($entref) -dtdsubset external #$externalParser free } else { uplevel #0 $options(-errorcommand) [list illegalreference "reference to undeclared parameter entity \"$entref\""] } } } } return {} } # sgml::ParseDTD:EntityMode -- # # Perform special processing for various parser modes # # Arguments: # opts configuration options # modeVar pass-by-reference mode variable # replTextVar pass-by-ref # declVar pass-by-ref # valueVar pass-by-ref # textVar pass-by-ref # delimiter delimiter currently in force # name # param # # Results: # Depends on current mode proc sgml::ParseDTD:EntityMode {opts modeVar replTextVar declVar valueVar textVar delimiter name param} { upvar 1 $modeVar mode upvar 1 $replTextVar replText upvar 1 $declVar decl upvar 1 $valueVar value upvar 1 $textVar text array set options $opts switch $mode { {} { # Pass through to normal processing section } entity { # Look for closing delimiter if {[regexp ([cl ^$delimiter]*)${delimiter}(.*) $decl discard val1 remainder]} { append replText <$val1 DTD:ENTITY [array get options] $name [string trim $param] $delimiter$replText$delimiter set decl / set text $remainder\ $value>$text set value {} set mode {} } elseif {[regexp ([cl ^$delimiter]*)${delimiter}(.*) $value discard val2 remainder]} { append replText <$decl\ $val2 DTD:ENTITY [array get options] $name [string trim $param] $delimiter$replText$delimiter set decl / set text $remainder>$text set value {} set mode {} } elseif {[regexp ([cl ^$delimiter]*)${delimiter}(.*) $text discard val3 remainder]} { append replText <$decl\ $value>$val3 DTD:ENTITY [array get options] $name [string trim $param] $delimiter$replText$delimiter set decl / set text $remainder set value {} set mode {} } else { # Remain in entity mode append replText <$decl\ $value>$text return -code continue } } ignore { upvar #0 $options(-statevariable) state if {[regexp {]](.*)$} $decl discard remainder]} { set state(condSections) [lreplace $state(condSections) end end] set decl $remainder set mode {} } elseif {[regexp {]](.*)$} $value discard remainder]} { set state(condSections) [lreplace $state(condSections) end end] regexp <[cl $::sgml::Wsp]*($::sgml::Name)(.*) $remainder discard decl value set mode {} } elseif {[regexp {]]>(.*)$} $text discard remainder]} { set state(condSections) [lreplace $state(condSections) end end] set decl / set value {} set text $remainder #regexp <[cl $::sgml::Wsp]*($::sgml::Name)([cl ^>]*)>(.*) $remainder discard decl value text set mode {} } else { set decl / } } comment { # Look for closing comment delimiter upvar #0 $options(-statevariable) state if {[regexp (.*?)--(.*)\$ $decl discard data1 remainder]} { } elseif {[regexp (.*?)--(.*)\$ $value discard data1 remainder]} { } elseif {[regexp (.*?)--(.*)\$ $text discard data1 remainder]} { } else { # comment continues append state(commentdata) <$decl\ $value>$text set decl / set value {} set text {} } } } return {} } # sgml::ParseDTD:ProcessMarkupDecl -- # # Process a single markup declaration # # Arguments: # opts configuration options # declVar pass-by-ref # valueVar pass-by-ref # delimiterVar pass-by-ref for current delimiter in force # nameVar pass-by-ref # modeVar pass-by-ref for current parser mode # replTextVar pass-by-ref # textVar pass-by-ref # paramVar pass-by-ref # # Results: # Depends on markup declaration. May change parser mode proc sgml::ParseDTD:ProcessMarkupDecl {opts declVar valueVar delimiterVar nameVar modeVar replTextVar textVar paramVar} { upvar 1 $modeVar mode upvar 1 $replTextVar replText upvar 1 $textVar text upvar 1 $declVar decl upvar 1 $valueVar value upvar 1 $nameVar name upvar 1 $delimiterVar delimiter upvar 1 $paramVar param variable declExpr variable ExternalEntityExpr array set options $opts upvar #0 $options(-statevariable) state switch -glob -- $decl { / { # continuation from entity processing } !ELEMENT { # Element declaration if {[regexp $declExpr $value discard tag cmodel]} { DTD:ELEMENT [array get options] $tag $cmodel } else { uplevel #0 $options(-errorcommand) [list illegaldeclaration "malformed element declaration around line $state(line)"] } } !ATTLIST { # Attribute list declaration variable declExpr if {[regexp $declExpr $value discard tag attdefns]} { if {[catch {DTD:ATTLIST [array get options] $tag $attdefns} err]} { #puts stderr "Stack trace: $::errorInfo\n***\n" # Atttribute parsing has bugs at the moment #return -code error "$err around line $state(line)" return {} } } else { uplevel #0 $options(-errorcommand) [list illegaldeclaration "malformed attribute list declaration around line $state(line)"] } } !ENTITY { # Entity declaration variable EntityExpr if {[regexp $EntityExpr $value discard param name value]} { # Entity replacement text may have a '>' character. # In this case, the real delimiter will be in the following # text. This is complicated by the possibility of there # being several '<','>' pairs in the replacement text. # At this point, we are searching for the matching quote delimiter. if {[regexp $ExternalEntityExpr $value]} { DTD:ENTITY [array get options] $name [string trim $param] $value } elseif {[regexp ("|')(.*?)\\1(.*) $value discard delimiter replText value]} { if {[string length [string trim $value]]} { uplevel #0 $options(-errorcommand) [list illegaldeclaration "malformed entity declaration around line $state(line)"] } else { DTD:ENTITY [array get options] $name [string trim $param] $delimiter$replText$delimiter } } elseif {[regexp ("|')(.*) $value discard delimiter replText]} { append replText >$text set text {} set mode entity } else { uplevel #0 $options(-errorcommand) [list illegaldeclaration "no delimiter for entity declaration around line $state(line)"] } } else { uplevel #0 $options(-errorcommand) [list illegaldeclaration "malformed entity declaration around line $state(line)"] } } !NOTATION { # Notation declaration if {[regexp $declExpr param discard tag notation]} { DTD:ENTITY [array get options] $tag $notation } else { uplevel #0 $options(-errorcommand) [list illegaldeclaration "malformed entity declaration around line $state(line)"] } } !--* { # Start of a comment if {[regexp !--(.*?)--\$ $decl discard data]} { if {[string length [string trim $value]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$value\""] } uplevel #0 $options(-commentcommand) [list $data] set decl / set value {} } elseif {[regexp -- ^(.*?)--\$ $value discard data2]} { regexp !--(.*)\$ $decl discard data1 uplevel #0 $options(-commentcommand) [list $data1\ $data2] set decl / set value {} } elseif {[regexp (.*?)-->(.*)\$ $text discard data3 remainder]} { regexp !--(.*)\$ $decl discard data1 uplevel #0 $options(-commentcommand) [list $data1\ $value>$data3] set decl / set value {} set text $remainder } else { regexp !--(.*)\$ $decl discard data1 set state(commentdata) $data1\ $value>$text set decl / set value {} set text {} set mode comment } } !*INCLUDE* - !*IGNORE* { if {$state(inInternalDTD)} { uplevel #0 $options(-errorcommand) [list illegalsection "conditional section not permitted in internal DTD subset around line $state(line)"] } if {[regexp {^!\[INCLUDE\[(.*)} $decl discard remainder]} { # Push conditional section stack, popped by ]]> sequence if {[regexp {(.*?)]]$} $remainder discard r2]} { # section closed immediately if {[string length [string trim $r2]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$r2\" in conditional section"] } } elseif {[regexp {(.*?)]](.*)} $value discard r2 r3]} { # section closed immediately if {[string length [string trim $r2]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$r2\" in conditional section"] } if {[string length [string trim $r3]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$r3\" in conditional section"] } } else { lappend state(condSections) INCLUDE set parser [$options(-cmd) entityparser] $parser parse $remainder\ $value> -dtdsubset external #$parser free if {[regexp {(.*?)]]>(.*)} $text discard t1 t2]} { if {[string length [string trim $t1]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$t1\""] } if {![llength $state(condSections)]} { uplevel #0 $options(-errorcommand) [list illegalsection "extraneous conditional section close"] } set state(condSections) [lreplace $state(condSections) end end] set text $t2 } } } elseif {[regexp {^!\[IGNORE\[(.*)} $decl discard remainder]} { # Set ignore mode. Still need a stack set mode ignore if {[regexp {(.*?)]]$} $remainder discard r2]} { # section closed immediately if {[string length [string trim $r2]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$r2\" in conditional section"] } } elseif {[regexp {(.*?)]](.*)} $value discard r2 r3]} { # section closed immediately if {[string length [string trim $r2]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$r2\" in conditional section"] } if {[string length [string trim $r3]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$r3\" in conditional section"] } } else { lappend state(condSections) IGNORE if {[regexp {(.*?)]]>(.*)} $text discard t1 t2]} { if {[string length [string trim $t1]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$t1\""] } if {![llength $state(condSections)]} { uplevel #0 $options(-errorcommand) [list illegalsection "extraneous conditional section close"] } set state(condSections) [lreplace $state(condSections) end end] set text $t2 } } } else { uplevel #0 $options(-errorcommand) [list illegaldeclaration "illegal markup declaration \"$decl\" around line $state(line)"] } } default { if {[regexp {^\?(.*)} $decl discard target]} { # Processing instruction } else { uplevel #0 $options(-errorcommand) [list illegaldeclaration "illegal markup declaration \"$decl\""] } } } return {} } # sgml::ParseDTD:External -- # # Parse the external DTD subset. # # Parameter entities are allowed anywhere. # # Arguments: # opts configuration options # dtd DTD data # # Results: # Markup declarations parsed may cause callback invocation proc sgml::ParseDTD:External {opts dtd} { variable MarkupDeclExpr variable MarkupDeclSub variable declExpr array set options $opts upvar #0 $options(parameterentities) PEnts upvar #0 $options(externalparameterentities) ExtPEnts upvar #0 $options(-statevariable) state # As with the internal DTD subset, watch out for # entities with angle brackets set mode {} ;# normal set delimiter {} set name {} set param {} set oldState 0 catch {set oldState $state(inInternalDTD)} set state(inInternalDTD) 0 # Initialise conditional section stack if {![info exists state(condSections)]} { set state(condSections) {} } set startCondSectionDepth [llength $state(condSections)] while {[string length $dtd]} { set progress 0 set PEref {} if {![string compare $mode "ignore"]} { set progress 1 if {[regexp {]]>(.*)} $dtd discard dtd]} { set remainder {} set mode {} ;# normal set state(condSections) [lreplace $state(condSections) end end] continue } else { uplevel #0 $options(-errorcommand) [list missingdelimiter "IGNORE conditional section closing delimiter not found"] } } elseif {[regexp ^(.*?)%($::sgml::Name)\;(.*)\$ $dtd discard data PEref remainder]} { set progress 1 } else { set data $dtd set dtd {} set remainder {} } # Tokenize the DTD (so far) # Protect Tcl special characters regsub -all {([{}\\])} $data {\\\1} dataP set n [regsub -all $MarkupDeclExpr $dataP $MarkupDeclSub dataP] if {$n} { set progress 1 # All but the last markup declaration should have no text set dataP [lrange "{} {} \{$dataP\}" 3 end] if {[llength $dataP] > 3} { foreach {decl value text} [lrange $dataP 0 [expr [llength $dataP] - 4]] { ParseDTD:EntityMode [array get options] mode replText decl value text $delimiter $name $param ParseDTD:ProcessMarkupDecl [array get options] decl value delimiter name mode repltextVar text param if {[string length [string trim $text]]} { # check for conditional section close if {[regexp {]]>(.*)$} $text discard text]} { if {[string length [string trim $text]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$text\""] } if {![llength $state(condSections)]} { uplevel #0 $options(-errorcommand) [list illegalsection "extraneous conditional section close"] } set state(condSections) [lreplace $state(condSections) end end] if {![string compare $mode "ignore"]} { set mode {} ;# normal } } else { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$text\""] } } } } # Do the last declaration foreach {decl value text} [lrange $dataP [expr [llength $dataP] - 3] end] { ParseDTD:EntityMode [array get options] mode replText decl value text $delimiter $name $param ParseDTD:ProcessMarkupDecl [array get options] decl value delimiter name mode repltextVar text param } } # Now expand the PE reference, if any switch -glob $mode,[string length $PEref],$n { ignore,0,* { set dtd $text } ignore,*,* { set dtd $text$remainder } *,0,0 { set dtd $data } *,0,* { set dtd $text } *,*,0 { if {[catch {append data $PEnts($PEref)}]} { if {[info exists ExtPEnts($PEref)]} { set externalParser [$options(-cmd) entityparser] $externalParser parse $ExtPEnts($PEref) -dtdsubset external #$externalParser free } else { uplevel #0 $options(-errorcommand) [list entityundeclared "parameter entity \"$PEref\" not declared"] } } set dtd $data$remainder } default { if {[catch {append text $PEnts($PEref)}]} { if {[info exists ExtPEnts($PEref)]} { set externalParser [$options(-cmd) entityparser] $externalParser parse $ExtPEnts($PEref) -dtdsubset external #$externalParser free } else { uplevel #0 $options(-errorcommand) [list entityundeclared "parameter entity \"$PEref\" not declared"] } } set dtd $text$remainder } } # Check whether a conditional section has been terminated if {[regexp {^(.*?)]]>(.*)$} $dtd discard t1 t2]} { if {![regexp <.*> $t1]} { if {[string length [string trim $t1]]} { uplevel #0 $options(-errorcommand) [list unexpectedtext "unexpected text \"$t1\""] } if {![llength $state(condSections)]} { uplevel #0 $options(-errorcommand) [list illegalsection "extraneous conditional section close"] } set state(condSections) [lreplace $state(condSections) end end] if {![string compare $mode "ignore"]} { set mode {} ;# normal } set dtd $t2 set progress 1 } } if {!$progress} { # No parameter entity references were found and # the text does not contain a well-formed markup declaration # Avoid going into an infinite loop upvar #0 $options(-errorcommand) [list syntaxerror "external entity does not contain well-formed markup declaration"] break } } set state(inInternalDTD) $oldState # Check that conditional sections have been closed properly if {[llength $state(condSections)] > $startCondSectionDepth} { uplevel #0 $options(-errorcommand) [list syntaxerror "[lindex $state(condSections) end] conditional section not closed"] } if {[llength $state(condSections)] < $startCondSectionDepth} { uplevel #0 $options(-errorcommand) [list syntaxerror "too many conditional section closures"] } return {} } # Procedures for handling the various declarative elements in a DTD. # New elements may be added by creating a procedure of the form # parse:DTD:_element_ # For each of these procedures, the various regular expressions they use # are created outside of the proc to avoid overhead at runtime # sgml::DTD:ELEMENT -- # # defines an element. # # The content model for the element is stored in the contentmodel array, # indexed by the element name. The content model is parsed into the # following list form: # # {} Content model is EMPTY. # Indicated by an empty list. # * Content model is ANY. # Indicated by an asterix. # {ELEMENT ...} # Content model is element-only. # {MIXED {element1 element2 ...}} # Content model is mixed (PCDATA and elements). # The second element of the list contains the # elements that may occur. #PCDATA is assumed # (ie. the list is normalised). # # Arguments: # opts configuration options # name element GI # modspec unparsed content model specification proc sgml::DTD:ELEMENT {opts name modspec} { variable Wsp array set options $opts upvar #0 $options(elementdecls) elements if {$options(-validate) && [info exists elements($name)]} { eval $options(-errorcommand) [list elementdeclared "element \"$name\" already declared"] } else { switch -- $modspec { EMPTY { set elements($name) {} uplevel #0 $options(-elementdeclcommand) $name {{}} } ANY { set elements($name) * uplevel #0 $options(-elementdeclcommand) $name * } default { # Don't parse the content model for now, # just pass the model to the application if {0 && [regexp [format {^\([%s]*#PCDATA[%s]*(\|([^)]+))?[%s]*\)*[%s]*$} $Wsp $Wsp $Wsp $Wsp] discard discard mtoks]} { set cm($name) [list MIXED [split $mtoks |]] } elseif {0} { if {[catch {CModelParse $state(state) $value} result]} { eval $options(-errorcommand) [list element? $result] } else { set cm($id) [list ELEMENT $result] } } else { set elements($name) $modspec uplevel #0 $options(-elementdeclcommand) $name [list $modspec] } } } } } # sgml::CModelParse -- # # Parse an element content model (non-mixed). # A syntax tree is constructed. # A transition table is built next. # # This is going to need alot of work! # # Arguments: # state state array variable # value the content model data # # Results: # A Tcl list representing the content model. proc sgml::CModelParse {state value} { upvar #0 $state var # First build syntax tree set syntaxTree [CModelMakeSyntaxTree $state $value] # Build transition table set transitionTable [CModelMakeTransitionTable $state $syntaxTree] return [list $syntaxTree $transitionTable] } # sgml::CModelMakeSyntaxTree -- # # Construct a syntax tree for the regular expression. # # Syntax tree is represented as a Tcl list: # rep {:choice|:seq {{rep list1} {rep list2} ...}} # where: rep is repetition character, *, + or ?. {} for no repetition # listN is nested expression or Name # # Arguments: # spec Element specification # # Results: # Syntax tree for element spec as nested Tcl list. # # Examples: # (memo) # {} {:seq {{} memo}} # (front, body, back?) # {} {:seq {{} front} {{} body} {? back}} # (head, (p | list | note)*, div2*) # {} {:seq {{} head} {* {:choice {{} p} {{} list} {{} note}}} {* div2}} # (p | a | ul)+ # + {:choice {{} p} {{} a} {{} ul}} proc sgml::CModelMakeSyntaxTree {state spec} { upvar #0 $state var variable Wsp variable name # Translate the spec into a Tcl list. # None of the Tcl special characters are allowed in a content model spec. if {[regexp {\$|\[|\]|\{|\}} $spec]} { return -code error "illegal characters in specification" } regsub -all [format {(%s)[%s]*(\?|\*|\+)?[%s]*(,|\|)?} $name $Wsp $Wsp] $spec [format {%sCModelSTname %s {\1} {\2} {\3}} \n $state] spec regsub -all {\(} $spec "\nCModelSTopenParen $state " spec regsub -all [format {\)[%s]*(\?|\*|\+)?[%s]*(,|\|)?} $Wsp $Wsp] $spec [format {%sCModelSTcloseParen %s {\1} {\2}} \n $state] spec array set var {stack {} state start} eval $spec # Peel off the outer seq, its redundant return [lindex [lindex $var(stack) 1] 0] } # sgml::CModelSTname -- # # Processes a name in a content model spec. # # Arguments: # state state array variable # name name specified # rep repetition operator # cs choice or sequence delimiter # # Results: # See CModelSTcp. proc sgml::CModelSTname {state name rep cs args} { if {[llength $args]} { return -code error "syntax error in specification: \"$args\"" } CModelSTcp $state $name $rep $cs } # sgml::CModelSTcp -- # # Process a content particle. # # Arguments: # state state array variable # name name specified # rep repetition operator # cs choice or sequence delimiter # # Results: # The content particle is added to the current group. proc sgml::CModelSTcp {state cp rep cs} { upvar #0 $state var switch -glob -- [lindex $var(state) end]=$cs { start= { set var(state) [lreplace $var(state) end end end] # Add (dummy) grouping, either choice or sequence will do CModelSTcsSet $state , CModelSTcpAdd $state $cp $rep } :choice= - :seq= { set var(state) [lreplace $var(state) end end end] CModelSTcpAdd $state $cp $rep } start=| - start=, { set var(state) [lreplace $var(state) end end [expr {$cs == "," ? ":seq" : ":choice"}]] CModelSTcsSet $state $cs CModelSTcpAdd $state $cp $rep } :choice=| - :seq=, { CModelSTcpAdd $state $cp $rep } :choice=, - :seq=| { return -code error "syntax error in specification: incorrect delimiter after \"$cp\", should be \"[expr {$cs == "," ? "|" : ","}]\"" } end=* { return -code error "syntax error in specification: no delimiter before \"$cp\"" } default { return -code error "syntax error" } } } # sgml::CModelSTcsSet -- # # Start a choice or sequence on the stack. # # Arguments: # state state array # cs choice oir sequence # # Results: # state is modified: end element of state is appended. proc sgml::CModelSTcsSet {state cs} { upvar #0 $state var set cs [expr {$cs == "," ? ":seq" : ":choice"}] if {[llength $var(stack)]} { set var(stack) [lreplace $var(stack) end end $cs] } else { set var(stack) [list $cs {}] } } # sgml::CModelSTcpAdd -- # # Append a content particle to the top of the stack. # # Arguments: # state state array # cp content particle # rep repetition # # Results: # state is modified: end element of state is appended. proc sgml::CModelSTcpAdd {state cp rep} { upvar #0 $state var if {[llength $var(stack)]} { set top [lindex $var(stack) end] lappend top [list $rep $cp] set var(stack) [lreplace $var(stack) end end $top] } else { set var(stack) [list $rep $cp] } } # sgml::CModelSTopenParen -- # # Processes a '(' in a content model spec. # # Arguments: # state state array # # Results: # Pushes stack in state array. proc sgml::CModelSTopenParen {state args} { upvar #0 $state var if {[llength $args]} { return -code error "syntax error in specification: \"$args\"" } lappend var(state) start lappend var(stack) [list {} {}] } # sgml::CModelSTcloseParen -- # # Processes a ')' in a content model spec. # # Arguments: # state state array # rep repetition # cs choice or sequence delimiter # # Results: # Stack is popped, and former top of stack is appended to previous element. proc sgml::CModelSTcloseParen {state rep cs args} { upvar #0 $state var if {[llength $args]} { return -code error "syntax error in specification: \"$args\"" } set cp [lindex $var(stack) end] set var(stack) [lreplace $var(stack) end end] set var(state) [lreplace $var(state) end end] CModelSTcp $state $cp $rep $cs } # sgml::CModelMakeTransitionTable -- # # Given a content model's syntax tree, constructs # the transition table for the regular expression. # # See "Compilers, Principles, Techniques, and Tools", # Aho, Sethi and Ullman. Section 3.9, algorithm 3.5. # # Arguments: # state state array variable # st syntax tree # # Results: # The transition table is returned, as a key/value Tcl list. proc sgml::CModelMakeTransitionTable {state st} { upvar #0 $state var # Construct nullable, firstpos and lastpos functions array set var {number 0} foreach {nullable firstpos lastpos} [ \ TraverseDepth1st $state $st { # Evaluated for leaf nodes # Compute nullable(n) # Compute firstpos(n) # Compute lastpos(n) set nullable [nullable leaf $rep $name] set firstpos [list {} $var(number)] set lastpos [list {} $var(number)] set var(pos:$var(number)) $name } { # Evaluated for nonterminal nodes # Compute nullable, firstpos, lastpos set firstpos [firstpos $cs $firstpos $nullable] set lastpos [lastpos $cs $lastpos $nullable] set nullable [nullable nonterm $rep $cs $nullable] } \ ] break set accepting [incr var(number)] set var(pos:$accepting) # # var(pos:N) maps from position to symbol. # Construct reverse map for convenience. # NB. A symbol may appear in more than one position. # var is about to be reset, so use different arrays. foreach {pos symbol} [array get var pos:*] { set pos [lindex [split $pos :] 1] set pos2symbol($pos) $symbol lappend sym2pos($symbol) $pos } # Construct the followpos functions catch {unset var} followpos $state $st $firstpos $lastpos # Construct transition table # Dstates is [union $marked $unmarked] set unmarked [list [lindex $firstpos 1]] while {[llength $unmarked]} { set T [lindex $unmarked 0] lappend marked $T set unmarked [lrange $unmarked 1 end] # Find which input symbols occur in T set symbols {} foreach pos $T { if {$pos != $accepting && [lsearch $symbols $pos2symbol($pos)] < 0} { lappend symbols $pos2symbol($pos) } } foreach a $symbols { set U {} foreach pos $sym2pos($a) { if {[lsearch $T $pos] >= 0} { # add followpos($pos) if {$var($pos) == {}} { lappend U $accepting } else { eval lappend U $var($pos) } } } set U [makeSet $U] if {[llength $U] && [lsearch $marked $U] < 0 && [lsearch $unmarked $U] < 0} { lappend unmarked $U } set Dtran($T,$a) $U } } return [list [array get Dtran] [array get sym2pos] $accepting] } # sgml::followpos -- # # Compute the followpos function, using the already computed # firstpos and lastpos. # # Arguments: # state array variable to store followpos functions # st syntax tree # firstpos firstpos functions for the syntax tree # lastpos lastpos functions # # Results: # followpos functions for each leaf node, in name/value format proc sgml::followpos {state st firstpos lastpos} { upvar #0 $state var switch -- [lindex [lindex $st 1] 0] { :seq { for {set i 1} {$i < [llength [lindex $st 1]]} {incr i} { followpos $state [lindex [lindex $st 1] $i] \ [lindex [lindex $firstpos 0] [expr $i - 1]] \ [lindex [lindex $lastpos 0] [expr $i - 1]] foreach pos [lindex [lindex [lindex $lastpos 0] [expr $i - 1]] 1] { eval lappend var($pos) [lindex [lindex [lindex $firstpos 0] $i] 1] set var($pos) [makeSet $var($pos)] } } } :choice { for {set i 1} {$i < [llength [lindex $st 1]]} {incr i} { followpos $state [lindex [lindex $st 1] $i] \ [lindex [lindex $firstpos 0] [expr $i - 1]] \ [lindex [lindex $lastpos 0] [expr $i - 1]] } } default { # No action at leaf nodes } } switch -- [lindex $st 0] { ? { # We having nothing to do here ! Doing the same as # for * effectively converts this qualifier into the other. } * { foreach pos [lindex $lastpos 1] { eval lappend var($pos) [lindex $firstpos 1] set var($pos) [makeSet $var($pos)] } } } } # sgml::TraverseDepth1st -- # # Perform depth-first traversal of a tree. # A new tree is constructed, with each node computed by f. # # Arguments: # state state array variable # t The tree to traverse, a Tcl list # leaf Evaluated at a leaf node # nonTerm Evaluated at a nonterminal node # # Results: # A new tree is returned. proc sgml::TraverseDepth1st {state t leaf nonTerm} { upvar #0 $state var set nullable {} set firstpos {} set lastpos {} switch -- [lindex [lindex $t 1] 0] { :seq - :choice { set rep [lindex $t 0] set cs [lindex [lindex $t 1] 0] foreach child [lrange [lindex $t 1] 1 end] { foreach {childNullable childFirstpos childLastpos} \ [TraverseDepth1st $state $child $leaf $nonTerm] break lappend nullable $childNullable lappend firstpos $childFirstpos lappend lastpos $childLastpos } eval $nonTerm } default { incr var(number) set rep [lindex [lindex $t 0] 0] set name [lindex [lindex $t 1] 0] eval $leaf } } return [list $nullable $firstpos $lastpos] } # sgml::firstpos -- # # Computes the firstpos function for a nonterminal node. # # Arguments: # cs node type, choice or sequence # firstpos firstpos functions for the subtree # nullable nullable functions for the subtree # # Results: # firstpos function for this node is returned. proc sgml::firstpos {cs firstpos nullable} { switch -- $cs { :seq { set result [lindex [lindex $firstpos 0] 1] for {set i 0} {$i < [llength $nullable]} {incr i} { if {[lindex [lindex $nullable $i] 1]} { eval lappend result [lindex [lindex $firstpos [expr $i + 1]] 1] } else { break } } } :choice { foreach child $firstpos { eval lappend result $child } } } return [list $firstpos [makeSet $result]] } # sgml::lastpos -- # # Computes the lastpos function for a nonterminal node. # Same as firstpos, only logic is reversed # # Arguments: # cs node type, choice or sequence # lastpos lastpos functions for the subtree # nullable nullable functions forthe subtree # # Results: # lastpos function for this node is returned. proc sgml::lastpos {cs lastpos nullable} { switch -- $cs { :seq { set result [lindex [lindex $lastpos end] 1] for {set i [expr [llength $nullable] - 1]} {$i >= 0} {incr i -1} { if {[lindex [lindex $nullable $i] 1]} { eval lappend result [lindex [lindex $lastpos $i] 1] } else { break } } } :choice { foreach child $lastpos { eval lappend result $child } } } return [list $lastpos [makeSet $result]] } # sgml::makeSet -- # # Turn a list into a set, ie. remove duplicates. # # Arguments: # s a list # # Results: # A set is returned, which is a list with duplicates removed. proc sgml::makeSet s { foreach r $s { if {[llength $r]} { set unique($r) {} } } return [array names unique] } # sgml::nullable -- # # Compute the nullable function for a node. # # Arguments: # nodeType leaf or nonterminal # rep repetition applying to this node # name leaf node: symbol for this node, nonterm node: choice or seq node # subtree nonterm node: nullable functions for the subtree # # Results: # Returns nullable function for this branch of the tree. proc sgml::nullable {nodeType rep name {subtree {}}} { switch -glob -- $rep:$nodeType { :leaf - +:leaf { return [list {} 0] } \\*:leaf - \\?:leaf { return [list {} 1] } \\*:nonterm - \\?:nonterm { return [list $subtree 1] } :nonterm - +:nonterm { switch -- $name { :choice { set result 0 foreach child $subtree { set result [expr $result || [lindex $child 1]] } } :seq { set result 1 foreach child $subtree { set result [expr $result && [lindex $child 1]] } } } return [list $subtree $result] } } } # sgml::DTD:ATTLIST -- # # defines an attribute list. # # Arguments: # opts configuration opions # name Element GI # attspec unparsed attribute definitions # # Results: # Attribute list variables are modified. proc sgml::DTD:ATTLIST {opts name attspec} { variable attlist_exp variable attlist_enum_exp variable attlist_fixed_exp array set options $opts # Parse the attribute list. If it were regular, could just use foreach, # but some attributes may have values. regsub -all {([][$\\])} $attspec {\\\1} attspec regsub -all $attlist_exp $attspec "\}\nDTDAttribute {$options(-attlistdeclcommand)} $name $options(attlistdecls) {\\1} {\\2} {\\3} {} \{" attspec regsub -all $attlist_enum_exp $attspec "\}\nDTDAttribute {$options(-attlistdeclcommand)} $name $options(attlistdecls) {\\1} {\\2} {} {\\4} \{" attspec regsub -all $attlist_fixed_exp $attspec "\}\nDTDAttribute {$options(-attlistdeclcommand)} $name $options(attlistdecls) {\\1} {\\2} {\\3} {\\4} \{" attspec eval "noop \{$attspec\}" return {} } # sgml::DTDAttribute -- # # Parse definition of a single attribute. # # Arguments: # callback attribute defn callback # name element name # var array variable # att attribute name # type type of this attribute # default default value of the attribute # value other information # text other text (should be empty) # # Results: # Attribute defn added to array, unless it already exists proc sgml::DTDAttribute args { # BUG: Some problems with parameter passing - deal with it later foreach {callback name var att type default value text} $args break upvar #0 $var atts if {[string length [string trim $text]]} { return -code error "unexpected text \"$text\" in attribute definition" } # What about overridden attribute defns? # A non-validating app may want to know about them # (eg. an editor) if {![info exists atts($name/$att)]} { set atts($name/$att) [list $type $default $value] uplevel #0 $callback [list $name $att $type $default $value] } return {} } # sgml::DTD:ENTITY -- # # declaration. # # Callbacks: # -entitydeclcommand for general entity declaration # -unparsedentitydeclcommand for unparsed external entity declaration # -parameterentitydeclcommand for parameter entity declaration # # Arguments: # opts configuration options # name name of entity being defined # param whether a parameter entity is being defined # value unparsed replacement text # # Results: # Modifies the caller's entities array variable proc sgml::DTD:ENTITY {opts name param value} { array set options $opts if {[string compare % $param]} { # Entity declaration - general or external upvar #0 $options(entities) ents upvar #0 $options(extentities) externals if {[info exists ents($name)] || [info exists externals($name)]} { eval $options(-warningcommand) entity [list "entity \"$name\" already declared"] } else { if {[catch {uplevel #0 $options(-parseentitydeclcommand) [list $value]} value]} { return -code error "unable to parse entity declaration due to \"$value\"" } switch -glob [lindex $value 0],[lindex $value 3] { internal, { set ents($name) [EntitySubst [array get options] [lindex $value 1]] uplevel #0 $options(-entitydeclcommand) [list $name $ents($name)] } internal,* { return -code error "unexpected NDATA declaration" } external, { set externals($name) [lrange $value 1 2] uplevel #0 $options(-entitydeclcommand) [eval list $name [lrange $value 1 2]] } external,* { set externals($name) [lrange $value 1 3] uplevel #0 $options(-unparsedentitydeclcommand) [eval list $name [lrange $value 1 3]] } default { return -code error "internal error: unexpected parser state" } } } } else { # Parameter entity declaration upvar #0 $options(parameterentities) PEnts upvar #0 $options(externalparameterentities) ExtPEnts if {[info exists PEnts($name)] || [info exists ExtPEnts($name)]} { eval $options(-warningcommand) parameterentity [list "parameter entity \"$name\" already declared"] } else { if {[catch {uplevel #0 $options(-parseentitydeclcommand) [list $value]} value]} { return -code error "unable to parse parameter entity declaration due to \"$value\"" } if {[string length [lindex $value 3]]} { return -code error "NDATA illegal in parameter entity declaration" } switch [lindex $value 0] { internal { # Substitute character references and PEs (XML: 4.5) set value [EntitySubst [array get options] [lindex $value 1]] set PEnts($name) $value uplevel #0 $options(-parameterentitydeclcommand) [list $name $value] } external - default { # Get the replacement text now. # Could wait until the first reference, but easier # to just do it now. set token [uri::geturl [uri::resolve $options(-baseuri) [lindex $value 1]]] set ExtPEnts($name) [lindex [array get $token data] 1] uplevel #0 $options(-parameterentitydeclcommand) [eval list $name [lrange $value 1 2]] } } } } } # sgml::EntitySubst -- # # Perform entity substitution on an entity replacement text. # This differs slightly from other substitution procedures, # because only parameter and character entity substitution # is performed, not general entities. # See XML Rec. section 4.5. # # Arguments: # opts configuration options # value Literal entity value # # Results: # Expanded replacement text proc sgml::EntitySubst {opts value} { array set options $opts # Protect Tcl special characters regsub -all {([{}\\])} $value {\\\1} value # Find entity references regsub -all (&#\[0-9\]+|&#x\[0-9a-fA-F\]+|%${::sgml::Name})\; $value "\[EntitySubstValue [list $options(parameterentities)] {\\1}\]" value set result [subst $value] return $result } # sgml::EntitySubstValue -- # # Handle a single character or parameter entity substitution # # Arguments: # PEvar array variable containing PE declarations # ref character or parameter entity reference # # Results: # Replacement text proc sgml::EntitySubstValue {PEvar ref} { # SRB: Bug fix 2008-11-18 #812051: surround case labels in braces for compatibility with Freewrap switch -glob -- $ref { {&#x*} { scan [string range $ref 3 end] %x hex return [format %c $hex] } {&#*} { return [format %c [string range $ref 2 end]] } {%*} { upvar #0 $PEvar PEs set ref [string range $ref 1 end] if {[info exists PEs($ref)]} { return $PEs($ref) } else { return -code error "parameter entity \"$ref\" not declared" } } default { return -code error "internal error - unexpected entity reference" } } return {} } # sgml::DTD:NOTATION -- # # Process notation declaration # # Arguments: # opts configuration options # name notation name # value unparsed notation spec proc sgml::DTD:NOTATION {opts name value} { return {} variable notation_exp upvar opts state if {[regexp $notation_exp $value x scheme data] == 2} { } else { eval $state(-errorcommand) [list notationvalue "notation value \"$value\" incorrectly specified"] } } # sgml::ResolveEntity -- # # Default entity resolution routine # # Arguments: # cmd command of parent parser # base base URL for relative URLs # sysId system identifier # pubId public identifier proc sgml::ResolveEntity {cmd base sysId pubId} { variable ParseEventNum if {[catch {uri::resolve $base $sysId} url]} { return -code error "unable to resolve system identifier \"$sysId\"" } if {[catch {uri::geturl $url} token]} { return -code error "unable to retrieve external entity \"$url\" for system identifier \"$sysId\"" } upvar #0 $token data set parser [uplevel #0 $cmd entityparser] set body {} catch {set body $data(body)} catch {set body $data(data)} if {[string length $body]} { uplevel #0 $parser parse [list $body] -dtdsubset external } $parser free return {} } tclxml-3.3~svn11.orig/tclxml-tcl/tclparser-8.1.tcl0000755000000000000000000003704211215700771020512 0ustar rootroot# tclparser-8.1.tcl -- # # This file provides a Tcl implementation of a XML parser. # This file supports Tcl 8.1. # # See xml-8.[01].tcl for definitions of character sets and # regular expressions. # # Copyright (c) 2005-2009 by Explain. # http://www.explain.com.au/ # Copyright (c) 1998-2003 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: tclparser-8.1.tcl,v 1.26.2.1 2005/12/28 06:49:51 balls Exp $ package require Tcl 8.1 package provide xml::tclparser 3.3 package require xmldefs 3.3 package require sgmlparser 1.0 namespace eval xml::tclparser { namespace export create createexternal externalentity parse configure get delete # Tokenising expressions variable tokExpr $::xml::tokExpr variable substExpr $::xml::substExpr # Register this parser class ::xml::parserclass create tcl \ -createcommand [namespace code create] \ -createentityparsercommand [namespace code createentityparser] \ -parsecommand [namespace code parse] \ -configurecommand [namespace code configure] \ -deletecommand [namespace code delete] \ -resetcommand [namespace code reset] } # xml::tclparser::create -- # # Creates XML parser object. # # Arguments: # name unique identifier for this instance # # Results: # The state variable is initialised. proc xml::tclparser::create name { # Initialise state variable upvar \#0 [namespace current]::$name parser array set parser [list -name $name \ -cmd [uplevel 3 namespace current]::$name \ -final 1 \ -validate 0 \ -statevariable [namespace current]::$name \ -baseuri {} \ internaldtd {} \ entities [namespace current]::Entities$name \ extentities [namespace current]::ExtEntities$name \ parameterentities [namespace current]::PEntities$name \ externalparameterentities [namespace current]::ExtPEntities$name \ elementdecls [namespace current]::ElDecls$name \ attlistdecls [namespace current]::AttlistDecls$name \ notationdecls [namespace current]::NotDecls$name \ depth 0 \ leftover {} \ ] # Initialise entities with predefined set array set [namespace current]::Entities$name [array get ::sgml::EntityPredef] return $parser(-cmd) } # xml::tclparser::createentityparser -- # # Creates XML parser object for an entity. # # Arguments: # name name for the new parser # parent name of parent parser # # Results: # The state variable is initialised. proc xml::tclparser::createentityparser {parent name} { upvar #0 [namespace current]::$parent p # Initialise state variable upvar \#0 [namespace current]::$name external array set external [array get p] regsub $parent $p(-cmd) {} parentns array set external [list -name $name \ -cmd $parentns$name \ -statevariable [namespace current]::$name \ internaldtd {} \ line 0 \ ] incr external(depth) return $external(-cmd) } # xml::tclparser::configure -- # # Configures a XML parser object. # # Arguments: # name unique identifier for this instance # args option name/value pairs # # Results: # May change values of config options proc xml::tclparser::configure {name args} { upvar \#0 [namespace current]::$name parser # BUG: very crude, no checks for illegal args # Mats: Should be synced with sgmlparser.tcl set options {-elementstartcommand -elementendcommand \ -characterdatacommand -processinginstructioncommand \ -externalentitycommand -xmldeclcommand \ -doctypecommand -commentcommand \ -entitydeclcommand -unparsedentitydeclcommand \ -parameterentitydeclcommand -notationdeclcommand \ -elementdeclcommand -attlistdeclcommand \ -paramentityparsing -defaultexpandinternalentities \ -startdoctypedeclcommand -enddoctypedeclcommand \ -entityreferencecommand -warningcommand \ -defaultcommand -unknownencodingcommand -notstandalonecommand \ -startcdatasectioncommand -endcdatasectioncommand \ -errorcommand -final \ -validate -baseuri -baseurl \ -name -cmd -emptyelement \ -parseattributelistcommand -parseentitydeclcommand \ -normalize -internaldtd -dtdsubset \ -reportempty -ignorewhitespace \ -reportempty \ } set usage [join $options ", "] regsub -all -- - $options {} options set pat ^-([join $options |])$ foreach {flag value} $args { if {[regexp $pat $flag]} { # Validate numbers if {[info exists parser($flag)] && \ [string is integer -strict $parser($flag)] && \ ![string is integer -strict $value]} { return -code error "Bad value for $flag ($value), must be integer" } set parser($flag) $value } else { return -code error "Unknown option $flag, can be: $usage" } } # Backward-compatibility: -baseuri is a synonym for -baseurl catch {set parser(-baseuri) $parser(-baseurl)} return {} } # xml::tclparser::parse -- # # Parses document instance data # # Arguments: # name parser object # xml data # args configuration options # # Results: # Callbacks are invoked proc xml::tclparser::parse {name xml args} { array set options $args upvar \#0 [namespace current]::$name parser variable tokExpr variable substExpr # Mats: if {[llength $args]} { eval {configure $name} $args } set parseOptions [list \ -emptyelement [namespace code ParseEmpty] \ -parseattributelistcommand [namespace code ParseAttrs] \ -parseentitydeclcommand [namespace code ParseEntity] \ -normalize 0] eval lappend parseOptions \ [array get parser -*command] \ [array get parser -reportempty] \ [array get parser -ignorewhitespace] \ [array get parser -name] \ [array get parser -cmd] \ [array get parser -baseuri] \ [array get parser -validate] \ [array get parser -final] \ [array get parser -defaultexpandinternalentities] \ [array get parser entities] \ [array get parser extentities] \ [array get parser parameterentities] \ [array get parser externalparameterentities] \ [array get parser elementdecls] \ [array get parser attlistdecls] \ [array get parser notationdecls] # Mats: # If -final 0 we also need to maintain the state with a -statevariable ! if {!$parser(-final)} { eval lappend parseOptions [array get parser -statevariable] } set dtdsubset no catch {set dtdsubset $options(-dtdsubset)} switch -- $dtdsubset { internal { # Bypass normal parsing lappend parseOptions -statevariable $parser(-statevariable) array set intOptions [array get ::sgml::StdOptions] array set intOptions $parseOptions ::sgml::ParseDTD:Internal [array get intOptions] $xml return {} } external { # Bypass normal parsing lappend parseOptions -statevariable $parser(-statevariable) array set intOptions [array get ::sgml::StdOptions] array set intOptions $parseOptions ::sgml::ParseDTD:External [array get intOptions] $xml return {} } default { # Pass through to normal processing } } lappend tokenOptions \ -internaldtdvariable [namespace current]::${name}(internaldtd) # Mats: If -final 0 we also need to maintain the state with a -statevariable ! if {!$parser(-final)} { eval lappend tokenOptions [array get parser -statevariable] \ [array get parser -final] } # Mats: # Why not the first four? Just padding? Lrange undos \n interp. # It is necessary to have the first four as well if chopped off in # middle of pcdata. set tokenised [lrange \ [eval {::sgml::tokenise $xml $tokExpr $substExpr} $tokenOptions] \ 0 end] lappend parseOptions -internaldtd [list $parser(internaldtd)] eval ::sgml::parseEvent [list $tokenised] $parseOptions return {} } # xml::tclparser::ParseEmpty -- Tcl 8.1+ version # # Used by parser to determine whether an element is empty. # This is usually dead easy in XML, but as always not quite. # Have to watch out for empty element syntax # # Arguments: # tag element name # attr attribute list (raw) # e End tag delimiter. # # Results: # Return value of e proc xml::tclparser::ParseEmpty {tag attr e} { switch -glob [string length $e],[regexp "/[::xml::cl $::xml::Wsp]*$" $attr] { 0,0 { return {} } 0,* { return / } default { return $e } } } # xml::tclparser::ParseAttrs -- Tcl 8.1+ version # # Parse element attributes. # # There are two forms for name-value pairs: # # name="value" # name='value' # # Arguments: # opts parser options # attrs attribute string given in a tag # # Results: # Returns a Tcl list representing the name-value pairs in the # attribute string # # A ">" occurring in the attribute list causes problems when parsing # the XML. This manifests itself by an unterminated attribute value # and a ">" appearing the element text. # In this case return a three element list; # the message "unterminated attribute value", the attribute list it # did manage to parse and the remainder of the attribute list. proc xml::tclparser::ParseAttrs {opts attrs} { set result {} while {[string length [string trim $attrs]]} { if {[regexp [::sgml::cl $::xml::Wsp]*($::xml::Name)[::sgml::cl $::xml::Wsp]*=[::sgml::cl $::xml::Wsp]*("|')([::sgml::cl ^<]*?)\\2(.*) $attrs discard attrName delimiter value attrs]} { lappend result $attrName [NormalizeAttValue $opts $value] } elseif {[regexp [::sgml::cl $::xml::Wsp]*$::xml::Name[::sgml::cl $::xml::Wsp]*=[::sgml::cl $::xml::Wsp]*("|')[::sgml::cl ^<]*\$ $attrs]} { return -code error [list {unterminated attribute value} $result $attrs] } else { return -code error "invalid attribute list" } } return $result } # xml::tclparser::NormalizeAttValue -- # # Perform attribute value normalisation. This involves: # . character references are appended to the value # . entity references are recursively processed and replacement value appended # . whitespace characters cause a space to be appended # . other characters appended as-is # # Arguments: # opts parser options # value unparsed attribute value # # Results: # Normalised value returned. proc xml::tclparser::NormalizeAttValue {opts value} { # sgmlparser already has backslashes protected # Protect Tcl specials regsub -all {([][$])} $value {\\\1} value # Deal with white space regsub -all "\[$::xml::Wsp\]" $value { } value # Find entity refs regsub -all {&([^;]+);} $value {[NormalizeAttValue:DeRef $opts {\1}]} value return [subst $value] } # xml::tclparser::NormalizeAttValue:DeRef -- # # Handler to normalize attribute values # # Arguments: # opts parser options # ref entity reference # # Results: # Returns character proc xml::tclparser::NormalizeAttValue:DeRef {opts ref} { # SRB: Bug fix 2008-11-18 #812051: surround case labels in braces for compatibility with Freewrap switch -glob -- $ref { {#x*} { scan [string range $ref 2 end] %x value set char [format %c $value] # Check that the char is legal for XML if {[regexp [format {^[%s]$} $::xml::Char] $char]} { return $char } else { return -code error "illegal character" } } {#*} { scan [string range $ref 1 end] %d value set char [format %c $value] # Check that the char is legal for XML if {[regexp [format {^[%s]$} $::xml::Char] $char]} { return $char } else { return -code error "illegal character" } } lt - gt - amp - quot - apos { array set map {lt < gt > amp & quot \" apos '} return $map($ref) } default { # A general entity. Must resolve to a text value - no element structure. array set options $opts upvar #0 $options(entities) map if {[info exists map($ref)]} { if {[regexp < $map($ref)]} { return -code error "illegal character \"<\" in attribute value" } if {![regexp & $map($ref)]} { # Simple text replacement return $map($ref) } # There are entity references in the replacement text. # Can't use child entity parser since must catch element structures return [NormalizeAttValue $opts $map($ref)] } elseif {[string compare $options(-entityreferencecommand) "::sgml::noop"]} { set result [uplevel #0 $options(-entityreferencecommand) [list $ref]] return $result } else { return -code error "unable to resolve entity reference \"$ref\"" } } } } # xml::tclparser::ParseEntity -- # # Parse general entity declaration # # Arguments: # data text to parse # # Results: # Tcl list containing entity declaration proc xml::tclparser::ParseEntity data { set data [string trim $data] if {[regexp $::sgml::ExternalEntityExpr $data discard type delimiter1 id1 discard delimiter2 id2 optNDATA ndata]} { switch $type { PUBLIC { return [list external $id2 $id1 $ndata] } SYSTEM { return [list external $id1 {} $ndata] } } } elseif {[regexp {^("|')(.*?)\1$} $data discard delimiter value]} { return [list internal $value] } else { return -code error "badly formed entity declaration" } } # xml::tclparser::delete -- # # Destroy parser data # # Arguments: # name parser object # # Results: # Parser data structure destroyed proc xml::tclparser::delete name { upvar \#0 [namespace current]::$name parser catch {::sgml::ParserDelete $parser(-statevariable)} catch {unset parser} return {} } # xml::tclparser::get -- # # Retrieve additional information from the parser # # Arguments: # name parser object # method info to retrieve # args additional arguments for method # # Results: # Depends on method proc xml::tclparser::get {name method args} { upvar #0 [namespace current]::$name parser switch -- $method { elementdecl { switch [llength $args] { 0 { # Return all element declarations upvar #0 $parser(elementdecls) elements return [array get elements] } 1 { # Return specific element declaration upvar #0 $parser(elementdecls) elements if {[info exists elements([lindex $args 0])]} { return [array get elements [lindex $args 0]] } else { return -code error "element \"[lindex $args 0]\" not declared" } } default { return -code error "wrong number of arguments: should be \"elementdecl ?element?\"" } } } attlist { if {[llength $args] != 1} { return -code error "wrong number of arguments: should be \"get attlist element\"" } upvar #0 $parser(attlistdecls) return {} } entitydecl { } parameterentitydecl { } notationdecl { } default { return -code error "unknown method \"$method\"" } } return {} } # xml::tclparser::ExternalEntity -- # # Resolve and parse external entity # # Arguments: # name parser object # base base URL # sys system identifier # pub public identifier # # Results: # External entity is fetched and parsed proc xml::tclparser::ExternalEntity {name base sys pub} { } # xml::tclparser:: -- # # Reset a parser instance, ready to parse another document # # Arguments: # name parser object # # Results: # Variables unset proc xml::tclparser::reset {name} { upvar \#0 [namespace current]::$name parser # Has this parser object been properly initialised? if {![info exists parser] || \ ![info exists parser(-name)]} { return [create $name] } array set parser { -final 1 depth 0 leftover {} } foreach var {Entities ExtEntities PEntities ExtPEntities ElDecls AttlistDecls NotDecls} { catch {unset [namespace current]::${var}$name} } # Initialise entities with predefined set array set [namespace current]::Entities$name [array get ::sgml::EntityPredef] return {} } tclxml-3.3~svn11.orig/tclxml-tcl/xmldep.tcl0000644000000000000000000000654711113705304017475 0ustar rootroot# xmldep.tcl -- # # Find the dependencies in an XML document. # Supports external entities and XSL include/import. # # TODO: # XInclude # # Copyright (c) 2001-2003 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: xmldep.tcl,v 1.3 2003/12/09 04:43:15 balls Exp $ package require xml package provide xml::dep 1.0 namespace eval xml::dep { namespace export depend variable extEntities array set extEntities {} variable XSLTNS http://www.w3.org/1999/XSL/Transform } # xml::dep::depend -- # # Find the resources which an XML document # depends on. The document is parsed # sequentially, rather than using DOM, for efficiency. # # TODO: # Asynchronous parsing. # # Arguments: # xml XML document entity # args configuration options # # Results: # Returns list of resource (system) identifiers proc xml::dep::depend {xml args} { variable resources variable entities set resources {} catch {unset entities} array set entities {} set p [xml::parser \ -elementstartcommand [namespace code ElStart] \ -doctypecommand [namespace code DocTypeDecl] \ -entitydeclcommand [namespace code EntityDecl] \ -entityreferencecommand [namespace code EntityReference] \ -validate 1 \ ] if {[llength $args]} { eval [list $p] configure $args } $p parse $xml return $resources } # xml::dep::ElStart -- # # Process start element # # Arguments: # name tag name # atlist attribute list # args options # # Results: # May add to resources list proc xml::dep::ElStart {name atlist args} { variable XSLTNS variable resources array set opts { -namespace {} } array set opts $args switch -- $opts(-namespace) \ $XSLTNS { switch $name { import - include { array set attr { href {} } array set attr $atlist if {[string length $attr(href)]} { if {[lsearch $resources $attr(href)] < 0} { lappend resources $attr(href) } } } } } } # xml::dep::DocTypeDecl -- # # Process Document Type Declaration # # Arguments: # name Document element # pubid Public identifier # sysid System identifier # dtd Internal DTD Subset # # Results: # Resource added to list proc xml::dep::DocTypeDecl {name pubid sysid dtd} { variable resources puts stderr [list DocTypeDecl $name $pubid $sysid dtd] if {[string length $sysid] && \ [lsearch $resources $sysid] < 0} { lappend resources $sysid } return {} } # xml::dep::EntityDecl -- # # Process entity declaration, looking for external entity # # Arguments: # name entity name # sysid system identifier # pubid public identifier or repl. text # # Results: # Store external entity info for later reference proc xml::dep::EntityDecl {name sysid pubid} { variable extEntities puts stderr [list EntityDecl $name $sysid $pubid] set extEntities($name) $sysid } # xml::dep::EntityReference -- # # Process entity reference # # Arguments: # name entity name # # Results: # May add to resources list proc xml::dep::EntityReference name { variable extEntities variable resources puts stderr [list EntityReference $name] if {[info exists extEntities($name)] && \ [lsearch $resources $extEntities($name)] < 0} { lappend resources $extEntities($name) } } tclxml-3.3~svn11.orig/tclxml-tcl/sgml-8.1.tcl0000755000000000000000000001470511113705304017450 0ustar rootroot# sgml-8.1.tcl -- # # This file provides generic parsing services for SGML-based # languages, namely HTML and XML. # This file supports Tcl 8.1 characters and regular expressions. # # NB. It is a misnomer. There is no support for parsing # arbitrary SGML as such. # # Copyright (c) 1998-2003 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: sgml-8.1.tcl,v 1.7 2003/12/09 04:43:15 balls Exp $ package require Tcl 8.1 package provide sgml 1.9 namespace eval sgml { # Convenience routine proc cl x { return "\[$x\]" } # Define various regular expressions # Character classes variable Char \t\n\r\ -\uD7FF\uE000-\uFFFD\u10000-\u10FFFF variable BaseChar \u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3 variable Ideographic \u4E00-\u9FA5\u3007\u3021-\u3029 variable CombiningChar \u0300-\u0345\u0360-\u0361\u0483-\u0486\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD\u05BF\u05C1-\u05C2\u05C4\u064B-\u0652\u0670\u06D6-\u06DC\u06DD-\u06DF\u06E0-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0901-\u0903\u093C\u093E-\u094C\u094D\u0951-\u0954\u0962-\u0963\u0981-\u0983\u09BC\u09BE\u09BF\u09C0-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09E2-\u09E3\u0A02\u0A3C\u0A3E\u0A3F\u0A40-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0B01-\u0B03\u0B3C\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B82-\u0B83\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C82-\u0C83\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86-\u0F8B\u0F90-\u0F95\u0F97\u0F99-\u0FAD\u0FB1-\u0FB7\u0FB9\u20D0-\u20DC\u20E1\u302A-\u302F\u3099\u309A variable Digit \u0030-\u0039\u0660-\u0669\u06F0-\u06F9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE7-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29 variable Extender \u00B7\u02D0\u02D1\u0387\u0640\u0E46\u0EC6\u3005\u3031-\u3035\u309D-\u309E\u30FC-\u30FE variable Letter $BaseChar|$Ideographic # white space variable Wsp " \t\r\n" variable noWsp [cl ^$Wsp] # Various XML names variable NameChar \[-$Letter$Digit._:$CombiningChar$Extender\] variable Name \[_:$BaseChar$Ideographic\]$NameChar* variable Names ${Name}(?:$Wsp$Name)* variable Nmtoken $NameChar+ variable Nmtokens ${Nmtoken}(?:$Wsp$Nmtoken)* # table of predefined entities for XML variable EntityPredef array set EntityPredef { lt < gt > amp & quot \" apos ' } } # These regular expressions are defined here once for better performance namespace eval sgml { variable Wsp # Watch out for case-sensitivity set attlist_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*(#REQUIRED|#IMPLIED) set attlist_enum_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*\\(([cl ^)]*)\\)[cl $Wsp]*("([cl ^")]*)")? ;# " set attlist_fixed_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*(#FIXED)[cl $Wsp]*([cl ^$Wsp]+) set param_entity_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^"$Wsp]*)[cl $Wsp]*"([cl ^"]*)" set notation_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*(.*) } ### Utility procedures # sgml::noop -- # # A do-nothing proc # # Arguments: # args arguments # # Results: # Nothing. proc sgml::noop args { return 0 } # sgml::identity -- # # Identity function. # # Arguments: # a arbitrary argument # # Results: # $a proc sgml::identity a { return $a } # sgml::Error -- # # Throw an error # # Arguments: # args arguments # # Results: # Error return condition. proc sgml::Error args { uplevel return -code error [list $args] } ### Following procedures are based on html_library # sgml::zapWhite -- # # Convert multiple white space into a single space. # # Arguments: # data plain text # # Results: # As above proc sgml::zapWhite data { regsub -all "\[ \t\r\n\]+" $data { } data return $data } proc sgml::Boolean value { regsub {1|true|yes|on} $value 1 value regsub {0|false|no|off} $value 0 value return $value } tclxml-3.3~svn11.orig/tclxml-tcl/sgml-8.0.tcl0000755000000000000000000000562411113705304017447 0ustar rootroot# sgml-8.0.tcl -- # # This file provides generic parsing services for SGML-based # languages, namely HTML and XML. # This file supports Tcl 8.0 characters and regular expressions. # # NB. It is a misnomer. There is no support for parsing # arbitrary SGML as such. # # Copyright (c) 1998,1999 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: sgml-8.0.tcl,v 1.4 2003/12/09 04:43:15 balls Exp $ package require -exact Tcl 8.0 package provide sgml 1.9 namespace eval sgml { # Convenience routine proc cl x { return "\[$x\]" } # Define various regular expressions # Character classes variable Char \t\n\r\ -\xFF variable BaseChar A-Za-z variable Letter $BaseChar variable Digit 0-9 variable CombiningChar {} variable Extender {} variable Ideographic {} # white space variable Wsp " \t\r\n" variable noWsp [cl ^$Wsp] # Various XML names variable NameChar \[-$Letter$Digit._:$CombiningChar$Extender\] variable Name \[_:$BaseChar$Ideographic\]$NameChar* variable Names ${Name}(?:$Wsp$Name)* variable Nmtoken $NameChar+ variable Nmtokens ${Nmtoken}(?:$Wsp$Nmtoken)* # table of predefined entities for XML variable EntityPredef array set EntityPredef { lt < gt > amp & quot \" apos ' } } # These regular expressions are defined here once for better performance namespace eval sgml { variable Wsp # Watch out for case-sensitivity set attlist_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*(#REQUIRED|#IMPLIED) set attlist_enum_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*\\(([cl ^)]*)\\)[cl $Wsp]*("([cl ^")])")? ;# " set attlist_fixed_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*(#FIXED)[cl $Wsp]*([cl ^$Wsp]+) set param_entity_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^"$Wsp]*)[cl $Wsp]*"([cl ^"]*)" set notation_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*(.*) } ### Utility procedures # sgml::noop -- # # A do-nothing proc # # Arguments: # args arguments # # Results: # Nothing. proc sgml::noop args { return 0 } # sgml::identity -- # # Identity function. # # Arguments: # a arbitrary argument # # Results: # $a proc sgml::identity a { return $a } # sgml::Error -- # # Throw an error # # Arguments: # args arguments # # Results: # Error return condition. proc sgml::Error args { uplevel return -code error [list $args] } ### Following procedures are based on html_library # sgml::zapWhite -- # # Convert multiple white space into a single space. # # Arguments: # data plain text # # Results: # As above proc sgml::zapWhite data { regsub -all "\[ \t\r\n\]+" $data { } data return $data } proc sgml::Boolean value { regsub {1|true|yes|on} $value 1 value regsub {0|false|no|off} $value 0 value return $value } tclxml-3.3~svn11.orig/tools/0000755000000000000000000000000011574742507014562 5ustar rootroottclxml-3.3~svn11.orig/tools/genStubs.tcl0000644000000000000000000005156511113705304017053 0ustar rootroot# genStubs.tcl -- # # This script generates a set of stub files for a given # interface. # # # Copyright (c) 1998-1999 by Scriptics Corporation. # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: genStubs.tcl,v 1.1 2002/09/26 18:32:58 andreas_kupries Exp $ namespace eval genStubs { # libraryName -- # # The name of the entire library. This value is used to compute # the USE_*_STUB_PROCS macro and the name of the init file. variable libraryName "UNKNOWN" # interfaces -- # # An array indexed by interface name that is used to maintain # the set of valid interfaces. The value is empty. array set interfaces {} # curName -- # # The name of the interface currently being defined. variable curName "UNKNOWN" # hooks -- # # An array indexed by interface name that contains the set of # subinterfaces that should be defined for a given interface. array set hooks {} # stubs -- # # This three dimensional array is indexed first by interface name, # second by platform name, and third by a numeric offset or the # constant "lastNum". The lastNum entry contains the largest # numeric offset used for a given interface/platform combo. Each # numeric offset contains the C function specification that # should be used for the given entry in the stub table. The spec # consists of a list in the form returned by parseDecl. array set stubs {} # outDir -- # # The directory where the generated files should be placed. variable outDir . } # genStubs::library -- # # This function is used in the declarations file to set the name # of the library that the interfaces are associated with (e.g. "tcl"). # This value will be used to define the inline conditional macro. # # Arguments: # name The library name. # # Results: # None. proc genStubs::library {name} { variable libraryName $name } # genStubs::interface -- # # This function is used in the declarations file to set the name # of the interface currently being defined. # # Arguments: # name The name of the interface. # # Results: # None. proc genStubs::interface {name} { variable curName $name variable interfaces set interfaces($name) {} return } # genStubs::hooks -- # # This function defines the subinterface hooks for the current # interface. # # Arguments: # names The ordered list of interfaces that are reachable through the # hook vector. # # Results: # None. proc genStubs::hooks {names} { variable curName variable hooks set hooks($curName) $names return } # genStubs::declare -- # # This function is used in the declarations file to declare a new # interface entry. # # Arguments: # index The index number of the interface. # platform The platform the interface belongs to. Should be one # of generic, win, unix, or mac. # decl The C function declaration, or {} for an undefined # entry. # # Results: # None. proc genStubs::declare {args} { variable stubs variable curName if {[llength $args] != 3} { puts stderr "wrong # args: declare $args" } lassign $args index platformList decl # Check for duplicate declarations, then add the declaration and # bump the lastNum counter if necessary. foreach platform $platformList { if {[info exists stubs($curName,$platform,$index)]} { puts stderr "Duplicate entry: declare $args" } } regsub -all "\[ \t\n\]+" [string trim $decl] " " decl set decl [parseDecl $decl] foreach platform $platformList { if {$decl != ""} { set stubs($curName,$platform,$index) $decl if {![info exists stubs($curName,$platform,lastNum)] \ || ($index > $stubs($curName,$platform,lastNum))} { set stubs($curName,$platform,lastNum) $index } } } return } # genStubs::rewriteFile -- # # This function replaces the machine generated portion of the # specified file with new contents. It looks for the !BEGIN! and # !END! comments to determine where to place the new text. # # Arguments: # file The name of the file to modify. # text The new text to place in the file. # # Results: # None. proc genStubs::rewriteFile {file text} { if {![file exist $file]} { puts stderr "Cannot find file: $file" return } set in [open ${file} r] set out [open ${file}.new w] # Always write out the file with LF termination fconfigure $out -translation lf while {![eof $in]} { set line [gets $in] if {[regexp {!BEGIN!} $line]} { break } puts $out $line } puts $out "/* !BEGIN!: Do not edit below this line. */" puts $out $text while {![eof $in]} { set line [gets $in] if {[regexp {!END!} $line]} { break } } puts $out "/* !END!: Do not edit above this line. */" puts -nonewline $out [read $in] close $in close $out file rename -force ${file}.new ${file} return } # genStubs::addPlatformGuard -- # # Wrap a string inside a platform #ifdef. # # Arguments: # plat Platform to test. # # Results: # Returns the original text inside an appropriate #ifdef. proc genStubs::addPlatformGuard {plat text} { switch $plat { win { return "#ifdef __WIN32__\n${text}#endif /* __WIN32__ */\n" } unix { return "#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */\n${text}#endif /* UNIX */\n" } mac { return "#ifdef MAC_TCL\n${text}#endif /* MAC_TCL */\n" } } return "$text" } # genStubs::emitSlots -- # # Generate the stub table slots for the given interface. If there # are no generic slots, then one table is generated for each # platform, otherwise one table is generated for all platforms. # # Arguments: # name The name of the interface being emitted. # textVar The variable to use for output. # # Results: # None. proc genStubs::emitSlots {name textVar} { variable stubs upvar $textVar text forAllStubs $name makeSlot 1 text {" void *reserved$i;\n"} return } # genStubs::parseDecl -- # # Parse a C function declaration into its component parts. # # Arguments: # decl The function declaration. # # Results: # Returns a list of the form {returnType name args}. The args # element consists of a list of type/name pairs, or a single # element "void". If the function declaration is malformed # then an error is displayed and the return value is {}. proc genStubs::parseDecl {decl} { if {![regexp {^(.*)\((.*)\)$} $decl all prefix args]} { puts stderr "Malformed declaration: $decl" return } set prefix [string trim $prefix] if {![regexp {^(.+[ ][*]*)([^ *]+)$} $prefix all rtype fname]} { puts stderr "Bad return type: $decl" return } set rtype [string trim $rtype] foreach arg [split $args ,] { lappend argList [string trim $arg] } if {![string compare [lindex $argList end] "..."]} { if {[llength $argList] != 2} { puts stderr "Only one argument is allowed in varargs form: $decl" } set arg [parseArg [lindex $argList 0]] if {$arg == "" || ([llength $arg] != 2)} { puts stderr "Bad argument: '[lindex $argList 0]' in '$decl'" return } set args [list TCL_VARARGS $arg] } else { set args {} foreach arg $argList { set argInfo [parseArg $arg] if {![string compare $argInfo "void"]} { lappend args "void" break } elseif {[llength $argInfo] == 2 || [llength $argInfo] == 3} { lappend args $argInfo } else { puts stderr "Bad argument: '$arg' in '$decl'" return } } } return [list $rtype $fname $args] } # genStubs::parseArg -- # # This function parses a function argument into a type and name. # # Arguments: # arg The argument to parse. # # Results: # Returns a list of type and name with an optional third array # indicator. If the argument is malformed, returns "". proc genStubs::parseArg {arg} { if {![regexp {^(.+[ ][*]*)([^][ *]+)(\[\])?$} $arg all type name array]} { if {$arg == "void"} { return $arg } else { return } } set result [list [string trim $type] $name] if {$array != ""} { lappend result $array } return $result } # genStubs::makeDecl -- # # Generate the prototype for a function. # # Arguments: # name The interface name. # decl The function declaration. # index The slot index for this function. # # Results: # Returns the formatted declaration string. proc genStubs::makeDecl {name decl index} { lassign $decl rtype fname args append text "/* $index */\n" set line "EXTERN $rtype" set count [expr {2 - ([string length $line] / 8)}] append line [string range "\t\t\t" 0 $count] set pad [expr {24 - [string length $line]}] if {$pad <= 0} { append line " " set pad 0 } append line "$fname _ANSI_ARGS_(" set arg1 [lindex $args 0] switch -exact $arg1 { void { append line "(void)" } TCL_VARARGS { set arg [lindex $args 1] append line "TCL_VARARGS([lindex $arg 0],[lindex $arg 1])" } default { set sep "(" foreach arg $args { append line $sep set next {} append next [lindex $arg 0] " " [lindex $arg 1] \ [lindex $arg 2] if {[string length $line] + [string length $next] \ + $pad > 76} { append text $line \n set line "\t\t\t\t" set pad 28 } append line $next set sep ", " } append line ")" } } append text $line append text ");\n" return $text } # genStubs::makeMacro -- # # Generate the inline macro for a function. # # Arguments: # name The interface name. # decl The function declaration. # index The slot index for this function. # # Results: # Returns the formatted macro definition. proc genStubs::makeMacro {name decl index} { lassign $decl rtype fname args set lfname [string tolower [string index $fname 0]] append lfname [string range $fname 1 end] set text "#ifndef $fname\n#define $fname" set arg1 [lindex $args 0] set argList "" switch -exact $arg1 { void { set argList "()" } TCL_VARARGS { } default { set sep "(" foreach arg $args { append argList $sep [lindex $arg 1] set sep ", " } append argList ")" } } append text " \\\n\t(${name}StubsPtr->$lfname)" append text " /* $index */\n#endif\n" return $text } # genStubs::makeStub -- # # Emits a stub function definition. # # Arguments: # name The interface name. # decl The function declaration. # index The slot index for this function. # # Results: # Returns the formatted stub function definition. proc genStubs::makeStub {name decl index} { lassign $decl rtype fname args set lfname [string tolower [string index $fname 0]] append lfname [string range $fname 1 end] append text "/* Slot $index */\n" $rtype "\n" $fname set arg1 [lindex $args 0] if {![string compare $arg1 "TCL_VARARGS"]} { lassign [lindex $args 1] type argName append text " TCL_VARARGS_DEF($type,$argName)\n\{\n" append text " " $type " var;\n va_list argList;\n" if {[string compare $rtype "void"]} { append text " " $rtype " resultValue;\n" } append text "\n var = (" $type ") TCL_VARARGS_START(" \ $type "," $argName ",argList);\n\n " if {[string compare $rtype "void"]} { append text "resultValue = " } append text "(" $name "StubsPtr->" $lfname "VA)(var, argList);\n" append text " va_end(argList);\n" if {[string compare $rtype "void"]} { append text "return resultValue;\n" } append text "\}\n\n" return $text } if {![string compare $arg1 "void"]} { set argList "()" set argDecls "" } else { set argList "" set sep "(" foreach arg $args { append argList $sep [lindex $arg 1] append argDecls " " [lindex $arg 0] " " \ [lindex $arg 1] [lindex $arg 2] ";\n" set sep ", " } append argList ")" } append text $argList "\n" $argDecls "{\n " if {[string compare $rtype "void"]} { append text "return " } append text "(" $name "StubsPtr->" $lfname ")" $argList ";\n}\n\n" return $text } # genStubs::makeSlot -- # # Generate the stub table entry for a function. # # Arguments: # name The interface name. # decl The function declaration. # index The slot index for this function. # # Results: # Returns the formatted table entry. proc genStubs::makeSlot {name decl index} { lassign $decl rtype fname args set lfname [string tolower [string index $fname 0]] append lfname [string range $fname 1 end] set text " " append text $rtype " (*" $lfname ") _ANSI_ARGS_(" set arg1 [lindex $args 0] switch -exact $arg1 { void { append text "(void)" } TCL_VARARGS { set arg [lindex $args 1] append text "TCL_VARARGS([lindex $arg 0],[lindex $arg 1])" } default { set sep "(" foreach arg $args { append text $sep [lindex $arg 0] " " [lindex $arg 1] \ [lindex $arg 2] set sep ", " } append text ")" } } append text "); /* $index */\n" return $text } # genStubs::makeInit -- # # Generate the prototype for a function. # # Arguments: # name The interface name. # decl The function declaration. # index The slot index for this function. # # Results: # Returns the formatted declaration string. proc genStubs::makeInit {name decl index} { append text " " [lindex $decl 1] ", /* " $index " */\n" return $text } # genStubs::forAllStubs -- # # This function iterates over all of the platforms and invokes # a callback for each slot. The result of the callback is then # placed inside appropriate platform guards. # # Arguments: # name The interface name. # slotProc The proc to invoke to handle the slot. It will # have the interface name, the declaration, and # the index appended. # onAll If 1, emit the skip string even if there are # definitions for one or more platforms. # textVar The variable to use for output. # skipString The string to emit if a slot is skipped. This # string will be subst'ed in the loop so "$i" can # be used to substitute the index value. # # Results: # None. proc genStubs::forAllStubs {name slotProc onAll textVar \ {skipString {"/* Slot $i is reserved */\n"}}} { variable stubs upvar $textVar text set plats [array names stubs $name,*,lastNum] if {[info exists stubs($name,generic,lastNum)]} { # Emit integrated stubs block set lastNum -1 foreach plat [array names stubs $name,*,lastNum] { if {$stubs($plat) > $lastNum} { set lastNum $stubs($plat) } } for {set i 0} {$i <= $lastNum} {incr i} { set slots [array names stubs $name,*,$i] set emit 0 if {[info exists stubs($name,generic,$i)]} { if {[llength $slots] > 1} { puts stderr "platform entry duplicates generic entry: $i" } append text [$slotProc $name $stubs($name,generic,$i) $i] set emit 1 } elseif {[llength $slots] > 0} { foreach plat {unix win mac} { if {[info exists stubs($name,$plat,$i)]} { append text [addPlatformGuard $plat \ [$slotProc $name $stubs($name,$plat,$i) $i]] set emit 1 } elseif {$onAll} { append text [eval {addPlatformGuard $plat} $skipString] set emit 1 } } } if {$emit == 0} { eval {append text} $skipString } } } else { # Emit separate stubs blocks per platform foreach plat {unix win mac} { if {[info exists stubs($name,$plat,lastNum)]} { set lastNum $stubs($name,$plat,lastNum) set temp {} for {set i 0} {$i <= $lastNum} {incr i} { if {![info exists stubs($name,$plat,$i)]} { eval {append temp} $skipString } else { append temp [$slotProc $name $stubs($name,$plat,$i) $i] } } append text [addPlatformGuard $plat $temp] } } } } # genStubs::emitDeclarations -- # # This function emits the function declarations for this interface. # # Arguments: # name The interface name. # textVar The variable to use for output. # # Results: # None. proc genStubs::emitDeclarations {name textVar} { variable stubs upvar $textVar text append text "\n/*\n * Exported function declarations:\n */\n\n" forAllStubs $name makeDecl 0 text return } # genStubs::emitMacros -- # # This function emits the inline macros for an interface. # # Arguments: # name The name of the interface being emitted. # textVar The variable to use for output. # # Results: # None. proc genStubs::emitMacros {name textVar} { variable stubs variable libraryName upvar $textVar text set upName [string toupper $libraryName] append text "\n#if defined(USE_${upName}_STUBS) && !defined(USE_${upName}_STUB_PROCS)\n" append text "\n/*\n * Inline function declarations:\n */\n\n" forAllStubs $name makeMacro 0 text append text "\n#endif /* defined(USE_${upName}_STUBS) && !defined(USE_${upName}_STUB_PROCS) */\n" return } # genStubs::emitHeader -- # # This function emits the body of the Decls.h file for # the specified interface. # # Arguments: # name The name of the interface being emitted. # # Results: # None. proc genStubs::emitHeader {name} { variable outDir variable hooks set capName [string toupper [string index $name 0]] append capName [string range $name 1 end] emitDeclarations $name text if {[info exists hooks($name)]} { append text "\ntypedef struct ${capName}StubHooks {\n" foreach hook $hooks($name) { set capHook [string toupper [string index $hook 0]] append capHook [string range $hook 1 end] append text " struct ${capHook}Stubs *${hook}Stubs;\n" } append text "} ${capName}StubHooks;\n" } append text "\ntypedef struct ${capName}Stubs {\n" append text " int magic;\n" append text " struct ${capName}StubHooks *hooks;\n\n" emitSlots $name text append text "} ${capName}Stubs;\n" append text "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n" append text "extern ${capName}Stubs *${name}StubsPtr;\n" append text "#ifdef __cplusplus\n}\n#endif\n" emitMacros $name text rewriteFile [file join $outDir ${name}Decls.h] $text return } # genStubs::emitStubs -- # # This function emits the body of the Stubs.c file for # the specified interface. # # Arguments: # name The name of the interface being emitted. # # Results: # None. proc genStubs::emitStubs {name} { variable outDir append text "\n/*\n * Exported stub functions:\n */\n\n" forAllStubs $name makeStub 0 text rewriteFile [file join $outDir ${name}Stubs.c] $text return } # genStubs::emitInit -- # # Generate the table initializers for an interface. # # Arguments: # name The name of the interface to initialize. # textVar The variable to use for output. # # Results: # Returns the formatted output. proc genStubs::emitInit {name textVar} { variable stubs variable hooks upvar $textVar text set capName [string toupper [string index $name 0]] append capName [string range $name 1 end] if {[info exists hooks($name)]} { append text "\nstatic ${capName}StubHooks ${name}StubHooks = \{\n" set sep " " foreach sub $hooks($name) { append text $sep "&${sub}Stubs" set sep ",\n " } append text "\n\};\n" } append text "\n${capName}Stubs ${name}Stubs = \{\n" append text " TCL_STUB_MAGIC,\n" if {[info exists hooks($name)]} { append text " &${name}StubHooks,\n" } else { append text " NULL,\n" } forAllStubs $name makeInit 1 text {" NULL, /* $i */\n"} append text "\};\n" return } # genStubs::emitInits -- # # This function emits the body of the StubInit.c file for # the specified interface. # # Arguments: # name The name of the interface being emitted. # # Results: # None. proc genStubs::emitInits {} { variable hooks variable outDir variable libraryName variable interfaces # Assuming that dependencies only go one level deep, we need to emit # all of the leaves first to avoid needing forward declarations. set leaves {} set roots {} foreach name [lsort [array names interfaces]] { if {[info exists hooks($name)]} { lappend roots $name } else { lappend leaves $name } } foreach name $leaves { emitInit $name text } foreach name $roots { emitInit $name text } rewriteFile [file join $outDir ${libraryName}StubInit.c] $text } # genStubs::init -- # # This is the main entry point. # # Arguments: # None. # # Results: # None. proc genStubs::init {} { global argv argv0 variable outDir variable interfaces if {[llength $argv] < 2} { puts stderr "usage: $argv0 outDir declFile ?declFile...?" exit 1 } set outDir [lindex $argv 0] foreach file [lrange $argv 1 end] { source $file } foreach name [lsort [array names interfaces]] { puts "Emitting $name" emitHeader $name } emitInits } # lassign -- # # This function emulates the TclX lassign command. # # Arguments: # valueList A list containing the values to be assigned. # args The list of variables to be assigned. # # Results: # Returns any values that were not assigned to variables. proc lassign {valueList args} { if {[llength $args] == 0} { error "wrong # args: lassign list varname ?varname..?" } uplevel [list foreach $args $valueList {break}] return [lrange $valueList [llength $args] end] } genStubs::init tclxml-3.3~svn11.orig/TclxmlConfig.sh.in0000644000000000000000000000420411113705304016733 0ustar rootroot# tclxmlConfig.sh -- # # This shell script (for sh) is generated automatically by Tclxml's # configure script. It will create shell variables for most of # the configuration options discovered by the configure script. # This script is intended to be included by the configure scripts # for Tclxml extensions so that they don't have to figure this all # out for themselves. This file does not duplicate information # already provided by tclConfig.sh, so you may need to use that # file in addition to this one. # # The information in this file is specific to a single platform. # Tclxml's version number. Tclxml_VERSION='@PACKAGE_VERSION@' # The name of the Tclxml library (may be either a .a file or a shared library): Tclxml_LIB_FILE='@PKG_LIB_FILE@' # String to pass to linker to pick up the Tclxml library from its # build directory. Tclxml_BUILD_LIB_SPEC='@Tclxml_BUILD_LIB_SPEC@' # String to pass to linker to pick up the Tclxml library from its # installed directory. Tclxml_LIB_SPEC='@Tclxml_LIB_SPEC@' # The name of the Tclxml stub library (a .a file): Tclxml_STUB_LIB_FILE='@PKG_STUB_LIB_FILE@' # String to pass to linker to pick up the Tclxml stub library from its # build directory. Tclxml_BUILD_STUB_LIB_SPEC='@Tclxml_BUILD_STUB_LIB_SPEC@' # String to pass to linker to pick up the Tclxml stub library from its # installed directory. Tclxml_STUB_LIB_SPEC='@Tclxml_STUB_LIB_SPEC@' # String to pass to linker to pick up the Tclxml stub library from its # build directory. Tclxml_BUILD_STUB_LIB_PATH='@Tclxml_BUILD_STUB_LIB_PATH@' # String to pass to linker to pick up the Tclxml stub library from its # installed directory. Tclxml_STUB_LIB_PATH='@Tclxml_STUB_LIB_PATH@' # String to pass to the compiler so that an extension can find # installed header. Tclxml_INCLUDE_SPEC='@Tclxml_INCLUDE_SPEC@' # Location of the top-level source directories from which [incr Tcl] # was built. This is the directory that contains generic, unix, etc. # If [incr Tcl] was compiled in a different place than the directory # containing the source files, this points to the location of the sources, # not the location where [incr Tcl] was compiled. Tclxml_SRC_DIR='@srcdir@' tclxml-3.3~svn11.orig/examples/0000755000000000000000000000000011574742544015241 5ustar rootroottclxml-3.3~svn11.orig/examples/tclxml/0000755000000000000000000000000011574742544016544 5ustar rootroottclxml-3.3~svn11.orig/examples/tclxml/simple.tcl0000644000000000000000000000115011116050505020513 0ustar rootroot#!/bin/sh # -*- tcl -*- \ exec tclsh "$0" "$@" # simple.tcl -- # # Count the characters in a XML document, # from README. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # # $Id$ package require xml 3.2 set parser [xml::parser] $parser configure -elementstartcommand EStart \ -characterdatacommand PCData proc EStart {tag attlist args} { array set attr $attlist puts "Element \"$tag\" started with [array size attr] attributes" } proc PCData text { incr ::count [string length $text] } set count 0 $parser parse [read stdin] puts "The document contains $count characters" exit 0 tclxml-3.3~svn11.orig/examples/tclxml/xmlwc0000755000000000000000000000276111113705304017610 0ustar rootroot#!/bin/sh # \ exec tclsh8.3 "$0" "$@" package require xml set bytes 0 set chars 0 set words 0 set lines 0 proc cdata {data args} { global bytes chars words lines incr bytes [string bytelength $data] incr chars [string length $data] incr lines [regsub -all \n $data {} discard] regsub -all "\[ \t\r\n\]+" [string trim $data] { } data incr words [regsub -all { } $data {} discard] return {} } set format {%1$7d%2$8d%3$8d %5$10s} set input {} foreach opt $argv { switch -- $opt { --bytes { set format {%4$7d} } -c - --chars { set format {%3$7d} } -w - --words { set format {%2$7d} } -l - --lines { set format {%1$7d} } -h - --help { puts stderr "$argv0 \[-clw\] \[--bytes\] \[--chars\] \[--words\] \[--lines\] \[--help\] \[--version\] \[file...\]" puts stderr "Counts number of bytes, characters, words and lines in an XML document" } --version { puts stderr "xmlwc version 1.0" } default { lappend input $opt } } } if {![llength $input]} { set p [xml::parser -characterdatacommand cdata] if {[catch {$p parse [read stdin]} err]} { puts stderr $err exit 1 } } else { foreach in $input { if {[catch {open $in} ch]} { puts stderr "unable to open file \"$in\"" exit 1 } set p [xml::parser -characterdatacommand cdata] if {[catch {$p parse [read $ch]} err]} { puts stderr $err exit 1 } catch {close $ch} } } puts [format $format $lines $words $chars $bytes $input] exit 0 tclxml-3.3~svn11.orig/examples/tclxml/README0000644000000000000000000000171711113705304017410 0ustar rootrootexamples/tclxml/README -- This directory contains example scripts to demonstrate the use of TclXML. --------------------------------------------------------------------------- See the file "LICENSE" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. --------------------------------------------------------------------------- flatten.tcl Parses an XML document or DTD and produces the document's DTD with all external entities expanded, parameter entities resolved and conditional sections resolved. xmlwc Counts the number of lines, words, characters and bytes in the character data of an XML document. Inspired by the Unix wc program. REC-xml-20001006.xml The W3C XML spec in XML format. A handy file to run xmlwc over to test your build. You should get this output with the command tclsh xmlwc REC-xml-20001006.xml : 2929 14978 116827 REC-xml-20001006.xml tclxml-3.3~svn11.orig/examples/tclxml/REC-xml-20001006.xml0000755000000000000000000061227611113705304021362 0ustar rootroot '"> amp, lt, gt, apos, quot"> ]>
Extensible Markup Language (XML) 1.0 (Second Edition) REC-xml-&iso6.doc.date; W3C Recommendation &draft.day;&draft.month;&draft.year; &http-ident;-&iso6.doc.date; (XHTML, XML, PDF, XHTML review version with color-coded revision indicators) http://www.w3.org/TR/REC-xml http://www.w3.org/TR/2000/WD-xml-2e-20000814 http://www.w3.org/TR/1998/REC-xml-19980210 Tim BrayTextuality and Netscape tbray@textuality.com Jean PaoliMicrosoft jeanpa@microsoft.com C. M. Sperberg-McQueenUniversity of Illinois at Chicago and Text Encoding Initiativecmsmcq@uic.edu Eve MalerSun Microsystems, Inc.eve.maler@east.sun.com

The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML has been designed for ease of implementation and for interoperability with both SGML and HTML.

This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.

This document specifies a syntax created by subsetting an existing, widely used international text processing standard (Standard Generalized Markup Language, ISO 8879:1986(E) as amended and corrected) for use on the World Wide Web. It is a product of the W3C XML Activity, details of which can be found at http://www.w3.org/XML. [E100] The English version of this specification is the only normative version. However, for translations of this document, see http://www.w3.org/XML/#trans. A list of current W3C Recommendations and other technical documents can be found at http://www.w3.org/TR.

[E66]This specification uses the term URI, which is defined by , a work in progress expected to update and .

This second edition is not a new version of XML (first published 10 February 1998); it merely incorporates the changes dictated by the first-edition errata (available at http://www.w3.org/XML/xml-19980210-errata) as a convenience to readers. The errata list for this second edition is available at http://www.w3.org/XML/xml-V10-2e-errata.

Please report errors in this document to xml-editor@w3.org[E101]; archives are available.

C. M. Sperberg-McQueen's affiliation has changed since the publication of the first edition. He is now at the World Wide Web Consortium, and can be contacted at cmsmcq@w3.org.

Chicago, Vancouver, Mountain View, et al.: World-Wide Web Consortium, XML Working Group, 1996, 1997, 2000.

Created in electronic form.

English Extended Backus-Naur Form (formal grammar) 1997-12-03 : CMSMcQ : yet further changes 1997-12-02 : TB : further changes (see TB to XML WG, 2 December 1997) 1997-12-02 : CMSMcQ : deal with as many corrections and comments from the proofreaders as possible: entify hard-coded document date in pubdate element, change expansion of entity WebSGML, update status description as per Dan Connolly (am not sure about refernece to Berners-Lee et al.), add 'The' to abstract as per WG decision, move Relationship to Existing Standards to back matter and combine with References, re-order back matter so normative appendices come first, re-tag back matter so informative appendices are tagged informdiv1, remove XXX XXX from list of 'normative' specs in prose, move some references from Other References to Normative References, add RFC 1738, 1808, and 2141 to Other References (they are not normative since we do not require the processor to enforce any rules based on them), add reference to 'Fielding draft' (Berners-Lee et al.), move notation section to end of body, drop URIchar non-terminal and use SkipLit instead, lose stray reference to defunct nonterminal 'markupdecls', move reference to Aho et al. into appendix (Tim's right), add prose note saying that hash marks and fragment identifiers are NOT part of the URI formally speaking, and are NOT legal in system identifiers (processor 'may' signal an error). Work through: Tim Bray reacting to James Clark, Tim Bray on his own, Eve Maler, NOT DONE YET: change binary / text to unparsed / parsed. handle James's suggestion about < in attriubte values uppercase hex characters, namechar list, 1997-12-01 : JB : add some column-width parameters 1997-12-01 : CMSMcQ : begin round of changes to incorporate recent WG decisions and other corrections: binding sources of character encoding info (27 Aug / 3 Sept), correct wording of Faust quotation (restore dropped line), drop SDD from EncodingDecl, change text at version number 1.0, drop misleading (wrong!) sentence about ignorables and extenders, modify definition of PCData to make bar on msc grammatical, change grammar's handling of internal subset (drop non-terminal markupdecls), change definition of includeSect to allow conditional sections, add integral-declaration constraint on internal subset, drop misleading / dangerous sentence about relationship of entities with system storage objects, change table body tag to htbody as per EM change to DTD, add rule about space normalization in public identifiers, add description of how to generate our name-space rules from Unicode character database (needs further work!). 1997-10-08 : TB : Removed %-constructs again, new rules for PE appearance. 1997-10-01 : TB : Case-sensitive markup; cleaned up element-type defs, lotsa little edits for style 1997-09-25 : TB : Change to elm's new DTD, with substantial detail cleanup as a side-effect 1997-07-24 : CMSMcQ : correct error (lost *) in definition of ignoreSectContents (thanks to Makoto Murata) Allow all empty elements to have end-tags, consistent with SGML TC (as per JJC). 1997-07-23 : CMSMcQ : pre-emptive strike on pending corrections: introduce the term 'empty-element tag', note that all empty elements may use it, and elements declared EMPTY must use it. Add WFC requiring encoding decl to come first in an entity. Redefine notations to point to PIs as well as binary entities. Change autodetection table by removing bytes 3 and 4 from examples with Byte Order Mark. Add content model as a term and clarify that it applies to both mixed and element content. 1997-06-30 : CMSMcQ : change date, some cosmetic changes, changes to productions for choice, seq, Mixed, NotationType, Enumeration. Follow James Clark's suggestion and prohibit conditional sections in internal subset. TO DO: simplify production for ignored sections as a result, since we don't need to worry about parsers which don't expand PErefs finding a conditional section. 1997-06-29 : TB : various edits 1997-06-29 : CMSMcQ : further changes: Suppress old FINAL EDIT comments and some dead material. Revise occurrences of % in grammar to exploit Henry Thompson's pun, especially markupdecl and attdef. Remove RMD requirement relating to element content (?). 1997-06-28 : CMSMcQ : Various changes for 1 July draft: Add text for draconian error handling (introduce the term Fatal Error). RE deleta est (changing wording from original announcement to restrict the requirement to validating parsers). Tag definition of validating processor and link to it. Add colon as name character. Change def of %operator. Change standard definitions of lt, gt, amp. Strip leading zeros from #x00nn forms. 1997-04-02 : CMSMcQ : final corrections of editorial errors found in last night's proofreading. Reverse course once more on well-formed: Webster's Second hyphenates it, and that's enough for me. 1997-04-01 : CMSMcQ : corrections from JJC, EM, HT, and self 1997-03-31 : Tim Bray : many changes 1997-03-29 : CMSMcQ : some Henry Thompson (on entity handling), some Charles Goldfarb, some ERB decisions (PE handling in miscellaneous declarations. Changed Ident element to accept def attribute. Allow normalization of Unicode characters. move def of systemliteral into section on literals. 1997-03-28 : CMSMcQ : make as many corrections as possible, from Terry Allen, Norbert Mikula, James Clark, Jon Bosak, Henry Thompson, Paul Grosso, and self. Among other things: give in on "well formed" (Terry is right), tentatively rename QuotedCData as AttValue and Literal as EntityValue to be more informative, since attribute values are the only place QuotedCData was used, and vice versa for entity text and Literal. (I'd call it Entity Text, but 8879 uses that name for both internal and external entities.) 1997-03-26 : CMSMcQ : resynch the two forks of this draft, reapply my changes dated 03-20 and 03-21. Normalize old 'may not' to 'must not' except in the one case where it meant 'may or may not'. 1997-03-21 : TB : massive changes on plane flight from Chicago to Vancouver 1997-03-21 : CMSMcQ : correct as many reported errors as possible. 1997-03-20 : CMSMcQ : correct typos listed in CMSMcQ hand copy of spec. 1997-03-20 : CMSMcQ : cosmetic changes preparatory to revision for WWW conference April 1997: restore some of the internal entity references (e.g. to docdate, etc.), change character xA0 to &nbsp; and define nbsp as &#160;, and refill a lot of paragraphs for legibility. 1996-11-12 : CMSMcQ : revise using Tim's edits: Add list type of NUMBERED and change most lists either to BULLETS or to NUMBERED. Suppress QuotedNames, Names (not used). Correct trivial-grammar doc type decl. Rename 'marked section' as 'CDATA section' passim. Also edits from James Clark: Define the set of characters from which [^abc] subtracts. Charref should use just [0-9] not Digit. Location info needs cleaner treatment: remove? (ERB question). One example of a PI has wrong pic. Clarify discussion of encoding names. Encoding failure should lead to unspecified results; don't prescribe error recovery. Don't require exposure of entity boundaries. Ignore white space in element content. Reserve entity names of the form u-NNNN. Clarify relative URLs. And some of my own: Correct productions for content model: model cannot consist of a name, so "elements ::= cp" is no good. 1996-11-11 : CMSMcQ : revise for style. Add new rhs to entity declaration, for parameter entities. 1996-11-10 : CMSMcQ : revise for style. Fix / complete section on names, characters. Add sections on parameter entities, conditional sections. Still to do: Add compatibility note on deterministic content models. Finish stylistic revision. 1996-10-31 : TB : Add Entity Handling section 1996-10-30 : TB : Clean up term & termdef. Slip in ERB decision re EMPTY. 1996-10-28 : TB : Change DTD. Implement some of Michael's suggestions. Change comments back to //. Introduce language for XML namespace reservation. Add section on white-space handling. Lots more cleanup. 1996-10-24 : CMSMcQ : quick tweaks, implement some ERB decisions. Characters are not integers. Comments are /* */ not //. Add bibliographic refs to 10646, HyTime, Unicode. Rename old Cdata as MsData since it's only seen in marked sections. Call them attribute-value pairs not name-value pairs, except once. Internal subset is optional, needs '?'. Implied attributes should be signaled to the app, not have values supplied by processor. 1996-10-16 : TB : track down & excise all DSD references; introduce some EBNF for entity declarations. 1996-10-?? : TB : consistency check, fix up scraps so they all parse, get formatter working, correct a few productions. 1996-10-10/11 : CMSMcQ : various maintenance, stylistic, and organizational changes: Replace a few literals with xmlpio and pic entities, to make them consistent and ensure we can change pic reliably when the ERB votes. Drop paragraph on recognizers from notation section. Add match, exact match to terminology. Move old 2.2 XML Processors and Apps into intro. Mention comments, PIs, and marked sections in discussion of delimiter escaping. Streamline discussion of doctype decl syntax. Drop old section of 'PI syntax' for doctype decl, and add section on partial-DTD summary PIs to end of Logical Structures section. Revise DSD syntax section to use Tim's subset-in-a-PI mechanism. 1996-10-10 : TB : eliminate name recognizers (and more?) 1996-10-09 : CMSMcQ : revise for style, consistency through 2.3 (Characters) 1996-10-09 : CMSMcQ : re-unite everything for convenience, at least temporarily, and revise quickly 1996-10-08 : TB : first major homogenization pass 1996-10-08 : TB : turn "current" attribute on div type into CDATA 1996-10-02 : TB : remould into skeleton + entities 1996-09-30 : CMSMcQ : add a few more sections prior to exchange with Tim. 1996-09-20 : CMSMcQ : finish transcribing notes. 1996-09-19 : CMSMcQ : begin transcribing notes for draft. 1996-09-13 : CMSMcQ : made outline from notes of 09-06, do some housekeeping
Introduction

Extensible Markup Language, abbreviated XML, describes a class of data objects called XML documents and partially describes the behavior of computer programs which process them. XML is an application profile or restricted form of SGML, the Standard Generalized Markup Language . By construction, XML documents are conforming SGML documents.

XML documents are made up of storage units called entities, which contain either parsed or unparsed data. Parsed data is made up of characters, some of which form character data, and some of which form markup. Markup encodes a description of the document's storage layout and logical structure. XML provides a mechanism to impose constraints on the storage layout and logical structure.

A software module called an XML processor is used to read XML documents and provide access to their content and structure. It is assumed that an XML processor is doing its work on behalf of another module, called the application. This specification describes the required behavior of an XML processor in terms of how it must read XML data and the information it must provide to the application.

Origin and Goals

XML was developed by an XML Working Group (originally known as the SGML Editorial Review Board) formed under the auspices of the World Wide Web Consortium (W3C) in 1996. It was chaired by Jon Bosak of Sun Microsystems with the active participation of an XML Special Interest Group (previously known as the SGML Working Group) also organized by the W3C. The membership of the XML Working Group is given in an appendix. Dan Connolly served as the WG's contact with the W3C.

The design goals for XML are:

XML shall be straightforwardly usable over the Internet.

XML shall support a wide variety of applications.

XML shall be compatible with SGML.

It shall be easy to write programs which process XML documents.

The number of optional features in XML is to be kept to the absolute minimum, ideally zero.

XML documents should be human-legible and reasonably clear.

The XML design should be prepared quickly.

The design of XML shall be formal and concise.

XML documents shall be easy to create.

Terseness in XML markup is of minimal importance.

This specification, together with associated standards (Unicode and ISO/IEC 10646 for characters, Internet RFC 1766 for language identification tags, ISO 639 for language name codes, and ISO 3166 for country name codes), provides all the information necessary to understand XML Version &versionOfXML; and construct computer programs to process it.

This version of the XML specification &doc.distribution;.

Terminology

The terminology used to describe XML documents is defined in the body of this specification. The terms defined in the following list are used in building those definitions and in describing the actions of an XML processor:

Conforming documents and XML processors are permitted to but need not behave as described.

Conforming documents and XML processors are required to behave as described; otherwise they are in error.

A violation of the rules of this specification; results are undefined. Conforming software may detect and report an error and may recover from it.

An error which a conforming XML processor must detect and report to the application. After encountering a fatal error, the processor may continue processing the data to search for further errors and may report such errors to the application. In order to support correction of errors, the processor may make unprocessed data from the document (with intermingled character data and markup) available to the application. Once a fatal error is detected, however, the processor must not continue normal processing (i.e., it must not continue to pass character data and information about the document's logical structure to the application in the normal way).

Conforming software may or must (depending on the modal verb in the sentence) behave as described; if it does, it must provide users a means to enable or disable the behavior described.

A rule which applies to all valid XML documents. Violations of validity constraints are errors; they must, at user option, be reported by validating XML processors.

A rule which applies to all well-formed XML documents. Violations of well-formedness constraints are fatal errors.

(Of strings or names:) Two strings or names being compared must be identical. Characters with multiple possible representations in ISO/IEC 10646 (e.g. characters with both precomposed and base+diacritic forms) match only if they have the same representation in both strings. [E85]At user option, processors may normalize such characters to some canonical form. No case folding is performed. (Of strings and rules in the grammar:) A string matches a grammatical production if it belongs to the language generated by that production. (Of content and content models:) An element matches its declaration when it conforms in the fashion described in the constraint .

[E87]Marks a sentence describing a feature of XML included solely to ensure that XML remains compatible with SGML.

[E87]Marks a sentence describing a non-binding recommendation included to increase the chances that XML documents can be processed by the existing installed base of SGML processors which predate the &WebSGML;.

Documents

A data object is an XML document if it is well-formed, as defined in this specification. A well-formed XML document may in addition be valid if it meets certain further constraints.

Each XML document has both a logical and a physical structure. Physically, the document is composed of units called entities. An entity may refer to other entities to cause their inclusion in the document. A document begins in a root or document entity. Logically, the document is composed of declarations, elements, comments, character references, and processing instructions, all of which are indicated in the document by explicit markup. The logical and physical structures must nest properly, as described in .

Well-Formed XML Documents

A textual object is a well-formed XML document if:

Taken as a whole, it matches the production labeled document.

It meets all the well-formedness constraints given in this specification.

Each of the parsed entities which is referenced directly or indirectly within the document is well-formed.

Document documentprolog element Misc*

Matching the document production implies that:

It contains one or more elements.

There is exactly one element, called the root, or document element, no part of which appears in the content of any other element. [E17]For all other elements, if the start-tag is in the content of another element, the end-tag is in the content of the same element. More simply stated, the elements, delimited by start- and end-tags, nest properly within each other.

As a consequence of this, for each non-root element C in the document, there is one other element P in the document such that C is in the content of P, but is not in the content of any other element that is in the content of P. P is referred to as the parent of C, and C as a child of P.

Characters

A parsed entity contains text, a sequence of characters, which may represent markup or character data. A character is an atomic unit of text as specified by ISO/IEC 10646 [E67](see also ). Legal characters are tab, carriage return, line feed, and the legal [E35]graphic characters of Unicode and ISO/IEC 10646. [E69]The versions of these standards cited in were current at the time this document was prepared. New characters may be added to these standards by amendments or new editions. Consequently, XML processors must accept any character in the range specified for Char. The use of compatibility characters, as defined in section 6.8 of [E67](see also D21 in section 3.6 of ), is discouraged.

Character Range Char#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.

The mechanism for encoding character code points into bit patterns may vary from entity to entity. All XML processors must accept the UTF-8 and UTF-16 encodings of 10646; the mechanisms for signaling which of the two is in use, or for bringing other encodings into play, are discussed later, in .

Common Syntactic Constructs

This section defines some symbols used widely in the grammar.

S (white space) consists of one or more space (#x20) characters, carriage returns, line feeds, or tabs.

White Space S(#x20 | #x9 | #xD | #xA)+

Characters are classified for convenience as letters, digits, or other characters. [E30]A letter consists of an alphabetic or syllabic base character or an ideographic character. Full definitions of the specific characters in each class are given in .

A Name is a token beginning with a letter or one of a few punctuation characters, and continuing with letters, digits, hyphens, underscores, colons, or full stops, together known as name characters. Names beginning with the string xml, or any string which would match (('X'|'x') ('M'|'m') ('L'|'l')), are reserved for standardization in this or future versions of this specification.

[E98]The Namespaces in XML Recommendation assigns a meaning to names containing colon characters. Therefore, authors should not use the colon in XML names except for namespace purposes, but XML processors must accept the colon as a name character.

An Nmtoken (name token) is any mixture of name characters.

Names and Tokens NameCharLetter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender Name(Letter | '_' | ':') (NameChar)* NamesName (S Name)* Nmtoken(NameChar)+ NmtokensNmtoken (S Nmtoken)*

Literal data is any quoted string not containing the quotation mark used as a delimiter for that string. Literals are used for specifying the content of internal entities (EntityValue), the values of attributes (AttValue), and external identifiers (SystemLiteral). Note that a SystemLiteral can be parsed without scanning for markup.

Literals EntityValue'"' ([^%&"] | PEReference | Reference)* '"' |  "'" ([^%&'] | PEReference | Reference)* "'" AttValue'"' ([^<&"] | Reference)* '"' |  "'" ([^<&'] | Reference)* "'" SystemLiteral('"' [^"]* '"') | ("'" [^']* "'") PubidLiteral'"' PubidChar* '"' | "'" (PubidChar - "'")* "'" PubidChar#x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]

[E72]Although the EntityValue production allows the definition of an entity consisting of a single explicit < in the literal (e.g., <!ENTITY mylt "<">), it is strongly advised to avoid this practice since any reference to that entity will cause a well-formedness error.

Character Data and Markup

Text consists of intermingled character data and markup. Markup takes the form of start-tags, end-tags, empty-element tags, entity references, character references, comments, CDATA section delimiters, document type declarations, processing instructions, [E89]XML declarations, text declarations, and any white space that is at the top level of the document entity (that is, outside the document element and not inside any other markup).

All text that is not markup constitutes the character data of the document.

The ampersand character (&) and the left angle bracket (<) may appear in their literal form only when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.[E18]They are also legal within the literal entity value of an internal entity declaration; see . If they are needed elsewhere, they must be escaped using either numeric character references or the strings &amp; and &lt; respectively. The right angle bracket (>) may be represented using the string &gt;, and must, for compatibility, be escaped using &gt; or a character reference when it appears in the string ]]> in content, when that string is not marking the end of a CDATA section.

In the content of elements, character data is any string of characters which does not contain the start-delimiter of any markup. In a CDATA section, character data is any string of characters not including the CDATA-section-close delimiter, ]]>.

To allow attribute values to contain both single and double quotes, the apostrophe or single-quote character (') may be represented as &apos;, and the double-quote character (") as &quot;.

Character Data CharData[^<&]* - ([^<&]* ']]>' [^<&]*)
Comments

Comments may appear anywhere in a document outside other markup; in addition, they may appear within the document type declaration at places allowed by the grammar. They are not part of the document's character data; an XML processor may, but need not, make it possible for an application to retrieve the text of comments. For compatibility, the string -- (double-hyphen) must not occur within comments. [E63]Parameter entity references are not recognized within comments.

Comments Comment'<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'

An example of a comment:

<!&como; declarations for <head> & <body> &comc;>

[E27]Note that the grammar does not allow a comment ending in --->. The following example is not well-formed.

<!-- B+, B, or B--->
Processing Instructions

Processing instructions (PIs) allow documents to contain instructions for applications.

Processing Instructions PI'<?' PITarget (S (Char* - (Char* &pic; Char*)))? &pic; PITargetName - (('X' | 'x') ('M' | 'm') ('L' | 'l'))

PIs are not part of the document's character data, but must be passed through to the application. The PI begins with a target (PITarget) used to identify the application to which the instruction is directed. The target names XML, xml, and so on are reserved for standardization in this or future versions of this specification. The XML Notation mechanism may be used for formal declaration of PI targets. [E63]Parameter entity references are not recognized within processing instructions.

CDATA Sections

CDATA sections may occur anywhere character data may occur; they are used to escape blocks of text containing characters which would otherwise be recognized as markup. CDATA sections begin with the string <![CDATA[ and end with the string ]]>:

CDATA Sections CDSectCDStart CData CDEnd CDStart'<![CDATA[' CData(Char* - (Char* ']]>' Char*)) CDEnd']]>'

Within a CDATA section, only the CDEnd string is recognized as markup, so that left angle brackets and ampersands may occur in their literal form; they need not (and cannot) be escaped using &lt; and &amp;. CDATA sections cannot nest.

An example of a CDATA section, in which <greeting> and </greeting> are recognized as character data, not markup:

<![CDATA[<greeting>Hello, world!</greeting>]]>
Prolog and Document Type Declaration

XML documents [E107]should begin with an XML declaration which specifies the version of XML being used. For example, the following is a complete XML document, well-formed but not valid:

Hello, world! ]]>

and so is this:

Hello, world!]]>

The version number 1.0 should be used to indicate conformance to this version of this specification; it is an error for a document to use the value 1.0 if it does not conform to this version of this specification. It is the intent of the XML working group to give later versions of this specification numbers other than 1.0, but this intent does not indicate a commitment to produce any future versions of XML, nor if any are produced, to use any particular numbering scheme. Since future versions are not ruled out, this construct is provided as a means to allow the possibility of automatic version recognition, should it become necessary. Processors may signal an error if they receive documents labeled with versions they do not support.

The function of the markup in an XML document is to describe its storage and logical structure and to associate attribute-value pairs with its logical structures. XML provides a mechanism, the document type declaration, to define constraints on the logical structure and to support the use of predefined storage units. An XML document is valid if it has an associated document type declaration and if the document complies with the constraints expressed in it.

The document type declaration must appear before the first element in the document.

Prolog prologXMLDecl? Misc* (doctypedecl Misc*)? XMLDecl&pio; VersionInfo EncodingDecl? SDDecl? S? &pic; VersionInfoS 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')[E15] EqS? '=' S? VersionNum([a-zA-Z0-9_.:] | '-')+ MiscComment | PI | S

The XML document type declaration contains or points to markup declarations that provide a grammar for a class of documents. This grammar is known as a document type definition, or DTD. The document type declaration can point to an external subset (a special kind of external entity) containing markup declarations, or can contain the markup declarations directly in an internal subset, or can do both. The DTD for a document consists of both subsets taken together.

A markup declaration is an element type declaration, an attribute-list declaration, an entity declaration, or a notation declaration. These declarations may be contained in whole or in part within parameter entities, as described in the well-formedness and validity constraints below. For [E14]further information, see .

Document Type Definition doctypedecl'<!DOCTYPE' S Name (S ExternalID)? S? ('[' (markupdecl | DeclSep)* ']' S?)? '>'[E109] DeclSepPEReference | S [E109] markupdeclelementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment

[E82]Note that it is possible to construct a well-formed document containing a doctypedecl that neither points to an external subset nor contains an internal subset.

The markup declarations may be made up in whole or in part of the replacement text of parameter entities. The productions later in this specification for individual nonterminals (elementdecl, AttlistDecl, and so on) describe the declarations after all the parameter entities have been included.

[E75]Parameter entity references are recognized anywhere in the DTD (internal and external subsets and external parameter entities), except in literals, processing instructions, comments, and the contents of ignored conditional sections (see ). They are also recognized in entity value literals. The use of parameter entities in the internal subset is restricted as described below.

Root Element Type

The Name in the document type declaration must match the element type of the root element.

Proper Declaration/PE Nesting

Parameter-entity replacement text must be properly nested with markup declarations. That is to say, if either the first character or the last character of a markup declaration (markupdecl above) is contained in the replacement text for a parameter-entity reference, both must be contained in the same replacement text.

PEs in Internal Subset

In the internal DTD subset, parameter-entity references can occur only where markup declarations can occur, not within markup declarations. (This does not apply to references that occur in external parameter entities or to the external subset.)

[E109]External Subset

The external subset, if any, must match the production for extSubset.

[E109]PE Between Declarations

The replacement text of a parameter entity reference in a DeclSep must match the production extSubsetDecl.

Like the internal subset, the external subset and any external parameter entities [E109]referenced in a DeclSep must consist of a series of complete markup declarations of the types allowed by the non-terminal symbol markupdecl, interspersed with white space or parameter-entity references. However, portions of the contents of the external subset or of [E109]these external parameter entities may conditionally be ignored by using the conditional section construct; this is not allowed in the internal subset.

External Subset extSubsetTextDecl? extSubsetDecl extSubsetDecl( markupdecl | conditionalSect | DeclSep)* [E109]

The external subset and external parameter entities also differ from the internal subset in that in them, parameter-entity references are permitted within markup declarations, not only between markup declarations.

An example of an XML document with a document type declaration:

Hello, world! ]]>

The system identifier hello.dtd gives the [E78]address (a URI reference) of a DTD for the document.

The declarations can also be given locally, as in this example:

]> Hello, world!]]>

If both the external and internal subsets are used, the internal subset is considered to occur before the external subset. This has the effect that entity and attribute-list declarations in the internal subset take precedence over those in the external subset.

Standalone Document Declaration

Markup declarations can affect the content of the document, as passed from an XML processor to an application; examples are attribute defaults and entity declarations. The standalone document declaration, which may appear as a component of the XML declaration, signals whether or not there are such declarations which appear external to the document entity[E64] or in parameter entities. An external markup declaration is defined as a markup declaration occurring in the external subset or in a parameter entity (external or internal, the latter being included because non-validating processors are not required to read them).

Standalone Document Declaration SDDecl S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))

In a standalone document declaration, the value yes indicates that there are no [E64]external markup declarations which affect the information passed from the XML processor to the application. The value no indicates that there are or may be such external markup declarations. Note that the standalone document declaration only denotes the presence of external declarations; the presence, in a document, of references to external entities, when those entities are internally declared, does not change its standalone status.

If there are no external markup declarations, the standalone document declaration has no meaning. If there are external markup declarations but there is no standalone document declaration, the value no is assumed.

Any XML document for which standalone="no" holds can be converted algorithmically to a standalone document, which may be desirable for some network delivery applications.

Standalone Document Declaration

The standalone document declaration must have the value no if any external markup declarations contain declarations of:

attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or

entities (other than &magicents;), if references to those entities appear in the document, or

attributes with values subject to normalization, where the attribute appears in the document with a value which will change as a result of normalization, or

element types with element content, if white space occurs directly within any instance of those types.

An example XML declaration with a standalone document declaration:

<?xml version="&versionOfXML;" standalone='yes'?>
White Space Handling

In editing XML documents, it is often convenient to use white space (spaces, tabs, and blank lines[E39], denoted by the nonterminal S in this specification) to set apart the markup for greater readability. Such white space is typically not intended for inclusion in the delivered version of the document. On the other hand, significant white space that should be preserved in the delivered version is common, for example in poetry and source code.

An XML processor must always pass all characters in a document that are not markup through to the application. A validating XML processor must also inform the application which of these characters constitute white space appearing in element content.

A special attribute named xml:space may be attached to an element to signal an intention that in that element, white space should be preserved by applications. In valid documents, this attribute, like any other, must be declared if it is used. When declared, it must be given as an enumerated type whose [E81]values are one or both of default and preserve. For example:

]]> <!-- [E81]--> <!ATTLIST pre xml:space (preserve) #FIXED 'preserve'>

The value default signals that applications' default white-space processing modes are acceptable for this element; the value preserve indicates the intent that applications preserve all the white space. This declared intent is considered to apply to all elements within the content of the element where it is specified, unless overriden with another instance of the xml:space attribute.

The root element of any document is considered to have signaled no intentions as regards application space handling, unless it provides a value for this attribute or the attribute is declared with a default value.

End-of-Line Handling

XML parsed entities are often stored in computer files which, for editing convenience, are organized into lines. These lines are typically separated by some combination of the characters carriage-return (#xD) and line-feed (#xA).

To simplify the tasks of applications, wherever an external parsed entity or the literal entity value of an internal parsed entity contains either the literal two-character sequence #xD#xA or a standalone literal #xD, an XML processor must pass to the application the single character #xA. (This behavior can conveniently be produced by normalizing all line breaks to #xA on input, before parsing.)

[E104]To simplify the tasks of applications, the characters passed to an application by the XML processor must be as if the XML processor normalized all line breaks in external parsed entities (including the document entity) on input, before parsing, by translating both the two-character sequence #xD #xA and any #xD that is not followed by #xA to a single #xA character.

Language Identification

In document processing, it is often useful to identify the natural or formal language in which the content is written. A special attribute named xml:lang may be inserted in documents to specify the language used in the contents and attribute values of any element in an XML document. In valid documents, this attribute, like any other, must be declared if it is used. [E73]The values of the attribute are language identifiers as defined by , Tags for the Identification of Languages, or its successor on the IETF Standards Track.

[E73] tags are constructed from two-letter language codes as defined by , from two-letter country codes as defined by , or from language identifiers registered with the Internet Assigned Numbers Authority [E58]. It is expected that the successor to will introduce three-letter language codes for languages not presently covered by .

[E73](Productions 33 through 38 have been removed.)

Language Identification LanguageIDLangcode ('-' Subcode)* LangcodeISO639Code | IanaCode | UserCode ISO639Code([a-z] | [A-Z]) ([a-z] | [A-Z]) IanaCode('i' | 'I') '-' ([a-z] | [A-Z])+ UserCode('x' | 'X') '-' ([a-z] | [A-Z])+ Subcode([a-z] | [A-Z])+

The Langcode may be any of the following:

a two-letter language code as defined by , Codes for the representation of names of languages

a language identifier registered with the Internet Assigned Numbers Authority ; these begin with the prefix i- (or I-)

a language identifier assigned by the user, or agreed on between parties in private use; these must begin with the prefix x- or X- in order to ensure that they do not conflict with names later standardized or registered with IANA

There may be any number of Subcode segments; if the first subcode segment exists and the Subcode consists of two letters, then it must be a country code from , "Codes for the representation of names of countries." If the first subcode consists of more than two letters, it must be a subcode for the language in question registered with IANA, unless the Langcode begins with the prefix "x-" or "X-".

It is customary to give the language code in lower case, and the country code (if any) in upper case. Note that these values, unlike other names in XML documents, are case insensitive.

For example:

The quick brown fox jumps over the lazy dog.

What colour is it?

What color is it?

Habe nun, ach! Philosophie, Juristerei, und Medizin und leider auch Theologie durchaus studiert mit heißem Bemüh'n. ]]>

The intent declared with xml:lang is considered to apply to all attributes and content of the element where it is specified, unless overridden with an instance of xml:lang on another element within that content.

A simple declaration for xml:lang might take the form

xml:lang NMTOKEN #IMPLIED

but specific default values may also be given, if appropriate. In a collection of French poems for English students, with glosses and notes in English, the xml:lang attribute might be declared this way:

]]>
Logical Structures

Each XML document contains one or more elements, the boundaries of which are either delimited by start-tags and end-tags, or, for empty elements, by an empty-element tag. Each element has a type, identified by name, sometimes called its generic identifier (GI), and may have a set of attribute specifications. Each attribute specification has a name and a value.

Element elementEmptyElemTag | STag content ETag

This specification does not constrain the semantics, use, or (beyond syntax) names of the element types and attributes, except that names beginning with a match to (('X'|'x')('M'|'m')('L'|'l')) are reserved for standardization in this or future versions of this specification.

Element Type Match

The Name in an element's end-tag must match the element type in the start-tag.

Element Valid

An element is valid if there is a declaration matching elementdecl where the Name matches the element type, and one of the following holds:

The declaration matches EMPTY and the element has no content.

The declaration matches children and the sequence of child elements belongs to the language generated by the regular expression in the content model, with optional white space (characters matching the nonterminal S) between [E59]the start-tag and the first child element, between child elements, or between the last child element and the end-tag. Note that a CDATA section containing only white space does not match the nonterminal S, and hence cannot appear in these positions.

The declaration matches Mixed and the content consists of character data and child elements whose types match names in the content model.

The declaration matches ANY, and the types of any child elements have been declared.

Start-Tags, End-Tags, and Empty-Element Tags

The beginning of every non-empty XML element is marked by a start-tag.

Start-tag STag'<' Name (S Attribute)* S? '>' AttributeName Eq AttValue

The Name in the start- and end-tags gives the element's type. The Name-AttValue pairs are referred to as the attribute specifications of the element, with the Name in each pair referred to as the attribute name and the content of the AttValue (the text between the ' or " delimiters) as the attribute value.[E46]Note that the order of attribute specifications in a start-tag or empty-element tag is not significant.

Unique Att Spec

No attribute name may appear more than once in the same start-tag or empty-element tag.

Attribute Value Type

The attribute must have been declared; the value must be of the type declared for it. (For attribute types, see .)

No External Entity References

Attribute values cannot contain direct or indirect entity references to external entities.

No < in Attribute Values

The replacement text of any entity referred to directly or indirectly in an attribute value [E83](other than &lt;) must not contain a <.

An example of a start-tag:

<termdef id="dt-dog" term="dog">

The end of every element that begins with a start-tag must be marked by an end-tag containing a name that echoes the element's type as given in the start-tag:

End-tag ETag'</' Name S? '>'

An example of an end-tag:

</termdef>

The text between the start-tag and end-tag is called the element's content:

Content of Elements contentCharData? ((element | Reference | CDSect | PI | Comment) CharData?)* [E71]

[E97]An element with no content is said to be empty. The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag. An empty-element tag takes a special form:

Tags for Empty Elements EmptyElemTag'<' Name (S Attribute)* S? '/>'

Empty-element tags may be used for any element which has no content, whether or not it is declared using the keyword EMPTY. For interoperability, the empty-element tag [E45]should be used, and should only be used, for elements which are declared EMPTY.

Examples of empty elements:

<IMG align="left" src="http://www.w3.org/Icons/WWW/w3c_home" /> <br></br> <br/>
Element Type Declarations

The element structure of an XML document may, for validation purposes, be constrained using element type and attribute-list declarations. An element type declaration constrains the element's content.

Element type declarations often constrain which element types can appear as children of the element. At user option, an XML processor may issue a warning when a declaration mentions an element type for which no declaration is provided, but this is not an error.

An element type declaration takes the form:

Element Type Declaration elementdecl'<!ELEMENT' S Name S contentspec S? '>' contentspec'EMPTY' | 'ANY' | Mixed | children

where the Name gives the element type being declared.

Unique Element Type Declaration

No element type may be declared more than once.

Examples of element type declarations:

<!ELEMENT br EMPTY> <!ELEMENT p (#PCDATA|emph)* > <!ELEMENT %name.para; %content.para; > <!ELEMENT container ANY> Element Content

An element type has element content when elements of that type must contain only child elements (no character data), optionally separated by white space (characters matching the nonterminal S).In this case, the constraint includes a [E55]content model, a simple grammar governing the allowed types of the child elements and the order in which they are allowed to appear. The grammar is built on content particles (cps), which consist of names, choice lists of content particles, or sequence lists of content particles:

Element-content Models children(choice | seq) ('?' | '*' | '+')? cp(Name | choice | seq) ('?' | '*' | '+')? choice'(' S? cp ( S? '|' S? cp )+ S? ')'[E50] [E52] seq'(' S? cp ( S? ',' S? cp )* S? ')'[E52]

where each Name is the type of an element which may appear as a child. Any content particle in a choice list may appear in the element content at the location where the choice list appears in the grammar; content particles occurring in a sequence list must each appear in the element content in the order given in the list. The optional character following a name or list governs whether the element or the content particles in the list may occur one or more (+), zero or more (*), or zero or one times (?). The absence of such an operator means that the element or content particle must appear exactly once. This syntax and meaning are identical to those used in the productions in this specification.

The content of an element matches a content model if and only if it is possible to trace out a path through the content model, obeying the sequence, choice, and repetition operators and matching each element in the content against an element type in the content model. For compatibility, it is an error if an element in the document can match more than one occurrence of an element type in the content model. For more information, see .

Proper Group/PE Nesting

Parameter-entity replacement text must be properly nested with [E11]parenthesized groups. That is to say, if either of the opening or closing parentheses in a choice, seq, or Mixed construct is contained in the replacement text for a parameter entity, both must be contained in the same replacement text.

[E19]For interoperability, if a parameter-entity reference appears in a choice, seq, or Mixed construct, its replacement text should contain at least one non-blank character, and neither the first nor last non-blank character of the replacement text should be a connector (| or ,).

Examples of element-content models:

<!ELEMENT spec (front, body, back?)> <!ELEMENT div1 (head, (p | list | note)*, div2*)> <!ELEMENT dictionary-body (%div.mix; | %dict.mix;)*>
Mixed Content

An element type has mixed content when elements of that type may contain character data, optionally interspersed with child elements. In this case, the types of the child elements may be constrained, but not their order or their number of occurrences:

Mixed-content Declaration Mixed'(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' | '(' S? '#PCDATA' S? ')'

where the Names give the types of elements that may appear as children. [E10]The keyword #PCDATA derives historically from the term parsed character data.

No Duplicate Types

The same name must not appear more than once in a single mixed-content declaration.

Examples of mixed content declarations:

<!ELEMENT p (#PCDATA|a|ul|b|i|em)*> <!ELEMENT p (#PCDATA | %font; | %phrase; | %special; | %form;)* > <!ELEMENT b (#PCDATA)>
Attribute-List Declarations

Attributes are used to associate name-value pairs with elements. Attribute specifications may appear only within start-tags and empty-element tags; thus, the productions used to recognize them appear in . Attribute-list declarations may be used:

To define the set of attributes pertaining to a given element type.

To establish type constraints for these attributes.

To provide default values for attributes.

Attribute-list declarations specify the name, data type, and default value (if any) of each attribute associated with a given element type:

Attribute-list Declaration AttlistDecl'<!ATTLIST' S Name AttDef* S? '>' AttDefS Name S AttType S DefaultDecl

The Name in the AttlistDecl rule is the type of an element. At user option, an XML processor may issue a warning if attributes are declared for an element type not itself declared, but this is not an error. The Name in the AttDef rule is the name of the attribute.

When more than one AttlistDecl is provided for a given element type, the contents of all those provided are merged. When more than one definition is provided for the same attribute of a given element type, the first declaration is binding and later declarations are ignored. [E9]For interoperability, writers of DTDs may choose to provide at most one attribute-list declaration for a given element type, at most one attribute definition for a given attribute name in an attribute-list declaration, and at least one attribute definition in each attribute-list declaration. For interoperability, an XML processor may at user option issue a warning when more than one attribute-list declaration is provided for a given element type, or more than one attribute definition is provided for a given attribute, but this is not an error.

Attribute Types

XML attribute types are of three kinds: a string type, a set of tokenized types, and enumerated types. The string type may take any literal string as a value; the tokenized types have varying lexical and semantic constraints[E8]. The validity constraints noted in the grammar are applied after the attribute value has been normalized as described in .

Attribute Types AttTypeStringType | TokenizedType | EnumeratedType StringType'CDATA' TokenizedType'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS' ID

Values of type ID must match the Name production. A name must not appear more than once in an XML document as a value of this type; i.e., ID values must uniquely identify the elements which bear them.

One ID per Element Type

No element type may have more than one ID attribute specified.

ID Attribute Default

An ID attribute must have a declared default of #IMPLIED or #REQUIRED.

IDREF

Values of type IDREF must match the Name production, and values of type IDREFS must match Names; each Name must match the value of an ID attribute on some element in the XML document; i.e. IDREF values must match the value of some ID attribute.

Entity Name

Values of type ENTITY must match the Name production, values of type ENTITIES must match Names; each Name must match the name of an unparsed entity declared in the DTD.

Name Token

Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.

Enumerated attributes can take one of a list of values provided in the declaration. There are two kinds of enumerated types:

Enumerated Attribute Types EnumeratedTypeNotationType | Enumeration NotationType'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')' Enumeration'(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'

A NOTATION attribute identifies a notation, declared in the DTD with associated system and/or public identifiers, to be used in interpreting the element to which the attribute is attached.

Notation Attributes

Values of this type must match one of the notation names included in the declaration; all notation names in the declaration must be declared.

[E7]One Notation Per Element Type

No element type may have more than one NOTATION attribute specified.

[E68]No Notation on Empty Element

For compatibility, an attribute of type NOTATION must not be declared on an element declared EMPTY.

Enumeration

Values of this type must match one of the Nmtoken tokens in the declaration.

For interoperability, the same Nmtoken should not occur more than once in the enumerated attribute types of a single element type.

Attribute Defaults

An attribute declaration provides information on whether the attribute's presence is required, and if not, how an XML processor should react if a declared attribute is absent in a document.

Attribute Defaults DefaultDecl'#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)

In an attribute declaration, #REQUIRED means that the attribute must always be provided, #IMPLIED that no default value is provided. If the declaration is neither #REQUIRED nor #IMPLIED, then the AttValue value contains the declared default value; the #FIXED keyword states that the attribute must always have the default value. If a default value is declared, when an XML processor encounters an omitted attribute, it is to behave as though the attribute were present with the declared default value.

Required Attribute

If the default declaration is the keyword #REQUIRED, then the attribute must be specified for all elements of the type in the attribute-list declaration.

Attribute Default Legal

The declared default value must meet the lexical constraints of the declared attribute type.

Fixed Attribute Default

If an attribute has a default value declared with the #FIXED keyword, instances of that attribute must match the default value.

Examples of attribute-list declarations:

<!ATTLIST termdef id ID #REQUIRED name CDATA #IMPLIED> <!ATTLIST list type (bullets|ordered|glossary) "ordered"> <!ATTLIST form method CDATA #FIXED "POST">
[E70]Attribute-Value Normalization

Before the value of an attribute is passed to the application or checked for validity, the XML processor must normalize the attribute value by applying the algorithm below, or by using some other method such that the value passed to the application is the same as that produced by the algorithm.

All line breaks must have been normalized on input to #xA as described in , so the rest of this algorithm operates on text normalized in this way.

Begin with a normalized value consisting of the empty string.

For each character, entity reference, or character reference in the unnormalized attribute value, beginning with the first and continuing to the last, do the following:

For a character reference, append the referenced character to the normalized value.

For an entity reference, recursively apply step 3 of this algorithm to the replacement text of the entity.

For a white space character (#x20, #xD, #xA, #x9), append a space character (#x20) to the normalized value.

For another character, append the character to the normalized value.

If the attribute type is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by a single space (#x20) character.

Note that if the unnormalized attribute value contains a character reference to a white space character other than space (#x20), the normalized value contains the referenced character itself (#xD, #xA or #x9). This contrasts with the case where the unnormalized value contains a white space character (not a reference), which is replaced with a space character (#x20) in the normalized value and also contrasts with the case where the unnormalized value contains an entity reference whose replacement text contains a white space character; being recursively processed, the white space character is replaced with a space character (#x20) in the normalized value.

All attributes for which no declaration has been read should be treated by a non-validating [E95]processor as if declared CDATA.

Following are examples of attribute normalization. Given the following declarations:

<!ENTITY d "&#xD;"> <!ENTITY a "&#xA;"> <!ENTITY da "&#xD;&#xA;">

the attribute specifications in the left column below would be normalized to the character sequences of the middle column if the attribute a is declared NMTOKENS and to those of the right columns if a is declared CDATA.

Attribute specification a is NMTOKENSa is CDATA
a=" xyz"x y z#x20 #x20 x y z
a="&d;&d;A&a;&a;B&da;"A #x20 B#x20 #x20 A #x20 #x20 B #x20 #x20
a= "&#xd;&#xd;A&#xa;&#xa;B&#xd;&#xa;"#xD #xD A #xA #xA B #xD #xA#xD #xD A #xA #xA B #xD #xD

Note that the last example is invalid (but well-formed) if a is declared to be of type NMTOKENS.

Conditional Sections

Conditional sections are portions of the document type declaration external subset which are included in, or excluded from, the logical structure of the DTD based on the keyword which governs them.

Conditional Section conditionalSectincludeSect | ignoreSect includeSect'<![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>' [E90] ignoreSect'<![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>'[E90] ignoreSectContentsIgnore ('<![' ignoreSectContents ']]>' Ignore)* IgnoreChar* - (Char* ('<![' | ']]>') Char*) [E90]Proper Conditional Section/PE Nesting

If any of the "<![", "[", or "]]>" of a conditional section is contained in the replacement text for a parameter-entity reference, all of them must be contained in the same replacement text.

Like the internal and external DTD subsets, a conditional section may contain one or more complete declarations, comments, processing instructions, or nested conditional sections, intermingled with white space.

If the keyword of the conditional section is INCLUDE, then the contents of the conditional section are part of the DTD. If the keyword of the conditional section is IGNORE, then the contents of the conditional section are not logically part of the DTD. [E90]Note that for reliable parsing, the contents of even ignored conditional sections must be read in order to detect nested conditional sections and ensure that the end of the outermost (ignored) conditional section is properly detected. If a conditional section with a keyword of INCLUDE occurs within a larger conditional section with a keyword of IGNORE, both the outer and the inner conditional sections are ignored. [E90]The contents of an ignored conditional section are parsed by ignoring all characters after the "[" following the keyword, except conditional section starts "<![" and ends "]]>", until the matching conditional section end is found. Parameter entity references are not recognized in this process.

If the keyword of the conditional section is a parameter-entity reference, the parameter entity must be replaced by its content before the processor decides whether to include or ignore the conditional section.

An example:

<!ENTITY % draft 'INCLUDE' > <!ENTITY % final 'IGNORE' > <![%draft;[ <!ELEMENT book (comments*, title, body, supplements?)> ]]> <![%final;[ <!ELEMENT book (title, body, supplements?)> ]]>
Physical Structures

An XML document may consist of one or many storage units. [E6]These are called entities; they all have content and are all (except for the document entity and the external DTD subset) identified by entity name. Each XML document has one entity called the document entity, which serves as the starting point for the XML processor and may contain the whole document.

Entities may be either parsed or unparsed. A parsed entity's contents are referred to as its replacement text; this text is considered an integral part of the document.

An unparsed entity is a resource whose contents may or may not be text, and if text, [E25]may be other than XML. Each unparsed entity has an associated notation, identified by name. Beyond a requirement that an XML processor make the identifiers for the entity and notation available to the application, XML places no constraints on the contents of unparsed entities.

Parsed entities are invoked by name using entity references; unparsed entities by name, given in the value of ENTITY or ENTITIES attributes.

General entities are entities for use within the document content. In this specification, general entities are sometimes referred to with the unqualified term entity when this leads to no ambiguity. [E53]Parameter entities are parsed entities for use within the DTD. These two types of entities use different forms of reference and are recognized in different contexts. Furthermore, they occupy different namespaces; a parameter entity and a general entity with the same name are two distinct entities.

Character and Entity References

A character reference refers to a specific character in the ISO/IEC 10646 character set, for example one not directly accessible from available input devices.

Character Reference CharRef'&#' [0-9]+ ';' | '&hcro;' [0-9a-fA-F]+ ';' Legal Character

Characters referred to using character references must match the production for Char.

If the character reference begins with &#x, the digits and letters up to the terminating ; provide a hexadecimal representation of the character's code point in ISO/IEC 10646. If it begins just with &#, the digits up to the terminating ; provide a decimal representation of the character's code point.

An entity reference refers to the content of a named entity. References to parsed general entities use ampersand (&) and semicolon (;) as delimiters. Parameter-entity references use percent-sign (%) and semicolon (;) as delimiters.

Entity Reference ReferenceEntityRef | CharRef EntityRef'&' Name ';' PEReference'%' Name ';' Entity Declared

In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with standalone='yes', [E34]for an entity reference that does not occur within the external subset or a parameter entity, the Name given in the entity reference must match that in an entity declaration that does not occur within the external subset or a parameter entity, except that well-formed documents need not declare any of the following entities: &magicents;. [E29]The declaration of a parameter entity must precede any reference to it. Similarly, The declaration of a general entity must precede any reference to it which appears in a default value in an attribute-list declaration.

Note that if entities are declared in the external subset or in external parameter entities, a non-validating processor is not obligated to read and process their declarations; for such documents, the rule that an entity must be declared is a well-formedness constraint only if standalone='yes'.

Entity Declared

In a document with an external subset or external parameter entities with standalone='no', the Name given in the entity reference must match that in an entity declaration. For interoperability, valid documents should declare the entities &magicents;, in the form specified in . The declaration of a parameter entity must precede any reference to it. Similarly, the declaration of a general entity must precede any [E92]attribute-list declaration containing a default value with a direct or indirect reference to that general entity.

Parsed Entity

An entity reference must not contain the name of an unparsed entity. Unparsed entities may be referred to only in attribute values declared to be of type ENTITY or ENTITIES.

No Recursion

A parsed entity must not contain a recursive reference to itself, either directly or indirectly.

In DTD

Parameter-entity references may only appear in the DTD.

Examples of character and entity references:

Type <key>less-than</key> (&hcro;3C;) to save options. This document was prepared on &docdate; and is classified &security-level;.

Example of a parameter-entity reference:

%ISOLat2;]]>
Entity Declarations

Entities are declared thus:

Entity Declaration EntityDeclGEDecl | PEDecl GEDecl'<!ENTITY' S Name S EntityDef S? '>' PEDecl'<!ENTITY' S '%' S Name S PEDef S? '>' EntityDefEntityValue | (ExternalID NDataDecl?) PEDefEntityValue | ExternalID

The Name identifies the entity in an entity reference or, in the case of an unparsed entity, in the value of an ENTITY or ENTITIES attribute. If the same entity is declared more than once, the first declaration encountered is binding; at user option, an XML processor may issue a warning if entities are declared multiple times.

Internal Entities

If the entity definition is an EntityValue, the defined entity is called an internal entity. There is no separate physical storage object, and the content of the entity is given in the declaration. Note that some processing of entity and character references in the literal entity value may be required to produce the correct replacement text: see .

An internal entity is a parsed entity.

Example of an internal entity declaration:

<!ENTITY Pub-Status "This is a pre-release of the specification.">
External Entities

If the entity is not internal, it is an external entity, declared as follows:

External Entity Declaration ExternalID'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral NDataDeclS 'NDATA' S Name

If the NDataDecl is present, this is a general unparsed entity; otherwise it is a parsed entity.

Notation Declared

The Name must match the declared name of a notation.

The SystemLiteral is called the entity's system identifier. It is a [E88]URI reference[E66] (as defined in , updated by ), [E76]meant to be dereferenced to obtain input for the XML processor to construct the entity's replacement text. It is an error for a fragment identifier (beginning with a # character) to be part of a system identifier. Unless otherwise provided by information outside the scope of this specification (e.g. a special XML element type defined by a particular DTD, or a processing instruction defined by a particular application specification), relative URIs are relative to the location of the resource within which the entity declaration occurs. A URI might thus be relative to the document entity, to the entity containing the external DTD subset, or to some other external parameter entity.

[E78]URI references require encoding and escaping of certain characters. The disallowed characters include all non-ASCII characters, plus the excluded characters listed in Section 2.4 of , except for the number sign (#) and percent sign (%) characters and the square bracket characters re-allowed in . Disallowed characters must be escaped as follows:

Each disallowed character is converted to UTF-8 as one or more bytes.

Any octets corresponding to a disallowed character are escaped with the URI escaping mechanism (that is, converted to %HH, where HH is the hexadecimal notation of the byte value).

The original character is replaced by the resulting character sequence.

In addition to a system identifier, an external identifier may include a public identifier. An XML processor attempting to retrieve the entity's content may use the public identifier to try to generate an alternative [E88]URI reference. If the processor is unable to do so, it must use the [E88]URI reference specified in the system literal. Before a match is attempted, all strings of white space in the public identifier must be normalized to single space characters (#x20), and leading and trailing white space must be removed.

Examples of external entity declarations:

<!ENTITY open-hatch SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml"> <!ENTITY open-hatch PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN" "http://www.textuality.com/boilerplate/OpenHatch.xml"> <!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif >
Parsed Entities The Text Declaration

External parsed entities [E107]should each begin with a text declaration.

Text Declaration TextDecl&pio; VersionInfo? EncodingDecl S? &pic;

The text declaration must be provided literally, not by reference to a parsed entity. No text declaration may appear at any position other than the beginning of an external parsed entity. [E94]The text declaration in an external parsed entity is not considered part of its replacement text.

Well-Formed Parsed Entities

The document entity is well-formed if it matches the production labeled document. An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [E109]All external parameter entities are well-formed by definition.

Well-Formed External Parsed Entity extParsedEntTextDecl? content extPETextDecl? extSubsetDecl [E109]

An internal general parsed entity is well-formed if its replacement text matches the production labeled content. All internal parameter entities are well-formed by definition.

A consequence of well-formedness in entities is that the logical and physical structures in an XML document are properly nested; no start-tag, end-tag, empty-element tag, element, comment, processing instruction, character reference, or entity reference can begin in one entity and end in another.

Character Encoding in Entities

Each external parsed entity in an XML document may use a different encoding for its characters. All XML processors must be able to read entities in [E56]both the UTF-8 and UTF-16 encodings. [E77]The terms UTF-8 and UTF-16 in this specification do not apply to character encodings with any other labels, even if the encodings or labels are very similar to UTF-8 or UTF-16.

Entities encoded in UTF-16 must begin with the Byte Order Mark described by [E67]Annex F of , Annex H of , section 2.4 of , and section 2.7 of (the ZERO WIDTH NO-BREAK SPACE character, #xFEFF). This is an encoding signature, not part of either the markup or the character data of the XML document. XML processors must be able to use this character to differentiate between UTF-8 and UTF-16 encoded documents.

Although an XML processor is required to read only entities in the UTF-8 and UTF-16 encodings, it is recognized that other encodings are used around the world, and it may be desired for XML processors to read entities that use them. [E47]In the absence of external character encoding information (such as MIME headers), parsed entities which are stored in an encoding other than UTF-8 or UTF-16 must begin with a text declaration (see ) containing an encoding declaration:

Encoding Declaration EncodingDeclS 'encoding' Eq ('"' EncName '"' | "'" EncName "'" ) EncName[A-Za-z] ([A-Za-z0-9._] | '-')*Encoding name contains only Latin characters

In the document entity, the encoding declaration is part of the XML declaration. The EncName is the name of the encoding used.

In an encoding declaration, the values UTF-8, UTF-16, ISO-10646-UCS-2, and ISO-10646-UCS-4 should be used for the various encodings and transformations of Unicode / ISO/IEC 10646, the values ISO-8859-1, ISO-8859-2, ... [E106]ISO-8859-n (where n is the part number) should be used for the parts of ISO 8859, and the values ISO-2022-JP, Shift_JIS, and EUC-JP should be used for the various encoded forms of JIS X-0208-1997. [E57]It is recommended that character encodings registered (as charsets) with the Internet Assigned Numbers Authority [E58], other than those just listed, be referred to using their registered names; other encodings should use names starting with an x- prefix. XML processors should match character encoding names in a case-insensitive way and should either interpret an IANA-registered name as the encoding registered at IANA for that name or treat it as unknown (processors are, of course, not required to support all IANA-registered encodings).

In the absence of information provided by an external transport protocol (e.g. HTTP or MIME), it is an error for an entity including an encoding declaration to be presented to the XML processor in an encoding other than that named in the declaration, [E5]for an encoding declaration to occur other than at the beginning of an external entity, or for an entity which begins with neither a Byte Order Mark nor an encoding declaration to use an encoding other than UTF-8. Note that since ASCII is a subset of UTF-8, ordinary ASCII entities do not strictly need an encoding declaration.

[E5]It is [E36]a fatal error for a TextDecl to occur other than at the beginning of an external entity.

It is a fatal error when an XML processor encounters an entity with an encoding that it is unable to process. [E79]It is a fatal error if an XML entity is determined (via default, encoding declaration, or higher-level protocol) to be in a certain encoding but contains octet sequences that are not legal in that encoding. It is also a fatal error if an XML entity contains no encoding declaration and its content is not legal UTF-8 or UTF-16.

Examples of [E23]text declarations containing encoding declarations:

<?xml encoding='UTF-8'?> <?xml encoding='EUC-JP'?>
XML Processor Treatment of Entities and References

The table below summarizes the contexts in which character references, entity references, and invocations of unparsed entities might appear and the required behavior of an XML processor in each case. The labels in the leftmost column describe the recognition context:

as a reference anywhere after the start-tag and before the end-tag of an element; corresponds to the nonterminal content.

as a reference within either the value of an attribute in a start-tag, or a default value in an attribute declaration; corresponds to the nonterminal AttValue.

as a Name, not a reference, appearing either as the value of an attribute which has been declared as type ENTITY, or as one of the space-separated tokens in the value of an attribute which has been declared as type ENTITIES.

as a reference within a parameter or internal entity's literal entity value in the entity's declaration; corresponds to the nonterminal EntityValue.

[E90]as a reference within either the internal or external subsets of the DTD, but outside of an EntityValue, AttValue, PI, Comment, SystemLiteral, PubidLiteral, or the contents of an ignored conditional section (see ).

.

Entity TypeCharacter
ParameterInternal GeneralExternal Parsed GeneralUnparsed
Reference in ContentNot recognized IncludedIncluded if validatingForbidden Included
Reference in Attribute ValueNot recognizedIncluded in literalForbidden [E51]ForbiddenIncluded
Occurs as Attribute ValueNot recognized Forbidden[E51]ForbiddenNotify [E51]Not recognized
Reference in EntityValueIncluded in literalBypassed BypassedForbidden Included
Reference in DTDIncluded as PEForbidden ForbiddenForbidden Forbidden
Not Recognized

Outside the DTD, the % character has no special significance; thus, what would be parameter entity references in the DTD are not recognized as markup in content. Similarly, the names of unparsed entities are not recognized except when they appear in the value of an appropriately declared attribute.

Included

An entity is included when its replacement text is retrieved and processed, in place of the reference itself, as though it were part of the document at the location the reference was recognized. The replacement text may contain both character data and (except for parameter entities) markup, which must be recognized in the usual way[E65], except that the replacement text of entities used to escape markup delimiters (the entities &magicents;) is always treated as data. (The string AT&amp;T; expands to AT&T; and the remaining ampersand is not recognized as an entity-reference delimiter.) A character reference is included when the indicated character is processed in place of the reference itself.

Included If Validating

When an XML processor recognizes a reference to a parsed entity, in order to validate the document, the processor must include its replacement text. If the entity is external, and the processor is not attempting to validate the XML document, the processor may, but need not, include the entity's replacement text. If a non-validating [E95]processor does not include the replacement text, it must inform the application that it recognized, but did not read, the entity.

This rule is based on the recognition that the automatic inclusion provided by the SGML and XML entity mechanism, primarily designed to support modularity in authoring, is not necessarily appropriate for other applications, in particular document browsing. Browsers, for example, when encountering an external parsed entity reference, might choose to provide a visual indication of the entity's presence and retrieve it for display only on demand.

Forbidden

The following are forbidden, and constitute fatal errors:

the appearance of a reference to an unparsed entity.

the appearance of any character or general-entity reference in the DTD except within an EntityValue or AttValue.

a reference to an external entity in an attribute value.

Included in Literal

When an entity reference appears in an attribute value, or a parameter entity reference appears in a literal entity value, its replacement text is processed in place of the reference itself as though it were part of the document at the location the reference was recognized, except that a single or double quote character in the replacement text is always treated as a normal data character and will not terminate the literal. For example, this is well-formed:

<!-- [E4] --> ]]>

while this is not:

<!ENTITY EndAttr "27'" > <element attribute='a-&EndAttr;>
Notify

When the name of an unparsed entity appears as a token in the value of an attribute of declared type ENTITY or ENTITIES, a validating processor must inform the application of the system and public (if any) identifiers for both the entity and its associated notation.

Bypassed

When a general entity reference appears in the EntityValue in an entity declaration, it is bypassed and left as is.

Included as PE

Just as with external parsed entities, parameter entities need only be included if validating. When a parameter-entity reference is recognized in the DTD and included, its replacement text is enlarged by the attachment of one leading and one following space (#x20) character; the intent is to constrain the replacement text of parameter entities to contain an integral number of grammatical tokens in the DTD. [E96]This behavior does not apply to parameter entity references within entity values; these are described in .

Construction of Internal Entity Replacement Text

In discussing the treatment of internal entities, it is useful to distinguish two forms of the entity's value. The literal entity value is the quoted string actually present in the entity declaration, corresponding to the non-terminal EntityValue. The replacement text is the content of the entity, after replacement of character references and parameter-entity references.

The literal entity value as given in an internal entity declaration (EntityValue) may contain character, parameter-entity, and general-entity references. Such references must be contained entirely within the literal entity value. The actual replacement text that is included as described above must contain the replacement text of any parameter entities referred to, and must contain the character referred to, in place of any character references in the literal entity value; however, general-entity references must be left as-is, unexpanded. For example, given the following declarations:

]]>

then the replacement text for the entity book is:

La Peste: Albert Camus, © 1947 Éditions Gallimard. &rights;

The general-entity reference &rights; would be expanded should the reference &book; appear in the document's content or an attribute value.

These simple rules may have complex interactions; for a detailed discussion of a difficult example, see .

Predefined Entities

Entity and character references can both be used to escape the left angle bracket, ampersand, and other delimiters. A set of general entities (&magicents;) is specified for this purpose. Numeric character references may also be used; they are expanded immediately when recognized and must be treated as character data, so the numeric character references &#60; and &#38; may be used to escape < and & when they occur in character data.

All XML processors must recognize these entities whether they are declared or not. For interoperability, valid XML documents should declare these entities, like any others, before using them. [E80]If the entities lt or amp are declared, they must be declared as internal entities whose replacement text is a character reference to the [E103]respective character (less-than sign or ampersand) being escaped; the double escaping is required for these entities so that references to them produce a well-formed result. If the entities gt, apos, or quot are declared, they must be declared as internal entities whose replacement text is the single character being escaped (or a character reference to that character; the double escaping here is unnecessary but harmless). For example:

]]>

Note that the < and & characters in the declarations of lt and amp are doubly escaped to meet the requirement that entity replacement be well-formed.

Notation Declarations

Notations identify by name the format of unparsed entities, the format of elements which bear a notation attribute, or the application to which a processing instruction is addressed.

Notation declarations provide a name for the notation, for use in entity and attribute-list declarations and in attribute specifications, and an external identifier for the notation which may allow an XML processor or its client application to locate a helper application capable of processing data in the given notation.

Notation Declarations NotationDecl'<!NOTATION' S Name S (ExternalID | PublicID) S? '>' PublicID'PUBLIC' S PubidLiteral [E22]Unique Notation Name

Only one notation declaration can declare a given Name.

XML processors must provide applications with the name and external identifier(s) of any notation declared and referred to in an attribute value, attribute definition, or entity declaration. They may additionally resolve the external identifier into the system identifier, file name, or other information needed to allow the application to call a processor for data in the notation described. (It is not an error, however, for XML documents to declare and refer to notations for which notation-specific applications are not available on the system where the XML processor or application is running.)

Document Entity

The document entity serves as the root of the entity tree and a starting-point for an XML processor. This specification does not specify how the document entity is to be located by an XML processor; unlike other entities, the document entity has no name and might well appear on a processor input stream without any identification at all.

Conformance Validating and Non-Validating Processors

Conforming XML processors fall into two classes: validating and non-validating.

Validating and non-validating processors alike must report violations of this specification's well-formedness constraints in the content of the document entity and any other parsed entities that they read.

Validating processors must[E21], at user option, report violations of the constraints expressed by the declarations in the DTD, and failures to fulfill the validity constraints given in this specification. To accomplish this, validating XML processors must read and process the entire DTD and all external parsed entities referenced in the document.

Non-validating processors are required to check only the document entity, including the entire internal DTD subset, for well-formedness. While they are not required to check the document for validity, they are required to process all the declarations they read in the internal DTD subset and in any parameter entity that they read, up to the first reference to a parameter entity that they do not read; that is to say, they must use the information in those declarations to normalize attribute values, include the replacement text of internal entities, and supply default attribute values. [E33]Except when standalone="yes", they must not process entity declarations or attribute-list declarations encountered after a reference to a parameter entity that is not read, since the entity may have contained overriding declarations.

Using XML Processors

The behavior of a validating XML processor is highly predictable; it must read every piece of a document and report all well-formedness and validity violations. Less is required of a non-validating processor; it need not read any part of the document other than the document entity. This has two effects that may be important to users of XML processors:

Certain well-formedness errors, specifically those that require reading external entities, may not be detected by a non-validating processor. Examples include the constraints entitled Entity Declared, Parsed Entity, and No Recursion, as well as some of the cases described as forbidden in .

The information passed from the processor to the application may vary, depending on whether the processor reads parameter and external entities. For example, a non-validating processor may not normalize attribute values, include the replacement text of internal entities, or supply default attribute values, where doing so depends on having read declarations in external or parameter entities.

For maximum reliability in interoperating between different XML processors, applications which use non-validating processors should not rely on any behaviors not required of such processors. Applications which require facilities such as the use of default attributes or internal entities which are declared in external entities should use validating XML processors.

Notation

The formal grammar of XML is given in this specification using a simple Extended Backus-Naur Form (EBNF) notation. Each rule in the grammar defines one symbol, in the form

symbol ::= expression

Symbols are written with an initial capital letter if they are [E42]the start symbol of a regular language, otherwise with an initial lower case letter. Literal strings are quoted.

Within the expression on the right-hand side of a rule, the following expressions are used to match strings of one or more characters:

where N is a hexadecimal integer, the expression matches the character in ISO/IEC 10646 whose canonical (UCS-4) code value, when interpreted as an unsigned binary number, has the value indicated. The number of leading zeros in the #xN form is insignificant; the number of leading zeros in the corresponding code value is governed by the character encoding in use and is not significant for XML.

matches any [E93]Char with a value in the range(s) indicated (inclusive).

matches any Char with a value among the characters enumerated. Enumerations and ranges can be mixed in one set of brackets.

matches any [E93]Char with a value outside the range indicated.

matches any [E93]Char with a value not among the characters given. [E3]Enumerations and ranges of forbidden values can be mixed in one set of brackets.

matches a literal string matching that given inside the double quotes.

matches a literal string matching that given inside the single quotes.

These symbols may be combined to match more complex patterns as follows, where A and B represent simple expressions:

expression is treated as a unit and may be combined as described in this list.

matches A or nothing; optional A.

matches A followed by B. [E20]This operator has higher precedence than alternation; thus A B | C D is identical to (A B) | (C D).

matches A or B but not both.

matches any string that matches A but does not match B.

matches one or more occurrences of A.[E20]Concatenation has higher precedence than alternation; thus A+ | B+ is identical to (A+) | (B+).

matches zero or more occurrences of A. [E20]Concatenation has higher precedence than alternation; thus A* | B* is identical to (A*) | (B*).

Other notations used in the productions are:

comment.

well-formedness constraint; this identifies by name a constraint on well-formed documents associated with a production.

validity constraint; this identifies by name a constraint on valid documents associated with a production.

References Normative References [E58](Internet Assigned Numbers Authority) Official Names for Character Sets, ed. Keld Simonsen et al. See ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets. IETF (Internet Engineering Task Force). RFC 1766: Tags for the Identification of Languages, ed. H. Alvestrand. 1995. [E38] (International Organization for Standardization). ISO 639:1988 (E). Code for the representation of names of languages. [Geneva]: International Organization for Standardization, 1988. [E38] (International Organization for Standardization). ISO 3166-1:1997 (E). Codes for the representation of names of countries and their subdivisions — Part 1: Country codes [Geneva]: International Organization for Standardization, 1997. ISO (International Organization for Standardization). ISO/IEC 10646-1993 (E). Information technology — Universal Multiple-Octet Coded Character Set (UCS) — Part 1: Architecture and Basic Multilingual Plane. [Geneva]: International Organization for Standardization, 1993 (plus amendments AM 1 through AM 7). [E67] ISO (International Organization for Standardization). ISO/IEC 10646-1:2000. Information technology — Universal Multiple-Octet Coded Character Set (UCS) — Part 1: Architecture and Basic Multilingual Plane. [Geneva]: International Organization for Standardization, 2000. The Unicode Consortium. The Unicode Standard, Version 2.0. Reading, Mass.: Addison-Wesley Developers Press, 1996. [E67] The Unicode Consortium. The Unicode Standard, Version 3.0. Reading, Mass.: Addison-Wesley Developers Press, 2000. ISBN 0-201-61633-5. Other References Aho, Alfred V., Ravi Sethi, and Jeffrey D. Ullman. Compilers: Principles, Techniques, and Tools. Reading: Addison-Wesley, 1986, rpt. corr. 1988. Berners-Lee, T., R. Fielding, and L. Masinter. Uniform Resource Identifiers (URI): Generic Syntax and Semantics. 1997. (Work in progress; see updates to RFC1738.) [E2]Brüggemann-Klein, Anne. Formal Models in Document Processing. Habilitationsschrift. Faculty of Mathematics at the University of Freiburg, 1993. (See ftp://ftp.informatik.uni-freiburg.de/documents/papers/brueggem/habil.ps.) [E2]Brüggemann-Klein, Anne, and Derick Wood. Deterministic Regular Languages. Universität Freiburg, Institut für Informatik, Bericht 38, Oktober 1991. Extended abstract in A. Finkel, M. Jantzen, Hrsg., STACS 1992, S. 173-184. Springer-Verlag, Berlin 1992. Lecture Notes in Computer Science 577. Full version titled One-Unambiguous Regular Languages in Information and Computation 140 (2): 229-253, February 1998. James Clark. Comparison of SGML and XML. See http://www.w3.org/TR/NOTE-sgml-xml-971215. [E58](Internet Assigned Numbers Authority) Registry of Language Tags, ed. Keld Simonsen et al. IETF (Internet Engineering Task Force). RFC 1738: Uniform Resource Locators (URL), ed. T. Berners-Lee, L. Masinter, M. McCahill. 1994. IETF (Internet Engineering Task Force). RFC 1808: Relative Uniform Resource Locators, ed. R. Fielding. 1995. IETF (Internet Engineering Task Force). RFC 2141: URN Syntax, ed. R. Moats. 1997. [E78]IETF (Internet Engineering Task Force). RFC 2279: UTF-8, a transformation format of ISO 10646, ed. F. Yergeau, 1998. [E48]IETF (Internet Engineering Task Force). RFC 2376: XML Media Types. ed. E. Whitehead, M. Murata. 1998. [E66]IETF (Internet Engineering Task Force). RFC 2396: Uniform Resource Identifiers (URI): Generic Syntax. T. Berners-Lee, R. Fielding, L. Masinter. 1998. [E66]IETF (Internet Engineering Task Force). RFC 2732: Format for Literal IPv6 Addresses in URL's. R. Hinden, B. Carpenter, L. Masinter. 1999. [E77] IETF (Internet Engineering Task Force). RFC 2781: UTF-16, an encoding of ISO 10646, ed. P. Hoffman, F. Yergeau. 2000. [E38] (International Organization for Standardization). ISO 639:1988 (E). Code for the representation of names of languages. [Geneva]: International Organization for Standardization, 1988. [E38] (International Organization for Standardization). ISO 3166-1:1997 (E). Codes for the representation of names of countries and their subdivisions — Part 1: Country codes [Geneva]: International Organization for Standardization, 1997. ISO (International Organization for Standardization). ISO 8879:1986(E). Information processing — Text and Office Systems — Standard Generalized Markup Language (SGML). First edition — 1986-10-15. [Geneva]: International Organization for Standardization, 1986. ISO (International Organization for Standardization). ISO/IEC 10744-1992 (E). Information technology — Hypermedia/Time-based Structuring Language (HyTime). [Geneva]: International Organization for Standardization, 1992. Extended Facilities Annexe. [Geneva]: International Organization for Standardization, 1996. [E43]ISO (International Organization for Standardization). ISO 8879:1986 TC2. Information technology — Document Description and Processing Languages. [Geneva]: International Organization for Standardization, 1998. [E98]Tim Bray, Dave Hollander, and Andrew Layman, editors. Namespaces in XML. Textuality, Hewlett-Packard, and Microsoft. World Wide Web Consortium, 1999. Character Classes

Following the characteristics defined in the Unicode standard, characters are classed as base characters (among others, these contain the alphabetic characters of the Latin alphabet[E84], without diacritics), ideographic characters, and combining characters (among others, this class contains most diacritics)[E30]; these classes combine to form the class of letters. Digits and extenders are also distinguished.

Characters LetterBaseChar | Ideographic BaseChar[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E] | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5] | [#x01FA-#x0217] | [#x0250-#x02A8] | [#x02BB-#x02C1] | #x0386 | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] | [#x03A3-#x03CE] | [#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0 | [#x03E2-#x03F3] | [#x0401-#x040C] | [#x040E-#x044F] | [#x0451-#x045C] | [#x045E-#x0481] | [#x0490-#x04C4] | [#x04C7-#x04C8] | [#x04CB-#x04CC] | [#x04D0-#x04EB] | [#x04EE-#x04F5] | [#x04F8-#x04F9] | [#x0531-#x0556] | #x0559 | [#x0561-#x0586] | [#x05D0-#x05EA] | [#x05F0-#x05F2] | [#x0621-#x063A] | [#x0641-#x064A] | [#x0671-#x06B7] | [#x06BA-#x06BE] | [#x06C0-#x06CE] | [#x06D0-#x06D3] | #x06D5 | [#x06E5-#x06E6] | [#x0905-#x0939] | #x093D | [#x0958-#x0961] | [#x0985-#x098C] | [#x098F-#x0990] | [#x0993-#x09A8] | [#x09AA-#x09B0] | #x09B2 | [#x09B6-#x09B9] | [#x09DC-#x09DD] | [#x09DF-#x09E1] | [#x09F0-#x09F1] | [#x0A05-#x0A0A] | [#x0A0F-#x0A10] | [#x0A13-#x0A28] | [#x0A2A-#x0A30] | [#x0A32-#x0A33] | [#x0A35-#x0A36] | [#x0A38-#x0A39] | [#x0A59-#x0A5C] | #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B] | #x0A8D | [#x0A8F-#x0A91] | [#x0A93-#x0AA8] | [#x0AAA-#x0AB0] | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] | #x0ABD | #x0AE0 | [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28] | [#x0B2A-#x0B30] | [#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D | [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] | [#x0B85-#x0B8A] | [#x0B8E-#x0B90] | [#x0B92-#x0B95] | [#x0B99-#x0B9A] | #x0B9C | [#x0B9E-#x0B9F] | [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA] | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9] | [#x0C05-#x0C0C] | [#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33] | [#x0C35-#x0C39] | [#x0C60-#x0C61] | [#x0C85-#x0C8C] | [#x0C8E-#x0C90] | [#x0C92-#x0CA8] | [#x0CAA-#x0CB3] | [#x0CB5-#x0CB9] | #x0CDE | [#x0CE0-#x0CE1] | [#x0D05-#x0D0C] | [#x0D0E-#x0D10] | [#x0D12-#x0D28] | [#x0D2A-#x0D39] | [#x0D60-#x0D61] | [#x0E01-#x0E2E] | #x0E30 | [#x0E32-#x0E33] | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 | [#x0E87-#x0E88] | #x0E8A | #x0E8D | [#x0E94-#x0E97] | [#x0E99-#x0E9F] | [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB] | [#x0EAD-#x0EAE] | #x0EB0 | [#x0EB2-#x0EB3] | #x0EBD | [#x0EC0-#x0EC4] | [#x0F40-#x0F47] | [#x0F49-#x0F69] | [#x10A0-#x10C5] | [#x10D0-#x10F6] | #x1100 | [#x1102-#x1103] | [#x1105-#x1107] | #x1109 | [#x110B-#x110C] | [#x110E-#x1112] | #x113C | #x113E | #x1140 | #x114C | #x114E | #x1150 | [#x1154-#x1155] | #x1159 | [#x115F-#x1161] | #x1163 | #x1165 | #x1167 | #x1169 | [#x116D-#x116E] | [#x1172-#x1173] | #x1175 | #x119E | #x11A8 | #x11AB | [#x11AE-#x11AF] | [#x11B7-#x11B8] | #x11BA | [#x11BC-#x11C2] | #x11EB | #x11F0 | #x11F9 | [#x1E00-#x1E9B] | [#x1EA0-#x1EF9] | [#x1F00-#x1F15] | [#x1F18-#x1F1D] | [#x1F20-#x1F45] | [#x1F48-#x1F4D] | [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D | [#x1F5F-#x1F7D] | [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE | [#x1FC2-#x1FC4] | [#x1FC6-#x1FCC] | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB] | [#x1FE0-#x1FEC] | [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126 | [#x212A-#x212B] | #x212E | [#x2180-#x2182] | [#x3041-#x3094] | [#x30A1-#x30FA] | [#x3105-#x312C] | [#xAC00-#xD7A3] Ideographic[#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029] CombiningChar[#x0300-#x0345] | [#x0360-#x0361] | [#x0483-#x0486] | [#x0591-#x05A1] | [#x05A3-#x05B9] | [#x05BB-#x05BD] | #x05BF | [#x05C1-#x05C2] | #x05C4 | [#x064B-#x0652] | #x0670 | [#x06D6-#x06DC] | [#x06DD-#x06DF] | [#x06E0-#x06E4] | [#x06E7-#x06E8] | [#x06EA-#x06ED] | [#x0901-#x0903] | #x093C | [#x093E-#x094C] | #x094D | [#x0951-#x0954] | [#x0962-#x0963] | [#x0981-#x0983] | #x09BC | #x09BE | #x09BF | [#x09C0-#x09C4] | [#x09C7-#x09C8] | [#x09CB-#x09CD] | #x09D7 | [#x09E2-#x09E3] | #x0A02 | #x0A3C | #x0A3E | #x0A3F | [#x0A40-#x0A42] | [#x0A47-#x0A48] | [#x0A4B-#x0A4D] | [#x0A70-#x0A71] | [#x0A81-#x0A83] | #x0ABC | [#x0ABE-#x0AC5] | [#x0AC7-#x0AC9] | [#x0ACB-#x0ACD] | [#x0B01-#x0B03] | #x0B3C | [#x0B3E-#x0B43] | [#x0B47-#x0B48] | [#x0B4B-#x0B4D] | [#x0B56-#x0B57] | [#x0B82-#x0B83] | [#x0BBE-#x0BC2] | [#x0BC6-#x0BC8] | [#x0BCA-#x0BCD] | #x0BD7 | [#x0C01-#x0C03] | [#x0C3E-#x0C44] | [#x0C46-#x0C48] | [#x0C4A-#x0C4D] | [#x0C55-#x0C56] | [#x0C82-#x0C83] | [#x0CBE-#x0CC4] | [#x0CC6-#x0CC8] | [#x0CCA-#x0CCD] | [#x0CD5-#x0CD6] | [#x0D02-#x0D03] | [#x0D3E-#x0D43] | [#x0D46-#x0D48] | [#x0D4A-#x0D4D] | #x0D57 | #x0E31 | [#x0E34-#x0E3A] | [#x0E47-#x0E4E] | #x0EB1 | [#x0EB4-#x0EB9] | [#x0EBB-#x0EBC] | [#x0EC8-#x0ECD] | [#x0F18-#x0F19] | #x0F35 | #x0F37 | #x0F39 | #x0F3E | #x0F3F | [#x0F71-#x0F84] | [#x0F86-#x0F8B] | [#x0F90-#x0F95] | #x0F97 | [#x0F99-#x0FAD] | [#x0FB1-#x0FB7] | #x0FB9 | [#x20D0-#x20DC] | #x20E1 | [#x302A-#x302F] | #x3099 | #x309A Digit[#x0030-#x0039] | [#x0660-#x0669] | [#x06F0-#x06F9] | [#x0966-#x096F] | [#x09E6-#x09EF] | [#x0A66-#x0A6F] | [#x0AE6-#x0AEF] | [#x0B66-#x0B6F] | [#x0BE7-#x0BEF] | [#x0C66-#x0C6F] | [#x0CE6-#x0CEF] | [#x0D66-#x0D6F] | [#x0E50-#x0E59] | [#x0ED0-#x0ED9] | [#x0F20-#x0F29] Extender#x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] | [#x309D-#x309E] | [#x30FC-#x30FE]

The character classes defined here can be derived from the Unicode [E67]2.0 character database as follows:

Name start characters must have one of the categories Ll, Lu, Lo, Lt, Nl.

Name characters other than Name-start characters must have one of the categories Mc, Me, Mn, Lm, or Nd.

Characters in the compatibility area (i.e. with character code greater than #xF900 and less than #xFFFE) are not allowed in XML names.

Characters which have a font or compatibility decomposition (i.e. those with a compatibility formatting tag in field 5 of the database -- marked by field 5 beginning with a <) are not allowed.

The following characters are treated as name-start characters rather than name characters, because the property file classifies them as Alphabetic: [#x02BB-#x02C1], #x0559, #x06E5, #x06E6.

Characters #x20DD-#x20E0 are excluded (in accordance with Unicode [E67]2.0, section 5.14).

Character #x00B7 is classified as an extender, because the property list so identifies it.

Character #x0387 is added as a name character, because #x00B7 is its canonical equivalent.

Characters ':' and '_' are allowed as name-start characters.

Characters '-' and '.' are allowed as name characters.

XML and SGML

[E43]XML is designed to be a subset of SGML, in that every XML document should also be a conforming SGML document. For a detailed comparison of the additional restrictions that XML places on documents beyond those of SGML, see .

Expansion of Entity and Character References

This appendix contains some examples illustrating the sequence of entity- and character-reference recognition and expansion, as specified in .

If the DTD contains the declaration

An ampersand (&#38;) may be escaped numerically (&#38;#38;) or with a general entity (&amp;).

" >]]>

then the XML processor will recognize the character references when it parses the entity declaration, and resolve them before storing the following string as the value of the entity example:

An ampersand (&) may be escaped numerically (&#38;) or with a general entity (&amp;).

]]>

A reference in the document to &example; will cause the text to be reparsed, at which time the start- and end-tags of the p element will be recognized and the three references will be recognized and expanded, resulting in a p element with the following content (all data, no delimiters or markup):

A more complex example will illustrate the rules and their effects fully. In the following example, the line numbers are solely for reference.

2 4 5 ' > 6 %xx; 7 ]> 8 This sample shows a &tricky; method.]]>

This produces the following:

in line 4, the reference to character 37 is expanded immediately, and the parameter entity xx is stored in the symbol table with the value %zz;. Since the replacement text is not rescanned, the reference to parameter entity zz is not recognized. (And it would be an error if it were, since zz is not yet declared.)

in line 5, the character reference &#60; is expanded immediately and the parameter entity zz is stored with the replacement text <!ENTITY tricky "error-prone" >, which is a well-formed entity declaration.

in line 6, the reference to xx is recognized, and the replacement text of xx (namely %zz;) is parsed. The reference to zz is recognized in its turn, and its replacement text (<!ENTITY tricky "error-prone" >) is parsed. The general entity tricky has now been declared, with the replacement text error-prone.

in line 8, the reference to the general entity tricky is recognized, and it is expanded, so the full content of the test element is the self-describing (and ungrammatical) string This sample shows a error-prone method.

Deterministic Content Models

[E102]As noted in , it is required that content models in element type declarations be deterministic. This requirement is for compatibility with SGML (which calls deterministic content models unambiguous); XML processors built using SGML systems may flag non-deterministic content models as errors.

For example, the content model ((b, c) | (b, d)) is non-deterministic, because given an initial b the [E95]XML processor cannot know which b in the model is being matched without looking ahead to see which element follows the b. In this case, the two references to b can be collapsed into a single reference, making the model read (b, (c | d)). An initial b now clearly matches only a single name in the content model. The [E95]processor doesn't need to look ahead to see what follows; either c or d would be accepted.

More formally: a finite state automaton may be constructed from the content model using the standard algorithms, e.g. algorithm 3.5 in section 3.9 of Aho, Sethi, and Ullman . In many such algorithms, a follow set is constructed for each position in the regular expression (i.e., each leaf node in the syntax tree for the regular expression); if any position has a follow set in which more than one following position is labeled with the same element type name, then the content model is in error and may be reported as an error.

Algorithms exist which allow many but not all non-deterministic content models to be reduced automatically to equivalent deterministic models; see Brüggemann-Klein 1991 .

[E105][E48]Autodetection of Character Encodings

The XML encoding declaration functions as an internal label on each entity, indicating which character encoding is in use. Before an XML processor can read the internal label, however, it apparently has to know what character encoding is in use—which is what the internal label is trying to indicate. In the general case, this is a hopeless situation. It is not entirely hopeless in XML, however, because XML limits the general case in two ways: each implementation is assumed to support only a finite set of character encodings, and the XML encoding declaration is restricted in position and content in order to make it feasible to autodetect the character encoding in use in each entity in normal cases. Also, in many cases other sources of information are available in addition to the XML data stream itself. Two cases may be distinguished, depending on whether the XML entity is presented to the processor without, or with, any accompanying (external) information. We consider the first case first.

Detection Without External Encoding Information

Because each XML entity not accompanied by external encoding information and not in UTF-8 or UTF-16 encoding must begin with an XML encoding declaration, in which the first characters must be '<?xml', any conforming processor can detect, after two to four octets of input, which of the following cases apply. In reading this list, it may help to know that in UCS-4, '<' is #x0000003C and '?' is #x0000003F, and the Byte Order Mark required of UTF-16 data streams is #xFEFF. The notation ## is used to denote any byte value except that two consecutive ##s cannot be both 00.

With a Byte Order Mark:

00 00 FE FFUCS-4, big-endian machine (1234 order)
FF FE 00 00UCS-4, little-endian machine (4321 order)
00 00 FF FEUCS-4, unusual octet order (2143)
FE FF 00 00UCS-4, unusual octet order (3412)
FE FF ## ##UTF-16, big-endian
FF FE ## ##UTF-16, little-endian
EF BB BFUTF-8

Without a Byte Order Mark:

00 00 00 3C UCS-4 or other encoding with a 32-bit code unit and ASCII characters encoded as ASCII values, in respectively big-endian (1234), little-endian (4321) and two unusual byte orders (2143 and 3412). The encoding declaration must be read to determine which of UCS-4 or other supported 32-bit encodings applies.
3C 00 00 00
00 00 3C 00
00 3C 00 00
00 3C 00 3FUTF-16BE or big-endian ISO-10646-UCS-2 or other encoding with a 16-bit code unit in big-endian order and ASCII characters encoded as ASCII values (the encoding declaration must be read to determine which)
3C 00 3F 00UTF-16LE or little-endian ISO-10646-UCS-2 or other encoding with a 16-bit code unit in little-endian order and ASCII characters encoded as ASCII values (the encoding declaration must be read to determine which)
3C 3F 78 6D UTF-8, ISO 646, ASCII, some part of ISO 8859, Shift-JIS, EUC, or any other 7-bit, 8-bit, or mixed-width encoding which ensures that the characters of ASCII have their normal positions, width, and values; the actual encoding declaration must be read to detect which of these applies, but since all of these encodings use the same bit patterns for the relevant ASCII characters, the encoding declaration itself may be read reliably
4C 6F A7 94EBCDIC (in some flavor; the full encoding declaration must be read to tell which code page is in use)
Other UTF-8 without an encoding declaration, or else the data stream is mislabeled (lacking a required encoding declaration), corrupt, fragmentary, or enclosed in a wrapper of some kind

In cases above which do not require reading the encoding declaration to determine the encoding, section 4.3.3 still requires that the encoding declaration, if present, be read and that the encoding name be checked to match the actual encoding of the entity. Also, it is possible that new character encodings will be invented that will make it necessary to use the encoding declaration to determine the encoding, in cases where this is not required at present.

This level of autodetection is enough to read the XML encoding declaration and parse the character-encoding identifier, which is still necessary to distinguish the individual members of each family of encodings (e.g. to tell UTF-8 from 8859, and the parts of 8859 from each other, or to distinguish the specific EBCDIC code page in use, and so on).

Because the contents of the encoding declaration are restricted to characters from the ASCII repertoire (however encoded), a processor can reliably read the entire encoding declaration as soon as it has detected which family of encodings is in use. Since in practice, all widely used character encodings fall into one of the categories above, the XML encoding declaration allows reasonably reliable in-band labeling of character encodings, even when external sources of information at the operating-system or transport-protocol level are unreliable. Note that since external parsed entities in UTF-16 may begin with any character, this autodetection does not always work. Also, Character encodings such as UTF-7 that make overloaded usage of ASCII-valued bytes may fail to be reliably detected.

Once the processor has detected the character encoding in use, it can act appropriately, whether by invoking a separate input routine for each case, or by calling the proper conversion function on each character of input.

Like any self-labeling system, the XML encoding declaration will not work if any software changes the entity's character set or encoding without updating the encoding declaration. Implementors of character-encoding routines should be careful to ensure the accuracy of the internal and external information used to label the entity.

Priorities in the Presence of External Encoding Information

The second possible case occurs when the XML entity is accompanied by encoding information, as in some file systems and some network protocols. When multiple sources of information are available, their relative priority and the preferred method of handling conflict should be specified as part of the higher-level protocol used to deliver XML. In particular, please refer to or its successor, which defines the text/xml and application/xml MIME types and provides some useful guidance. In the interests of interoperability, however, the following rule is recommended.

If an XML entity is in a file, the Byte-Order Mark and encoding declaration PI are used (if present) to determine the character encoding.[E74] All other heuristics and sources of information are solely for error recovery.

If an XML entity is delivered with a MIME type of text/xml, then the charset parameter on the MIME type determines the character encoding method; all other heuristics and sources of information are solely for error recovery.

If an XML entity is delivered with a MIME type of application/xml, then the Byte-Order Mark and encoding-declaration PI are used (if present) to determine the character encoding. All other heuristics and sources of information are solely for error recovery.

These rules apply only in the absence of protocol-level documentation; in particular, when the MIME types text/xml and application/xml are defined, the recommendations of the relevant RFC will supersede these rules.

W3C XML Working Group

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

Jon BosakSunChair James ClarkTechnical Lead Tim BrayTextuality and Netscape XML Co-editor Jean PaoliMicrosoftXML Co-editor C. M. Sperberg-McQueenU. of Ill. XML Co-editor Dan ConnollyW3CW3C Liaison Paula AngersteinTexcel Steve DeRoseINSO Dave HollanderHP Eliot KimberISOGEN Eve MalerArborText Tom MaglieryNCSA Murray MaloneySoftQuad, Grif SA, Muzmo and Veo Systems MURATA Makoto (FAMILY Given)Fuji Xerox Information Systems Joel NavaAdobe Conleth O'ConnellVignette Peter SharpeSoftQuad John TigueDataChannel
W3C XML Core Group

The second edition of this specification was prepared by the W3C XML Core Working Group (WG). The members of the WG at the time of publication of this edition were:

Paula AngersteinVignette Daniel AustinAsk Jeeves Tim Boland Allen BrownMicrosoft Dan ConnollyW3CStaff Contact John CowanReuters Limited John EvdemonXMLSolutions Corporation Paul GrossoArbortextCo-Chair Arnaud Le HorsIBMCo-Chair Eve MalerSun Microsystems Second Edition Editor Jonathan MarshMicrosoft MURATA Makoto (FAMILY Given)IBM Mark NeedlemanData Research Associates David OrchardJamcracker Lew ShannonNCR Richard TobinUniversity of Edinburgh Daniel VeillardW3C Dan VintLexica Norman WalshSun Microsystems François YergeauAlis Technologies Errata List Editor Kongyi ZhouOracle
Production Notes

This Second Edition was encoded in the XMLspec DTD (which has documentation available). The HTML versions were produced with a combination of the xmlspec.xsl, diffspec.xsl, and REC-xml-2e.xsl XSLT stylesheets. The PDF version was produced with the html2ps facility and a distiller program.

tclxml-3.3~svn11.orig/examples/tclxml/flatten.tcl0000755000000000000000000001777711113705304020711 0ustar rootroot#!/bin/sh # -*- tcl -*- \ exec tclsh8.3 "$0" "$@" # flatten.tcl -- # # Parse a DTD, resolve all external entities, parameter # entities and conditional sections and save the result. # # Copyright (c) 2000 Zveno Pty Ltd # http://www.zveno.com/ # # Zveno makes this software and all associated data and documentation # ('Software') available free of charge for any purpose. # Copies may be made of this Software but all of this notice must be included # on any copy. # # The Software was developed for research purposes and Zveno does not warrant # that it is error free or fit for any purpose. Zveno 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. # # CVS: $Id: flatten.tcl,v 1.2 2000/05/19 23:56:20 steve Exp $ # Allow the script to work from the source directory set auto_path [linsert $auto_path 0 [file dirname [file dirname [file join [pwd] [info script]]]]] # We need TclXML package require xml 2.0 # Process -- # # Parse a XML document or DTD and emit result # # Arguments: # data XML text # type "xml" or "dtd" # out output channel # args configration options # # Results: # Data is parsed and flattened DTD written to output channel proc Process {data type out args} { global elementDeclCount PEDeclCount AttListDeclCount CommentCount global config set elementDeclCount [set PEDeclCount [set AttListDeclCount [set CommentCount 0]]] # Create the parser object. # We want to use the Tcl-only parser for this application, # because it can resolve entities without doing full # validation. set parser [eval ::xml::parser \ -elementstartcommand ElementStart \ -validate 1 \ $args \ ] if {$config(wantElementDecls)} { $parser configure -elementdeclcommand [list ElementDeclaration $out] } if {$config(wantPEDecls)} { $parser configure -parameterentitydeclcommand [list PEDecl $out] } if {$config(wantAttListDecls)} { $parser configure -attlistdeclcommand [list AttListDecl $out] } if {$config(wantComments)} { $parser configure -commentcommand [list Comment $out] } switch $type { xml { # Proceed with normal parsing method $parser parse $data } dtd { # Use the DTD parsing method instead $parser parse $data -dtdsubset external } } # Clean up parser object #$parser free #rename $parser {} return {} } # ElementStart -- # # Callback for the start of an element. # # Arguments: # name tag name # attlist attribute list # args other information # # Results: # Returns break error code, since we don't # care about the document instance, only the DTD proc ElementStart {name attlist args} { return -code break } # ElementDeclaration -- # # Callback for an element declaration. # # Arguments: # out output channel # name tag name # cmodel content model specification # # Results: # Writes element declaration to output channel proc ElementDeclaration {out name cmodel} { global elementDeclCount incr elementDeclCount regsub -all "\[ \t\n\r\]+" $cmodel { } cmodel puts $out "" return {} } # PEDecl -- # # Callback for a parameter entity declaration. # # Arguments: # out output channel # name PE name # repl replacement text # # Results: # Writes info to stderr proc PEDecl {out name repl args} { global PEDeclCount incr PEDeclCount if {[llength $args]} { puts $out "" } else { puts $out "" } return {} } # AttListDecl -- # # Callback for an attribute list declaration. # # Arguments: # out output channel # name element name # attname attribute name # type attribute definition type # dflt default type # dfltval default value # # Results: # Writes info to stderr proc AttListDecl {out name attname type dflt dfltval} { global AttListDeclCount incr AttListDeclCount puts $out "" return {} } # Comment -- # # Callback for a comment. # # Arguments: # out output channel # data comment data # # Results: # Writes info to stderr proc Comment {out data} { global CommentCount incr CommentCount puts $out "" return {} } # Open -- # # Manage opening document in GUI environment # # Arguments: # None # # Results: # XML or DTD document opened and parsed proc Open {} { global currentDir status set filename [tk_getOpenFile -parent . -title "Open Document" -initialdir $currentDir -defaultextension ".xml" -filetypes { {{XML Documents} {.xml} } {{DTD Files} {.dtd} } {{All File} * } }] if {![string length $filename]} { return {} } set currentDir [file dirname $filename] set savename [file join [file rootname $filename].dtd] set savename [tk_getSaveFile -parent . -title "Save DTD" -initialdir $currentDir -initialfile $savename -defaultextension ".dtd" -filetypes { {{XML Documents} {.xml} } {{DTD Files} {.dtd} } {{All File} * } }] if {![string length $savename]} { return {} } set status Processing set oldcursor [. cget -cursor] . configure -cursor watch grab .elementDecls update set ch [open $filename] set out [open $savename w] if {[catch {Process [read $ch] [expr {[file extension $filename] == ".dtd" ? "dtd" : "xml"}] $out -baseurl file://[file join [pwd] $filename]} err]} { tk_messageBox -message [format [mc {Unable to process document "%s" due to "%s"}] $filename $err] -icon error -default ok -parent . -type ok } else { tk_messageBox -message [mc "DTD Saved OK"] -icon info -default ok -parent . -type ok } close $ch close $out set status {} grab release .elementDecls . configure -cursor $oldcursor return {} } ### Main script # Initialize message catalog, in case it is used package require msgcat namespace import msgcat::mc catch {::msgcat::mcload [file join [file dirname [info script]] msgs]} # Usage: flatten.tcl file1 file2 ... # "-" reads input from stdin # No arguments - Tk means read from stdin # Files read from stdin assumed to be XML documents # When given files to read, all output goes to stdout # No arguments + Tk means use GUI switch [llength $argv] { 0 { if {![catch {package require Tk}]} { # Create a nice little GUI array set config {wantElementDecls 1 wantPEDecls 0 wantAttlistDecls 1 wantComments 0} checkbutton .wantElementDecls -variable config(wantElementDecls) label .elementDeclLabel -text [mc "Element declarations:"] label .elementDecls -textvariable elementDeclCount checkbutton .wantPEDecls -variable config(wantPEDecls) label .peDeclLabel -text [mc "PE declarations:"] label .peDecls -textvariable PEDeclCount checkbutton .wantAttListDecls -variable config(wantAttListDecls) label .attListDeclLabel -text [mc "Atttribute List declarations:"] label .attListDecls -textvariable AttListDeclCount checkbutton .wantComments -variable config(wantComments) label .commentLabel -text [mc "Comments:"] label .comments -textvariable CommentCount label .status -textvariable status -foreground red grid .wantElementDecls .elementDeclLabel .elementDecls grid .wantPEDecls .peDeclLabel .peDecls grid .wantAttListDecls .attListDeclLabel .attListDecls grid .wantComments .commentLabel .comments grid .status - - . configure -menu .menu menu .menu -tearoff 0 .menu add cascade -label [mc File] -menu .menu.file menu .menu.file .menu.file add command -label [mc Open] -command Open .menu.file add separator .menu.file add command -label [mc Quit] -command exit set currentDir [pwd] } else { Process [read stdin] xml stdout } } default { foreach filename $argv { if {$filename == "-"} { Process [read stdin] xml stdout } else { set ch [open $filename] Process [read $ch] [expr {[file extension $filename] == ".dtd" ? "dtd" : "xml"}] stdout -baseurl file://[file join [pwd] $filename] close $ch } } } } tclxml-3.3~svn11.orig/examples/tcldom/0000755000000000000000000000000011574742541016520 5ustar rootroottclxml-3.3~svn11.orig/examples/tcldom/Libxml2-Logo-180x168.gif.b640000644000000000000000000002554711113705304022743 0ustar rootrootR0lGODlhtABEAPf/AP///wAAAP7+/vz8/Onq6aSloQUKAjE0L/v7+3JybC0t Kb29vWJiXJSVkTQ1Mjo7OJKTjt3d3YuMiUtMSpqalff394mKhuHh4fT09Bsc GtXV1NLS0ebm5tDQziQmI8nJxcXFwOTk5M3NyUtSUrW2sfPz8/n5+GlqZtnZ 2UNEQZucmf39/fDw76ysqfLy8g4ODbm5stnZ1YGCgMHBvdXV0Tg5Nq2tpMrK yHFycAAEACwwK/L18bGwqe7u7gACAL6+uba2rWxuahMWEURLTICBfuTl4jtF Rm9wbfr6+nR1crCxrcXFvCcpJGRlYoSFgsnJwejo5rq6rKGinh4iHQIHALm5 tWpsaWVmZNzc2ubm5FJSTVVYVs3NxhEWDuzs683NzHh5drCwpb29tXx9eklK RuDg3mFiYPb49Xp8ecLCwH1+fKmqpe/x7nV3dMHBuO3u7K2toVpaUcbGwxQY E3l7eGdoZlxdWX19clhZVsDAtHd4daGhmYKDge7w7n6AfWlraFxeXDY4NPP1 8lpaWV9gXebp6mJjYXN0cEBCPlpcWlVVUfX29A4SDCgqJ6ammlZWVFpdXVda Wuvr6ff69ubo5vPz8uvs6paYlIWHhL29sAkJCdDQyoGBevr8+MTEuUZIRBgZ F4CAdKmpoo6QjFBUU11dVPX19cjIvqSknoeIhVFSUE5QTK6vrFFXVfr59+js 7fHx8ezu60FHSQsPCV1hYL6/vcfIxW5ubKanpQMDA9TUzgQHAT0/PLq7uYaG fC02Nn9/dgwMC0lPUCEkH+Tm5LW1qYiIf4SEeSUqKKmpn9vb2M3S1J6fnNbZ 2uzu7uPk4QYLBCAlIwYGBry8uJ+flfz7+AgMBvv8+fv7+pCQhltbUqOjnOHm 6fHz8NfX1be3tFNXV3h4cd/j5gIFAODi3/j799PT09PW1AIHAtjc3czMyvP2 9rO0rrOzq9vf4MzMw2JlZcTEvu3w8W9yb4iHg8TEw/3+/Hh4bTA6OqamoaSj m/b6+pCQjQIIAAIFAoCAgCH5BAEAAP8ALAAAAAC0AEQAAAj/AP8JFEjk0AQd uQIoXMiwocOHECNKnEixosWLGDM+zKVjwiEiA0MKVHNAo8mTKFOqXInygBqR Aq9oCpBLFa4vKwDo3Mmzp8+fQIMKHUq0qNGjSJP2XPEFl6qEmq6IHKSQyQ2l WLNq3cq1K9YbTBQOGohDIY4KXtOqXcu27c4KZQPg+EcEVIAtQAUIWDEAgd+/ gAMLHkzY74ABKwS4Xcx465YAoIgcCSCNg8+9SExUwFDChefPoEOLHk26BAZT FUwgbsy69VAO0gIcmRBgkM8VCExgYOGFAAcOIYILH068uHHjvwn0cJF6gGLX 0KNTneAhAK6lSCqw2EAkxZwu4MOL/x9Pvrz5LgfqVCnD4Q0G1c+jy2eMK4CH FwFQ8BSAxJQXZruwFIAPA/pgoA85JKggggoFsUwZBJSg2nyLCXAYAojFp5OF fWGooVIoBIBfALDsZGEFb8wTQA4BCPEJHnbEGCMhhAAiox2J4KHjI4qoosoq q0xAxicppIAIIrzw8kANgQSigxAJBoCMBhEQgAESH27IFxJccnlYlhT2NIAJ psACC3PO7TQAEou4wAIsFSCRU1awMMTTCibAksaKu3xiASvTgACCHLZ88ME7 htoih6DxzODGNL1UQQI7SrDSAi4FFCAFMypQcEkDEGCCAx6BzMKiBOZc0EMF A1w25m49vP/xRg8slFABAnOG2RN/5oxiBxghvFHBnLwyY8UEIXhhSqta2amm KSGUtIsh+fxgiSvVYNPJNdx2e82210wi7iRnnLHIIqYIIsg6+5h7hiB99NDH G6+kA4EZEzCSgw8keMNBCVjuigQfaqChx8GY1BMCAS6YkKuuOq3AwS1maXAB LMwKUIEf+NWgSwRvmLCVswDw54IKA+Ihyg1n2PNtNTBX08nM5dRczriTXFPO ueoKcgYl9VRKAjnd9GB0D/K8wooZiFARwB9flNGDw0tV8EUGCh0xWQBEKBOC CwjoJbZSYoOp165n8zRAJVkodIIt3kiCRMSLQPFAAA48oQEHaDX/u9BOePaw RQ7QOMEOC/a4gjO55Zp77iLqntGHN1jsIMgOO5zhzShjoDGGHlLIGssrhRDw CiUyqGIqL7ZgIcmwu9Z9dwDZLBFWAErsLWEFpqBmAgKZVYBu76hVYLwJJgTf e3OHZcd7akgAr5nvGK5ZgRdlKNTEDx1AMXfJpmRxtwNucAFyasgbfzzySKT5 E8krVCCJA1SAQgENnZT7OM89qwu5IHWjABFkkIYzdGMRH6CHGmTABz7IwAkR cEYhJjjBV9jCDFPIwTDS4A0oYIBZJpKdQoyRhyso5AofUIZyWtALAijHMz2Q BBR+wwEoEEASR2MBC3qwgBbYcDmVgMUX/wiAgipAwQsscIEQW4AC5VRCeC6o xTdioBAGwEAdHBBZyRZRhLsdIA8wUEEZoIDDN0hCEgTwAq1g8R4Q9oRkAzAF AQ7gAyaIwhLv6p8eLbcINkDuDN+ggwzoUADMEQACY5CBImXghwZQ4hWQJB03 uCEONTTCB1Ooxd4+6JNFiE8hx4hCE7QXjw3oIQN6UEAGIFCGIlhBIS+YXQCS cLUA0KEIuMiAAurwgiSU4RkaoEMAeICfJmDhGbbgxQva8II6dIADklAGLwJw hU9UEQY3yOJbPgkK2oiIFVgAAywhMAPaSMALAAMTHDHAAQfUkQdsSJcee4Y5 NlSBH7Y4AxsosP/AMRSADYLoBRoWyQcnEKEWznBHM5ZxjnSIg3QSuOQUFqA7 BPikAnYDZRTIoJA7uCEIATBEB0igEAp4IwZYa8QTTqAQMXBBBY+IAStEFA8u BCIAEmDGiByAtQBs4gNYo8AmQGoGynFUEZsQwzWzqUUAVIADdwMFHLKBnxds Qhc1ENE7RKCCQ0QgWCZQ5990MgB2upMJSmDDDrrB1ra2NXO1ONgl2NCHS4yB CHRgxQ4IYFcG8gENZjCDElTghDGAIQl0GAUuaiEDBWByAeb4l0V7gtHZlQKk 9olCMhQCgSe8oxEByMA7NkGxADjCEW7zhBUkoItH4O0U1MBPCrhgAYX/JGCU B3jCGBRyiiiE5QUigIFCwHCKUyxVmzp5qhczkQdtgPIJwgzAMZZgBRJ4bWpi VYiaSsABOjKBHT3oBhvYwFbyknetgigAGNTgBHIsogXrpYMtBIEFJzjQIHMI hhMaQAc66OEQR7DCFcxgiCvQcaKRLcFkeVJZhXyCDDoghA3yEA6FZMMTp9CC QpJxCqUGQBHFqI4HMjGI0Vb1ACg+wAme0ACF+KId2RDDKVKgkBQfYBW6tbAn lnDcpio3AAeIQh6OoT03LAE/E8gDIm6AAg7AYsFvHCsAEMBd77LjDXTtw3i3 bDl1wVcNfMDCIrwhgzYUwBI9iIATHnEARijE/w8FcKAaDouDANfBEE04MGQl e9GMShcOPIBBGj6AWQu44RSYNcahaWy/YXAWDyDYRI2jUAwSTEMOH2ixdG1A gnhs4qYBoDQQLv0OzErAyD1+C1SBnAk3QOCablhFAIKxBzzIoYmcfJ+Uqdzd OrJDjUc72g68IQWW2QIMaHBCGejaAn6Qow+v8IasFWKNMeCigTKYcxLqbIU6 NMHAj00wlJPr52OEoQq20IA31GBbNzwBs9T4gS3ooRAdZKPGDYg01kARBRjM 4AYb0AUFXMyONJgjBopQCDWi8IMP6KIDpQUGhqtYhQ8g16mr/uISNB0OGMRj DwrhBT1AgAUWNNUnJP/jtZUl8YZYxEJWb2ABOUYxD0w8gw3sSAIELMHzGb5B GTMIQ2OnQIgG4EICmJAzne38bT2Lu5NZyGoAQmGDGfgrBL1QSBzycIpXgoId MxDBJvDjgWLoADIeF4EqRujvGcggBgMPgC9IcIMIXIAIsBbBIWgQ9617oook sEUIKvCcp2ZV4ywNRj6m8YFNYC0YQEgDFjAWlJRX2ddQiIUlCMBzS0yOCGgA Qy0EYYlvfCAWnGcDB0TQDlGsgQdrKAAJpCABCyQ920vvdtPDzef9hE/qnGDH B0JQiR6UgWIvaEc8wkKPb8AtBoQIAAOKwYAA2AHdGyABfoJxhFEEghkxkID/ QsJRhS8sTBmglb4ECHGIGICgqgkwYQA+YQbBEz65HMiqB8TgCQdInwT1QAMx QDG8QAJyEAEY8DBRpl06oXK+RgkEYEMuxHl8pQdm9gaeJy9sUAZScAITgAg1 8CJ8wAyXAAGjgHRKt21MB24I1nsmYgreBBlHsAEEIDxQoAF/8AIHMAig4AfT kAYa8AwXUAUBsA0wAHLMkAYdgAIxUAB2ISJ0oAE6pRDB0ATP9AYXEA/+pxCA oAHKQAN0sH0JAArBoAjMoA6DNycVQAAPcALdhAgv0AS9MAMbcAFDKBu9oA4X cH9AYXm9hlZZAAWUQAkSCAU9YAtocARnphxZUAsW/+AALNIQ0MALTkABJ3h7 2sZt3saCe6ZgS2EKHEADM/ANJGB1koA8sHAB5vABo6AC8VAPN6ABIcAbZaAC tnCLzGALGxABwOENtkABFiBvG6ABHSAH0/ANQMgwkhAB6oALFqAEcmAOWIAF 5lAFEgADMNAAJFAF9aABNfgcJvAGUqAO8SABFBAPaSAHdfgGUIAFjZAPIBBZ J4dyu3Z5aPUMHDCI+jiIlmALDXAD4yUHhjALCtEPBnCQCOk0c5AKEGB7DmRY 2xYEupdnvOeJ+4EiZWAO6qAO/vJkY8ICIfCFG2AO3sCLcIIBXhACEYAFK/lV knAmHIACHXAD6kADdhcBxP/YAd4QAie5jBtwAwDHiwTwDN4wkx8AlDrJk2HT gNz1hR3QAeagAVgQLLAABV9QA3LwBRHQA25Ejww4ZfbIA89QBGNZBGZpllng G2/wBVaANTmwCwgZlwgZAHhwCRZgX34AkfMQBH/gbRTZghZpIghgCm/AAXYI BSzAKnthAi7gBcBRQz1gCnKCABUAC8GWRHGCBCgZAmVQBgvzBo4ZHIjJKpTZ AxzQmQvDRrBAAJwZAWVwARxAALAwIRHDmKEJmxzgBZWAARswAS9wBLHIARgA Jjvhh95lA7zIAVlwlsSwnGOpDLThA3I5nQdJlxSQCvalBnRwWHvZl03wl504 bgD/wBeagQEY0BzPYSHleZ7wUTJ9wT5e4hzqaQqewZ7T4zvyuQLZ0RnniSG5 YQqdYRqpgSv7gRvGwxnsSZkzFQDjiAKnOBTG6QPvCATx0AHKwJIRoAwasAEd oA6AEABwSZ1ySQU+sF+Y4AS4d1hHEAQncAV45nQuSDZjcxlCUTZGMaMmYqM1 WjaKoTHK0AZqoA51SHlCEaGNUAA2YAM8QAK98AO14CgzYAsqkCAiKpe74ANm wAoOSQRz1gaaOGDg+XQQM6YCYAI9cAEoUJI1qIBeGQA74YCNIAVrYANh0A7s gI3TUAu18AGTUaVx6TSk0AujgJ18AHrcyZfeRmAwGphr/8Eh1UOcrsEXhpEY b4qSvyEJjNqH9dhdOcAEe4ALc8oDdkoC2Oik1uSn1YkOeNACdpkKckYHbZAE e9miTRBYOlCR4okUe9EhzUMmsLBDzLGU0WEh2LAZO4SZIDQm9MkcckIUxpkD HqACqJAPcxoGosoO28gOjuWnLNIIDcAODWABd1moEAlgLHoFTUAItHCrgCme uKEZ6qM+7ZOelFkJOwQLlVB8KJAKD9AGzyAsbNoYr/IGHwAGClAAHGByfFGs JXCstuI+lbepBwCtFCAF+pAPopCk1toOJNAOgSCd1BkgQgAGrgcBteeq2RZ6 KuidZkAIZsCu4bkrlAkLXgAFM/8Um2/QMMwymKwwAYOQBhdgC6ugAAsRBHXI Al3ZGAKAACTAC1OwEA0giw1TmV6wBrgAAs+QljpbpBILrZfADMywDagAqklK p0DgWtRJBbtABhBQBZcwCic4rkRgWF66oi1qCC27rri6FCbwtEryAA+ANQ1g JRalMV+wEBmwCTcAAUSrPab4Pa5Rph1gASMSABZgC8rgBS7QswyRATgQA/8K O5r6lSoHrQ1AASrADHugDwVArWuwBjkHolbqA0kAA9sAAQ3QAKNwoqnApf4l q0fgnYZQI4AAs2L6LJKgBwyBCCQQNSyAJSuAAbu1EBIgAjSQAAthRd0Dua3B HyzwDFL/J10/QANFIAG9pAKlpRBasAkgE1aj66ZMyakeAAGXcAmpG7b6gApj awOjMAtUEJe74A9BAAOfwl94UAMeoABb8FeHZa602rKQAAnGG6PjKT/bwBBW ZAsR8GQAsDb1QYWiIAe6gL0KUQrt8AUX5xoD4ALkEL6hUAUdUAABwAwbsAlc gFkKcQh66AJJqxPPOgyjkLuXgLpgq7rbcLFrF5c5kAEFUMBO0FMsspCwegjd mag1kgiJMMGZWqaScMELUQo8AAIRUAKtsgKV8AwJ8AKgcAjsYAsj/MVAIAIh cCXtcxgXAhh2/BcZohcrwBd9wSUY0sd/HMhrA74LEQrYRAaP//CUT+kGDLF/ NCA37/umVaZBFgABuFu/Q6wCnKwCUtAA1ZGQXSABl8APEIAG/nuQPqADDRCr 8xBgD0wIkIAHg6AAOdCuPoEEXcwQcWAD9bCHPbqGMfAEYjBqHRADhwDHXIAF ZBRzlQCglnk0sGAaQZRE56k8JdAZsTIrlYAuLhAry3Er4SNLiPwBLyABHbAB KPCFW6gQPHADgzfJ8TuxU5AKcIu7udsA9UsB/CwFdYAgB3mlq0ABuWsGuxCi AbAKo3AIdcaiVgwIkbAFkdAItxyzYtIDMrwQcfDOyBU/b1AGugABJ/ABMYAF SbAQ2hAFTqAID1AHM1AGGjAGY2C1Bf/QBnpwa2qgArgABnQgmy7wBtNgBWOJ CxMwAcr2DFBgC1bQ0jNwAVZSAp+kEKEABHLwAt8gjbFZBuEbAKKQBmXQN21K yZw6BU4gARJwz/icz/pMAQkwCyC7CzmgA6tABnOA0BnAOThQxU0wvLKMB1sA DshQ0cerJhjNENrA0SKztBggCQWQVQ5A0ia9EApQEgwxBjTAD7IUACmgC8rg BArxCMzAHrZAFQFwCq61EIqgCzJQuS+QDzFgiFEdAMDQDiBQBSjAi54RdQsR CPng1WC9gPALlmMtA6kgrmYNt/xgypiMuypwBULw1gQSAP9rAD7ACPv1ysFb By7ashC9Ba3/0AoUjcsXndEKcdhMNZ4mQASNizelpAzJrBBzcA/AULkBAAFc EA+VywunIAIgYEs3MJOkrRCgsApBULlM4ABB0M4OIAfKwAHPIEt3IHxYkJtw wjYYLAr2J8/CTc9+4AROgAnFbQFmfdYjfoINoAaO5gMhepBO8wJjMAp5LZGx DAg5Ag6kAN6CTcEdXNgojdgdXAFqsN4HAAMigMwaHQZREHc15m7RNULUlQJy AHCsgAcYnAme8N6QYeVRULk2EDVlAOHsoIeJiTwskAqSTQ1K0AEEwL088axT MAYOVFAfngohLq52ngr8kAqqwATQwBCM4ABEcAnYbQUPDMF+3Qoj/0AK4W3R asPj5e3jcQQFUrAQOtAOtkADWB4HcAADnoAIDEENh9bOwxAGoBDCS1gGygBq U1cMbnBvCqEAxSBj7cwJ8RADEQDmKMwqA3A9sxMMDZAPtbDBPQwAz5oBYOAH fjBADeThzH6izF5QEsAPY4AHSTIIDcAMkqE13YauLSvLEY3oIzACgS3ejU7e AWDe2hQ/UAByr24DIKALWK4NNtBwOBwAnAADIPBqCzEMj8B4TQYFWr0Qd9AO M6BpAaAAcCAGT9DOwDANNIAFYN4BktAqa7MGVGgM+fANNOi+uka6lZwBbYAG aKAGajBABNVAKL9IXMoH4ooJEiADALaiff+Jrnjr7d5NCiMgDCMQDTmeqTtu 7uguMvFDAJPe7u+O5WAswijzxTAgB1wwbRYGA19wAUpkyB0FBE+g5AjvBiKg 6ncAwzEQvhEu8YiBIkTrAfrAaXoICwHT8cFdup4LBnLvOSSvBsjOQDJABETg B3avnf2lB9uW1zL/B7EMCZHg1zgvDIrP8+RO2EDP0azCJrts9PD+xe1wAzHA 7uXNDjegC0DAECcABGhoChig2x1F5Et/8GHw7mIPA8cs9uzQAV7gF5UgTIjA adOgDjPAAVvr9mI9sRlwBEmQBDYt93Qg8n6ABnXwB2jQBsdfZ3RwCITwB20w D3/wBwLmolvgI4n/YPiIn/OKLwyMz+iOb9gcjRoQYJpFf/DuXvklzAPqoAzr HwBxcPnDzBBzUAxyUAamABCLoDwIUPAODBEqCgZQEAaErhoLD3aIEdEgiQ1e kFT48sLMqRm2OqgL8MyLCyQAVK5UuTDAygElOBzIkSHIPByHkiRpowcMnRMK AtVos2oVJl4p9Dh40EhVEgeEjvDC8SlDDV6EIuHZ0mrECGHChgyJlmPKAnMc SiBgqXJAjwIutfG4wYEFq5Jl9ixUYOPhoYWl2qlTJsXlPXZfsPAJ5JKBG289 Kg2UiFBhwYYPLQaYWFEiRkmLWPA6tOkDFxoxkgTQUEZShbYrXcKU6aDm/4kg R47Mw6kTjAM7BSRIQBTgBC8yZPBIIcQEzRxEVxipQfQAzbwmW7aQ+hp2iCyy ZtGqZdv2bdyFc0WEkGQngLcYlxn6pQG4oGARWJwsDKavyoYOMmCHDP7CUCeE HrIgyCDL+HIIosoo2uwOjAjoYQwydOHinU3esc8WGkLAILaWFoIJg5lyAOUK K6wIIjfd5glCh1H0+MSQFBp5IJBPaghijCt0AAOUKVIYJ4hVrtoCEHBI4c47 WaIs66y01optABbQK0gbIDa5gIYXAuBCFwoclKO+wLpUZrWC4oAjHg3aeGQT OFxSZAYUOChiwQBCESMhMyEsKJT/lNksFBg2eP9mDZcaDQCGDyJwgUQAZnML AygC2YURQk6o44Q//nDxRR1wSIKXVT45hJAAVnnAjjHsaMSKT1KYBRFVVKmB jiO2606sKI0wYg4qhllAA/Jiw8YLVFyKo5gPYrDPkycacDCeDRJIEzUFCgqG gnZsYZSEd06ZwKU9bsAigkNh4KJMzBzaZEKEPBsUhk1ECNPRhWyYQZlJSbQU gAFMISCIHHaZoI4mrriijk//CGKCKXgZRpVPrHBimE/MYOIBIVYZBJAmHjjE gy3m0MGpJ4GVRVh8oMmBjBm84QCDAdoSwAQC2MQsmVO0LSiTJYxZCJQwZtjE jIV0AOIJeIMxxoYf2mn/JIB3PngCApcemGEDb+j9AF6Gwohn3oUScFeXqwu6 AoZ3PuHXpWRmwKIESgdeoQIvGM1BgSaaMMSQwB2+4o9HUJVgizHGAOSENhR5 ABB+VknCEDrm+aQOXh5IgZawXBbWCGSoCOCPelAgwJScWdpbh7ldgqGOfQsC 5RARAlkFDoJ4sSNMMvSxgZkUFnJgmgYyaHSCNtq2vQF6lF/ok3iK58+Q6Bs9 oIXYvV1DjjJMydtElXZmoQymd2mE5MEDd/8WPfyY54ogGsbujyTAuIIWeCCp IxFaAJAWkGgFlF4mLGRYIwdzUMINIuCFCqzAPBhYwxriAQQ4JMMGJPiBCixA /w8IfGMN/HADDGxgASeQ4AtHaMEPYACBJtSBD+yoQhV+cAMVbOAGVeDHDWbQ gAvagBqcsEALGtACMfCgAURQwg9QAQIYhIETEABBAaRQNRsQARXIQ2I79sAJ IH4gHjDgQTIccUZH6EMfovjGBjgAG4GRDwACQIJM6jGLHPjAA8oZhB0SkQg7 BDIRgwAkIQc5iEFwBRxNUkSuwCKW70TpgEb4xRR2YboG1GIDIWCBCQRgngpI IgIdkEMtapGGD6jjC7aoRxpEYo5VziAkHUCBMjTQgRvkUgS5vMEXvFGGZ0TA GxsAGxZQsIEPzOCUH+iAOTrwgTSkQQ4dgA8y01CPG/+YAwUaUAcIpPkFDQzz Bmk45Q024ExbpOEH02DnNHqxgHps4AKwKE9sXAILmFSgB2VogcwSxog5BFSg AyUoQYVwUIQitAuMYGhDZ2EAKuQgALfohboIgAEEfNJ1JnABAS5gTBSsKwIR QEFJI/CMEFyApCg4KQcIwAEOPKMMZRgpFsrAAUmwgAWS4MAFLuBSKISgDCVV hk0vQFMsrOunHBBqUssQAqZ+VKkhSGkEjGnUlJYBpCUtqU05AAsTSDA2sChI mFCwEjpigABYYMYDDJAwKsRVrnOla13tGtdd5FWvuxgHFTwwhl7YwmadFCtL BDAAE5jCBbBg7GJhwYIe9ID/BbAoQQkcy1jKmsIUFVAsLHrwBha4oAImQIIJ KmBZF2BAs5ZlrE4n29rGYgADrG1sZS8LCxdc9rUuqCxqc/vbEmwWAYVtCwoC 8AIPBAAXG4UFFLDwBRUAwgE6oG51rXtd7GZXuzqYACZIkAZ1oABBFcgopQRw Xo2idQXrXS960cte+A5AvgNYQXrd697yCWAF9K3vff3L3vsC2L+UInBbcBEA D5xrEIZFLCwIUAZvdICV5DRlhS18YQxnGMMzcKU6NBABDvSgAkggboFNfGIU p1jFK2axSgYRgAkcIQDS4ACDTVCCN/SUpN7whgZ8/GMgB1nIQw6yN0J6U0nA YsQl4G5xk538ZCgTmAPSCMARiACKAGxBZwPYSAlY4AUCQAGmYyZzmc185jND gQCS6IELTGGCAaQ3ynOmc51TvIUAgIII/8BBQXAAR7Ry2bSmkG2hDX1oRCda 0aodLRLoK2c7R1rSda5AnwOAg39k+sUBYMINYnPe9c5X1KMmdalNLer+TlrV q47yDZhQkEFkWtZX0EQAcqEKXHyByazmda99neIVfAEXqshFADRxBVknWw0H 6F6znf1saEdb2tOmdrWtvZADqCHZ2ybCISagg2JfW9zjJne5zU3tXHD3EHtO dkAAADs= tclxml-3.3~svn11.orig/examples/tcldom/simple.tcl0000644000000000000000000000066311215700771020511 0ustar rootroot#!/bin/sh # -*- tcl -*- \ exec tclsh "$0" "$@" # simple.tcl -- # # Simple character count of a DOM document, # from README. # # Copyright (c) 2008-2009 Explain # http://www.explain.com.au/ # # $Id$ package require xml set doc [dom::parse [read stdin]] set count 0 foreach textNode [dom::selectNode $doc //text()] { incr count [string length [$textNode cget -nodeValue]] } puts "The document contains $count characters" exit 0 tclxml-3.3~svn11.orig/examples/tcldom/domtext.tcl0000644000000000000000000010416311215700771020704 0ustar rootroot# domtext.tcl -- # # Megawidget to display a DOM document in a Text widget. # # This widget both generates and reacts to DOM Events. # # Copyright (c) 2008-2009 Explain # http://www.explain.com.au/ # Copyright (c) 1999-2003 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: domtext.tcl,v 1.5 2003/12/09 04:56:40 balls Exp $ package provide domtext 3.3 # We need the DOM # V2.0 gives us Level 2 Events package require dom 3.3 # Configuration options: # # -elementbgcolorlist {colour1 colour2 ...} # Specifies a list of colours to cycle through for # backgrounds of sucessive element content. # # -showtag text|tab| # "text" denotes that start and end tags are shown # as their XML text. "tab" denotes that start and # end tags are shown as an image. Empty value # denotes that start and end tags are not shown. namespace eval domtext { # Widget::tkinclude domtext text .text \ # remove {-command -state} # Widget::declare domtext { # {-highlightcolor String "#d9ffff" 0} # {-rootnode String "" 0} # {-state String "normal" 0} # {-tagcolor String "#18605a" 0} # {-commentcolor String "#660f91" 0} # {-entityrefcolor String "#0080c0" 0} # {-elementbgcolorlist String "" 0} # {-showtag String "text" 0} # } proc ::domtext { path args } { return [domtext::create $path {*}$args] } # Define bindings for domtext widget class # Certain mouse event bindings for the Text widget class must be overridden bind domtext [namespace code [list TkeventOverride %W %x %y]] bind domtext [namespace code [list TkeventOverride %W %x %y]] # All of these bindings for the Text widget class cause characters # to be inserted or deleted. These must be caught and prevented if the # characters are part of markup, otherwise the node value must be # updated # TODO: update with all bindings for Text widget foreach spec { <> <> <> <> } { bind domtext $spec [list domtext::TkeventFilter_$spec %W %A] } foreach spec { } { bind domtext $spec [list domtext::KeySelect %W $spec] } foreach spec { } { bind domtext $spec {# Do nothing - allow the normal Text class binding to take effect} } variable eventTypeMap array set eventTypeMap { ButtonPress mousedown ButtonRelease mouseup Enter mouseover Leave mouseout Motion mousemove FocusIn DOMFocusIn FocusOut DOMFocusOut } } # domtext::create -- # # Widget class creation command # # Arguments: # path widget path # args configuration options # # Results: # Widget created, returns path proc domtext::create {path args} { variable state array set maps [list Text {} :text {} .text {}] text $path -wrap none -takefocus 1 set cmd [namespace current]::_cmd$path rename ::$path $cmd dict set state $path cmd $cmd proc ::$path {args} "[namespace current]::Cmd $path {*}\$args" $cmd tag configure starttab -elide 1 $cmd tag configure endtab -elide 1 $cmd tag configure sel -borderwidth 2 $cmd tag configure sel -relief raised bindtags $path [list $path Domtext [winfo toplevel $path] all] dict set state $path rootnode {} dict set state $path nextColor 0 dict set state $path tag_backgrounds { #fdd5bd #bdfdd5 #bdd5fd #999ab9 } dict set state $path insert end dict set state $path showtag 0 configure $path {*}$args return $path } # domtext::Cmd -- # # Implements widget command # # Arguments: # path widget path # cmd subcommand # args options # # Results: # Depends on subcommand proc domtext::Cmd {path cmd args} { [namespace current]::$cmd $path {*}$args } # domtext::cget -- # # Implements the cget method # # Arguments: # path widget path # option configuration option # # Results: # Returns value of option proc domtext::cget {path option} { variable state regexp {^-(.*)} $option discard opt return [dict get $state $path $opt] } # domtext::configure -- # # Implements the configure method # # Arguments: # path widget path # args configuration options # # Results: # Sets values of options proc domtext::configure {path args} { variable state switch [llength $args] { 0 { return {} } 1 { return [cget $path [lindex $args 0]] } default { set cmd [dict get $state $path cmd] foreach {option value} $args { regexp {^-(.*)} $option discard opt switch -- $opt { rootnode { dict set state $path rootnode $value $cmd delete 1.0 end # Delete all marks and tags # This doesn't delete the standard marks and tags $cmd tag delete {*}[$cmd tag names] $cmd mark unset {*}[$cmd mark names] # Remove event listeners from previous DOM tree dict set state $path insert 1.0 if {[string length $value]} { set docel [$value cget -documentElement] if {[string length $docel]} { # Listen for UI events dom::node addEventListener $value DOMActivate [namespace code [list NodeSelected $path]] -usecapture 1 # Listen for mutation events #dom::node addEventListener $value DOMNodeInserted [namespace code [list NodeInserted $path]] -usecapture 1 #dom::node addEventListener $value DOMNodeRemoved [namespace code [list NodeRemoved $path]] -usecapture 1 #dom::node addEventListener $value DOMCharacterDataModified [namespace code [list NodePCDATAModified $path]] -usecapture 1 #dom::node addEventListener $value DOMAttrModified [namespace code [list NodeAttrModified $path]] -usecapture 1 #dom::node addEventListener $value DOMAttrRemoved [namespace code [list NodeAttrRemoved $path]] -usecapture 1 Refresh $path } } } tagcolor { $cmd tag configure tags -foreground $value } highlightcolor { $cmd tag configure highlight -background $value } commentcolor { $cmd tag configure comment -foreground $value } entityrefcolor { $cmd tag configure entityreference -foreground $value } elementbgcolorlist { dict set state $path nextColor 0 dict set state $path tag_backgrounds $value ElementBackgroundSetAll $path [dict get $state $path rootnode] } showtag { switch -- $value { text { $cmd tag configure starttab -elide 1 $cmd tag configure endtab -elide 1 $cmd tag configure tags -elide 0 } tab { $cmd tag configure tags -elide 1 $cmd tag configure starttab -elide 0 $cmd tag configure endtab -elide 0 } {} { $cmd tag configure tags -elide 1 $cmd tag configure starttab -elide 1 $cmd tag configure endtab -elide 1 } default { return -code error "invalid mode \"$value\"" } } } xscrollcommand - yscrollcommand { $cmd configure $option $value } default { return -code error "unknown option \"$option\"" } } } } } return {} } # domtext::xview -- # # Implements xview method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Text's xview method proc domtext::xview {path args} { variable state [dict get $state $path cmd] xview {*}$args } # domtext::yview -- # # Implements yview method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Text's yview method proc domtext::yview {path args} { variable state [dict get $state $path cmd] yview {*}$args } # domtext::instate -- # # Implements instate method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Text's instate method proc domtext::instate {path args} { variable state [dict get $state $path cmd] instate {*}$args } # domtext::Refresh -- # # Inserts serialized nodes into the Text widget, # while at the same time marking up the text to support # DOM-level editing functions. # # This function is similar to the DOM package's # serialization feature. The code started by being copied # from there. # # Assumes that the widget is in normal state # # Arguments: # path widget path # # Results: # Text widget populated with serialized text. proc domtext::Refresh {path} { variable state set rootnode [dict get $state $path rootnode] if {$rootnode == {}} { return {} } RefreshNode $path [dict get $state $path cmd] [$rootnode cget -documentElement] return {} } proc domtext::RefreshNode {path cmd node} { variable state set id [$node cget -id] set insert [dict get $state $path insert] $cmd mark set $id $insert $cmd mark gravity $id left set end $insert # For all nodes we bind Tk events to be able to generate DOM events $cmd tag bind $id <1> [namespace code [list TkeventSelect $path $node %x %y]] $cmd tag bind $id [namespace code [list TkeventOpen $path $node]] $cmd tag configure $id -background [ElementBackgroundCycle $path] switch [$node cget -nodeType] { document - documentFragment { foreach childToken [$node children] { set end [RefreshNode $path $cmd $childToken] dict set state $path insert $end } $cmd tag add $id $id $end } element { # Serialize the start tag $cmd insert $insert <[$node cget -prefix][expr {[$node cget -prefix] != "" ? ":" : ""}][$node cget -nodeName] [list tags tag:start:$id] [SerializeAttributeList [array get [$node cget -attributes]]] [list tags attrs:$id] > [list tags tag:start:$id] set insert [lindex [$cmd tag ranges tag:start:$id] end] # Add the start tab icon $cmd image create $insert -image ::domtext::starttab -align center -name tab:start:$id foreach t [list starttab tags tag:start:$id] { $cmd tag add $t tab:start:$id } set insert [lindex [$cmd tag ranges tag:start:$id] end] dict set state $path insert $insert # Serialize the content $cmd mark set content:$id $insert $cmd mark gravity content:$id left foreach childToken [$node children] { set end [RefreshNode $path $cmd $childToken] dict set state $path insert $end set insert $end } $cmd tag add content:$id content:$id $end # Serialize the end tag $cmd insert $insert [list tags tag:end:$id] set end [lindex [$cmd tag ranges tag:end:$id] end] # Add the end tab icon $cmd image create $end -image ::domtext::endtab -align center -name tab:end:$id foreach t [list endtab tags tag:end:$id] { $cmd tag add $t tab:end:$id } set end [lindex [$cmd tag ranges tag:end:$id] end] dict set state $path insert $end $cmd tag add $id $id $end $cmd tag raise starttab $cmd tag raise endtab $cmd tag configure starttab -elide [expr {[dict get $state $path showtag] != "tab"}] $cmd tag configure endtab -elide [expr {[dict get $state $path showtag] != "tab"}] } textNode { set text [Encode [$node cget -nodeValue]] if {[string length $text]} { $cmd insert $insert $text $id set end [lindex [$cmd tag ranges $id] 1] dict set state $path insert $end } else { dict set state $path end $insert } } comment { set text [$node cget -nodeValue] $cmd insert $insert [list comment markup $id] set end [lindex [$cmd tag ranges $id] 1] dict set state $path insert $end } entityReference { set text [$node cget -nodeName] $cmd insert $insert & [list entityreference markup $id] $text [list entityreference $id] \; [list entityreference markup $id] set end [lindex [$cmd tag ranges $id] 1] dict set state $path insert $end } processingInstruction { set text [$node cget -nodeValue] if {[string length $text]} { set text " $text" } $cmd insert $insert "" $id set end [lindex [$cmd tag ranges $id] 1] dict set state $path insert $end } default { # Ignore it } } return $end } # domtext::SerializeAttributeList -- # # Produce textual representation of an attribute list. # # NB. This is copied from TclDOM's domimpl.tcl, # but with the namespace handling removed. # # Arguments: # atlist name/value list of attributes # # Results: # Returns string proc domtext::SerializeAttributeList atlist { set result {} foreach {name value} $atlist { append result { } $name = # Handle special characters regsub -all & $value {\&} value regsub -all < $value {\<} value if {![string match *\"* $value]} { append result \"$value\" } elseif {![string match *'* $value]} { append result '$value' } else { regsub -all \" $value {\"} value append result \"$value\" } } return $result } # domtext::Encode -- # # Protect XML special characters # # NB. This is copied from TclDOM's domimpl.tcl. # # Arguments: # value text # # Results: # Returns string proc domtext::Encode value { array set Entity { $ $ < < > > & & \" " ' ' } regsub -all {([$<>&"'])} $value {$Entity(\1)} value ;# " for emacs return [subst -nocommand -nobackslash $value] } # domtext::ElementBackgroundSetAll -- # # Recurse node hierarchy setting element background color property # # Arguments: # path widget path # node DOM node # # Results: # Text widget tag configured proc domtext::ElementBackgroundSetAll {path node} { variable state if {$node == {}} { return {} } set cmd [dict get $state $path cmd] if {[catch {set id [$node cget -id]}]} { # node is the document set node [$node cget -documentElement] set id [$node cget -id] } $cmd tag configure $id -background [ElementBackgroundCycle $path] switch [$node cget -nodeType] { document - documentFragment - element { foreach child [$node children] { ElementBackgroundSetAll $path $child } } default { # No more to do here } } return {} } proc domtext::ElementBackgroundCycle path { variable state set list [dict get $state $path tag_backgrounds] set colour [lindex $list [dict get $state $path nextColor]] dict set state $path nextColor [expr ([dict get $state $path nextColor] + 1) % [llength $$list]] return $colour } # domtext::NodeInserted -- # # React to addition of a node # # Arguments: # path widget path # evid DOM event node # # Results: # Display updated to reflect change to DOM structure proc domtext::NodeInserted {path evid} { variable state set node [dom::event cget $evid -target] set id [$node cget -id] set cmd [dict get $state $path cmd] # Remove parent's content and then render new content set parent [$node parent] set tags [$cmd tag ranges [$parent cget -id]] set start [lindex $tags 0] set end [lindex $tags end] if {[string length $start]} { $cmd delete $start $end } else { set start end } dict set state $path insert $start set end [Refresh $path $parent] # Restore grandparent element tags set parent [$parent parent] while {[string length $parent]} { set ranges [$cmd tag ranges [$parent cget -id]] catch {$cmd tag remove [$parent cget -id] {*}$ranges} catch {$cmd tag add [$parent cget -id] [lindex $ranges 0] [lindex $ranges end]} # Also do content tag for elements if {![string compare [$parent cget -nodeType] "element"]} { set ranges [$cmd tag ranges content:[$parent cget -id]] catch {$cmd tag remove [$parent cget -id] {*}$ranges} catch {$cmd tag add content:[$parent cget -id] [lindex $ranges 0] [lindex $ranges end]} } set parent [$parent parent] } return {} } # domtext::NodeRemoved -- # # React to removal of a node. # This is almost identical to node insertion, # except that we must get the parent from the event. # # Arguments: # path widget path # evid DOM event node # # Results: # Display updated to reflect change to DOM structure proc domtext::NodeRemoved {path evid} { variable state set node [dom::event cget $evid -target] set cmd [dict get $state $path cmd] if {[dict exists $state $path selected]} { dict unset $state $path selected } # Remove parent's content and then render new content set parent [dom::event cget $evid -relatedNode] set tags [$cmd tag ranges [$parent cget -id]] set start [lindex $tags 0] set end [lindex $tags end] if {[string length $start]} { $cmd delete $start $end } else { set start end } dict set state $path insert $start set end [Refresh $path $parent] # Restore grandparent element tags set parent [$parent parent] while {[string length $parent]} { set ranges [$cmd tag ranges [$parent cget -id]] catch {$cmd tag remove [$parent cget -id] {*}$ranges} catch {$cmd tag add [$parent cget -id] [lindex $ranges 0] [lindex $ranges end]} # Also do content tag for elements if {![string compare [::dom::node cget $parent -nodeType] "element"]} { set ranges [$cmd tag ranges content:[$parent cget -id]] catch {$cmd tag remove [$parent cget -id] {*}$ranges} catch {$cmd tag add content:[$parent cget -id] [lindex $ranges 0] [lindex $ranges end]} } set parent [$parent parent] } return {} } # domtext::NodeAttrModified -- # # React to a change in the attribute list for a node # # Arguments: # path widget path # evid DOM event node # # Results: # Display updated to reflect change to DOM structure proc domtext::NodeAttrModified {path evid} { variable state set node [dom::event cget $evid -target] set id [$node cget -id] set cmd [dict get $state $path cmd] set tags [$cmd tag ranges attrs:$id] if {[llength $tags]} { # Remove previously defined attributes foreach {start end} $tags break set existingTags [$cmd tag names $start] $cmd delete $start $end $cmd tag delete attrs:$id } else { set tagStartEnd [lindex [$cmd tag ranges tag:start:$id] end] set start [$cmd index "$tagStartEnd - 1 char"] set existingTags [$cmd tag names $start] } # Replace with current attributes lappend existingTags attrs:$id # TODO: make sure this works with TclDOM/libxml2 $cmd insert $start [SerializeAttributeList [array get [::dom::node cget $node -attributes]]] $existingTags return {} } # domtext::NodeAttrRemoved -- # # React to a change in the attribute list for a node # # Arguments: # path widget path # evid DOM event node # # Results: # Display updated to reflect change to DOM structure proc domtext::NodeAttrRemoved {path evid} { NodeAttrModified $path $evid } # domtext::NodePCDATAModified -- # # React to a change in character data # # Arguments: # path widget path # evid DOM event node # # Results: # Display updated to reflect change to DOM structure proc domtext::NodePCDATAModified {path evid} { variable state set node [dom::event cget $evid -target] set id [$node cget -id] set cmd [dict get $state $path cmd] if {[string compare [$node cget -nodeType] "textNode"]} { return -code error "node is not a text node" } # Remember where the insertion point is set insert [$cmd index insert] # Remove previous text set ranges [$cmd tag ranges $id] set tags [$cmd tag names [lindex $ranges 0]] $cmd delete {*}$ranges # Replace with new text $cmd insert [lindex $ranges 0] [dom::event cget $evid -newValue] $tags # Restore insertion point $cmd mark set insert $insert return {} } # domtext::NodeSelected -- # # A node has been selected. # # Arguments: # path widget path # evid DOM event node # # Results: # Node's text is selected proc domtext::NodeSelected {path evid} { variable state set node [dom::event cget $evid -target] set id [$node cget -id] dict set state $path selected $node set cmd [dict get $state $path cmd] catch {$cmd tag remove sel {*}[$cmd tag ranges sel]} set ranges [$cmd tag ranges $id] if {[llength $ranges]} { $cmd tag add sel {*}$ranges $cmd mark set insert [lindex $ranges end] $cmd see [lindex $ranges 0] } return {} } # domtext::TkeventOverride -- # # Certain Text widget class bindings must be prevented from firing # # Arguments: # path widget path # x x coord # y y coord # # Results: # Return break error code proc domtext::TkeventOverride {w x y} { return -code break } # domtext::TkeventSelect -- # # Single click. We only want the highest priority tag to fire. # # Arguments: # path widget path # node DOM node # x # y Coordinates # # Results: # DOM event posted proc domtext::TkeventSelect {path node x y} { variable state variable tkeventid set cmd [dict get $state $path cmd] catch {after cancel $tkeventid} set tkeventid [after idle " dom::event postUIEvent [list $node] DOMActivate -detail 1 dom::event postMouseEvent [list $node] click -detail 1 [namespace current]::TkeventSelectSetinsert [list $path] [list $node] [tk::TextClosestGap $cmd $x $y] "] return {} } # Helper routine for above proc proc domtext::TkeventSelectSetinsert {path node idx} { variable state set cmd [dict get $state $path cmd] set id [$node cget -id] switch [$node cget -nodeType] { textNode { # No need to change where the insertion point is going } element { # Set the insertion point to the end of the first # child textNode, or if none to immediately following # the start tag. set fc [$node cget -firstChild] if {[string length $fc] && [$fc cget -nodeType] == "textNode"} { set idx [lindex [$cmd tag ranges [$fc cget -id]] end] } else { set idx [lindex [$cmd tag ranges tag:start:$id] end] } } default { # Set the insertion point following the node set idx [lindex [$cmd tag ranges $id] end] } } $cmd mark set insert $idx dict set state $path insert $idx $cmd mark set anchor insert focus $path return {} } # domtext::TkeventOpen -- # # Double click # # Arguments: # path widget path # node DOM node # # Results: # DOM event posted proc domtext::TkeventOpen {path node} { variable tkeventid catch {after cancel $tkeventid} set tkeventid [after idle " dom::event postUIEvent [list $node] DOMActivate -detail 2 dom::event postMouseEvent [list $node] click -detail 2 "] return {} } # domtext::KeySelect -- # # Select a node in which a key event has occurred. # # Arguments: # path widget path # spec the event specifier # # Results: # Appropriate node is selected. Returns node id. proc domtext::KeySelect {path spec} { variable state set root [dict get $state $path rootnode] set cmd [dict get $state $path cmd] set selected $root catch {set selected [dict get $state $path selected]} # If selected node is a textNode move around the text itself # Otherwise markup has been selected. # Move around the nodes switch -glob [$selected cget -nodeType],$spec { textNode, { set ranges [$cmd tag ranges $selected] foreach {line char} [split [lindex $ranges 0] .] break set index [$cmd index insert] foreach {iline ichar} [split [lindex $index 0] .] break if {$line == $iline} { set new [dom::node parent $selected] } else { ::tk::TextSetCursor $cmd [::tk::TextUpDownLine $cmd -1] # The insertion point may now be in another node set newnode [InsertToNode $path] if {[string compare $newnode $selected]} { dom::event postUIEvent $newnode DOMActivate -detail 1 } return -code break } } textNode, { set ranges [$cmd tag ranges $selected] foreach {line char} [split [lindex $ranges end] .] break set index [$cmd index insert] foreach {iline ichar} [split [lindex $index 0] .] break if {$line == $iline} { bell return {} } else { ::tk::TextSetCursor $cmd [::tk::TextUpDownLine $cmd 1] # The insertion point may now be in another node set newnode [InsertToNode $path] if {[string compare $newnode $selected]} { dom::event postUIEvent $newnode DOMActivate -detail 1 } return -code break } } textNode, { set ranges [$cmd tag ranges $selected] set index [$cmd index insert] if {[$cmd compare $index == [lindex $ranges 0]]} { set new [$selected cget -previousSibling] if {![string length $new]} { set new [dom::node parent $selected] } } else { ::tk::TextSetCursor $cmd insert-1c return -code break } } textNode, { set ranges [$cmd tag ranges $selected] set index [$cmd index insert] if {[$cmd compare $index == [lindex $ranges end]]} { set new [$selected cget -nextSibling] if {![string length $new]} { set new [dom::node parent $selected] } } else { ::tk::TextSetCursor $cmd insert+1c return -code break } } *, { set new [dom::node parent $selected] } *, { set new [$selected cget -firstChild] if {![string length $new]} { bell return {} } } *, { if {[dom::node parent $selected] == $root} { bell return {} } set new [$selected cget -previousSibling] if {![string length $new]} { set new [dom::node parent $selected] } } *, { set new [$selected cget -nextSibling] if {![string length $new]} { set new [dom::node parent $selected] } } } if {![string length $new]} { bell } dom::event postUIEvent $new DOMActivate -detail 1 return -code break } # domtext::TkeventFilter_* -- # # React to editing events to keep the DOM structure # synchronised # # Arguments: # path widget path # detail key pressed # # Results: # Either event is blocked or passed through to the Text class binding # DOM events may be generated if text is inserted or deleted proc domtext::TkeventFilter_ {path detail} { variable state set cmd [dict get $state $path cmd] set selected [dict get $state $path selected] set index [$cmd index insert] $cmd tag remove sel 0.0 end # Take action depending upon which node type the event has occurred. # Possibilities are: # text node insert the text, update node # element If a text node exists as first child, # redirect event to it and make it active. # Otherwise create a text node # Document Type Declaration ignore # XML Declaration ignore switch [$selected cget -nodeType] { element { set child [$selected cget -firstChild] if {[string length $child]} { if {[$child cget -nodeType] == "textNode"} { dom::event postUIEvent $child DOMActivate -detail 1 dom::node configure $child -nodeValue [$child cget -nodeValue]$detail ::tk::TextSetCursor $cmd insert+1c focus $path return -code $code {} } else { bell return -code $code {} } } else { set child [dom::document createTextNode $selected $detail] dom::event postUIEvent $child DOMActivate -detail 1 # When we return the new text node will have been # inserted into the Text widget set end [lindex [$cmd tag ranges $child] 1] $cmd mark set insert $end $cmd tag remove sel 0.0 end focus $path return -code $code {} } } textNode { # We need to know where in the character data to insert the # character. This is hard, so instead allow the Text widget # to do the insertion then take all of the text and # set that as the node's value $cmd insert insert $detail $selected $cmd see insert focus $path set ranges [$cmd tag ranges $selected] set newvalue [$cmd get [lindex $ranges 0] [lindex $ranges end]] $selected configure -nodeValue $newvalue return -code $code {} } default { bell return -code $code {} } } return -code $code {} } proc domtext::TkeventFilter_ {path detail} { set code [catch {TkeventFilter_ $path \n} msg] return -code $code $msg } proc domtext::TkeventFilter_ {path detail} { set code [catch {TkeventFilter_ $path \t} msg] return -code $code $msg } # Don't support transposition (yet) proc domtext::TkeventFilter_ {path detail} { return -code break } proc domtext::TkeventFilter_ {path detail} { set code [catch {TkeventFilter_ $path $detail} msg] return -code $code $msg } proc domtext::TkeventFilter_ {path detail} { variable state set cmd [dict get $state $path cmd] set selected [dict get $state $path selected] switch [$selected cget -nodeType] { textNode { # If we're at the beginning of the text node stop here set ranges [$cmd tag ranges $selected] if {![llength $ranges] || [$cmd compare insert <= [lindex $ranges 0]]} { bell return -code break } } default { switch [tk_messageBox -parent [winfo toplevel $path] -title [mc {Confirm Delete Node}] -message [format [mc {Are you sure you want to delete a node of type %s?}] [$selected cget -nodeType]] -type okcancel] { ok { dom::node removeNode [dom::node parent $selected] $selected } cancel { return -code break } } } } $cmd delete insert-1c $cmd see insert TkeventFilterUpdate $path return -code break } proc domtext::TkeventFilter_ {path detail} { variable state set cmd [dict get $state $path cmd] set selected [dict get $state $path selected] switch [$selected cget -nodeType] { textNode { # If we're at the beginning of the text node stop here set ranges [$cmd tag ranges $selected] if {[$cmd compare insert >= [lindex $ranges end]]} { bell return -code break } } default { switch [tk_messageBox -parent [winfo toplevel $path] -title [mc {Confirm Delete Node}] -message [format [mc {Are you sure you want to delete a node of type %s?}] [$selected cget -nodeType]] -type okcancel] { ok { dom::node removeNode [dom::node parent $selected] $selected } cancel { return -code break } } } } $cmd delete insert $cmd see insert TkeventFilterUpdate $path return -code break } proc domtext::TkeventFilterUpdate path { variable state set cmd [dict get $state $path cmd] set selected [dict get $state $path selected] # Now update the DOM node's value set ranges [$cmd tag ranges $selected] # If all text has been deleted then remove the node if {[llength $ranges]} { set newtext [$cmd get [lindex $ranges 0] [lindex $ranges end]] $selected configure -nodeValue $newtext } else { set parent [dom::node parent $selected] dom::node removeNode [dom::node parent $selected] $selected # Move selection to parent element, rather than removing selection #unset selected dom::event postUIEvent $parent DOMActivate -detail 1 } return {} } # This will delete from the insertion point to the end of the line # or text node, whichever is shorter # TODO: implement this proc domtext::TkeventFilter_ {path detail} { return -code break } # TODO: this will delete the word to the left of the insertion point # (only within the text node) proc domtext::TkeventFilter_ {path detail} { return -code break } proc domtext::TkeventFilter_ {path detail} { TkeventFilter_ $path $detail } ### Utilities # domtext::InsertToNode -- # # Finds the DOM node for the insertion point # # Arguments: # path widget path # # Results: # Returns DOM token proc domtext::InsertToNode path { variable state set cmd [dict get $state $path cmd] set tags [$cmd tag names insert] set newnode [lindex $tags end] while {![dom::DOMImplementation isNode $newnode]} { set tags [lreplace $tags end end] set newnode [lindex $tags end] } return $newnode } ### Inlined images image create photo ::domtext::starttab -data { R0lGODlhEAAYAPcAAP//////zP//mf//Zv//M///AP/M///MzP/Mmf/MZv/M M//MAP+Z//+ZzP+Zmf+ZZv+ZM/+ZAP9m//9mzP9mmf9mZv9mM/9mAP8z//8z zP8zmf8zZv8zM/8zAP8A//8AzP8Amf8AZv8AM/8AAMz//8z/zMz/mcz/Zsz/ M8z/AMzM/8zMzMzMmczMZszMM8zMAMyZ/8yZzMyZmcyZZsyZM8yZAMxm/8xm zMxmmcxmZsxmM8xmAMwz/8wzzMwzmcwzZswzM8wzAMwA/8wAzMwAmcwAZswA M8wAAJn//5n/zJn/mZn/Zpn/M5n/AJnM/5nMzJnMmZnMZpnMM5nMAJmZ/5mZ zJmZmZmZZpmZM5mZAJlm/5lmzJlmmZlmZplmM5lmAJkz/5kzzJkzmZkzZpkz M5kzAJkA/5kAzJkAmZkAZpkAM5kAAGb//2b/zGb/mWb/Zmb/M2b/AGbM/2bM zGbMmWbMZmbMM2bMAGaZ/2aZzGaZmWaZZmaZM2aZAGZm/2ZmzGZmmWZmZmZm M2ZmAGYz/2YzzGYzmWYzZmYzM2YzAGYA/2YAzGYAmWYAZmYAM2YAADP//zP/ zDP/mTP/ZjP/MzP/ADPM/zPMzDPMmTPMZjPMMzPMADOZ/zOZzDOZmTOZZjOZ MzOZADNm/zNmzDNmmTNmZjNmMzNmADMz/zMzzDMzmTMzZjMzMzMzADMA/zMA zDMAmTMAZjMAMzMAAAD//wD/zAD/mQD/ZgD/MwD/AADM/wDMzADMmQDMZgDM MwDMAACZ/wCZzACZmQCZZgCZMwCZAABm/wBmzABmmQBmZgBmMwBmAAAz/wAz zAAzmQAzZgAzMwAzAAAA/wAAzAAAmQAAZgAAM+4AAN0AALsAAKoAAIgAAHcA AFUAAEQAACIAABEAAADuAADdAAC7AACqAACIAAB3AABVAABEAAAiAAARAAAA 7gAA3QAAuwAAqgAAiAAAdwAAVQAARAAAIgAAEe7u7t3d3bu7u6qqqoiIiHd3 d1VVVURERCIiIhEREQAAACwAAAAAEAAYAAcIgwABCBxIsKBAfAjx2TNYMCHC hQwPOrwHkaFDhRQjXtR3L6PBix3teSR4USRHexUlJuTY8WRFkBQ7dsQ3sOS9 kzNrOmR5M6dKhCFl3qP5EyPOoTpXymRJFABMkTKb2sSZL19ShDz1WSU5MeZW rglNfgWL9d5YsvjMRgRQte3ZtXABAggIADs= } image create photo ::domtext::endtab -data { R0lGODlhEAAYAPcAAP//////zP//mf//Zv//M///AP/M///MzP/Mmf/MZv/M M//MAP+Z//+ZzP+Zmf+ZZv+ZM/+ZAP9m//9mzP9mmf9mZv9mM/9mAP8z//8z zP8zmf8zZv8zM/8zAP8A//8AzP8Amf8AZv8AM/8AAMz//8z/zMz/mcz/Zsz/ M8z/AMzM/8zMzMzMmczMZszMM8zMAMyZ/8yZzMyZmcyZZsyZM8yZAMxm/8xm zMxmmcxmZsxmM8xmAMwz/8wzzMwzmcwzZswzM8wzAMwA/8wAzMwAmcwAZswA M8wAAJn//5n/zJn/mZn/Zpn/M5n/AJnM/5nMzJnMmZnMZpnMM5nMAJmZ/5mZ zJmZmZmZZpmZM5mZAJlm/5lmzJlmmZlmZplmM5lmAJkz/5kzzJkzmZkzZpkz M5kzAJkA/5kAzJkAmZkAZpkAM5kAAGb//2b/zGb/mWb/Zmb/M2b/AGbM/2bM zGbMmWbMZmbMM2bMAGaZ/2aZzGaZmWaZZmaZM2aZAGZm/2ZmzGZmmWZmZmZm M2ZmAGYz/2YzzGYzmWYzZmYzM2YzAGYA/2YAzGYAmWYAZmYAM2YAADP//zP/ zDP/mTP/ZjP/MzP/ADPM/zPMzDPMmTPMZjPMMzPMADOZ/zOZzDOZmTOZZjOZ MzOZADNm/zNmzDNmmTNmZjNmMzNmADMz/zMzzDMzmTMzZjMzMzMzADMA/zMA zDMAmTMAZjMAMzMAAAD//wD/zAD/mQD/ZgD/MwD/AADM/wDMzADMmQDMZgDM MwDMAACZ/wCZzACZmQCZZgCZMwCZAABm/wBmzABmmQBmZgBmMwBmAAAz/wAz zAAzmQAzZgAzMwAzAAAA/wAAzAAAmQAAZgAAM+4AAN0AALsAAKoAAIgAAHcA AFUAAEQAACIAABEAAADuAADdAAC7AACqAACIAAB3AABVAABEAAAiAAARAAAA 7gAA3QAAuwAAqgAAiAAAdwAAVQAARAAAIgAAEe7u7t3d3bu7u6qqqoiIiHd3 d1VVVURERCIiIhEREQAAACwAAAAAEAAYAAcIgwABCBxIsKDBgvbwKcR3cGDC hQwb2rsHMaLBiQ8XHpx4T1/Fi/c4fiRob6K+kCMBlOx4r6VHiAPxtWwpEqZA mSFZZlQY0+XMlxpvzsxJ0SYAnCZRGsV50mVKnDRbpsyXL+fJnRYF5mvaMeXA qjWDFtyqVOzYrkYNVvWqlqrbhg0BAggIADs= } tclxml-3.3~svn11.orig/examples/tcldom/domtree-treectrl.tcl0000644000000000000000000006556111113705304022503 0ustar rootroot# domtree-treectrl.tcl -- # # A megawidget to support display of a DOM hierarchy # based on the treectrl widget. # # This widget both generates and reacts to DOM Events. # # This package features ordered and non-unique directories and items. # Paths are managed as live links into a DOM hierarchy. # # Copyright (c) 2005 Explain # http://www.explain.com.au/ # Copyright (c) 2004 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: domtree-treectrl.tcl,v 1.1 2005/11/04 06:31:15 balls Exp $ package provide domtree::treectrl 3.1 # We need the treectrl widget package require treectrl 1.1 # We need the DOM # V2.0 gives us Level 2 event model # V2.1 gives us libxml2 package require dom 3.1 namespace eval domtree { # Just make sure this namespace exists variable exists {} } namespace eval domtree::treectrl { variable defaults array set defaults { showlength 20 showtextcontent 0 showelementid 0 } catch {font create [namespace current]::bold -weight bold} proc ::domtree::treectrl { path args } { return [eval domtree::treectrl::create $path $args] } # We may be able to use tktreectrl's event mechanism # to exactly match treectrl events to DOM events variable eventTypeMap array set eventTypeMap { ButtonPress mousedown ButtonRelease mouseup Enter mouseover Leave mouseout Motion mousemove FocusIn DOMFocusIn FocusOut DOMFocusOut } } # domtree::treectrl::create -- # # Create a DOM Treectrl widget # # Arguments: # path widget path # args configuration options # # Results: # Tree widget created proc domtree::treectrl::create {path args} { upvar \#0 [namespace current]::Widget$path widget eval frame $path -bd 0 -relief flat -takefocus 0 \ -class domtree::treectrl -highlightthickness 0 bindtags $path [list $path domtree::treectrl [winfo toplevel $path] all] set tree [eval treectrl $path.tree -showroot yes -showrootbutton yes \ -showbuttons yes -showlines yes \ -itemheight 0 \ -openbuttonimage ::domtree::collapse -closedbuttonimage ::domtree::expand] $path.tree column create -expand yes -text Elements -tag element $path.tree column create -text Attributes -tag attr $path.tree column create -text Depth -tag depth $path.tree element create e1 image -image {::domtree::element {open} ::domtree::element {}} $path.tree element create Edocument image -image ::domtree::textNode $path.tree element create EtextNode text $path.tree element create Ecomment image -image ::domtree::Comment $path.tree element create e3 text \ -fill [list [$path cget -highlightcolor] {selected focus}] \ -font [list [namespace current]::bold {}] $path.tree element create e4 text -fill blue $path.tree element create e6 text $path.tree element create e5 rect -showfocus yes \ -fill [list [$path cget -highlightbackground] {selected focus} gray {selected !focus}] $path.tree style create Selement $path.tree style elements Selement {e5 e1 e3 e4} $path.tree style layout Selement e1 -padx {0 4} -expand ns $path.tree style layout Selement e3 -padx {0 4} -expand ns $path.tree style layout Selement e4 -padx {0 6} -expand ns $path.tree style layout Selement e5 -union [list e3] -iexpand ns -ipadx 2 $path.tree style create Sdocument $path.tree style elements Sdocument {e5 Edocument e3 e4} $path.tree style layout Sdocument Edocument -padx {0 4} -expand ns $path.tree style layout Sdocument e3 -padx {0 4} -expand ns $path.tree style layout Sdocument e4 -padx {0 6} -expand ns $path.tree style layout Sdocument e5 -union [list e3] -iexpand ns -ipadx 2 $path.tree style create StextNode $path.tree style elements StextNode EtextNode $path.tree style layout StextNode EtextNode -padx {0 4} -squeeze x $path.tree style create Scomment $path.tree style elements Scomment {e5 Ecomment e3 e4} $path.tree style layout Scomment Ecomment -padx {0 4} -expand ns $path.tree style layout Scomment e3 -padx {0 4} -expand ns $path.tree style layout Scomment e4 -padx {0 6} -expand ns $path.tree style layout Scomment e5 -union [list e3] -iexpand ns -ipadx 2 $path.tree style create s3 $path.tree style elements s3 {e6} $path.tree style layout s3 e6 -padx 6 -expand ns # Create custom event to allow mapping to DOM nodes $path.tree notify install event MapDOMNode # Set various bindings to generate DOM events if {0} { foreach event {ButtonRelease ButtonPress Enter Leave Motion} { $path.tree bindImage <$event> [namespace code [list _node_mouse_event $event {} $path]] $path.tree bindText <$event> [namespace code [list _node_mouse_event $event {} $path]] foreach modifier {Control Shift Alt Meta Double} { $path.tree bindImage <$modifier-$event> [namespace code [list _node_mouse_event $event $modifier $path]] $path.tree bindText <$modifier-$event> [namespace code [list _node_mouse_event $event $modifier $path]] } } } grid $tree -row 0 -column 0 -sticky news grid rowconfigure $path 0 -weight 1 grid columnconfigure $path 0 -weight 1 rename $path ::$path:cmd proc ::$path { cmd args } "return \[eval domtree::treectrl::cmd $path \$cmd \$args\]" array set widget { -rootnode {} -populate normal } foreach {option value} $args { configure $path $option $value } return $path } # domtree::treectrl::see -- # # Display a DOM node in the tree. # # Arguments: # path widget path # dnode DOM node # # Results: # The tree node for the corresponding DOM node is expanded, # all parent nodes are also expanded. # Returns the id of the tree item. proc domtree::treectrl::see {path dnode} { foreach pathnode [dom::node path $dnode] { $path.tree expand [_dnode_to_treeid $path $pathnode] update idletasks } set id [_dnode_to_treeid $path $dnode] $path.tree see $id return $id } # domtree::treectrl::cmd -- # # Widget command # # Arguments: # path widget path # method command method # args method arguments # # Results: # Depends on method. proc domtree::treectrl::cmd {path method args} { return [eval [list $method $path] $args] } # domtree::treectrl::cget -- # # Implements the cget method # # Arguments: # path widget path # option configuration option # # Results: # Returns value of option proc domtree::treectrl::cget {path option} { switch -- $option { -rootnode - -populate { upvar \#0 [namespace current]::Widget$path widget return $widget($option) } default { return [$path.tree cget $option] } } } # domtree::treectrl::configure -- # # Implements the configure method # # Arguments: # path widget path # args configuration options # # Results: # Sets value of options proc domtree::treectrl::configure {path args} { if {[catch {eval configure:dbg [list $path] $args} msg]} { puts stderr "domtree::treectrl::configure incurred error\n$msg" } } proc domtree::treectrl::configure:dbg {path args} { set res {} foreach {option value} $args { switch -- $option { -rootnode { upvar \#0 [namespace current]::Widget$path widget if {$widget(-rootnode) != ""} { $path.tree item delete all _dom_unmap $path $widget(-rootnode) } if {$value != ""} { set widget(-rootnode) $value _add_node $path 0 $value } } -populate { upvar \#0 [namespace current]::Widget$path widget switch -- $value { {} - normal { set widget(-populate) normal } lazy { set widget(-populate) lazy } default { return -code error "unknown value \"$value\" for option \"-populate\"" } } } default { return [$path.tree configure $option $value] } } } # May need to add these to above switch code if {0} { # Listen for UI events dom::node addEventListener $docel DOMActivate [namespace code [list _node_selected $path]] -usecapture 1 # Listen for mutation events dom::node addEventListener $docel DOMSubtreeModified [namespace code [list _node_tree_modified $path]] -usecapture 1 dom::node addEventListener $docel DOMNodeInserted [namespace code [list _node_inserted $path]] -usecapture 1 dom::node addEventListener $docel DOMNodeRemoved [namespace code [list _node_removed $path]] -usecapture 1 dom::node addEventListener $docel DOMCharacterDataModified [namespace code [list _node_data_modified $path]] -usecapture 1 dom::node addEventListener $docel DOMAttrModified [namespace code [list _node_attr_modified $path]] -usecapture 1 dom::node addEventListener $docel DOMAttrRemoved [namespace code [list _node_attr_removed $path]] -usecapture 1 } return $res } # domtree::treectrl::refresh -- # # Updates the Tree display with the value of a node # # Arguments: # path widget path # node DOM node # # Results: # May change node display proc domtree::treectrl::refresh {path node} { _refresh $path $node return {} } # domtree::treectrl::xview -- # # Implement xview method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Tree xview method proc domtree::treectrl::xview {path args} { eval $path.tree xview $args } # domtree::treectrl::yview -- # # Implement yview method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Tree yview method proc domtree::treectrl::yview {path args} { eval $path.tree yview $args } # domtree::treectrl::selection -- proc domtree::treectrl::selection {path args} { eval $path.tree selection $args } # domtree::treectrl::find -- # # Find DOM node at given location # # Arguments: # path widget path # findInfo location # confine # # Results: # DOM node at location proc domtree::treectrl::find {path findInfo {confine {}}} { set tnode [$path.tree find $findInfo $confine] return [_treeid_to_dnode $tnode] } # Procedures to implement display # domtree::treectrl::_refresh -- # # Configure node with appropriate images, labels, etc # # Arguments: # path widget path # node DOM node # args additional options # # Results: # Tree node may have image or label changed proc domtree::treectrl::_refresh {path node args} { switch [set nodetype [::dom::node cget $node -nodeType]] { document - documentFragment - element { set label [dom::node cget $node -nodeName] set icon ::domtree::element if {![string compare $nodetype element]} { # ID attribute display if {[Widget::getoption $path -showelementid]} { array set attributes [array get [::dom::node cget $node -attributes]] if {[catch { append label " (id $attributes(id))" }] && [catch { append label " (ID $attributes(ID))" }]} {} } if {[Widget::getoption $path -showtextcontent]} { # Text content display set temp [_refresh_text_content_display_find_text $node [Widget::getoption $path -showlength]] if {[string length $temp]} { append label " \[ [_refresh_string_trim $temp [Widget::getoption $path -showlength]] \]" } } } if {![string length [dom::node parent $node]]} { # Root node is special return {} } } textNode { array set opts [list -label [dom::node cget $node -nodeValue]] array set opts $args set label [_refresh_string_trim [string trim $opts(-label)] [Widget::getoption $path -showlength]] set icon ::domtree::textNode # Also do the ancestors foreach ancestor [lrange [lreplace [::dom::node path $node] end end] 1 end] { _refresh $path $ancestor } } processingInstruction { set label [string trim [dom::node cget $node -nodeName]] set icon ::domtree::PI } docType { set label {} set icon ::domtree::DocType } comment { set label [_refresh_string_trim [string trim [::dom::node cget $node -nodeValue]] [Widget::getoption $path -showlength]] set icon ::domtree::Comment } entityReference { set label [::dom::node cget $node -nodeName] set icon ::domtree::EntityReference } default { set label $nodetype set icon ::domtree::other } } catch { $path.tree itemconfigure [_dom_to_tree $node] -image $icon $path.tree itemconfigure [_dom_to_tree $node] -text $label } return {} } # domtree::treectrl::_refresh_text_content_display_find_text -- # # Searches given element for text. # In future could use XPath - just get the string value # of the node. # # Arguments: # node DOM element node to search # len amount of text to return # # Results: # Returns string proc domtree::treectrl::_refresh_text_content_display_find_text {node len} { switch -- $len { 0 { return {} } default { set text {} foreach child [::dom::node children $node] { switch [::dom::node cget $child -nodeType] { document - documentFragment - element { append text \ [_refresh_text_content_display_find_text $child [expr $len - [string length $text]]] } textNode { append text [string range \ [::dom::node cget $child -nodeValue] \ 0 [expr $len - [string length $text]] \ ] } default { # Nothing to do } } if {[string length $text] >= $len} { return $text } } return $text } } return {} } # domtree::treectrl::_refresh_all -- # # Updates display of all tree nodes # # Arguments: # path widget pathname # node Tree node # # Results: # Returns empty string proc domtree::treectrl::_refresh_all {path node} { foreach child [$path.tree nodes $node] { _refresh $path [_tree_to_dom $child] _refresh_all $path $child } return {} } # domtree::treectrl::_refresh_string_trim -- # # Massage text for display # # Arguments: # text text string # max maximum length for string # # Results: # Returns string proc domtree::treectrl::_refresh_string_trim {text max} { if {[string length $text] > $max} { set text [string range $text 0 [expr $max - 3]]... } if {[info tclversion] >= 8.1} { set dot \u2022 } else { set dot { } } regsub -all [format {[%s%s%s%s]+} \n \r { } \t] $text $dot text return $text } # domtree::treectrl::_node_selected -- # # A node has been selected. # # This is invoked via a DOM event. # # Arguments: # path widget path # evid event node proc domtree::treectrl::_node_selected {path evid} { set domnode [dom::event cget $evid -target] # Temporarily remove the -selectcommand callback # to avoid an infinite loop (continually posting DOM click events) set cmd [$path.tree cget -selectcommand] $path.tree configure -selectcommand {} $path.tree selection set [_dom_to_tree $domnode] $path.tree configure -selectcommand $cmd return {} } # domtree::treectrl::_select_node -- # # A tree node has been selected. # # Arguments: # path widget path # tree tree path # tnode tree node proc domtree::treectrl::_select_node {path tree tnode} { dom::event postMouseEvent [_tree_to_dom $tnode] click -detail 1 return {} } # domtree::treectrl::_node_mouse_event -- # # Generate DOM Mouse Event # # Arguments: # event event type # mod modifier # path widget path # tnode tree node # # Results: # Event synthesized for DOM proc domtree::treectrl::_node_mouse_event {event mod path tnode} { variable eventTypeMap set type $event catch {set type $eventTypeMap($event)} set evid [dom::document createEvent [_tree_to_dom $tnode] $type] dom::event initMouseEvent $evid $type 1 1 {} 0 0 0 0 0 \ [expr {$mod == "Control"}] \ [expr {$mod == "Alt"}] \ [expr {$mod == "Shift"}] \ [expr {$mod == "Meta"}] \ 0 {} dom::node dispatchEvent [_tree_to_dom $tnode] $evid dom::destroy $evid # ButtonRelease events also generate DOMActivate events if {![string compare $event "ButtonRelease"]} { set detail 1 if {![string compare $mod "Double"]} { set detail 2 } dom::event postUIEvent [_tree_to_dom $tnode] DOMActivate -detail $detail } return {} } # domtree::treectrl::_node_ui_event -- # # Generate DOM UI Event # # Arguments: # event event type # path widget path # tnode tree node # # Results: # Event synthesized for DOM proc domtree::treectrl::_node_ui_event {event path tnode} { variable eventTypeMap set type $event catch {set type $eventTypeMap($event)} dom::event postUIEvent [_tree_to_dom $tnode] $type return {} } # domtree::treectrl::_add_node -- # # Recurse DOM structure, inserting tree nodes as we go. # # # Arguments: # w tree widget path # tnode tree node to add children to # dnode DOM node corresponding to tree path above # # Results: # Nodes added to tree proc domtree::treectrl::_add_node {path tnode dnode} { upvar \#0 [namespace current]::Widget$path widget switch [dom::node cget $dnode -nodeType] { document { set nodename {} set hasChildren 1 set text {} set attrs {} } element { set nodename [$dnode cget -nodeName] set hasChildren [$dnode hasChildNodes] set text {} set attrs {} foreach atnode [dom::node selectNode $dnode @*] { lappend attrs [dom::node cget $atnode -nodeName] } } textNode { set nodename {} set hasChildren 0 set text [$dnode cget -nodeValue] set attrs {} } default { set nodename [dom::node cget $dnode -nodeType] set hasChildren 0 set text {} set attrs {} } } set id [$path.tree item create] if {$tnode != ""} { $path.tree item lastchild $tnode $id } $path.tree item configure $id -button $hasChildren switch [dom::node cget $dnode -nodeType] { textNode { $path.tree item style set $id 0 S[dom::node cget $dnode -nodeType] $path.tree item text $id 0 $text } default { $path.tree item style set $id 0 S[dom::node cget $dnode -nodeType] \ 1 s3 2 s3 $path.tree item complex $id \ [list [list e3 -text $nodename]] \ [list [list e6 -text $attrs]] \ [list [list e6 -text [llength [dom::node path $dnode]]]] } } # Create a two-way mapping between DOM node and tree id $path.tree notify bind $id [list [namespace current]::_domid $dnode] dom::node addEventListener $dnode DOMActivate [list [namespace current]::_treeid $path $id] # Implement lazy population of the tree widget if {$widget(-populate) == "lazy"} { $path.tree collapse $id after idle [list $path.tree notify bind $id [namespace code [list _node_open $path %I $id $dnode]]] } if {$widget(-populate) == "normal"} { foreach dchild [dom::node children $dnode] { _add_node $path $id $dchild } } return {} } # These should not be called proc domtree::treectrl::_domid {dnode} { return $dnode } proc domtree::treectrl::_treeid {id} { return $id } # domtree::treectrl::_dnode_to_treeid -- # # Find the tree item for a DOM node # # Arguments: # path widget path # dnode DOM node # # Results: # Returns a tree item descriptor proc domtree::treectrl::_dnode_to_treeid {path dnode} { set listener {} foreach l [dom::node addEventListener $dnode DOMActivate] { foreach {key dpath value} $l break if {[string equal $path $dpath] && \ [string equal $key "[namespace current]::_treeid"]} { return $value } } return {} } # domtree::treectrl::_treeid_to_dnode -- # # Find the DOM node for a tree item # # Arguments: # path widget path # id item descriptor # # Results: # Returns a DOM node token proc domtree::treectrl::_treeid_to_dnode {path id} { return [lindex [$path.tree notify bind $id ] end] } # domtree::treectrl::_dom_unmap -- # # Remove all event listeners for a tree widget. # # Arguments: # path widget path # node DOM node # # Results: # Returns empty string. # Event listeners may be removed from DOM document nodes. proc domtree::treectrl::_dom_unmap {path node} { # Crashing bug in TclDOM v3.1 prevents us from cleaning up return {} foreach listener [dom::node addEventListener $node DOMActivate] { foreach {key dpath value} $listener break if {[string match [namespace current]::_* $key] && \ [string equal $dpath $path]} { # This is one of ours dom::node removeEventListener $node DOMActivate $listener } } foreach child [dom::node children $node] { _dom_unmap $path $child } } # domtree::_set_client_data -- # # Manage data for tree nodes # # Arguments: # path widget path # node tree node # field field name # value value for field # # Results: # Item's configuration changed proc domtree::_set_client_data {path node field value} { array set nodeinfo [$path.tree itemcget $node -data] set nodeinfo($field) $value $path.tree itemconfigure $node -data [array get nodeinfo] } # domtree::_unset_client_data -- # # Manage data for tree nodes # # Arguments: # path widget path # node tree node # field field name to unset # # Results: # Item's configuration changed proc domtree::_unset_client_data {path node field} { array set nodeinfo [$path.tree itemcget $node -data] catch {unset nodeinfo($field)} $path.tree itemconfigure $node -data [array get nodeinfo] } # domtree::_node_open -- # # Invoked when a tree item is opened and # the tree is being populated lazily. # # Arguments: # path widget path # id tree item # dnode DOM node # # Results: # Tree nodes may be added proc domtree::treectrl::_node_open {path tnode id dnode} { if {[string equal $tnode $id]} { $path.tree notify bind $id {} foreach dchild [dom::node children $dnode] { _add_node $path $id $dchild } } return {} } # domtree::_node_tree_modified -- # # Invoked when the node's subtree has changed. # Could be because a child node has been removed. # # Refresh the # display of the node, since if textual content # is enabled the node's string value may have # changed. # # Arguments: # path widget path # evid DOM event node # # Results: # Tree nodes inserted or removed proc domtree::_node_tree_modified {path evid} { set target [dom::event cget $evid -target] set children [dom::node children $target] set branch [Tree::nodes $path.tree [_dom_to_tree $target]] if {[llength $children] < [llength $branch]} { for {set idx 0} {$idx < [llength $branch]} {incr idx} { if {![string length [lindex $children $idx]] || \ [_dom_to_tree [lindex $children $idx]] != [lindex $branch $idx]} { $path.tree delete [lindex $branch $idx] break } } } _refresh $path [dom::event cget $evid -currentNode] return {} } # domtree::_node_inserted -- # # A node has been inserted. # # Arguments: # path widget path # evid DOM event node # # Results: # Insert tree node proc domtree::_node_inserted {path evid} { # Find where the node was inserted into the child list set newnode [dom::event cget $evid -target] set parent [dom::node parent $newnode] set children [dom::node children $parent] set idx [lsearch $children $newnode] # Get old tree info set tparent [_dom_to_tree $parent] set branch [Tree::nodes $path.tree $tparent] if {$idx > [llength $branch]} { # Append the new node to the branch $path.tree insert end $tparent [_dom_to_tree $newnode] } else { # Insert the new node into the branch $path.tree insert $idx $tparent [_dom_to_tree $newnode] } _refresh $path $newnode _add_node $path [_dom_to_tree $newnode] $newnode return {} } # domtree::_node_removed -- # # A node has been removed. # # Arguments: # path widget path # evid DOM event node # # Results: # Remove tree node proc domtree::_node_removed {path evid} { set oldnode [dom::event cget $evid -target] Tree::delete $path.tree [_dom_to_tree $oldnode] return {} } # domtree::_node_data_modified -- # # Character data has changed # # Arguments: # path widget path # evid DOM L2 event node # # Results: # Tree display updated proc domtree::_node_data_modified {path evid} { _refresh $path [dom::event cget $evid -target] \ -label [dom::event cget $evid -newValue] return {} } # domtree::_node_attr_modified -- # # Attribute value modified # # Arguments: # path widget path # evid DOM L2 event node # # Results: # Display updated proc domtree::_node_attr_modified {path evid} { _refresh $path [dom::event cget $evid -target] return {} } # domtree::_node_attr_removed -- # # Attribute removed # # Arguments: # path widget path # evid DOM L2 event node # # Results: # Display updated proc domtree::_node_attr_removed {path evid} { _refresh $path [dom::event cget $evid -target] return {} } ### Image data image create photo ::domtree::element -data {R0lGODlhEAAQANX/AP7///3//vv+/vn+/fj+/ff9/fb9/fL8/PL6+e/8++78+u37+uz7+ur7 +ef6+d349tv49df18tT289P288718sPz773y7bPw6qzo4qTt5o3o4Ivn4IHb0nTj2XPj2Wrh 107bzzDVxxnQwRecjBCtmRCtmA+AdA6Hew21oQ2NgQq+rQqjlQpoXApmWgm/rQeekAXMuwXG tQTMu////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C0FET0JFOklS MS4wAt7tACH5BAEAADMALAAAAAAQABAAAAaRwJlwCBgajZCKBeE4GhuXCCIinQycs+iUA8N4 HgHnZyuTcUoZAyAwIAgA5LKMNGIckksHgiOXoRAnElpUCCB8MlKEGolcGBsiMIwyGCFxHBMd LpZxZQMPnDJ7fSVConIlKocyJSNChqcjKzEwqyMmQo+0rCYpLyUmwC1CmL/BLBQZIy3KQp7J yy0KAgUJCwcCQQA7 } image create photo ::domtree::textNode -data {R0lGODlhEAAOAJH/AP///39/fwAAAP///yH/C0FET0JFOklSMS4wAt7tACH5BAEAAAMALAAA AAAQAA4AAAI0nIUpxi0AIWoOhAveouPFnHDPhV1CQHmfhFYkmbWMup6p9QbxvbJ3rrNVejuH 4ihjAF+GAgA7 } image create photo ::domtree::PI -data {R0lGODdhEAAOAPEAALLA3AAAAAAA/////ywAAAAAEAAOAAACL4yPoBvi78Jio9oqJwh3oG90 DfSEF9dhKIioGFmqR4phFL3eaa6g+6ETaTYsw6IAADs= } image create photo ::domtree::DocType -data {R0lGODlhEAAQAKL/APfQ0MmZmYJfX2YAAEoBAf///wAAAAAAACH/C0FET0JFOklSMS4wAt7t ACH5BAEAAAUALAAAAAAQABAAAAM7WDKyUjBGB8AaUl4RQFhZNIxM8D2hQJBNgIUKOZ5wsbJu fcmNfrM1iEoWnIyKqRGqWHoFd0sdEOmAJAAAOw== } image create photo ::domtree::Comment -data {R0lGODlhEAAQAKL/AP///8fHx7CwsJ6enpycnHp6egAAAP///yH/C0FET0JFOklSMS4wAt7t ACH5BAEAAAcALAAAAAAQABAAAANDeLrcazBGZ4C917CKTegPBnigwmVDJ5iikWbEelpuV8hi bhTEMY8vGo+VE8Yeswhv1eDsCkuHb8Qj9KSRo9RniDG3CQA7 } image create photo ::domtree::EntityReference -data {R0lGODlhEAAQALP/AP7+/vfQ0NOsrMmZmci5uYMwMIJfX2YAAEoBAf///wAAAAAAAAAAAAAA AAAAAAAAACH/C0FET0JFOklSMS4wAt7tACH5BAEAAAkALAAAAAAQABAAAARPMEl5jAlhzJ2O r1WmbV+CfEdGVtzJTp4xwq90XuvBmZVAeTtbxVAK0nQTYg11mKUGyJJL8ykQOiwAr1nsyDau mgn3+8xsFwuzeUYopR5NBAA7 } image create photo ::domtree::other -data {R0lGODlhEAAOAKL/AP///39/fxAQEAAAAP///wAAAAAAAAAAACH/C0FET0JFOklSMS4wAt7t ACH5BAEAAAQALAAAAAAQAA4AAAM4SDSj/m8E0ByrdtI1wI4aFV6ZR5kiJpmrJ6kj+pbuGMCs fIO1O/MdhmcHeUkCSGJEIriQIByoIwEAOw== } image create photo ::domtree::collapse -data {R0lGODlhEAAQALIAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMyH5BAUAAAYA LAAAAAAQABAAggAAAGZmzIiIiLu7u5mZ/8zM/////wAAAAMlaLrc/jDKSRm4 OAMHiv8EIAwcYRKBSD6AmY4S8K4xXNFVru9SAgAh/oBUaGlzIGFuaW1hdGVk IEdJRiBmaWxlIHdhcyBjb25zdHJ1Y3RlZCB1c2luZyBVbGVhZCBHSUYgQW5p bWF0b3IgTGl0ZSwgdmlzaXQgdXMgYXQgaHR0cDovL3d3dy51bGVhZC5jb20g dG8gZmluZCBvdXQgbW9yZS4BVVNTUENNVAAh/wtQSUFOWUdJRjIuMAdJbWFn ZQEBADs= } image create photo ::domtree::expand -data {R0lGODlhEAAQALIAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMyH5BAUAAAYA LAAAAAAQABAAggAAAGZmzIiIiLu7u5mZ/8zM/////wAAAAMnaLrc/lCB6MCk C5SLNeGR93UFQQRgVaLCEBasG35tB9Qdjhny7vsJACH+gFRoaXMgYW5pbWF0 ZWQgR0lGIGZpbGUgd2FzIGNvbnN0cnVjdGVkIHVzaW5nIFVsZWFkIEdJRiBB bmltYXRvciBMaXRlLCB2aXNpdCB1cyBhdCBodHRwOi8vd3d3LnVsZWFkLmNv bSB0byBmaW5kIG91dCBtb3JlLgFVU1NQQ01UACH/C1BJQU5ZR0lGMi4wB0lt YWdlAQEAOw== } tclxml-3.3~svn11.orig/examples/tcldom/browser.tcl0000644000000000000000000000526511215700771020706 0ustar rootroot#!/bin/sh # \ exec wish "$0" "$@" # browser.tcl -- # # A mini XML browser # # Copyright (c) 2009 Explain # http://www.explain.com.au/ # Copyright (c) 2003 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: browser.tcl,v 1.3 2003/12/09 04:56:40 balls Exp $ package require dom package require domtree package require domtext package provide app-browser 3.3 proc Open {} { global tree text doc view set fname [tk_getOpenFile] if {![string length $fname]} { return {} } set ch [open $fname] set newdoc [dom::parse [read $ch]] close $ch $tree configure -rootnode {} $text configure -rootnode {} catch {dom::destroy $doc} set doc $newdoc if {[lsearch $view tree] >= 0} { $tree configure -rootnode $doc } if {[lsearch $view text] >= 0} { $text configure -rootnode $doc } return {} } proc View:tree {} { global view set view tree .controls.view configure -text {Tree & Text} -command View:both return {} } proc View:both {} { global view set view {tree text} .controls.view configure -text {Tree Only} -command View:tree return {} } frame .controls ttk::button .controls.open -text Open -command Open ttk::button .controls.view View:both grid .controls.open .controls.view -sticky w set p [ttk::panedwindow .panes -orient horizontal] grid .controls -row 0 -column 0 -sticky ew grid $p -row 1 -column 0 -sticky news grid rowconfigure . 1 -weight 1 grid columnconfigure . 0 -weight 1 ttk::labelframe $p.tree -text {Tree View} $p add $p.tree set tree [domtree::create $p.tree.t \ -yscrollcommand [list $p.tree.y set] \ -xscrollcommand [list $p.tree.x set]] ttk::scrollbar $p.tree.y -orient vertical -command [list $p.tree.t yview] ttk::scrollbar $p.tree.x -orient horizontal -command [list $p.tree.t xview] grid $p.tree.t -row 0 -column 0 -sticky news grid $p.tree.y -row 0 -column 1 -sticky ns grid $p.tree.x -row 1 -column 0 -sticky ew grid rowconfigure $p.tree 0 -weight 1 grid columnconfigure $p.tree 0 -weight 1 ttk::labelframe $p.text -text {Source View} $p add $p.text set text [domtext::create $p.text.t \ -yscrollcommand [list $p.text.y set] \ -xscrollcommand [list $p.text.x set]] ttk::scrollbar $p.text.y -orient vertical -command [list $p.text.t yview] ttk::scrollbar $p.text.x -orient horizontal -command [list $p.text.t xview] grid $p.text.t -row 0 -column 0 -sticky news grid $p.text.y -row 0 -column 1 -sticky ns grid $p.text.x -row 1 -column 0 -sticky ew grid rowconfigure $p.text 0 -weight 1 grid columnconfigure $p.text 0 -weight 1 tclxml-3.3~svn11.orig/examples/tcldom/common.tcl0000644000000000000000000003231011113705304020474 0ustar rootroot# common.tcl -- # # Common code shared between tkxmllint and tkxsltproc. # # The master version of this file is in the TclDOM project. # # Copyright (c) 2005 Explain # http://www.explain.com.au # Copyright (c) 2004 Zveno # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: common.tcl,v 1.1 2005/05/21 11:56:02 balls Exp $ package require http # SetProperties -- # # Setup tag properties # # Arguments: # win toplevel window # log log window # # Results: # Tag properties set proc SetProperties {win log} { $log tag configure timing -background #bafdff $log tag configure error -background #ff9d8d $log tag configure errorhighlight -background #cd3030 $log tag configure related -background #ffe59f $log tag configure relatedhighlight -background #e8b417 $log tag configure message -background #ffe59f $log tag configure log -background #b9ffd4 return {} } # Browse -- # # Choose a file # # Arguments: # win toplevel window # field name of state variable field to update # args configuration options # # Results: # Current file is set proc Browse {win field args} { upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] array set opts { -title {Select Document} -type open -command {} } array set opts $args set cwd [pwd] if {$state(cwd) != {}} { set cwd $state(cwd) } switch -- $opts(-type) { save { set fname [tk_getSaveFile -parent $win -title [mc $opts(-title)] -initialdir $cwd] } open - default { set fname [tk_getOpenFile -parent $win -title [mc $opts(-title)] -initialdir $cwd] } } if {![string length $fname]} { return {} } set state($field) file:///$fname set state(cwd) [file dirname $fname] if {[string length $fname] && [string length $opts(-command)]} { uplevel #0 $opts(-command) } return {} } # ReadAndParseXML -- # # Helper procedure to read an XML document from a file # and parse it into a DOM tree. # # Arguments: # win toplevel window # label description of the document # fname filename of document to parse # baseuri base URI for document # timearr name of array for timing information, # "start" entry must exist. # args additional options # # Results: # Document read into memory. Log messages provide feedback. # Returns DOM document token. proc ReadAndParseXML {win label fname baseuri {timearr time} args} { upvar 1 $timearr time upvar \#0 State$win state array set opts { -noent 0 -nonet 0 } array set opts $args set state(externalentities) 0 Feedback $win [mc "Opening $label document \"$fname\""] if {[string match http://* $fname]} { FeedbackProgress $win 0 set state(start_download) [clock clicks -milliseconds] if {[catch {::http::geturl $fname \ -command [list HTTPComplete $win] \ -progress [list HTTPProgress $win] \ -timeout 30000} token]} { tk_messageBox -message "unable to retrieve $label document \"$fname\" due to \"$token\"" -parent $win -type ok -icon error return -code error {} } ::http::wait $token if {[::http::status $token] != "ok"} { return -code error {} } set xml [::http::data $token] ::http::cleanup $token set time(read) [clock clicks -milliseconds] } else { if {[catch {open $fname} ch]} { tk_messageBox -message "unable to open $label document \"$fname\" due to \"$ch\"" -parent $win -type ok -icon error return -code error {} } set time(open) [clock clicks -milliseconds] Log timing $win "Opening $label document took [expr $time(open) - $time(start)]ms\n" Feedback $win [mc "Reading $label document"] # Take note of encoding information set encoding {} gets $ch xmldecl set re ^[::sgml::cl $::xml::Wsp]*<\\?xml[::sgml::cl $::xml::Wsp]+(version[::sgml::cl $::xml::Wsp]*=[::sgml::cl $::xml::Wsp]*("|')[::sgml::cl ^"']+\\2)?[::sgml::cl $::xml::Wsp]*(encoding[::sgml::cl $::xml::Wsp]*=[::sgml::cl $::xml::Wsp]*("|')([::sgml::cl ^"']+)\\4)?[::sgml::cl $::xml::Wsp]*(standalone[::sgml::cl $::xml::Wsp]*=[::sgml::cl $::xml::Wsp]*("|')(yes|no)\\7)?[::sgml::cl $::xml::Wsp]*\\?> if {[regexp $re $xmldecl discard allversion delimiter allencoding delimiter encoding allstandalone delimiter]} { if {[catch {fconfigure $ch -encoding $encoding} msg]} { if {[catch {fconfigure $ch -encoding [string tolower $encoding]} msg]} { tk_messageBox -message "unable to read $label document \"$fname\" due to \"$msg\"" -parent $win -type ok -icon error return -code error {} } } } set xml $xmldecl\n[read $ch] close $ch # Watch out for UTF-16 documents if {[regexp "^(\xFF\xFE)|(\xFE\xFF)" $xml]} { set xml [encoding convertfrom unicode $xml] } set time(read) [clock clicks -milliseconds] Log timing $win "Reading $label document took [expr $time(read) - $time(open)]ms\n" } Feedback $win [mc "Parsing $label XML"] if {[catch {dom::parse $xml \ -baseuri [uri_escape $baseuri] \ -defaultexpandinternalentities $opts(-noent) \ -externalentitycommand [list External $win]} doc]} { if {[string match "unable to*" $doc]} { Log add $win $doc } else { Log addXMLError $win $xml $doc } Feedback $win [mc "Parsing $label document failed"] after 2000 [list Feedback $win {}] return -code error {} } set time(parse) [clock clicks -milliseconds] Log timing $win "Parsing $label document took [expr $time(parse) - $time(read)]ms\n" set time(last) $time(parse) if {$state(xinclude)} { Feedback $win [mc "$label document XInclude processing"] # TODO: handle doc in slave interp if {[catch {dom::xinclude $doc} msg]} { Log addDocError $win $doc $msg Feedback $win [mc "$label document XInclude processing failed"] after 2000 [list Feedback $win {}] } set time(xinclude) [clock clicks -milliseconds] Log timing $win "$label document XInclude took [expr $time(xinclude) - $time(last)]ms\n" set time(last) $time(xinclude) } return $doc } # External -- # # Handle external entity references # # Arguments: # win toplevel window # name current parser # baseuri base URI of document # uri system identifier of referenced entity # id public identifier of referenced entity # # Results: # This reference is logged. # If loading of external entities is enabled then the entity is laoded as usual, # otherwise an empty entity is returned. proc External {win name baseuri uri id} { upvar \#0 State$win state if {$state(nonet) && ([string match http:* $uri] || [string match ftp:* $uri])} { Log entity $win "external entity not loaded, network access not permitted: system ID \"$uri\" public ID \"$id\"" return {} } Log entity $win "external entity reference: system ID \"$uri\" public ID \"$id\"" incr state(externalentities) # resume normal loading of external entity return -code continue {} } # GetFilename -- # # Helper routine to retrieve resource filename # # Arguments: # win toplevel window # entry entry widget containing filename value # field member of state array containing URI # # Results: # Returns filename. If URI is not a valid file: URL, # returns empty string and displays message. proc GetFilename {win entry field} { upvar \#0 State$win state set state($field) [$entry get] if {[catch {uri::split $state($field)} spliturl]} { # Try the URL as a pathname set fname $state($field) set state($field) file:///$state(field) } else { array set urlarray $spliturl switch -- $urlarray(scheme) { http { set fname $state($field) } file { set fname $urlarray(path) } default { tk_messageBox -message "\"$urlarray(scheme)\" type URLs are not supported" -parent $win -type ok -icon warning return {} } } } return $fname } # HTTPComplete -- # # HTTP download is finished # # Arguments: # win toplevel window # token http token # # Results: # Set progress to completion proc HTTPComplete {win token} { upvar \#0 State$win state $state(progress) itemconfigure $state(progressbar) -state disabled Log timing $win "Downloading document took [expr [clock clicks -milliseconds] - $state(start_download)]ms\n" return {} } # HTTPProgress -- # # HTTP download is in progress # # Arguments: # win toplevel window # token http token # total total number of bytes to download # current number of bytes downloaded so far # # Results: # Set progress bar proc HTTPProgress {win token total current} { upvar \#0 State$win state FeedbackProgress $win [expr ($current * 100) / $total] return {} } # Log -- # # Manage the log window # # Arguments: # win toplevel window # args messages to display # # Results: # Log window updated. proc Log {method win args} { upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] switch -- $method { clear { $state(messages).log configure -state normal $state(messages).log delete 1.0 end $state(messages).log configure -state disabled } view { set what [lindex $args 0] switch -- $what { start { $state(messages).log see 1.0 } end { $state(messages).log see end } default { return -code error "don't know how to view \"$what\"" } } } add { $state(messages).log configure -state normal $state(messages).log insert end [lindex $args 0] $state(messages).log configure -state disabled $state(messages).log see end } addXMLError { $state(messages).log configure -state normal set xml [lindex $args 0] set id 0 $state(messages).log insert end [mc "Problems detected in document:\n"] foreach errormsg [lindex $args 1] { foreach {domain level code node line message relatedLine dummy related1 related2} $errormsg break lappend error($line) error$id lappend related($relatedLine) related$id $state(messages).log insert end $message [list error error$id] if {[string index $message end] != "\n"} { $state(messages).log insert end \n } $state(messages).log tag bind error$id [list ErrorHighlight $w $state(messages).log error$id $line $relatedLine] $state(messages).log tag bind error$id [list ErrorRemoveHighlight $w $state(messages).log error$id $line $relatedLine] incr id } $state(messages).log insert end \n set linenum 1 foreach line [split $xml \n] { if {[info exists error($linenum)]} { $state(messages).log insert end $line "error errorline$linenum" } elseif {[info exists related($linenum)]} { $state(messages).log insert end $line "related relatedline$linenum" } else { $state(messages).log insert end $line } $state(messages).log insert end \n incr linenum } $state(messages).log configure -state disabled $state(messages).log see end } addDocError { $state(messages).log configure -state normal set doc [lindex $args 0] foreach errormsg [lindex $args 1] { foreach {domain level code node line message relatedLine dummy related1 related2} $errormsg break $state(messages).log insert end $message if {[string index $message end] != "\n"} { $state(messages).log insert end \n } } $state(messages).log configure -state disabled $state(messages).log see end } addMessage { $state(messages).log configure -state normal $state(messages).log insert end [lindex $args 0] message $state(messages).log configure -state disabled $state(messages).log see end } timing { if {$state(timing)} { $state(messages).log configure -state normal $state(messages).log insert end [lindex $args 0] timing $state(messages).log configure -state disabled $state(messages).log see end } } entity { if {$state(display:entrefs)} { $state(messages).log configure -state normal $state(messages).log insert end [lindex $args 0] log \n $state(messages).log configure -state disabled $state(messages).log see end } } default { return -code error "unknown method \"$method\"" } } return {} } # ErrorHighlight -- Highlight an error proc ErrorHighlight {win log tag line related} { $log tag configure $tag -background [$log tag cget errorhighlight -background] $log tag configure errorline$line -background [$log tag cget errorhighlight -background] $log tag raise errorline$line error $log tag configure relatedline$related -background [$log tag cget relatedhighlight -background] $log tag raise relatedline$related related return {} } proc ErrorRemoveHighlight {win log tag line related} { Feedback $win {} $log tag configure $tag -background {} $log tag configure errorline$line -background {} $log tag configure relatedline$related -background {} return {} } # Feedback -- Manage the feedback widget proc Feedback {win msg} { upvar \#0 State$win state set state(feedback) $msg update return {} } proc FeedbackProgress {win percent} { upvar \#0 State$win state $state(progress) coords $state(progressbar) 0 0 $percent 25 update return {} } # Incr -- utility to increment a variable, handling non-existance proc Incr var { upvar $var v if {[info exists v]} { incr v } else { set v 1 } return $v } # This should be part of the uri package proc uri_escape uri { # TODO: other characters must also be escaped regsub -all { } $uri {%20} uri return $uri } tclxml-3.3~svn11.orig/examples/tcldom/domtree.tcl0000644000000000000000000010153711215700771020661 0ustar rootroot# domtree.tcl -- # # A megawidget to support display of a DOM hierarchy # based on the TTK treectrl widget. # # This widget both generates and reacts to DOM Events. # # This package features ordered and non-unique directories and items. # Paths are managed as live links into a DOM hierarchy. # # Copyright (c) 2005-2009 Explain # http://www.explain.com.au/ # Copyright (c) 2004 Zveno Pty Ltd # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id$ package provide domtree 3.3 # We need the DOM # V2.0 gives us Level 2 event model # V2.1 gives us libxml2 # V3.3 gives us -id node option package require dom 3.3 namespace eval domtree { variable counter if {![info exists counter]} { set counter 0 } variable defaults dict set defaults showlength 20 dict set defaults showtextcontent 0 dict set defaults showelementid 0 } proc domtree::create {path args} { variable state ttk::treeview $path set cmd [namespace current]::_cmd$path rename ::$path $cmd dict set state $path cmd $cmd dict set state $path rootnode {} proc ::$path {args} "[namespace current]::Cmd $path {*}\$args" bindtags $path [list $path Domtree Treeview [winfo toplevel $path] all] $cmd tag configure element -foreground blue $cmd tag configure textNode -foreground black $cmd tag configure comment -foreground red $cmd tag configure processing-instruction -foreground red configure $path {*}$args return $path } # domtree::Cmd -- # # Implements widget command # # Arguments: # path widget path # cmd subcommand # args options # # Results: # Depends on subcommand proc domtree::Cmd {path cmd args} { [namespace current]::$cmd $path {*}$args } # domtree::cget -- # # Implements the cget method # # Arguments: # path widget path # option configuration option # # Results: # Returns value of option proc domtree::cget {path option} { variable state regexp {^-(.*)} $option discard opt if {[catch {dict get $state $path $opt} result]} { set result [[dict get $state $path cmd] cget $option] } return $result } # domtree::configure -- # # Implements the configure method # # Arguments: # path widget path # args configuration options # # Results: # Sets values of options proc domtree::configure {path args} { variable state switch [llength $args] { 0 { return {} } 1 { return [cget $path [lindex $args 0]] } default { set cmd [dict get $state $path cmd] foreach {option value} $args { regexp {^-(.*)} $option discard opt switch -- $opt { rootnode { dict set state $path rootnode $value # Completely remove the previous tree foreach item [$cmd children {}] { $cmd delete $item } if {[string length $value]} { # Listen for UI events dom::node addEventListener $value DOMActivate [namespace code [list NodeSelected $path]] -usecapture 1 # Listen for mutation events #dom::node addEventListener $value DOMNodeInserted [namespace code [list NodeInserted $path]] -usecapture 1 #dom::node addEventListener $value DOMNodeRemoved [namespace code [list NodeRemoved $path]] -usecapture 1 #dom::node addEventListener $value DOMCharacterDataModified [namespace code [list NodePCDATAModified $path]] -usecapture 1 #dom::node addEventListener $value DOMAttrModified [namespace code [list NodeAttrModified $path]] -usecapture 1 #dom::node addEventListener $value DOMAttrRemoved [namespace code [list NodeAttrRemoved $path]] -usecapture 1 Insert $path [$value cget -documentElement] } } cursor - xscrollcommand - yscrollcommand { $cmd configure $option $value } default { return -code error "unknown option \"$option\"" } } } } } return {} } # domtree::xview -- # # Implements xview method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Tree's xview method proc domtree::xview {path args} { variable state [dict get $state $path cmd] xview {*}$args } # domtree::yview -- # # Implements yview method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Tree's yview method proc domtree::yview {path args} { variable state [dict get $state $path cmd] yview {*}$args } # domtree::instate -- # # Implements instate method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Tree's instate method proc domtree::instate {path args} { variable state [dict get $state $path cmd] instate {*}$args } # domtree::identify -- # # Implements identify method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Tree's identify method proc domtree::identify {path args} { variable state [dict get $state $path cmd] identify {*}$args } # domtree::see -- # # Implements see method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Tree's see method proc domtree::see {path args} { variable state [dict get $state $path cmd] see {*}$args } # domtree::focus -- # # Implements focus method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Tree's focus method proc domtree::focus {path args} { variable state [dict get $state $path cmd] focus {*}$args } # domtree::selection -- # # Implements selection method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Tree's selection method proc domtree::selection {path args} { variable state switch -- [lindex $args 0] { set { # Post a DOMActivate event. The event listener will capture # this and actually set the selection. dom::event postUIEvent [dict get $state $path map [lindex $args 1]] DOMActivate -detail 1 } default { [dict get $state $path cmd] selection {*}$args } } } # domtree::item -- # # Implements item method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Tree's item method proc domtree::item {path args} { variable state [dict get $state $path cmd] item {*}$args } # domtree::heading -- # # Implements heading method # # Arguments: # path widget path # args additional arguments # # Results: # Depends on Tree's heading method proc domtree::heading {path args} { variable state [dict get $state $path cmd] heading {*}$args } # domtree::Insert -- # # Add a DOM node to the tree. # # TODO: # Set image for different node types # # Arguments: # path widget path # node DOM node # # Results: # Tree item created. proc domtree::Insert {path node} { variable state set cmd [dict get $state $path cmd] set parent [$node parent] if {[$parent cget -nodeType] == "document"} { set tree_parent {} } else { set tree_parent [$parent cget -id] } set label --Unknown-- switch [$node cget -nodeType] { element { set label [$node cget -prefix][expr {[$node cget -prefix] != "" ? ":" : ""}][$node cget -nodeName] set values [list [expr {[array size [$node cget -attributes]] > 0 ? "@" : ""}] {}] } textNode { set label \#PCDATA set values [list {} [$node cget -nodeValue]] } comment { set label ! set values [list {} [$node cget -nodeValue]] } processing-instruction { set label ?[$node cget -nodeName] set values [list {} [$node cget -nodeValue]] } } set id [$cmd insert $tree_parent end -id [$node cget -id] -text $label \ -values $values \ -tags [$node cget -nodeType] \ -open true] dict set state $path map [$node cget -id] $node foreach child [$node children] { Insert $path $child } return $id } # domtree::NodeSelected -- # # Handle selection event. # # Arguments: # path widget path # evid event node # # Results: # Selection is set. proc domtree::NodeSelected {path evid} { variable state set cmd [dict get $state $path cmd] set node [dom::event cget $evid -target] $cmd selection set [$node cget -id] $cmd see [$node cget -id] return {} } return {} ### TODO namespace eval domtree::treectrl { catch {font create [namespace current]::bold -weight bold} proc ::domtree::treectrl { path args } { return [eval domtree::treectrl::create $path $args] } # We may be able to use tktreectrl's event mechanism # to exactly match treectrl events to DOM events variable eventTypeMap array set eventTypeMap { ButtonPress mousedown ButtonRelease mouseup Enter mouseover Leave mouseout Motion mousemove FocusIn DOMFocusIn FocusOut DOMFocusOut } } # domtree::treectrl::create -- # # Create a DOM Treectrl widget # # Arguments: # path widget path # args configuration options # # Results: # Tree widget created proc domtree::treectrl::create {path args} { upvar \#0 [namespace current]::Widget$path widget eval frame $path -bd 0 -relief flat -takefocus 0 \ -class domtree::treectrl -highlightthickness 0 bindtags $path [list $path domtree::treectrl [winfo toplevel $path] all] set tree [eval treectrl $path.tree -showroot yes -showrootbutton yes \ -showbuttons yes -showlines yes \ -itemheight 0 \ -openbuttonimage ::domtree::collapse -closedbuttonimage ::domtree::expand] $path.tree column create -expand yes -text Elements -tag element $path.tree column create -text Attributes -tag attr $path.tree column create -text Depth -tag depth $path.tree element create e1 image -image {::domtree::element {open} ::domtree::element {}} $path.tree element create Edocument image -image ::domtree::textNode $path.tree element create EtextNode text $path.tree element create Ecomment image -image ::domtree::Comment $path.tree element create e3 text \ -fill [list [$path cget -highlightcolor] {selected focus}] \ -font [list [namespace current]::bold {}] $path.tree element create e4 text -fill blue $path.tree element create e6 text $path.tree element create e5 rect -showfocus yes \ -fill [list [$path cget -highlightbackground] {selected focus} gray {selected !focus}] $path.tree style create Selement $path.tree style elements Selement {e5 e1 e3 e4} $path.tree style layout Selement e1 -padx {0 4} -expand ns $path.tree style layout Selement e3 -padx {0 4} -expand ns $path.tree style layout Selement e4 -padx {0 6} -expand ns $path.tree style layout Selement e5 -union [list e3] -iexpand ns -ipadx 2 $path.tree style create Sdocument $path.tree style elements Sdocument {e5 Edocument e3 e4} $path.tree style layout Sdocument Edocument -padx {0 4} -expand ns $path.tree style layout Sdocument e3 -padx {0 4} -expand ns $path.tree style layout Sdocument e4 -padx {0 6} -expand ns $path.tree style layout Sdocument e5 -union [list e3] -iexpand ns -ipadx 2 $path.tree style create StextNode $path.tree style elements StextNode EtextNode $path.tree style layout StextNode EtextNode -padx {0 4} -squeeze x $path.tree style create Scomment $path.tree style elements Scomment {e5 Ecomment e3 e4} $path.tree style layout Scomment Ecomment -padx {0 4} -expand ns $path.tree style layout Scomment e3 -padx {0 4} -expand ns $path.tree style layout Scomment e4 -padx {0 6} -expand ns $path.tree style layout Scomment e5 -union [list e3] -iexpand ns -ipadx 2 $path.tree style create s3 $path.tree style elements s3 {e6} $path.tree style layout s3 e6 -padx 6 -expand ns # Create custom event to allow mapping to DOM nodes $path.tree notify install event MapDOMNode # Set various bindings to generate DOM events if {0} { foreach event {ButtonRelease ButtonPress Enter Leave Motion} { $path.tree bindImage <$event> [namespace code [list _node_mouse_event $event {} $path]] $path.tree bindText <$event> [namespace code [list _node_mouse_event $event {} $path]] foreach modifier {Control Shift Alt Meta Double} { $path.tree bindImage <$modifier-$event> [namespace code [list _node_mouse_event $event $modifier $path]] $path.tree bindText <$modifier-$event> [namespace code [list _node_mouse_event $event $modifier $path]] } } } grid $tree -row 0 -column 0 -sticky news grid rowconfigure $path 0 -weight 1 grid columnconfigure $path 0 -weight 1 rename $path ::$path:cmd proc ::$path { cmd args } "return \[eval domtree::treectrl::cmd $path \$cmd \$args\]" array set widget { -rootnode {} -populate normal } foreach {option value} $args { configure $path $option $value } return $path } # domtree::treectrl::cmd -- # # Widget command # # Arguments: # path widget path # method command method # args method arguments # # Results: # Depends on method. proc domtree::treectrl::cmd {path method args} { return [eval [list $method $path] $args] } # domtree::treectrl::cget -- # # Implements the cget method # # Arguments: # path widget path # option configuration option # # Results: # Returns value of option proc domtree::treectrl::cget {path option} { switch -- $option { -rootnode - -populate { upvar \#0 [namespace current]::Widget$path widget return $widget($option) } default { return [$path.tree cget $option] } } } # domtree::treectrl::configure -- # # Implements the configure method # # Arguments: # path widget path # args configuration options # # Results: # Sets value of options proc domtree::treectrl::configure {path args} { if {[catch {eval configure:dbg [list $path] $args} msg]} { puts stderr "domtree::treectrl::configure incurred error\n$msg" } } proc domtree::treectrl::configure:dbg {path args} { set res {} foreach {option value} $args { switch -- $option { -rootnode { upvar \#0 [namespace current]::Widget$path widget if {$widget(-rootnode) != ""} { $path.tree item delete all _dom_unmap $path $widget(-rootnode) } if {$value != ""} { set widget(-rootnode) $value _add_node $path 0 $value } } -populate { upvar \#0 [namespace current]::Widget$path widget switch -- $value { {} - normal { set widget(-populate) normal } lazy { set widget(-populate) lazy } default { return -code error "unknown value \"$value\" for option \"-populate\"" } } } default { return [$path.tree configure $option $value] } } } # May need to add these to above switch code if {0} { # Listen for UI events dom::node addEventListener $docel DOMActivate [namespace code [list _node_selected $path]] -usecapture 1 # Listen for mutation events dom::node addEventListener $docel DOMSubtreeModified [namespace code [list _node_tree_modified $path]] -usecapture 1 dom::node addEventListener $docel DOMNodeInserted [namespace code [list _node_inserted $path]] -usecapture 1 dom::node addEventListener $docel DOMNodeRemoved [namespace code [list _node_removed $path]] -usecapture 1 dom::node addEventListener $docel DOMCharacterDataModified [namespace code [list _node_data_modified $path]] -usecapture 1 dom::node addEventListener $docel DOMAttrModified [namespace code [list _node_attr_modified $path]] -usecapture 1 dom::node addEventListener $docel DOMAttrRemoved [namespace code [list _node_attr_removed $path]] -usecapture 1 } return $res } # domtree::treectrl::refresh -- # # Updates the Tree display with the value of a node # # Arguments: # path widget path # node DOM node # # Results: # May change node display proc domtree::treectrl::refresh {path node} { _refresh $path $node return {} } # domtree::treectrl::find -- # # Find DOM node at given location # # Arguments: # path widget path # findInfo location # confine # # Results: # DOM node at location proc domtree::treectrl::find {path findInfo {confine {}}} { set tnode [$path.tree find $findInfo $confine] return [_treeid_to_dnode $tnode] } # Procedures to implement display # domtree::treectrl::_refresh -- # # Configure node with appropriate images, labels, etc # # Arguments: # path widget path # node DOM node # args additional options # # Results: # Tree node may have image or label changed proc domtree::treectrl::_refresh {path node args} { switch [set nodetype [::dom::node cget $node -nodeType]] { document - documentFragment - element { set label [dom::node cget $node -nodeName] set icon ::domtree::element if {![string compare $nodetype element]} { # ID attribute display if {[Widget::getoption $path -showelementid]} { array set attributes [array get [::dom::node cget $node -attributes]] if {[catch { append label " (id $attributes(id))" }] && [catch { append label " (ID $attributes(ID))" }]} {} } if {[Widget::getoption $path -showtextcontent]} { # Text content display set temp [_refresh_text_content_display_find_text $node [Widget::getoption $path -showlength]] if {[string length $temp]} { append label " \[ [_refresh_string_trim $temp [Widget::getoption $path -showlength]] \]" } } } if {![string length [dom::node parent $node]]} { # Root node is special return {} } } textNode { array set opts [list -label [dom::node cget $node -nodeValue]] array set opts $args set label [_refresh_string_trim [string trim $opts(-label)] [Widget::getoption $path -showlength]] set icon ::domtree::textNode # Also do the ancestors foreach ancestor [lrange [lreplace [::dom::node path $node] end end] 1 end] { _refresh $path $ancestor } } processingInstruction { set label [string trim [dom::node cget $node -nodeName]] set icon ::domtree::PI } docType { set label {} set icon ::domtree::DocType } comment { set label [_refresh_string_trim [string trim [::dom::node cget $node -nodeValue]] [Widget::getoption $path -showlength]] set icon ::domtree::Comment } entityReference { set label [::dom::node cget $node -nodeName] set icon ::domtree::EntityReference } default { set label $nodetype set icon ::domtree::other } } catch { $path.tree itemconfigure [_dom_to_tree $node] -image $icon $path.tree itemconfigure [_dom_to_tree $node] -text $label } return {} } # domtree::treectrl::_refresh_text_content_display_find_text -- # # Searches given element for text. # In future could use XPath - just get the string value # of the node. # # Arguments: # node DOM element node to search # len amount of text to return # # Results: # Returns string proc domtree::treectrl::_refresh_text_content_display_find_text {node len} { switch -- $len { 0 { return {} } default { set text {} foreach child [::dom::node children $node] { switch [::dom::node cget $child -nodeType] { document - documentFragment - element { append text \ [_refresh_text_content_display_find_text $child [expr $len - [string length $text]]] } textNode { append text [string range \ [::dom::node cget $child -nodeValue] \ 0 [expr $len - [string length $text]] \ ] } default { # Nothing to do } } if {[string length $text] >= $len} { return $text } } return $text } } return {} } # domtree::treectrl::_refresh_all -- # # Updates display of all tree nodes # # Arguments: # path widget pathname # node Tree node # # Results: # Returns empty string proc domtree::treectrl::_refresh_all {path node} { foreach child [$path.tree nodes $node] { _refresh $path [_tree_to_dom $child] _refresh_all $path $child } return {} } # domtree::treectrl::_refresh_string_trim -- # # Massage text for display # # Arguments: # text text string # max maximum length for string # # Results: # Returns string proc domtree::treectrl::_refresh_string_trim {text max} { if {[string length $text] > $max} { set text [string range $text 0 [expr $max - 3]]... } if {[info tclversion] >= 8.1} { set dot \u2022 } else { set dot { } } regsub -all [format {[%s%s%s%s]+} \n \r { } \t] $text $dot text return $text } # domtree::treectrl::_node_selected -- # # A node has been selected. # # This is invoked via a DOM event. # # Arguments: # path widget path # evid event node proc domtree::treectrl::_node_selected {path evid} { set domnode [dom::event cget $evid -target] # Temporarily remove the -selectcommand callback # to avoid an infinite loop (continually posting DOM click events) set cmd [$path.tree cget -selectcommand] $path.tree configure -selectcommand {} $path.tree selection set [_dom_to_tree $domnode] $path.tree configure -selectcommand $cmd return {} } # domtree::treectrl::_select_node -- # # A tree node has been selected. # # Arguments: # path widget path # tree tree path # tnode tree node proc domtree::treectrl::_select_node {path tree tnode} { dom::event postMouseEvent [_tree_to_dom $tnode] click -detail 1 return {} } # domtree::treectrl::_node_mouse_event -- # # Generate DOM Mouse Event # # Arguments: # event event type # mod modifier # path widget path # tnode tree node # # Results: # Event synthesized for DOM proc domtree::treectrl::_node_mouse_event {event mod path tnode} { variable eventTypeMap set type $event catch {set type $eventTypeMap($event)} set evid [dom::document createEvent [_tree_to_dom $tnode] $type] dom::event initMouseEvent $evid $type 1 1 {} 0 0 0 0 0 \ [expr {$mod == "Control"}] \ [expr {$mod == "Alt"}] \ [expr {$mod == "Shift"}] \ [expr {$mod == "Meta"}] \ 0 {} dom::node dispatchEvent [_tree_to_dom $tnode] $evid dom::destroy $evid # ButtonRelease events also generate DOMActivate events if {![string compare $event "ButtonRelease"]} { set detail 1 if {![string compare $mod "Double"]} { set detail 2 } dom::event postUIEvent [_tree_to_dom $tnode] DOMActivate -detail $detail } return {} } # domtree::treectrl::_node_ui_event -- # # Generate DOM UI Event # # Arguments: # event event type # path widget path # tnode tree node # # Results: # Event synthesized for DOM proc domtree::treectrl::_node_ui_event {event path tnode} { variable eventTypeMap set type $event catch {set type $eventTypeMap($event)} dom::event postUIEvent [_tree_to_dom $tnode] $type return {} } # domtree::treectrl::_add_node -- # # Recurse DOM structure, inserting tree nodes as we go. # # # Arguments: # w tree widget path # tnode tree node to add children to # dnode DOM node corresponding to tree path above # # Results: # Nodes added to tree proc domtree::treectrl::_add_node {path tnode dnode} { upvar \#0 [namespace current]::Widget$path widget switch [dom::node cget $dnode -nodeType] { document { set nodename {} set hasChildren 1 set text {} set attrs {} } element { set nodename [$dnode cget -nodeName] set hasChildren [$dnode hasChildNodes] set text {} set attrs {} foreach atnode [dom::node selectNode $dnode @*] { lappend attrs [dom::node cget $atnode -nodeName] } } textNode { set nodename {} set hasChildren 0 set text [$dnode cget -nodeValue] set attrs {} } default { set nodename [dom::node cget $dnode -nodeType] set hasChildren 0 set text {} set attrs {} } } set id [$path.tree item create] if {$tnode != ""} { $path.tree item lastchild $tnode $id } $path.tree item configure $id -button $hasChildren switch [dom::node cget $dnode -nodeType] { textNode { $path.tree item style set $id 0 S[dom::node cget $dnode -nodeType] $path.tree item text $id 0 $text } default { $path.tree item style set $id 0 S[dom::node cget $dnode -nodeType] \ 1 s3 2 s3 $path.tree item complex $id \ [list [list e3 -text $nodename]] \ [list [list e6 -text $attrs]] \ [list [list e6 -text [llength [dom::node path $dnode]]]] } } # Create a two-way mapping between DOM node and tree id $path.tree notify bind $id [list [namespace current]::_domid $dnode] dom::node addEventListener $dnode DOMActivate [list [namespace current]::_treeid $path $id] # Implement lazy population of the tree widget if {$widget(-populate) == "lazy"} { $path.tree collapse $id after idle [list $path.tree notify bind $id [namespace code [list _node_open $path %I $id $dnode]]] } if {$widget(-populate) == "normal"} { foreach dchild [dom::node children $dnode] { _add_node $path $id $dchild } } return {} } # These should not be called proc domtree::treectrl::_domid {dnode} { return $dnode } proc domtree::treectrl::_treeid {id} { return $id } # domtree::treectrl::_dnode_to_treeid -- # # Find the tree item for a DOM node # # Arguments: # path widget path # dnode DOM node # # Results: # Returns a tree item descriptor proc domtree::treectrl::_dnode_to_treeid {path dnode} { set listener {} foreach l [dom::node addEventListener $dnode DOMActivate] { foreach {key dpath value} $l break if {[string equal $path $dpath] && \ [string equal $key "[namespace current]::_treeid"]} { return $value } } return {} } # domtree::treectrl::_treeid_to_dnode -- # # Find the DOM node for a tree item # # Arguments: # path widget path # id item descriptor # # Results: # Returns a DOM node token proc domtree::treectrl::_treeid_to_dnode {path id} { return [lindex [$path.tree notify bind $id ] end] } # domtree::treectrl::_dom_unmap -- # # Remove all event listeners for a tree widget. # # Arguments: # path widget path # node DOM node # # Results: # Returns empty string. # Event listeners may be removed from DOM document nodes. proc domtree::treectrl::_dom_unmap {path node} { # Crashing bug in TclDOM v3.1 prevents us from cleaning up return {} foreach listener [dom::node addEventListener $node DOMActivate] { foreach {key dpath value} $listener break if {[string match [namespace current]::_* $key] && \ [string equal $dpath $path]} { # This is one of ours dom::node removeEventListener $node DOMActivate $listener } } foreach child [dom::node children $node] { _dom_unmap $path $child } } # domtree::_set_client_data -- # # Manage data for tree nodes # # Arguments: # path widget path # node tree node # field field name # value value for field # # Results: # Item's configuration changed proc domtree::_set_client_data {path node field value} { array set nodeinfo [$path.tree itemcget $node -data] set nodeinfo($field) $value $path.tree itemconfigure $node -data [array get nodeinfo] } # domtree::_unset_client_data -- # # Manage data for tree nodes # # Arguments: # path widget path # node tree node # field field name to unset # # Results: # Item's configuration changed proc domtree::_unset_client_data {path node field} { array set nodeinfo [$path.tree itemcget $node -data] catch {unset nodeinfo($field)} $path.tree itemconfigure $node -data [array get nodeinfo] } # domtree::_node_open -- # # Invoked when a tree item is opened and # the tree is being populated lazily. # # Arguments: # path widget path # id tree item # dnode DOM node # # Results: # Tree nodes may be added proc domtree::treectrl::_node_open {path tnode id dnode} { if {[string equal $tnode $id]} { $path.tree notify bind $id {} foreach dchild [dom::node children $dnode] { _add_node $path $id $dchild } } return {} } # domtree::_node_tree_modified -- # # Invoked when the node's subtree has changed. # Could be because a child node has been removed. # # Refresh the # display of the node, since if textual content # is enabled the node's string value may have # changed. # # Arguments: # path widget path # evid DOM event node # # Results: # Tree nodes inserted or removed proc domtree::_node_tree_modified {path evid} { set target [dom::event cget $evid -target] set children [dom::node children $target] set branch [Tree::nodes $path.tree [_dom_to_tree $target]] if {[llength $children] < [llength $branch]} { for {set idx 0} {$idx < [llength $branch]} {incr idx} { if {![string length [lindex $children $idx]] || \ [_dom_to_tree [lindex $children $idx]] != [lindex $branch $idx]} { $path.tree delete [lindex $branch $idx] break } } } _refresh $path [dom::event cget $evid -currentNode] return {} } # domtree::_node_inserted -- # # A node has been inserted. # # Arguments: # path widget path # evid DOM event node # # Results: # Insert tree node proc domtree::_node_inserted {path evid} { # Find where the node was inserted into the child list set newnode [dom::event cget $evid -target] set parent [dom::node parent $newnode] set children [dom::node children $parent] set idx [lsearch $children $newnode] # Get old tree info set tparent [_dom_to_tree $parent] set branch [Tree::nodes $path.tree $tparent] if {$idx > [llength $branch]} { # Append the new node to the branch $path.tree insert end $tparent [_dom_to_tree $newnode] } else { # Insert the new node into the branch $path.tree insert $idx $tparent [_dom_to_tree $newnode] } _refresh $path $newnode _add_node $path [_dom_to_tree $newnode] $newnode return {} } # domtree::_node_removed -- # # A node has been removed. # # Arguments: # path widget path # evid DOM event node # # Results: # Remove tree node proc domtree::_node_removed {path evid} { set oldnode [dom::event cget $evid -target] Tree::delete $path.tree [_dom_to_tree $oldnode] return {} } # domtree::_node_data_modified -- # # Character data has changed # # Arguments: # path widget path # evid DOM L2 event node # # Results: # Tree display updated proc domtree::_node_data_modified {path evid} { _refresh $path [dom::event cget $evid -target] \ -label [dom::event cget $evid -newValue] return {} } # domtree::_node_attr_modified -- # # Attribute value modified # # Arguments: # path widget path # evid DOM L2 event node # # Results: # Display updated proc domtree::_node_attr_modified {path evid} { _refresh $path [dom::event cget $evid -target] return {} } # domtree::_node_attr_removed -- # # Attribute removed # # Arguments: # path widget path # evid DOM L2 event node # # Results: # Display updated proc domtree::_node_attr_removed {path evid} { _refresh $path [dom::event cget $evid -target] return {} } ### Image data image create photo ::domtree::element -data {R0lGODlhEAAQANX/AP7///3//vv+/vn+/fj+/ff9/fb9/fL8/PL6+e/8++78+u37+uz7+ur7 +ef6+d349tv49df18tT289P288718sPz773y7bPw6qzo4qTt5o3o4Ivn4IHb0nTj2XPj2Wrh 107bzzDVxxnQwRecjBCtmRCtmA+AdA6Hew21oQ2NgQq+rQqjlQpoXApmWgm/rQeekAXMuwXG tQTMu////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C0FET0JFOklS MS4wAt7tACH5BAEAADMALAAAAAAQABAAAAaRwJlwCBgajZCKBeE4GhuXCCIinQycs+iUA8N4 HgHnZyuTcUoZAyAwIAgA5LKMNGIckksHgiOXoRAnElpUCCB8MlKEGolcGBsiMIwyGCFxHBMd LpZxZQMPnDJ7fSVConIlKocyJSNChqcjKzEwqyMmQo+0rCYpLyUmwC1CmL/BLBQZIy3KQp7J yy0KAgUJCwcCQQA7 } image create photo ::domtree::textNode -data {R0lGODlhEAAOAJH/AP///39/fwAAAP///yH/C0FET0JFOklSMS4wAt7tACH5BAEAAAMALAAA AAAQAA4AAAI0nIUpxi0AIWoOhAveouPFnHDPhV1CQHmfhFYkmbWMup6p9QbxvbJ3rrNVejuH 4ihjAF+GAgA7 } image create photo ::domtree::PI -data {R0lGODdhEAAOAPEAALLA3AAAAAAA/////ywAAAAAEAAOAAACL4yPoBvi78Jio9oqJwh3oG90 DfSEF9dhKIioGFmqR4phFL3eaa6g+6ETaTYsw6IAADs= } image create photo ::domtree::DocType -data {R0lGODlhEAAQAKL/APfQ0MmZmYJfX2YAAEoBAf///wAAAAAAACH/C0FET0JFOklSMS4wAt7t ACH5BAEAAAUALAAAAAAQABAAAAM7WDKyUjBGB8AaUl4RQFhZNIxM8D2hQJBNgIUKOZ5wsbJu fcmNfrM1iEoWnIyKqRGqWHoFd0sdEOmAJAAAOw== } image create photo ::domtree::Comment -data {R0lGODlhEAAQAKL/AP///8fHx7CwsJ6enpycnHp6egAAAP///yH/C0FET0JFOklSMS4wAt7t ACH5BAEAAAcALAAAAAAQABAAAANDeLrcazBGZ4C917CKTegPBnigwmVDJ5iikWbEelpuV8hi bhTEMY8vGo+VE8Yeswhv1eDsCkuHb8Qj9KSRo9RniDG3CQA7 } image create photo ::domtree::EntityReference -data {R0lGODlhEAAQALP/AP7+/vfQ0NOsrMmZmci5uYMwMIJfX2YAAEoBAf///wAAAAAAAAAAAAAA AAAAAAAAACH/C0FET0JFOklSMS4wAt7tACH5BAEAAAkALAAAAAAQABAAAARPMEl5jAlhzJ2O r1WmbV+CfEdGVtzJTp4xwq90XuvBmZVAeTtbxVAK0nQTYg11mKUGyJJL8ykQOiwAr1nsyDau mgn3+8xsFwuzeUYopR5NBAA7 } image create photo ::domtree::other -data {R0lGODlhEAAOAKL/AP///39/fxAQEAAAAP///wAAAAAAAAAAACH/C0FET0JFOklSMS4wAt7t ACH5BAEAAAQALAAAAAAQAA4AAAM4SDSj/m8E0ByrdtI1wI4aFV6ZR5kiJpmrJ6kj+pbuGMCs fIO1O/MdhmcHeUkCSGJEIriQIByoIwEAOw== } image create photo ::domtree::collapse -data {R0lGODlhEAAQALIAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMyH5BAUAAAYA LAAAAAAQABAAggAAAGZmzIiIiLu7u5mZ/8zM/////wAAAAMlaLrc/jDKSRm4 OAMHiv8EIAwcYRKBSD6AmY4S8K4xXNFVru9SAgAh/oBUaGlzIGFuaW1hdGVk IEdJRiBmaWxlIHdhcyBjb25zdHJ1Y3RlZCB1c2luZyBVbGVhZCBHSUYgQW5p bWF0b3IgTGl0ZSwgdmlzaXQgdXMgYXQgaHR0cDovL3d3dy51bGVhZC5jb20g dG8gZmluZCBvdXQgbW9yZS4BVVNTUENNVAAh/wtQSUFOWUdJRjIuMAdJbWFn ZQEBADs= } image create photo ::domtree::expand -data {R0lGODlhEAAQALIAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMyH5BAUAAAYA LAAAAAAQABAAggAAAGZmzIiIiLu7u5mZ/8zM/////wAAAAMnaLrc/lCB6MCk C5SLNeGR93UFQQRgVaLCEBasG35tB9Qdjhny7vsJACH+gFRoaXMgYW5pbWF0 ZWQgR0lGIGZpbGUgd2FzIGNvbnN0cnVjdGVkIHVzaW5nIFVsZWFkIEdJRiBB bmltYXRvciBMaXRlLCB2aXNpdCB1cyBhdCBodHRwOi8vd3d3LnVsZWFkLmNv bSB0byBmaW5kIG91dCBtb3JlLgFVU1NQQ01UACH/C1BJQU5ZR0lGMi4wB0lt YWdlAQEAOw== } tclxml-3.3~svn11.orig/examples/tcldom/README0000644000000000000000000000311711113705304017363 0ustar rootrootexamples/tcldom/README -- This directory contains some small example scripts to demonstrate the use of TclDOM. --------------------------------------------------------------------------- See the file "LICENSE" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. --------------------------------------------------------------------------- cgi2dom.tcl Not an application, but a package. Provides the 'cgi2dom::createdocument' command which accepts a number of name-value parameters and returns a DOM tree. All parameters whose name starts with '/' are interpreted as XPath location paths. The 'createNode' method is used to construct a DOM tree. The parameter values are inserted into the tree as text nodes. domtree.tcl A BWidget mega-widget. Displays a DOM documents as a tree of nodes. The BWidgets Tree widget provides the display. DOM events are used to maintain the tree view, and DOM events are posted in response to Tk events. domtree-treectrl.tcl Similar to above, but uses a treectrl widget. domtext.tcl A Tk mega-widget. Displays a DOM document in a Tk text widget. Control of the widget's contents is at the level of DOM nodes, not lines and characters. DOM events are used to maintain the text view and DOM events are posted in response to Tk events. Character data in the widget is editable. browser.tcl A mini XML browser. Uses above mega-widgets. tkxmllint An XML document analyzer. Performs well-formedness check, DTD validation or XML Schema validation on a XML document. Basically, the GUI version of xmllint. tclxml-3.3~svn11.orig/examples/tcldom/pwrdLogo150.gif.b640000644000000000000000000000646011113705304021613 0ustar rootrootR0lGODlhYQCWAPUAAP//////zP//mf//AP/MzP/Mmf/MAP+Zmf+ZZv+ZAMz/ /8zM/8zMzMyZzMyZmcyZZsyZAMxmZsxmM8xmAMwzM8wzAJnM/5nMzJmZzJmZ mZlmmZlmZplmM5kzM5kzAGaZzGZmzGZmmWZmZmYzZmYzMzNmzDNmmTMzmTMz ZgAzmQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH+BSAtZGwtACH5BAEKAAIALAAA AABhAJYAAAb+QIFwSCwaj8ikcslsOp/Oh1RClVSu2KxWAu16jY9IpGrVms9o 9OPLJqbf8Lic2/7K0ZN0IpG/p9dGCAgPZBSGZ05+WRADBmcTA5EDfYqVcomV jJNnkpGOlqBvmIqeZwaSBhOUoaxZo3eaq1eQkbKttxVOFIqnn1qnm7jCV7q8 AxBmscPDdEy7frVmkQnLzE5ld43JkdXDEdek1L/BlhKE3VffTdhy5LPalRIF APQABOhP7HHuFQnHlRHqCbxXLR8vaQMqHRAIYMECeg8KRjmYBZIvOfPoLfiQ ouMJBwEkNonoRxyWU7bSEKjHsaPLFBn0tXpC8o4sbncWNjTxsqf+hmU0Fa2y mJPehZ5IT3QYBoWVv5RmAgLAgBQpCaBPWJ2aQ69lVZcollFoGgoenJVUv7o8 Ua1Zk1CQTKZZeFSty6XL3DIJxQjZGwkN7bq8amkCnzOAXil6ehYAT8Fh3xg2 IPeKv1RaEr8FtfXNAwBe7cbxNw3hxQobPnxQDO20mQAMBHckDAeYa9JaRvRc UtZ1loWP7UYeXVoLLS0odispW1kLgLqCPdwh7VeL2SvJXZrgXZhfls/B1dIm 7r0CvxMvQXCvBAlqBQKxIZ+hYuo6lgmue65e3j0NYBCy4VUBBQ+sBEBIZpzS XD+2KKeETHFAkgYCAMgWGQUMMASATNH+mGGLBw4mASEc+KmUll0joJBdRyBc AJFx9r3RQYhIjFhbGgAAKNtXAQCAgBaMLIjGjNoxYeMbQgK241corHTAOO6Z QWRH+ykRAShQPbDAklV14KR1vqVBwktNXLnMASdy6VIFL95XnphkMmHmMATo qKZHFNDDjj+VrJhCmdUQEJ6aI0j1zBUDCJnGitsxUZMwAdz5UgcLEfSOJSuq t9kw8UmawnsAPInFHpag11FWy3R6Jwp5bphFmHDEuakwaapJwmcIzqLoG7Lu tUwGnqbgJQCP7sqrS6gOo0GwbAJwaAVRpjFlo7PisoFag76Ewmei3jJllb4O c21VJmQ72Er+w4x5arLCTPnSCaEhxQGx6SLLLi7udoQCCbX25ICluOi2Lmu3 WMWvWk0eWYnAJ5C1DFIdbNCvSxr8uEx2JTjMyqN+fppBvC850E124IbLygHd +hkWAyV8Nd4w9t4LykoWCzybB45VNVw1MRNciYEMpDhpBxVWhc4VPVc7cz0b veRBBAp0eXQFHVHrhIChrATdSxU4sGVPI2ShsCJEavoE1kuDHFYDW3e01AEE xL0MkV6gbclKdoJVAQNtr5Vht/gOLPPdOfd01VRqbQDAnLio6wUuwEHM5sQd OeDqMDM23AXkRffUwX9qoTt3ChlvfstCVXkAelUn2FPNjCUrbcn+Z6ZyHVDe L4UQ6ut/Pn7LZx1/Ct5XGtDLsx23AGazvl0XjlQGi3fTOxQY4KJ8T2FFXpXl Y1ditRMhCAPAuHpnaG4K3Hdj9hPh47Ih2Ht3jtRC+HjxEy4ERAD/SkzS380X 7btF/vYnv5eM4DP160IAW4EyP13lIS4DTAKhsEBWROAAy3tgAe/Cpu4p4gs7 Y4UECKCu2VQAgqnr4P+8EDZhkPAlGvxKBSS4wi60EH/uimFSKlCgCT7hhqeT AAxPuMEUhCV/PnQCEFsRgQcMEYVgG+HRvPCBlzGwdmGD4qQK4MFKaKYJJbDb yVaUxSLS52hfZIIJxBgKBNisjEgZATb+uniHNC5BWHkRgd4sAIDadUQ6MyQA HefQBTwuY1nM42N4UCABuOmpG3phgiG9UT7n4bGRj2xLIdkYCiF6pAIYsGQF OkACFIDgcnmBAkc4GQquhbJlVTnlFJ+wSuthY0XNw51LQJArkTSBJ6y8A2BI siIPFE+XHcEAwLDihI7Q6UAO8ErEQPOVBgCOmU1wpjB0kqZpUo4Aj8KmJD81 DADAcjBEmxgKnDXLZpJzm20bQZ76loIN9NKX4xSLJcPikO1dU5xKaEk1tPSu vUUNewEYpB+eAKAQ4qIAaWoeUjawTHwqgScOxZ80aactQU4tF+7MKP50RALA nDMFIvinRZP+wLyjRTMFcqSmS0T2UZBm04gfDQEIwiJTmNb0CggIaU1RwBYC QOen6WhCS0S6jLAV4GtLnJo6lqAjplZjIR0I5jKmqgRYWhUUEArIs34aySMM hhmfKcB8UInUshrhrMsAgFrPED2kXsGtRYBrOedqBgJYzK54JYJexebRSsgV DQfgq11vmgIrViAgCj3sGSJQ0ZoyQZpmkIdc/4qFCx4gnFeQbGYBYFcsMMFO YoSsGeCWjoqK1gxs/akaORiV2AKmDP7Lwmu1AM7S2pSltNWCan9zOQrIZLe/ Uaxs7xjcLAwXC/M4EnKxQMPFMvePk43tQrAxVjYp1zkKDcU4tVn+W30MEwv/ nC4W/FraJYQGDYAhwDVHSIgDsAOT8p1LZduJhLz5Z0RnLMd+k1iEk/p2vaW1 4xD8eOArqBSNSuhJg2eY4AhzbcKlDayEMZdVEpAgqyDW6tE0fGE5gNjDKSJq sLCnohaP4MUv9rCMPxxiTuI1NMPxwIlLqSI/rvjHXILCSY0I5CIbWXCzPbKS jwyFJTu5yE1+spQ9FeUpW3lH37vulbf8lSxbGCkluMAFdFkCBjStJxhoGQZ4 kuaeiLlWLbrAkE3w5p6E+QIgK5ITkJmCDyjgAwU0wVROWSsMUGUqrfOxOQf1 gQWEsieCLgGjN9JTOz9hyC7x8yn1E5/VRtvZnA0BwddeMpV4NdrTLxE0BnDn aVQjJXZJOB+gGRAvDHT6oKSmNQBojRTQsJoegxL0B4bc6lHr5wlqcfVLSgCa EiigXy4yQYZ8nALHTNrRkF60fhbgbMrBGglqAYGqXgLo58RyS6KuigIUMO4P XMAECggPvNmtn3VTrs/I5rK+q1Llfft7epf9t8ChAIKCG/zgBi+XwhfOcIUL 3C51iHgRPgACTO9b4hhPAsXPt+SMe1ypIOA4lT9OclVKOlglT3kbKi5yJKv8 5V+g+JBhTvOaGyEIADs= tclxml-3.3~svn11.orig/examples/tcldom/tkxmllint.tcl0000644000000000000000000007234211215700771021251 0ustar rootroot#!/bin/sh # \ exec wish "$0" "$@" # tkxmllint -- # # Simple GUI for xmllint-style processing of XML documents # # Copyright (c) 2005-2009 Explain # http://www.explain.com.au/ # Copyright (c) 2003-2004 Zveno # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: tkxmllint.tcl,v 1.11 2005/05/20 14:07:33 balls Exp $ # Global initialisation set VERSION 1.9 # Temporary hack for TclApp-wrapped executables lappend auto_path [file dirname [info nameofexecutable]] package require dom package require msgcat namespace import ::msgcat::mc package require uri 1.2 tk appname tkxmllint # We need the code shared with tkxsltproc source [file join [file dirname [info script]] common.tcl] # Init -- # # Create the GUI # # Arguments: # win toplevel window # # Results: # Tk widgets created proc Init win { upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] array set state { url {} cwd {} noent 0 nonet 0 display:entrefs 0 } wm title $win "Tk XML Lint" switch [tk windowingsystem] { aqua - classic { set metakey Command set metakeylabel Command- } default { set metakey Control set metakeylabel Ctrl+ } } menu $w.menu -tearoff 0 $win configure -menu $w.menu $w.menu add cascade -label [mc File] -menu $w.menu.file menu $w.menu.file -tearoff 1 $w.menu.file add command -label [mc {New Window}] -command NewWindow -accel ${metakeylabel}N bind $win <${metakey}-n> NewWindow $w.menu.file add separator $w.menu.file add command -label [mc {Save As...}] -command [list SaveAs $win] -state disabled $w.menu.file add separator $w.menu.file add command -label [mc Quit] -command {destroy .} -accel ${metakeylabel}Q bind $win <${metakey}-q> {destroy .} $w.menu add cascade -label [mc Help] -menu $w.menu.help menu $w.menu.help -tearoff 0 $w.menu.help add command -label [mc {About tkxmllint}] -command tkAboutDialog -accel ${metakeylabel}? # This fails on Linux catch {bind $win <${metakey}-?> tkAboutDialog} if {$::tcl_platform(platform) == "macintosh" || ($::tcl_platform(platform) == "unix" && $::tcl_platform(os) == "Darwin")} { $w.menu add cascade -label tkxmllint -menu $w.menu.apple menu $w.menu.apple -tearoff 0 $w.menu.apple add command -label [mc {About tkxmllint}] -command tkAboutDialog } frame $w.controls grid $w.controls - -row 0 -column 0 -sticky ew button $w.controls.check -text [mc Check] -command [list Check $win] # TODO: add a nice icon grid $w.controls.check -row 0 -column 0 -sticky w grid columnconfigure $w.controls 0 -weight 1 labelframe $w.doc -text [mc Document] grid $w.doc - -row 1 -column 0 -sticky ew label $w.doc.url -text [mc URL:] entry $w.doc.urlentry -width 60 -textvariable State${win}(url) button $w.doc.browse -text [mc Browse] -command [list Browse $win url -title {Select XML Document}] grid $w.doc.url -row 0 -column 0 -sticky w grid $w.doc.urlentry -row 0 -column 1 -sticky ew grid $w.doc.browse -row 0 -column 2 -sticky e grid columnconfigure $w.doc 1 -weight 1 labelframe $w.options -text [mc Options] grid $w.options - -row 2 -column 0 -sticky news checkbutton $w.options.noout -text [mc {Display document}] -variable State${win}(display) checkbutton $w.options.timing -text [mc {Display timing}] -variable State${win}(timing) checkbutton $w.options.xinclude -text [mc XInclude] -variable State${win}(xinclude) checkbutton $w.options.noent -text [mc {Substitute entities}] -variable State${win}(noent) checkbutton $w.options.logentities -text [mc {Log entities}] -variable State${win}(display:entrefs) checkbutton $w.options.nonet -text [mc {No network}] -variable State${win}(nonet) menubutton $w.options.encode -text [mc Encoding...] -menu $w.options.encode.menu set m [menu $w.options.encode.menu -tearoff 0] $m add radiobutton -label [mc utf-8] -variable ::State${win}(encoding) -value utf-8 $m add radiobutton -label [mc ascii] -variable ::State${win}(encoding) -value ascii entry $w.options.encoding -textvariable ::State${win}(encoding) set state(encoding) utf-8 grid $w.options.noout -row 0 -column 0 -sticky w grid $w.options.timing -row 1 -column 0 -sticky w grid $w.options.logentities -row 2 -column 0 -sticky w grid $w.options.xinclude -row 0 -column 1 -sticky w grid $w.options.noent -row 1 -column 1 -sticky w grid $w.options.nonet -row 2 -column 1 -sticky w grid $w.options.encode -row 0 -column 2 -sticky w grid $w.options.encoding -row 0 -column 3 -sticky ew grid columnconfigure $w.options 3 -weight 1 labelframe $w.validation -text [mc Validation] grid $w.validation - -row 3 -column 0 -sticky news radiobutton $w.validation.none -text [mc none] -variable State${win}(validate) -value no radiobutton $w.validation.dtd -text [mc DTD] -variable State${win}(validate) -value dtd radiobutton $w.validation.wxs -text [mc WXS] -variable State${win}(validate) -value wxs radiobutton $w.validation.rng -text [mc RNG] -variable State${win}(validate) -value rng labelframe $w.validation.doc -text [mc {Schema Document}] label $w.validation.doc.url -text [mc URL:] entry $w.validation.doc.urlentry -width 40 -textvariable State${win}(schemaurl) button $w.validation.doc.browse -text [mc Browse] -command [list Browse $win schemaurl -title {Select Schema Document}] grid $w.validation.doc.url -row 0 -column 0 -sticky w grid $w.validation.doc.urlentry -row 0 -column 1 -sticky ew grid $w.validation.doc.browse -row 0 -column 2 -sticky e grid columnconfigure $w.validation.doc 1 -weight 1 set state(validate) no grid $w.validation.none -row 0 -column 0 -sticky w grid $w.validation.dtd -row 0 -column 1 -sticky w grid $w.validation.wxs -row 0 -column 2 -sticky w grid $w.validation.rng -row 0 -column 3 -sticky w grid $w.validation.doc - - - -row 1 -sticky ew grid columnconfigure $w.validation 2 -weight 1 set state(messages) [labelframe $w.messages -text [mc Messages]] grid $w.messages - -row 4 -column 0 -sticky news text $w.messages.log -wrap none \ -state disabled \ -xscrollcommand [list $w.messages.xscroll set] \ -yscrollcommand [list $w.messages.yscroll set] scrollbar $w.messages.xscroll -orient horizontal \ -command [list $w.messages.log xview] scrollbar $w.messages.yscroll -orient vertical \ -command [list $w.messages.log yview] grid $w.messages.log -row 0 -column 0 -sticky news grid $w.messages.yscroll -row 0 -column 1 -sticky ns grid $w.messages.xscroll -row 1 -column 0 -sticky ew grid rowconfigure $w.messages 0 -weight 1 grid columnconfigure $w.messages 0 -weight 1 SetProperties $win $w.messages.log frame $w.feedback grid $w.feedback - -row 5 -column 0 -sticky ew label $w.feedback.msg -textvariable State${win}(feedback) set state(progress) [canvas $w.feedback.progress \ -width 100 -height 25 -relief sunken] set state(progressbar) [$w.feedback.progress create rectangle 0 0 1 25 \ -fill blue -disabledfill white -state disabled] grid $w.feedback.progress -row 0 -column 1 grid $w.feedback.msg -row 0 -column 0 -sticky ew grid columnconfigure $w.feedback 0 -weight 1 grid rowconfigure $win 3 -weight 1 grid columnconfigure $win 1 -weight 1 return {} } # tkAboutDialog -- # # Information about this application # # Arguments: # None # # Results: # Displays window proc tkAboutDialog {} { catch {destroy .about} toplevel .about catch {::tk::unsupported::MacWindowStyle style .about floatProc} wm title .about [mc {About tkxmllint}] label .about.libxml2logo -image libxml2Logo label .about.tcllogo -image tclLogo text .about.msg -width 40 -height 10 -font Arial .about.msg insert end [mc [format "tkxmllint - A GUI for xmllint Version %s Powered by: \tlibxml2\tv%s \tTclXML\tv%s \tTcl/Tk\tv%s http://tclxml.sourceforge.net/tkxmllint.html " $::VERSION $::xml::libxml2::libxml2version \ [package require xml] [info patchlevel]]] .about.msg configure -state disabled grid .about.libxml2logo -row 0 -column 2 -sticky news grid .about.tcllogo -row 1 -column 2 -sticky news grid .about.msg -row 0 -column 1 -rowspan 2 -sticky news -padx 20 -pady 20 grid rowconfigure .about 0 -weight 1 grid rowconfigure .about 1 -weight 1 grid columnconfigure .about 1 -weight 1 return {} } # SaveAs -- # # Save document into a file # # Arguments: # win toplevel # # Results: # File written proc SaveAs {win} { upvar \#0 State$win state if {![info exists state(dom)]} { tk_messageBox -parent $win -title [mc {No Document}] \ -message [mc {No document to save}] -type ok return {} } set w [expr {$win == "." ? {} : $win}] set cwd [pwd] if {$state(cwd) != {}} { set cwd $state(cwd) } set fname [tk_getSaveFile -parent $win -title [mc {Save As...}] -initialdir $cwd] if {![string length $fname]} { return {} } set state(cwd) [file dirname $fname] if {[catch {open $fname w} ch]} { tk_messageBox -parent $win -icon error -type ok -message "Unable to open \"[file nativename $fname]\" for writing" return {} } fconfigure $ch -encoding $state(encoding) puts $ch [dom::serialize $state(dom) -encoding $state(encoding)] close $ch return {} } # NewWindow -- # # Create another toplevel window # # Arguments: # None # # Results: # Tk toplevel created and initialised proc NewWindow {} { global counter Init [toplevel .top[Incr counter]] return {} } # Check -- # # Parse the given document and display report # # Arguments: # win toplevel window # # Results: # Document read into memory, parsed and report displayed proc Check win { upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] set fname [GetFilename $win $w.doc.urlentry url] if {![string length $fname]} { return } set dodisplay $state(display) Log clear $win $w.menu.file entryconfigure [mc {Save As...}] -state disabled catch { dom::destroy $state(dom) unset state(dom) } set time(start) [clock clicks -milliseconds] if {[catch {ReadAndParseXML $win [mc "source"] $fname $state(url) time \ -noent $state(noent) \ -nonet $state(nonet)} doc]} { return } $w.menu.file entryconfigure [mc {Save As...}] -state normal switch -- $state(validate) { dtd { Feedback $win [mc "Validating document"] if {[catch {$doc dtd validate} msg]} { Log addXMLError $win [dom::serialize $doc] $msg Feedback $win [mc "Document is not valid"] set dodisplay 0 } else { Log add $win $msg } set time(validate) [clock clicks -milliseconds] Log timing $win "Validation took [expr $time(validate) - $time(last)]ms\n" set time(last) $time(validate) } wxs { Feedback $win [mc "Schema-validating document"] set schemafname [GetFilename $win $w.validation.doc.urlentry schemaurl] if {[string length $schemafname]} { set schematime(start) $time(last) if {[catch {ReadAndParseXML $win [mc "schema"] $schemafname ? schematime} schemadoc]} { # continue } else { set time(last) $schematime(last) Feedback $win [mc "Preparing schema"] if {[catch {$schemadoc schema compile} msg]} { Log add $win $msg Feedback $win [mc "Preparing schema failed"] set time(schemacompile) [clock clicks -milliseconds] set time(last) $time(schemacompile) set dodisplay 0 } else { set time(schemacompile) [clock clicks -milliseconds] Log timing $win "Preparing schema took [expr $time(schemacompile) - $time(last)]ms\n" set time(last) $time(schemacompile) Feedback $win [mc "Schema-validating document"] if {[catch {$schemadoc schema validate $doc} msg]} { Log addXMLError $win [dom::serialize $doc] $msg Feedback $win [mc "Document is not schema-valid"] set dodisplay 0 } else { Log add $win $msg Feedback $win [mc "Document is schema-valid"] } set time(schemavalidate) [clock clicks -milliseconds] Log timing $win "Schema validation took [expr $time(schemavalidate) - $time(last)]ms\n" set time(last) $time(schemavalidate) } # TODO: cache the compiled schema dom::destroy $schemadoc } } rng { Feedback $win [mc "RELAX NG-validating document"] set schemafname [GetFilename $win $w.validation.doc.urlentry schemaurl] if {[string length $schemafname]} { set schematime(start) $time(last) if {[catch {ReadAndParseXML $win [mc "schema"] $schemafname ? schematime} schemadoc]} { # continue } else { set time(last) $schematime(last) Feedback $win [mc "Preparing RELAX NG schema"] if {[catch {$schemadoc relaxng compile} msg]} { Log add $win $msg Feedback $win [mc "Preparing RELAX NG schema failed"] set time(schemacompile) [clock clicks -milliseconds] set time(last) $time(schemacompile) set dodisplay 0 } else { set time(schemacompile) [clock clicks -milliseconds] Log timing $win "Preparing RELAX NG schema took [expr $time(schemacompile) - $time(last)]ms\n" set time(last) $time(schemacompile) Feedback $win [mc "RELAX NG-validating document"] if {[catch {$schemadoc relaxng validate $doc} msg]} { Log addXMLError $win [dom::serialize $doc] $msg Feedback $win [mc "Document is not RELAX NG-valid"] set dodisplay 0 } else { Log add $win $msg Feedback $win [mc "Document is RELAX NG-valid"] } set time(schemavalidate) [clock clicks -milliseconds] Log timing $win "RELAX NG validation took [expr $time(schemavalidate) - $time(last)]ms\n" set time(last) $time(schemavalidate) } # TODO: cache the compiled schema dom::destroy $schemadoc } } } } if {$dodisplay} { Log add $win [dom::serialize $doc -encoding $state(encoding)] set time(serialize) [clock clicks -milliseconds] Log timing $win "Displaying document took [expr $time(serialize) - $time(last)]ms\n" set time(last) $time(serialize) } Feedback $win [mc "Processing completed"] after 2000 [list Feedback $win {}] # We no longer destroy the document, since the user may wish to save it set state(dom) $doc Log timing $win "Total time: [expr $time(last) - $time(start)]ms\n" Log view $win start return {} } ### Image data - end of script image create photo libxml2Logo -data { R0lGODlhtABEAPf/AP///wAAAP7+/vz8/Onq6aSloQUKAjE0L/v7+3JybC0t Kb29vWJiXJSVkTQ1Mjo7OJKTjt3d3YuMiUtMSpqalff394mKhuHh4fT09Bsc GtXV1NLS0ebm5tDQziQmI8nJxcXFwOTk5M3NyUtSUrW2sfPz8/n5+GlqZtnZ 2UNEQZucmf39/fDw76ysqfLy8g4ODbm5stnZ1YGCgMHBvdXV0Tg5Nq2tpMrK yHFycAAEACwwK/L18bGwqe7u7gACAL6+uba2rWxuahMWEURLTICBfuTl4jtF Rm9wbfr6+nR1crCxrcXFvCcpJGRlYoSFgsnJwejo5rq6rKGinh4iHQIHALm5 tWpsaWVmZNzc2ubm5FJSTVVYVs3NxhEWDuzs683NzHh5drCwpb29tXx9eklK RuDg3mFiYPb49Xp8ecLCwH1+fKmqpe/x7nV3dMHBuO3u7K2toVpaUcbGwxQY E3l7eGdoZlxdWX19clhZVsDAtHd4daGhmYKDge7w7n6AfWlraFxeXDY4NPP1 8lpaWV9gXebp6mJjYXN0cEBCPlpcWlVVUfX29A4SDCgqJ6ammlZWVFpdXVda Wuvr6ff69ubo5vPz8uvs6paYlIWHhL29sAkJCdDQyoGBevr8+MTEuUZIRBgZ F4CAdKmpoo6QjFBUU11dVPX19cjIvqSknoeIhVFSUE5QTK6vrFFXVfr59+js 7fHx8ezu60FHSQsPCV1hYL6/vcfIxW5ubKanpQMDA9TUzgQHAT0/PLq7uYaG fC02Nn9/dgwMC0lPUCEkH+Tm5LW1qYiIf4SEeSUqKKmpn9vb2M3S1J6fnNbZ 2uzu7uPk4QYLBCAlIwYGBry8uJ+flfz7+AgMBvv8+fv7+pCQhltbUqOjnOHm 6fHz8NfX1be3tFNXV3h4cd/j5gIFAODi3/j799PT09PW1AIHAtjc3czMyvP2 9rO0rrOzq9vf4MzMw2JlZcTEvu3w8W9yb4iHg8TEw/3+/Hh4bTA6OqamoaSj m/b6+pCQjQIIAAIFAoCAgCH5BAEAAP8ALAAAAAC0AEQAAAj/AP8JFEjk0AQd uQIoXMiwocOHECNKnEixosWLGDM+zKVjwiEiA0MKVHNAo8mTKFOqXInygBqR Aq9oCpBLFa4vKwDo3Mmzp8+fQIMKHUq0qNGjSJP2XPEFl6qEmq6IHKSQyQ2l WLNq3cq1K9YbTBQOGohDIY4KXtOqXcu27c4KZQPg+EcEVIAtQAUIWDEAgd+/ gAMLHkzY74ABKwS4Xcx465YAoIgcCSCNg8+9SExUwFDChefPoEOLHk26BAZT FUwgbsy69VAO0gIcmRBgkM8VCExgYOGFAAcOIYILH068uHHjvwn0cJF6gGLX 0KNTneAhAK6lSCqw2EAkxZwu4MOL/x9Pvrz5LgfqVCnD4Q0G1c+jy2eMK4CH FwFQ8BSAxJQXZruwFIAPA/pgoA85JKggggoFsUwZBJSg2nyLCXAYAojFp5OF fWGooVIoBIBfALDsZGEFb8wTQA4BCPEJHnbEGCMhhAAiox2J4KHjI4qoosoq q0xAxicppIAIIrzw8kANgQSigxAJBoCMBhEQgAESH27IFxJccnlYlhT2NIAJ psACC3PO7TQAEou4wAIsFSCRU1awMMTTCibAksaKu3xiASvTgACCHLZ88ME7 htoih6DxzODGNL1UQQI7SrDSAi4FFCAFMypQcEkDEGCCAx6BzMKiBOZc0EMF A1w25m49vP/xRg8slFABAnOG2RN/5oxiBxghvFHBnLwyY8UEIXhhSqta2amm KSGUtIsh+fxgiSvVYNPJNdx2e82210wi7iRnnLHIIqYIIsg6+5h7hiB99NDH G6+kA4EZEzCSgw8keMNBCVjuigQfaqChx8GY1BMCAS6YkKuuOq3AwS1maXAB LMwKUIEf+NWgSwRvmLCVswDw54IKA+Ihyg1n2PNtNTBX08nM5dRczriTXFPO ueoKcgYl9VRKAjnd9GB0D/K8wooZiFARwB9flNGDw0tV8EUGCh0xWQBEKBOC CwjoJbZSYoOp165n8zRAJVkodIIt3kiCRMSLQPFAAA48oQEHaDX/u9BOePaw RQ7QOMEOC/a4gjO55Zp77iLqntGHN1jsIMgOO5zhzShjoDGGHlLIGssrhRDw CiUyqGIqL7ZgIcmwu9Z9dwDZLBFWAErsLWEFpqBmAgKZVYBu76hVYLwJJgTf e3OHZcd7akgAr5nvGK5ZgRdlKNTEDx1AMXfJpmRxtwNucAFyasgbfzzySKT5 E8krVCCJA1SAQgENnZT7OM89qwu5IHWjABFkkIYzdGMRH6CHGmTABz7IwAkR cEYhJjjBV9jCDFPIwTDS4A0oYIBZJpKdQoyRhyso5AofUIZyWtALAijHMz2Q BBR+wwEoEEASR2MBC3qwgBbYcDmVgMUX/wiAgipAwQsscIEQW4AC5VRCeC6o xTdioBAGwEAdHBBZyRZRhLsdIA8wUEEZoIDDN0hCEgTwAq1g8R4Q9oRkAzAF AQ7gAyaIwhLv6p8eLbcINkDuDN+ggwzoUADMEQACY5CBImXghwZQ4hWQJB03 uCEONTTCB1Ooxd4+6JNFiE8hx4hCE7QXjw3oIQN6UEAGIFCGIlhBIS+YXQCS cLUA0KEIuMiAAurwgiSU4RkaoEMAeICfJmDhGbbgxQva8II6dIADklAGLwJw hU9UEQY3yOJbPgkK2oiIFVgAAywhMAPaSMALAAMTHDHAAQfUkQdsSJcee4Y5 NlSBH7Y4AxsosP/AMRSADYLoBRoWyQcnEKEWznBHM5ZxjnSIg3QSuOQUFqA7 BPikAnYDZRTIoJA7uCEIATBEB0igEAp4IwZYa8QTTqAQMXBBBY+IAStEFA8u BCIAEmDGiByAtQBs4gNYo8AmQGoGynFUEZsQwzWzqUUAVIADdwMFHLKBnxds Qhc1ENE7RKCCQ0QgWCZQ5990MgB2upMJSmDDDrrB1ra2NXO1ONgl2NCHS4yB CHRgxQ4IYFcG8gENZjCDElTghDGAIQl0GAUuaiEDBWByAeb4l0V7gtHZlQKk 9olCMhQCgSe8oxEByMA7NkGxADjCEW7zhBUkoItH4O0U1MBPCrhgAYX/JGCU B3jCGBRyiiiE5QUigIFCwHCKUyxVmzp5qhczkQdtgPIJwgzAMZZgBRJ4bWpi VYiaSsABOjKBHT3oBhvYwFbyknetgigAGNTgBHIsogXrpYMtBIEFJzjQIHMI hhMaQAc66OEQR7DCFcxgiCvQcaKRLcFkeVJZhXyCDDoghA3yEA6FZMMTp9CC QpJxCqUGQBHFqI4HMjGI0Vb1ACg+wAme0ACF+KId2RDDKVKgkBQfYBW6tbAn lnDcpio3AAeIQh6OoT03LAE/E8gDIm6AAg7AYsFvHCsAEMBd77LjDXTtw3i3 bDl1wVcNfMDCIrwhgzYUwBI9iIATHnEARijE/w8FcKAaDouDANfBEE04MGQl e9GMShcOPIBBGj6AWQu44RSYNcahaWy/YXAWDyDYRI2jUAwSTEMOH2ixdG1A gnhs4qYBoDQQLv0OzErAyD1+C1SBnAk3QOCablhFAIKxBzzIoYmcfJ+Uqdzd OrJDjUc72g68IQWW2QIMaHBCGejaAn6Qow+v8IasFWKNMeCigTKYcxLqbIU6 NMHAj00wlJPr52OEoQq20IA31GBbNzwBs9T4gS3ooRAdZKPGDYg01kARBRjM 4AYb0AUFXMyONJgjBopQCDWi8IMP6KIDpQUGhqtYhQ8g16mr/uISNB0OGMRj DwrhBT1AgAUWNNUnJP/jtZUl8YZYxEJWb2ABOUYxD0w8gw3sSAIELMHzGb5B GTMIQ2OnQIgG4EICmJAzne38bT2Lu5NZyGoAQmGDGfgrBL1QSBzycIpXgoId MxDBJvDjgWLoADIeF4EqRujvGcggBgMPgC9IcIMIXIAIsBbBIWgQ9617oook sEUIKvCcp2ZV4ywNRj6m8YFNYC0YQEgDFjAWlJRX2ddQiIUlCMBzS0yOCGgA Qy0EYYlvfCAWnGcDB0TQDlGsgQdrKAAJpCABCyQ920vvdtPDzef9hE/qnGDH B0JQiR6UgWIvaEc8wkKPb8AtBoQIAAOKwYAA2AHdGyABfoJxhFEEghkxkID/ QsJRhS8sTBmglb4ECHGIGICgqgkwYQA+YQbBEz65HMiqB8TgCQdInwT1QAMx QDG8QAJyEAEY8DBRpl06oXK+RgkEYEMuxHl8pQdm9gaeJy9sUAZScAITgAg1 8CJ8wAyXAAGjgHRKt21MB24I1nsmYgreBBlHsAEEIDxQoAF/8AIHMAig4AfT kAYa8AwXUAUBsA0wAHLMkAYdgAIxUAB2ISJ0oAE6pRDB0ATP9AYXEA/+pxCA oAHKQAN0sH0JAArBoAjMoA6DNycVQAAPcALdhAgv0AS9MAMbcAFDKBu9oA4X cH9AYXm9hlZZAAWUQAkSCAU9YAtocARnphxZUAsW/+AALNIQ0MALTkABJ3h7 2sZt3saCe6ZgS2EKHEADM/ANJGB1koA8sHAB5vABo6AC8VAPN6ABIcAbZaAC tnCLzGALGxABwOENtkABFiBvG6ABHSAH0/ANQMgwkhAB6oALFqAEcmAOWIAF 5lAFEgADMNAAJFAF9aABNfgcJvAGUqAO8SABFBAPaSAHdfgGUIAFjZAPIBBZ J4dyu3Z5aPUMHDCI+jiIlmALDXAD4yUHhjALCtEPBnCQCOk0c5AKEGB7DmRY 2xYEupdnvOeJ+4EiZWAO6qAO/vJkY8ICIfCFG2AO3sCLcIIBXhACEYAFK/lV knAmHIACHXAD6kADdhcBxP/YAd4QAie5jBtwAwDHiwTwDN4wkx8AlDrJk2HT gNz1hR3QAeagAVgQLLAABV9QA3LwBRHQA25Ejww4ZfbIA89QBGNZBGZpllng G2/wBVaANTmwCwgZlwgZAHhwCRZgX34AkfMQBH/gbRTZghZpIghgCm/AAXYI BSzAKnthAi7gBcBRQz1gCnKCABUAC8GWRHGCBCgZAmVQBgvzBo4ZHIjJKpTZ AxzQmQvDRrBAAJwZAWVwARxAALAwIRHDmKEJmxzgBZWAARswAS9wBLHIARgA Jjvhh95lA7zIAVlwlsSwnGOpDLThA3I5nQdJlxSQCvalBnRwWHvZl03wl504 bgD/wBeagQEY0BzPYSHleZ7wUTJ9wT5e4hzqaQqewZ7T4zvyuQLZ0RnniSG5 YQqdYRqpgSv7gRvGwxnsSZkzFQDjiAKnOBTG6QPvCATx0AHKwJIRoAwasAEd oA6AEABwSZ1ySQU+sF+Y4AS4d1hHEAQncAV45nQuSDZjcxlCUTZGMaMmYqM1 WjaKoTHK0AZqoA51SHlCEaGNUAA2YAM8QAK98AO14CgzYAsqkCAiKpe74ANm wAoOSQRz1gaaOGDg+XQQM6YCYAI9cAEoUJI1qIBeGQA74YCNIAVrYANh0A7s gI3TUAu18AGTUaVx6TSk0AujgJ18AHrcyZfeRmAwGphr/8Eh1UOcrsEXhpEY b4qSvyEJjNqH9dhdOcAEe4ALc8oDdkoC2Oik1uSn1YkOeNACdpkKckYHbZAE e9miTRBYOlCR4okUe9EhzUMmsLBDzLGU0WEh2LAZO4SZIDQm9MkcckIUxpkD HqACqJAPcxoGosoO28gOjuWnLNIIDcAODWABd1moEAlgLHoFTUAItHCrgCme uKEZ6qM+7ZOelFkJOwQLlVB8KJAKD9AGzyAsbNoYr/IGHwAGClAAHGByfFGs JXCstuI+lbepBwCtFCAF+pAPopCk1toOJNAOgSCd1BkgQgAGrgcBteeq2RZ6 KuidZkAIZsCu4bkrlAkLXgAFM/8Um2/QMMwymKwwAYOQBhdgC6ugAAsRBHXI Al3ZGAKAACTAC1OwEA0giw1TmV6wBrgAAs+QljpbpBILrZfADMywDagAqklK p0DgWtRJBbtABhBQBZcwCic4rkRgWF66oi1qCC27rri6FCbwtEryAA+ANQ1g JRalMV+wEBmwCTcAAUSrPab4Pa5Rph1gASMSABZgC8rgBS7QswyRATgQA/8K O5r6lSoHrQ1AASrADHugDwVArWuwBjkHolbqA0kAA9sAAQ3QAKNwoqnApf4l q0fgnYZQI4AAs2L6LJKgBwyBCCQQNSyAJSuAAbu1EBIgAjSQAAthRd0Dua3B HyzwDFL/J10/QANFIAG9pAKlpRBasAkgE1aj66ZMyakeAAGXcAmpG7b6gApj awOjMAtUEJe74A9BAAOfwl94UAMeoABb8FeHZa602rKQAAnGG6PjKT/bwBBW ZAsR8GQAsDb1QYWiIAe6gL0KUQrt8AUX5xoD4ALkEL6hUAUdUAABwAwbsAlc gFkKcQh66AJJqxPPOgyjkLuXgLpgq7rbcLFrF5c5kAEFUMBO0FMsspCwegjd mag1kgiJMMGZWqaScMELUQo8AAIRUAKtsgKV8AwJ8AKgcAjsYAsj/MVAIAIh cCXtcxgXAhh2/BcZohcrwBd9wSUY0sd/HMhrA74LEQrYRAaP//CUT+kGDLF/ NCA37/umVaZBFgABuFu/Q6wCnKwCUtAA1ZGQXSABl8APEIAG/nuQPqADDRCr 8xBgD0wIkIAHg6AAOdCuPoEEXcwQcWAD9bCHPbqGMfAEYjBqHRADhwDHXIAF ZBRzlQCglnk0sGAaQZRE56k8JdAZsTIrlYAuLhAry3Er4SNLiPwBLyABHbAB KPCFW6gQPHADgzfJ8TuxU5AKcIu7udsA9UsB/CwFdYAgB3mlq0ABuWsGuxCi AbAKo3AIdcaiVgwIkbAFkdAItxyzYtIDMrwQcfDOyBU/b1AGugABJ/ABMYAF SbAQ2hAFTqAID1AHM1AGGjAGY2C1Bf/QBnpwa2qgArgABnQgmy7wBtNgBWOJ CxMwAcr2DFBgC1bQ0jNwAVZSAp+kEKEABHLwAt8gjbFZBuEbAKKQBmXQN21K yZw6BU4gARJwz/icz/pMAQkwCyC7CzmgA6tABnOA0BnAOThQxU0wvLKMB1sA DshQ0cerJhjNENrA0SKztBggCQWQVQ5A0ia9EApQEgwxBjTAD7IUACmgC8rg BArxCMzAHrZAFQFwCq61EIqgCzJQuS+QDzFgiFEdAMDQDiBQBSjAi54RdQsR CPng1WC9gPALlmMtA6kgrmYNt/xgypiMuypwBULw1gQSAP9rAD7ACPv1ysFb By7ashC9Ba3/0AoUjcsXndEKcdhMNZ4mQASNizelpAzJrBBzcA/AULkBAAFc EA+VywunIAIgYEs3MJOkrRCgsApBULlM4ABB0M4OIAfKwAHPIEt3IHxYkJtw wjYYLAr2J8/CTc9+4AROgAnFbQFmfdYjfoINoAaO5gMhepBO8wJjMAp5LZGx DAg5Ag6kAN6CTcEdXNgojdgdXAFqsN4HAAMigMwaHQZREHc15m7RNULUlQJy AHCsgAcYnAme8N6QYeVRULk2EDVlAOHsoIeJiTwskAqSTQ1K0AEEwL088axT MAYOVFAfngohLq52ngr8kAqqwATQwBCM4ABEcAnYbQUPDMF+3Qoj/0AK4W3R asPj5e3jcQQFUrAQOtAOtkADWB4HcAADnoAIDEENh9bOwxAGoBDCS1gGygBq U1cMbnBvCqEAxSBj7cwJ8RADEQDmKMwqA3A9sxMMDZAPtbDBPQwAz5oBYOAH fjBADeThzH6izF5QEsAPY4AHSTIIDcAMkqE13YauLSvLEY3oIzACgS3ejU7e AWDe2hQ/UAByr24DIKALWK4NNtBwOBwAnAADIPBqCzEMj8B4TQYFWr0Qd9AO M6BpAaAAcCAGT9DOwDANNIAFYN4BktAqa7MGVGgM+fANNOi+uka6lZwBbYAG aKAGajBABNVAKL9IXMoH4ooJEiADALaiff+Jrnjr7d5NCiMgDCMQDTmeqTtu 7uguMvFDAJPe7u+O5WAswijzxTAgB1wwbRYGA19wAUpkyB0FBE+g5AjvBiKg 6ncAwzEQvhEu8YiBIkTrAfrAaXoICwHT8cFdup4LBnLvOSSvBsjOQDJABETg B3avnf2lB9uW1zL/B7EMCZHg1zgvDIrP8+RO2EDP0azCJrts9PD+xe1wAzHA 7uXNDjegC0DAECcABGhoChig2x1F5Et/8GHw7mIPA8cs9uzQAV7gF5UgTIjA adOgDjPAAVvr9mI9sRlwBEmQBDYt93Qg8n6ABnXwB2jQBsdfZ3RwCITwB20w D3/wBwLmolvgI4n/YPiIn/OKLwyMz+iOb9gcjRoQYJpFf/DuXvklzAPqoAzr HwBxcPnDzBBzUAxyUAamABCLoDwIUPAODBEqCgZQEAaErhoLD3aIEdEgiQ1e kFT48sLMqRm2OqgL8MyLCyQAVK5UuTDAygElOBzIkSHIPByHkiRpowcMnRMK AtVos2oVJl4p9Dh40EhVEgeEjvDC8SlDDV6EIuHZ0mrECGHChgyJlmPKAnMc SiBgqXJAjwIutfG4wYEFq5Jl9ixUYOPhoYWl2qlTJsXlPXZfsPAJ5JKBG289 Kg2UiFBhwYYPLQaYWFEiRkmLWPA6tOkDFxoxkgTQUEZShbYrXcKU6aDm/4kg R47Mw6kTjAM7BSRIQBTgBC8yZPBIIcQEzRxEVxipQfQAzbwmW7aQ+hp2iCyy ZtGqZdv2bdyFc0WEkGQngLcYlxn6pQG4oGARWJwsDKavyoYOMmCHDP7CUCeE HrIgyCDL+HIIosoo2uwOjAjoYQwydOHinU3esc8WGkLAILaWFoIJg5lyAOUK K6wIIjfd5glCh1H0+MSQFBp5IJBPaghijCt0AAOUKVIYJ4hVrtoCEHBI4c47 WaIs66y01optABbQK0gbIDa5gIYXAuBCFwoclKO+wLpUZrWC4oAjHg3aeGQT OFxSZAYUOChiwQBCESMhMyEsKJT/lNksFBg2eP9mDZcaDQCGDyJwgUQAZnML AygC2YURQk6o44Q//nDxRR1wSIKXVT45hJAAVnnAjjHsaMSKT1KYBRFVVKmB jiO2606sKI0wYg4qhllAA/Jiw8YLVFyKo5gPYrDPkycacDCeDRJIEzUFCgqG gnZsYZSEd06ZwKU9bsAigkNh4KJMzBzaZEKEPBsUhk1ECNPRhWyYQZlJSbQU gAFMISCIHHaZoI4mrriijk//CGKCKXgZRpVPrHBimE/MYOIBIVYZBJAmHjjE gy3m0MGpJ4GVRVh8oMmBjBm84QCDAdoSwAQC2MQsmVO0LSiTJYxZCJQwZtjE jIV0AOIJeIMxxoYf2mn/JIB3PngCApcemGEDb+j9AF6Gwohn3oUScFeXqwu6 AoZ3PuHXpWRmwKIESgdeoQIvGM1BgSaaMMSQwB2+4o9HUJVgizHGAOSENhR5 ABB+VknCEDrm+aQOXh5IgZawXBbWCGSoCOCPelAgwJScWdpbh7ldgqGOfQsC 5RARAlkFDoJ4sSNMMvSxgZkUFnJgmgYyaHSCNtq2vQF6lF/ok3iK58+Q6Bs9 oIXYvV1DjjJMydtElXZmoQymd2mE5MEDd/8WPfyY54ogGsbujyTAuIIWeCCp IxFaAJAWkGgFlF4mLGRYIwdzUMINIuCFCqzAPBhYwxriAQQ4JMMGJPiBCixA /w8IfGMN/HADDGxgASeQ4AtHaMEPYACBJtSBD+yoQhV+cAMVbOAGVeDHDWbQ gAvagBqcsEALGtACMfCgAURQwg9QAQIYhIETEABBAaRQNRsQARXIQ2I79sAJ IH4gHjDgQTIccUZH6EMfovjGBjgAG4GRDwACQIJM6jGLHPjAA8oZhB0SkQg7 BDIRgwAkIQc5iEFwBRxNUkSuwCKW70TpgEb4xRR2YboG1GIDIWCBCQRgngpI IgIdkEMtapGGD6jjC7aoRxpEYo5VziAkHUCBMjTQgRvkUgS5vMEXvFGGZ0TA GxsAGxZQsIEPzOCUH+iAOTrwgTSkQQ4dgA8y01CPG/+YAwUaUAcIpPkFDQzz Bmk45Q024ExbpOEH02DnNHqxgHps4AKwKE9sXAILmFSgB2VogcwSxog5BFSg AyUoQYVwUIQitAuMYGhDZ2EAKuQgALfohboIgAEEfNJ1JnABAS5gTBSsKwIR QEFJI/CMEFyApCg4KQcIwAEOPKMMZRgpFsrAAUmwgAWS4MAFLuBSKISgDCVV hk0vQFMsrOunHBBqUssQAqZ+VKkhSGkEjGnUlJYBpCUtqU05AAsTSDA2sChI mFCwEjpigABYYMYDDJAwKsRVrnOla13tGtdd5FWvuxgHFTwwhl7YwmadFCtL BDAAE5jCBbBg7GJhwYIe9ID/BbAoQQkcy1jKmsIUFVAsLHrwBha4oAImQIIJ KmBZF2BAs5ZlrE4n29rGYgADrG1sZS8LCxdc9rUuqCxqc/vbEmwWAYVtCwoC 8AIPBAAXG4UFFLDwBRUAwgE6oG51rXtd7GZXuzqYACZIkAZ1oABBFcgopQRw Xo2idQXrXS960cte+A5AvgNYQXrd697yCWAF9K3vff3L3vsC2L+UInBbcBEA D5xrEIZFLCwIUAZvdICV5DRlhS18YQxnGMMzcKU6NBABDvSgAkggboFNfGIU p1jFK2axSgYRgAkcIQDS4ACDTVCCN/SUpN7whgZ8/GMgB1nIQw6yN0J6U0nA YsQl4G5xk538ZCgTmAPSCMARiACKAGxBZwPYSAlY4AUCQAGmYyZzmc185jND gQCS6IELTGGCAaQ3ynOmc51TvIUAgIII/8BBQXAAR7Ry2bSmkG2hDX1oRCda 0aodLRLoK2c7R1rSda5AnwOAg39k+sUBYMINYnPe9c5X1KMmdalNLer+TlrV q47yDZhQkEFkWtZX0EQAcqEKXHyByazmda99neIVfAEXqshFADRxBVknWw0H 6F6znf1saEdb2tOmdrWtvZADqCHZ2ybCISagg2JfW9zjJne5zU3tXHD3EHtO dkAAADs= } image create photo tclLogo -data { R0lGODlhYQCWAPUAAP//////zP//mf//AP/MzP/Mmf/MAP+Zmf+ZZv+ZAMz/ /8zM/8zMzMyZzMyZmcyZZsyZAMxmZsxmM8xmAMwzM8wzAJnM/5nMzJmZzJmZ mZlmmZlmZplmM5kzM5kzAGaZzGZmzGZmmWZmZmYzZmYzMzNmzDNmmTMzmTMz ZgAzmQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH+BSAtZGwtACH5BAEKAAIALAAA AABhAJYAAAb+QIFwSCwaj8ikcslsOp/Oh1RClVSu2KxWAu16jY9IpGrVms9o 9OPLJqbf8Lic2/7K0ZN0IpG/p9dGCAgPZBSGZ05+WRADBmcTA5EDfYqVcomV jJNnkpGOlqBvmIqeZwaSBhOUoaxZo3eaq1eQkbKttxVOFIqnn1qnm7jCV7q8 AxBmscPDdEy7frVmkQnLzE5ld43JkdXDEdek1L/BlhKE3VffTdhy5LPalRIF APQABOhP7HHuFQnHlRHqCbxXLR8vaQMqHRAIYMECeg8KRjmYBZIvOfPoLfiQ ouMJBwEkNonoRxyWU7bSEKjHsaPLFBn0tXpC8o4sbncWNjTxsqf+hmU0Fa2y mJPehZ5IT3QYBoWVv5RmAgLAgBQpCaBPWJ2aQ69lVZcollFoGgoenJVUv7o8 Ua1Zk1CQTKZZeFSty6XL3DIJxQjZGwkN7bq8amkCnzOAXil6ehYAT8Fh3xg2 IPeKv1RaEr8FtfXNAwBe7cbxNw3hxQobPnxQDO20mQAMBHckDAeYa9JaRvRc UtZ1loWP7UYeXVoLLS0odispW1kLgLqCPdwh7VeL2SvJXZrgXZhfls/B1dIm 7r0CvxMvQXCvBAlqBQKxIZ+hYuo6lgmue65e3j0NYBCy4VUBBQ+sBEBIZpzS XD+2KKeETHFAkgYCAMgWGQUMMASATNH+mGGLBw4mASEc+KmUll0joJBdRyBc AJFx9r3RQYhIjFhbGgAAKNtXAQCAgBaMLIjGjNoxYeMbQgK241corHTAOO6Z QWRH+ykRAShQPbDAklV14KR1vqVBwktNXLnMASdy6VIFL95XnphkMmHmMATo qKZHFNDDjj+VrJhCmdUQEJ6aI0j1zBUDCJnGitsxUZMwAdz5UgcLEfSOJSuq t9kw8UmawnsAPInFHpag11FWy3R6Jwp5bphFmHDEuakwaapJwmcIzqLoG7Lu tUwGnqbgJQCP7sqrS6gOo0GwbAJwaAVRpjFlo7PisoFag76Ewmei3jJllb4O c21VJmQ72Er+w4x5arLCTPnSCaEhxQGx6SLLLi7udoQCCbX25ICluOi2Lmu3 WMWvWk0eWYnAJ5C1DFIdbNCvSxr8uEx2JTjMyqN+fppBvC850E124IbLygHd +hkWAyV8Nd4w9t4LykoWCzybB45VNVw1MRNciYEMpDhpBxVWhc4VPVc7cz0b veRBBAp0eXQFHVHrhIChrATdSxU4sGVPI2ShsCJEavoE1kuDHFYDW3e01AEE xL0MkV6gbclKdoJVAQNtr5Vht/gOLPPdOfd01VRqbQDAnLio6wUuwEHM5sQd OeDqMDM23AXkRffUwX9qoTt3ChlvfstCVXkAelUn2FPNjCUrbcn+Z6ZyHVDe L4UQ6ut/Pn7LZx1/Ct5XGtDLsx23AGazvl0XjlQGi3fTOxQY4KJ8T2FFXpXl Y1ditRMhCAPAuHpnaG4K3Hdj9hPh47Ih2Ht3jtRC+HjxEy4ERAD/SkzS380X 7btF/vYnv5eM4DP160IAW4EyP13lIS4DTAKhsEBWROAAy3tgAe/Cpu4p4gs7 Y4UECKCu2VQAgqnr4P+8EDZhkPAlGvxKBSS4wi60EH/uimFSKlCgCT7hhqeT AAxPuMEUhCV/PnQCEFsRgQcMEYVgG+HRvPCBlzGwdmGD4qQK4MFKaKYJJbDb yVaUxSLS52hfZIIJxBgKBNisjEgZATb+uniHNC5BWHkRgd4sAIDadUQ6MyQA HefQBTwuY1nM42N4UCABuOmpG3phgiG9UT7n4bGRj2xLIdkYCiF6pAIYsGQF OkACFIDgcnmBAkc4GQquhbJlVTnlFJ+wSuthY0XNw51LQJArkTSBJ6y8A2BI siIPFE+XHcEAwLDihI7Q6UAO8ErEQPOVBgCOmU1wpjB0kqZpUo4Aj8KmJD81 DADAcjBEmxgKnDXLZpJzm20bQZ76loIN9NKX4xSLJcPikO1dU5xKaEk1tPSu vUUNewEYpB+eAKAQ4qIAaWoeUjawTHwqgScOxZ80aactQU4tF+7MKP50RALA nDMFIvinRZP+wLyjRTMFcqSmS0T2UZBm04gfDQEIwiJTmNb0CggIaU1RwBYC QOen6WhCS0S6jLAV4GtLnJo6lqAjplZjIR0I5jKmqgRYWhUUEArIs34aySMM hhmfKcB8UInUshrhrMsAgFrPED2kXsGtRYBrOedqBgJYzK54JYJexebRSsgV DQfgq11vmgIrViAgCj3sGSJQ0ZoyQZpmkIdc/4qFCx4gnFeQbGYBYFcsMMFO YoSsGeCWjoqK1gxs/akaORiV2AKmDP7Lwmu1AM7S2pSltNWCan9zOQrIZLe/ Uaxs7xjcLAwXC/M4EnKxQMPFMvePk43tQrAxVjYp1zkKDcU4tVn+W30MEwv/ nC4W/FraJYQGDYAhwDVHSIgDsAOT8p1LZduJhLz5Z0RnLMd+k1iEk/p2vaW1 4xD8eOArqBSNSuhJg2eY4AhzbcKlDayEMZdVEpAgqyDW6tE0fGE5gNjDKSJq sLCnohaP4MUv9rCMPxxiTuI1NMPxwIlLqSI/rvjHXILCSY0I5CIbWXCzPbKS jwyFJTu5yE1+spQ9FeUpW3lH37vulbf8lSxbGCkluMAFdFkCBjStJxhoGQZ4 kuaeiLlWLbrAkE3w5p6E+QIgK5ITkJmCDyjgAwU0wVROWSsMUGUqrfOxOQf1 gQWEsieCLgGjN9JTOz9hyC7x8yn1E5/VRtvZnA0BwddeMpV4NdrTLxE0BnDn aVQjJXZJOB+gGRAvDHT6oKSmNQBojRTQsJoegxL0B4bc6lHr5wlqcfVLSgCa EiigXy4yQYZ8nALHTNrRkF60fhbgbMrBGglqAYGqXgLo58RyS6KuigIUMO4P XMAECggPvNmtn3VTrs/I5rK+q1Llfft7epf9t8ChAIKCG/zgBi+XwhfOcIUL 3C51iHgRPgACTO9b4hhPAsXPt+SMe1ypIOA4lT9OclVKOlglT3kbKi5yJKv8 5V+g+JBhTvOaGyEIADs= } Init . tclxml-3.3~svn11.orig/examples/tcldom/cgi2dom.tcl0000644000000000000000000000221711113705304020533 0ustar rootroot# cgi2dom.tcl -- # # Turns CGI parameters into a DOM document # # Copyright (c) 2000-2002 Zveno Pty Ltd # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: cgi2dom.tcl,v 1.4 2003/12/09 04:56:40 balls Exp $ package require dom 2.5 package require xpath package provide cgi2dom 1.1 namespace eval cgi2dom { namespace export createdocument } # cgi2dom::createdocument -- # # Construct a DOM document from XPath locations paths. # # Arguments: # specs List of XPath location path specifications # given as location-path/cdata pairs # # Results: # Returns token for new DOM document proc cgi2dom::createdocument specs { set doc [dom::DOMImplementation create] foreach {path value} $specs { if {![string match /* $path]} continue set node [dom::DOMImplementation createNode $doc $path] if {[string length $value]} { switch [dom::node cget $node -nodeType] { element { dom::document createTextNode $node $value } textNode { dom::node configure $node -nodeValue $value } default {} } } } return $doc } tclxml-3.3~svn11.orig/examples/tclxslt/0000755000000000000000000000000011574742552016735 5ustar rootroottclxml-3.3~svn11.orig/examples/tclxslt/count.xsl0000644000000000000000000000160111116050505020571 0ustar rootroot The document contains characters. tclxml-3.3~svn11.orig/examples/tclxslt/simple.tcl0000644000000000000000000000071611215700771020723 0ustar rootroot#!/bin/sh # -*- tcl -*- \ exec tclsh "$0" "$@" # simple.tcl -- # # Simple transformation of a XML document, # from README. # # Copyright (c) 2008-2009 Explain # http://www.explain.com.au/ # # $Id$ package require xml set chan [open "count.xsl"] set styleDoc [dom::parse [read $chan]] close $chan set sourceDoc [dom::parse [read stdin]] set style [xslt::compile $styleDoc] set resultDoc [$style transform $sourceDoc] puts [dom::serialize $resultDoc] exit 0 tclxml-3.3~svn11.orig/examples/tclxslt/tkxsltproc-sml.gif.b640000644000000000000000000004072111113705304023007 0ustar rootrootR0lGODlh8AAPAfcAMf///84SB0kMDM6JGS4JCVZWVs3NzczMzNacJdOJitGR HsrKytujpNOVIJKSkpCQkJSUlBAODpiYmIyMjJaWloCAgI6Ojvfr0JycnJ6e noqKiqurq5qamqCgoMDAwIWFhaOjozMzM4iIiIKCgrCwsKWlpISEhKenp6mp qa2trcdqa7a2tq6urrOysrS0tOSiI7m4uH5+frEwMbq6usPDw25ubry8vHx7 e76+vnp6esjIyNypLcXFxcTExHh4eHBwcOKYHHRzc8h8EiIiInV1deeqKnJy ctCPHO3Trevr67hHR+G1Ne3NlfTh4UFBQd+xMpxiDtWYIuXBPevCO92tMGBg YMqBFPHhVasSCerNRocRC/rx8dmjKffuXu/bUcuCFfbpq5URC3gRDLkSCNmt atakUsd6EfDw8OG2d8yGIem5NO7S0ubEQOm1MtqlKvHUSrJxce3VTOS1WuK5 OE1NTbWKi5lpaqoYGeOdIGsQDPr04ezRSvTncsyGGO3TeOiyL/PlWFwODNWd SujKRJowMdOWPtHMxWhoaMh8EdfFqfDeUsqCFvTpXJJPTe/YTuO8OoBQC/Xn j9O5kMyFF/z48e3JQefGQeq+OOO9PMl+E+vQSM+MG9qmK9abI+jIQ+/NRMuD FU8wBnIIBe3US+WmPfTnWsl9Er6mheG3NqOBgYsHCMh7EdGTNOanJ76goO7L QnlmZtzT09igJzMgBeLXyJh2SObBYOO+PNGUKdCNHPPgwebBiKMNBMmAFKGR kerOR8ewsc6LL9zAl+S9OtObMuGzQ6EZGmRAC+fHQvDSSMqAE+bm5s+OMOXl 5ePj4+Tk5OLi4uDg4OHh4d7e3t/f39vb293d3dzc3NefJ9ra2tnZ2djY2NfX 19XV1dbW1tTU1NPT09LS0tHR0dDQ0HYVFaASC8p/E+fn59igKOnCwr5XV+Kz s+evLZkICezGPvDQRqQhIsqCILCgoMB+G3wlJciaXNXDwK19Iqh9QejIUJJ9 emcaGsuZJ8+OJqQJCgAAACH5BAEAAAAALAAAAADwAA8BAAj/AAEIHEiwoMGD CBMqXMiwocOHECNKnEixosWLGDNq3Mixo8ePIEOKHEmypMmTKFOqXMmypcuX MGPKnEmzps2bOHPq3Mmzp8+fQIMKHaqwCdGjSEGmu2M0qdOnFIFhkQG1qlWG CeDducq168AEd6gCAOa17FMVvJSADZDArFug6xKog4elLpZ2d7AweMtXp9a6 vO5i4SVjb8IEcFQkaNq3MUoVUxMowQKPscAEFwrKGMPrTmd1mB2LNqkOi7qC SsIWHBOmM692vDqr0DO6NkgZWFQMTIcbr26BTTwP9uya8GLbyDVqbQtgXd47 eccMZICF+ODOsDsrSc49oWGFF+C1/4XTGZ66sIwvAEuQQAW84nk7y0jXvf7A tA0v3BmDZXtesgDYYZlAS2FXnFj2cRccZcwpdB5muCWwjgr7/WYQWHW1M9x2 DDFgYYJXNaEhbGPQp9AaAEAGnXCeNVjQOq4JhgWA3lUHYlfpDDcYPHBkdtgd Gt6hhHuDuViQVDLmphADrGGxzo1XpYNXcZ09idAFeCmhCwPPGWlQaUC2thVC YIUxBjw+QgmVVK/F5pln6pho0DrpNAFWWFYCMOBXYQCW154AgFWenGo+xeWb bsbWGRwJKREYPASdR+Z7gXVG6GVYhHEHpIVaJeh1ir45hhLfESQDL8ylQ2Fn pU6XV5+xXf8Kx2BTpdmpodl1hiiQbsJDG2PpmJhaca0KhFaiWFimAmtC3srV BaveRVxs0p6p1aZGNTHrm3ckQJtBelAKJGUDNaHiHeoA6qxTa7w33GuIVucm h03whxejCeFmHS+nGRtYO/2u61VW1mkIL7X8NkUhmgpt6+Zge5kr2IcCeyUD cUDmNaJwMzbXma2aueYZbGOmhpe3Fb+1zrB19ZlhXfvFORmCBCVwsWBTwrPG BaV1hnLKfIGlYXV43dXOlHdQ2E6eAHBJF5VFAnBqi0A7RsuyLg+dIXFmPrkO HHTJK62umKVWnZdVv7UGkBqG0bbI8kFn73XW3UHfe3gVm/Zb6mj/LS1gbhYd WNbVMtrufvAwvTdf6fwrJNFUwo3dy/gCAA+lly7+FhxDt8Ubra+9PGVgSTPw rUBKcLapDIoxUKfmZvHXJ2NZkfwv5BlnnoDB8rIoZGiwV6WCpmNUTqBwQ7uc ZJwE2dmeDMqP2LsMoEkIcvA+6eemQfriNbTW7Wh6dkJrSJaxm+cjKgPa2OOU gGtGcpkk3bwQLp/ezccFhxJ/uYYXkChqH0+gg5dLKaFoU1JCa2Q0Opgp4XQM 0UM64HAqRSlJgDp5n2coRov4uKwt6+jby3TksvWpSyHpYEB7OITBm+iBV2NC jcHCQLMyCac17WBWXmRwwhYe5X11odh0//QVwHJBBjAwEwzx4ABBHybFUbDJ XM0CVpAmyMB70oJNEu+gOCcKZQONeJMoQhACJzihAAWoQQ1iEIMJOMAXDiCB HA0QizoCYA0MoIv07qKpzuRGil7cCQn+8Q9VYIeQiEykIhe5SHJURzCOO9r4 AtmTDTiBkAK4jigSGQEBCCACjAxlIgUghqEVZ4Z30AI9hkBGM6JRjWx0owM2 IEcS0LGOSaCkSAygSFF4TwCIzEObeBEIURrzHwJozb+KM5gwhGGTx4zmP4Yw hA3oMiMkuGQiCVA0VSByHwjrzD4KcEYzltEJ1KQmKBdJgEDUD3S7yhQwpXnM WFzTIkkIASNVIf+YeXITPhragEBpWctYGOCgsTCEQg+6AQdMgI10GZfBxhWb dqyTnosswD0pEosYEGCRQ2hEpigTA0zaBT4xaChB52jLWxoiCbFIgkLXkIQk XABs77xLYMaWCoc+FBZqRCM5naDPUNpzoxEZJCNT2ojB2WEChNzHxnjFC33E UaC13MBBSVDHhMYUpoaIaULbNbaxwcYAhlgDWg16UITGwgGhrAFSIWIAbSqy Bg4wgC9ENYEJDAGZgNEiL+DhgFmqlARaneNBX4rLmsL0sWs4z8G+Z4A1eJWt bTUAVDmJSGvOtSE1YGQIEOqKix3NDg69JDeVSRwlFNaNcqRlYrm62Jj/hrWm YgWbvG4XpK7WMbMMveg/IqDNCHyWIRsoaiKHMIE62tIXLiNsXwuAyQV2hhCy nMBAV2rLWHQ3oY41BAPUIabQJUlTvq1jWLf6V0RGYALrNMBxFULdRcYgpgg1 wHnwgtq+lhSR0AtDAR6a3Yb6gruZTahCU3EHVeTQbSMjGswIkdBb/vagyiXk BLTphPkihAQZJmQ1xcpWEowLC270byILwEZ9tFGWhd3uHBN70FTAQVPcitFI x9bcsHZ1vXYlJF4ROQEPG+S/iuwwbn9LAgXWxQ5wdGgMlBuCNbLxxYWN8UAR awA56sN70wocJAWTOJq+1Md1DO2KLYnIXBpZ/yCxqK8iJ0DTx8LUAMB4kwyi TGA5/wOWV+5rllU6UDjYIcyj29cd+sS6W8r00V3dLCKdMMv2xuDNAkmCcBFJ Asde1qB2IJprG/pQNq5YjVbuK4w3oF07tCnR6LPdYGRAR5mG9cy2TsIGFBmC wv7XuJh2xab/EQIS0PSrjDUopVBMav/GoL3/cAKgYwljOyiwohhLVOg6EwYV MACyj370S5NAAmgP1427JuSl35zuRRqgpu/+Kn5DnSVXzNK/a6RyDFAd6AmE sWjQCZyBeFUdhSYbpsiu6RoMwUtOstoBav6HfI0MV5DWurGPZTg8xDdQVbOx BnaNwL5hqY8CEEKLmf9SlMoRlkMV+MIQTTC4p2s67jP7+R9trDQhQ4DpUMZb 3mC9cCwGOkuffjziEVjjGuGRw+pkG2nTgg4c6ngBgysUt1eX6cKTcPMaoFvS RzVyxCcNiwl8l+Zd3WqXBfraUqtxxY2gx9E0Nra8jI3bQ2rp1cdt56/SPAlI JiSls9zeDmNaqcZ0Qht9awCtEp0ERt/3s6MqyZTzNnS5CkstG39QcUPazuNu t4iz7NDOYlogIT7mOdUoS7a7XY2EyEP4gvS9EQ5tU0/dvGL3XmfH2toQrlDk EEjvALu6GdOxwKgxhyBtNsKiEeGT0QJvmMT6EUIfkHdFVrvM+b3PPNzm/of/ oLO8TgfoRLPOZ30sc076wyKWxi1FKMJ9r6eW2DUEQCXjsOkZgU56Mg+iQA6q AGGEs2iNoA/oZlgIZksyF1O9lwQGEGLsV1j1NQQ5EQvhp3waKEoRkE5lVACe 9RGiZ1AkqFk1kHobqEgRQAACQAAEQFRnhEaSl3Nsp3feF25B9meqlmKItG42 EXgpGIT854MdcVFO0FYMR4IG1VD7VgAhkIFCGIXulWQ76EZyNnE14WcREAha kAde6IUCEAhh6Elk2EnDJYXSFHYbgXj/EH9oNla/1VUQOAEniIZ26F4+NX7r ZHg1UXHIpApjEACCOIiEGACBaIiFmIiHOAaMyIiC/8EafeJMqvBRIrZGBQBt Q6CGGqFcNeBW6uVbuJZeSWBZiNVXsDBUQ9B/dyhNIVCFD4VImhgTyWdSjViL g1GLuJiLhsiIAYAFgfiLg8iLiNiLk6ZwABBniXR8GuGHEZB2onhrEJhxdhZu saAHvodbpbhvRPWE+xeEA1aFiCRXNiFpWqA8fWIwnOFH1GIXdjEG0dGOdcEf 7OiIvhgYlBgCo0hiSSBpPMcRSZBI92VhoLhkoihWx+ZYD/hpvtVd7/daV9aE 5DRU2xh+LyZochaCNFFU++BMHMmR4VOObtORzhQ+iyaSJhmJKFkdZqIFRIZw uBRW/NgRftiGlpVetjVuuP8kb35nW141ii/laELHVUKZVWx3VVm2g0HWim30 YsqFE+ukClogBlowlVQ5lWFQleVolVR5lVl5lV4Jklb5lR8pBogEDDnpkmsg Z0SYEdB2XwMZirhUkzo5jT35WLGwcMCldkSpUkV3lKpmbktJYJKGkTRBSBEg BoiZmOQgBou5mIrJmJCpmFFJDlPJmFRJmVQplVg5T/9gky6Jgaa3EUgWAs9I c5Y1jTLFk7h1jY2Vdo0nlI5HlEX3cH75iojEXBUJXzuXE4b5hb75m3kgBsEp nME5nMJ5nIhpnMNZnMmJnJxJYp/oW8pFAhthCInkAOC1d/Fml3K4mn5nlwjn Y3n/aUuIFVtE11C12UZBpnilRodExpvDFYaBkAdh6JsCQJ/4eZ9gOJ9fyJ95 EAj86Z/A+YXPaZPpxYYcMXbq9Xe4hmt/R5dox3AK9VuGEJvct5eGBWN5aGoA KZgToFyxOBPtJYYkSob/N4aeJIZkSJ8oep8nCqAkGqMAmp+cZqDOuAHrlIka oWmI5AANamae13diNXNiNaGYpZfl+X5sh55t518T4GdDsH5ttE4alRNyZqJY KgCzkKVc2qVYqqJc2ll5mV9tJWl8iBFy5gS2xgBWJ3O39Z3h9YaMx1BbZUsE taSsRpsbOmWJZGVMiUg70W6dxIKE2oIsaKKHuqWedKiL/+qlXcqCiFQAYzqm EXemFsGGG5CaDPqg3+edOOma3uVdM/Z+kFeU2eVsbARt7xVoSCaOFeFpW8V2 G2Fus+CCtmqrK+iChvpRBLCluXqruWqGteqCgzqoLihikzqmarmJiBQCbmpb 4cZ34eZpSeiabaVVa6ek6MmkeVhqHCp4DxkDdkWdCSFTiOUAI0dGUKhIG5EE qvoPBNB/8QpMLbiCwfpJn4Sr+cqCnfSrt/qvlIhzyZqXymV+GDGLhLQBWfd7 vrewGQetc9pl5FlL5TmbxOdxV2ZuLBZo0CaRT5iKdghsGtFwUghKJrtO/Zey hsmr8AqvAfsP2DqwCAVt5HoRdv9VAA8qXo/GAHA6pOLmmrTEVtz1eHqKqh83 Zw85dqu4SJZ6sDe3tBs4BPE3sEOXoyGaVImEVps6rbj1gMl2YdyXrVkFeRnq l0t5ZX6meA/Zje6VitTUSq7EYjVQdrKUg3/2EcgItUGYiSVIR/nFVt6VjBhx UTjLppzaoL6HbOpFpxcqqg1ZlOl5ZWqUYd4aA3I2BDLIRu23XVsWW0MZC3b7 Dwb7ERDYVknKlxcbmLBwdKeYRmhUTmZkTq2UTpMWh6CohHVkphjBhiQgc1x7 jdEKVm0lqhJLsYbVl00art9KbOGqXLnZejEWR4ZFsRKLYZxFSDXLFXY1AQJp o7k7aRj/0ZYOynDhVb65ZnB1WrwYyq3JK7k1kLbhOmlVSHysVp5YxVUCJap3 BW1F1BXb673pZQDLShEOIFwRsLBpBbzme2Z01FJctpdFiZ47mLRqBJhKFwMX Nb/Ri6f3+8CNZ25OIHpu0QSJxFUA7FvQRpgN4a5LxalJ8G2H+8IMl75dNnTm ibq0ibEfx0Z+VmUZ26w7OGja1VBKunlBO5PEBnnu9RYsPFyZKofQ6ZIRGJoO 4QCYGGTvlnXS6n23hlYOHJvauq0ppsOSp0ZBdsEZ9o0a2pcyxlK2pJu3aVjN yheIl4mfOaSVhUuIJ7IMYW4RQEdt+cLXKK3fdmYzHKqNt1IR/3xvTeqtVlbB t/lxIaZqpBfGHUyeHaWCsoVkTesV7eYEwMCd+miQJICyVzsQSHxfChVxQwBW 0sqghuzFdbqXpXpvY1y5SgdLiRQCTchJWPZai3y/8Ke04jdQSFalfCFpOJua cgqeuosQCCtiE2qu13m+5WvIC6W+xVuDerqhlTtydRiO73tX48fGnbt5rtB4 T6uAGxBxa+kWarlWQzrP+fjMBAF4qtqJ4sZwl+u7XBvLNUyeskVLx8ukHofL qFYD+VwDwvWNR8mX5xxbXWa3KbVdA9wYduWjWVdh84db7nzP4de7W2d1JCu6 wMumV7dVhuDGFItVRQdjTiq54DzOkf+qtAXgUO0XY5CXpOTZeKkHW8eb0aIB mk48yn33WHXVowIBhDVwl7+XzYZwfzRXczTHAGi10tXb0rXMrRO8wwnNp4Y5 efIL04SGVXfKfVacUQS91nalwnxxUe8Gnn63nbGgXJJmmJ0Gjba2WIiVtWt6 k6WrsHb6mjecpzD9zQkNaND2hMuF00Jc1itF2BkYA1dVgw4wnbVRxxgHdAdJ bsMWAZLqeTOcWbaEiQYHraON1RQbxsjbrTINziO3XHO2xhzMXXJUwIuEV+cK 0dB2ym5Rx6tJjbf2VUgMs/v8e6Stv53lptnMeRd6wzGmoTHtvl+9rsy1avc2 0PdrAFYtepH/yrnbBcf/oIyioczBTaQQaNN3Ob5W17sOnNSEVABXV8imq77Q DbltF66JXcai5HX0O5tbNltAGN843H4XxR12FQPB/Z3eHQF5/WhqRdJoRcNj h3amq7COl8iPp12k19Vl/NXiGkoDRr9D3MaJPOA4d1VDbHbbepvd8b+jaJcC rEih3aDYrNpdttLvB21O0Nx8zXnavaQd7mwPlcu5zEYoSGkpBtHsvNpP+2cF PWgvDb4Kkki+BVPebdLZKW5WjYQ0/Jp33Wl6udKypaRFV8uu7dUgvkbDdt3R zbmzRLHeBYWtN8Rlq10f3R1E3YbOlYNHGHN/V8jrhYTxN7FyBG2d/0jozw3n Erynas5vsETMzEV8Uh7RybVUUf7SEixnRVYfml3c5oe40Gi6o01LYitHSKdl YAzdFuvNFBzpMzjZ0EvEZi3nWT5cOc2teqpcWNgdOCpiNE6dfEfVo13fM2bf t85I7fVX6dTsrOTsrPSEZAS3qYdXOd3kD5zWKpiAqHuUpAdt5M0dKD4BDDrS L8WmKt14FUqngp1VKK63x+R1q3aenbsBviBaO/3fZEt8Bw4idx1tnVZnjJVW Z2ZQK+1dYWvoLS1Q6wrvolXOEB3gXSbWieQEHL6tlE7pSwwiQNhK+4ZucvST mXXwQwnkqy1QdDjt1DRNDr9IvSZLW93GiP+F4jdNm+yb8X1F5Qny7/Tktsx3 TjEoVH6KZRze6rXpdjPtukIVkbHb9DAIg5Sd6wqYVcScdMB89TjvcTpvH+/e 8sIXAXArbe/bb8rr1SOnvK64wYVFy40XukX/cKRG6a4oZ8hsH5KmTl4vhcze 7NIe9kKfag7FpODNZcUHUtKd8UePbz14I4OJrZBX5Ga08nk/+dMU7WfEekOc gYOH8VnvitO1+CDih9xLY2W+8BuKakIVux+78g1P+ULodXHf+Z5PYEId+kQm toRNyyiPp0WP8/n9vuSk8qro+sc0fEsu+64opcrl1snhh3H0wKtNqnFusQZ9 843spBiL0EoPu6r/r/LNPvxBaPGBL/fdWoVnu5S8fiPOb98Lb9bS23Gzucbl 763fTMFnf8FlTGDPK934BvyRDxBDIvwjSLCAgwkOECpkOMHhQ4cxJsSgWHHi hCEFYwHg2NHjR5AhRY4kWdLkSZIbCk4gYYDES5gkNsyc6aDmBoY4Ge5ECDHi xYoUawitMdRoUaRCg06U+DBnQ5w0N8AcWPAgz54+fUqkyLRr1X9JUI4lW9bs WY4OVsqM+VKqTRI2N0yYaxNrQ4hdg+4dGqOoX6RG/e5tCnEnXbkO4sqc+TKj 1cNaH+6NSDgGWLSZNW8mq5Igy7Y049JMrBAnYp5am1pWChhwYMFLCzvk/xnV tNSpLwsSrNEwa16gXrnuLTiE83HkydV+Do1b8c6odGlHBj48aF/BsAdvtzh7 +ty6z3HH3P3voOTJlVnHgDVhaEEnyeXPN0uiYIyYuHGOrnkYq2qg+FIKNgIJ u8gw6G7Tzy0DPCuoBvSYEq6AEB4jKIIIKgwhhPvo8/DDkewjCD/GSNvvOYUW u+u3n6zjKzvtLEOvthNLbAymmcqDML2uJPSrPCCDnABEIokU8R8S3xrNJsR0 uksyvSzL7rW/YpPNp9oUXHADlwxY7sGfArSIwyDLLM+BItOUz8EY9HMuRdOe 3Eq9ivoarMC/DDzQqQRvGi+mBr8ckavghjPz0P/yQlBz0c0MuO+mxHSybUUA 17uTwKTs7A7LPu1aENCWBP0HQhctAgu+hBCKoYACnKiwzBoYlbW+R6cSD7yn 5KzORTurpNI17iziNE4VbcwtlgYNcImECcoj1DIgI4jFkCSqNeRabC+IoUwS ZvX2JEd5q2nJ06LTlcf1qsSTNcn6jKox0WBaFpiWDGh2N8osspC3avv1N4lY tj1UrG8LDulIiabSidklmUwNOB/rbE1dXzUdjlPwpFPs3dzknQpZLjcQ+D7W nHA2CWoB/jdcRGMw+GWPWK7h3dIQOo26MC09Ck8r9Ro2Tk//9LhLEmIhwZCR RxQOMB1jiWUNlWOpFtn/fc00DmaYZZ4pobjsUihVvFTrjihgMW2tR+9ySog0 Y+XtkktllUW2ht0iYAoWpU4NYVqpU5ba6TJfLc8ArF9mOWFPgX5416Wxu1Q7 iwlFEKqo+Os4NGXrrZfugiIItqjdhjAA2b+jTsLk8pwoOuDUCzc4lgdP9A/n ypYmDDvILd5zcqDZjndoZUMeXVnOCRqiTqPKm8CQNZx2mlpqi3/QeadRL8j1 gmHnTTpJ/6vU9sd5NjBtmxO/CUd5W5KJ6LjjLiD0O/2y/p8hDKF+WpSTEPUf J4Z3/t6CEA57s9LeqHQCtsXlJUrXkZjZ1qOVhnTtfFIZGtxeMrz2xeJ9BQnB /2v8cipkjc55KFuDIebHP6OFcHRHIsgGBkjABykugbVjzc6olKl8QfApNLMR qF5itJaoUG7V200IKLabAgjRAIZYoiEcVJCpKGsCtYjB6PY1pBcyKglg6s8M J5OuAQUmWJT5WcbGRUGPFa1BRktW3Kg3PydQ6VRwa5+ymAgkurjEAVCAwgDu 4QoAIimLjCrgeby3FZ25Zl3B2h1tmhQnN62vJVxSXwrreD84wiZ0daxj0v4R ArdsABJCGIAQ7lFKSBwjFOYZ5KIKOLND8ihiitxZpvI0Nh3ajC77+dT6orjG DQjRfk6bGpl4Exhj/sMBTOSkspKJpNzAopRCoGY1Sf8phHqsoZVqsgoCWbQa 2zmulmKUEaceyTE0UnJZ7BOi86hFzH0VICkWGsL9nCY3EpxqCDSZABSs+c9q DkAQSNgmiLa4PdrRqYZEWeSVMLa2oMmlYw3agCsyV69L2rNa8RQMEu3pPAN4 kmsbCAVATVpNMhTUQwc1T9iqA75aerBnPjNn9ySKRlB1SadufJ7pknCqisBC ehMgpj0NUZ4h2KWfJ2UqGfSg0vlAhkUKFY44zXZLMvIpUhtDpw8v2BL7ZXCE KVOZs4oygVORAGDvRJnTnsg/u8DiCExtKlTlI9VKleooNySnQ3nXPd/lRnjq bOYQ8UfWvjmrK3XLH8DwBzD/T8bAZqOk60nTwAS7IqebiATjdiAnsaXk0jSp Es2NJum2NmbUsdZKQgmrVbc64QtbZIXeCVNVA39WlqkXyCxnNvtF8HEHU77K Ie92KZcetuWCLjFE0TAqQuqxlrVHxRdFNtjCa6EMetndVwgSMoFQzFW3J0VD bzcDGcY1cK9inKnkEPSuXW4Np0Zj4gWbSzqe/q1v2p2W/Vg4hIvMT7r9gp6O IpLb8Z7UvJr5bamkNNwxulerO6ycab9KyeY2U6N9m221nng8h1hvCNodsP6U J5ECJJiuguDtgs3SzYsJiL0OzOpfI8rViYYqc8h6rmFLR+Br7TeQAJ6IMZ2A MgNY/wt6Sbgu/SpSAPGq2KRpaLGLx/KYAjj4bOvFYeR29zXbnK9EytXcjsU6 QmKmjK39GvJDLHRk5imZu/CTCGWlzNTyWhklWH4WA2lJzsh5ZzpqOyNOMxe8 H2LQjmn2V3//9TfpedchFqpBh5PAgH4lqi92vvNJEdAEPZvkMU4I7q8gfCXy 7fCmpV2W+pbLxvw+lq20VVm1mkzqSVulidqFHssIYsQawALBnT5pIQga6pHw WcaeZS9ohYWxoMUXpxf82Arllt/8kVXO2a31rRkClgIEr4nZZSH/hhICYo/3 2MgGCZmyfLvwNVtPvItoL33Jvh67s7ED5nZjpZZMJzCE0v9frVdz3+qEojhh 2OmeMmbZ/RHUkbqBf84TVns0rC66ybQNggkQ7xnrbPsLW1D7l7XiKXCrKKzV yhKVPGMQgigznKnrfjgAyBTHAcV7r8W1cb1/52qXsFGJ0VUzbbW972uVpwBR sdDSFdYWUeF8CHSNuUmnyVQq15wjEb/dVWUk6JyA50QKs3CyOl40OkJ3hLxm ALYI3C/XJh2J0nnzThjzkqjjDd0yv/rVrymENGgdAFy/FF/j59cJ46q0Pzd7 YdVOzGwX/e1ALvBuYLkBY3p3UjdJHUVKmu5phh6gpdyF1jlH6hl3mYxgZ5IZ /TTRkGG0x9DNH+SBLHJuz1bu99n/pYgXQlrFBPKTReZ7QP9OzVKmQRCmJwjC dZ6U8dX0nF2lJGHVx8l71n7fJXa72/Pna2jOpMkIAps+K7Jwv1ez6sYvZfqv OYAqIzvi4ySupsI0uTD3Mjccv68az8zof8m9bfM+JFMemkga+3OKE3IAiqAH vxuAq1s/a+o7q6OmPGO30xuu9pKQv5q+n/uqLuk/sZo1OeO1ACxB6FmDcosv QfEc+5MI6RmViDiGWqhA9xu945tAISiEmjs998gddsE4YrG3o1kfccMvwwo5 yqM13KsWTOuXt5KofLK8AqEIPKIIBoyBhUswCsTBmhMYhFM9nks8SHo9Brm+ 6zs00qGe/yW7PSZku+zyPlF5OpEpIlM7N6WbjIwQgGPYQmpavy78p/aruXsB NhuatwnTkne5O2qLCSDqkhCKLg4zwe5TsxIqOt1zovK4nA3YF+SpkhPynAlw glOJAPSzOggUPR0UAgQgxOaLEd2ZDawArOQ6w51iJsNqQ92bLtwTQF4zhCcM pAggOBJoMs95kRiomkOphzT4wxwkpfYzPvYTgpR6ODAEFkTUKh6KpEZ0Ilzc gGsBuf3SxV8cQExkAKnJH2HsOJd4KwBjDUSBDwBAgvFqP/drP5oLtUJ0nHyR xSx5PQtTJ/VpLlxcop7SRUzcRV4swZBLGlDCN0/6JFZhFeyIx/8IMAQAuAC6 SsX3E0Ro1DrP6CDiAid6Wxi4SCf+Sy1wxEXomcTtcsJMRMFrabs4nK6k6R/h cZ94/LVDiQBtAgBaULFolMZqfLjlwLnoI78wWzVWu7c0ZKaaVMKa3MXc6zAC VLMkkJ4aALrra7KdjJZu4QgmmEAKTMWhJMt8DLWjHMNBC7u3MLSpaC6MKsiX JLG6LLnGskpLa7vGYoAmCzd8Ip2iicivpB+C4QhBiDkIRL6/W0yPbEWQbD7Z cK9Oyb8boSQQzLCMekKs3L4mfMmElC410yB82Sk3WqGXU8ZDqYGN4Ag9KANA fD97dEzkg0BdEDwRQcqL08bbYEpOREP/56JLfbs0ytu+SuwXTCs6zpzJlJmf CTCzM1syt3KPEDiVAPoIKtjIaDzLgCrKmgsXnGuku5CUT8FM5gKr9sGWnjLO qszEfrPK20uCJKut3YCboZM1v1EZkpOJ64qFJkCCXSADZtBOs6TN2oQ/wQMA 8GykQRs7jcsPzeQSqHSjvJRKfgPGcow8DXVCtouFZMI+Nlwyv0lHf3mfCDiG QrjB0Ws/BTBLQRyAtGS33GQ9SIqU8RBI9jHN+RTRkju6vHxPAXzCkGvJJPjQ aztIkSuxqUkHSbgHf1LRFy3QAp3AC8TN5msXh/EaW6EglRM3OmLJIW3CChXS 7ns7HuVLdBRR/0NIpo+qUM90LDIwUC6czY78J8hMUADQHlzjE8Q4rgeVJLbQ UTuyUIbEy1+UPA4d0nRMTpShJzZcKzdtLfkEBgGFUqaSUkz9J2bA0444qIDT Rq5JkV4KHmYCq7SrSSGNz39BRyUTUprszEMtU5QBi3rSL6RrQwOAAxedU7M8 ghaVUgUAqCpNUE9NxKDhGMz5Ks20o6kUTW17w+xKx6sEGEZlVBHFNLDYm8My U2oxgARghj6yVLJMRX5IxV/NVICiBU7lCOoKuMqUwp9jIgtCFrokMUZVMuI8 Tmf1Pr6criCzy8jbDSewnyWklg24ByGYqzQQ19kcAH44grny1WAdgP8WVYCK vcE75dSDuorK1L91Wi5OytDIe9Ze9FdZDVPizJ/kpBaPktbs2gA0kAEEoKZT ulRoJFcIhFiIrViLpdhzvcH449TmgxP54sajoShSnb0O48v23LZWzR8AsDT3 ZCL1pJa2OywWSqK3IwGEPaXFVFFgtVhfpVid7VmLPVvHTL9hFVr+4R4Fuakz NMIirKM4nFpKJDHpItGo3EVMiwUyHVJMY6EasBYDYAJ8uIc0WFiwvVmzRICz 5VlfdVyfPdc6rSZBALV17QiDcL0KuxGO05wiVCKrtVvoWdmjs9YyTV38cbRm vRZBiQH5dAAhgIK5QgCOXFGz3AGH5dnHVQD/ybXdnv1a9wu8zPWI5iPPrmoL olnW9qk95nTP4iTHqAxTWrPap82u160HBEjcB8Rdhx0ABChX8O3dx3XcseVI 7qQmZgjazDUI8aCLMaM2/ks0uq1b6O03E3RDTKTeulXZltyuezHFI0hf790B 2z1g8B1f3XVcBdiBYD2CmWXM7bw6Hizej3DfLf0dzEzDJDhaZo1Vu5289oxW mgxTzlTZu8VQQygAAoCEAZBA3C1XBEBgx63hI9Bd3zXbtN3O4xsA77RgjhiI g+AlCwPBuJEJFULVqe1fvMzEqHU7a+1LYNxW690uQ7ADfihX3YLANFhgAwbf HbjhA+7ZGR7bjvza/2dEUCC+YOMJAXnaJVvkSrrk0SU2Om6dSjoewLZSU16T ImZY2C0egDQ4YASA4Bmm4TKW3ExFX78rBIdbY48ooGjJsplISfSMG9A8TgJM WfYk2SHVy5BD0/zZgAHAA8ADvOGtTX5wYAPOYdvV3TC+YV8d4OBlZO6EUUgO CfArkwgYApdLu0FFyJiEVg5VTxS20CpG4Uo0ADsoBFNW3O6tzUP2XVY+5Bn2 XQh+4QHGVHv8O34ggxjN5Y6IhQl4JkTxZQdYor4UU7z8Wzf8UQzt1+xi2qhE RweggkKgJtsdNtGDQH4oZAR4gVcG40PeWW6m2Paz3WpKg3AWZ5EwmolwAv/V BJIhMCLJUucTzt9I3S5pFc09Ttl5zrbkJIFT+OOEndnb7TtBNuBDNmCWdmAE cGDw1dmDXsw0AOefdGjNYJaJLhNSS7J2TlKFrN4LVVOjtgNBVmkeJqUudmkE IIUBcGoDnmXfzVmI5WYhKAP21enjaBDq7OndIACEo4t+hWc3tV6UWU5lVmZD OAXw5QfG7WZ7/GenjukdcGmYTmDbnemr/lUEKAMkoIWn4mo1SYINiMF4/Omj o7UopkTJS1P8ESjdxWqyDOiYtuuobuAcrmoEfmHb9dUyuE3CNpjYnYBW2ckM GWsu4cVrfbuV/WgmgoNCOALxTcVTQljZVABS2AH/KsDru77rQ05gCNzrQh4A OUACzB3tAYoFB5DowoyApeNRe10yVhVRA0jgyfYj4f1afliCF7jrAehtu/5t v9Zr4S6DwVbugjIaBqSQr3SCLFOMTI685DQAfCgERZbS90MA8X6Cu+7t3wZu CPZd8d3rAUADdVVvKzOEUSxMJwPHSzNqA0hMgbZlaGTqJwhvKQhwDpdY8z2C F3hYgdpqBXcxiI4B547HIYBvyVIrJsIHa67pqF6CJ6ACAP/vALfmax7gHWSC 9C5xPCWBZHRwJ6ACQQDv7X5hhI3q395w3q5x3l4CmIZgiYXYHfxxIC9el/AL wQkSKCiEVjbwVNxmJq/x/yd4ASpYAhp/giUAcB1HaSF45CznagbcF2awcQW4 4ZregSfYcCl4AjZ/ckCHZQiucGpKAyyfc8KO3VqwcZd2UfTlcxpXc0qXAkr/ 7RneAUAegDJIbkUvcRungvDObkylAktP8yx4glTfgSXIgt8GY4784U9Xbj1A A0enAjGXUja39FT/c0tXc0z/YvFCg0SfdcIGAwWwcf7OdbPs81b38x1wdSlY 9fHm8QM39iwvhjbnbVIvUARQ81639F+n8Rz/2rXFdsImgzQP8INW9T6XAnjP Ang/9XJPWFlHd67WBWB39IOmglSX9yzIgiWY9z+vd073dHwnbD+gAjYHcAjs dv/ejoOAl/Y4kAKJ928oV+gjWL6EV289kINBJwVcf+EXrm1VD/hWl/hWF3hA 53doFO2OH20kWHP/XgIxz2Y+jwMqiIMn0Hkv8IIl4HlAr3GOJPGYh2Q9gHc2 b/gB/uxUfAIvyIKol3iq5/k1X4IWJaVzP/pc1oVUH3r/juqcneyA94I4OPuJ l3eh7+1UJF6uV/h/H/gnKO5sLmR/P3u8zwK8//NtT8VCQPi3F2c0GPhoH/So pmEqMHu8X3x/b3yzLL3AJ2x5h/eBx3UqB+gjMHvF13yJ//cv9ufIJ2yvF/iB l3LznlkEiIOf1/yfv4KJ/3wINPrQL14kEHh5r/wZBl//gN6BK7gCL+j91Xd9 0jfwMph9rgaDP+jz218CijVgVjRgReh96Zd+V4+DAm1o48/cqLd9wg/jGs70 6Q//oJ/7700DmM9+SEYDi3d1vYdqL7bdYgj/6c8Chs/ZAXgC9HdoRdD7Z5eC PwAIBQgEDkQg5coVPgkXZsnihcqANAMQoAFg8SLGjBo3cuzo8SPIkCJHkixp 8mRJPw0bPnkiZQeCIzsm7liCcOHNK1moPJmIYAAYlEKHEi1q9CjSk5GyLMki hSUCBDB3KNiRRaFCnA3jwPSZ9CvYsGLHGkXzJo4UtFx37JDJ1qoihFmvePGS Lw7En/zI8u3r929SMHGyoHX6/5JtVKn55N7k4yUOZJhHEAgCbPky5swXL3hZ mfbJVKlSs+Bk/HjtgB1UNLNu7RopYbUNQ7+92lihIshcByog8/o38OAe9ajU bfUtYrhY5So6vcRnReHSp/+OpJtwFuRvF5dGWDfOksRyqJMvf1mwbrXaazJO mFWRouwxo5uvbx+sruuQD7+lYjPrXFfEVUxittx3IIJFnbZfHKRoZ1N7pe2m AH0JWnghSEgsGNkOfyzBFim2LRTgG1LtMB6GKaqYkS4IpSdFSzGy11hOCE1V xoo5rshHc9fF2NISVMQFYHvZ1aQjkheCcUV6cfwIWlNxjVjjW7okeeV9LboI GVMtSf+xBJhDCticlFd8uEOFWKo5HV1tQvaEk09kFyZCiixRDJgNnbnDBWv6 KR0S3p2WxRNLFMpUUzp9KcUfpLzw6Asd7qLHn5X+5h1dg1k12BJSOIroH39A +igeO4BGqaWpahYJpo/l2VCojy4x6gtAPArEl0ugqCqvgC3ZKqdZvDArpMQC YWutQIAJZp+9OsuXHjfV1dBTX976AqO04gGEh8QG9Sy4Yi05mBTllruEqI9W G2q6j8b6KBLhyvsVGG9QO6uH7/7xxpfp4urhqEBYOS/BRsWR77voqtsvpEBc ETAQuxQ8MVH5KHytudgyXOuwUshhy8fxUjzySWAQmyy2sf5pwaiotsZaDMkx CwWGHKSQsjK/7b6g8sVAyPzzzIq80fMLCOXcLtBJm1TvxTvbtDEQpCg99UhL 8luuqCu/C4TIVHvtkdUsu5tuMV1/ffZGOoF5q9S6oIo23Bsp8u4LZsd9N0YX ECv1mgEBADs= tclxml-3.3~svn11.orig/examples/tclxslt/tkxsltproc.gif0000644000000000000000000020330711113705304021625 0ustar rootrootGIF89aÐ,÷ÿÎI Ή. VVVÍÍÍÌÌÌÖœ%Ó‰ŠÑ‘ÊÊÊÛ£¤Ó• ’’’”””˜˜˜ŒŒŒ–––€€€ŽŽŽ÷ëМœœžžžŠŠŠ«««ššš   ÀÀÀ………£££333ˆˆˆ‚‚‚°°°¥¥¤„„„§§§©©©­­­Çjk¶¶¶®®®³²²´´´ä¢#¹¸¸~~~±01ºººÃÃÃnnn¼¼¼|{{¾¾¾zzzÈÈÈÜ©-ÅÅÅÄÄÄxxxpppâ˜tssÈ|"""uuuçª*rrrÐíÓ­ëëë¸GGáµ5íÍ•ôááAAAß±2œbÕ˜"åÁ=ëÂ;Ý­0```ÊñáU« êÍF‡ úññÙ£)÷î^ïÛQË‚öé«• x ¹Ù­jÖ¤RÇzðððá¶w̆!é¹4îÒÒæÄ@éµ2Ú¥*ñÔJ²qqíÕLäµZâ¹8MMMµŠ‹™ijªã k úôáìÑJôçr̆íÓxè²/óåX\ ÕJèÊDš01Ó–>ÑÌÅhhhÈ|×Å©ðÞRÊ‚ôé\’OMïØNã¼:€P õçӹ̅üøñíÉAçÆAê¾8ã½<É~ëÐHόڦ+Ö›#èÈCïÍD˃O0ríÔKå¦=ôçZÉ}¾¦…á·6£‹È{Ñ“4æ§'¾  îËByffÜÓÓØ '3 â×ȘvHæÁ`ã¾<Ñ”)ÐóàÁæÁˆ£ É€¡‘‘êÎGǰ±Î‹/ÜÀ—ä½:Ó›2á³C¡d@ çÇBðÒHÊ€æææÏŽ0åååãããäääâââàààáááÞÞÞßßßÛÛÛÝÝÝÜÜÜן'ÚÚÚÙÙÙØØØ×××ÕÕÕÖÖÖÔÔÔÓÓÓÒÒÒÑÑÑÐÐÐv  ÊçççØ (é¾WWâ³³ç¯-™ ìÆ>ðÐF¤!"Ê‚ °  À~|%%Èš\ÕÃÀ­}"¨}AèÈP’}zgË™'ÏŽ&¤ ÿÿÿ!ùÿ,Ð,ÿÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H“*]Ê´©Ó§P£JJµªÕ«X³jÝʵ«×¯`ÊK¶¬Ù³hÓª]˶­Û·pãÊK·®Ý»xóêÝË·¯ß¿€ L¸°áÈ+^̸±ãÇ#KžL¹²å˘3kÞ̹³çÏ C‹Mº´éÓ¨S«^ͺµë×°cËžM»¶íÛ¸sëÞÍ»·ïßÀƒ N¼¸ñãÈ“+g©e¹óçk“ €N½zØ$ýRXßÎýj¿ïéšwÿO^©–ïßcˆ/ϾýOtè¿ÛQã¾¾ý›êâËgr¿¿ÿ–è÷ÿhàH)hÇ 6Èvú%áà„Nd‡€ÚU¨á† ØÏ†(¢ÒWЍâð X:)\âŠ4Ú`„©‘B úMWãå%¨_:ðèav@&I ¤sá‘P~—ÄzJV9ŒFF©ezTZéenj Ζdâøå™´iã;e¶iG: ¤ˆæœ®‘Øf™1¤ ŽGL ãçŸ&Ò)¨b êk0XLxXp´õºËPÂGüWlÕ®ñ-|:—B™aBG|d éZlrSÎÆGq³wΈPÊ"«'×Ü”¿ßÑ<´PÚÑq?+ „sÌ Ûl4S xˆ¸2·‹žÆ9M´Ç%muOñ{PÖÂ) „ MgÕW—“¥èím”0Ñ1° !©Ÿr§ µØ3›­·E)ÿF¦Cw‹Ž­ê‘ Ä(v?óí-yDC’<Œ¶ÌÍályE0þl/Ü“—®zŸ”ÂŒ0ë—aÒ®'¤Ùi±@ÃÃ’núîAŒ^ “˜ÔyÏ3nŽú¦Z‰¤Eè>¬à-ÑÎû†!Cî2IC÷“÷?˜7J3Ž?‘:¸·ùùHZ@:}•ÕKé÷G·†7P¹è]ýñ).QëÃê9Ð[`w$|Äm#Hë>v»Io!L3×»NÒ½ï0Iü‹Ï;‚¶‘ÙYÿ¨Þ»’'º¯i$};_G*ø^PEÒû6r;9i¡cÌžÇ6¢Ã-Ùáaáwÿ>öBõ0>C_AnUB$zèz9"ÛÐw«w‘FΓ9"ÅF¥ÄòŸDºè¡†Äxúã”EO$ÂÂSœbp™©1"å‹7‚Æq­1Dm$Þ›8$I©£‰òãs÷‘>êg‚ÜÀ’0C‹ÄX}È%UhIsUr"ŽtQ$%1rw10 áz¶E‹ÜÐZœ\!¿³ÇQ6(f\áÏ’Â^듹$”Ô6¾Y~È–r•È©e¦€f\ÃPI|÷*PȬPûì•Ä €`›êa-A’Ç#“!×¦Ž #WݨT·DĪN¨œë&(ȯFÉ©1×O…FV³’r¤shA’6¥ƒ¸UKãtH…OvuÂê΀ ÄOð¬å_£”I¾™ ž[Uhb7M¼*hOƒ…\F+·Àþc²ƒë‰ìÕÌ È´›e =;Ì@ÿ~.y‡ªlOEÌÚ•¶±mÐbik-3žè›wJ‡jòJk!öD¿ n:K\-=­i+ìC Ê+…ørŸÒýÑ$¸ëY¿1QÚ}È6É´ „„‰z ¯p‹×ç $IHïCšë\÷ÎròMu«‹žž·ù v¤¿÷¢.¾žÐl ì®’Ý*u!!o|z;s)Â_.…Q—RèÓ¸Ñp|Rêaí Ä"߈IŠ[Í"'ÝÖ¶$SÏ ·3®ÜŽõb‹.Jó:ðïŠìc1¾F—9rÈeDÉmò¤dd¥äÄL>‘=‡eEayyZžg¬ÖLùÿ"È™ÆÎlß4ÏéÉAF°‰À º#k)€t¬ÅåôÍQ”µ¤;)wÐhZóˆc >ÃËÏ>d•£!½-<9 ?ã(À¦´jZKäôº gb• *ÎôÚaUŸIÒ­ö²JIWOXµ¶5š<dåÄv‹ÆT \ _aWŒÕ¶ƒýb}'Ò1ûxζ® œßV—ˆ×þp¶-¶ÞV»Ã ·ö¨:nƒ%ÛÜÃÒ5÷ò˜Õvë«ÜðŽYhÖâ:Û{[cηȰe~ÿÛbÔ8Ñ^ðYúûàÈ:"¦áÍð†kéÆŸT›Jl…) 8-3^±#~ Úÿ'0…é(,@¿$ÿÒÆdC8%öë¡b@$t,7æ0´®_ß=µT:uâiƒ: t Ï2h(¯n:‚ýj§ŽÚ“ΨÞô “ÃÇ r›#‚oå)R?ï:{ø{$|vœÀ莈1cæ¨ÕÁ\íäùz°.0y;DäxtV…÷•Éùu´]ÆÙmî}T¤˜^øá`ì A\ž)Y&¨Ià{ÄêþòÊs'Œ÷Ö[mÊ ¢;27Ï Ž´›ž6X†¤z÷Œ £qD×·Ò)ûÖ >ñ¢œ±ùyP›{ìÅßMh¯µ? ãÑÂëÓ‘üaY1ú¾ dÿê2sÞß½"¯·[u¹~Óà[÷ý²¾‡ünÇ;ߨojl‘òË_Ú/áybÒ}项o(ò7L¶wBé'zÄg€ŸxwÎÅ€Q­'¿§~-#µáò!T6WaE€Õv~õ×|³h GT‡DŠg¶|;¡}¨ /("9$h-)…l–/‘~’s=x&'3ˆ.X耂¢‚0¡ ¸„•ñƒýàTSø*+÷„1CZÈ!Âôp aƒçD8bX†"ÂvMeãµ%ïD_8bœ‡r†ñvú1~Í"†"c„|8rHsuðmÿHa½wˆ^§%˜gIcˆ'8cõ&‰ýqxm÷–€¡†Ä}œè—'ÍÃUñˆpÇ~§XfG¨Ð¶( ‘-‘‡F†±XÐ@ %¡àÆxŒÈM°ŒM@ðŒÏh‹Òh+AŠ´•j¿¸ÁhŒ© %€ŒàŽâ8Žþ̸ŒÐøŒ €‹ñ”³‡ÙèÛhŒ %©@Žú¸üÈÊȌΘŽìØÔ˜‰#†‰óHÐà Zý‘9‘ À“f… ù Ž÷%ùH‘"9’$‰Œ9b›¸‘ºÑ‘âx’P‘%“2ÙÐfŒÿÐ>ŽëÈŽ* ,)Ž %!9“Fy”áx‘#– ß‘BpŽsŽ0ì ?yA9Ž.y$0I“€ДHY–ḕ´…‘€`–âxŽ:™Ž0Wùõ¸Z 쀑ú‘ ]É–fY“#Æd ˜%ù”Ì•éH•ÒèŽsIu¹h) 9ŽJ%ìP™†i”—I`E¹™ Žni‘ÉwÉ6I&ÅšH9™´µ–®9›â8¥9f@0‘°²)ŽB«Y&ŸI›%)˜Ɣƹœp›P‘›»I‘©IŽsà‰m’ B°œ2Ù™ÕÕšÚ šMàœOÿÙ)’€ %¿)Žçi.Œ€Àð`0ðŒC@ø‰Ÿ B°Ÿå©½9R™ù›ÉâÉ#ðŸ"É—Pb—Ó ÀðI$`& º#0, *ð/ 2P7`‹3Ð ð00`.j°Ÿ2$‰œ …I GYzY)’Ã%ó Z&Œpï9¡zŠÊ¡-à¡/ #Z¢03°; `Pâàð ܰ Ù Ø` Õ0 <À¤M pZ@°ŒûÙÿÉÄ•ž:*“TУGqš#É G’4Ž"cHúžñY¡&ÿà¦(°¡P*¥#J¢&Ê[Ê¥_ ¦bê eª Ù@ Ö Ó ÏÐ Ì  æ  ªzªÎà ÊÐ ÎÀ Ïð ÑPÁ7,Þ¹§1é˜~¹9“ Z2  È¸žƒ ‰:¡Œê¦OÊú¡SZ5`¢3`©\Ú¥ ©ßà ݰ Ú€ ÔP ¢ Ï«ªºªÌÀ ­ê Íð®¥ê Ïð Ö‰W¹ª«#ž½*P¨$ÙP Z’Àâ8œö’€¤úŒz¡à¤ÊQú¡TJ©Wš¥[Ú¥_*â0¦Üð­hª¦Ò Ñ«¨š®ëÊ®­ú®Í0«´ú áãYéÿ€ {"ð¢.*£û鯺ڜûú3 0o0¬P†0ŽDS9«¨»¤Mú¬;¥UZ©—ʱš œÚ ž ªkJª¦š²êʲ. ³'ë ¶J[oð r tvë±x+Ûº·`€`T@¸†0>k´e CëÐ0À:,°¡õªùPBµ°Ëê°ÍÚ¤­ :©ÖŠ­  ­ÜÊ©à*®¡: 抮*»®íº¶³ æ:¯•K4)à rû t vyë±|»­^𼩛¼ÉË·+Gi «¿*“@+ - ´L‹¹`¬þÿ0”S๠ˬŠ¡€µR:­VŠ¥Zš­û±Ý*²âJ®& «§:»,ë®ðz»¸Kª3+6oà ¾;·u{·y{¼}˼ºËÛ¼{k@;’B0½:‘ 3Ù !º½»‹uÐÞk°È(¾“й Kµ¡±ìk±[{¥ØŠ©+¦d*¶Ÿª¦£¯h« +[»/ ÀÑ &û¶Ó ÚpÀÀ›ÀÄ[¼ ìÀ Á\PÁ#)½\Ð`‡é7P¬,€ ÃúM+!ð´àˆÂæB¸-ìÂV±£ë¡K­Òx­]›©a ¶êºåZªû›¶B<Ä´Àæÿ ÂÖÒ ÌÄÁ;¼Å«·Ç+ÅTܼ¾$ <ºÅ1Q½1 80¶(ÆœGu€ÆÞëâ3ƒ ¸€k¾I ºé›¡›µîk­ñ»¼`¦õk¦÷[²±[È@L»-û¿‰\ÄÐ0 μ´D³‘,ÉN\É—ìÀ̱^êÅüœlŒÊ3¡Á2i2°¦Ü¨Üt %ïð ๾k-ù¢qÌÂç[µzµ¹,©3ÌÇ륿 ²:œ¦eÛ¶?ÄÉ<ĸËÌͬðX&œÊ ü»MLÉP|ÍÌ›Í^ ¹IäèÉâ ]|´, 9€ÎÆ2ࡪŒ¢òÿ¬ÆÀÍþ¤öR ¢+ ¸s Ÿþ쨣›µ“ú¾5¬ºÌºá ª¢j¶§šªÇÜ¿¶»Ì° 0“sPÜð ´ÍÒ<`ʨZR Ï$¬×ÂÍÉ÷L&äà€Ü(ªÏ@ÝÂBíÜJ±-ÝImÐKÝ©;\¶„ÜÐ,û ˜­ÙÞÍÕ ÍÑ`Í·,ß<ŽBýJŽB+ß&±ÉmÍØ  Ü0Ûp½ý­Î¬ÛQR0(ê½Á-gm£eBu0Ï ®Ü0ØŸK¡uü¬¤;­ÕºØÛØÁÜÔ¯[ÌézÌÞÍm!+ÞžMÍ¡ýÄ+¾·É{/.ŽÀÆmiã&a}=Ê4P Ô Ûà >þÀ@îß5ÿàv½Â¾­ä% }î‘ ~$PóœÜ(ºÜ´Ü° ÐÐ]ºÒ­±ò{Ð9,Ì‘¿®šªÌ€Ù„(0é° á­æ(^Þ*n¼ýÞýŸ«]ãz#°ÞýØ9 €ž Ý@è´ÝÒàEPC0=`ô÷(_÷+ÿàœ.áæþÏ0ÐêεÔýµ9œ ¿Ù·ÚàóŠŸïBßæçMÁ)î‰ÿðâpù! ÏTÐ ®ªªÍàùÖ°ãù=úZۀǰÂHÎúKîñ@Às@¶CâÀa D”ð"D *8hÐàÁƒ/\À€Ã‡$L˜8¡AŠ#X°h¡BÅ 5jÜèÐa9r(0P €¸pà щÑÏèQ¤I•.eÚ”i«lÛ¤v£Êͪ7¬ß´‚ãΫ8°a;ñWÖìY´þ„4èˆABZ³Ìü£[×î]¼yõîåÛ×ï_À&\Øðaĉ/fÜØñã»àNž,Dƒ3fÌ”)cÖ,š4kضqû&®€9xÌè ¢˜Ó~½.lˆð ¢ÿ BxA!ÊeAÐðQ¤ˆÀ &±°aˆP´8!ã†?’i¤†)Wº|SfÍ7s*àéóW:;°åϧŸô—6mR·Qíf•Vo´ú†+p¼ ', È -(hë‚&(£2 +´ðB 3ÔpC;ôð/h"\pA¼i3ÍÌé ТâÓPSµ7`Kb#Úlk ‚Üvë @XŠ,ˆ!zHΆåÁƒç"šˆº¬‹;Ž8Øn¤’N O¥–^’!&šlša‡õ: ª>6Û\ÊŽtêÉ&üôãÏ¿¬ìê«°æ-8êè-Ê ùðPDUÿtQFuT±€ûs2.hæD•Qñ©‰ÊOS`‡Õnˆ¯)vzÁ`¶Úp€GÝJøF4„8€@2¹‚bŽ!‡¢›¨¢‹¬ÌÎ#ºë%ñ„‰Lôpj%+Ü´ÖÍw(„Î9뜪ª«òpÏÅbR³¨8á¢âQxã•w^zëµ—.Э,‡g.u³Í8ã´O·5ÆHí F§nÜ(#Û^íQVßlÈwÁ9h îHäjR!`¡“’JŒ® ‚ ºîÚßÌ{‚µ)û@Õf¸©$´|x‚ˆ#ÚÍn lÀ¡¬)Bc\uMÒc_Anˆp‰¨«N£ì>Zœ$“PXÙY™/—©$Z©Fšj¬±†þ?¿ü| OB㊠T· !8 u9 Y:p;FP‚¤ÚÅtW!¨шÆïþÿ¼°EƒxØ0Þ7—¶°Í)½øž=Ýð&!ÖÃÁë‚ý!é{½Bˆø",’]çd!IÙIÄÂx¤ã5ócb?Š¡9kpŽsúÛŸçtö¿Ñ @zÚ‚&¶T  (xF4¦Q2C».‚oDcƒì×Á¦ ÏL#4Ú M8D•0:Àf$øÀªh3ÛôH†xë FDú-I€ë¡àžé qéCÙH¾ž7 ¢‰MŒ¾Á9ioŠúãŸA׳þ¬?¥G`©u , ÖøK`S˜‡/HhLsôš7әτf4¥9Nv0³¦ÿ ‚oc•ŽpÃYOI¼4 |À½"yOIÊ©$°È7,M 1KÉâ’z‘rŒ’‰éøÅ2§ñOiTŠTl¥ÿ`i'pmÑ6œT6 Ë8²2ähE-ŠFsRH¥2™é¯L©¨,’æ‹b”šVÒ-taŽ*+Uìz@È^eˆƒNŽíÐ í‰U² qqu( ;ôy¹ÌeƒƒËL&@ºÊ*ºò ßšeмQ£QáJm1Ñ2¡‹†U¬c…šd.XD  ÿ\&A¼MuêS¡BÍ5a£Í²U‹U8q0 0t2EŠdN)Éœ']2"™<ŸÉ²Ä^0¢ÿZG½\ð¯gpPŽþt*þòÇÊþ]qª²ÄSŒ‚Œl5iç¢Ô\ÈúZØÆQd<«? À‚ûu´­¿ûZÀ˜1¶¹",¥N‰ É͸ñ5Ã` ñHÂö-Wcç¯ÄÃÉ“¨”½œ4Ç)ßi–©ÿœF@=ûÙ¨Tt±$ 4šÔ¦–«©)Z| [üæW¿Žicmm‹Ûܲ•ƒ¼ý ð€[¶P)€IhÛŒ›× $wnu gëƒ÷š3º9Üøx¬‘ýÔ:¨`D>¹[³Rfã_—âZ×ÄËÙò>½­èÚxHíV±‚à8m¿C&r‘÷b†úfMáÿˆb€•9àf‚PÃ+ÞñÄš_Àæ'x° # =¹I`z3¼Þ…uŒ!éœ8Õ!¯çœ†Ø"uå‰kÆOs˜cÊ+¾Tx— có4½5 BspfÊ@ V’/v’œ.#GZÒD.¦…Pý¡2•mu«3C8Â"Ï vʸ|ÜÊ œd¶°®l  aÃF¢.“*™XòI'%¶3Ͳež&ËNÙòH¹ª/'rÕŒ¼0mƒC€XÏzº: œ Lj:÷ÚZ–ÿfôüÌa»Ï.þsSc|^‚†¶Ù…Þ†½'e öø¡Ñ6Kì¶ýq3ÞF`ø—éû±õ£å~¦g@#Ò˜Fé€Í4ànnºTÕ1¥·¬iá|¯¹o†_B@‚:0b‰oÓë! h<`¾M¸Â[œÙ†'[ÆWo¡=`4L@ìÔÎHÈ9‚§]íì¶¥ÅÑÊL¯uÜ|kŠVôòÑ„jÝMy‡IFaÃt‘âÌ7 m!èJÖBÏá$««€3ÝZ1 ƒ§¬õhœ(`g±ÍðÍ6UÙ3–8?pZè쵚èÚ]ÿúªÜÒÐÙÉ£(÷Ý63¤w/ØÁ ÿ°<¦ØüæÇÕkÄïWÀ8¯N‹®‚ŽÎ}¯Ó =„‰%Ï&~ncNÔˆ¢2û•"ªwžÏÇog=èf¯€äˆ¿H•-_rúöó§?½Ú^ÛKîäâ7§.0h ˜à*:H7H‚ˆ€ërhœ.ƒ›½‚)沞 Ó‹› H>5c³Žaº¾úx‡7(„pðnØmؙ˛†ú?a?«#?@Û:в¢91€Ãƒ !ö»÷‹€ ÜúB"dhð/µ0€9©=îã?fÒ½;›$ßS X¨x :X¿#¾Û« ›ÀV[3 [&¬çéÿ!x…ê3*¤$ ƒ°‡oð†nо¹Ÿ :‘;zAÏ[8¬ =­;?f³†L‹i¿by¿ '°*BJ¬Ä B}¹´Ð©=”Ã=rÄ(|â¡ã1™KÖ¸-t 0<5‹0à 1«›»)3 @ÃE‚#Q¼Yó@9œCù€“_Èžø q‡oà†nІlÀ†î‹:Í;8Aä³{1‡½ˆ³"Ž Ž!°GôÁÔ*‚àp-K¤?lÁ@Ì ü¼B4Ie‹8 Ó—9hI—|ÄŒ ÇB©I½ÜËÀXGü*ÀÀ4yT¹«»€q¹’¢&£ì€ØBHÊXJœÓ+DÚ¹Á+3ŸÛ˜÷ZÃ7œH­tŠbx˜‰HŒÜ è °PFftFh¬†'›ÆðÄ«Ë:óƒ*X?á0Ÿºt?ëx´ÿ²˜¾,NãÔ‹EÌ€¤P¹ƒB»)¼3©?ÂB-DÊ” Ì•ʹVÙEò«(¼NÄËÊÐl:h± œÐ‰°ÜÈŽtFîÛ´ïÓª³MÌÆ­ëÞT‹  ËŸzI¬¢Œ:N=N@B2' 8q&‘’«¼;)RaëŒÌ”ð»í,>W9>™ O庛,‹H…`•M?mÛ€ ]†;ÖIñÂÑÞíP•„ l_Ã0ƒË` ¾\F£ØUÃ9j%_$€€ …Þ½¾ÆÍe1ôéõ)"f[{½_õpÏÝUìÕ”Æ`ÍÙÛß´ ‚ÂÉÞƒEØÃ[Ò ö 3Qvl&nb'fâ90:)žb ˜`+6Ú"6 %NöP€ˆ0xR®Va@ÿ>±b`„|±òù)yRáâmœã×ä½×ô˜QÍÍÃíCuÁ&IBYÉÎ^Ô5Rˆ…‹Íâ½à€†,ã2†€'®d&¦bL+–àFG¿\XMQ^Mž0 0„ –dU6 @€4N…P YkißÞ(È5ƪ’9&^žUõ„áå]M™ÕS>ìÓÌûSjd;Ó:d)A]E%Ïguä¼0 ãUÞæm¶d'ö)v€ÀâØÚâ£eQö uV縀3cnŽç²he~eX†åY…qxZCð¡w2^ªôÛefû¥S³å ÖÜ\^õUà„»” Ýÿè8d>á–\ä´?k¶‹Œ’gi$ŽN†­OŽPFçu^g18 @e išø[œÎi\žžðijChçè©Î$ àc}åÜùô\A®:nÐf!€ŠþáÓMä–ÑjîhºC­i°ë³Ž~-sž•^iŸhi1 ‡ C8_±®k»N´ó…g}è¨ê–æŠð¼åê˜Ô»>ìà 0é[ºtVkddk 0á ù†À€cmFlÏk ¾öëhâŠhH¹àj3àáÏníUF+s6b†ìÈni·~kËÁŠÿªh$½vmâ®iø!‘f >a³£ ™´f$+nééû«hlÛ¾í¶vëʾìÞ6AÿàþÕ†ø ážnõž]ÑmÒ^ne%à´hÝ"Žî¬¡çõÎï7"gŠJNC°mÉ î&ËÎCñfïg gÌø€ óÝ`ý®pÄ –ÑVrzî,¶ï? €PØ(q?qGñ]XqoqWcñz®qü¶p¦…€p«E PëŸl¯ènï>ððVpý g gÜ™V" *Ho¯ò³˜ƒžêkå†oùF‹Ø.bÖ†€PHq2/s3?sÿ4Os5oó—q8Wc@°q:k(éŠJN Xé ðÝæm#?rªXpgòÏqòž,¯jèÈ *·rõ†‡@îä¶è)i€!îhÃ^1_sPuQuR/õ4ƒ…ÓÒ´»¨·ÖcÔîír"׊ÞFðô$WrC׿Vâ>*’¢Ü2/i˜Sö)ÿjIk!Ð ×rhFàÞhk‡ 1€lßvm7uoÿvpwP€oó #Rlþ"<¦i‘=_kÉÎíZ7ð@Ïõ=$ô„G&„»`—"bï(Ãä´8 ðHWöeWe*¨ôgïì•ÿjîè¯1¸xŒÇxmÏxŽ¿øßøŽßv×ø‘çv“w”OyPu›†NÓ,Íj†èòCÝq‹Òh4§w/r¬@p$ßõ}or_·=”Ó4ó"/zy(ëÌ(6n0‰ 0Ž"óíì…¯Ô\vx÷Öð €à(ë ~õÉ…?{´?{ïøµO{·Wû’yŸû’ÿø“w1@ `*¾ïûezäþþ¥w_ èsÊîy@ÿyA×u©àõM<ô_§¢&ø¤'/¾‡y:â-"¶à›1øŽƒ/’¼Žô¬GœJïúhwòLíרP¸1°}ÛÏøÜÏ}ÿ·çý·ÿ}àþ¸g{¸~âykíRzçwþh° 2ü5ÂyøÚùÄÿs[¿wñÎ÷Ç/ôÈïw`?z¤ø¥gzßñ#6‘2MѳÎã9:IRœ nx¹6ý?ý™,hð „ 2H#„‡%f¨˜AÆŒm(¤ðï#È"G’,iò$Ê”*W²lér¥…€®Ð¬ió&Μbr^ÙÙógÍB *¦èѤJ—2mêô)Ô¨O 'í*Ö¬Z³F€°Ê˰bǦ„Öð‚¸´jñ îíÛor¿y«ë^¼ÝövÛæw›¶ÀÚ²&Œí06jŠ©ÿYkܸäjY§Q¦ í2´hš£=ëü¬hÐÎF;cfš™²Ô©Í)cæ¬Ù³hЦI«fÚálÚ¶uãæí¸pi 0`@‚9vìà1cÆÒ+¡b! @h÷Úð;øðþ x(?‘¢Å‹%8h¢Ð ÙøòçÓ¯/VH»®£ÙŸ'€ 8 hM*xTOHIå ¡(Ä‚d[Y¸U Þ%äƒ}z 5¡VZm¹8sÑe×]yñÕ×_‚VX6ˆ%¶cŽEVáU•Y†ÙfœyöYh¤•všj«µöZl³ÕÖnºñæp‰CœqÈ)Çœs3tðe7ÔPÿƒ /˜i¦ ,´0 #°‰È  †0Çs4!Ÿ|j(žxs@dÞDé©§Q Ö‡:ú(¤ÿŒ PäXz)¦™jŠ)ýYÚ)¡z**©ÿ™j ª©ª* O ;Ê:+­Õ° ¨ADºkKf1¤ÂZ&¢¨"‹-êÅ×_~ÉH£8æøXdZùˆYf› I¤h¤fZ’¬¹Æ¤l´Ùån½ýÜpÅ—ÜrÍ=çå—b’Yæ *ØÛ ,¸ù¦ýž`À$üÁl0\Ã<  GlÈz6qñž|‚gCy„jÑz¸—4¼š|2Ê&…ˆP™‚±ÿ)Ì1Ë<3Í5_ ê§£ê\*©¡ú¼*€ä(TÀ³Ž}4Ò±ÀP);ÒÊ ÍQ¢°p©¸b]yqób²€ Æl³‹½£´•Q¤…ÖŒ‘Gr«kKÂî“äNy®•X®«\»]‚)¯ ôÚ«¾úº¹ ýú ° ÌAÂH¾Ã8ü@™O‡QEd0¨4|'ègèz¸ÔÄÓ­»î¨êeíµÛ~;î´“£;ï/ó¾;ð¾?<ð—¾l3òÉ+3Ξ’ƒ¬ÎJ?=õ,8¯£,NCÀV±viý"ŒÊ~]˜7*66ÙXM{¶µž­Ýö¶Ýz ®“ãb#ÿ¥¹Uª¥·–úöœ¿)phºW¾ö…8Åià_#Á¦°ÉUîr™Óœ*‘ŠH¤c øJÐ1…u!€B𦽲0,ÈOîb(ÃÒ°†6ÌÝî|§ÃOx>,Þñ‚¸<™½ !#Põ’(=Ñ)ðia¤F&µï¥(|Ys×bt>ô!GGk_Ì?Í imlÓ’àv¿¹åï6ûÛÍÝüw%uKŒW‡À.q‹{`!7Á P®aÀÜ7Ç¹Ï ª"ˆ]A ‚’°„ Ë$AÅMrÒ$HHÀ…QŽR”¤%*g§ÊT²r•«D%,gwÃYÒ²ÿ–¶¬{—Ã"Déû%0ƒyjÌa!šìd£^x½°EU” ‹´¶5diq‹5ê¢ØØ™É¼ï2A*ãüÐø6¸É­IâºÝú‡®9f‰]v„W˜ò¨GÂñ‘_l9 Vð‰ÌàYž”ÀßA)yK^2jÑ2#ÊÉb"„”½(F3ªÑRnT£¦TeF[)RWŠ4–´“å-SZ»„ÌF.})LaŠ ü(„QµbˆYm.Å5ÍgͰeZÛt_7«EFpfk4ÛB 9]ÃFÚÔíq\'Ýé®;Æs^¤§áìÙ@Æ9N‚ƒ,¤åü‰A .²ƒÿp¤>؈ ¡#\hz0BÓƒá¦~e¡\ 2€Q†¡£†=,b«ØŽ~±©EG*Y’f! Œ2«ÙÍn6Ø+B<ò×ù(S!àÁ°|M,î¥kËââ0½¨£hqóGÞü¦üŠ$Îq*#nR5gUùG%¬ÒQ«]‚'àæY8úq¬dͧ%GÈ~"²Šôœ@ß*P’‘d]Ex×ÓÌ  íhÓ›²„ …u/|ã ßʾ·²ö­o}í«ßÂê·¿üíïb,à#zùg¬`À»þ€¨zÇZ„¢§ª½â±Z›¬×†¨E“Um§1Æ¥ªM·»íVÿj~K7ý oéj§q¹šÜ¯.· t >¹Ï鲺×Å®[áŠÂ†ÌÁ‘ví^ÓXƒ@à‰~r¤ùR¹ÊV¾2–ÝKß÷j¹Ê[æ2~ï+fþ’™°fö/)ÿKàŽ !]{3œã ç0${P~ "ð]ØXÓ ª×f¶Ø®o¶´ £moKblñÄj,çŠÝØâ*å­¸[Ú*½Z¯=2·¹8.« ¥‹V þ“­@näv)°d…à`»áU(y3€…pèζn””ñå]óº×¾þõ¯¿ faƒy¾]3²+Ûf„¯ÙÎ~ö³=p½pܺ%>®¶ZÖ–/Ѓ4¿ÿxhi$U©ict£ÝÕ¨âïœQš4qÛyi¿áQÓƒ+s÷i膚Ÿi­®uÚVTs·» \_=Þe`Õ)Yµ#NŸ\ã¡âCÅ1®ëŒ[|ãÿ¸ÇCò“\×%6ÊS®r^/û Ò|9Ìcón˜7!N”xJò¼!XÑÏîvfÁ-[CóˆÜIÅmn›ªî$õÒmTŒUÕYiy ¹c²7§m|OPï­ÿ.u@ƒœj P”!puxÅ[ÉŠ|2!6Å9ÜÃÂÞŽÓ½îv¿;ÞóNwãï¹È?ò“~廿eA„° ™3¾ñÒ,;BŽ÷’8ØÙƆ¾aÿ_“Ð…6jÑžh¤—XéOE±Š/ãî¨wê{«ºÕ±Žo­;7Çë7¿¾Ö°\N¸öA @´+ɧ˩Aì<ùå¯dîx„Þ£/ýéS¿úÖ¿þƳÏqÀñB±Â/þñ“ßÝ>AÞÎü´*˜÷s«ùícóóÖ#¢E $Ò‡Ó©õ#§Ó­¼¹^5½u•mÚì‰Õ 웎uÝÀu \ÉIÔð¡Ý‘U @묞{ô‘  ž >_ – >Ÿ –  Æ ôÉ ÅÍ` bæ Vœ÷Äo\ ¡a ß@ šAåaÀ¶ýÿÐ •‡iÓQå߈[ÿùoùV»W¹´Þ‹QÝ;eZN‰Uíqö˜N vÙ}‡!ȉnàBAžAŒ@æ!IŒ ö¡þ! ž  ¢ â þ¡!â  #VÜ >¢#Ö $î Þõà@8&f¢&nb\h€ƒA¶ŸÍ‰·=¡ ÁV¸]Ñ•ÿ™®[o­p±Xþ`¼½^ÖÛfí9 >¥¡îíV ïáwùñm éH$õ•>#HÄÎ"5V£5^#6f#!nc Rc"¾`7¾ &'–£9b¢ÔYšAC0¡4ÅŸ·¹TJaˆéŸ¢Yÿáþ»MUU±ž‹±.bš.ÎÓ.ÐÖñ[×EàrPïÍ 1ÄÀ€Î!¬…À!(Bc"ß@@ €6†¤HŽ$I–¤I¶œAh€‰¬$K¶¤K¾¤\ò­ŸCEÞ;ZС¢³Ð#R‰Ñ=^K>¦Ñ>Î":ù£eÕ¼q*W=ä"ä 婜©1ä@H$G" ø^nA©é”€B€Fj¤Œ`¬%[¶¥[¾å[~$HÎåGÖ%]Ú%^Ö¥Iî%_Z#J„ˆ`&a¦aŠCÍEž“1Ÿ¯,„ p›kA¡ç}ظ‰ž=šPºâé %Q¦“dÿ—2eX9¥/þ¢¨)$UòÞUºaVvàÁ¹f2ŠeD$¦A áY† ÎÄ´%^Ò%pþ¦]®¥\Â%q§pÎ¥q.'\Êer>gp‚d_ú¡N¦u^gaÚ¡AHMBd†u[<¢b*‚^ÙŒ^+šž>6]ráU V äRÒXS6×S>`jª¡0žZC¾æC.ÄxåW‚%m†€1.fn‚`c2s.(ƒ*§s6([B§„*'…ºåƒN(„.è…‚dBŒv~臣?¨ßä%hBÈùlÞ)vžçIá*ú¤¹á£Ò-Ý£¥žÖâQ"eÕ¦|–&}úbtùÛTJ‡ÀZkúØÀVÿ„kN¤€Še‰èú9Ü@ôf†f©–n)—'—N(†RèGƇ™ž)š¦©š®išŠÃ ˆ(nNÞ’ÄÀ#ç±èÐÝþ±bü”zf¡,Fšg~¦Žæb|*`2àsÙ§ªU~Ze") Øl2¨“ èYé@@•æaL°×Zb)–@©–j—¦ªª®*«6¨% „ °©¬Î*­šÀ'‚`i)Dh˜PÍý'yö¤y.šIz6öã~ahÊX Χ¾-*j6ª£^¤ãkÚ€ Ô¤NI$€ÎfÇ Ô|ê3šhA ©Žª©²k»ö&¼¾«¼Æ+½¶ÿ«½®ë½ºë©¶*¿®ê«úЪÀ왚€:®ßœ:„)®¨‡QæZæe’£«P*I²Ú†¤áè-6+<j´úè´RµZëBf—¶&)·rj$Ñ ¦¨Â©¬?¨¹æ¡·„ºÂ+½âì¼îl½ö,ÏÊk¾­ÏíÏÆ«Ðê«»Ú«ª&„(€q<-ÔF­ÔN-ÕR­(µ1_®"䀊újÃò¤°ŽXfþi.ÉÒb{2kŒ9«ì•¡i>TÞg0b«Ébå¶ÚTž?4AV¶¬¸Ú€Îì3n­A˜*Ϊ+⾫â6®Î:.ãFîÐ>nÎíÏZ.Ñâ«æb®åB Tÿ-膮è‡mn§Âˆú ȸ+þYf2UºÑ¨’¬§ÚJÛò¡Î¢JkÈÚ^J嵩Eˆ¢¬ \äBÐËbª¸&lFê!4€IĉïÍdÜ%¬?ܬãro÷z/ø&®ø"nøR.ùŠ/ä¦ïÍJ.ûV®ú¶/çÒ+K!ýÖ¯ýÞ/þæ¯þ*€vwÆÝn&ôjëæ)ˆ-Ù&Ý즧9êÓå:fÛòhï‚ìï¢!ÝNåj#V¢,àÌ„¼&¸†« .ÓÞÚô‚‰õÊ `Ìž|‡Ì–(C”¯ ß0ßðùâ0ãò0÷î0ú®ïûþ0ø.î#®×ÿÀþ.1/ñ ˆè”J\êzÀÎ#Ñ…µ`¦§;ðúîJpRÆÞ.‚•×çÈŽš£n°‘FêœLªÞ~ðwD$”°WŸôï@8 ­ð—´0¼0Ƥ. Ä OÞÕòf/2#7²#?²?²?²BB_2&Óo À)ó0B7H&°êéÃúHÄö)ºQ,o!kÚ岊ñŽ$iæÛA2jîÕ-ñÞíñÂñã€òvDÛ12j $5™‡øqõz¥ _ !²3 D†ðx@25W³5_363²ßÀèv³7g ÜêòUfmýÙßž*OìnÁ¢_Åíª¥Áÿ,-£±YeððV¥.K*·Æ1H³?€¥3àºÚ/DœŠ2ò2Çð3G´DDBßB€ºbt6o4Gw´Gÿ«?Xò7´èFÀÁÆ]"÷7W¦:£rPV¬·\lÆ®-,¿Ïr/2ðâžûX.ï.së÷@”º]A×ñAo—1RA Ãp3O´TOõ÷é¡á*Ä`´Vg5WoµWwuF‡5WµF—µX›õG§55{ ´[WmJöFœ2ĈgKÛK«+Ò®zÒ´gþcVMð@öè=ã³O«æekó2ôÀèq$ý³A;ïvÕ,Ug¶f?óæÿ¡'7„6Fo/Z—6YŸ5jõiŸöW·6Xõj›vl§u½µmKmBûïéV[\ìž)—2Œj±ŸÒL¿s<ã{Žq=ó"âxµïO_3öPÇq@6!7³0OdTo6y—7Bãg›÷wx{‡{ö«ˆ6i˶lÏ6}£¶kç÷kƒõBÁþ÷K¶@ü/]WÞ][q°Raû)W,+ó#‹½r¡Â'ïÞÜJ·ÈR·j^w?¿1Q?6d5WRve‡kZª7Ч8¶idz«¸‹?³W´wŒ¿w|‡ööN3i§6Z߬ƒÅ*€ÿ¸¬vOfû6n´ÿ¨ØBì‚·£ ¥ vŽ‚!…_]_øÏ­¿á2?¯?øvGöÁý3·–ø ô‹Ÿù3/4†ߢ¹›¿9 A9·©/„šßºÄ Lf’Ãîþ-;¿¢;;ÝKø<ãôs$†÷tbã'‡sù;ö—ßΘ'uózå‰Ãù›kÇvpG!ãáYš€{:ª§:ÓÎ@·º™’€8ã\‘ÄàF^‡Þ^ËhƒËtе2”olÛæ´a÷">º–³æ‘z¸vCö”.BÀˆ9xcª™«zðqÇv4PÁ¶FŒÀ Pï—Ì€ˆ7Ä!£w›[»º¿ùÔ€¨»hlÿÀIGÜžDÜú‹+_Ï(÷:„×tëM@`…C÷N·±i‘¶ñÉR:³öøg:™S@¤;Šs‡vv`‡Sûž´ÉáŒ@¾°€½œIàÈÀ˜„;˜¼Ë©+„§æ¦ܺ×üºÀ»çüuö¶@@@ÖJÜËÀ¸(/ùúuÛ.ÀSI”¼ÛVy=)j†'üÛ­¤çmQ?<ð-L¼´“yÄ2ô‰4AÅTŒ! Á< |‘@ã ¡€È»I¾´@ Ž™¤üÊS¯ËG4áÎüxÛ<â“·è<ã&8ä¶oï6”]µA¸w¢w*7ÿ¹ÅúznhlsDzÇÚóNO}BBz¤ï§ƒøÃ;;“õr´“¸Rû^å‘}ÙcÌ‚î‚ H‡u?€åL@ålÀHW Á ÝÌ Ü}Þ“¼šôýÉÿ½Ê×Ëû ¨ÀáGá‚ÄPÁö'¾øK4Z4¾ù—È©¸­E< \~¾ë{Ùî:,>xgþzèêè3ú•Û²ðă8¨ a† !BxðPB„ aÀ°qŽ=† „?‘#IŽlÒ##Ž‹++¶œ8§dI"–pB!B*8ðAÐ ˆnØp) ˜~ø@ª ©'4TÕ€bÅŠ[Y°hÑBÿEØceȨQãÆkgÌP!$f\¹"›ü³{o^½{ùöõûp`¿â8PhÒdnbÅ‹7vüräÅN„³|sfÍ›9w·nb*‚I—6 ¸ÃäÖXWs]MZìØÓhOƒvZ4ÝÑžõîÝ x3gÃ13n\Yreæ”1sÖì™nhÓ¤U³F [6mÛºqóö \8qâ 0`@‚9vìàÑvÆÚ7ΖVE‹®[G¬@aõ©L€Ê©˜R © 6 *‚ ‚ú© ƒZ¨¡‡"šˆ"‹lÈh£Ž>*Æ II¥•lh©¢‰BœË‡šò€¡œtêÉ' „bШ•ZŠÿ§ "A@ª¬ÂJ+®ºK,²ÌBK-¶fø`EÉL:Ê*­¼²4qäÛ’ËÂ0üòK“L2£”Í4Õ”Kˆ<{Î8ym. °¼O»BRŒ†Ö^“m¶ÚpËm7Þ| N8âŽCN9æš{.ºéª».»íºû.¼ñÊ;/½õÚs¯-ùè«Á¾ðÓþü³Jƒ¥"Ð@DjA¢ˆ ƒtRˆ¡ !’(CŒ4âÈ# Š ‚1!P"ÑDa €€ÄfÁ¦›pÊ`'ø)¨†*ꨤ”jꩨ¦b•Hþºò ¿±^(무äk ƒ3Ñô!Ï|õÝ—ß}¡áàF“à—Ê<¸ÿ :׌LÀyâˆ%ž˜âŠ-ç{câ ßŽýâ@µ×\´6Ûp+ÔÐß‚#n¸E•[Ž9ç ‹FRë°ÓŽ;ïÀ¼MÑS=Pã[kÔROÝo«UÖ1H°Ö̵ %àÕ× ƒÝpX¥aOÅæX6%ODQᘨ öű± mmô–Á½`Gr RÈ«°R÷Èv•< ­ygèA㸠€)1;=~òÈ%Ÿœ/3¸` –kð,þôÐ!¾`1q(<í¸2™dA-Ô·gM´åã^6'fHi¦ÎæJsÖ9Óž9º½÷†ž¯>î Uþúû¯*W$Áÿ)§¡fðÖŸˆpW úÊ„í°Ø"Šð¡1 6b¶Ù–K¶­UèmžâæöFu·Çrœªo(ø›‘Ø•¤w-©pNÂc­Äpìt”à)è13l..TøÆ9ØA~„!áE ˜®‚y™b„ð'Ù”Ìd·Ý¡Å2—ÝîQ3«¥|w©iÊ0N1 ØÙ2Ò¾g¥Ž$¨Œ®U?mi/EÙ d.œ €Áº”$xÅËpïcŒT€Á˜t …‰Tä"™q$Ž$"ÿá$)YÉoR. 0C#©dô-fu­s w;Ù­LQ¶Ã¡Ì"Å;ÖÜÌRÀã™Ï:4ãm©hÊ3óö¼¥½Ê‰Ö»ž­¦¶½*^Í{–5Ä5ò}È>@cL0F•ˆ%0 Ab ‘ùÉÈ~5²Ñ·ä(.:úèçR‘ö8Áý1h Óý²$ˆää>ùÙÏ~‰c1ðÆ@ ZPƒt – !8¾Aϸ€ÀŸéÀ4c"@I£d¯+eìj˜JU&'wÀiå¤`™3LÍ2ˆµ,|ŠH*]"QUK”Þª'«§ÑJЏ2¦Õ°†Åe2s|Ä‚¦€ÀŒq}ì»Èÿ£Æoºñ~ø#§Ý„·s–K@wD;ÛÙG òiC¥µŠŠ$¢iUëZ³Â¹@@•ë\éZWo€F1£a+^< ™¼p”„ڨʀòâ|t9ÉaåîHÚCYqxë±e¨ˆfÄ]æ§—J‹^k ŨejÝK&ø¶Æ!¡+š4 k\š0¤^³Yˆyklâ67ÒŽtÓßþÈ…Õ mÕyîô#›´–·8F&Øã³Wç>w­`aìZ]ë”xmÜsGIiŠ6ƒlÊNYX"w9iïpæÃà Oˆ“=^.—‡Ù$úò—ÓëìM£HLƧ£ÍâMÿëµóù€48ëH áZk*Õ«%Iž:#ÜJµnw³joí¨Õu·€Ã%\q; “¸o¡Ûbs“qB¸QcßÇ9ÖñŽyÌ xW$T«$ÌdT£ºáhGkÇ(†t½”™I_•±².­/ªî«Ù™ӦÔšNwÚ½+*3|*p±P‹`C$ ~pÙl@ ûcl¼–…ÅÙ€8R•·ýó­:«¢Ç®âç«\‰ëõ8ÏŠ©Ë‹)]é â“$sèñ¦9Ýin¸u.(ŒhwÓ$“RÉ4De“™ñ²Ä.v‡Ô(©{QYù¶´,/åe—eÊÙÿ'ò7jc¦b€ÏLZ rñ™mN°lÅÖ¤’Q%o£žÁÎÜNUÃü«c:=\h® 7ѹëZ.pç’ÐÀy#(abæ`iw¿rÌ+7ºQo{ßßùÖ÷¾ùÝ ˜0þ$òÂTÞ“ –°´;,zÕËX×H9–'…l|WJYäiù²ÍSb~›fS`çtØfÎÚ2·èÌÓ8Á f :"ghÁÜT`cµ/<Î W•ýëpß®òí‡û$^àcæîô@1Žƒ÷Ò™Ž§pÜÙý–úÔ©ÎÇD“ü䀹C€Ž—¼L^¸“_ kWÎú±V&žÐækY˜n|³¾f…Z+ŽÿœäjîâPS.í0¶ÜådëÁ‰ý1óúY[ªäÌ6tÎmžÜJZô–†î˜&}¬SÓ9ßy*T1ØÆèI_zÓŸõ©Wýè‹,ˆ6Ì^˜?xpp„‹}ì8lx¬+qµ¯ý–Y6Ú®cʪ/ïWÌ -ó„œ÷ 8µ)—ý\ç–¿6#˜–‰Û²Õg¡(çŒGgVïs¯J~ÜÐ|c„@çe%óŠÑ§çé_ÿ¾€Zq#Xýþùß,X¯É¸N$„¦/.ÀöÂnÕXív Ìá ŽÊ£Ö(Ë.nøì+¦z ˜§üK{¸çî|*͞ϋ,å|ÀÜ Àúÿ®Ïšzå‚ ö näfœÀ/Ðü€ p¾â‚nKZOÆÜ¯?à+´O$æÏþ– ¥+1fL¢P § «Ð ¯ µáÿ’.‘bï1¨ º£öf(ál÷Î.;Ú+íh ø,޾.Kᎉ:ð×’¯˜–™ŠmÀôŽ|N0åhàêŠX\pŒ„p$ ÀhÎûâhñ˜¢ñÒ©ü@Ì +¹IŠ0+è?Р K‘ ‘$„@²[±·aîLÈ$h‘‹jl DÑ|À î¼ÈîÕt'ÖÐÎ÷àpˆ‚ïâ0îíðëõ+?í®G®MïÿqKÂ>ðä ÊmÐÏ ñnr(q«ØéHúÈ]‚®IŽë1 @Œ£gÁLíO @²Áÿ R ’ 2> t$Ht‘$¨`¾Á;¾c MRMÕÐ0 ƒQ‡h£±Ü°S*åÐíˆÏ/V •O§‘3O.úRÐÜ„€¨ZÐÙzàchàðjnuËnÊQÛüç·ÖI½‚ÁJ^:àïÜ4À?ê‘UL(«²óäM4 R+·’+³!LHÔ$Ç Ùº#"=Gy‘Í‹ÕZ­QKÙÐ#«Ìå«í”‘$™Qzœqî>«˜V²§ÿÂØlï”m‹`ýæ¢ >Â&]Kƒ'»OœºEñ„òœö†Ðzî(C¬­IÊ-2h *—ˆU4@Ò¬5™î‘#°Á5_6cS6g“6kÓ5sÒ².rò1š€ºpSÂcݸé–Œ-ð-×°##Ž.ƒÈ‘q—Q³š±ã< 䤑%Ѭ´ å1š’Ó&i€ýÁv"œl2oΜôÆŽÊo3“ò€â¥Ij2@*K³*ÆR.&-5ÿÓÒ@/1>À6 Ô@”„ðõ‡?'ã~'¡Æ2 àÄ$à" +#ÓËì–“ÊšÓÖ*×t­KRîP’î”s0ÿ_úb2Á¢ÉÜ@@<[$ƒÀéæÛæÈ=)1âSpæ3¬.2š@€ôÓø4&ð@›”ÒðO'G@Ö¦”J«ÔJ¯K³TÖ(4¯é £¡Å-Aªá"áôÊŒç.3PãôÒמYÿKY›ïK3ÙºóO}DHvFÙu.°UQÅ‘QyTÐvŽÛI\…4̵$„€ÔU@T–$”ð]‡6¢öq_i“ÖH,ñ¤Up`;6¡ ˆ  ÌíÔ4Cár#9”Ö&îÊ.0:é”4M²/¯3E“I;mÍ®qd¿ˆ1¨À|Š€1u$„ [qGmÛÿvðÃzÑÆU-ZÀ)svgK³g÷ÒLL1Â’h#wŸ°r.¨@d.s3Ws7Ws3À„¢K¶1@শޖ ¶<6…S3É9~±aaF9Ù‹9XÉv$Gt:ÑÖDý’c«FäZÒm¹ÓEi š¢©t‘IÖn`›ØÏB€Ï\(M\8ÌñföÐ~pÄ:Àp%0@q}6«ä%}ùéécu8×}ß~qS7Ocà\¦ìt«6u¯6ˆjÀÜ4vpv%Ð,?òCqwN/cñ0mñtmýYßÖXDöE÷y% yí–<cn‹oÙózc6{×HÎOÑiëÿÀ7Œ|Ëw*î,}c˜“t.Là¢n‡sX‡w86€vJN£_G·ðWV7h{ÆgÐǯUó-7´w|µ'VNK%㈕ãÀìNÇìwƒ·m “xý´‚QÖZ·‘y‹À)w2[|òeývüŠÒÛ,qpO¸p@32 „¤g]8«~„Åd JKZ€‡‘wø°4ê×1îW;,¥€ø½ø<~†¹€wu€eMŠÅ6$q)w/¶NøX}7äFð‹›I‚)Øx3ƒ&w÷F%óÚ@xÃÜpãXppòD Ù¯Ú0œOwœ%Ô`Íùœÿ%+ÉNCãlÓŽ§oMø€š×ŒÏN?OÌ‹W´Y]ùxQö#N ^™Po¥ú©Ú­Ûú—‡kò Z1 Á¢û8¬È)Z7&<Õ¬c»c(WÝÚ¶oÛ­%À„H1/R2­Á®]:¯+Y¦/9=€†=ঊ%žAù«±;îŒu‹Q0÷yx“ÍYǸyÀµ3Èxš…(€³ÇqºªßøªÍ/)µúFgcÂŽ˜Âº@ D…V¶û[_VWQFÀœÀ ÜÀuC~7é.æ:Y8ÀM#YœgU¯U7‰iº§ÛC©ÀQØb#Öv:“±‹¯º«“±ÿ»c!˜ŸûYŒ_™yÓ´ýÜŒ! ƒk0·€2µ½-Q>ƒŽ—¾í{µY;¿9`¿ý[Éù…†åBÊ£ÜÀ¡a‰ýaÒ|»1¨€T]ÂÅ”œkµ¸ûzˆÚ£&cŠß9l »âæyX©›:µøº“•ØŽúØL®EÑŧõ#§žìpià¼×\rð:]JøÇ-ÈѤ¾ùxµóûÈ9€LÁ—ÓñdQLLÉÓ?ÔC]ÔŸa‘óê™Ùä<¹RL8¿œÂÓÂÇTtÊN°Õü A2º¥ûÍI¼­ûÄU2ÅñnÅ“ºÅÿù»‡ ¼é[åºnÐÉfÿ½½ÍŽ%ãÑU¿%ý$%ñ|3ܱäÔýAŠsÔÏÝAÝJ}öüAËU½Ë xLÁ<ÌûÂ+n¬å´ÁkÛt§á0”»×í0·:Ÿ×V»A¶Oõ|²“}tQh ÆMB2ÕÚÛs=+ÂuÑãe†Y˷ȹ½Û%J¸)ÜSþJäfÇåƒ#ÝcÞ7Täõ®ãÁÃÙË%”Þ“ØÞï(ÖÜ(@§çro7ĘXíYÎõ̲[Å‘záy³åÌm&Þõ*ª·Q3€ •ÚÍf%:2²}z¶]Ò%‘íwä4UîOc_žîëÞîï8LSMÿš`^á]çåÝÕù׸kĩ>f ße¬¹oÆèãy×…•ëY¨ñYmØÎ¾åàֻų#¸šÜE -Þë£(þÐ"U¸:“pÌ2²=ÒIží%qG”âíã÷ƒ¶ãÂðÞ÷Ÿî+M ௢œGðyþÕóç ŸbåÃÜ$Àqþßuݰ“Ñbƒºà)_m¡þòY9Œ©þÅ õáeÙU)àmrt[Ë©[±÷QSìYÿ,ªü´Ó£I¾ä=®ö‡€ âŸÀ <ˆ0¡Â… :|1¢Ä‰+Z¼(0;zôWÁ™È‘$Kš<‰2¥3fT>º|鯉¸jÖÿ¬QÆ-[6mÛ¶uëÆÍ›·oßÀ… '.i¥ 8U5‡Ô;ªòà1#k‡­hÀô(äY4hÓ¦I£ys§Ï E‘Š[úTT«Ygp½Q£† /^¨øÛ‚‹„W Ð€ø„‰Å$H|øÀ!2 *oˆ€yƒ :;pPA‚è B„ðà¡„ZÀa#6=z H>høöÍÛG‘"¹ÜÒcãWŽÊ—3÷!ZB…Ï:wÞ<3æ •/LÆùñ‡Æ‹Mœ8X +Ì¢Åß¿}÷æíÐĹsCû7`dJö] á-È`ƒ>a„:(Žÿ~/¨„a†vÓ’~A4ÒÔtSNjù”PDåÖ[L9eTrMUÕWÕÅÕV,4÷•c™…VN<¥Ø–RMÅ8#]Zm…—^|ù˜`î–žbåý“uwYf›Y÷Yh£•vZjª±æl6ÌVÛm¹íÖÛo47\qÇõ@€‡zúCE¢M÷™u `§]ÜUö]x‘Wzé±ç|òÍWŸ yßž.ñçŸc>6 €XYžËq0aªª®Êj«®>ÈsÈÀL­¶ÞŠk®ºîªë Bhê3TC“M8éÄŠA ÕV‹L‰dTsY…Õ’wÕÐár u–±ji”ÿ‘0J«äµNö5_`ƒvX•WzJ —ÚiÆ™g E'i¦¡vfk¼&m¶á¦orÎI§Ç°ËÍ ÕYG¨v‡" â1º˜£ˆAi|ó©P饿:ܧX~še¨£nÙ]es8×Á«6ߌsÎ:7Hs xÃkÐB½©{B${âOË®xTR.—´TQ‹cŽ7à50™ÐmZC²U¤‹qM[­¹{¡åºìºË¼ZRfÙ¼_‚yï˜û¦¶š¿¯)°›,g #×Ê01 ‚V¼]Ì“): å™—žzí…<)}/ØWÃ'+®2Ë ºü2Ý1W–éÿWâì {ì²ÏŽs¶‹+ƒ{îºïÎ{ï¾çŽ×ú {V±%"Û“Ó*6+õ³ãÊH#ÖÖ2Ù¤ ¶/¤k ®ÙH¢mmõOެî”íj`¥ XÆ[·—õÚ+f¾dòÛwš×6ð›„ÿfxnwâ©8—¡q¢Ø²c1Éelc–kTæ@FÁtŽdŸ³O„§)N™.TzÙêV7:˜Ðn„$,¡ )Ұ倿k¡ w§Öé iÜ2^Zv2¤1‹EÍ{QÕft5UË.Zk’^>à!PClÛ+ÕÈe£ð‰m*(ßÛó®ÓÁìèRè…·øé«Lý²ßýò7¸ƒÑ‰8þ» ÿþB@P Òqœ¹îLNc‹j`Ǹ¹ŠŒR´T0¸'C˜®eJê>h8ºä„”¬¤%Mh†~/ìäï‚,!ÌÀ,Ý²É µ‘Cn Ý3´dÄÝhzØZ^œ$„L—[ž˜¤(†//kƒR¥tEôeQ‹ªó"á1ÒMÿú›Ð'5ò¦NmD\|ÀAçO¼Î u1ïdŒÃÜ£ùžAzn/–BP8É2Î̓äRÉ‘&\r -è«ÄPŽ8`h ÍU7té!D#"²¡‰P©¬U¶rjϳš,‡˜£Z‘ž2@¢~nÿð-¶t˜Ó¦ÚÆ×6óe.}ë››¼ÜÆhÎoš~SÓ5—ÍÂõïµ™Y89b:J§œƒ: Ó¹Gvúу§GV©z†"È'êøÙO.v±KΨAÏŠÖ´b¤BÎyÁ3žÑŒ¸Êu®t­k])ЗAe©(‰N™J¶ˆ£ž³v—‘Ò³/uÉÆÆ½_²ôjic1azL·Q nê“Ûy·„IŒ;-c5ÏÔýg¨DÅ$F€ˆ1;OU €úx9iÎ=ñœ`VoÐØ£uU<útdX-3Ví8À9TP«sŸ ]…Äj9P4®‹Ýìfw¢Üí.ww Éÿ=ù@,¤´(²»Ãú°j†&-ˆË¾¼`ªPT*Ù³Qv˜ç2¦“ISÏ6ÓnïmÞä·7ÓZ3pŽj&œâǵÁAŽ,ÙNÌœ¨­׉[¾“·W%$=kÜŠ€ÅMÝqÅÚÅBEàÂËQPtoŒcçöl9B‡ˆ~ ä È0È«­Û×R.ñ¢è]‘z©ÆÞ–º—ˆæºì“ ^˜PÁ—âúÞ~© êP‹ÚȲ‡¨àŒgp«x¦<F×"X©6ÊAœrHá»X*†@?ÈAd» ÅÊZ¶¿éBæÈà3£ù™&­›©ù7Àµ©Á^ãáð7™Çèóã UWκ…`o]©E‡s€úÜ'©Ž›\Êh0©™¦ïošú#À‰¿ÿ ð€Ó`Û`9ÁXVM¬V )Y÷U+£æJE«½C¤ò°­,ß‘±`ß1„lĆ¹Øš=_€¼ìвYod|3œJm:¯V8lœ°7³í•pÒÀÛ<çv.Õ>’” º+x‚ÃDà qáoykçÿFýнóõ¬ã,“Ρ6tö°‹]'ê¾Ýò¢åx¯n8÷xñÂJ¹â·¾e|©ðzùõò—_*fc“¹ÌU6 œS–·Ú>•s…jçnÞ|6zÖ!BcGsúÜP@ߣÐE\Õ¢—˜‚¼àºðèw÷SÒR/T‡'Py3h}ö´g•Fœãžè~÷¼ïFÎ5%ƒ\í ÇaòTép¸Oí•V "ݵf÷\0ò1²!z¨ßr »˜$—)gkúYÄÛëÀÒäãQsmFÞæ“Ç^±¥–SÍOíüÇ z͉^žòÝËû¨'*.u1Öz™ñzÀhQÿ{ è€Òú¡BAè ª„ ø€vÃWQkçj ‡|oqË'w-5K'R·$}Ó×êNÎ!à=!f—x‚grËÄ>‡‡S‰‡`‹×SèWAUgvm66Ài{Â8ò·aô‡NvýÑ(³ûwt{aOÔëD€8iR—€j¦Bð€i¨†1]_ÀJq(‡;`ðVÈjK¶pÇ÷4ç,ë=†•‚·¦XW6}™FF“¥}µ„qþ¥ƒß‡ríóE̶rAÈSf”mÓ6gêÇM6‡mK§|&1=‡G†B…Šb…ƒ…$)„TAuÿN_ènªI¬w€H/jÖ eVkHŒÅÈ1øB°²&5 0Ñ݇×ÕW g,•<:TÊç<´æ| UD,XLx§ˆƒŒÉ¨Ùç^€'‰%G‰Ì4`?Ølm&„f$mØTmÛTsx¶„6 t"Pøm«h”Ã1çñ(²8z´•§‹ßiQ×ze¨fYVƨ‘iMÏR3@o3t©&Ô$ÆÃ4 §ÌãJÌD߈XÔ#Žˆ82åHÀˆ^¦$7Hl1`—~ñ˜fkF~¥µçw©%sŠüˆ±a‹ÀE w4…s„zY2òÄÿ˜rT†‘´‹I†¯w‘Ù  —Éu#ðŒ/ÑÛÐ ÓH)¹4ب,ËÂØ|5“+‰ä¨.Æ6#©WT`IÖl0Ü”Çv>„7”)g”¤…”J sŸyHÈ~£•±aŠËAWÉaY‰19U妅Xõ9e§8@`V¼x€¹–ïó{0acqiœkhÏh7à˜¼æÎ°—'Ù—¬vȘ;T‚Ý-±$=*hK‰™ˆ‹é6Ǧ“æ!Bžë©žBÐ0ð Ÿs@Ÿs@0ƒ'M,·‰/çxFx„ûȱa0€2S™÷ÿg°©N²Yh#Æ9¶)¸‰2ribØ‹¾œ¡eÃù#pœ!ª†%ƒ9W|Y* ˜Êƒe°Dˆà˜X5ye7)ž¼¥™Íiž=ºnB¤A¤ ÐEÚDФïIK*ŸLJ¡(ŠJ˜šÊ£ÚRG³µy¬(h|Ä•¡‚ä[Ÿcz$0 NfùA¾Y‘j¹¡‚"(UWo"*§>*GÐ5Öx‹©£+`à£ê¨  ¤Búþ0@ Š¥i[\ÚN´yha*P©! ‘Ú‹À¹–nê¦pú¯3§±:{mxÿT'*Wyø#åõWL–Q/ÚCêQÝiˆ6šq‡ ‰ºY ©ËʬÍúr$É žb^ZUŸ*¡@0ª ài€¿É¦Áɪnê«é²ª®ZwŽŠCs…«Ó©d€Õ«N6X„¬‡E¨Äª˜ˆÊ[Šz>à¬K°ëС £¥±éгihjb@pT_®c˜–Ö¦å*(òŒëê±ùæ‘"2W)*¹êW­v^õº÷ ¬Ü©¯ÞY¨Åš.þ:%ƒ§Êj°;˳ ™êa +Uz­;O® [›¡ªÊ–;~Ô¡Ãø±S‹clå0E°—·z²òj^Æçÿ4±ö«'¨5²Žáhe†Z³Çú¯8{nÙ³o ·zÒÑzGAÛ  K´»e´„b[E¨*®›±NK…»\Ë!µT«¸Î5ªBðÑP²yвóÊ«_›^. -7wuáÑ7Ž8j³…Á¶Šq—qkºË8Ô1vt]JUz ¦è¶è*+6Лh)oL ŒNk`† à>°¸Ãë\W+‘»—zŠp»º²–k¯²¶^š[kÏWewž¡{l†±™Ê¤;vºß ·B  n›*UC÷¥çFH+PºÉ«®û‹MË»¾û» joI¼ûkPÀ×йðª¼ÄLJÆkɇÿ¹b›¯¶}5I³Ô§¶7»™Cx&оà‹Á= = Xºy]´¥ç›æft„ô¬W¦¸+cºË¡åj¿÷+&S —Æ¿7|IšBÁáŠAX|m7‚- £ ³ \½Òº,ºq³2\jS·;u» &4`ÌÌ̶lË`¤Ól¤L©“ì„©¨yZ¬• ‹¾¡÷•è&±qD1£¦g<¸„›Ê ºÊSy° ϳƒÍzÇ´L÷|ÏÝ ˜NÌ<Ìܦf,¸/\¸ì¼Ê¤!?¥}&Ôä/p08@pÑNº¤s€¤´\ÏéiÍ@ Êž< ›ÉŸ‹ ÙÉ4Ί#8Àç|±J™¬ºÆªÜÎø‚®ñìÓ;3Ï+©w¬žÝõ#U2ÌþA\m–=¿æJ /¤A&{3M.—&Ñ–ÿml‚8‚ó&lÔÁq0«Uˆ“m±ñ­áøŒÏ‘iËÓl&…(½Å*m±ØÒŒµncÛ¦œÆ0¼Îm¼Óòs†?­Ø7ÔÍí©žïŸs`øÓ°EÈ؃ݻT­SW]&üѽÕjg3m÷©p’Hø?i] 00Ñ«Q`!`Õ}¦ºXhgê +ý1 –/ ³‹ƒ4Ø}Êêì»:}ØcBQ»ØÓÝ*ŽmÝ(3© ÐÈy,';ZílÕ·Úf’”¤]M\݉ø³0EÈÚMi8¯Ýkí/´]Û¶Û ­ÛÒÚۉ©û¥³8@»¬ cK+ÿØÊ¬Æ…ýÜŸmÕÎ1Ô á©rÝ>°ÙMÍЙѣMÚ¯Þ×”Úæ`d ylß©)ß­Aߨa¹ß¼G Ë@yKÂ`™q$Ó€Ü6Í»O;ÕÎ}ØV-䥡¿näBáInÅ’*¤ÔŒÑ÷œÇéâìÍàØMRªÖ)¾âöíâWêgv½¥3>ÂV–cŠÝ ãórà/ŒÓ…mØà=äc”85väuÎ (¬äy>ÉNËñé¤BeâÛ>ß´Íâ÷­T^®ß1~·bÞÅ5>Aa € `àÊÍÙRÝÜžäq.Þ!ðÆ.¢v.êQÜznê§ÞÙ¤ñùÖ….õ}ÿÛø­è0¾°^­›LæTdDi~‰–Žà„éoçCÞé§ñéáÊ£Îì ¡g*ð=pÏGšž¨ní×N]BJ¤EJŸÍÜÌ4@ëáöÛžë#óÒv詺æ=Þ» ä›nìÇ~• Ínï¡g!µv§Ñ1-ÍvŒíOðK§íŽ,¥àßE ¦#“ì{Vk ìlŽé†ËÆÄ^ÕqÚ·ýÐ!ðÎ÷ò ‘k$õ9èâ,.¡í¤ì9Òóží }è!€*Pê€íÂ7]ñîŽñïÇþÐÝÓ!¯ô1òˆÉ¯œ¶þl>‡!þNJó/ÿó[?ð@èœÎÂnñš¾Ó/ïã}ôÒ½ôk/#ÿOOŽUô‚ðÌO¼½?,ÅäÑ]ÍÈ,¤\ø6PÊÏîn¾àÐ-ägôG_% ŒlÏöùþög+_‰Át¯£vOÁx/Åí)Ä%ú ²:! aŽ<©¯ú ¯æôÞ=ìC¯ø‹oô/ÚïÁ+ùk¯g•OR6y“rO÷u¯¨ÚÛùçРúŽ–‹ðû›kIrŸM0GzÍ«¯ýæI_ä‹hìm>ì‰ßжû¸ÿø-EÞû ÿûžÛ‚ÃOüRÌw¯üŸß)ÒHºˆ\±!Â@‚&|ÿ0a† 8hè ÂD -ú0”ÑМ&›€R%MžD™RåJ–-]¾„SæLš5KB(Bð B…=þdè@èP¡+XDš4ÃR¦B<…úÔÃTªSK\‘5«!—þ}VìX²eÍžE›VíZ¶mݾ…Wî\ºuÇ6iYCo }e¼ XÅ`Â- ³@ÌbÄbÆ#V¬@BÃdÊNœ0‘Y³ I| šÃèÑL›¾Zõ… ­ êä©èC¢“Vlê”iˆª°f-BE8;Š iSùræÍ7Ra‚Á=eÏvH´¶íÛHs/µ7Õ«%´ž§â²ƒ]ÿöíÝ¿‡_þ|úhñ²Üë÷oà„ N¬1Æ‹¬2Ê.ÛL3Ï> íÒ88í´ÕTsíµb[h6í¸Sª©ðzûM+ F$‘N´!ER´‡‰#ŽŽ@ø$äžÃ1G›ãB }Â.(íŠ2ª;ï¾s*<©Æ+ϼóÎ#@½ú¦¤²J+¯ÄòÊûVâK?þüû/1ÄtŒ@É ´ ³9ó¬AI‹ƒ )ÈBê¬ÃnãºóP<±ÄO$”E]t±E{bE-ÂI%TR.½t6ݹ‘v5Ô™  a§ ¬».È!‰ÜÓHܾSrI&Ë{2«·\)Kÿ]wåµW_µlI¿ýSÐÌ3+»LÍÍd0´㜓µ _«ÈŸôlõÈÝü$/D[5‘P mQ}´ÑF€Þ"*”{ï¥TÒ{‹ÂÝЏFã>òTTƒmB‚lQ RÈ!‹tõÕÜbåm<ßÄ=\\Uúµc?9ä°ÒcÉ/þú+öXÅÈ4Í4×d³Mi§°ÚÖêÄöG ·3rbp­t\rÍ=×Pu×e×ÝwãbÞIõ½7êIç×_EE÷DIÔê*†0„ <šÑS’~Ž€~L5ÏU!ŽIŠ-¾8èŒÉ¥@ˆ–@¹o¿ÿ¼= ‚–Xÿÿ kAL2Ë,M×\ÐÍ!¬yΛíd{ç¡8ô¼Ÿ/~ïr eñh¤Ûu—iyé…:j{§fÚê°f‘PA»®*Ý2¸­í’€†§eœ£ø&ÌFÛp8Õvx;ÎoC2I%-n²V¡ñÖ›¥&?|ñÇÿjð’¿L9qÅY†lYf}Væ™K£ÖrœsÆSs"{þösŒñ&ºŽÆ.F)Muób\÷:ØÁKi‹¢ ÌU¢ó”€*QaJR|'”Ÿôd:iMj0ÀÑŒÆA Y‹†©â$ 8ÛK„à¼ç5lUÿ`u=ìѪV¢+ b¨’9ψGD"¯Ìÿ·ôIe+kÌcÚç²ÇÅO~%¤Ÿ„lv¿‚è (ë–E|•?Ù €æ º¨´!0 d ¨æÀFA0‚¶£`V¼6¨4)Jr×l`B§yPh<“ (2Q‚É ó§ª·Mz;äá¬ì( ÚÎ%Hb(E9Ê÷,Q%)–±Ô7&öEÆ}“iä"7¿,¢Æ~\ôQóÚéñ©Od¬ ÆDpFÒ•NI3 Óœö48 Rü¢££®vG­åQ{ô@—¢Á BÄ! !$iÒ(r‘š¹Œ#Q°ÄD’¢$ÃèË1~¨‡›Ü1 õIRöÓŸÿT‹)Sb¸ÿíŠQœ¢ãà§ +¾ N•›Ðå,´0xf‡gôô0Ã:}͘ˆBf2ãµÌzÁ±Ñ´c S„G®é1wOÉà‰"ȵ}p !\ "Mšs¢³‘•‰Ì FÐ=ÖІòœç%ëù9  3ŸC WZ²€VÕªÿ(JPVPƒ.®e …Ù,iI9-FôZ]Ôå.£‡CfTV@ã(T‹™.†ti#%ië¤vÒNS¥¬æˆ*xAmòN¦¤©MojHÕD¨œ<í #J™u uí„ÉŽŠÔˆI z±¢[ö~ÄA­h$c U¯ºZÖ1«'IŸ˜: „¨ŠVŒÉjKûÙÿéNÚÚÖE•j=Âõn‚  Ñ޹(6ºñizÅ×3«VÇ”Ö.°‚Õ£ùÓ˜Vˆm8Æ6–œý@O33ÙÉÕ²ÀìK4«¿^vVn ½§ö†IZÓ¢ˆEd 4Z;`îµ&q¢Ag[¦Úè¶™–äZV³b΋Ánçˆ[±p™Q®þýh¢ìÚFe¾Ñ¤ÒE©_UÊRì^S»Ùä®a-ò]o†wã-¯ÏKBs’€‘ê´,cˆê’9Ôx­›³d‡–ZÜ`:u¿ì/ºl°±”ØÊWöØKRÐõ%«}¯|™,¯8¹ú™—ÔI«Q-Šä¤.õO£E.•[WæŠtuÿÏmæÔ Ù/êÎÎE†b1ºöâÂr3ß¼1s|ò8½êM'P×) Èd¾GÆa’5ìV¦6U¿¤]rÑÕ*ŸXFuª±¤e q]Fhãl»P7”Ì]Ds–fú&ÙÍMŽkœçJW£.u%Æó‰å»>G°0¸K «»m¼ g!ÝèKÖ‘¡t¥cÒÚp6n÷µ§&ñùdÑõ×£srJ¾§jz×;>¬V¥l½Ú`‡ÕÖ¦0|{a ï£~óqƒ(jbŸÎØ$Æ«‰]÷´=÷ÕÏ+fñ`·c ÚÆƒÔvN¹ Yo&Ò”wc#*T2©JþÿeºËøiþFYÊÄîA¼Q2o{÷ÜçraõÙÇoXÒ:f¹uènå´Åóº×/9‡7ªp1¼ák´sÓ¨ÀêyºÒô«u¡mMlVÆ qbq<΢W½&`¯Ü«òÄ´@&4(w¦;ëYLʼÉëµ»on: 1%>øyâ¿– ëÛË®T(­#Ü š<5ºF«Ó ®÷á"üïÁ®ºœCìð¯Éî:Šù vu‰=Ú.žvw½ÛMµ’íè}tÉ×÷ †›†iÀÝYõòMo˜É¦9”M;xÂÏŽŸ‹‡~ôÃ2‚–Àš¶²~Ÿ¿Ç\yÞæú¬°Ñüš Þy¿ÿ¯£i¤óÃÿËLeÏqõÕu=Ù Íqk¹âUôíwš{oK:È‹©»P¸;´Ó4‰Y²·ê0À«¹å“2Âs¸®¾ „¾h `¥Ç³0K±Ò-¥Û¢3Ëœ/Ê0 +?û°w3S­C½‰£”¯c½?‹¿–º¦—¢¶³C;û8Û¶ë6“ã½”cŒŒ C >1ê»N«|"­ ä ‘&ŽC °•P- ôB{³@–ÀÀ}þ~3¤ã¾¥ë- ›¤Íóµþa2ó6ÃÂbS¿“¸½’£Šë³‹»±k±Ü8?š1ÚC4Ë?ój»ý{»¸“;"@Ä@Â@˜ÿ°ûjÂãó4í8›€€Ø”&˜ƒK)EÙB•‡/dÅz Õð€¡+Ã4‘<Lº2«°‰"8^*Aô<䣺Ò¶,¬3Ó»3öK½=üº”Â8@l±²£¿BäÁûK4q¹ElF²ÿ3Bÿ¨D˜8·”ºÏãDr0<€tD‰VtÇT{E•( ³Xê@¼5˳ÜŵÊ!&„Ãq¦ó›3;,½»:Æ’JF÷“g ´A‹½j“Æk£ÆšJDEt;Hã½I£»ß›DÂxÔz‰ƒ HM-8+RK˜xÇ–´²xL‰y¼¾ |°Zë 85ô>~ ?^?˜ÿûEãâ¤9|·«+FctAd„Áe[ư«ÁgÄAÙÛÁi̶‹Ô1l$¹þC¹ÿn ÀTl  ,Éq\Àr$•\I˜0—„K«‚I”IÆ¡I£³Å4ÔIcCà?¶:¸=aœ+b¼Ãˆ{ÁèŠÁhšÁftFƒ±hô.ª¬J‚À©«ÄJþÂoãʺ“À‘t €Œ:M¬›äÓv\˽Á€¸tÍ~šË“›EÄ-œA¦ëKµòG¨ ÈYÌP+JÃlÌf|=hÌAC£Hü«Î«Ä=mô?ß3Œî|¿(5•‚LTÀ¦b@ÑiÕLϘUlÏŸ÷,‰ø¬Íš<ºÜÊÇlCŸLòó$J%===ULålL@».焽AŒNélÐj\,ýs´ÙÌ íÈ õÐ싈/—ØÐ²$O§5@Ï­ PBÑ2íõhQ¼ü7û¼¥ÝäM=i« ÿüÏÑs8ýQäLNfÒ§4Ò‹L©ì&û«Ì&½ÆëÔÊö‚Ä®”ÄTþð ½ÿÈÒ–ØÐ¹É/´l7CQ1¥‰&03UAS5¥"6½IÊËɽ¼¼3û-ÞÌ»…¹LʧºÓÑÃ:¤D ÄŒ#¦\½?}¶ÇÄ[Pk£©µ 9EÌL ªFõÌ*ËIå‹Je !À/MBM¢±ôTæ(ÑQW^AS 8UúÄM\ô¾¦«Qµ¤_Æ¡ ½a\®Ã R|U1}}N~ePCeÒ›rÒÿÃΓk/Žå/FenàÖæ áX–籘å3<×ñµu…áÞœSÁôOfÄC^•_Ö5fÇ´&AŒ]BÝ_ÛUVEÒ­¤PßäJÜmæf–[ÙãmY Hc”0gsF‚s>çt&e ¾`v~Þf胡Úy–ézÖ\ñŵtõ\·A2ôÿe*9 gÍU„Ìa–_!eæLÐùËÁ³óWD¶="fä6ØHì]h½f¶èÀhàn~‰o^ßp6 jå• €nPeéµ6i”Fg•öb3`²ví•iy¦é½g}Ä<ð³ãúJ• NN?ÔP™%fšía›=Òeâ];¨ÎF½Õ]G¦jHþÊnbÖêmæê°f·vhÊP– fPmfHë´fë‘.i·Ni$xéäYã»ncšž¼Äç¾Î¥¿Þi<ŽÃÞc è=%ê¢VlANj ®?!&/¼…轕ÒGVbÍÎfKÞjØød–<›{@xgÔÿng@ogXmÖní׆í“Ngj8í±kÜfã–°£³åÞþ>a nnŠe¸|ÙTÛ<[Ì_…?dNШ¤[Ú=ÔèîÙ¬ŒhF¥fÌ^blÎjŒžîÞÿî•P>««Ã"øh“ €hx†gh†Ooõ^íÖVk÷ŽmøvØô¼mûæ^üÎKÎÅéòÝçóŨôõéÒ5îèøõ:úõCdVØ5;CnègößEŒæ‚å̉¶j£M`mÞêïnï–‰.ÊöÓ™Xñh`óoñ‡ñôžñövïsNÚ-"Ïm–°‘Åç|®ã}#áV@Z_ÂP?&håæáÖsðÿÆY*_Rêbhžl©ö?n|TŠfØ÷lóç—¨â3Gs(o• i€†V‡6os7‡óó–ó9¯ñ‘¾s1}K=/a‡Ñ4¼Ï@×e6#tÜ$‚ÄÕã®WŸ_·}òG¿_¥&ÔCƶUä+¿ÎŸà¾åôÍóõwa“€€=ëSï ˜ !†wŸ†xwõW‡u7wq8ñõnmHqP!S^çÞÓ¶ý¾éV¥QAßeñ]² kDÏSNðöóÓ¶wîÙN‡¶t §n‰Nb«¾jo¿è0sqÏ ww¼l>E¡ë“‚†j¨†w‡÷xŸ†yÿ¯wYÇ÷ZçwŒ€/áÓÆÍUºîoÿr9-öÑ­áïc]ø¥4èf;fû D¥–ÝÉœtþ½ÛÛîÝÛò)¥hçlw“Gù”¤ÒÆÓbCu™€€°†º·š§y›—œÏyW‡us|ï†~•úp%z›ÖG@rXeúá’Ø#/î‚t_©®µdgö‡¼Ùefjj¯ÝȆæ,?âLßÎëùÀ=ûO/ùq_{(÷’‚gc>g—~lÀjà}»¿{¼×{¾×ùoxy—€€9¸—ãO *8|ËMü[,ø}ÌåÏÕϦ§áÑžüdWräÆüÌ?hŽö‹ÿ×ßIXž•ì ,}ÊÚËFýßõtpoý“Gy0€`~!0õ†3H€èÑcH"L8'Cl±Q‹HÍEkÕ.JË(mÇiÐ>B‹mÚœ„&O"„àÁÀCˆ6PÂôáÍš6oâÌ©s'Ïž> *t(Ñ¢F"Mʳ Jž>Å Uê…ªV/lÈa+×¾>¶Ù²  E[¡‚„¶nÛfˆ7]ºîÞ-QB_¾þþ cð`† ãHœX ã!މ¹H–-ÓȬ9óeÊ’3V|ØáÀúêÅ[Wî[ kÓšm ök׬W/L…úa7‰Þ$Lÿ7q℆âÅQ X1bùrÎ[´P!]ú‹ê2®×È~ãF‡îÝg€çÁcùæ 7 ¾@Ì„ pŒ¶¡x>ÆöjPHŽlÚ´1ÔÐCMTÑEeÔ‘GÐø _LTäÐÍ6ÿeã58˜8JqØ¡‡‚¢ˆ#’ÈÔINA5U·a¥UW[}5XcÅvVZ¬Õš[rÍUWxåµW_"˜a…F_}=6„d’Qvf›iÖÙ“  $Úa¥†«ÅÕZ7Æ6Û‹¶]•ÛS»}à[pÀ gÜq+(ÇÜαÝt*TgvÚqçxá‘WÞyé­Ç^†MŒ¦äb÷ ÿúƒ‚„ÛLø€¶D`E¨‘4&Pj|ã 7ÜHH¡C4”ê$ÒZ«­·âšk‰0õ•аØâ‹\5cd݈#[:JÀc>þ¤^CYä‘0ÄGß}M:ù$e•II%gVFÖdh‰mÉå_C– ˜ˆ ›Y3NpæiªÉ›n¾Iœœ$W'sxF·gŸ×ýYC ‚:ž¡‡* žPLi=Èç(¤‘>F¥†tÃj7#cŠ©¦›V8 DŸ(±$Äá€óMª"gZ¡¥‚ «Ï?´Ð!šhR¯¿+ì°^Éhì±ÉæÈ,Ðé^BöU$×f;ß¶ÿM> D”áŠKCgE|æØ¹è¦îº|¥v×»ðºõZe†E[m·å«/o½½)Ü¿ÈÑi'žyîɧŸ2d§ðÂß…çðæå€¢S,ŽÅoÌ­“;;(„7£¯ºêÈ$—|r€)C´²EE—:‡8³‹C³Íª’¬ 6#ÄjÆÐ¿¼ðAÃŽPH³˜ÕKÇ8ãO߸ֲ­9Kµ´Ó©5×zm·a}YÙf[æY¹jg©%iƒ™†Z»rÓÅÚ[v;€÷zsu/¾èö7àÁÅIN„³ÓžS°é,aÛñäf žBQÎrÃ\Äq‹õ {òœ“@© „ãv£SUéNw)ÿ“ijuz Ìü1 Î.¶#]îJB© /‡:Ü!‹R¼ƒo*ÁRóŠ%è¥%j:ªžª†½¬iïH]SÌ×>p‰¯lä:ßÖ6·nïóÀ»â%¯²Ì¦^ùÓŸUòµ¯ÿÐ_Æ á h°2P ”%ÁËQ¬‚³»¥@Å rp2 ÓÏhŽGÚL„$4ÝéJ–) è/ƒÙ"–(Úɰf4ÔF J5«¢2•ªÔá D`%ÏE/2âkµéQojM¼µ´¶5)&I[L²¢·Â7%*I m\ìbúà“.´nîŠ_˜æwF4æÍ^ûãßšü¸Îÿ±puDÜ_€°<*Œà£ä&1‰”„Ì!;—HÉxÐA˜AídèHHFr„“Ù /©Iq²r€dí IÂn´ò$MX%E+jQ\Et°ŒåÒ˜æ¼cÙ(‰¸|‹.w‰—'úÅZÀ æ!‡ ™bbñ˜›9[Ú˜ÙÌgB0î›&æ7¦»ÍËL{ÛTüÖ&8Âé_gs–8<6.{l!æIÆ0óté¹°ù`‘íí@éÏGT’5!¦ÐB!¼àžŒg ÊPj&Ý+_ûz”Œ&M–]ižÓb“,eI­¤v¹ÖRjší±ôQ.í”bêƒñÑ”‹ÿksæúrªS1ò´šuûiý‚z?5æoRéŸ7û5¸ä`¤Îâ·À©ö±ª ½*Vû  rI[Ø"“Oý¡·eõç?kЖŽU Ød© ÝJ°·¶K•XÛ ¿‚7¼â½ `oCÄa¶–†žIªØh´±Ž d£A|¯˜Rº¬˧L `)ƒlkûºZø…@~£½¦lò†Ú ©«íæQ‘ ÎãÀvœz*'Âlû¸uF» Í\]k–z—¸Å¥Lwaƒ@˜¡eíg(Óš*z,V§"ÔÃF ÊGW?8/‘‹lQ Àdæ,±hù<[²—YÍzÿ¯åëËúf¬¥)¦ìd,‹Ùò] }ælg£)‚1’‘št«™Lû`³±*nlmÇÔ¦æi¶}2§ÇÎB¹s·ð$q‰Subù`ËÅírr¬L‚1ž±YkœÖ´° ôã¡-H7C§42©K­C$£DÉVar“?ŠDµŒtGTæeöTºÒ,K¿*fô~û æez‘À~›4œ`Ѷ…´ö»Ÿ6%‰ª•†Þ¦©w½"•ò¬ÿi ÅÇÞ×ÂÕ51+»_þ"Ó¿5µúÀ¸S÷tÁ@ÅæiϤZnR8ÚI`ÀÆimÚòReXn{œïw‡R„Ü€U†v]Ùð‚ß0åŠiOØÒYÝj^[p[š;L6˜0‚AÏnÞ™hÀ»îu[ Ü$@hÑòŽp)Ö±ž²\¬_+ÛI‘xНØk_›ÀbžÏ3Í·4{ÍÉV¶›ßgÜ<›Mþæk†ç _;æVgÃ8Ýmo›Õ¹$܆ Äe˜Æ”Z?HÔSôÓÝÛ“.+BK%lã–4€€,ñP@W¥2¤×¯?ø {BpÿÞY:ùÕˆMlÛM¤^F‘0SÌuÝõK6qeVï6U_™ |æ1–ѧ Ncm?ç ÿFÚsÌðÀìÈá>ã¶æ¾9ÎúÐm´^?å6¦”„ŽHÝé]ê¹Å0]†ÌÁ9Ù©À@À”A–Á@À Jl¥ßr`QBÌ«y”«¥Ýò-QÃ=_­Å¶ÌÝÄå—õeöýšfÝTßyš…›Éžù%Á‰͉ãUä)NmiåQ•ˆí¡ µJþÅ„\‘e‰OŤ^¤ »µ[ I¡~@€(N‡%a ÁH Â#0 d¥|WÒaÿêÄÄtTò)_{¹W8ŸÕÀÄI÷hYõýÜÝeÜ ؘá”÷Ù4žøí`ƒeSùmk©œàØ:ÕûÉœ¶-a ]ÎmfJ¢„ЀؘÛÅa\º™„(Œmáu¡@À DžÖÈ‚=¬!Â!À=DBÄÈ¢I ™B£â¡Aè!òÝ“•  þ! .ÖÛA!Ê}â v™".bÞß ›ßŸš‰ áñ ák-žk±ÜÉÖS!¡ã(¡üÉÕ~Û)RR¦`ƒ*ž„|‹b\fˆ[LARÌ-JL.z’AÝËLv4cG®¡ÿ<Ѓ1øßI‚,¨‰Ê)ÿx æi±dY¸d‹º¨bz£ ʨMŠ#õ‘£+š£y¢ãÞuܰ›¶çàufÉ •³Ñã& ¡Sz¢iÂÜTŠ¢?¾“§eÞí ¤«X©æd–Ž‹à&BˆÀ#1— })íDh¬ª©`@8Ž < q²i¯gŒÁLœ«_ fa®¨H½$ ¨ŸþéôÑÝ òß—ùÀ¡nßOzÜž‚9j%"åVD˜œý úõK¥ÒQpá~fÛ¦>ÍAé·e%«l¥…LD5J©¢jg0(L@À|Z¹ê«Æêì`J¢aº6,ðª¯B,r–AÁëÅVTÀÄ8ÿ6.+¬1œ³¢MÖ¤!jÙ ª‚¦êYf òè¢jæ$r&¸z¦¸ú }¡p +µåcä¡&?ªf;µ¦r9Òi%ZE\D¾:H,dªú—XÎ7D’ÍìÀzi¬R3žlÀÊaØ ðâ”CÄš-‡AƒÅblÛòÆ¢Ǫ(ž²è &f7v'c †cÞ"òšÊ&SMekzº »H¢·ºÆ£Æçg’k¹RªRµœ†écÌÁ^üY^):aÑ¢"&Y©EdÓ’é"úW A­DTÕZíÕ¾j8|© Äʜ뿀€1”Â1ânîâîÙö*^–0ä‚Û ¯ðÀíIÈ­ÿÇ~¬6n£ÛÉ F«ÉN«ÏU+Žn\3®g-*{†Ü·©%â¸*¥‘Úãúᣒf*üÅžUhVi^¨ˆ½*m‚€n{@•$Ó5$J@@éÔè¨nÀ².Á–Õ˜¶ÇX˜¿ ™qêî3pçnÄêÂðJ°Ð¯IÈm¦vî)Þ ¢ó ߎ£ôzõÒà˜]/;å;>ê÷BXøÖ§}6eºBåäjj?¾ëü±[ýµ/½æ ü"ˆGH@!}¥Æ=‰Ô†LtqCÿR­ê^-8´np­I4ž 1”kñsñ«B ë‹1®T°B€Ô-…ìÝrç³zçóÞ¤÷ˆpÿ¡Ú﵆Ùà~‘¢†‘P‚²%î ?ظ"ÎÖãhZj~ážÕpЪ/”.—CÅf•Z)FpÄG4=‘Ï·„cDñéšÐG—ÿoËÄ @…@\ªB³r+/0!äÁË2­”1bpo§LBëb æµN¯èæ(¢’Ù¶F¢±!®Q éâÚl&Š/!G®ºÒ0Z.kvªviLCD„ÒVÃFx„HT2¢]kÞiŸcè“%mC'{òª€r(?Òo"ׄÕç4¯²+ës+«Ç4‡b.2#³¯ÎåN•v³çnÄGˆÄ3Œ³~˜ó9w[°hƒ:¯s'#q÷¯êš.BPÁù‘)“í>#u+ûs@3µR 45&¯òÂ…È*ô JkÚÊ~%¶n– Vt ©ý°ðÍN*RytØrTBUjBÝ"ä§Þ Έj7ÿ°K?Ã34CLU‹™E"ÄàôÉè4;÷´ãU^á‹nÀ€Âí&õcoq?ÿsSS6Q<µ •VžÚm./¦ÞþR/û2VÃ`–Î1W»,Pf/X‹\÷†+œ¹°ÿÀ0º>eªõ>R%ˆq*æbå_Ê\ßë7OrHÜu38ƒÿ_'„àÚ”@µ¬N`kÊ`ó4Ž<·„ï:6dkw/ue{÷O\v KÝæ’ëró2Cß¹édyj_&jç16jÓ,3»v‘Öç7íì¥æY9ý,Un¼zêk-CrHr8GÃp;ƒ97Bœó}$Fï=ZK4·sÿt›PtõAØø:›! @>o÷‰ë®*Cw‹çÄeÏAH¬ž2/{öµjC3D›'ÛD®— 3+3½4[ã 2¥ö·!‹tå­név€-ꨴ‚'ƒã5q;3D¸AA#š°M'„ HDK8D†ŸÌ†[R'£@u©ÿœ Á#ðŠÓ¹î‚‹ãùM„7ô‹VuÉB¯h··{¯ì0sÜ€3£žàatá½yãÕ~oØ‚´~®u¦ï“¸o¡4•r³•·tH4x3730t¹?|9…ó]—³€5HD˜96 yš«s7ôk{4¤Šxgqû!Áäy±Ã8³Òx ^MŒ¦7 Ò(GfÊz¡K´:Ê÷Çu+‘ùF*¤SØ ƒ-ZkXm¸»ºõ¦ç\\§tÊÐõ7‡zƒgù–3ƒ2@x†PaWÆ&CÀ§PD¬Sì׺`oÃ&PÙl€°;°³m±·øžKõT›wg_ jkuÿö¡çcï|[4Q6z<ʧ¤†fl7^Z‹ôä)2"«û6³ûoƒ³]ãµ3È;½+mš0™FÓH5ð;¬Ç:À7·¦Ü@uñ W\Àîn‡.¼>°¸ÃW¶l¬ôàò'´7;ôº ÏI;i¯,|Ÿv¢Çl23˜÷¹·s4ãç¸85?9Ë»f¡¡"ÒB„7ÏüK×ü–+½›CΗꎦK®Ÿ LCFüüEð»¿}€„@©4AšI@ÀíFìÓ·r P}‹Ó[k'BŸ÷[|ôF;yŠ}à–0áS4±3àÉ,÷fôÚ«ˆ&šu¥.•“;06)nû')®/§O¹ÿ§(¨OòK“ºÍÏ;àÿýæð|iˆ¥ $¾¨HÃâ}ã}§PwLÐÀ5ÝO ¼rž­æsq4|ç7õÆf}/û.¶z‡ðé󸡺õzujï1Èo;¯‹8@\ˆ ƒ~ ±ÐDÆ'4DŒˆÅŠ#0Ž`±‘E ?¾)ƒd “7ntP©rFKBuëâÂuÛG÷î=Àƒ2~<óæ‹ñ±~= ÷ïݳOž|xïÛã^§0ºóåÈ‹“ ±Ç “¬œ`‚dp $ƒ8Hh!†:"‰4 è¢Œ4Ú¨@RA¤H’Á¤PZ‰%—`’‰¦šp2@§z(¡ˆ: )¥˜r**©ð²*+­œéê+±ÆKàêj­ì`¨N 4 «¬ÊK/¾úúË/Á "ì†,Ó¸ÿ!sà* (Ã3Îè䬌20+MÏ=õ â ß TÐA -ÔÐCq® D.¹åBpî¹è¦A?ë¨ÜÎï¾ <òÎCO=ö|€>ùB­¼û¦”ë:þ$ýï¸#ÐÀ\°Á „ð )´à 7”¨¢3âhÄOD±¤“RZ©%—b’1›j¼‘§òf¨¢¶A*›¥š‚Ê/ªªÂê$»‹I²”Ñͳ¤ÌîÒy}x+.»ôr0Ã“Ì æ=‹€ Š«2@)´:!ÆìNµ¯;ü\µÖæ 0a[ D0Áìu `BèB‡*v"‹@ ±£M)Å£•vÚw˜iÆ›rÂQŸtj(£ÂUj)!£šªHu·Jò«°š„WÞ‚©ÈïR*æ½@_¬ç·_/ÁsL ö§£‡k¬ÊF‹â‰ïÌóâÏäÑI/ÝôÓcS”ÑáH†TÒIS¾»ì4}9æ>‚æôHm/gùŠ o¼˜Y}+h¡EèhåMXá[•Véœ~zÂ`¥ö!;<D޶fÖkÁv±ƒ±É6Û&´mT›í ¼-ꨤÆmꩺ©22«¼½r·o¿#8ÙIÿgóÚÁºˆ¸Ä)Î_ÿj\53/È aÄJQ Òh®Nœëè@xˆ\ Ž„%4á }#2ã´n9¯ƒ¥¨³2Ú¹ŒS·ËÝînæ»ß­g><ÞªŠ'8ëð§þaÞ¬œ‡4ÉDOW»òÕ¯ µì‘€j&°Z÷…e‘$'ú´Ì‡¾j©FÙrßOà×£ùÉ~C²›‘ÖÅ¿%‰^daÆßæE…Kñh‚ÀV¶‚À*0ŠƒF÷2ÈùË £*ÐPð‰ƒvòàCÈ'B “ôd'UGe d.„¡td7»¸Ô®†1»a¨xGªœéÌ=‚ªzP<ãUéUÿÒQž(H«ç%-WLãÕ¡V¡)R‘XÜóPÖ¶È5/>‹Ea{Ñ ^2Ƴ™Ñ}mã¸~D.!«HW‰£Þæø?°x…E`/ùAà€@Î$ ¹.B’^2Á" #>aBx„)YIÍ\“™,Í>Q‰N”cŠe)OvJ•Ép•nyÌ<53ön–4Ø™‡à3—Côe¬ŽXÁ5¨@K\š1«Åë)S!Ú³â½÷=q±kã›5§…Íj•m›i+À¶ÖÖ¶øSnA2‘Òu$®´‹oêT;Û9ì§R/ô–²df$‰­ö¼g3ò¹OCN‹ôÿÁK—— øCNŸSèBZ1‡ŠFÀ èa›X݈ 9uÊ*%»LÑÐ;6éylFÒòPx?ÌåÏÚb/—â˜Á<Úc ½é3BÉ33ĽaM¨áëâøÈÇ¢0ŽM›MmßS{ò“n½mõ£›TÐu•ýmuot¬ãWÁê΂¥Ì¬Í™ÀºÖ¶ºõžù<œ­B€ÈA JC&dq'Ðý°ì`C³ÅΗ¾õMEIé:SÆŽ£Ú¡l§B *Xæ°T³^gUºÒЬÉ+¢#›·¦aÚôÒ3&2£(Å©Q ¨AÕ¢²¤iT0ºHŒÖZ7·õ¾oÂ~Aºrÿ«¢\­p¥|{.t£9"¾ŽóÒ€³»]îâ3®XiF &„^*Æp({3sÉ÷Â÷2eÐ…}±œåOŠÌ±“Ò¨dgèÑV¸<Öìfm‰KNµª¥Èû¥i%¬ÄÉó¾rí29Üá,jmYâsVn[Dbõ[(æV©ÊÆqÂŽ3VRWoœÝµŠwº¿\ž!楀Hy»o…k>)%ýø²Bxžž eU¸—Ê¡ D´kY›NQ]ödcØß–ý¤dÖ™ei`Î"ˆ ^p›üæ˜ÒЦ©­p©—Ó;÷¶UsfE 9T?ÿù¨‚´‰Ëø[¨ ×m=Š[ýÚHÿÎkUoþóª¤×ª $ÏëÁÍ@æÅÜã˜Böô3vPãõ|r&U½ê‰µ4e@Dgq‰# ßviB~MöØ/ƒ¹£Ü±¯iV3 {Ø·T3h=jÒ ‰3E­³¡m;O{ÃÍä‡?lÛà¶|ÞV*¡Ã­­àJ•¸çžÛ‹±*ã¼qÕ¹u„7[ç%! ôˆ‡’š·vï[ÒÞ çEƒ• ‘HïÁS å†2üAj&w¹óÆêjiaFù«ŸÉй²®¼¬¨FŽæà¡”x(­›ëMA™ hÂs¾©g¾SžÖ|{ΤmÎu^Ô/žd·ÔwÐϸ£øÿ±¸ªÇ}£ÒiÜ\¯ò»ßI2GÔ¯^Z †övAÒñFã}³^»I’nÁX•4yíðM8ªÙþ`dlîÍw¾lꎖ‹›rãz³Çûr`ãŒäiöìšSOetñŒ—3®ž½Z ï4!Ô®¢ž³Ý¢jžš6Óç[qѤçSÎ%ÌÉÑj¬éà¥ë¶«öCX@ä)1¨Àôò'÷mÓÀ ræE† ˆà .ù.CÕ@ð3TáÊžïQð¢^ö+ï®cï°ÀdFÀ0+ðØ>ËØvIåÌÞZ®rý,¬iÖ{¨­Ú4äÚö,šülóìïš²éó¸ ¸¢ÿJôÌ-œ\ÌʉÝí]œÛŠÐ Mü(Ð.h@\²ÑÌIŽöÍ@R*§„¯&í¨LÕ‚à±Õ0#à. qâVÐ,š ãp •8οøNsç×jðÌLå¤LîñÍx°Þdr*§Ùˆ©ÂVKÚ2ìµÞ¨./çúlçD¬š|Žl˜êZ@ «°Ü¨ Ý.¹Ô…]TïÝÀ°­š!r‡c^zàmŒ.݈¤ÑRï¹èÐö¾ïgà„ÕF½1µq¹‘4àâ1c-ƒCã\S`ðã´¯mðTNªgŠÍÚ¬¬¨ÎƒPiH§"ý¦(-ÿo E$Äþ Ð:ïçf‘ÙGèÖ†ÜFÏGJïÅì&«éVïé¼n æâʯr R\ŽN ÓåœÚ…i|È>l`Ò˯Q¡¸1&er=£0áOÄ1'í‹›v"K×X)ûf°Ì*ÑßãÀO¥8Qü/¦MjÊñ†ÐAŠÐ)ÏŠ”0‹Àgþ¦)·tËÛ¢pOÌ©R ÊÍÿBÖm¹*Ќӄˆ1@€°æeÊÒ ýϪêænöÇjðp©É΃FpN*i&s1ÿ`M'!±xò…α:`pSÆl()QTŒò(yhð21Á–r´ÆÏï‘Î ÿ¯µø±9L ã¯]Ñ ­é|¾M,ÃmÿÒ å ™ñô´ê½ð ÁJȆÌæ2‰æ…È27û7!2þ)r ¡–“̼>‘eÛ]÷S5û³Ú~Ê5kvÛd3óOUqó§Ê!u1hyqhÝÍ_ÿ5IþM| rBàVæ jí‚Û`ñþ¢PgÓF(m^@ÀmµÖ¸ÿ6b='ù2ã2(ƒÂ–1ÇÖle7P0P-tÍc{dðÞ“T@71ü'yêÑn VµòV§<JUQTmv {îT—ptXáæK%Ð/'²_…ÓL6r%7rœ A&7K à4zå5,›*ëÂsè=²ótO7uQZ7õw÷WFcwvX7öÊâ¬O[sײDÖ={÷3q0xS–ÔÊõ)O3ýêLo÷öýÚ5Y@¬ ©ÉT¡ppÇRXÍò#éçU}“- °"7`½ëÊw^(,W^8 @çH•ó¤··Ü7Mg*ƒ~˜bþ”uù·ˆ8óx‰ic€£$[yÿô€ý.c‰ûJöä on!xeÍu‚§’zÔ[@÷y,Aø6«W7÷²7ð7»°hy8Y¸Èf8KÐÎî81X€Ï8˜ vvXúŠr=ô0ˆƒØk?çˆ9‰¸‘K È–‰)Ù5œØvÑÓ€5d‰rd­ømwuð{‹ñÓe…Ú8Õzö iVƒåO ϘsÓxK©pA}6n€V$ ­{ki‰LŒlÍ4Ú~J”Cl–iÓ˜µd3cé9‘© ’yÕùˆƒ@‰+9œSã’ÑBÉvw¥¸[½µ¤0‹Yª‘ÔE‘Â6Õ——o£ôjÊÿpëÏ@=/X wXsQœ®jq!´qÙ+èøV½K¤Yä‹#@9ÑÄXš™J9¸Û:@šƒã–pÈš¯9‘YO´ùˆA½´¦Uœ)™œÏBX†×¸“EîQi)R3Q>³øxèÑ‘’Ôå2yw¥z$äžýñæ¦tƒo zq8‡­…zCo¸v{£S{e•L÷h!|‰qœá¡%šz(:K*o".:D`ó†9Úi°’5¤áÚ~¹¤xµy“X:œ]Ú,`Z“3““7³‡ƒÔ­³9ÙT¶nð\Gñ‹í™BžŸ3ó̸ƒq¶6µtKíµU¡³ª÷m,«ƒù{ÿºÈ:ɦ‡ÇJ$©_³ 9z-8Ù<Þ®ãz¤Cƒ®¸0ñ’q2¯™x¯ý¡¯Ñy“wW°¿”qP\I¹4íÖ‹aÖ‚yÊýl΢÷ù5š–©vUq™Nw9×-Ž€SŽwȆyI¤pÊi†`^ĸ¬õY@A‚b{Їà­ùÔ¶Eús‚@·ùWb&æ¿À¸X¸…à-‚R»m?™°ãS)´>Ë•Ùò5e.f#û¨­û5«ô†7÷šæ ÒpsùK4¼Çô—°¼¹½Á "gš&§Mzà‚c ©µRDb[eF¿÷›¿·ÛÀû7Êî„Àÿ VÁËVÁq÷£ð;°‘›SÔ+ÜRá,QY›T5:ÏþñµÿÚÄ£š³©º ­ZßB;¡{O˜?Í´gœÆ fVÙÎæeX¹Ã«‹@¤€ Ö“È‹ÜÈéw¤K¡ ½0aÒ)½Ò½y3ð¤À1 ¤<ÁP¦¯ÜQ¸°%ÕÉ.±SÇ7º]f[ÛÇݵ²½ò²ÿ9³åt„‹®„ÛH_Q¯-UX«Í;š§ÆŸ¨SçÅVùÎf–ŒC— O6<}ѽ~÷$Ò±=Ûµ]Û1¡N4ýÀ;=cücg:°«x°ñt‹ eµ¸”û”ƒš‚S³Õ×Jý–ÿTÄã5gõoïµ³ÝèÅÛ×iµÎI;i»šØ‹}Ï× >` ÃÆ‡šÃ…ƒ#âÙ¥îck»½ª‘'¶=äEÞÛ+Ò[wÒ—!ÊýP|¥Œ»=Ï=¹%<”uz”Ûݹ»8Ãå}Ã¥ûµ\ùÞYQÖ³ûƒ·ûFn¹g½ûÿxy™+D{´·º´e|øE"Ð;u§Ò°.æWXæ´ã¡„¼(kã9¾ãœA^äÙÛC3ÖžíMpå«uÜ×ö¸c^Ëq:nQn\I3žWçë9Œ©{ÐCÄù¹@cq©<7 ‰ŽNuÎ%²Å%Ôh=Ø[xŸø‰_¦ÁDÑЋZò>ÿ`… ±U™â§È)ŠmÀâ¤s0í¯í½ímÿí7ãlÊé¾Z9`s°ÜEtošæk^á‰x}ZžQYSǼSyÜðqÎÓ\}åU¥úzÒ\"²×)²à >Øï<áóœKðÂó³d’IŠ ýê$@ÎôsÞ¡{ îê øéDöC Tx¨T¹ƒ*\ˆ°”ª‡!bb¨P׿‹3jÜȱ£Ç CŠI²¤É“(SŠì௥˖BpÈìA“æ›7èÔY¤ˆŸ@iJhÏ8kö‰Ã†SP)H•*¢j‰²†Øš¡k `%T¨à lƒ³gÿ¨0!‚[·.È•‹¡.‡»>è%Áׄ_¿'4ŒÅŠ#`Á˜E !¿˜,£rË5ntؼy†g•÷øÃŠ-ëmÚl½A\s]Pà§ ?TPTNÙàOF…f¨á†vèa† Dш 9d!D‡x*µèâ‹0Æ(ãŒ2²„ŸCà T8å´=õQDÿUR7ÕÄTSOE5U‰pUVl‚Wú‰E–Yþ©`[8×xÕ÷_$üØ`„¦XbµðXd*LöBe2`vƒfœuàÙ  ‰¶i9œ–šj¬¹›lµÙ†›n½ù\5ÃwœrË5÷œtÓYW]vÚq×ÝwàGžyÉ¥‡ÞzëE°à{Ìgæ™$HøjK4`Ö–ýu¹V˜b^p«{sLõ 6ñ†'>ôá³ÐF[¡ˆ*Vkb³ªL¤â4vëí·à† ®ïÅ´cCü¤OB9”‘H¡¤LÚðà“PZ…•V\u•åXüù×€—¾µA°ÚEß^hªyB`lÿ†Ø›qΙxêÉgg:Zi¦ºZ¢âÀÛlÜØ¶Mn¼a#©píwixÍ9ÝtÔy j¨¢:Cj3¦†‡jªªBÃêz4 ëR™õ¡ÉWJPe¿_íº¥À‡yJ·Ôēڂ1Ìb+íÙhƒXmµ˜‚­@*bBˆ¸t×m÷Ýu“ëŽ5¡«îºBúà®PFý˜MLÕ{ï“QîËï•þêÇ«Àÿ l Ë·0­i: ñ`†M¬XÅtÚy§e—mÌñg‚ 2jˆКkàÄF›£+ï)p0g\r4o§ž^·sÏÛýô©¨}4«Iw=«Ó·7,L95äUÿƒ0—ÿè–]û#¾ÂÐ(e›öûÑj»6Em„íÚyà­ÿþü÷’Þ/Bßz¤®ž°+(îÒ‘tr8ÄÑ«IN¢Jã¨d%îInr¾²œÁ‚u Íå…aÕ[›4º7-†1“ eP—º>ù©c‚"T¡B»Ù½æd·»Mnt÷2áGfÀcŽð¢Ó©âíŒÈûЂ6´¢íyÓFô”Ö4§©Iä»Õù$¨½©éjWC‹ZšP>Tl0@ô6ø¹ÑC˜H†å8¿„Ô '’E‚°ÿùñ€]" ðˆ€? R»/&É´W%(%ÇYé‹ÞÃÿ ×&ƒaŽL›ãœšLð¹6†bq¢SV˜§Ô©î…€ ÍÇfHCŒÌ†‹Bî å²ß§RÆAŽr„¸)âTÈó™ò˜Ø<çA‘8S¼¨¿ÌAi‹£¤%ûõ¯0 |þ0D”ÀeUèmªx£:3Ç9ºóðtg9‚LjDEs ¤>÷ÉÏ“ &‡ÄI8$Fþä(Ž”$™$Ià«qÛ´àøÉ/ h@ŸTØ9‡Pb&$]éX©1vL–®£¥ÈnI;¦ 7;Üݤ€9³åïfEÔ2“¸Ìñ í<Î<q¤Qo*M åš ¡4*D(›ù’ÿ©&90µ|ˆÒ´>6¶qêlg<Ç ÏyÒ³žp«Ö$úÉÖ¶ºõ"ÿ4¹E"05Ü#—Ɇ>Ô*TÚ&÷CÑð .åF“úFÌM¨tL M—1WöéO±ŒáëV*;Ön6‚)_F)ß 3xÎ!bN?u<ž~gy? ªP‡* t ÕŒc3 4ð•¡Pàã¾N!dO«Ré?žÎs~¬ð+Y§+dzžõ!Ô•#·ÞÊÝîú/®8òQ]íZP")0^ ý­â&©ÕˆJŒà«h'[ 2M”žûè)#›ÂUžŽ…¯Ä,Jeh¨*ê³9mË|éÿCÓ±fÃ[-kw**%¶‰ª‚bi ÛU©+å ¸&ͽ&‚ŒÓ×p3E¥A +WAî !t6ºi“nvÇj]ë–ƒºŠ°ˆw‡Ldº·éJ$AË[¤ƒ.p®{U/ŠS\É©r¯{Z*lå,ªµújt±}qØGK8ºTŽô¿˜ÉŒI?3à×ÁΖ$»!£j£CHõ†Á4=-1#œ3RxT¤º°yœ¨aÚ§Vò;BÁ$úU†XàáNìש@”JdÄj`\­‚PÅ@ñˆ2 Ç9Þ1u{|ÖSw E޵¬gÞ$7pƒ+Š“ã5¯HB5ª]¼d䬦e‚ÿÍ£^ö ™+BÐA¶Ì’U%Æ`6kV¥œÅ¥Kw¹›^Îô‡5Ý3§úlÖöÌÂ¦Š­lYeh¢Bãѯ"€nݦû(ºp íõSšâõ¶Í^§«Bò E …Q}6«ú¬¦§ÃáˆY[üâ(¯”Œkƒú¡PN/¥+mi¯ËYŽï–; Äj´Šaž÷cE'öwÚ­ÌLµ3;ËÃ9Οեh»MÚ˜SÆ)¹÷g@¿6ÝÎðóÚMTJa•”ô&aè*àbÁ.¯ù†ä¾ùM€0Øt`c<ΩäC¦vßåꇗ5â™8<1Î÷¾ÿ¼_$^?®W‘÷õ×Â=y7‹­Aú&û¾Ì&e)I¸_hËéÌh¶,gÜ:Bùœ¥-íKs×2ßüÒè§µijÇ}̦'/ÐÌlfz ÝnJY½kȺijøVð8BHéµ8jVZ;ÛÇéÐ{œzî*G¦Oýê[úwÇû!ôþN¿{ÿûÿÐøº–ìqÂ'ÔðÀ nâ+8XM†O|—“ba>JÇ‚®ò5wŒ´Y™óêÚØösÚf;t¦`wÆ;Àô;ÃaªU<ÊpD®õtP7hë¶Tg{·×TcFfŠqM×£k^g^»æHúf™Ö5¤|Z%Ra²Pjqg!ÿÐç!Òw}8˜ƒU`VxÇ}î~@Èw RHäÅdï2‚!§Å7IÀQ^eßÓ+òul.çA`VM“·{‘¥gVY-tYÖÖsŸg¹”`1åm¿nz¦)|æ€æVa=åS²7{Ïdhh{åCÎÆoâ]C€#xMr“MQÓ+H%Ë'Wå &w5˜!7¨ƒ”8}<q¥ƒÝ„œ(kCHä'|OF|KHvÚä„ÖIŒÇežôx¡ÄlögJ!esû—y:·f<—R>'€Æ(£w†E§†Hdž¬×zØ‘Lè&‡s¸*SW{wX ‡Zw4m¿÷*M0P'‚ærÿÇ7,fä‰ÈiŒxŽXj'‰R‰ì¸ƒÚWíØ‰òHdCŠƒGˆ&vxLxiŠWU«Èr“QÊBõ—…Ï–—×…Ô†a¨‹µ42U2Z¤'S½#3ÈZ›‚3ÆxŒX*HR7[vøŒÖ@å#|¸…*àÃBt5~‚x„æw‚]ÓOXAj—=ÿö@64¨ŽÒŽ•x‰¬–‰ì8JÉ]Ÿ8“49ФÈP$§M%l(ç~†uQéŠWXúU"¥BÿÕ¸ø×6†yCˆ;,s€§ç`H7DÆägÙŒ°’åQV’'Y>PÐ&Y-€7©ÿ1ˆFøuE`ŽÃb“Éð† 6ƒ7‰DI‰w„‰ñ¸” ÙOCè” ˆé%e eŠíeeO8Q*ç%ð·A\Ù•bö•³È…CRzR–mFKozr&zuÆCx&Œ h3 Ø‘<ãtÞ!hy©—Îx‡~ù—]cBùgssÒ•© †0ˆ)P·˜Ûù*à`!™jT>²À\¡Žª°™:Ø™¬† •¨ùšø HŸ˜k¥ •è—~¦Ø„¬™Š)'…†E…y_øÕXc–´¨ý·sãoÆ‹%S†/õ(DçK¥e)™)È9—åæzÊt—â¡n#I’CõŒÕ0Ô©4·ù ÿtâ]6°$:2@âÅ%öN ]aߨ5ìw‘а¤LÚ¤ŠÐŽ¥ðŽôY‰dŸVêG£™k”„b7vUeýHl¯ÉIñ'ÉQŒælmZR 9¡ž÷Àt ŒŠzštÅ8¢$šŒ'ut¨¢+j’.j+0zl*m2à˜ ÒÈ!8úàÉ£C2žÒ4Mði@êè,Ї Nª¢ªQª}SªƒŠpWºªû³Ÿ÷Xx%8e%'Uz•üa +§•Uy1's÷·¦ )–¶¸' i–bø›$#‘k©2mÙKo Dq¹zI—yn&ú§ËøDÍÈ—ÿ}é¢Ô`ˆ '„ª$¬ø˜ÇR/7Ê’º£E®›¯î! ç4w :ªøJªïXOJ‰}Ī[7®J“ÝØ#±z,TF«Ûó^Þ³Š±éxt1™¦„ãzsü·›ÅÚ›œ&#œØC ¸†r)aLW—Öz­B¨êQ‡ÜJ).¿¯øÓ_Âz'+À¨–éÆ6õ²$ç"PC`“òz´^3 dО¨Æ ùú´Lúއà´O› {µá2„†ÐdçŸJèkûhr‚…IQˆ5dÚef*+Ë 3Gs›bé…jö¦½yÈš–eX€1å– vtÇYL&û€oøz*Ë<ÿÏ™¢ìö²0³¿ñ­·µÁZ‹ü7edès,êB+©<‹´e qðà©ÐU^pº¨›ºª{º¢*µT›¯X»Þ2°[•ú¥ÁFU®‰«Æ¦• úнŠu3w›‘ë_^H¬t{–µd¡ÁZj‘zt4CŒÓJ­Hô‘ ‰­"¨‰«¸-ʸK³ï8+¬x‚:й>)N[6é ©›Ûç깛ʑn“™ê´ºüÛ¿¨› ®›¯UP¥²[À1¢µ_×µ¼Ö¥²zеú/XÙ»²É•0×Q ¬;¬ª#`u+§@·m!Œ­i²ˆ½Îy¸ÜkÑÙ­ÓÙ¸ÿk©îA¾’;–9wpvR3píû³@«¹Kâ’ô NT°h€ ¤ûFAà¿L¬ºüŽýÛ¤BfÀT¬û‰oa‡šS lU©»ð…«¹Z¦{¦‘‹”‡Á˜w¼¼Ùy›e`¡g†Íjz©€™œÖ{½)Ûœ±·½-»­´E¨Þ ÃÀ!Ã/A˜gÃi¦s5`´Ã‚#äØvøò¾Ò„<Ä3lA^`"ëT MüÉ^`”¬ÖÄŠ`U|Ê(qÅe¥¨šëg•»k¶×rÉFÆÁ;ygL¼µ(·þDZh©msÆm †€?DÇB$­Kw²Õʜ٫½Dƒ¸,¬¸1k ‚üØPÉ-Aÿ9{¾7¼'ã{› 4À‚ì¾âØlɺ™|ºœüF˜ÊM,Ÿ=æÉL̨œÏ%±B€„¶ë¥T–» [ ²ÌrÈ–¶À‹… ê¶f–›Œ‹pêfÙÖ‹B÷¼hØ·—ò·m¨œvY¸,ÛÇ‚ZuÒ ¾0ÜKéL”u¾‰ìÍ.Ô9¯M`T`0T@Èu¹šÎôÛ¡É^PùûFÉ ÏL\ªxgÏþ kúüÔ ÁÈæS^»P=«Ý~|¶­ˆÐWhÁ J¼|¼ÚÁw›–tú‹¼ŒJÂJç†}‡+›­ÚÚ½ È/,È.ã2EÊ2€Èi†¼-íÿ=iÉŽxpM€Ó ÉRmØ-a¿Aý¿Lû>¦‹Ôý+µåÐÄV ÕœÍR-OÆ¥ZŒx€õÀþ8¦¬H˼¶¾*‹ü5Y8禫“‹qz·³£¬¢Ç¬£u§pYÇ{:a(›ÇÍ<×|\×v=¨#×z½×ܼ٘ү´y˜ÕØŽí€Ø8=êë¹Eì«ð àíù«¿Ñ¢ –Ý¿DýŽGí¿«ÐÙî­Ÿ ˆ!‡~ëåÊ¥½°í§ea<ÁclËX˜…ÛÐq«Æ €¿|`k©CÍZœ½}Ì}ÇØ»DxùÌÌèÇÈm{Ó\ÍÔ°×{íÜ,¤yeÉf*Ð×Õ]âÃÒÝÞ*~-ïƒ ÿ*þâçýÄÚ·Þý;ÅïíޟŨIÚ`:¶©X¶dлʫ ݶ[8Ö^ÖÊëÁÀ ²{+²Æ ¢€›Ì‚ëz~êÌ@Í{yáNÒ%ÍáØÐÜ]#ÐݰÄf(%$nâlî(Þ¹ðâŸðÎiSr~çx~ç¢ÜcMœ?7þÞñýÏ , aªŠ¨-ä¿»Q Úl®myH¡mև¼*Ìh½áF½;¸„+Xžå+Í\¾¸üå`ÎåCcæ˜K(5jÞæ²ŽoÞg /î6ð£ yÞëyNÏÖÅÔüëÔŽã7•õ»¨x•[Ú[éÕL±Ó(Ö»¼É{¬ÿœ…Ö œ;úm#¬‘o á¾Ç*\áÇ}hx-³Õ æ.Ã#P> â:K¤Qk>ëŽ]ëñÝ*®ä--åàëŸëûêë¦\ìÆ^.s«[œx>¾x‡®«‰NÒ¾’aé_-ݬ³äýÆuºÛÏJǪÇgÉ|ÂÂ-áÊXÜ´ç½^Þ¸ìæ¼ñå#ØÅÚôî›BŒï%®ïqrÎ o¤?ðâ­Þ½NÀßÙŸMßdß Ë~Úì«ÚýMä^1ŽBÕ`kLï~¡É–ÄIÌ Î€" ÜËÜéz<á„æ²wíÂÊmêÌÍ1_>-}æ6ŸRn;0°Ý:¯ ÿ“° ’Pøà] nðC/ð¼ µ^Ðë›ôœã ÌãYM¶ÍŽè³Iñl«¦ ­õmª±ѾÙñÍ«·kÍà~+åΧi¯öÃm¸nîç΢¾Ü§N÷uïbdh ´iÓ A‹öìY3gΘ1Sfξ2üùçïŸßüfÐ=Ý‹æ@£YoÁõÒsp"È ‚B¨! #‚¨¢‰´ÿцž0ê($‘H2i‡”TbI—`š®:q  „k´ñF Þ*jªO òñÇ ®RH¥‚ÐÊ«®ÆRò »štòI(£”rJ'ñ²I¾þL0Â(0L„Äó€±Ë 2É*à 3Íèì3ÐD#íÓ0@Õ>`„×`“6 nÃM·xcÁ·àTî…âŒCn9æD:º–\¤Îºë²Ûλï¯<óªAO½݃O>üîËO?þúû@,Àd°ÁÓ“0B ²p! Òð!³ñpCDç&MqE[|Fq±¨¨éFn»õǧ·rá‡rù¨âGtŸÿúdHv©*ÇHx‘<“«¼ÈƒJ|óÕw_~õµr#!zø+0. û2Ì13Í &£lÍÚtÎ8ç¬óNq,uZÁ X× v&ûa¤¾¶Æ!ºŽFœ_ǃ<Š*=<3—7E¢ñ'zÓSÚÒ˜æ´ì}‘{¿úø°Æ!3Ú,nØÜæ mŠÎü ‡^ôvzã¼Éšða¾3žŒÒW¦û³kéÔ©®ËÓöPÞNߨ¤so˜9úë‘û­GløÜR±hšÞt:½ K(Ô¢–ÃNwTÓ¬w¯¸:¥ [!ÛØ~Ä7²ÎT[% Õð‡G¼2fA‹G0Å€ª¸+±‹=y¹÷òû÷²4¯ùÂq Ïã24=<@¶:ÈB½S=TJ:+·×»ÿ“Òq:¢=©Ë¡˽ S- «·ß>ŒÓ7;Z"K«J‹¢ä;1+B»X18[a;q*£>oš±©"ŸˆíË‚S'X›Ÿ:šµ¿«5óC2µÊ5/Ä›D `(ƒõŠ$®À2üûUøþëBȼÿû¿¥pŠ-ã²@(,LC5 D˜Qš³4±,l½Ša: ä3û34ÜãÀÝó¥ÞÛ:×Â7MA¢}#?&Z¦#»’S¾åsAYÁ‘ÁµáJˆ¨²>SÛÁmоnà€±¸u 2íÛ8x®À¹%ª&ä5Ä›…H „Í{6h»¿,„ U@6/ìÿÂrÃÿÃÅÊ~è¹5<Æ4Ô6(º ·Õc½¥;·¦ë3?[· ™A#4¬;´æ›æ²7FûªM+Oé©â#•±ªÄó“Ä뾄“¾TˆLŒˆã¾ìóDPTRü>™Ñ8àá¸#ì7´ ¹%9'lž(†C¸92ÃÅ\|Š]ìE/¬9`´9‰D6>°/düÈÑÓ6ø6p09Œ˜:0;¼CÙ{: 4Òz7xÓÆmŒ”@üFpìºq¬°Ë#Ú ªÛ 8³{DwL*µ‹AàzK¬GLl8|œ;¬;O¤™~ä QÔ;° ?H+2À³5ôë.&#¹œ…`L(ÿL8ËZŒ$,œH .´È.ÃŒ”È2ˆ9KI½ =‘d@84ÉgœÃÌb%‚=s:Ô-s)שºx›C³I­C'œ ¾°*AIûÉô³´u4*ib¾Ht¾çÕ¶ã•KlÊQÃÁŠ€¸}œJnðµ1„œR›X#G"ë¸dJÂ[ÛL][HüÅU@KµFx(ã»@Ú­=t· ÔÆ^’LL§jÁGÃÌò8%LAúhDlÁÿxGÑd1JÔ·{;{tʧÌÁ­áÄ©¤™îè1„!ÈwŠÿ´‚œ§& 9&D>üœ…1†ùBËŒ´¹+;NÑè< Uð›æìEDªK ¡Në|Ñ5ëœÀœíÜœîTºr#LΪÀXZ)k<ÏÆ„7?„̬&Eë*q4Är$~SD%cÄulÇ¢|AxüO¥G¦´šÔ,ÐRcMKP:êChнã”ê"HU\Åzú7õÃPUq áüÐRQ½S<-QdÎíÂOxNÍ+Ñ@€QBU3½ £3¥ÀôΉÉQ¦3L­ÑGÓZÓÁ€v²Íñ£µPùÕ$¹&t2sˆSL8VŽ5Vg³Óf Ù<ý >V¹¤VŽMËRÐÓ2¸m}YŠâÖ¨Q¤óN:Ô¬•Œ= ÔÃv Ò™ä¥È´ÕÒTʾëذøô°ù4?Ä×#ÕÏ„ÄÐô×UU¥\ʵA2ŠÕS›UO¬Õîð†[å ÐÿÊÅM$<ÈV<•‹½4àä…Ž­V<‘­[U8„*àMØ[¾Õ“Ý?>ˆ[Ý`€YÕ(™ÕˆÉ¢,qc=’2·V‚Ô–¬F Ru}Ìõd–É<ÒÊÌ·¤-²D¤´'âLǫ́5U*=ÊT•Ç« ÐîAÍ-•»ÕôÒ„¥ÕZå r<Û%2È ][au2h2H†*ˆ[µŒ<å(»ÑRð½í[é^ê¥^‹ \Á-–uÑÃíÞ JÜŒ8º“´Ùh”F–DLò¬ tº )Ý«I¡•”öÄ8ÚÉCdÒÐEH(…ÚÓÒæ£Úµ³ÚÖXÐW…ÕÙEØÚÕ>° ÛíÈÿÝ›è;®Ì.<6-<±4D4H^à…dHdÛå-aõjVLð¨^na~á½Å^Á}¼tqYï½a _Œ ³“©ò-LŒáQsýÑžµÔ÷…_šÒÔo AÜ©ÛÕ cYõZnàŒ{ÿà!È õJ uÅõ³á „rø`á=Nf~^½dg~fhŽfh&äAFÙìÃtÉËEÞf~idî·ï¬ÃI~¥=éQÊ-ÏÅ 4ôÌÆ÷]ÏøuWÎÁÞ!A¥ÅúÝÂ{ZÝ*ÕTþ_kªZ-Ž×õbYãë«åÖüZ°Íåí~ !PUÔ®ßŵ6Å-e@‚ Fƒ*èh®SeéÈ+.”f“>i”NégnáOÈÞÁÝxàf™Þ—F¶QpLFs>gõ½ÆuîCM.ÒùERÏå)ü½gýUÇ(ågÿÚUžD€h.à !PÙ¥e„þRÛ½]†ö†oÅ‚TS`MÿÈï Y¤ã*à…ãi‘në®È[MPi¹žkºŽfMðvi–-Å™i¿ž’FîaÅ3“ÚÑHõÑIõéËͽvÆT­[b®û1¯3j(.õÊ}&JXI;Teåè›jW]ñ1Ь^`Å宎™P,?zÚM°Œã(ìè´þE·®íyQa#ÈmÝÞmÞîíÜ®kà–f¸ãža¾4ükån’À¾Ñ””Àœ%gj´äv»½Ÿ=âMZߋ윂­á3GŸ´×(6e}­â~vjèVX.îb¼Á«Æêc±åÓ^h†–£¯V–ƒhc%´h¶ æY8ƒeP/PÚ¶í¶^NMðmoÿpðàdI nâîØÒæåÎpºì›ל=Ìé>WË5âä½Í%›O>žDÄ$å ÄOäWÎNoõî¢ÒœX¶jNàÒîD…åêûÆï¡ŠfEÿö BEXr^ÀoërÐÛŸr*¯r+7¨ ßrcÅftId ó¹häwÔç3sN_RìÅjêÎç¤×¥<ûÔgGìßÍöç`–êö¦êX.èø>ب¤o2¶ï —#( ø¸5M? Nhp/ð‚ã}r‘Žò¿rOÿt+Ç>ØrRáòH1Oõ¶ s;ûa .WI-ÏõÕ@ÇÄÜÈLÿb¢ça*Dzæ·ü]D¥>eTnê+îl¨þs@Çq÷6`ÑmùîÚ„®o ÏeüŽØä pãÁ#kåaƒÇk'×ôd^N\utO÷E(uRßkîUuyW œ€ÀF%ìG=ß'âJeçÆj%&xåõï¦×$Œâ`/ïa—ž§qV¶qW~åe‡Ý/.tC/í1.ã®öêjÿ† ¨‘pí m2sB¸ôµ&÷=.…OЄxy˜y™Wwšwp\øÙvwâ¦at†äžw 7‹zdègéÞiêv)ë^W"}óNÖõ×Rqù oã+å|Íló>ïbê[U‰Ÿøªnÿö|¢ÑW«ô°N‹²>.;B-8Kd‘}mmíµÙ‚͘Ødƒk6fWr¦ö–¤æ6ka'7¥u›yw¾Â±Ù¯¿pþ¸à|°ž‡S“¸â ;ì8ä"'¹‹å§r• 2÷ ÁG„P²L•£t¼ éP· rh‚ ð ?(Â’°u&œ™R¨ÂØÉ®f­‚ÉífBÝý®†6¼!{%¼¤L3Ž·#å-«yWËšÖjÀ5%-)[‹Ážº¥ÿ=*íJæÍ–Ô奷™@µ¹ ½Öw¯¼í ~}›_àw?„YC‰[\6ö0õHÌ=´ØÅ x@*Ð)M@D J&ÈT•ƒ†4¤R0 ‘Ž|$$!9ÂI–°’"4a»r²….\I9b(CŸá°”¦<¥®"…´¬ôЇÄ:^òˆÈ,!=+zGRb’:à5'†-{e—•6c®µqi|_r—˜â•¾0îfŒd|_¿þõ7À¥ÑN÷«Ç?8Êbu¤XÅèCÀÊc•I ea>HP’ Ý!ã)OOq0’ö¼'>óÙHJòÓ’ôˆ&$ÁÉvÒ“7«&D)“@ÿ•}(D›²¢áÍhXM{ZŽ¢ÆeÑjµŒ–‘¦G=Ã|m[bÛ/«D®ïk4Åt[»\s>e¤LvCSûôMi¢1:j\£áöÆÅýÏ›Œä¼1N=š‘’Å)È*ȳªVµ Dê©Ï­rµ«[åg@ *Ö‚z’ª -ÃM"ªÖµ²õ'‘ŠQˆÑŒÆ’j³tÞm)R&’”—P”â¹—™Í°44.Uùàv>ÚÈ˦Ít¦šÊ¸Sùõ:?-\þ´9ÔñtÓ¨†º£8óÈÔN¦cP j%ø‰B^µµWÕªWc+ÛÙ&`fBÐXsËB›ÙN”Gh+pƒ»Ö·²²ÿ¢®¼h±‚¨Q¹eyÍ{Ö¢'=\ŽÔ0Ö3i½.quO˜žÁâaÇ—šò½f±_¬i½ìÙàH–o<•ý.‹  uaD-*¡ŽŠÔŠÖQæ¬ ¸VtÚÔFt-‚ãY FζÁÆgmùpÛ oR·b­/Î  ·ÃÎáD[)×äše¹Ìµ+óhy$N—º]«ž“z ØoQ1˜Xjéh´È.ò&sn`L/û"Û^ä¼¾Õ´&f3[_†q¿éù&h'G¹Œý7ÛëT5A` z!Á^6$ƒ,æG˜ÂfÆ­… jV…’¡¡~3œ‡©¸Ž–C”eŠY€×&‘Z¹ÿÜeŒ¹5ãíª”°ÃDW1·¨Xxù½7õMN‡ü&Ê,¾HN²v4kßû6γí'§LåÿnO{„&´Làw–‚µ_N°$>8æYÇÖ$  Ý™sfN&ã¬ðømœƒ-ìŸA`EÆ1‰ézg?7¯ ®ŸGŠ­@ûò—g[éw‰‰Øñ.}tsì™Ö º—ÒFö©ý€šiMû‰›‚ ~ߓԥŽz¥Ç üT§šÀ|HF«.pW¿ÚUHh­ð|&À$¢{8®smæ]£ì¬m6Æ3^«&{i¯TnòšÛQ=CZÏžÖ c]¿ ¥4¦L ¾ð®‹‹å ÿcÁÈLÞˆ[_Ä1c‘›céKçIÉÝÙ¦ÿÞíé‰!jÞýõ¯9ï-Cª&0Ê®u­¼š€ØÃ.ö±“=á ×gmÛ9Aˆ?\âÏm(úkÓ½î#â¸<ŽÜã-Ïy†ntŸ í?ÃøzÕ.»{cð&zÇ­)¯— äž“»ÜË©¬eÓ]t£÷iÓIït~?e)ßg´¤½w´|õ®vë®=ÁåÉȲӾö¶¯}­g&ÕA²]tn;'×,Ê3¸ÙîÆ?¾PðÞŸ&/q]í$=;;‰.fâ´¯¥ìºœÐã²b– Ûøcv‘¦Ž#N… MËÇ©ÒGžÎ5³ÿÉîï¸[étŒ·¼ñ(j¨G}{@!lY±ì`bÐÁÝž. –ØÚîEà­õÞïQØ %”BB v`Ñ(4ÁÀÀ@ß²9—G­˜^)ÑéÒ’””Œ Za[øVÛ옻̔©ú¥É3ýûµß¹¡uÄ}užç5èÝŸèí—þá9UY©Õ œf¡bÂ×5 ~aÙ5œ¿I`ö^ÄUà$¬Ü!䂾!æDõ AH GU ÉU_H± áõµqÙ¼œe|_Ú´ÛÔ\ùÈÎí ¸ñ\ú©YÐ ÝÀhÞæíÉüÿÑß發5a¢„šž•mŒAª­bjy¾"ìI€!-~¡Z¡Ú‘!ï™a ßí°Å¡0r ©ÍaÇ€ÀP `ªà F_}öUÛöâ`%¢ø‰#>^ÜäÜù=Ö$²×úY¢¹ab&þpâ$!ã,ᓉâ(>aéÕ›½mO$¬‚¬"+ ,öcÀaÂÕ¢@ÞÞââ–éâî™a¦œ™+*0#Dr`£1 €\õñYŸâÊ^Ëw]ã¡eQ—8^ùyc$J"¤Qb›L–rLÓÐ!¦qâ’yâ'JèÁcþÉ#Æð_=NF=.à‚>ÿö[”ƒR–&4¥?j!@'L%UVeU¤¦AZ!BJ•BN˜"`` B0F¤YÖÝP¤Z:\¤<@àõY Ú4Rã Z .¢¢!£‘ÉαäoüàK¡L¾_u¨ÛºÝf)¡;>O†Ó|ÐPžÞdŒäcQeª}ÂRvfg6%&<¥Ö¤U–¦iž&jrBäV¶fWºÓWÆ] ‘ž¥mÖ¬¥njóIÀ \ fvuK÷Á"¢mùÅ Mñ 8ú KGúû!MÖdÂ(&;¶£Nîä§5)Î#=žÞÿá£dff˜g®'{‚¦?FejÿƧ|Î'UBV¶&~æ"BöžÆ<ŒÁÞ¦€j\nî¦B42šÀ‹½ ËÙ¥q^ca…r6b7ž—sf`F'Е£9f:¦£Mjg»åä1!{€Zxþädž¢8äãežgQ @‚°'Žæ(S:åëäü(© )}©å'’¦Ök®$ô' ¨”fœò¨•zÌEâ@|d]Ê`¸X#øÍ\ãq[Jbè_ªW8ŽÛ8Nš‡Î$üagubý5¦c¦èè)ÕÓYNÿ…C$ÜÂŒþ).¨§Žê ºg«I ©¢.*£6ê˜&àB’Nª’¾f¬!ÏŒ‡ÿM)§PA•^©¨:…$ãÈbJ}ŸwáØøÅä™ßJ¢iKŠãšÇ%RÓ9¾)œºÑvÆ‘“Êc®h'€½hŒþéŒ @2ª³>k9à‚£N+µ:*'Ü"¥fkI $ô–‡e”vª¸fœ8Œ4A±ªº¶¥!H Þ—gI."Lu[sÎjϹϭžæÕÉun∮c‰æd(~'x†Öþé‡òé-Xˆ²J´FlŽzT«Å^ì£&€Q²¢¶fkBfØÎ,C0踖lÝ™APÀ8•ºŠêEÁD(¶©MrÞ 9¢·ÕÔ_Ytî 9^^¿Ê×|%&‰ÿ2™x«°l<"l)ëdÀhI\¦&$¥ÄVmg À\ƒÖní5`¬×éµ¥>v¬Ç‚ŽXÖ0œÁ¦š,Û_p€„jËh¼€Ì1ž6&–ù<â2íl¾J®^¢›&vúêvv–w22­x¶h¸ôéG ŠK4«ÕJlp­æn.çn.Æ^kfŠíØ’-’Bl¬¤íÚ¶­êv 4˜kÁÜŠj[Ò€Œ€øéØ—p#£™é䥩¾VâÏÆduZ'¯-Ñ"¡Ñrgw¾ã°«)ZY!XæGàÂ'T®õ¾Äåâh@Açv¯÷~¯ç6zj¦èöé¤"”‚‡ î궯Yÿ¢¬PËÆ®"£ @ìeJúeïÖªšÞjüïð‚hñoÀîÏb-ÒBÙÁFfžê©½!Â0€ÄI\¯[oö–ƒ$d-øv°oí< Ž/ù–ïùnÙ¥Ö!Œ¬û¶ð€ŠÜ¢+ýZiÒ@ðÎÞë™®àòë×OˆbÓ lò+2ðÒ:pÂB0iAÃ~Ä¿]°_0´âÂ_1ø†°²Ž0 —ïê‘m“ª‚—<ÁŸ §ñmBCÊÎìΰ¶%T€@"àúîïJçt&ñ.ÀÆéMâ¤ÛŠÚiã*qÓB.ŒþSITï?ò#·'`1%w.l1 ÿ’p ‹-Ù®–«BÚ–¥ò¸v@üÊ-SäE hãùïÿfð á‡p ±:"pâ"m2n“‹21€!Â-ì#7œ"@²2/s2T'\Ã9D³4Oó9Tò÷Ú'&o±&oòQRꥊ1,É’29«n¹žkº¦òZZ$`€ ðl,Ë2› ðÚ²‹èër+.ó*í/P±*l•$ý.`3'ôó4S³C?4DSs÷^kÃe³6oóÆŠ.~~&€òˆr9‡´û¢¬Êί:#Ô±`êñ,óq¡:"Á./÷$"?®@›Ó"ÛSmµŠB3³&ÿ4tDµQCô5sE[t&o³se”ñŒ³HW5)¿mÜž´n‚@ä@åÍ3= Œ=Î#îÀ2æòö³!ÿ2ž.q9E"ì>M-í°DP_ol_÷µ_óõQ¶4_ƒ}‚S++Fg4'£–$ÂÔ¦UGvd·î¹¾±Vc[¼@‡m=ûë¿0 ­ +µ5pN³0‹C$ä“]ß5P+4üµmß6nßöC@„vSkrùòÁèUK¶qK6üÊïe«åERÀ ðXëj›5>g'iÏ)(Ú´Šúd@ ³•4>á‚lwJL±"pBn§·zçv,ÿ(õHøöŒb´>ÞÂG·}ßwOÀpܦórƒ`øÀàp¿ñ-ãòñqÿ˜¨M§ö!¿u"ïôB $œÙA’x“7†¯„Klðzw¸‡ó6©Àw|kò0èBêâ7Ч8«¬e÷wæÈ±¨€tÛ³L8M«õi'm[ãôjw·wK°ØE’d8‘«„"ìu$¹’/y’{øzŸÃ>™Šˆ_ffÒ7d§8–g9O˜2¨ºøÚ! ˜@8mu£uòò3j38³ÇuÙ=’´P‘·&Ä“繞ïùžÿu‡Ðˈ¸&ŒÁ•k¹¡ºNœ³ {yæX¤ Ïux>߸iìMÿCf?¯kãžÔìÔ¹Jlp’o©“:ŸŸ:ª7y$]’”g3.ðq#º¬Ï:OôÊ2ºܯ¤[7ò–v¥/î¥;ÝKá¨fí%À'x:³ym—:´G»´O{©£zRß«—  ò!€4­;¸c5*ãúSÔ0þŽ6‚'8Žç8ÿó»¹½»í1À&1»½«À9P;¿÷»¿oBT8„¹÷„˜DB¡ƒ»Â/ï3!§ùJ&„Œ>*²Ç¹@Õ½7;J|ü;ʧü&Ä‚À£Á‡D *€2<Í×üN$·IC¼S £ó;šë¸šÿ¯¹ƒëtkwüU’îZ ¼ìAèÔG½ÔO½Ô«¼´ÿ¹leûäØ!¨ÂÌÛ<؇}Nè÷¢ëÕoAØÙ%Ù¨C”·á¯¾ásù¸C¼Â(Àã=¦=kÃ;iÁý5LåZeÂUXæ[€¾ñ?˘$¤ÌC <ëG¿ôï £³âŸ=Ð@ÈÀMûƒ·6²ú>‘V% ÿ®ñÁLÁÔÿ«ÿñ·?Ô§{U&qÊé/ƒ·O?þG¿­ç¼Î*C0pãæ aBoß6übDpá(V'®™XœtôØ‘SH\^H–4yeJ“štè˜2ÅeL˜3eÖ¤ ³eN97q‚òhП ˆ5ZÔˆ¤CK™ÂÓõjT©S©VµzkV­[¹võúlX±cÉ–5{mZµkÙ¶ÅÚÁ&þèÖµ{o^½{õ ibÄJ„XñÅŒœ®5þø8Á'É’UV¶œàefÍ›9o¶ùyæŸBI=jT@¹ «ƒZM&[Ù³i×¶}wnÝ»y÷ m…&Bø7~/ÿ†Dh`hø0bŠŠ5Æ:ÐøÚãŽP&w÷nÙ2”ÎãÉ—ï,ºtzÓEð)Å>°#¾é×·~ýûù›5Ó*@@ŽÀõaŽ!.ˆHºéÄ1`ŠX°›P;¼»CðH:À¼=ÜìœBRO½$Å3&éÅ]|ÆetQä‚ÀÀ ôËTp#2&2;ŒÀÉ$?A‰Ã4ï¥$1(ND‘5`r™‘Ë.½üÌ0Åü8 æ NÇ4SŽN#–sˆ¤ð3É&ŸÜÓ³"¥œR=øÀ>Ç<ÑD]”Q²à¢b.5%Íë‰-ΑsNì°ÿÏN»»Æ‰P§pbTQI=uT>=ÓîÏIc@B³Ü²ÑZm½×\g¬Q8'MÓ˜k.6Ók’’Ùd=Í3Ôf}ÚhQ6Õ)6ÑΣVGûÉLJyËRÆXQ×rÍ=ÝteûÏÌ=ΘM6–X"¡Hß|‘]ö¤ýà€CÕÛÇ´µòÛ„.ùÔ}âˆ%žx*¸äz7/Y¶ØØRz1P}E9É>e'tp¬à¤ÄÅÛ…‚Ø(¾çœu^´ÌáÞ…`Ž7öøãkÚãé‘•ÖW2MJMjhÛ²åî•yá1vޚ뮽~‘]u„À¡9&ÿº1N^›í¤—™§£žÛ‰©ç¬:˜±>¤á¯ýþðÀu«ñÆãž· ³;¦÷MÚ~üñ·%ÑA‰Ê+wÂòË•ÀœóÍéÞ¤X–k…—±@ðÔU_u²Ê<3¯xÛ˜]ñÅ/òÜsÏ÷šÌ}ÿøà7¾sÐC×$IJÿ“@Èmú襟ªGç’EÞMfO\qbÐ|Ýžüò…Ÿ÷ø!¡ð¢œöËÁ~…µ¦žþúí|b²ßž{³/5"|l›&œp  Tà)Ì—90.} H†û(è>L8ì~Ôà#V‹ì!n{µÛ”HHB‚o Tá YˆÀÿ¢­X ¨à ûÆAÞ‡:‚>BÚ™M%âOˆ´k´‰I4 †F´¢aG3¬ P—C+^‹2²€þxØCþ VCãu—9œi<£‘ÈD¡9±hQ”¢ûQÅ,Þy¤OtÒCí}ñcä MÈ8A‰Tä"Õ¨@7vω›š#Ÿ§GK^“kYNxâEþ%€¡ãYJS*r µ;›Ç®!‰I¶•Ìä,iYK­ä“}ôäÔDÙË2à”Á<åB¨ÊÅ]ƒÉP&/*ˆ /A–¶”æ4k‡\êòƒ³Ã…/{© %œŠ¬ÿúW;d*ÿéœàü¨ÙNw^r“1ÙIKüÈ nö² ŽÐç>ùÙOö³”Nðá‹dª3^`ç;ÚÐæ/‘çðSL3¸˜ŒJølo‡›Ùžîvæþÿ%l_œØmÀÂÆ9ÞqœãgîɦÀ%yÑ|øÊYÜêûY ÀøÌG½ßç ħv;)×,ºƒ'ÆÂ|` PºÒi.îkäêP·… ¦<-aèYðŒ~tŠ;+KûÒ›n„SøíiW»/¢~óNü.Í|8yõ^÷ëÖ"/ÿz¨0v¿½ß ÈÄà _xÃ>k_»#•/û¾§¿óáý Ðý:!ïÈ (|è-ÿСúà¦È¯üòÍ þÿ.à€;Ð?ð P(°ë ¨û P tŠÿIJúfÓï@sP‘h JHw$áþVg)rª§`Úà4úÎ g°ö¦ «Ð AuÐLi im°Ãp–¾Àð+p šð4h —ήãP«0ô©‰KA ÷pÿ–ú` ®* É€@ ‘(ذæPq 1R‹X'ð! ÞÊ Ï0¡À;±(ºCQG‘Cñ áàŸÒ¨ ziÌ(Ñoh" ®&PÎ=ñJQwq;{Ê |Éf^‘qÈb ]°ï;qxK±ÊðõI@I”Н·Ñ†¾`²fQí0.° QÓQ£‘õÃñ{i¹‘íZ+ ȱ›ðÕ R ² ëo›²±Ò~úÀð‘õQÀ8±O£#3²¾1GH”æ‘!C²u:áµò1ÿ QëUú ¬€%[Ò%_&Ò 2{IE'YGÃJ2"{ %©¤}&‡’(aò¿Z #1'—2uò`Ãx²’J„â(¡(¯r(7ÒµNi˜,Ç*á)C¬'õI*§2=þ€-Û’-­ààR.ã2.‰ÒŽr²§ÂÆ ÃÒ/wf,AÌ,i1-Õ’4Ü1S1“,wR².á¾ÞL4$ÿÒ2)æ Ö 1"'°0 3(S4E3<,²¦€ÆÞLRð2[“b ¡Ê³3u =@³4H7qs4wS²¬Ã¢à-ÑúÒ5‹3]236Ër6E£Ul ÿ:£S:¥37«³:ÿ@’“ÃÀØ l,Àã •Oû”Z«uN¬[ƒ4ïæ6Ïùê\ç57Äu\y5Z¡ô\ÑuHÔu]´ o[;^kÏâ€^V7ò b_Ëu'!ˆ_á_´ o`±àÛðïUa?¶-Üõ^4ÿ_Ž.%}*¡b´ôàð¶•Ÿð •nTAÖfCVdŸõa¯l NÖ‰ˆDeWVDwïecv ûÎcoViÉ¢/cw•dË•‰|ÖgƒVhyïðŒ¶ @I—Ök¿í6jY4• ‰jÏá„VDÙk Ok›°V¿–n¿â ïiõaÉól©‰ˆfmÙÖý°Vâö4º¶n×*,ð–l÷4Ö”ÀoéRWh9ppwO n±2×s­"rÏqGVN%wr©Ø– <0sõ`s=ñscW+DAtöqËÔÈét…&uÙ¶ B°ý\—" Qv‹×*ú ÷l—t•-wEŠÿ TÉT÷wA°ý¡4NÃx³W* h•Wgy¨œ·˜6æT× ¨z{S-µ—}¿€v“×iÉ–ÝjkÄ—Ê—mÿÀ A°€rØW{óÞ·vãwdÁZ¶*¤ÈéZÙvàÐû—J€³w€ Øe½×SßN;xvT— @‚á@¦’‚+¸x÷@.~sÖS³Š~;øƒ¬@uÁOÑUÒã„Q8v¿sݶ€]øT£€¶dX^45EÕ3(v˜‡=7Dᇠxt;îÐ ›>HTwHÑ ÓS=ø‰—u8ƒ ¸ã°Ø¹6á@؆½¸ fGÿDŒÇ¸n÷ ÿŒ©Xƒ5ViË_…öv1M=”êØŽ¿ö °°ƒ7ˆ3VÀú˜©þ€‹Ñ±AG ù—6º@‘§¸…6 nâ´œK@Ø Òq×à’3ùs9¹“/X ¸Fì3˜ŠMU—2±@t´“Yùf!áw_™‘ÏXd;¤–)„¹à”ב“3Å#~˜AÖöw‘ÍØqÍëId‚†q¹™×q BGš§Ya'!¬Ù“ÙTå%ô`™[ §@œÉ9q…a¹…×€§@–y\2÷uNÆ™žéÕD¸ ó~xŸ%„ëž!t6¡ év“}¯9–›¥Zœd‹ßù%Eÿ•°CN*šn÷à†3:3ØÒŒÖÈA˜`’jM‘•8¡5º÷Þä^:3º`™¹¢YÒ l‡^bqmú[ͧUŸsOcéfT¢ ¨™¢£mÏ!©•šYQº©‰ÙŒgnZ¦ßÒ ôÀok–«?ö Þ8¥Áú}/nšÅrº-­ ­×úf™zï9xßn®Cå@ýÙ-åà‡„¦ Z¯mÜú­ó8~M¬&ªÚ-;Áy7¦ Ûf-€’û:§§ØȇsþE „¡-«Èi¶š³ušÙ‹Cû‚+¡m²{—°Ù¤Ûbû[û³¿šu3aùH»rºyÿSUûPûG¡3>á§Ú`ˆA¸Ö¾¹¶z[È|¨ÚMÿ¹ <Á(¡<¡ \ÕG£ó:¶³ÛN¿Ù±1ú•¯/sXHáœÝÜ!½Û¡¤@ ,Á<Á½¥“ˆŸK{j¾éì»»;Yö{¾ º}ôÜ@ÀݽÕÁ< Ò€ Ò¨¥Ó Öx¾'|Ió€%Ù¸9p PÃëZD­@ÀÏ»ÀKÜNÅý€ÈÝ`ü ÚÁ œ¢$Æ¿u¬’ư””ˆ¹¹ B¼À\ÁƒÅÙÀÖ̉À ,aˆ€Ò€ÀtàÅŸÜB¿žQ´ÑWÿ øèûÜ(ÄÌÙ@ÌÇ<ÍÕœ (ÔÜ\À¹œÎmu¶ç¼¸{ZñüŒÒ Ûä ”¹À FüÀ]È ½ÌXÁØ@ÍQ½ÑE9'æ6ÒïtšÎ¿ H°”„! D]ÌÉ|زË}Ð{ýÐW½Ñ]€ÝîàÚ€3\»c½T-`¨§¿ÃQÓÈÚăœØÕ\ º ÐM<̉¼ÔOÕýÔÙï­`]Ú™tÒi½Ò1Zè ~è‰ÞèQþüÔ-±^"¸ÞB!>â%^‰+a®ààæ]Aë·žà—ýãKÝØÅþèÍþÄÞì×A½÷ÝØs¢Ýí™4îú%­½ Da²°ë1¾×¹ÞèYì÷~äO^ðÉ~äßþ}ØCÞ??÷òéý¾T²ìç}çMþä}ÕÓýóA_ð‹¾ìÍÞD]çÇÜ ú@õ™ô Ü2ÿêï›ò!Ëæ/¾Ä·^ÙGåÿÞè?ô}ŸúQþ„¿ïñßB_ù#?滀$£Àòg?ñ3Ÿà±ÿÚÁ„þ{?Ýáß|¾óß\üâŸÀ <ˆ0¡Â… :|1¢Ä‰+Z¸‡ÔŸ¬xü˜¨K#7ÈÜé'J,î…V‰Ë\¾¬• B¢êê§Æþ$¨¤Ô¥1É.qáÕëöJ´칀Ȭ¦5‘Å +ˆPjBDãQ\p Ëb ż¦9ÏIªIì!t Ïð<á¹:ï‰Ï@eƒÝôâì™Ï€ P_“Tn8È*t¡\êC;FXÉ£\’¡­¨‚òð³pUñ'§´¨G?z ˆiÈ©IOŠ/tQ0£˜ J_ ÓÒä¡áªß(ŽPΘ>$ ;tclxml-3.3~svn11.orig/examples/tclxslt/tkxsltproc.tcl0000644000000000000000000016544611215700771021663 0ustar rootroot#!/bin/sh # \ exec wish "$0" "$@" # tkxsltproc -- # # Simple GUI for xsltproc-style transformations # # Copyright (c) 2005-2002009 Explain # http://www.explain.com.au # Copyright (c) 2003-2004 Zveno # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: tkxsltproc.tcl,v 1.11 2005/05/20 14:08:10 balls Exp $ # Global initialisation set VERSION 1.9 # Temporary hack for TclApp-wrapped executables lappend auto_path [file dirname [info nameofexecutable]] # v3.1+ gives us the "-indent", "-resulturi" and "-profilefilename" options package require xslt 3.3 package require msgcat catch {namespace import ::msgcat::mc} package require uri 1.2 # We need common routines from tkxmllint source [file join [file dirname [info script]] common.tcl] # Pre-load "standard" XSLT extension packages catch { package require xslt::resources ::xslt::extension add http://www.zveno.com/resources ::xslt::resources } catch { package require xslt::process ::xslt::extension add http://www.zveno.com/process ::xslt::process } catch { package require xslt::utilities ::xslt::extension add http://www.zveno.com/utilities ::xslt::utilities } tk appname tkxsltproc # Init -- # # Create the GUI # # Arguments: # win toplevel window # # Results: # Tk widgets created proc Init win { upvar \#0 State$win state if {[info exists state(initialised)]} { return } set w [expr {$win == "." ? {} : $win}] array set state { src {} ssheet {} result {} cwd {} profile 0 profilefilename {} nonet 0 nowrite 0 nomkdir 0 writesubtree None } wm title $win "Tk XSLTPROC" switch [tk windowingsystem] { aqua - classic { set metakey Command set metakeylabel Command- } default { set metakey Control set metakeylabel Ctrl+ } } menu $w.menu -tearoff 0 $win configure -menu $w.menu $w.menu add cascade -label [mc File] -menu $w.menu.file menu $w.menu.file -tearoff 0 $w.menu.file add command -label [mc {New Window}] -command NewWindow -accel ${metakeylabel}N bind $win <${metakey}-n> NewWindow $w.menu.file add separator $w.menu.file add command -label [mc {Reload Stylesheet}] -command [list Compile $win] -accel ${metakeylabel}R bind $win <${metakey}-r> [list Compile $win] if {[tk windowingsystem] != "aqua"} { $w.menu.file add separator $w.menu.file add command -label [mc Preferences...] -command Preferences $w.menu.file add separator $w.menu.file add command -label [mc Quit] -command {destroy .} -accel ${metakeylabel}Q } bind $win <${metakey}-q> {destroy .} $w.menu add cascade -label [mc Help] -menu $w.menu.help menu $w.menu.help -tearoff 0 $w.menu.help add command -label [mc {About tkxsltproc}] -command tkAboutDialog -accel ${metakeylabel}? # This fails on Linux catch {bind $win <${metakey}-?> tkAboutDialog} if {[tk windowingsystem] == "aqua"} { $w.menu add cascade -label tkxsltproc -menu $w.menu.apple menu $w.menu.apple -tearoff 0 $w.menu.apple add command -label [mc {About tkxsltproc}] -command tkAboutDialog $w.menu.apple add command -label [mc Preferences...] -command Preferences } frame $w.controls grid $w.controls -row 0 -column 0 -sticky ew button $w.controls.xform -text [mc Transform] -command [list Transform $win] button $w.controls.reload -text [mc {Reload Stylesheet}] -command [list Compile $win] # TODO: add nice icons grid $w.controls.xform -row 0 -column 0 -sticky w grid $w.controls.reload -row 0 -column 1 -sticky w grid columnconfigure $w.controls 1 -weight 1 Doc $win src -title [mc {Source Document}] -row 1 Doc $win ssheet -title [mc {Stylesheet Document}] -row 2 -command [list Compile $win] Doc $win result -title [mc {Result Document}] -row 3 -type save labelframe $w.options -text [mc Options] grid $w.options -row 4 -column 0 -sticky ew checkbutton $w.options.validate -text [mc {Skip validation}] -variable State${win}(novalidate) checkbutton $w.options.timing -text [mc {Display timing}] -variable State${win}(timing) checkbutton $w.options.xinclude -text [mc XInclude] -variable State${win}(xinclude) checkbutton $w.options.nonet -text [mc {No network}] -variable State${win}(nonet) checkbutton $w.options.nowrite -text [mc {No write}] -variable State${win}(nowrite) checkbutton $w.options.nomkdir -text [mc {No mkdir}] -variable State${win}(nomkdir) label $w.options.writesubtreelabel -text [mc {Write subtree}] button $w.options.writesubtree -text [file tail $state(writesubtree)] -command [list WriteSubtree $win] button $w.options.profile -text [mc Profile...] -command [list Profile $win] if {$::tcl_platform(platform) == "windows"} { $w.options.profile configure -state disabled } button $w.options.security -text [mc Security...] \ -command [list SecuritySettings $win] ### xsltproc options not yet provided # novalid # nodtdattr # maxdepth # maxparserdepth # catalogs # load-trace grid $w.options.validate -row 0 -column 0 -sticky w grid $w.options.timing -row 0 -column 1 -sticky w grid $w.options.xinclude -row 1 -column 0 -sticky w grid $w.options.profile -row 1 -column 1 -sticky w grid $w.options.nonet -row 0 -column 2 -sticky w grid $w.options.nowrite -row 1 -column 2 -sticky w grid $w.options.nomkdir -row 0 -column 3 -sticky w grid $w.options.writesubtreelabel -row 1 -column 3 -sticky e grid $w.options.writesubtree -row 1 -column 4 -sticky w grid columnconfigure $w.options 5 -weight 1 labelframe $w.parameters -text [mc Parameters] ShowParameters $win text $w.parameters.t -wrap none -height 8 \ -xscrollcommand [list $w.parameters.xs set] \ -yscrollcommand [list $w.parameters.ys set] scrollbar $w.parameters.xs -orient horizontal \ -command [list $w.parameters.t xview] scrollbar $w.parameters.ys -orient vertical \ -command [list $w.parameters.t yview] $w.parameters.t insert end [mc {No parameters defined}] $w.parameters.t configure -tabs {4c right 5c left} -state disabled grid $w.parameters.t -row 0 -column 0 -sticky news grid $w.parameters.xs -row 1 -column 0 -sticky ew grid $w.parameters.ys -row 0 -column 1 -sticky ns grid columnconfigure $w.parameters 0 -weight 1 set state(messages) [labelframe $w.messages -text [mc Messages]] grid $w.messages -row 7 -column 0 -sticky news text $w.messages.log -wrap none \ -state disabled \ -xscrollcommand [list $w.messages.xscroll set] \ -yscrollcommand [list $w.messages.yscroll set] scrollbar $w.messages.xscroll -orient horizontal \ -command [list $w.messages.log xview] scrollbar $w.messages.yscroll -orient vertical \ -command [list $w.messages.log yview] grid $w.messages.log -row 0 -column 0 -sticky news grid $w.messages.yscroll -row 0 -column 1 -sticky ns grid $w.messages.xscroll -row 1 -column 0 -sticky ew grid rowconfigure $w.messages 0 -weight 1 grid columnconfigure $w.messages 0 -weight 1 SetProperties $win $w.messages.log frame $w.feedback grid $w.feedback -row 8 -column 0 -sticky ew label $w.feedback.msg -textvariable State${win}(feedback) set state(progress) [canvas $w.feedback.progress \ -width 100 -height 25] set state(progressbar) [$w.feedback.progress create rectangle 0 0 1 25 \ -fill blue -disabledfill white -state disabled] grid $w.feedback.progress -row 0 -column 0 grid $w.feedback.msg -row 0 -column 1 -sticky ew grid columnconfigure $w.feedback 1 -weight 1 grid rowconfigure $win 7 -weight 1 grid columnconfigure $win 0 -weight 1 set state(initialised) 1 return {} } # tkAboutDialog -- # # Information about this application # # Arguments: # None # # Results: # Displays window proc tkAboutDialog {} { catch {destroy .about} toplevel .about catch {::tk::unsupported::MacWindowStyle style .about floatProc} wm title .about [mc {About tkxsltproc}] label .about.libxsltlogo -image libxsltLogo label .about.tcllogo -image tclLogo label .about.tkxsltproclogo -image tkxsltprocLogo text .about.msg -width 40 -height 10 -font Arial .about.msg insert end [mc [format "tkxsltproc - A GUI for xsltproc Version %s Powered by: \tlibxml2\tv%s \tlibxslt\tv%s \tlibexslt\tv%s \tTclXSLT\tv%s \tTcl/Tk\tv%s http://tclxml.sourceforge.net/tkxsltproc.html " $::VERSION $::xml::libxml2::libxml2version \ $::xslt::libxsltversion $::xslt::libexsltversion \ [package require xslt] [info patchlevel]]] .about.msg configure -state disabled grid .about.tkxsltproclogo -row 0 -column 0 -rowspan 2 -sticky news grid .about.msg -row 0 -column 1 -rowspan 2 -sticky news -padx 20 -pady 20 grid .about.libxsltlogo -row 0 -column 2 -sticky news grid .about.tcllogo -row 1 -column 2 -sticky news grid rowconfigure .about 0 -weight 1 grid rowconfigure .about 1 -weight 1 grid columnconfigure .about 1 -weight 1 return {} } # Preferences -- # # Manage application preferences # # Arguments: # None # # Results: # Preferences dialog displayed proc Preferences {} { catch {destroy .prefs} toplevel .prefs wm title .prefs [mc {tkxsltproc Preferences}] labelframe .prefs.extensions -text [mc Extensions] grid .prefs.extensions -row 0 -column 0 -sticky news grid columnconfigure .prefs 0 -weight 1 button .prefs.extensions.load -text [mc Load] -command [list Preferences:LoadExtension] entry .prefs.extensions.script -textvariable ::preferences(extensionScript) button .prefs.extensions.browse -text [mc Browse] -command [list Preferences:Browse] grid .prefs.extensions.load - -row 0 -column 0 -sticky w grid .prefs.extensions.script -row 1 -column 0 -sticky ew grid .prefs.extensions.browse -row 1 -column 1 -sticky e grid columnconfigure .prefs.extensions 0 -weight 1 return {} } proc Preferences:LoadExtension {} { set fname [.prefs.extensions.script get] if {![string length $fname]} { tk_messageBox -icon warning -message [mc {No extension script has been given}] return {} } if {![file readable $fname]} { tk_messageBox -icon error -message [mc {Unable to open extension script}] return {} } if {[catch {uplevel \#0 source $fname} err]} { tk_messageBox -icon error -message "An error occurred while loading the extension\n$err" return {} } return {} } proc Preferences:Browse {} { set fname [tk_getOpenFile -title [mc {Load Extension Script}]] if {![string length $fname]} { return {} } .prefs.extensions.script delete 0 end .prefs.extensions.script insert 0 $fname return {} } proc WriteSubtree {win} { upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] set dir [tk_chooseDirectory -parent $win -title [mc {Choose Write Subtree}] \ -mustexist 1 -initialdir [expr {$state(writesubtree) == "None" ? [pwd] : $state(writesubtree)}]] if {$dir != ""} { set state(writesubtree) $dir $w.options.writesubtree configure -text [file tail $dir] } } proc Profile win { upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] catch {destroy .profile} toplevel .profile wm title .profile [mc {tkxsltproc Profile}] set f [labelframe .profile.f -text [mc Profile]] grid $f -row 0 -column 0 -sticky news grid columnconfigure .profile 0 -weight 1 checkbutton $f.state -text [mc Enabled] -variable State${win}(profile) entry $f.fname -textvariable State${win}(profilefilename) -width 30 button $f.browse -text [mc Browse] -command [list Profile:Browse $win] grid $f.state - -row 0 -column 0 -sticky ew grid $f.fname -row 1 -column 0 -sticky ew grid $f.browse -row 1 -column 1 -sticky w grid columnconfigure $f 0 -weight 1 return {} } proc Profile:Browse win { upvar \#0 State$win state set fname [tk_getSaveFile -title [mc {Save Profiling Data}]] if {![string length $fname]} { return {} } set state(profilefilename) $fname return {} } # Doc -- # # Setup a document pane # # Arguments: # win toplevel window # p pane # args configuration options # # Results: # Widgets created and positioned proc Doc {win p args} { upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] array set options { -type open -title {} -command {} } array set options $args labelframe $w.$p -text $options(-title) grid $w.$p -row $options(-row) -column 0 -sticky ew label $w.$p.url -text [mc URL:] entry $w.$p.urlentry -width 60 -textvariable State${win}(${p}) button $w.$p.browse -text [mc Browse] -command [list Browse $win $p -title $options(-title) -type $options(-type) -command $options(-command)] grid $w.$p.url -row 0 -column 0 -sticky w grid $w.$p.urlentry -row 0 -column 1 -sticky ew grid $w.$p.browse -row 0 -column 2 -sticky e grid columnconfigure $w.$p 1 -weight 1 return {} } # NewWindow -- # # Create another toplevel window # # Arguments: # None # # Results: # Tk toplevel created and initialised proc NewWindow {} { global counter Init [toplevel .top[Incr counter]] return {} } # Compile -- # # Manage loading the stylesheet # # Arguments: # win toplevel window # # Results: # Compiles stylesheet, adds widgets for parameters proc Compile {win} { global stylesheets upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] Log clear $win catch {unset state(stylesheetLoaded)} Feedback $win [mc {Loading stylesheet document}] if {[catch {LoadDoc $win ssheet [mc stylesheet]} ssheetdoc]} { puts stderr "Compile: unable to load stylesheet due to \"$ssheetdoc\"" return {} } Feedback $win [mc {Compiling stylesheet}] set time(precompile) [clock clicks -milliseconds] if {[catch {XSLTCompile $win $ssheetdoc} ssheet]} { Log add $win $ssheet Feedback $win [mc {Compiling stylesheet failed}] after 2000 [list Feedback $win {}] return {} } set time(compile) [clock clicks -milliseconds] Log timing $win "Compiling stylesheet took [expr $time(compile) - $time(precompile)]ms\n" set state(ssheet_cmd) $ssheet set stylesheets($ssheet) $win $ssheet configure -messagecommand [list messages $win] PopulateParams $win set state(stylesheetLoaded) $state(ssheet:mtime) Feedback $win [mc {Loading stylesheet completed}] after 2000 [list Feedback $win {}] return {} } # XSLTCompile -- # # Stub for compilation of the stylesheet # # Arguments: # win toplevel window # doc DOM document token of stylesheet to compile # # Results: # Returns stylesheet command or error message proc XSLTCompile {win doc} { return [::xslt::compile $doc] } # PopulateParams -- # # Add widgets for stylesheet parameters # # Arguments: # win toplevel window # # Results: # Widgets added for each stylesheet parameter proc PopulateParams win { upvar \#0 State$win state upvar \#0 Parameters$win params set w [expr {$win == "." ? {} : $win}] set t $w.parameters.t ShowParameters $win $t configure -state normal foreach child [winfo children $w.parameters.t] { destroy $child } $t delete 1.0 end set state(parameters) {} set parameters [$state(ssheet_cmd) get parameters] if {[llength $parameters] == 0} { HideParameters $win } foreach parameter [lsort $parameters] { foreach {name ns select} $parameter break # Bug workaround: Variables cannot be resolved when passed # in as parameters, so do not attempt to set a default # value that computes using a variable reference. if {[string first \$ $select] >= 0} { set select {} } # Workaround #2: XPath select expressions may need to be # resolved against the base URI of the stylesheet that # defines the parameter. if {![regexp {^("|').*("|')$} $select]} { set select {} } if {[string first . $name] >= 0} { set splitname [split $name .] set head [lindex $splitname 0] if {[winfo exists $t.menu$head]} { if {[winfo class $t.menu$head] != "Menubutton"} { Log add $win "Unable to add parameter entry for \"$name\"" continue } } else { menubutton $t.menu$head -text $head -menu $t.menu$head.menu menu $t.menu$head.menu -tearoff 0 $t window create end -window $t.menu$head $t insert end \n $t insert end \t\t entry $t.menu${head}_value -width 50 bindtags $t.menu${head}_value "[bindtags $t.menu${head}_value] parameter" $t window create end -window $t.menu${head}_value $t insert end \n } set root .menu foreach step [lrange $splitname 1 [expr [llength $splitname] - 2]] { if {![winfo exists $t.menu$head${root}_$step]} { $t.menu$head$root insert 0 cascade -label $step \ -menu $t.menu$head${root}_$step menu $t.menu$head${root}_$step -tearoff 0 } append root _$step } set tail [lindex $splitname end] set m $t.menu$head$root $m insert 0 command -label $tail -command [list NestedParameter $win $name $ns $t.menu$head $t.menu$head$root $t.menu${head}_value] set params($name) $select lappend state(parameters) [list $name $ns [list set ::Parameters${win}($name)]] } else { entry $t.value$name -width 50 if {[string length $name] > 15} { $t insert end $name\n\t\t } else { $t insert end \t$name\t } $t.value$name insert 0 $select $t window create end -window $t.value$name -stretch yes -align center $t insert end \n lappend state(parameters) [list $name $ns [list $t.value$name get]] } } $t configure -state disabled return {} } proc ShowParameters {win} { upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] grid $w.parameters -row 6 -column 0 -sticky news return {} } proc HideParameters {win} { upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] grid forget $w.parameters return {} } # NestedParameter -- # # Displays parameter value for a "nested" parameter. # # Arguments: # win toplevel window # name parameter name # ns parameter's XML Namespace # mb menu button for this parameter group # menu menu widget for this parameter # entry entry widget to display parameter select value # # Results: # Widget display changed proc NestedParameter {win name ns mb menu entry} { upvar \#0 State$win state upvar \#0 Parameters$win select set w [expr {$win == "." ? {} : $win}] set t $w.parameters.t $t configure -state normal set tags [$t tag ranges $mb] foreach {start end} $tags { $t delete $start $end } $t insert [list $mb + 1 chars] \t$name $mb $entry delete 0 end $entry insert 0 $select($name) bind parameter [list ChangeParameter $win $name $entry] $t configure -state disabled return {} } # ChangeParameter -- # # Keep track of parameter values # # Arguments: # win toplevel window # name parameter name # entry entry widget containing value # # Results: # State variable updated proc ChangeParameter {win name entry} { upvar \#0 State$win state upvar \#0 Parameters$win select set w [expr {$win == "." ? {} : $win}] set select($name) [$entry get] return {} } # Transform -- # # Perform XSL transformation and display report # # Arguments: # win toplevel window # # Results: # Documents read into memory, parsed, transformed and report displayed proc Transform win { upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] Log clear $win if {![info exists state(stylesheetLoaded)]} { tk_messageBox -parent $win -message [mc "Stylesheet has not been loaded"] -type ok return {} } set time(start) [clock clicks -milliseconds] Feedback $win [mc {Loading source document}] if {[catch {LoadDoc $win src [mc source]} srcdoc]} { return {} } if {![info exists state(ssheet_cmd)] || \ [string equal $state(ssheet_cmd) {}] || \ $state(stylesheetLoaded) < [LastModTime $state(ssheet)]} { Compile $win } set parameters {} foreach parameter $state(parameters) { foreach {name ns entry} $parameter break set value [eval $entry] if {[string length $value]} { lappend parameters $name $value } } $state(ssheet_cmd) configure -resulturi [$w.result.urlentry get] if {$state(profile)} { if {[catch {open $state(profilefilename) w} profilech]} { tk_messageBox -icon error -type ok -parent $win -message "Unable to write profiling data to \"$state(profilefilename)\" due to \"$profilech\"" return {} } $state(ssheet_cmd) configure -profilechannel $profilech } Feedback $win [mc {Perform transformation}] if {[catch {eval $state(ssheet_cmd) transform [list $srcdoc] $parameters} resultdoc]} { catch {close $profilech} Log add $win $resultdoc Feedback $win [mc {Transformation failed}] after 2000 [list Feedback $win {}] return {} } catch {close $profilech} set time(xform) [clock clicks -milliseconds] Log timing $win "Transformation took [expr $time(xform) - $time(start)]ms\n" # When the stylesheet's method is NULL, the type of the result document # determines the default output method. set method [$state(ssheet_cmd) cget -method] switch -glob -- $method,[dom::node cget $resultdoc -nodeType] { ,HTMLdocument { set method html } ,* { set method xml } } if {[string length $state(result)]} { set fname {} set state(result) [$w.result.urlentry get] if {[catch {uri::split $state(result)} spliturl]} { # Treat as a pathname set fname $state(result) set state(result) file:///$state(result) } else { array set urlarray $spliturl switch -- $urlarray(scheme) { http { tk_messageBox -message "Saving to a http URL is not yet supported" -parent $win -type ok -icon warning Log add $win [Serialize $win $resultdoc -method [$state(ssheet_cmd) cget -method]] } file { set fname $urlarray(path) } default { tk_messageBox -message "Saving to a \"$urlarray(scheme)\" type URL is not supported" -parent $win -type ok -icon warning Log add $win [Serialize $win $resultdoc -method [$state(ssheet_cmd) cget -method]] } } } if {[string length $fname] && [catch {open $fname w} ch]} { Log add $win $ch Feedback $win [mc {Unable to save result}] after 2000 [list Feedback $win {}] return {} } fconfigure $ch -encoding utf-8 puts $ch [Serialize $win $resultdoc -method $method -indent [$state(ssheet_cmd) cget -indent]] close $ch } else { Log add $win [Serialize $win $resultdoc -method $method -indent [$state(ssheet_cmd) cget -indent]] } set time(finish) [clock clicks -milliseconds] Log timing $win "saving result took [expr $time(finish) - $time(xform)]ms\n" Log timing $win "total time for processing: [expr $time(finish) - $time(start)]ms\n" Feedback $win [mc {Processing completed}] after 2000 [list Feedback $win {}] return {} } # Serialize -- # # Stub for serializing DOM document # # Arguments: # win toplevel window # doc DOM document # args additional arguments # # Results: # Document text proc Serialize {win doc args} { return [eval dom::serialize [list $doc] $args] } # messages -- # # Display messages emitted by the stylesheet # # Arguments: # win toplevel window # args messages # # Results: # Updates message display proc messages {win args} { upvar \#0 State$win state foreach msg $args { if {[catch {Log addMessage $win "$msg"} errmsg]} { puts stderr "messages: $args" } } update return {} } # LoadDoc -- # # Load a document into an in-memory DOM tree # # Arguments: # win toplevel window # type type of document # label display label # # Results: # Returns DOM tree token proc LoadDoc {win type label} { upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] set state($type) [$w.$type.urlentry get] if {![string length $state($type)]} { tk_messageBox -parent $win -type ok -icon error -message [mc "You haven't specified a $label document"] return -code error "unable to load $label document" } if {[catch {uri::split $state($type)} spliturl]} { # Try the URL as a pathname set fname $state($type) set state($type) file:///$state($type) array set urlarray {scheme file} } else { array set urlarray $spliturl switch -- $urlarray(scheme) { http { set fname $state($type) } file { set fname $urlarray(path) } default { tk_messageBox -message "\"$urlarray(scheme)\" type URLs are not supported" -parent $win -type ok -icon warning return -code error "unable to load $label document" } } } set time(start) [clock clicks -milliseconds] if {[catch {ReadAndParseXML $win $type $fname $state($type) time \ -noent 1 -nonet $state(nonet)} doc]} { return } set state(${type}:mtime) 0 # HTTP downloads will not have mtime set catch {set state(${type}:mtime) [file mtime $fname]} set state(${type}_doc) $doc # BUG WORKAROUND: store the source doc's directory set state(${type}_dir) {} catch {set state(${type}_dir) [file dirname $fname]} return $doc } # LastModTime -- proc LastModTime {uri} { if {[catch {uri::split $uri} spliturl]} { # Try the URL as a pathname set fname $uri } else { array set urlarray $spliturl switch -- $urlarray(scheme) { http { # Not yet supported return 0 } file { set fname $urlarray(path) } default { return 0 } } } return [file mtime $fname] } # ::xslt::security -- # # Implement restrictions on stylesheet operations # # Arguments: # name name of requesting stylesheet # op requested operation # value additional info # # Results: # Returns boolean proc ::xslt::security {name op value} { global stylesheets upvar #0 State$stylesheets($name) state switch -- $op { readfile { return 1 } writefile { if {$value == {}} { # This is the console return 1 } elseif {!$state(nowrite)} { if {$state(writesubtree) != "None"} { set towrite [file split [file normalize $value]] set ok 1 set split [file split $state(writesubtree)] for {set count 0} {$count < [llength $split]} {incr count} { if {[lindex $towrite $count] != [lindex $split $count]} { set ok 0 } } return $ok } else { return 1 } } else { return 0 } } createdirectory { return [expr !$state(nomkdir)] } readnetwork - writenetwork { if {$state(nonet) && \ ([string match http://* $value] || \ [string match ftp://* $value])} { return 0 } else { return 1 } } } # shouldn't be here return 0 } ### Image data - end of script image create photo libxsltLogo -data { R0lGODlhtABEAPf/AP///wAAAP7+/vz8/AUKAjU1Mvv7+729vd7e3SwtKWJi XPb29pKTjpSVkUtMSoODfIuMiXFyb/T09La2sYmKhpmaldnZ2BscGtHRzdXV 1fPz8yQmI9LS0c3NyeHh4ZydmWprZDs8OdnZ1UtSUubm5sXFweTk5P39/Q4O DcnJxfj4+FlaVTEyLsHBvL6+ufDw8BMWEnR1ckNFQtXV0YGCgPLy8rm5sQAE ACwwKu7u7qysqvL18SgqJnFycAACALm5rFFSTbKyprW1ruTl4q2tpTk5N0RL TKGhnaSkoezs7DtFRm9wbcrKyMHBudzc2icpJPr6+s7OzElKRuDg3mxuah4i HWVmZMnJwgIHAGpsaenp6FZYVn1+fOjo5rGxrhEWDmRlYrm6tcbGw8LCwMzM xfb49cXFvXp8eYSFgl1dWO3u7KmpoXh5djI1L7Gxqebm5GFiYHx9el1eXKam mu/x7qampcDAtOrq6hQYE3d4dWdoZYKDgaWlnXZ2dO7w7uzs6mlqaH+Afvv6 +L29tnl7eKCgmvP18qqqpTY4NX19cV9gXebp6mJjYVpaWXJ0cQ4SDPX29KCg lVpcWr29sfPz8lpdXebo5oWHhOrs6UFDP5eYlFdXVSEjHqqqnff69ldaWcXF uVVVUXt7cFFSUOnr6Pn8+EZIRK6uoo6QjBgYFlBUU4eIhQoKCU5QTK6vq1FX Vezu6+js7dDQysjIvbq7uUFHSfHx8ba2qAsPCaeno/X19V1hYL6/vMfIxejq 5z4/PAQHAQMDA0lPUC02NgwMC6GioOTm5AYLBCYrKNrb2dbZ2s3S1OLl4dPT zp2fnH19duzu7qKkoSAlIwYGBry8uS8wLICAdczMwvv8+fz7+G1ubAgMBuHm 6d/j5vH08NfX1re3taOjnVNXV8/PxwIFALOzq8/Qz9jc3fj799PT09PW1J6e j+3w8fb6+szMyvP29v3+/MPEvmJlZdvf4MPEw6Sjm4iHgrO0ruDi36+vp29y cPv7+gIGApCQjQIIAICAgCH5BAEAAP8ALAAAAAC0AEQAAAj/AP8JFBjIkYNq wQIoXMiwocOHECNKnEixosWLGDM+DFbNgaNAA0MK5MJCo8mTKFOqXImSBReR Aq2wChBsVJ0oJwDo3Mmzp8+fQIMKHUq0qNGjSJP2PBGlzqiErKyIbKTwCROl WLNq3cq1K1YmTxQ2GthDYY8FXtOqXcu27c4FZQP0+BcoVYBNQAUIODHAgN+/ gAMLHkzY74ABJwS4Xcx466YAqQItCTCNhM+9UFQskKChhufPoEOLHk1agwRd C1Qgbsy69VAS0wIscRCgkc8TBlRIeJFECwkSJoILH068uHHjv+/kqJF6gGLX 0KNTdbAhQJ2lUBa84BBIBp4v4MOL/x9Pvrz5Lyz0gJtCQo0E1c+jt93b93B8 AYcNx+daJ8AGFAFYwJMAUOiShDPAsBSADwv64KAPN0QoIYQKabPMFHdooBpQ fBkAxYdQGLCafEOdkF0NL9iyABQ5DXBiiivm1JUFAQAYgC074beAGhEEcEMA MJiygiRpFJmGHEgamYYkK6ywySahjAJEK604IIUpMsiQSSa//BJCEYggwgIM EQaATAYI3CEBFPvpZOIClOSghho55EBJcyTmZYAJzmThgAlJ6OIcFOn0+Weg A3hlC0M8naCCLWP4CIwpFLhCTQkliNFLCleQkUIKvYiBqRkt8EINLWFMcI8X ruiQSx1IFP/jzAcVaNIAA5c4sgIiuPwIQToe5LBAoj0NAE4gcbCRRx95IGFC F8ISm+eAKgQCYBHNIKCGCgIsYG0A2GqrQlqM7jSALiaUBAwjubiAiSCC7IPN vPTWi40n+HpSRhmQQKKLIYa80w6/ZRjiRw5+qBHLOQzA4cAjN/gwwTckaMDm gFDUEIdCF1TAQwAJMDGFGgvkpFebRp38k14DqrzTCbpoEUIABZSQDgklLyAz zVdkgDO5C+WY8QcLrrAGE2XAg00p2TSdTSlQoyM1Ovl6gg06/QJsSBmW0MPq BPh4U2ed7MTiChy/YBEAIFFMkYMKMu4ERQ65KFQAKA8oBETbwmr/hpoKKmS2 wAK6FI5aaoAnPvjfIg6wj9+DB55d4c31tUAOQxRB8yBMeLCAALq8oXkBTZDh hLCpDR554iMOVS4AjuawxQ3HoHEPHfCoULW++/LbLyQAl+GHOk7sYMgOO5Tx DSpxnBFHHkfMCUssi/gSiyU0jNLrL704kUTJPc2NhEIsTGKHQijE08wQakSh QzJ30PlCDnf49lsXWiiXQ4rzuw9/DraogS2mkIwuHIIE+svBAXSQPzt1JgqH cAIiAsCCCYhhCp9bQOYoaAcbfGAKXbjDHTAhQuWkiDkXc13Q3LSAJLQBC6mo wAxKsa/fZU1rAAOeISDRhQoEggZjKIM3/yCRAntwgQZ72AMN0IAAaCziiU+M RS/gUIUbcGIM3+iCBKSlEwPkYHwUvMUkFjKJFLgiBA7QQwC2gAFmAAJ9mlNI DKJwgQCc4Q1i+AUK+oACPWBgCG+gAAoakACQJWMKdbhAAvSwRw+8oQtZCIAU QgEgFtyjBBgEwAJEBxna1MgVLSikJDuwChRUIxkqiltQXncuLbTBB09YAyYK hsNaGg8SdABeGcBBCBoQAgne8IYvGBAHGhiTBoFogCViwUzqcYMb3eBCAnxQ BV74bIvF+qJCqnGLSChkA5OwAYBKgIFQgGsGM6gjD2YBAoUMggwV2IQIOlDH CoyDCgGAwxXqGP8AHoQlAJo4RI3MMI4JQkAEMQjABcZxjbBYEpNoWQAJNJeK U0AAQCgYRwUUQgUyYEAK7piCFjTARaCwUgIkeOUT3ECHf9VSa8ijQxj60Ysy 0KECR4wDEuhgCGqc4Zh7QEMgeAGNeShjGeo4RzeoBwEeUPMAPtOAAbIJxg08 oCQBEMUkWsGza1BAIWy4Bj4DMIc5KAQEZsgCBGYQCIXMwgZhQQEZWqAQBzSg RjYAAs1m8QEAyWAcdQTCLGZRAAoKAaKanCgFzbcChTxgFnV8QhOuAIcMiBSb KlSIuVCqUi/QYQfBDK1ok8eLPORBE3TwgybiEAhCuMIbpFgtEvdwBjj/wMEL H0BDsmJACFTUgRc0mGYVDnAzqVJVIalQBAtCgIYwNKGOpDNDPhTSClDYQCGh uEV1wNkIj5qCfCwIbyuucA2FKCAIH3CDGTAaXha0AQTTDYAe7ACKwrLgsJmU qOZY8AM75C0ACrCDFRQyh0DkAQMe+J4qTbpCAAxAAymF5T0ASAc6BNPCFgat IZDABi6gAR+Q0EGHCdELQzgBDUo0CB6IgYYGEIIQeXDEErJgBTgwwgoseGpx p8qTAWgzANU4BRHu4QIxkIF8kzBDeRdrh0xAZh2cUAgDNiEGWUwwAD+4xQTC UIIUHBnA+RBCC65Avh+UwwZNmAUDFAIG+tp3/wK9yK9iWYDmNQPYBmYFsBTu EQUPvIBbRHmdASCs0nuoIbV+qLCivaE1EXNhD06AxDdo0Ack/CEHCEBDKFjw CIUEAglK5AIbYtCDGeuBEWDI8XB3XKwXgDHI5WgBBr6RTsgk+ctSQPN/qwEB 8jVADOVUSCRs4IJeoLMZ5i0HL6LQjDqm4gc2aEEHMHDXu6T5zZjURWL3awcz VFsUNmiyf6QwCHOQQFBFETShJXzpsY3NG98oBtJ6wYYzMDG1OugHPvyAiW9w VSHbiEMdkkgDUZPa1GDAsY4rxuOdeDEc21zDBNzhgS4gwJwByIcZyBwAKtgg HikA0AZuUQ3ITICcG/+7cxPcEQMLzMC8h/1GMjBuj2iPIRDj+KabDTsGBGig W3PudjuJkYswxIMN5g2DObrwuXQ3eNAR5sE9SKEGWMBiTmp4AT5QoY9LMIMO 94gBAzDxB0x0oT3JaEE+glsFRTQgFxC4RKhHXeos6CHhqiYuw8OnhiNskwgu +IZ7usAEAIGhCWig4ARc4A4MKALAt1BAAORgg15kYAYfAzAEFBGDZHA8FHBG gAdoASBiLAEViPgABgobADBYQ+QKKIHPga45cDahsAqYwBii0AIA9YMWHLgD FIyi7qjfowuw+AMp/sB8P3wjEGdgAy8M8QdwpAAWy6cDCTpQjjUcwg2HQML/ BIoBAQrIveB0R7jCV713nkDBGfwEMiYtZgsEIKEAKGjEExzgChcwwQLJAA4B EA42UAgBUAhjwAEI4ATxwHqTlwFMEH+/0Dkk4ARIwE8oQAgzwAHhwE+M8AsB YApocEEacAI6UwSAcAEOoEdgQA2ylgwiMAoXYANYpAYltUpPt25PcA+W4Atd 4AukEITKpwnLggRq8AcHk2gIUAyAsIJFICR74AyawACoEHdzd3B2h3cLZ1w5 ogJq4AQpEAb3EAYUJ1U6kwwdoAOocHIlEAVOQAJdMAUf0At06Ay9wAEg1AVO 4A65QAFeIAYcQGtM4AJh4ALmACgk8A29UAEUUGwc/5ABzSAGEJAPNnAERBAG CYgzjqIGxeAOJQABFVACYwCIHkACUwABrdAC7oAANbBgOKhZXbRuPOAFj2QJ lvCDPpgDvXAGSxANypcDb8ALFFAAP9IQx/ALaFABVXh+Bld3d7d+eseFDgdh FhAFTGAOCKBgAyABdzAFGZAOHJAOFpBgEkAJSWACC5iOgKIBGnAHCMABTOAO 6eAEHjAFFoABUZAOIyMBNUACyWAO8ZgOCGACHmAB5uAOKcAETBAFGeBn3AJ1 yTADGGAO6ZABTgAo3dgDq2B5P0N8ORh1XsAMJGCLJGmLmNALDcAEFSYGjIAL CuEPBBCTMqk2eLAKDGB+Sv+0Wz1ABVmYalvYcDoxAI+iBR5QioFiAHphAJej BcFBAkmgIi6yALbgbi/AHH5xOaY4BSagBXTClCbQHrqQGRJwjlPAHknwArxB AvVYllv5AsMCOypQA0kAHKXYHp4hTQGwkNoyfB4JiwAAdSrlBswwBIM5BIZp mG/gC+0RBVlQRzcADDIZmTIZACugCRSAYsgyahFABYBwdz7JftKoE/gxOaeh AgYgI6O5GRLQHCbTF4ADIvYBO9nRGRqAOISzmqqRGEKpC56xmn6hGbSJm1Dg HACwF0q5GaaBODUAgjLABOlgAjVwg68YANMYYU9ABAjwG29wmMawnYOZDLTh A5L/OZ4xSZkVsAooxgWEoJmc6Zl5x2pZ4TI9gTLzyTJEcTJtgp9BgZ8sYwCU UAeO4AVRkAxa0HR9SZ2xGGHIkAsTEA8YkAxOgAAIkAwZMJHuIAcBAJnkKZlY 4AMtdglogH6jtgScaQWo9p7txxj0gRj02Rj0kRgOJgF6+A0WYAK2AJSB9pGv xANIQARE4AZb5gK80AJNMGYfECEbKpnA4ANw4Ao4GQii1gfOWGOfGY04qhX8 aZzASQm1iZStkZrlyByqMQDa0QXP4pauKBTFt6PhcAhEkA/lcA82YAPUwAu8 kAKTkaSRqTaqQAuogJ57AH3s2ZlgYGMoGppukh+N8xcs/1osk/M3m/ECfyAC FAAIJkAy0qkWAqCUcaIF4CAJ4KAFNQA3u6kBurAhSLGmN/AEhZALbuoGcToB NlCIvPBdelqe/LACRGCZqxBqhNAHMbCZhGpb1fCT2AEn8+Nuy7EAXhqUUqkD YUACXCmHZzAz4NIMbsOXi0GmYwABjcBPFWABJCABJsMXMJoUqroBH8AHrnoK +QCr97Bl9zBNevojCdAA99AAFHCZgbpbMlaiYKAIu4ADxpojAzAByPIqSIAE DdAHbGABbkksjjIFJXcXIoAAnrQQBdAC6dAF48IYA0APDgEBKYAAL5AoenEC Ktui01mdbXADG1ABR1AP7Oqj7/9aDkJQDoggnuSZIDDABq7KAOXXqwUXfQc3 rIoABwQLmkBJIGMQSQ1xAXDgDl2AbjGKoQvxALIgAtQQf9UgBExgAmjBGBkz BAmVtS6QATa4qZrRHCz7E+mqCc5QCDTrqj76pkLwGOSJBcAgBQwQBpqAClXI r5kppSQKCCYKBwK7tFaKMbYwBAPGEESwbCaAWV5krealPjNwZSBDBIgFshIw BAa4EM8wARyQBH6hC0fABXcQsamqozDbABVQAc4ws+x6CLgbdhmqpD4QA2EQ DgzQAA2ACiC6ClAKY8G6BITKCIogB5XAuPApmgNACWbbEKcQBlGAM8QyN3nA EPbgAhj/sLkLkQBrMAaZxBgm2AWjqxCiIASnqwK64AQoEALJYAIvoK1O55eA CbMMoAma8AEfUAjhQLNIkAtEgAq4gAWRCQz84HG24mJbUAQbkABbQFuj9q+I W6iKUAnPW7AvowskcLYLMQemK3zPYQAvgACPRwxWQATxkAEiEEcgcwokeBjO oRgpi58qmxhZOiCKihiOggl+txCJMAHNIKpOUEiI0AEWoAUfe6Aua0WoILya MLvOMLd0Ww+5oFeReQMXgAQPjAb89CM1+auOIKx3p7hyIAmSAL0puhMqoAUi rBD1AA4Z8AJx82AmMAPxYANCYANRgABTIMMJEARi4AT6UwOn/wo4C8COlPDI lLCat/nIqNE4mlEDY1OVg6MGYKQQiWADfyQCokQ6q/gCpwnFCfqynEABDBC8 /lvFAAzAR9AA1TGTXwABmtAPDHAGCRyTPlANDZu8WYC0lbAFjZAAN8C0PgEF f9AHDTEH1GABOPIyKpAD+DADZNAHYfAN9UjIt2AGh8AsXsAeamALXqADFrCd M1AHddAFSeAKVJsBuQCxqCEBOUAL67kKSIABbXkHnRwA1mADsoAGNgJkP9AC HFAxcJO/CPqXhJbMqyC4wSu8DeC/syuzegAhMbmkrVABwgsHwKChAdAKqOAI pdaeGiwHn7AFn4AMydy44dPMzxzNNf9gsDsyBEegOQ3QkIO8EDAAAg4ILoec ARm7EEUgMhk7SNCSAx9QR0UgSiH4DYYJcQsR0JnnECiQDJjK0FFcBWgAARAg 0RNN0RVdARGACzwLDDdQDa0gBXgg0hfAPD2AxmDAvBu8BeIgDi6tzDHtzAwB zRZQ026iAh4AAZiLCm6IADIMGVi1ECjgAjOQDK5Q0AHwAFfQDDG8Nr2AASBE CArBB1dwBVAbAGLwDQgwxJ5ciRQQf6ywAnIABgldA1cKt7BbBTSwCvsK1oLb D7rcysH7AVYAA2nNIAGgwATgA4/QYhGwBMqrB4m7wSv9Cq+w1zDtfjL91zRt LhlA2QFgDyX/YJEyzArrcAuaQNkOQE7NMBkLUQ2lgwEXAAgtIAbN4AF1QzOg EA+dkgYKAb4WgNoBkAhCcAXj4IA8MAeAxwFdQFJcncrJHAhogAaXgNsUANZh TeFV2ABcEGU+oKExqTYocAaoMNc8ibRrjNeq8Ao88NLRKzfXPcLZ3UWUkAGP UdWDwAGZrRA80AnlYAdzHAD1IAZRIAvxl1WgkAU80AJj4A7J4AGeRAynYAdi 0AFXgH+DgAH9zRDtmwKrtxAF/odO4Lo5qr8PXQVxoERBBeGrIOH7uuar0A+r MApPcAwM8QgFEAiaoA/MPcxprLiVEN0joArUveI6wcx+7eKBvVlv/7C+/w3K N95PcyAE+E3ZaTAIjVdtyBUJKAABLfB/JjAEDLHKs9ABHSAGLVACpu3fojBx zcC5CVAPE2BuzPq2O6GqF8AGgXDrs/Xgug6iuh5UENAPcbAFXtIIDeAMkpHn epDGigDdW/AKI/Dsgf7Gg97iBPbisLMA6ovlAt3oCQDNzBbUQDBx39AMTrYQ qcACYdALTQyMDvEEhNAEHeAOeGgCqA7I3L4GvOAEtnCuYd7Q+3sBfXAGZ8AF XPBDQJVECH9MULoH+3oJEEADMna4zl3XfB7dqjACwjAC0qDi0g4AhD7Thy6a KiDE2r61hLwGpu4EPTK+bpACEDoBDdG+cf9WAxrQBd+F1SBABjPgASZA1ey7 7SdvvmOLyg6dUl7cA2yQ9M5D8AX/Q0p061B6vC+WB6Q214cLCBlc8SaO8cIg DBvP19Zd6NUe2PSRG5xc8vdeAk4wBXOcAEQgBgOZDHq1ECtQDr3gAat5B64Q EQVABhYwBfVu8uNbvudL9P++BDEQA8yS9IQg8NCnB1lwBn3Q+KVGCI6gCIDQ BxEACFlAYya6BaMwCpLQ5yuwBRff9V3/9dXN4mJPVtSASkKZAex4Bz6fVUA/ +LI3BGJPvmLgAXdQ2AzBCnMge6OKaYIEEXrQASKg6OAm+ApBvkL/un75YEZ/ AVQQAT3gCIm/+IT/AAgJgAhF0AdUcgm/kAl5UABFgAyjEAMFoAhL8As9YAoX gAghoAgr3ezP3vVGYASqDxDpSGgwAMDgQSh/+gRgyHAOtWQ1VGiocujOkCMN A4iyIUtEkYYJ1pRAMGRhwxWHepnIQWKTxgAKXGRIsoDSmxk2FKSCGSBVE1kf NHL0CJKhyDFTFhxk2pSpxoMDNJBoc+MCICpLlkSI0MNRDDZt5CCBACFTAEC/ pEjZUkwRjzN4Mll5xCVTiDP6wGwSp2rECGHCjNQyIu1GlQMCCTpNeLLhw2S2 JAg9gsBJoaEdP4ZcI8bJkJcNQRBxRyJHLxREiGksxMSErRq0knWIZ0NU/zWY P65UyFw0JJESU3Q5JX4QqsEBEqjeSGUlSxYqWbVGoIIDVR5TjGTwCIHIVBEq caxUY5OqSiZyVFpdQLSlUl+/gQfXqmUYseKCTRvDnOMiWQ41HAhAk2ZEEKoh ojY76hDP8DEqAFYiuSedLpL4JYIrwNBIiia+qTAAPZpxp4QW7KCioVSCMIM3 BG3AQMEAEgiiBCdeMGAAAYpr6jgAkusCEWAeUQQQPQAxErrocPjql1ZMiUGR AFoJQZI4JOEhC1NkwCWTUUYpgpAltvALMMHoU0IJPLCQ5oAMBsqPqf00OqWF ZO7ohaF+yGjmQIasCePFBxM4JQUnptAoFD5acP+iiwpQiOcKG1ZryB4ynGCG oXtkiWIGDK5hgaFMZmSxzz9FMKUhTm5p4gMTKFFhAB2faigqXbSg4gZgHNAD DCv08NVIKhyo4hdORjEFBDQ4MQWOJ0KAoZVG5ACjCEc22AIPHJAZJb4yazlz mGNukGKMb0iQAFamBFhAixhg6mSQGRCQgiEK4hln1AASscGdGR7kJAgxZtgD 1UjccAeBZlCAg4wrrgBBo2qAEoGhAq7oQAQRMHgiAGLWEWI3jRIRwh0RItAo jWdQYOIOCd6MlccTFkjikABuSAAMMBhhBGcregYkFCYh2CKOOOQApI9QQpCj n1ZiYISQCEzR45cQMtn/JbBuz1QCGSwCyIIeC7TQBd2oNMjgApjSGKSF0AJ4 oAkyltColQlSwAAFFHhy24wW0A6AE03WaCGDMRIIQI4SyOjAHpioEGOchlqx YQYRAuGYAjdc6EDuyMtJYQaaYdrEHQ9egCJW42Y1SAAVXpgCjgCA4UFanXG2 XZs8uIjACip4jQAMQMCyYhd5KtFDkl2Q36WSV+Qz88wNtrkBDy+YQKCmE9KF ohgUevL+bb9hKiSKABy5JY3VCuj+AhDWIIKaCULQSA934ugeJgeuAKIhFBDh AQVJ5GMCvEDC/WByhAxkYH+Rq1vpXKYjHgkAClOhBy5u4IMNSGEFjZBEB+Xw /0FJcFAOHAxhIxrxiS2Ioy+h6BKZjDCf5ylhGFUARtcawAsOmOAFKsjRQVgX BSTcwwVu6MQc+JCPMLTgAxRAwwOEMAYvNKAFQjhFJOLQgBJEYRTxGIQN1rAE K8SgAja4xwTGwIEp1IEJHRiDJj7gDnBoIh4TIEIn7PEATYghBfd4hgIYoQcG 9KIEY0gBByzgCk1MsYpxCOQ3koGBCiggDQwgAi3MYS6yvawhtojKAnIwBR2E C1ePwEMpTXlKVKISBqtkJSu/8AhYxhIXBMDCDQKgDVowwQlaaFkPV6cCW5jg G0yIhwtcwIsSuCMKHejFGMbQC0NmIAokcsEYmGDIZP+kwxwdYAITUtCLXujR HE4gQRLu4IFvRMEdhkTAI3vRAmOWgAnpSEcUehGPMYjBHeZIxzemQAItmCAZ 04SnNb/hARIgwBzxCAM4eBGFKeRABdlDnS0Y0j0L+BAKEtCCE5wRAgLgCgsj JWlJTXpSlI4UGCtlKTDIgYUNxIEWvSjXDinqwwF4MqHJsIAFnOAEBEwBARb4 hgUQYAISkMADTuhpMqaA0C4k1QQemAJTfeqBLthiAQuoQRJMMIWnkuAOXTBB O3taKKR6YKgZsIBTTaCFF0hAAy8gQVWb+k81vEANAs1AOpKhwwVkUkcWCAAK NhCAOjDlBMDsghOi8AE5tAH/B5OlbGUte1nMZhYHDrjEPcbgDguwZAEG8OVB TmCABWjAFquFTQ1W+wIAvcAWGtCFBlxrixfIVjK60MVWJWALNSQhCXF91QAG oILUrlYDEtCFXG+b29nK1Rbm1MJwNTDaARhABb/FLXSvqwIV6EKvatAqFG6K ujoEYAMCakS6jmsLLUzhG+boBT3GwAv8HkC/++Vvf/373wPg15m9cEcGEGCa BZi3OAJgMIOdIoATnGAAEW5whSEc4RMwOMLGNW5pAWBhC6/uwhrOrgFudF4Q V/jDAuAwjlDXlEYEwAFymwYJ3DsRNSh1qN/4RgJ9/GMgB1nIQS5qocpZ3vO+ WMlL3mZyk5385KaQYBoBWEIgeLKJprAYCql9QRK0ENWkhlnMYyZzmcncherm oAa6eJWHofxmOMdZzk15SSoC8Y8eMKQHS3EvFJDbXAkEWtCDJnShDW3o3qoA ChN285wd/WhIO2UBeQ5AD/5x6RgH4AlMePCFW/xpUIda1KHOcKMjfWpUx5kJ GwtAIy79aiuwIgDBGEUdopDkVOda17uW8wmiUIdRBANCVnh1sbnwKe8lW9nL Znaznf1saEdb2tOWNgu4UGxsB8IRDqiGsKn9bXCHW9zjJjdMglENBzjizsUO CAA7 } image create photo tclLogo -data { R0lGODlhYQCWAPUAAP//////zP//mf//AP/MzP/Mmf/MAP+Zmf+ZZv+ZAMz/ /8zM/8zMzMyZzMyZmcyZZsyZAMxmZsxmM8xmAMwzM8wzAJnM/5nMzJmZzJmZ mZlmmZlmZplmM5kzM5kzAGaZzGZmzGZmmWZmZmYzZmYzMzNmzDNmmTMzmTMz ZgAzmQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH+BSAtZGwtACH5BAEKAAIALAAA AABhAJYAAAb+QIFwSCwaj8ikcslsOp/Oh1RClVSu2KxWAu16jY9IpGrVms9o 9OPLJqbf8Lic2/7K0ZN0IpG/p9dGCAgPZBSGZ05+WRADBmcTA5EDfYqVcomV jJNnkpGOlqBvmIqeZwaSBhOUoaxZo3eaq1eQkbKttxVOFIqnn1qnm7jCV7q8 AxBmscPDdEy7frVmkQnLzE5ld43JkdXDEdek1L/BlhKE3VffTdhy5LPalRIF APQABOhP7HHuFQnHlRHqCbxXLR8vaQMqHRAIYMECeg8KRjmYBZIvOfPoLfiQ ouMJBwEkNonoRxyWU7bSEKjHsaPLFBn0tXpC8o4sbncWNjTxsqf+hmU0Fa2y mJPehZ5IT3QYBoWVv5RmAgLAgBQpCaBPWJ2aQ69lVZcollFoGgoenJVUv7o8 Ua1Zk1CQTKZZeFSty6XL3DIJxQjZGwkN7bq8amkCnzOAXil6ehYAT8Fh3xg2 IPeKv1RaEr8FtfXNAwBe7cbxNw3hxQobPnxQDO20mQAMBHckDAeYa9JaRvRc UtZ1loWP7UYeXVoLLS0odispW1kLgLqCPdwh7VeL2SvJXZrgXZhfls/B1dIm 7r0CvxMvQXCvBAlqBQKxIZ+hYuo6lgmue65e3j0NYBCy4VUBBQ+sBEBIZpzS XD+2KKeETHFAkgYCAMgWGQUMMASATNH+mGGLBw4mASEc+KmUll0joJBdRyBc AJFx9r3RQYhIjFhbGgAAKNtXAQCAgBaMLIjGjNoxYeMbQgK241corHTAOO6Z QWRH+ykRAShQPbDAklV14KR1vqVBwktNXLnMASdy6VIFL95XnphkMmHmMATo qKZHFNDDjj+VrJhCmdUQEJ6aI0j1zBUDCJnGitsxUZMwAdz5UgcLEfSOJSuq t9kw8UmawnsAPInFHpag11FWy3R6Jwp5bphFmHDEuakwaapJwmcIzqLoG7Lu tUwGnqbgJQCP7sqrS6gOo0GwbAJwaAVRpjFlo7PisoFag76Ewmei3jJllb4O c21VJmQ72Er+w4x5arLCTPnSCaEhxQGx6SLLLi7udoQCCbX25ICluOi2Lmu3 WMWvWk0eWYnAJ5C1DFIdbNCvSxr8uEx2JTjMyqN+fppBvC850E124IbLygHd +hkWAyV8Nd4w9t4LykoWCzybB45VNVw1MRNciYEMpDhpBxVWhc4VPVc7cz0b veRBBAp0eXQFHVHrhIChrATdSxU4sGVPI2ShsCJEavoE1kuDHFYDW3e01AEE xL0MkV6gbclKdoJVAQNtr5Vht/gOLPPdOfd01VRqbQDAnLio6wUuwEHM5sQd OeDqMDM23AXkRffUwX9qoTt3ChlvfstCVXkAelUn2FPNjCUrbcn+Z6ZyHVDe L4UQ6ut/Pn7LZx1/Ct5XGtDLsx23AGazvl0XjlQGi3fTOxQY4KJ8T2FFXpXl Y1ditRMhCAPAuHpnaG4K3Hdj9hPh47Ih2Ht3jtRC+HjxEy4ERAD/SkzS380X 7btF/vYnv5eM4DP160IAW4EyP13lIS4DTAKhsEBWROAAy3tgAe/Cpu4p4gs7 Y4UECKCu2VQAgqnr4P+8EDZhkPAlGvxKBSS4wi60EH/uimFSKlCgCT7hhqeT AAxPuMEUhCV/PnQCEFsRgQcMEYVgG+HRvPCBlzGwdmGD4qQK4MFKaKYJJbDb yVaUxSLS52hfZIIJxBgKBNisjEgZATb+uniHNC5BWHkRgd4sAIDadUQ6MyQA HefQBTwuY1nM42N4UCABuOmpG3phgiG9UT7n4bGRj2xLIdkYCiF6pAIYsGQF OkACFIDgcnmBAkc4GQquhbJlVTnlFJ+wSuthY0XNw51LQJArkTSBJ6y8A2BI siIPFE+XHcEAwLDihI7Q6UAO8ErEQPOVBgCOmU1wpjB0kqZpUo4Aj8KmJD81 DADAcjBEmxgKnDXLZpJzm20bQZ76loIN9NKX4xSLJcPikO1dU5xKaEk1tPSu vUUNewEYpB+eAKAQ4qIAaWoeUjawTHwqgScOxZ80aactQU4tF+7MKP50RALA nDMFIvinRZP+wLyjRTMFcqSmS0T2UZBm04gfDQEIwiJTmNb0CggIaU1RwBYC QOen6WhCS0S6jLAV4GtLnJo6lqAjplZjIR0I5jKmqgRYWhUUEArIs34aySMM hhmfKcB8UInUshrhrMsAgFrPED2kXsGtRYBrOedqBgJYzK54JYJexebRSsgV DQfgq11vmgIrViAgCj3sGSJQ0ZoyQZpmkIdc/4qFCx4gnFeQbGYBYFcsMMFO YoSsGeCWjoqK1gxs/akaORiV2AKmDP7Lwmu1AM7S2pSltNWCan9zOQrIZLe/ Uaxs7xjcLAwXC/M4EnKxQMPFMvePk43tQrAxVjYp1zkKDcU4tVn+W30MEwv/ nC4W/FraJYQGDYAhwDVHSIgDsAOT8p1LZduJhLz5Z0RnLMd+k1iEk/p2vaW1 4xD8eOArqBSNSuhJg2eY4AhzbcKlDayEMZdVEpAgqyDW6tE0fGE5gNjDKSJq sLCnohaP4MUv9rCMPxxiTuI1NMPxwIlLqSI/rvjHXILCSY0I5CIbWXCzPbKS jwyFJTu5yE1+spQ9FeUpW3lH37vulbf8lSxbGCkluMAFdFkCBjStJxhoGQZ4 kuaeiLlWLbrAkE3w5p6E+QIgK5ITkJmCDyjgAwU0wVROWSsMUGUqrfOxOQf1 gQWEsieCLgGjN9JTOz9hyC7x8yn1E5/VRtvZnA0BwddeMpV4NdrTLxE0BnDn aVQjJXZJOB+gGRAvDHT6oKSmNQBojRTQsJoegxL0B4bc6lHr5wlqcfVLSgCa EiigXy4yQYZ8nALHTNrRkF60fhbgbMrBGglqAYGqXgLo58RyS6KuigIUMO4P XMAECggPvNmtn3VTrs/I5rK+q1Llfft7epf9t8ChAIKCG/zgBi+XwhfOcIUL 3C51iHgRPgACTO9b4hhPAsXPt+SMe1ypIOA4lT9OclVKOlglT3kbKi5yJKv8 5V+g+JBhTvOaGyEIADs= } image create photo tkxsltprocLogo -data { R0lGODlh8AAPAfcAMf///84SB0kMDM6JGS4JCVZWVs3NzczMzNacJdOJitGR HsrKytujpNOVIJKSkpCQkJSUlBAODpiYmIyMjJaWloCAgI6Ojvfr0JycnJ6e noqKiqurq5qamqCgoMDAwIWFhaOjozMzM4iIiIKCgrCwsKWlpISEhKenp6mp qa2trcdqa7a2tq6urrOysrS0tOSiI7m4uH5+frEwMbq6usPDw25ubry8vHx7 e76+vnp6esjIyNypLcXFxcTExHh4eHBwcOKYHHRzc8h8EiIiInV1deeqKnJy ctCPHO3Trevr67hHR+G1Ne3NlfTh4UFBQd+xMpxiDtWYIuXBPevCO92tMGBg YMqBFPHhVasSCerNRocRC/rx8dmjKffuXu/bUcuCFfbpq5URC3gRDLkSCNmt atakUsd6EfDw8OG2d8yGIem5NO7S0ubEQOm1MtqlKvHUSrJxce3VTOS1WuK5 OE1NTbWKi5lpaqoYGeOdIGsQDPr04ezRSvTncsyGGO3TeOiyL/PlWFwODNWd SujKRJowMdOWPtHMxWhoaMh8EdfFqfDeUsqCFvTpXJJPTe/YTuO8OoBQC/Xn j9O5kMyFF/z48e3JQefGQeq+OOO9PMl+E+vQSM+MG9qmK9abI+jIQ+/NRMuD FU8wBnIIBe3US+WmPfTnWsl9Er6mheG3NqOBgYsHCMh7EdGTNOanJ76goO7L QnlmZtzT09igJzMgBeLXyJh2SObBYOO+PNGUKdCNHPPgwebBiKMNBMmAFKGR kerOR8ewsc6LL9zAl+S9OtObMuGzQ6EZGmRAC+fHQvDSSMqAE+bm5s+OMOXl 5ePj4+Tk5OLi4uDg4OHh4d7e3t/f39vb293d3dzc3NefJ9ra2tnZ2djY2NfX 19XV1dbW1tTU1NPT09LS0tHR0dDQ0HYVFaASC8p/E+fn59igKOnCwr5XV+Kz s+evLZkICezGPvDQRqQhIsqCILCgoMB+G3wlJciaXNXDwK19Iqh9QejIUJJ9 emcaGsuZJ8+OJqQJCgAAACH5BAEAAAAALAAAAADwAA8BAAj/AAEIHEiwoMGD CBMqXMiwocOHECNKnEixosWLGDNq3Mixo8ePIEOKHEmypMmTKFOqXMmypcuX MGPKnEmzps2bOHPq3Mmzp8+fQIMKHaqwCdGjSEGmu2M0qdOnFIFhkQG1qlWG CeDducq168AEd6gCAOa17FMVvJSADZDArFug6xKog4elLpZ2d7AweMtXp9a6 vO5i4SVjb8IEcFQkaNq3MUoVUxMowQKPscAEFwrKGMPrTmd1mB2LNqkOi7qC SsIWHBOmM692vDqr0DO6NkgZWFQMTIcbr26BTTwP9uya8GLbyDVqbQtgXd47 eccMZICF+ODOsDsrSc49oWGFF+C1/4XTGZ66sIwvAEuQQAW84nk7y0jXvf7A tA0v3BmDZXtesgDYYZlAS2FXnFj2cRccZcwpdB5muCWwjgr7/WYQWHW1M9x2 DDFgYYJXNaEhbGPQp9AaAEAGnXCeNVjQOq4JhgWA3lUHYlfpDDcYPHBkdtgd Gt6hhHuDuViQVDLmphADrGGxzo1XpYNXcZ09idAFeCmhCwPPGWlQaUC2thVC YIUxBjw+QgmVVK/F5pln6pho0DrpNAFWWFYCMOBXYQCW154AgFWenGo+xeWb bsbWGRwJKREYPASdR+Z7gXVG6GVYhHEHpIVaJeh1ir45hhLfESQDL8ylQ2Fn pU6XV5+xXf8Kx2BTpdmpodl1hiiQbsJDG2PpmJhaca0KhFaiWFimAmtC3srV BaveRVxs0p6p1aZGNTHrm3ckQJtBelAKJGUDNaHiHeoA6qxTa7w33GuIVucm h03whxejCeFmHS+nGRtYO/2u61VW1mkIL7X8NkUhmgpt6+Zge5kr2IcCeyUD cUDmNaJwMzbXma2aueYZbGOmhpe3Fb+1zrB19ZlhXfvFORmCBCVwsWBTwrPG BaV1hnLKfIGlYXV43dXOlHdQ2E6eAHBJF5VFAnBqi0A7RsuyLg+dIXFmPrkO HHTJK62umKVWnZdVv7UGkBqG0bbI8kFn73XW3UHfe3gVm/Zb6mj/LS1gbhYd WNbVMtrufvAwvTdf6fwrJNFUwo3dy/gCAA+lly7+FhxDt8Ubra+9PGVgSTPw rUBKcLapDIoxUKfmZvHXJ2NZkfwv5BlnnoDB8rIoZGiwV6WCpmNUTqBwQ7uc ZJwE2dmeDMqP2LsMoEkIcvA+6eemQfriNbTW7Wh6dkJrSJaxm+cjKgPa2OOU gGtGcpkk3bwQLp/ezccFhxJ/uYYXkChqH0+gg5dLKaFoU1JCa2Q0Opgp4XQM 0UM64HAqRSlJgDp5n2coRov4uKwt6+jby3TksvWpSyHpYEB7OITBm+iBV2NC jcHCQLMyCac17WBWXmRwwhYe5X11odh0//QVwHJBBjAwEwzx4ABBHybFUbDJ XM0CVpAmyMB70oJNEu+gOCcKZQONeJMoQhACJzihAAWoQQ1iEIMJOMAXDiCB HA0QizoCYA0MoIv07qKpzuRGil7cCQn+8Q9VYIeQiEykIhe5SHJURzCOO9r4 AtmTDTiBkAK4jigSGQEBCCACjAxlIgUghqEVZ4Z30AI9hkBGM6JRjWx0owM2 IEcS0LGOSaCkSAygSFF4TwCIzEObeBEIURrzHwJozb+KM5gwhGGTx4zmP4Yw hA3oMiMkuGQiCVA0VSByHwjrzD4KcEYzltEJ1KQmKBdJgEDUD3S7yhQwpXnM WFzTIkkIASNVIf+YeXITPhragEBpWctYGOCgsTCEQg+6AQdMgI10GZfBxhWb dqyTnosswD0pEosYEGCRQ2hEpigTA0zaBT4xaChB52jLWxoiCbFIgkLXkIQk XABs77xLYMaWCoc+FBZqRCM5naDPUNpzoxEZJCNT2ojB2WEChNzHxnjFC33E UaC13MBBSVDHhMYUpoaIaULbNbaxwcYAhlgDWg16UITGwgGhrAFSIWIAbSqy Bg4wgC9ENYEJDAGZgNEiL+DhgFmqlARaneNBX4rLmsL0sWs4z8G+Z4A1eJWt bTUAVDmJSGvOtSE1YGQIEOqKix3NDg69JDeVSRwlFNaNcqRlYrm62Jj/hrWm YgWbvG4XpK7WMbMMveg/IqDNCHyWIRsoaiKHMIE62tIXLiNsXwuAyQV2hhCy nMBAV2rLWHQ3oY41BAPUIabQJUlTvq1jWLf6V0RGYALrNMBxFULdRcYgpgg1 wHnwgtq+lhSR0AtDAR6a3Yb6gruZTahCU3EHVeTQbSMjGswIkdBb/vagyiXk BLTphPkihAQZJmQ1xcpWEowLC270byILwEZ9tFGWhd3uHBN70FTAQVPcitFI x9bcsHZ1vXYlJF4ROQEPG+S/iuwwbn9LAgXWxQ5wdGgMlBuCNbLxxYWN8UAR awA56sN70wocJAWTOJq+1Md1DO2KLYnIXBpZ/yCxqK8iJ0DTx8LUAMB4kwyi TGA5/wOWV+5rllU6UDjYIcyj29cd+sS6W8r00V3dLCKdMMv2xuDNAkmCcBFJ Asde1qB2IJprG/pQNq5YjVbuK4w3oF07tCnR6LPdYGRAR5mG9cy2TsIGFBmC wv7XuJh2xab/EQIS0PSrjDUopVBMav/GoL3/cAKgYwljOyiwohhLVOg6EwYV MACyj370S5NAAmgP1427JuSl35zuRRqgpu/+Kn5DnSVXzNK/a6RyDFAd6AmE sWjQCZyBeFUdhSYbpsiu6RoMwUtOstoBav6HfI0MV5DWurGPZTg8xDdQVbOx BnaNwL5hqY8CEEKLmf9SlMoRlkMV+MIQTTC4p2s67jP7+R9trDQhQ4DpUMZb 3mC9cCwGOkuffjziEVjjGuGRw+pkG2nTgg4c6ngBgysUt1eX6cKTcPMaoFvS RzVyxCcNiwl8l+Zd3WqXBfraUqtxxY2gx9E0Nra8jI3bQ2rp1cdt56/SPAlI JiSls9zeDmNaqcZ0Qht9awCtEp0ERt/3s6MqyZTzNnS5CkstG39QcUPazuNu t4iz7NDOYlogIT7mOdUoS7a7XY2EyEP4gvS9EQ5tU0/dvGL3XmfH2toQrlDk EEjvALu6GdOxwKgxhyBtNsKiEeGT0QJvmMT6EUIfkHdFVrvM+b3PPNzm/of/ oLO8TgfoRLPOZ30sc076wyKWxi1FKMJ9r6eW2DUEQCXjsOkZgU56Mg+iQA6q AGGEs2iNoA/oZlgIZksyF1O9lwQGEGLsV1j1NQQ5EQvhp3waKEoRkE5lVACe 9RGiZ1AkqFk1kHobqEgRQAACQAAEQFRnhEaSl3Nsp3feF25B9meqlmKItG42 EXgpGIT854MdcVFO0FYMR4IG1VD7VgAhkIFCGIXulWQ76EZyNnE14WcREAha kAde6IUCEAhh6Elk2EnDJYXSFHYbgXj/EH9oNla/1VUQOAEniIZ26F4+NX7r ZHg1UXHIpApjEACCOIiEGACBaIiFmIiHOAaMyIiC/8EafeJMqvBRIrZGBQBt Q6CGGqFcNeBW6uVbuJZeSWBZiNVXsDBUQ9B/dyhNIVCFD4VImhgTyWdSjViL g1GLuJiLhsiIAYAFgfiLg8iLiNiLk6ZwABBniXR8GuGHEZB2onhrEJhxdhZu saAHvodbpbhvRPWE+xeEA1aFiCRXNiFpWqA8fWIwnOFH1GIXdjEG0dGOdcEf 7OiIvhgYlBgCo0hiSSBpPMcRSZBI92VhoLhkoihWx+ZYD/hpvtVd7/daV9aE 5DRU2xh+LyZochaCNFFU++BMHMmR4VOObtORzhQ+iyaSJhmJKFkdZqIFRIZw uBRW/NgRftiGlpVetjVuuP8kb35nW141ii/laELHVUKZVWx3VVm2g0HWim30 YsqFE+ukClogBlowlVQ5lWFQleVolVR5lVl5lV4Jklb5lR8pBogEDDnpkmsg Z0SYEdB2XwMZirhUkzo5jT35WLGwcMCldkSpUkV3lKpmbktJYJKGkTRBSBEg BoiZmOQgBou5mIrJmJCpmFFJDlPJmFRJmVQplVg5T/9gky6Jgaa3EUgWAs9I c5Y1jTLFk7h1jY2Vdo0nlI5HlEX3cH75iojEXBUJXzuXE4b5hb75m3kgBsEp nME5nMJ5nIhpnMNZnMmJnJxJYp/oW8pFAhthCInkAOC1d/Fml3K4mn5nlwjn Y3n/aUuIFVtE11C12UZBpnilRodExpvDFYaBkAdh6JsCQJ/4eZ9gOJ9fyJ95 EAj86Z/A+YXPaZPpxYYcMXbq9Xe4hmt/R5dox3AK9VuGEJvct5eGBWN5aGoA KZgToFyxOBPtJYYkSob/N4aeJIZkSJ8oep8nCqAkGqMAmp+cZqDOuAHrlIka oWmI5AANamae13diNXNiNaGYpZfl+X5sh55t518T4GdDsH5ttE4alRNyZqJY KgCzkKVc2qVYqqJc2ll5mV9tJWl8iBFy5gS2xgBWJ3O39Z3h9YaMx1BbZUsE taSsRpsbOmWJZGVMiUg70W6dxIKE2oIsaKKHuqWedKiL/+qlXcqCiFQAYzqm EXemFsGGG5CaDPqg3+edOOma3uVdM/Z+kFeU2eVsbARt7xVoSCaOFeFpW8V2 G2Fus+CCtmqrK+iChvpRBLCluXqruWqGteqCgzqoLihikzqmarmJiBQCbmpb 4cZ34eZpSeiabaVVa6ek6MmkeVhqHCp4DxkDdkWdCSFTiOUAI0dGUKhIG5EE qvoPBNB/8QpMLbiCwfpJn4Sr+cqCnfSrt/qvlIhzyZqXymV+GDGLhLQBWfd7 vrewGQetc9pl5FlL5TmbxOdxV2ZuLBZo0CaRT5iKdghsGtFwUghKJrtO/Zey hsmr8AqvAfsP2DqwCAVt5HoRdv9VAA8qXo/GAHA6pOLmmrTEVtz1eHqKqh83 Zw85dqu4SJZ6sDe3tBs4BPE3sEOXoyGaVImEVps6rbj1gMl2YdyXrVkFeRnq l0t5ZX6meA/Zje6VitTUSq7EYjVQdrKUg3/2EcgItUGYiSVIR/nFVt6VjBhx UTjLppzaoL6HbOpFpxcqqg1ZlOl5ZWqUYd4aA3I2BDLIRu23XVsWW0MZC3b7 Dwb7ERDYVknKlxcbmLBwdKeYRmhUTmZkTq2UTpMWh6CohHVkphjBhiQgc1x7 jdEKVm0lqhJLsYbVl00art9KbOGqXLnZejEWR4ZFsRKLYZxFSDXLFXY1AQJp o7k7aRj/0ZYOynDhVb65ZnB1WrwYyq3JK7k1kLbhOmlVSHysVp5YxVUCJap3 BW1F1BXb673pZQDLShEOIFwRsLBpBbzme2Z01FJctpdFiZ47mLRqBJhKFwMX Nb/Ri6f3+8CNZ25OIHpu0QSJxFUA7FvQRpgN4a5LxalJ8G2H+8IMl75dNnTm ibq0ibEfx0Z+VmUZ26w7OGja1VBKunlBO5PEBnnu9RYsPFyZKofQ6ZIRGJoO 4QCYGGTvlnXS6n23hlYOHJvauq0ppsOSp0ZBdsEZ9o0a2pcyxlK2pJu3aVjN yheIl4mfOaSVhUuIJ7IMYW4RQEdt+cLXKK3fdmYzHKqNt1IR/3xvTeqtVlbB t/lxIaZqpBfGHUyeHaWCsoVkTesV7eYEwMCd+miQJICyVzsQSHxfChVxQwBW 0sqghuzFdbqXpXpvY1y5SgdLiRQCTchJWPZai3y/8Ke04jdQSFalfCFpOJua cgqeuosQCCtiE2qu13m+5WvIC6W+xVuDerqhlTtydRiO73tX48fGnbt5rtB4 T6uAGxBxa+kWarlWQzrP+fjMBAF4qtqJ4sZwl+u7XBvLNUyeskVLx8ukHofL qFYD+VwDwvWNR8mX5xxbXWa3KbVdA9wYduWjWVdh84db7nzP4de7W2d1JCu6 wMumV7dVhuDGFItVRQdjTiq54DzOkf+qtAXgUO0XY5CXpOTZeKkHW8eb0aIB mk48yn33WHXVowIBhDVwl7+XzYZwfzRXczTHAGi10tXb0rXMrRO8wwnNp4Y5 efIL04SGVXfKfVacUQS91nalwnxxUe8Gnn63nbGgXJJmmJ0Gjba2WIiVtWt6 k6WrsHb6mjecpzD9zQkNaND2hMuF00Jc1itF2BkYA1dVgw4wnbVRxxgHdAdJ bsMWAZLqeTOcWbaEiQYHraON1RQbxsjbrTINziO3XHO2xhzMXXJUwIuEV+cK 0dB2ym5Rx6tJjbf2VUgMs/v8e6Stv53lptnMeRd6wzGmoTHtvl+9rsy1avc2 0PdrAFYtepH/yrnbBcf/oIyioczBTaQQaNN3Ob5W17sOnNSEVABXV8imq77Q DbltF66JXcai5HX0O5tbNltAGN843H4XxR12FQPB/Z3eHQF5/WhqRdJoRcNj h3amq7COl8iPp12k19Vl/NXiGkoDRr9D3MaJPOA4d1VDbHbbepvd8b+jaJcC rEih3aDYrNpdttLvB21O0Nx8zXnavaQd7mwPlcu5zEYoSGkpBtHsvNpP+2cF PWgvDb4Kkki+BVPebdLZKW5WjYQ0/Jp33Wl6udKypaRFV8uu7dUgvkbDdt3R zbmzRLHeBYWtN8Rlq10f3R1E3YbOlYNHGHN/V8jrhYTxN7FyBG2d/0jozw3n Erynas5vsETMzEV8Uh7RybVUUf7SEixnRVYfml3c5oe40Gi6o01LYitHSKdl YAzdFuvNFBzpMzjZ0EvEZi3nWT5cOc2teqpcWNgdOCpiNE6dfEfVo13fM2bf t85I7fVX6dTsrOTsrPSEZAS3qYdXOd3kD5zWKpiAqHuUpAdt5M0dKD4BDDrS L8WmKt14FUqngp1VKK63x+R1q3aenbsBviBaO/3fZEt8Bw4idx1tnVZnjJVW Z2ZQK+1dYWvoLS1Q6wrvolXOEB3gXSbWieQEHL6tlE7pSwwiQNhK+4ZucvST mXXwQwnkqy1QdDjt1DRNDr9IvSZLW93GiP+F4jdNm+yb8X1F5Qny7/Tktsx3 TjEoVH6KZRze6rXpdjPtukIVkbHb9DAIg5Sd6wqYVcScdMB89TjvcTpvH+/e 8sIXAXArbe/bb8rr1SOnvK64wYVFy40XukX/cKRG6a4oZ8hsH5KmTl4vhcze 7NIe9kKfag7FpODNZcUHUtKd8UePbz14I4OJrZBX5Ga08nk/+dMU7WfEekOc gYOH8VnvitO1+CDih9xLY2W+8BuKakIVux+78g1P+ULodXHf+Z5PYEId+kQm toRNyyiPp0WP8/n9vuSk8qro+sc0fEsu+64opcrl1snhh3H0wKtNqnFusQZ9 843spBiL0EoPu6r/r/LNPvxBaPGBL/fdWoVnu5S8fiPOb98Lb9bS23Gzucbl 763fTMFnf8FlTGDPK934BvyRDxBDIvwjSLCAgwkOECpkOMHhQ4cxJsSgWHHi hCEFYwHg2NHjR5AhRY4kWdLkSZIbCk4gYYDES5gkNsyc6aDmBoY4Ge5ECDHi xYoUawitMdRoUaRCg06U+DBnQ5w0N8AcWPAgz54+fUqkyLRr1X9JUI4lW9bs WY4OVsqM+VKqTRI2N0yYaxNrQ4hdg+4dGqOoX6RG/e5tCnEnXbkO4sqc+TKj 1cNaH+6NSDgGWLSZNW8mq5Igy7Y049JMrBAnYp5am1pWChhwYMFLCzvk/xnV tNSpLwsSrNEwa16gXrnuLTiE83HkydV+Do1b8c6odGlHBj48aF/BsAdvtzh7 +ty6z3HH3P3voOTJlVnHgDVhaEEnyeXPN0uiYIyYuHGOrnkYq2qg+FIKNgIJ u8gw6G7Tzy0DPCuoBvSYEq6AEB4jKIIIKgwhhPvo8/DDkewjCD/GSNvvOYUW u+u3n6zjKzvtLEOvthNLbAymmcqDML2uJPSrPCCDnABEIokU8R8S3xrNJsR0 uksyvSzL7rW/YpPNp9oUXHADlwxY7sGfArSIwyDLLM+BItOUz8EY9HMuRdOe 3Eq9ivoarMC/DDzQqQRvGi+mBr8ckavghjPz0P/yQlBz0c0MuO+mxHSybUUA 17uTwKTs7A7LPu1aENCWBP0HQhctAgu+hBCKoYACnKiwzBoYlbW+R6cSD7yn 5KzORTurpNI17iziNE4VbcwtlgYNcImECcoj1DIgI4jFkCSqNeRabC+IoUwS ZvX2JEd5q2nJ06LTlcf1qsSTNcn6jKox0WBaFpiWDGh2N8osspC3avv1N4lY tj1UrG8LDulIiabSidklmUwNOB/rbE1dXzUdjlPwpFPs3dzknQpZLjcQ+D7W nHA2CWoB/jdcRGMw+GWPWK7h3dIQOo26MC09Ck8r9Ro2Tk//9LhLEmIhwZCR RxQOMB1jiWUNlWOpFtn/fc00DmaYZZ4pobjsUihVvFTrjihgMW2tR+9ySog0 Y+XtkktllUW2ht0iYAoWpU4NYVqpU5ba6TJfLc8ArF9mOWFPgX5416Wxu1Q7 iwlFEKqo+Os4NGXrrZfugiIItqjdhjAA2b+jTsLk8pwoOuDUCzc4lgdP9A/n ypYmDDvILd5zcqDZjndoZUMeXVnOCRqiTqPKm8CQNZx2mlpqi3/QeadRL8j1 gmHnTTpJ/6vU9sd5NjBtmxO/CUd5W5KJ6LjjLiD0O/2y/p8hDKF+WpSTEPUf J4Z3/t6CEA57s9LeqHQCtsXlJUrXkZjZ1qOVhnTtfFIZGtxeMrz2xeJ9BQnB /2v8cipkjc55KFuDIebHP6OFcHRHIsgGBkjABykugbVjzc6olKl8QfApNLMR qF5itJaoUG7V200IKLabAgjRAIZYoiEcVJCpKGsCtYjB6PY1pBcyKglg6s8M J5OuAQUmWJT5WcbGRUGPFa1BRktW3Kg3PydQ6VRwa5+ymAgkurjEAVCAwgDu 4QoAIimLjCrgeby3FZ25Zl3B2h1tmhQnN62vJVxSXwrreD84wiZ0daxj0v4R ArdsABJCGIAQ7lFKSBwjFOYZ5KIKOLND8ihiitxZpvI0Nh3ajC77+dT6orjG DQjRfk6bGpl4Exhj/sMBTOSkspKJpNzAopRCoGY1Sf8phHqsoZVqsgoCWbQa 2zmulmKUEaceyTE0UnJZ7BOi86hFzH0VICkWGsL9nCY3EpxqCDSZABSs+c9q DkAQSNgmiLa4PdrRqYZEWeSVMLa2oMmlYw3agCsyV69L2rNa8RQMEu3pPAN4 kmsbCAVATVpNMhTUQwc1T9iqA75aerBnPjNn9ySKRlB1SadufJ7pknCqisBC ehMgpj0NUZ4h2KWfJ2UqGfSg0vlAhkUKFY44zXZLMvIpUhtDpw8v2BL7ZXCE KVOZs4oygVORAGDvRJnTnsg/u8DiCExtKlTlI9VKleooNySnQ3nXPd/lRnjq bOYQ8UfWvjmrK3XLH8DwBzD/T8bAZqOk60nTwAS7IqebiATjdiAnsaXk0jSp Es2NJum2NmbUsdZKQgmrVbc64QtbZIXeCVNVA39WlqkXyCxnNvtF8HEHU77K Ie92KZcetuWCLjFE0TAqQuqxlrVHxRdFNtjCa6EMetndVwgSMoFQzFW3J0VD bzcDGcY1cK9inKnkEPSuXW4Np0Zj4gWbSzqe/q1v2p2W/Vg4hIvMT7r9gp6O IpLb8Z7UvJr5bamkNNwxulerO6ycab9KyeY2U6N9m221nng8h1hvCNodsP6U J5ECJJiuguDtgs3SzYsJiL0OzOpfI8rViYYqc8h6rmFLR+Br7TeQAJ6IMZ2A MgNY/wt6Sbgu/SpSAPGq2KRpaLGLx/KYAjj4bOvFYeR29zXbnK9EytXcjsU6 QmKmjK39GvJDLHRk5imZu/CTCGWlzNTyWhklWH4WA2lJzsh5ZzpqOyNOMxe8 H2LQjmn2V3//9TfpedchFqpBh5PAgH4lqi92vvNJEdAEPZvkMU4I7q8gfCXy 7fCmpV2W+pbLxvw+lq20VVm1mkzqSVulidqFHssIYsQawALBnT5pIQga6pHw WcaeZS9ohYWxoMUXpxf82Arllt/8kVXO2a31rRkClgIEr4nZZSH/hhICYo/3 2MgGCZmyfLvwNVtPvItoL33Jvh67s7ED5nZjpZZMJzCE0v9frVdz3+qEojhh 2OmeMmbZ/RHUkbqBf84TVns0rC66ybQNggkQ7xnrbPsLW1D7l7XiKXCrKKzV yhKVPGMQgigznKnrfjgAyBTHAcV7r8W1cb1/52qXsFGJ0VUzbbW972uVpwBR sdDSFdYWUeF8CHSNuUmnyVQq15wjEb/dVWUk6JyA50QKs3CyOl40OkJ3hLxm ALYI3C/XJh2J0nnzThjzkqjjDd0yv/rVrymENGgdAFy/FF/j59cJ46q0Pzd7 YdVOzGwX/e1ALvBuYLkBY3p3UjdJHUVKmu5phh6gpdyF1jlH6hl3mYxgZ5IZ /TTRkGG0x9DNH+SBLHJuz1bu99n/pYgXQlrFBPKTReZ7QP9OzVKmQRCmJwjC dZ6U8dX0nF2lJGHVx8l71n7fJXa72/Pna2jOpMkIAps+K7Jwv1ez6sYvZfqv OYAqIzvi4ySupsI0uTD3Mjccv68az8zof8m9bfM+JFMemkga+3OKE3IAiqAH vxuAq1s/a+o7q6OmPGO30xuu9pKQv5q+n/uqLuk/sZo1OeO1ACxB6FmDcosv QfEc+5MI6RmViDiGWqhA9xu945tAISiEmjs998gddsE4YrG3o1kfccMvwwo5 yqM13KsWTOuXt5KofLK8AqEIPKIIBoyBhUswCsTBmhMYhFM9nks8SHo9Brm+ 6zs00qGe/yW7PSZku+zyPlF5OpEpIlM7N6WbjIwQgGPYQmpavy78p/aruXsB NhuatwnTkne5O2qLCSDqkhCKLg4zwe5TsxIqOt1zovK4nA3YF+SpkhPynAlw glOJAPSzOggUPR0UAgQgxOaLEd2ZDawArOQ6w51iJsNqQ92bLtwTQF4zhCcM pAggOBJoMs95kRiomkOphzT4wxwkpfYzPvYTgpR6ODAEFkTUKh6KpEZ0Ilzc gGsBuf3SxV8cQExkAKnJH2HsOJd4KwBjDUSBDwBAgvFqP/drP5oLtUJ0nHyR xSx5PQtTJ/VpLlxcop7SRUzcRV4swZBLGlDCN0/6JFZhFeyIx/8IMAQAuAC6 SsX3E0Ro1DrP6CDiAid6Wxi4SCf+Sy1wxEXomcTtcsJMRMFrabs4nK6k6R/h cZ94/LVDiQBtAgBaULFolMZqfLjlwLnoI78wWzVWu7c0ZKaaVMKa3MXc6zAC VLMkkJ4aALrra7KdjJZu4QgmmEAKTMWhJMt8DLWjHMNBC7u3MLSpaC6MKsiX JLG6LLnGskpLa7vGYoAmCzd8Ip2iicivpB+C4QhBiDkIRL6/W0yPbEWQbD7Z cK9Oyb8boSQQzLCMekKs3L4mfMmElC410yB82Sk3WqGXU8ZDqYGN4Ag9KANA fD97dEzkg0BdEDwRQcqL08bbYEpOREP/56JLfbs0ytu+SuwXTCs6zpzJlJmf CTCzM1syt3KPEDiVAPoIKtjIaDzLgCrKmgsXnGuku5CUT8FM5gKr9sGWnjLO qszEfrPK20uCJKut3YCboZM1v1EZkpOJ64qFJkCCXSADZtBOs6TN2oQ/wQMA 8GykQRs7jcsPzeQSqHSjvJRKfgPGcow8DXVCtouFZMI+Nlwyv0lHf3mfCDiG QrjB0Ws/BTBLQRyAtGS33GQ9SIqU8RBI9jHN+RTRkju6vHxPAXzCkGvJJPjQ aztIkSuxqUkHSbgHf1LRFy3QAp3AC8TN5msXh/EaW6EglRM3OmLJIW3CChXS 7ns7HuVLdBRR/0NIpo+qUM90LDIwUC6czY78J8hMUADQHlzjE8Q4rgeVJLbQ UTuyUIbEy1+UPA4d0nRMTpShJzZcKzdtLfkEBgGFUqaSUkz9J2bA0444qIDT Rq5JkV4KHmYCq7SrSSGNz39BRyUTUprszEMtU5QBi3rSL6RrQwOAAxedU7M8 ghaVUgUAqCpNUE9NxKDhGMz5Ks20o6kUTW17w+xKx6sEGEZlVBHFNLDYm8My U2oxgARghj6yVLJMRX5IxV/NVICiBU7lCOoKuMqUwp9jIgtCFrokMUZVMuI8 Tmf1Pr6criCzy8jbDSewnyWklg24ByGYqzQQ19kcAH44grny1WAdgP8WVYCK vcE75dSDuorK1L91Wi5OytDIe9Ze9FdZDVPizJ/kpBaPktbs2gA0kAEEoKZT ulRoJFcIhFiIrViLpdhzvcH449TmgxP54sajoShSnb0O48v23LZWzR8AsDT3 ZCL1pJa2OywWSqK3IwGEPaXFVFFgtVhfpVid7VmLPVvHTL9hFVr+4R4Fuakz NMIirKM4nFpKJDHpItGo3EVMiwUyHVJMY6EasBYDYAJ8uIc0WFiwvVmzRICz 5VlfdVyfPdc6rSZBALV17QiDcL0KuxGO05wiVCKrtVvoWdmjs9YyTV38cbRm vRZBiQH5dAAhgIK5QgCOXFGz3AGH5dnHVQD/ybXdnv1a9wu8zPWI5iPPrmoL olnW9qk95nTP4iTHqAxTWrPap82u160HBEjcB8Rdhx0ABChX8O3dx3XcseVI 7qQmZgjazDUI8aCLMaM2/ks0uq1b6O03E3RDTKTeulXZltyuezHFI0hf790B 2z1g8B1f3XVcBdiBYD2CmWXM7bw6Hizej3DfLf0dzEzDJDhaZo1Vu5289oxW mgxTzlTZu8VQQygAAoCEAZBA3C1XBEBgx63hI9Bd3zXbtN3O4xsA77RgjhiI g+AlCwPBuJEJFULVqe1fvMzEqHU7a+1LYNxW690uQ7ADfihX3YLANFhgAwbf HbjhA+7ZGR7bjvza/2dEUCC+YOMJAXnaJVvkSrrk0SU2Om6dSjoewLZSU16T ImZY2C0egDQ4YASA4Bmm4TKW3ExFX78rBIdbY48ooGjJsplISfSMG9A8TgJM WfYk2SHVy5BD0/zZgAHAA8ADvOGtTX5wYAPOYdvV3TC+YV8d4OBlZO6EUUgO CfArkwgYApdLu0FFyJiEVg5VTxS20CpG4Uo0ADsoBFNW3O6tzUP2XVY+5Bn2 XQh+4QHGVHv8O34ggxjN5Y6IhQl4JkTxZQdYor4UU7z8Wzf8UQzt1+xi2qhE RweggkKgJtsdNtGDQH4oZAR4gVcG40PeWW6m2Paz3WpKg3AWZ5EwmolwAv/V BJIhMCLJUucTzt9I3S5pFc09Ttl5zrbkJIFT+OOEndnb7TtBNuBDNmCWdmAE cGDw1dmDXsw0AOefdGjNYJaJLhNSS7J2TlKFrN4LVVOjtgNBVmkeJqUudmkE IIUBcGoDnmXfzVmI5WYhKAP21enjaBDq7OndIACEo4t+hWc3tV6UWU5lVmZD OAXw5QfG7WZ7/GenjukdcGmYTmDbnemr/lUEKAMkoIWn4mo1SYINiMF4/Omj o7UopkTJS1P8ESjdxWqyDOiYtuuobuAcrmoEfmHb9dUyuE3CNpjYnYBW2ckM GWsu4cVrfbuV/WgmgoNCOALxTcVTQljZVABS2AH/KsDru77rQ05gCNzrQh4A OUACzB3tAYoFB5DowoyApeNRe10yVhVRA0jgyfYj4f1afliCF7jrAehtu/5t v9Zr4S6DwVbugjIaBqSQr3SCLFOMTI685DQAfCgERZbS90MA8X6Cu+7t3wZu CPZd8d3rAUADdVVvKzOEUSxMJwPHSzNqA0hMgbZlaGTqJwhvKQhwDpdY8z2C F3hYgdpqBXcxiI4B547HIYBvyVIrJsIHa67pqF6CJ6ACAP/vALfmax7gHWSC 9C5xPCWBZHRwJ6ACQQDv7X5hhI3q395w3q5x3l4CmIZgiYXYHfxxIC9el/AL wQkSKCiEVjbwVNxmJq/x/yd4ASpYAhp/giUAcB1HaSF45CznagbcF2awcQW4 4ZregSfYcCl4AjZ/ckCHZQiucGpKAyyfc8KO3VqwcZd2UfTlcxpXc0qXAkr/ 7RneAUAegDJIbkUvcRungvDObkylAktP8yx4glTfgSXIgt8GY4784U9Xbj1A A0enAjGXUja39FT/c0tXc0z/YvFCg0SfdcIGAwWwcf7OdbPs81b38x1wdSlY 9fHm8QM39iwvhjbnbVIvUARQ81639F+n8Rz/2rXFdsImgzQP8INW9T6XAnjP Ang/9XJPWFlHd67WBWB39IOmglSX9yzIgiWY9z+vd073dHwnbD+gAjYHcAjs dv/ejoOAl/Y4kAKJ928oV+gjWL6EV289kINBJwVcf+EXrm1VD/hWl/hWF3hA 53doFO2OH20kWHP/XgIxz2Y+jwMqiIMn0Hkv8IIl4HlAr3GOJPGYh2Q9gHc2 b/gB/uxUfAIvyIKol3iq5/k1X4IWJaVzP/pc1oVUH3r/juqcneyA94I4OPuJ l3eh7+1UJF6uV/h/H/gnKO5sLmR/P3u8zwK8//NtT8VCQPi3F2c0GPhoH/So pmEqMHu8X3x/b3yzLL3AJ2x5h/eBx3UqB+gjMHvF13yJ//cv9ufIJ2yvF/iB l3LznlkEiIOf1/yfv4KJ/3wINPrQL14kEHh5r/wZBl//gN6BK7gCL+j91Xd9 0jfwMph9rgaDP+jz218CijVgVjRgReh96Zd+V4+DAm1o48/cqLd9wg/jGs70 6Q//oJ/7700DmM9+SEYDi3d1vYdqL7bdYgj/6c8Chs/ZAXgC9HdoRdD7Z5eC PwAIBQgEDkQg5coVPgkXZsnihcqANAMQoAFg8SLGjBo3cuzo8SPIkCJHkixp 8mRJPw0bPnkiZQeCIzsm7liCcOHNK1moPJmIYAAYlEKHEi1q9CjSk5GyLMki hSUCBDB3KNiRRaFCnA3jwPSZ9CvYsGLHGkXzJo4UtFx37JDJ1qoihFmvePGS Lw7En/zI8u3r929SMHGyoHX6/5JtVKn55N7k4yUOZJhHEAgCbPky5swXL3hZ mfbJVKlSs+Bk/HjtgB1UNLNu7RopYbUNQ7+92lihIshcByog8/o38OAe9ajU bfUtYrhY5So6vcRnReHSp/+OpJtwFuRvF5dGWDfOksRyqJMvf1mwbrXaazJO mFWRouwxo5uvbx+sruuQD7+lYjPrXFfEVUxittx3IIJFnbZfHKRoZ1N7pe2m AH0JWnghSEgsGNkOfyzBFim2LRTgG1LtMB6GKaqYkS4IpSdFSzGy11hOCE1V xoo5rshHc9fF2NISVMQFYHvZ1aQjkheCcUV6cfwIWlNxjVjjW7okeeV9LboI GVMtSf+xBJhDCticlFd8uEOFWKo5HV1tQvaEk09kFyZCiixRDJgNnbnDBWv6 KR0S3p2WxRNLFMpUUzp9KcUfpLzw6Asd7qLHn5X+5h1dg1k12BJSOIroH39A +igeO4BGqaWpahYJpo/l2VCojy4x6gtAPArEl0ugqCqvgC3ZKqdZvDArpMQC YWutQIAJZp+9OsuXHjfV1dBTX976AqO04gGEh8QG9Sy4Yi05mBTllruEqI9W G2q6j8b6KBLhyvsVGG9QO6uH7/7xxpfp4urhqEBYOS/BRsWR77voqtsvpEBc ETAQuxQ8MVH5KHytudgyXOuwUshhy8fxUjzySWAQmyy2sf5pwaiotsZaDMkx CwWGHKSQsjK/7b6g8sVAyPzzzIq80fMLCOXcLtBJm1TvxTvbtDEQpCg99UhL 8luuqCu/C4TIVHvtkdUsu5tuMV1/ffZGOoF5q9S6oIo23Bsp8u4LZsd9N0YX ECv1mgEBADs= } # Filter out the process serial number on Mac OS X if {[set idx [lsearch -glob $argv "-psn*"]] >= 0} { set argv [lreplace $argv $idx $idx] } array set args { -inline 1 } array set args $argv if {$args(-inline)} { Init . } tclxml-3.3~svn11.orig/examples/tclxslt/common.tcl0000644000000000000000000003231011113705304020707 0ustar rootroot# common.tcl -- # # Common code shared between tkxmllint and tkxsltproc. # # The master version of this file is in the TclDOM project. # # Copyright (c) 2005 Explain # http://www.explain.com.au # Copyright (c) 2004 Zveno # http://www.zveno.com/ # # See the file "LICENSE" in this distribution for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # $Id: common.tcl,v 1.1 2005/05/21 11:21:01 balls Exp $ package require http # SetProperties -- # # Setup tag properties # # Arguments: # win toplevel window # log log window # # Results: # Tag properties set proc SetProperties {win log} { $log tag configure timing -background #bafdff $log tag configure error -background #ff9d8d $log tag configure errorhighlight -background #cd3030 $log tag configure related -background #ffe59f $log tag configure relatedhighlight -background #e8b417 $log tag configure message -background #ffe59f $log tag configure log -background #b9ffd4 return {} } # Browse -- # # Choose a file # # Arguments: # win toplevel window # field name of state variable field to update # args configuration options # # Results: # Current file is set proc Browse {win field args} { upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] array set opts { -title {Select Document} -type open -command {} } array set opts $args set cwd [pwd] if {$state(cwd) != {}} { set cwd $state(cwd) } switch -- $opts(-type) { save { set fname [tk_getSaveFile -parent $win -title [mc $opts(-title)] -initialdir $cwd] } open - default { set fname [tk_getOpenFile -parent $win -title [mc $opts(-title)] -initialdir $cwd] } } if {![string length $fname]} { return {} } set state($field) file:///$fname set state(cwd) [file dirname $fname] if {[string length $fname] && [string length $opts(-command)]} { uplevel #0 $opts(-command) } return {} } # ReadAndParseXML -- # # Helper procedure to read an XML document from a file # and parse it into a DOM tree. # # Arguments: # win toplevel window # label description of the document # fname filename of document to parse # baseuri base URI for document # timearr name of array for timing information, # "start" entry must exist. # args additional options # # Results: # Document read into memory. Log messages provide feedback. # Returns DOM document token. proc ReadAndParseXML {win label fname baseuri {timearr time} args} { upvar 1 $timearr time upvar \#0 State$win state array set opts { -noent 0 -nonet 0 } array set opts $args set state(externalentities) 0 Feedback $win [mc "Opening $label document \"$fname\""] if {[string match http://* $fname]} { FeedbackProgress $win 0 set state(start_download) [clock clicks -milliseconds] if {[catch {::http::geturl $fname \ -command [list HTTPComplete $win] \ -progress [list HTTPProgress $win] \ -timeout 30000} token]} { tk_messageBox -message "unable to retrieve $label document \"$fname\" due to \"$token\"" -parent $win -type ok -icon error return -code error {} } ::http::wait $token if {[::http::status $token] != "ok"} { return -code error {} } set xml [::http::data $token] ::http::cleanup $token set time(read) [clock clicks -milliseconds] } else { if {[catch {open $fname} ch]} { tk_messageBox -message "unable to open $label document \"$fname\" due to \"$ch\"" -parent $win -type ok -icon error return -code error {} } set time(open) [clock clicks -milliseconds] Log timing $win "Opening $label document took [expr $time(open) - $time(start)]ms\n" Feedback $win [mc "Reading $label document"] # Take note of encoding information set encoding {} gets $ch xmldecl set re ^[::sgml::cl $::xml::Wsp]*<\\?xml[::sgml::cl $::xml::Wsp]+(version[::sgml::cl $::xml::Wsp]*=[::sgml::cl $::xml::Wsp]*("|')[::sgml::cl ^"']+\\2)?[::sgml::cl $::xml::Wsp]*(encoding[::sgml::cl $::xml::Wsp]*=[::sgml::cl $::xml::Wsp]*("|')([::sgml::cl ^"']+)\\4)?[::sgml::cl $::xml::Wsp]*(standalone[::sgml::cl $::xml::Wsp]*=[::sgml::cl $::xml::Wsp]*("|')(yes|no)\\7)?[::sgml::cl $::xml::Wsp]*\\?> if {[regexp $re $xmldecl discard allversion delimiter allencoding delimiter encoding allstandalone delimiter]} { if {[catch {fconfigure $ch -encoding $encoding} msg]} { if {[catch {fconfigure $ch -encoding [string tolower $encoding]} msg]} { tk_messageBox -message "unable to read $label document \"$fname\" due to \"$msg\"" -parent $win -type ok -icon error return -code error {} } } } set xml $xmldecl\n[read $ch] close $ch # Watch out for UTF-16 documents if {[regexp "^(\xFF\xFE)|(\xFE\xFF)" $xml]} { set xml [encoding convertfrom unicode $xml] } set time(read) [clock clicks -milliseconds] Log timing $win "Reading $label document took [expr $time(read) - $time(open)]ms\n" } Feedback $win [mc "Parsing $label XML"] if {[catch {dom::parse $xml \ -baseuri [uri_escape $baseuri] \ -defaultexpandinternalentities $opts(-noent) \ -externalentitycommand [list External $win]} doc]} { if {[string match "unable to*" $doc]} { Log add $win $doc } else { Log addXMLError $win $xml $doc } Feedback $win [mc "Parsing $label document failed"] after 2000 [list Feedback $win {}] return -code error {} } set time(parse) [clock clicks -milliseconds] Log timing $win "Parsing $label document took [expr $time(parse) - $time(read)]ms\n" set time(last) $time(parse) if {$state(xinclude)} { Feedback $win [mc "$label document XInclude processing"] # TODO: handle doc in slave interp if {[catch {dom::xinclude $doc} msg]} { Log addDocError $win $doc $msg Feedback $win [mc "$label document XInclude processing failed"] after 2000 [list Feedback $win {}] } set time(xinclude) [clock clicks -milliseconds] Log timing $win "$label document XInclude took [expr $time(xinclude) - $time(last)]ms\n" set time(last) $time(xinclude) } return $doc } # External -- # # Handle external entity references # # Arguments: # win toplevel window # name current parser # baseuri base URI of document # uri system identifier of referenced entity # id public identifier of referenced entity # # Results: # This reference is logged. # If loading of external entities is enabled then the entity is laoded as usual, # otherwise an empty entity is returned. proc External {win name baseuri uri id} { upvar \#0 State$win state if {$state(nonet) && ([string match http:* $uri] || [string match ftp:* $uri])} { Log entity $win "external entity not loaded, network access not permitted: system ID \"$uri\" public ID \"$id\"" return {} } Log entity $win "external entity reference: system ID \"$uri\" public ID \"$id\"" incr state(externalentities) # resume normal loading of external entity return -code continue {} } # GetFilename -- # # Helper routine to retrieve resource filename # # Arguments: # win toplevel window # entry entry widget containing filename value # field member of state array containing URI # # Results: # Returns filename. If URI is not a valid file: URL, # returns empty string and displays message. proc GetFilename {win entry field} { upvar \#0 State$win state set state($field) [$entry get] if {[catch {uri::split $state($field)} spliturl]} { # Try the URL as a pathname set fname $state($field) set state($field) file:///$state(field) } else { array set urlarray $spliturl switch -- $urlarray(scheme) { http { set fname $state($field) } file { set fname $urlarray(path) } default { tk_messageBox -message "\"$urlarray(scheme)\" type URLs are not supported" -parent $win -type ok -icon warning return {} } } } return $fname } # HTTPComplete -- # # HTTP download is finished # # Arguments: # win toplevel window # token http token # # Results: # Set progress to completion proc HTTPComplete {win token} { upvar \#0 State$win state $state(progress) itemconfigure $state(progressbar) -state disabled Log timing $win "Downloading document took [expr [clock clicks -milliseconds] - $state(start_download)]ms\n" return {} } # HTTPProgress -- # # HTTP download is in progress # # Arguments: # win toplevel window # token http token # total total number of bytes to download # current number of bytes downloaded so far # # Results: # Set progress bar proc HTTPProgress {win token total current} { upvar \#0 State$win state FeedbackProgress $win [expr ($current * 100) / $total] return {} } # Log -- # # Manage the log window # # Arguments: # win toplevel window # args messages to display # # Results: # Log window updated. proc Log {method win args} { upvar \#0 State$win state set w [expr {$win == "." ? {} : $win}] switch -- $method { clear { $state(messages).log configure -state normal $state(messages).log delete 1.0 end $state(messages).log configure -state disabled } view { set what [lindex $args 0] switch -- $what { start { $state(messages).log see 1.0 } end { $state(messages).log see end } default { return -code error "don't know how to view \"$what\"" } } } add { $state(messages).log configure -state normal $state(messages).log insert end [lindex $args 0] $state(messages).log configure -state disabled $state(messages).log see end } addXMLError { $state(messages).log configure -state normal set xml [lindex $args 0] set id 0 $state(messages).log insert end [mc "Problems detected in document:\n"] foreach errormsg [lindex $args 1] { foreach {domain level code node line message relatedLine dummy related1 related2} $errormsg break lappend error($line) error$id lappend related($relatedLine) related$id $state(messages).log insert end $message [list error error$id] if {[string index $message end] != "\n"} { $state(messages).log insert end \n } $state(messages).log tag bind error$id [list ErrorHighlight $w $state(messages).log error$id $line $relatedLine] $state(messages).log tag bind error$id [list ErrorRemoveHighlight $w $state(messages).log error$id $line $relatedLine] incr id } $state(messages).log insert end \n set linenum 1 foreach line [split $xml \n] { if {[info exists error($linenum)]} { $state(messages).log insert end $line "error errorline$linenum" } elseif {[info exists related($linenum)]} { $state(messages).log insert end $line "related relatedline$linenum" } else { $state(messages).log insert end $line } $state(messages).log insert end \n incr linenum } $state(messages).log configure -state disabled $state(messages).log see end } addDocError { $state(messages).log configure -state normal set doc [lindex $args 0] foreach errormsg [lindex $args 1] { foreach {domain level code node line message relatedLine dummy related1 related2} $errormsg break $state(messages).log insert end $message if {[string index $message end] != "\n"} { $state(messages).log insert end \n } } $state(messages).log configure -state disabled $state(messages).log see end } addMessage { $state(messages).log configure -state normal $state(messages).log insert end [lindex $args 0] message $state(messages).log configure -state disabled $state(messages).log see end } timing { if {$state(timing)} { $state(messages).log configure -state normal $state(messages).log insert end [lindex $args 0] timing $state(messages).log configure -state disabled $state(messages).log see end } } entity { if {$state(display:entrefs)} { $state(messages).log configure -state normal $state(messages).log insert end [lindex $args 0] log \n $state(messages).log configure -state disabled $state(messages).log see end } } default { return -code error "unknown method \"$method\"" } } return {} } # ErrorHighlight -- Highlight an error proc ErrorHighlight {win log tag line related} { $log tag configure $tag -background [$log tag cget errorhighlight -background] $log tag configure errorline$line -background [$log tag cget errorhighlight -background] $log tag raise errorline$line error $log tag configure relatedline$related -background [$log tag cget relatedhighlight -background] $log tag raise relatedline$related related return {} } proc ErrorRemoveHighlight {win log tag line related} { Feedback $win {} $log tag configure $tag -background {} $log tag configure errorline$line -background {} $log tag configure relatedline$related -background {} return {} } # Feedback -- Manage the feedback widget proc Feedback {win msg} { upvar \#0 State$win state set state(feedback) $msg update return {} } proc FeedbackProgress {win percent} { upvar \#0 State$win state $state(progress) coords $state(progressbar) 0 0 $percent 25 update return {} } # Incr -- utility to increment a variable, handling non-existance proc Incr var { upvar $var v if {[info exists v]} { incr v } else { set v 1 } return $v } # This should be part of the uri package proc uri_escape uri { # TODO: other characters must also be escaped regsub -all { } $uri {%20} uri return $uri } tclxml-3.3~svn11.orig/examples/tclxslt/Libxslt-Logo-180x168.gif.b640000644000000000000000000002554311113705304023262 0ustar rootrootR0lGODlhtABEAPf/AP///wAAAP7+/vz8/AUKAjU1Mvv7+729vd7e3SwtKWJi XPb29pKTjpSVkUtMSoODfIuMiXFyb/T09La2sYmKhpmaldnZ2BscGtHRzdXV 1fPz8yQmI9LS0c3NyeHh4ZydmWprZDs8OdnZ1UtSUubm5sXFweTk5P39/Q4O DcnJxfj4+FlaVTEyLsHBvL6+ufDw8BMWEnR1ckNFQtXV0YGCgPLy8rm5sQAE ACwwKu7u7qysqvL18SgqJnFycAACALm5rFFSTbKyprW1ruTl4q2tpTk5N0RL TKGhnaSkoezs7DtFRm9wbcrKyMHBudzc2icpJPr6+s7OzElKRuDg3mxuah4i HWVmZMnJwgIHAGpsaenp6FZYVn1+fOjo5rGxrhEWDmRlYrm6tcbGw8LCwMzM xfb49cXFvXp8eYSFgl1dWO3u7KmpoXh5djI1L7Gxqebm5GFiYHx9el1eXKam mu/x7qampcDAtOrq6hQYE3d4dWdoZYKDgaWlnXZ2dO7w7uzs6mlqaH+Afvv6 +L29tnl7eKCgmvP18qqqpTY4NX19cV9gXebp6mJjYVpaWXJ0cQ4SDPX29KCg lVpcWr29sfPz8lpdXebo5oWHhOrs6UFDP5eYlFdXVSEjHqqqnff69ldaWcXF uVVVUXt7cFFSUOnr6Pn8+EZIRK6uoo6QjBgYFlBUU4eIhQoKCU5QTK6vq1FX Vezu6+js7dDQysjIvbq7uUFHSfHx8ba2qAsPCaeno/X19V1hYL6/vMfIxejq 5z4/PAQHAQMDA0lPUC02NgwMC6GioOTm5AYLBCYrKNrb2dbZ2s3S1OLl4dPT zp2fnH19duzu7qKkoSAlIwYGBry8uS8wLICAdczMwvv8+fz7+G1ubAgMBuHm 6d/j5vH08NfX1re3taOjnVNXV8/PxwIFALOzq8/Qz9jc3fj799PT09PW1J6e j+3w8fb6+szMyvP29v3+/MPEvmJlZdvf4MPEw6Sjm4iHgrO0ruDi36+vp29y cPv7+gIGApCQjQIIAICAgCH5BAEAAP8ALAAAAAC0AEQAAAj/AP8JFBjIkYNq wQIoXMiwocOHECNKnEixosWLGDM+DFbNgaNAA0MK5MJCo8mTKFOqXImSBReR Aq2wChBsVJ0oJwDo3Mmzp8+fQIMKHUq0qNGjSJP2PBGlzqiErKyIbKTwCROl WLNq3cq1K1YmTxQ2GthDYY8FXtOqXcu27c4FZQP0+BcoVYBNQAUIODHAgN+/ gAMLHkzY74ABJwS4Xcx466YAqQItCTCNhM+9UFQskKChhufPoEOLHk1agwRd C1Qgbsy69VAS0wIscRCgkc8TBlRIeJFECwkSJoILH068uHHjv+/kqJF6gGLX 0KNTdbAhQJ2lUBa84BBIBp4v4MOL/x9Pvrz5Lyz0gJtCQo0E1c+jt93b93B8 AYcNx+daJ8AGFAFYwJMAUOiShDPAsBSADwv64KAPN0QoIYQKabPMFHdooBpQ fBkAxYdQGLCafEOdkF0NL9iyABQ5DXBiiivm1JUFAQAYgC074beAGhEEcEMA MJiygiRpFJmGHEgamYYkK6ywySahjAJEK604IIUpMsiQSSa//BJCEYggwgIM EQaATAYI3CEBFPvpZOIClOSghho55EBJcyTmZYAJzmThgAlJ6OIcFOn0+Weg A3hlC0M8naCCLWP4CIwpFLhCTQkliNFLCleQkUIKvYiBqRkt8EINLWFMcI8X ruiQSx1IFP/jzAcVaNIAA5c4sgIiuPwIQToe5LBAoj0NAE4gcbCRRx95IGFC F8ISm+eAKgQCYBHNIKCGCgIsYG0A2GqrQlqM7jSALiaUBAwjubiAiSCC7IPN vPTWi40n+HpSRhmQQKKLIYa80w6/ZRjiRw5+qBHLOQzA4cAjN/gwwTckaMDm gFDUEIdCF1TAQwAJMDGFGgvkpFebRp38k14DqrzTCbpoEUIABZSQDgklLyAz zVdkgDO5C+WY8QcLrrAGE2XAg00p2TSdTSlQoyM1Ovl6gg06/QJsSBmW0MPq BPh4U2ed7MTiChy/YBEAIFFMkYMKMu4ERQ65KFQAKA8oBETbwmr/hpoKKmS2 wAK6FI5aaoAnPvjfIg6wj9+DB55d4c31tUAOQxRB8yBMeLCAALq8oXkBTZDh hLCpDR554iMOVS4AjuawxQ3HoHEPHfCoULW++/LbLyQAl+GHOk7sYMgOO5Tx DSpxnBFHHkfMCUssi/gSiyU0jNLrL704kUTJPc2NhEIsTGKHQijE08wQakSh QzJ30PlCDnf49lsXWiiXQ4rzuw9/DraogS2mkIwuHIIE+svBAXSQPzt1JgqH cAIiAsCCCYhhCp9bQOYoaAcbfGAKXbjDHTAhQuWkiDkXc13Q3LSAJLQBC6mo wAxKsa/fZU1rAAOeISDRhQoEggZjKIM3/yCRAntwgQZ72AMN0IAAaCziiU+M RS/gUIUbcGIM3+iCBKSlEwPkYHwUvMUkFjKJFLgiBA7QQwC2gAFmAAJ9mlNI DKJwgQCc4Q1i+AUK+oACPWBgCG+gAAoakACQJWMKdbhAAvSwRw+8oQtZCIAU QgEgFtyjBBgEwAJEBxna1MgVLSikJDuwChRUIxkqiltQXncuLbTBB09YAyYK hsNaGg8SdABeGcBBCBoQAgne8IYvGBAHGhiTBoFogCViwUzqcYMb3eBCAnxQ BV74bIvF+qJCqnGLSChkA5OwAYBKgIFQgGsGM6gjD2YBAoUMggwV2IQIOlDH CoyDCgGAwxXqGP8AHoQlAJo4RI3MMI4JQkAEMQjABcZxjbBYEpNoWQAJNJeK U0AAQCgYRwUUQgUyYEAK7piCFjTARaCwUgIkeOUT3ECHf9VSa8ijQxj60Ysy 0KECR4wDEuhgCGqc4Zh7QEMgeAGNeShjGeo4RzeoBwEeUPMAPtOAAbIJxg08 oCQBEMUkWsGza1BAIWy4Bj4DMIc5KAQEZsgCBGYQCIXMwgZhQQEZWqAQBzSg RjYAAs1m8QEAyWAcdQTCLGZRAAoKAaKanCgFzbcChTxgFnV8QhOuAIcMiBSb KlSIuVCqUi/QYQfBDK1ok8eLPORBE3TwgybiEAhCuMIbpFgtEvdwBjj/wMEL H0BDsmJACFTUgRc0mGYVDnAzqVJVIalQBAtCgIYwNKGOpDNDPhTSClDYQCGh uEV1wNkIj5qCfCwIbyuucA2FKCAIH3CDGTAaXha0AQTTDYAe7ACKwrLgsJmU qOZY8AM75C0ACrCDFRQyh0DkAQMe+J4qTbpCAAxAAymF5T0ASAc6BNPCFgat IZDABi6gAR+Q0EGHCdELQzgBDUo0CB6IgYYGEIIQeXDEErJgBTgwwgoseGpx p8qTAWgzANU4BRHu4QIxkIF8kzBDeRdrh0xAZh2cUAgDNiEGWUwwAD+4xQTC UIIUHBnA+RBCC65Avh+UwwZNmAUDFAIG+tp3/wK9yK9iWYDmNQPYBmYFsBTu EQUPvIBbRHmdASCs0nuoIbV+qLCivaE1EXNhD06AxDdo0Ack/CEHCEBDKFjw CIUEAglK5AIbYtCDGeuBEWDI8XB3XKwXgDHI5WgBBr6RTsgk+ctSQPN/qwEB 8jVADOVUSCRs4IJeoLMZ5i0HL6LQjDqm4gc2aEEHMHDXu6T5zZjURWL3awcz VFsUNmiyf6QwCHOQQFBFETShJXzpsY3NG98oBtJ6wYYzMDG1OugHPvyAiW9w VSHbiEMdkkgDUZPa1GDAsY4rxuOdeDEc21zDBNzhgS4gwJwByIcZyBwAKtgg HikA0AZuUQ3ITICcG/+7cxPcEQMLzMC8h/1GMjBuj2iPIRDj+KabDTsGBGig W3PudjuJkYswxIMN5g2DObrwuXQ3eNAR5sE9SKEGWMBiTmp4AT5QoY9LMIMO 94gBAzDxB0x0oT3JaEE+glsFRTQgFxC4RKhHXeos6CHhqiYuw8OnhiNskwgu +IZ7usAEAIGhCWig4ARc4A4MKALAt1BAAORgg15kYAYfAzAEFBGDZHA8FHBG gAdoASBiLAEViPgABgobADBYQ+QKKIHPga45cDahsAqYwBii0AIA9YMWHLgD FIyi7qjfowuw+AMp/sB8P3wjEGdgAy8M8QdwpAAWy6cDCTpQjjUcwg2HQML/ BIoBAQrIveB0R7jCV713nkDBGfwEMiYtZgsEIKEAKGjEExzgChcwwQLJAA4B EA42UAgBUAhjwAEI4ATxwHqTlwFMEH+/0Dkk4ARIwE8oQAgzwAHhwE+M8AsB YApocEEacAI6UwSAcAEOoEdgQA2ylgwiMAoXYANYpAYltUpPt25PcA+W4Atd 4AukEITKpwnLggRq8AcHk2gIUAyAsIJFICR74AyawACoEHdzd3B2h3cLZ1w5 ogJq4AQpEAb3EAYUJ1U6kwwdoAOocHIlEAVOQAJdMAUf0At06Ay9wAEg1AVO 4A65QAFeIAYcQGtM4AJh4ALmACgk8A29UAEUUGwc/5ABzSAGEJAPNnAERBAG CYgzjqIGxeAOJQABFVACYwCIHkACUwABrdAC7oAANbBgOKhZXbRuPOAFj2QJ lvCDPpgDvXAGSxANypcDb8ALFFAAP9IQx/ALaFABVXh+Bld3d7d+eseFDgdh FhAFTGAOCKBgAyABdzAFGZAOHJAOFpBgEkAJSWACC5iOgKIBGnAHCMABTOAO 6eAEHjAFFoABUZAOIyMBNUACyWAO8ZgOCGACHmAB5uAOKcAETBAFGeBn3AJ1 yTADGGAO6ZABTgAo3dgDq2B5P0N8ORh1XsAMJGCLJGmLmNALDcAEFSYGjIAL CuEPBBCTMqk2eLAKDGB+Sv+0Wz1ABVmYalvYcDoxAI+iBR5QioFiAHphAJej BcFBAkmgIi6yALbgbi/AHH5xOaY4BSagBXTClCbQHrqQGRJwjlPAHknwArxB AvVYllv5AsMCOypQA0kAHKXYHp4hTQGwkNoyfB4JiwAAdSrlBswwBIM5BIZp mG/gC+0RBVlQRzcADDIZmTIZACugCRSAYsgyahFABYBwdz7JftKoE/gxOaeh AgYgI6O5GRLQHCbTF4ADIvYBO9nRGRqAOISzmqqRGEKpC56xmn6hGbSJm1Dg HACwF0q5GaaBODUAgjLABOlgAjVwg68YANMYYU9ABAjwG29wmMawnYOZDLTh A5L/OZ4xSZkVsAooxgWEoJmc6Zl5x2pZ4TI9gTLzyTJEcTJtgp9BgZ8sYwCU UAeO4AVRkAxa0HR9SZ2xGGHIkAsTEA8YkAxOgAAIkAwZMJHuIAcBAJnkKZlY 4AMtdglogH6jtgScaQWo9p7txxj0gRj02Rj0kRgOJgF6+A0WYAK2AJSB9pGv xANIQARE4AZb5gK80AJNMGYfECEbKpnA4ANw4Ao4GQii1gfOWGOfGY04qhX8 aZzASQm1iZStkZrlyByqMQDa0QXP4pauKBTFt6PhcAhEkA/lcA82YAPUwAu8 kAKTkaSRqTaqQAuogJ57AH3s2ZlgYGMoGppukh+N8xcs/1osk/M3m/ECfyAC FAAIJkAy0qkWAqCUcaIF4CAJ4KAFNQA3u6kBurAhSLGmN/AEhZALbuoGcToB NlCIvPBdelqe/LACRGCZqxBqhNAHMbCZhGpb1fCT2AEn8+Nuy7EAXhqUUqkD YUACXCmHZzAz4NIMbsOXi0GmYwABjcBPFWABJCABJsMXMJoUqroBH8AHrnoK +QCr97Bl9zBNevojCdAA99AAFHCZgbpbMlaiYKAIu4ADxpojAzAByPIqSIAE DdAHbGABbkksjjIFJXcXIoAAnrQQBdAC6dAF48IYA0APDgEBKYAAL5AoenEC Ktui01mdbXADG1ABR1AP7Oqj7/9aDkJQDoggnuSZIDDABq7KAOXXqwUXfQc3 rIoABwQLmkBJIGMQSQ1xAXDgDl2AbjGKoQvxALIgAtQQf9UgBExgAmjBGBkz BAmVtS6QATa4qZrRHCz7E+mqCc5QCDTrqj76pkLwGOSJBcAgBQwQBpqAClXI r5kppSQKCCYKBwK7tFaKMbYwBAPGEESwbCaAWV5krealPjNwZSBDBIgFshIw BAa4EM8wARyQBH6hC0fABXcQsamqozDbABVQAc4ws+x6CLgbdhmqpD4QA2EQ DgzQAA2ACiC6ClAKY8G6BITKCIogB5XAuPApmgNACWbbEKcQBlGAM8QyN3nA EPbgAhj/sLkLkQBrMAaZxBgm2AWjqxCiIASnqwK64AQoEALJYAIvoK1O55eA CbMMoAma8AEfUAjhQLNIkAtEgAq4gAWRCQz84HG24mJbUAQbkABbQFuj9q+I W6iKUAnPW7AvowskcLYLMQemK3zPYQAvgACPRwxWQATxkAEiEEcgcwokeBjO oRgpi58qmxhZOiCKihiOggl+txCJMAHNIKpOUEiI0AEWoAUfe6Aua0WoILya MLvOMLd0Ww+5oFeReQMXgAQPjAb89CM1+auOIKx3p7hyIAmSAL0puhMqoAUi rBD1AA4Z8AJx82AmMAPxYANCYANRgABTIMMJEARi4AT6UwOn/wo4C8COlPDI lLCat/nIqNE4mlEDY1OVg6MGYKQQiWADfyQCokQ6q/gCpwnFCfqynEABDBC8 /lvFAAzAR9AA1TGTXwABmtAPDHAGCRyTPlANDZu8WYC0lbAFjZAAN8C0PgEF f9AHDTEH1GABOPIyKpAD+DADZNAHYfAN9UjIt2AGh8AsXsAeamALXqADFrCd M1AHddAFSeAKVJsBuQCxqCEBOUAL67kKSIABbXkHnRwA1mADsoAGNgJkP9AC HFAxcJO/CPqXhJbMqyC4wSu8DeC/syuzegAhMbmkrVABwgsHwKChAdAKqOAI pdaeGiwHn7AFn4AMydy44dPMzxzNNf9gsDsyBEegOQ3QkIO8EDAAAg4ILoec ARm7EEUgMhk7SNCSAx9QR0UgSiH4DYYJcQsR0JnnECiQDJjK0FFcBWgAARAg 0RNN0RVdARGACzwLDDdQDa0gBXgg0hfAPD2AxmDAvBu8BeIgDi6tzDHtzAwB zRZQ026iAh4AAZiLCm6IADIMGVi1ECjgAjOQDK5Q0AHwAFfQDDG8Nr2AASBE CArBB1dwBVAbAGLwDQgwxJ5ciRQQf6ywAnIABgldA1cKt7BbBTSwCvsK1oLb D7rcysH7AVYAA2nNIAGgwATgA4/QYhGwBMqrB4m7wSv9Cq+w1zDtfjL91zRt LhlA2QFgDyX/YJEyzArrcAuaQNkOQE7NMBkLUQ2lgwEXAAgtIAbN4AF1QzOg EA+dkgYKAb4WgNoBkAhCcAXj4IA8MAeAxwFdQFJcncrJHAhogAaXgNsUANZh TeFV2ABcEGU+oKExqTYocAaoMNc8ibRrjNeq8Ao88NLRKzfXPcLZ3UWUkAGP UdWDwAGZrRA80AnlYAdzHAD1IAZRIAvxl1WgkAU80AJj4A7J4AGeRAynYAdi 0AFXgH+DgAH9zRDtmwKrtxAF/odO4Lo5qr8PXQVxoERBBeGrIOH7uuar0A+r MApPcAwM8QgFEAiaoA/MPcxprLiVEN0joArUveI6wcx+7eKBvVlv/7C+/w3K N95PcyAE+E3ZaTAIjVdtyBUJKAABLfB/JjAEDLHKs9ABHSAGLVACpu3fojBx zcC5CVAPE2BuzPq2O6GqF8AGgXDrs/Xgug6iuh5UENAPcbAFXtIIDeAMkpHn epDGigDdW/AKI/Dsgf7Gg97iBPbisLMA6ovlAt3oCQDNzBbUQDBx39AMTrYQ qcACYdALTQyMDvEEhNAEHeAOeGgCqA7I3L4GvOAEtnCuYd7Q+3sBfXAGZ8AF XPBDQJVECH9MULoH+3oJEEADMna4zl3XfB7dqjACwjAC0qDi0g4AhD7Thy6a KiDE2r61hLwGpu4EPTK+bpACEDoBDdG+cf9WAxrQBd+F1SBABjPgASZA1ey7 7SdvvmOLyg6dUl7cA2yQ9M5D8AX/Q0p061B6vC+WB6Q214cLCBlc8SaO8cIg DBvP19Zd6NUe2PSRG5xc8vdeAk4wBXOcAEQgBgOZDHq1ECtQDr3gAat5B64Q EQVABhYwBfVu8uNbvudL9P++BDEQA8yS9IQg8NCnB1lwBn3Q+KVGCI6gCIDQ BxEACFlAYya6BaMwCpLQ5yuwBRff9V3/9dXN4mJPVtSASkKZAex4Bz6fVUA/ +LI3BGJPvmLgAXdQ2AzBCnMge6OKaYIEEXrQASKg6OAm+ApBvkL/un75YEZ/ AVQQAT3gCIm/+IT/AAgJgAhF0AdUcgm/kAl5UABFgAyjEAMFoAhL8As9YAoX gAghoAgr3ezP3vVGYASqDxDpSGgwAMDgQSh/+gRgyHAOtWQ1VGiocujOkCMN A4iyIUtEkYYJ1pRAMGRhwxWHepnIQWKTxgAKXGRIsoDSmxk2FKSCGSBVE1kf NHL0CJKhyDFTFhxk2pSpxoMDNJBoc+MCICpLlkSI0MNRDDZt5CCBACFTAEC/ pEjZUkwRjzN4Mll5xCVTiDP6wGwSp2rECGHCjNQyIu1GlQMCCTpNeLLhw2S2 JAg9gsBJoaEdP4ZcI8bJkJcNQRBxRyJHLxREiGksxMSErRq0knWIZ0NU/zWY P65UyFw0JJESU3Q5JX4QqsEBEqjeSGUlSxYqWbVGoIIDVR5TjGTwCIHIVBEq caxUY5OqSiZyVFpdQLSlUl+/gQfXqmUYseKCTRvDnOMiWQ41HAhAk2ZEEKoh ojY76hDP8DEqAFYiuSedLpL4JYIrwNBIiia+qTAAPZpxp4QW7KCioVSCMIM3 BG3AQMEAEgiiBCdeMGAAAYpr6jgAkusCEWAeUQQQPQAxErrocPjql1ZMiUGR AFoJQZI4JOEhC1NkwCWTUUYpgpAltvALMMHoU0IJPLCQ5oAMBsqPqf00OqWF ZO7ohaF+yGjmQIasCePFBxM4JQUnptAoFD5acP+iiwpQiOcKG1ZryB4ynGCG oXtkiWIGDK5hgaFMZmSxzz9FMKUhTm5p4gMTKFFhAB2faigqXbSg4gZgHNAD DCv08NVIKhyo4hdORjEFBDQ4MQWOJ0KAoZVG5ACjCEc22AIPHJAZJb4yazlz mGNukGKMb0iQAFamBFhAixhg6mSQGRCQgiEK4hln1AASscGdGR7kJAgxZtgD 1UjccAeBZlCAg4wrrgBBo2qAEoGhAq7oQAQRMHgiAGLWEWI3jRIRwh0RItAo jWdQYOIOCd6MlccTFkjikABuSAAMMBhhBGcregYkFCYh2CKOOOQApI9QQpCj n1ZiYISQCEzR45cQMtn/JbBuz1QCGSwCyIIeC7TQBd2oNMjgApjSGKSF0AJ4 oAkyltColQlSwAAFFHhy24wW0A6AE03WaCGDMRIIQI4SyOjAHpioEGOchlqx YQYRAuGYAjdc6EDuyMtJYQaaYdrEHQ9egCJW42Y1SAAVXpgCjgCA4UFanXG2 XZs8uIjACip4jQAMQMCyYhd5KtFDkl2Q36WSV+Qz88wNtrkBDy+YQKCmE9KF ohgUevL+bb9hKiSKABy5JY3VCuj+AhDWIIKaCULQSA934ugeJgeuAKIhFBDh AQVJ5GMCvEDC/WByhAxkYH+Rq1vpXKYjHgkAClOhBy5u4IMNSGEFjZBEB+Xw /0FJcFAOHAxhIxrxiS2Ioy+h6BKZjDCf5ylhGFUARtcawAsOmOAFKsjRQVgX BSTcwwVu6MQc+JCPMLTgAxRAwwOEMAYvNKAFQjhFJOLQgBJEYRTxGIQN1rAE K8SgAja4xwTGwIEp1IEJHRiDJj7gDnBoIh4TIEIn7PEATYghBfd4hgIYoQcG 9KIEY0gBByzgCk1MsYpxCOQ3koGBCiggDQwgAi3MYS6yvawhtojKAnIwBR2E C1ePwEMpTXlKVKISBqtkJSu/8AhYxhIXBMDCDQKgDVowwQlaaFkPV6cCW5jg G0yIhwtcwIsSuCMKHejFGMbQC0NmIAokcsEYmGDIZP+kwxwdYAITUtCLXujR HE4gQRLu4IFvRMEdhkTAI3vRAmOWgAnpSEcUehGPMYjBHeZIxzemQAItmCAZ 04SnNb/hARIgwBzxCAM4eBGFKeRABdlDnS0Y0j0L+BAKEtCCE5wRAgLgCgsj JWlJTXpSlI4UGCtlKTDIgYUNxIEWvSjXDinqwwF4MqHJsIAFnOAEBEwBARb4 hgUQYAISkMADTuhpMqaA0C4k1QQemAJTfeqBLthiAQuoQRJMMIWnkuAOXTBB O3taKKR6YKgZsIBTTaCFF0hAAy8gQVWb+k81vEANAs1AOpKhwwVkUkcWCAAK NhCAOjDlBMDsghOi8AE5tAH/B5OlbGUte1nMZhYHDrjEPcbgDguwZAEG8OVB TmCABWjAFquFTQ1W+wIAvcAWGtCFBlxrixfIVjK60MVWJWALNSQhCXF91QAG oILUrlYDEtCFXG+b29nK1Rbm1MJwNTDaARhABb/FLXSvqwIV6EKvatAqFG6K ujoEYAMCakS6jmsLLUzhG+boBT3GwAv8HkC/++Vvf/373wPg15m9cEcGEGCa BZi3OAJgMIOdIoATnGAAEW5whSEc4RMwOMLGNW5pAWBhC6/uwhrOrgFudF4Q V/jDAuAwjlDXlEYEwAFymwYJ3DsRNSh1qN/4RgJ9/GMgB1nIQS5qocpZ3vO+ WMlL3mZyk5385KaQYBoBWEIgeLKJprAYCql9QRK0ENWkhlnMYyZzmcncherm oAa6eJWHofxmOMdZzk15SSoC8Y8eMKQHS3EvFJDbXAkEWtCDJnShDW3o3qoA ChN285wd/WhIO2UBeQ5AD/5x6RgH4AlMePCFW/xpUIda1KHOcKMjfWpUx5kJ GwtAIy79aiuwIgDBGEUdopDkVOda17uW8wmiUIdRBANCVnh1sbnwKe8lW9nL Znaznf1saEdb2tOWNgu4UGxsB8IRDqiGsKn9bXCHW9zjJjdMglENBzjizsUO CAA7 tclxml-3.3~svn11.orig/examples/tclxslt/README0000644000000000000000000000065411113705304017601 0ustar rootrootexamples/tclxslt/README -- This directory contains example scripts to demonstrate the use of TclXSLT. --------------------------------------------------------------------------- See the file "LICENSE" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. --------------------------------------------------------------------------- tkxsltproc A GUI version of libxslt's xsltproc. tclxml-3.3~svn11.orig/examples/tclxslt/pwrdLogo150.gif.b640000644000000000000000000000646011113705304022026 0ustar rootrootR0lGODlhYQCWAPUAAP//////zP//mf//AP/MzP/Mmf/MAP+Zmf+ZZv+ZAMz/ /8zM/8zMzMyZzMyZmcyZZsyZAMxmZsxmM8xmAMwzM8wzAJnM/5nMzJmZzJmZ mZlmmZlmZplmM5kzM5kzAGaZzGZmzGZmmWZmZmYzZmYzMzNmzDNmmTMzmTMz ZgAzmQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH+BSAtZGwtACH5BAEKAAIALAAA AABhAJYAAAb+QIFwSCwaj8ikcslsOp/Oh1RClVSu2KxWAu16jY9IpGrVms9o 9OPLJqbf8Lic2/7K0ZN0IpG/p9dGCAgPZBSGZ05+WRADBmcTA5EDfYqVcomV jJNnkpGOlqBvmIqeZwaSBhOUoaxZo3eaq1eQkbKttxVOFIqnn1qnm7jCV7q8 AxBmscPDdEy7frVmkQnLzE5ld43JkdXDEdek1L/BlhKE3VffTdhy5LPalRIF APQABOhP7HHuFQnHlRHqCbxXLR8vaQMqHRAIYMECeg8KRjmYBZIvOfPoLfiQ ouMJBwEkNonoRxyWU7bSEKjHsaPLFBn0tXpC8o4sbncWNjTxsqf+hmU0Fa2y mJPehZ5IT3QYBoWVv5RmAgLAgBQpCaBPWJ2aQ69lVZcollFoGgoenJVUv7o8 Ua1Zk1CQTKZZeFSty6XL3DIJxQjZGwkN7bq8amkCnzOAXil6ehYAT8Fh3xg2 IPeKv1RaEr8FtfXNAwBe7cbxNw3hxQobPnxQDO20mQAMBHckDAeYa9JaRvRc UtZ1loWP7UYeXVoLLS0odispW1kLgLqCPdwh7VeL2SvJXZrgXZhfls/B1dIm 7r0CvxMvQXCvBAlqBQKxIZ+hYuo6lgmue65e3j0NYBCy4VUBBQ+sBEBIZpzS XD+2KKeETHFAkgYCAMgWGQUMMASATNH+mGGLBw4mASEc+KmUll0joJBdRyBc AJFx9r3RQYhIjFhbGgAAKNtXAQCAgBaMLIjGjNoxYeMbQgK241corHTAOO6Z QWRH+ykRAShQPbDAklV14KR1vqVBwktNXLnMASdy6VIFL95XnphkMmHmMATo qKZHFNDDjj+VrJhCmdUQEJ6aI0j1zBUDCJnGitsxUZMwAdz5UgcLEfSOJSuq t9kw8UmawnsAPInFHpag11FWy3R6Jwp5bphFmHDEuakwaapJwmcIzqLoG7Lu tUwGnqbgJQCP7sqrS6gOo0GwbAJwaAVRpjFlo7PisoFag76Ewmei3jJllb4O c21VJmQ72Er+w4x5arLCTPnSCaEhxQGx6SLLLi7udoQCCbX25ICluOi2Lmu3 WMWvWk0eWYnAJ5C1DFIdbNCvSxr8uEx2JTjMyqN+fppBvC850E124IbLygHd +hkWAyV8Nd4w9t4LykoWCzybB45VNVw1MRNciYEMpDhpBxVWhc4VPVc7cz0b veRBBAp0eXQFHVHrhIChrATdSxU4sGVPI2ShsCJEavoE1kuDHFYDW3e01AEE xL0MkV6gbclKdoJVAQNtr5Vht/gOLPPdOfd01VRqbQDAnLio6wUuwEHM5sQd OeDqMDM23AXkRffUwX9qoTt3ChlvfstCVXkAelUn2FPNjCUrbcn+Z6ZyHVDe L4UQ6ut/Pn7LZx1/Ct5XGtDLsx23AGazvl0XjlQGi3fTOxQY4KJ8T2FFXpXl Y1ditRMhCAPAuHpnaG4K3Hdj9hPh47Ih2Ht3jtRC+HjxEy4ERAD/SkzS380X 7btF/vYnv5eM4DP160IAW4EyP13lIS4DTAKhsEBWROAAy3tgAe/Cpu4p4gs7 Y4UECKCu2VQAgqnr4P+8EDZhkPAlGvxKBSS4wi60EH/uimFSKlCgCT7hhqeT AAxPuMEUhCV/PnQCEFsRgQcMEYVgG+HRvPCBlzGwdmGD4qQK4MFKaKYJJbDb yVaUxSLS52hfZIIJxBgKBNisjEgZATb+uniHNC5BWHkRgd4sAIDadUQ6MyQA HefQBTwuY1nM42N4UCABuOmpG3phgiG9UT7n4bGRj2xLIdkYCiF6pAIYsGQF OkACFIDgcnmBAkc4GQquhbJlVTnlFJ+wSuthY0XNw51LQJArkTSBJ6y8A2BI siIPFE+XHcEAwLDihI7Q6UAO8ErEQPOVBgCOmU1wpjB0kqZpUo4Aj8KmJD81 DADAcjBEmxgKnDXLZpJzm20bQZ76loIN9NKX4xSLJcPikO1dU5xKaEk1tPSu vUUNewEYpB+eAKAQ4qIAaWoeUjawTHwqgScOxZ80aactQU4tF+7MKP50RALA nDMFIvinRZP+wLyjRTMFcqSmS0T2UZBm04gfDQEIwiJTmNb0CggIaU1RwBYC QOen6WhCS0S6jLAV4GtLnJo6lqAjplZjIR0I5jKmqgRYWhUUEArIs34aySMM hhmfKcB8UInUshrhrMsAgFrPED2kXsGtRYBrOedqBgJYzK54JYJexebRSsgV DQfgq11vmgIrViAgCj3sGSJQ0ZoyQZpmkIdc/4qFCx4gnFeQbGYBYFcsMMFO YoSsGeCWjoqK1gxs/akaORiV2AKmDP7Lwmu1AM7S2pSltNWCan9zOQrIZLe/ Uaxs7xjcLAwXC/M4EnKxQMPFMvePk43tQrAxVjYp1zkKDcU4tVn+W30MEwv/ nC4W/FraJYQGDYAhwDVHSIgDsAOT8p1LZduJhLz5Z0RnLMd+k1iEk/p2vaW1 4xD8eOArqBSNSuhJg2eY4AhzbcKlDayEMZdVEpAgqyDW6tE0fGE5gNjDKSJq sLCnohaP4MUv9rCMPxxiTuI1NMPxwIlLqSI/rvjHXILCSY0I5CIbWXCzPbKS jwyFJTu5yE1+spQ9FeUpW3lH37vulbf8lSxbGCkluMAFdFkCBjStJxhoGQZ4 kuaeiLlWLbrAkE3w5p6E+QIgK5ITkJmCDyjgAwU0wVROWSsMUGUqrfOxOQf1 gQWEsieCLgGjN9JTOz9hyC7x8yn1E5/VRtvZnA0BwddeMpV4NdrTLxE0BnDn aVQjJXZJOB+gGRAvDHT6oKSmNQBojRTQsJoegxL0B4bc6lHr5wlqcfVLSgCa EiigXy4yQYZ8nALHTNrRkF60fhbgbMrBGglqAYGqXgLo58RyS6KuigIUMO4P XMAECggPvNmtn3VTrs/I5rK+q1Llfft7epf9t8ChAIKCG/zgBi+XwhfOcIUL 3C51iHgRPgACTO9b4hhPAsXPt+SMe1ypIOA4lT9OclVKOlglT3kbKi5yJKv8 5V+g+JBhTvOaGyEIADs= tclxml-3.3~svn11.orig/examples/README0000644000000000000000000000107411113705304016101 0ustar rootrootexamples/README -- These directories contain various example scripts to demonstrate the use of TclXML, TclDOM and TclXSLT. --------------------------------------------------------------------------- See the file "LICENSE" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. --------------------------------------------------------------------------- tclxml Examples of streaming parsing using TclXML. tcldom Examples of tree-based scripting using TclDOM. tclxslt Examples of invoking XSL stylesheets using TclXSLT. tclxml-3.3~svn11.orig/pkgIndex.tcl.in0000644000000000000000000001262611215700771016300 0ustar rootroot# TclXML combo package index file - handcrafted # # $Id: pkgIndex.tcl.in,v 1.13 2003/12/03 20:06:34 balls Exp $ namespace eval ::xml { variable _init 0 } namespace eval ::xml::libxml2 { variable _init 0 } namespace eval ::dom { variable _init 0 } namespace eval ::dom::libxml2 { variable _init 0 } namespace eval ::xslt { variable _init 0 } # From http://wiki.tcl.tk/9427 proc ::xml::_platform {} { global tcl_platform set plat [lindex $tcl_platform(os) 0] set mach $tcl_platform(machine) switch -glob -- $mach { sun4* { set mach sparc } intel - i*86* { set mach x86 } {Power Macintosh} { set mach ppc } } return "$plat-$mach" } proc ::xml::_loadlib {dir package version} { global tcl_platform set lib $package[info sharedlibextension] return [file join $dir [_platform] $lib] } namespace eval ::xml { variable pkginit if {![info exists pkginit]} { set pkginit 0 } # Try to locate the binary library: # 1) Using TEA conventions # 2) Using StarKit conventions # 3) Using platform-specific conventions proc pkgload {dir {binary 0} {cmd {}}} { variable pkginit if {$pkginit} {return {}} namespace eval :: [format { package require xmldefs @PACKAGE_VERSION@ package require xml::tcl @PACKAGE_VERSION@ # TEA style if {[catch {load [file join [list %s] @PKG_LIB_FILE@] Tclxml}]} { # StarKit style if {[catch {load [::xml::_loadlib [list %s] Tclxml @PACKAGE_VERSION@]}]} { # Mac OS X frameworks are different if {[catch {load [file join [list %s] .. .. Tclxml] Tclxml}]} { # Unable to load binary implmentation, # just use pure-Tcl implmentation instead if {$binary} { return -code error "unable to load shared library" } } else { set ::xml::libxml2::_init 1 set ::dom::libxml2::_init 1 set ::xslt::_init 1 source [file join [list %s] tcldom-libxml2.tcl] source [file join [list %s] tclxslt-libxslt.tcl] } } else { set ::xml::libxml2::_init 1 set ::dom::libxml2::_init 1 set ::xslt::_init 1 source [file join [list %s] tcldom-libxml2.tcl] source [file join [list %s] tclxslt-libxslt.tcl] } } else { set ::xml::libxml2::_init 1 set ::dom::libxml2::_init 1 set ::xslt::_init 1 source [file join [list %s] tcldom-libxml2.tcl] source [file join [list %s] tclxslt-libxslt.tcl] } package require xml::tclparser @PACKAGE_VERSION@ package provide tclparser @PACKAGE_VERSION@ package provide xml::libxml2 @PACKAGE_VERSION@ package provide xml @PACKAGE_VERSION@ package provide dom @PACKAGE_VERSION@ package provide dom::libxml2 @PACKAGE_VERSION@ package provide xslt @PACKAGE_VERSION@ package provide xslt::libxslt @PACKAGE_VERSION@ set pkginit 1 } $dir $dir $dir $dir $dir $dir $dir $dir $dir $dir] eval $cmd } } package ifneeded xml::tcl @PACKAGE_VERSION@ [list source [file join $dir xml__tcl.tcl]] package ifneeded sgmlparser 1.1 [list source [file join $dir sgmlparser.tcl]] package ifneeded xpath 1.0 [list source [file join $dir xpath.tcl]] package ifneeded xmldep 1.0 [list source [file join $dir xmldep.tcl]] # Requesting a specific package means we want it to be the default parser class. package ifneeded xml::libxml2 @PACKAGE_VERSION@ [list ::xml::pkgload $dir 1 {::xml::parser default libxml2}] # tclparser works with either xml::c or xml::tcl package ifneeded tclparser @PACKAGE_VERSION@ [list ::xml::pkgload $dir 0 { ::xml::parser default tclparser package provide tclparser @PACKAGE_VERSION@ }] # use tcl only (mainly for testing) package ifneeded puretclparser @PACKAGE_VERSION@ " package require xml::tcl @PACKAGE_VERSION@ package require xmldefs package require xml::tclparser @PACKAGE_VERSION@ package provide puretclparser @PACKAGE_VERSION@ " # Requesting the generic package leaves the choice of default parser automatic package ifneeded xml @PACKAGE_VERSION@ [list ::xml::pkgload $dir 0] package ifneeded dom @PACKAGE_VERSION@ [list ::xml::pkgload $dir 0] package ifneeded dom::libxml2 @PACKAGE_VERSION@ [list ::xml::pkgload $dir 1] package ifneeded xslt @PACKAGE_VERSION@ [list ::xml::pkgload $dir 1] package ifneeded xslt::libxslt @PACKAGE_VERSION@ [list ::xml::pkgload $dir 1] package ifneeded xmlswitch @PACKAGE_VERSION@ [list source [file join $dir xmlswitch.tcl]] package ifneeded xslt::cache @PACKAGE_VERSION@ [list source [file join $dir xsltcache.tcl]] package ifneeded xslt::utilities 1.2 [list source [file join $dir utilities.tcl]] package ifneeded xslt::process 1.1 [list source [file join $dir process.tcl]] package ifneeded xslt::resources 1.3 [list source [file join $dir resources.tcl]] if {[info tclversion] <= 8.0} { package ifneeded sgml 1.9 [list source [file join $dir sgml-8.0.tcl]] package ifneeded xmldefs @PACKAGE_VERSION@ [list source [file join $dir xml-8.0.tcl]] package ifneeded xml::tclparser @PACKAGE_VERSION@ [list source [file join $dir tclparser-8.0.tcl]] } else { package ifneeded sgml 1.9 [list source [file join $dir sgml-8.1.tcl]] package ifneeded xmldefs @PACKAGE_VERSION@ [list source [file join $dir xml-8.1.tcl]] package ifneeded xml::tclparser @PACKAGE_VERSION@ [list source [file join $dir tclparser-8.1.tcl]] } tclxml-3.3~svn11.orig/tcldom.c0000644000000000000000000002133711215700771015043 0ustar rootroot/* * tcldom.c -- * * Generic interface to DOM Implementation. * As of v3.0, there is no substantial generic layer; * instead each implementation provides its own commands * directly. This module now provides common definitions * for method/option tables, etc. * * Copyright (c) 2006-2009 Explain * http://www.explain.com.au/ * Copyright (c) 2002-2004 Steve Ball, Zveno Pty Ltd * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * $Id: tcldom.c,v 1.25 2004/02/25 20:10:27 balls Exp $ * */ #include /* * Method tables for commands */ #ifndef CONST84 #define CONST84 /* Before 8.4 no 'const' required */ #endif CONST84 char *TclDOM_DOMImplementationCommandMethods[] = { "hasFeature", "createDocument", "create", "createDocumentType", "createNode", "destroy", "isNode", "parse", "selectNode", "serialize", "trim", (char *) NULL }; CONST84 char *TclDOM_DocumentCommandMethods[] = { "cget", "configure", "createElement", "createDocumentFragment", "createTextNode", "createComment", "createCDATASection", "createProcessingInstruction", "createAttribute", "createEntity", "createEntityReference", "createDocTypeDecl", "importNode", "createElementNS", "createAttributeNS", "getElementsByTagNameNS", "getElementsById", "createEvent", "getElementsByTagName", "dtd", "schema", "relaxng", (char *) NULL }; CONST84 char *TclDOM_DocumentCommandOptions[] = { "-doctype", "-implementation", "-documentElement", "-keep", "-baseuri", (char *) NULL }; CONST84 char *TclDOM_DocumentDTDSubmethods[] = { "validate", (char *) NULL }; CONST84 char *TclDOM_DocumentSchemaSubmethods[] = { "compile", "validate", (char *) NULL }; CONST84 char *TclDOM_DocumentRelaxNGSubmethods[] = { "compile", "validate", (char *) NULL }; CONST84 char *TclDOM_NodeCommandMethods[] = { "cget", "configure", "insertBefore", "replaceChild", "removeChild", "appendChild", "hasChildNodes", "cloneNode", "children", "parent", "path", "createNode", "selectNode", "stringValue", "addEventListener", "removeEventListener", "dispatchEvent", "isSameNode", (char *) NULL }; CONST84 char *TclDOM_NodeCommandOptions[] = { "-nodeType", "-parentNode", "-childNodes", "-firstChild", "-lastChild", "-previousSibling", "-nextSibling", "-attributes", "-namespaceURI", "-prefix", "-localName", "-nodeValue", "-cdatasection", "-nodeName", "-ownerDocument", "-id", (char *) NULL }; CONST84 char *TclDOM_NodeCommandAddEventListenerOptions[] = { "-usecapture", (char *) NULL }; CONST84 char *TclDOM_ElementCommandMethods[] = { "cget", "configure", "getAttribute", "setAttribute", "removeAttribute", "getAttributeNS", "setAttributeNS", "removeAttributeNS", "getAttributeNode", "setAttributeNode", "removeAttributeNode", "getAttributeNodeNS", "setAttributeNodeNS", "removeAttributeNodeNS", "getElementsByTagName", "normalize", (char *) NULL }; CONST84 char *TclDOM_ElementCommandOptions[] = { "-tagName", "-empty", (char *) NULL }; CONST84 char *TclDOM_EventCommandMethods[] = { "cget", "configure", "stopPropagation", "preventDefault", "initEvent", "initUIEvent", "initMouseEvent", "initMutationEvent", "postUIEvent", "postMouseEvent", "postMutationEvent", (char *) NULL }; CONST84 char *TclDOM_EventCommandOptions[] = { "-altKey", "-attrName", "-attrChange", "-bubbles", "-button", "-cancelable", "-clientX", "-clientY", "-ctrlKey", "-currentNode", "-detail", "-eventPhase", "-metaKey", "-newValue", "-prevValue", "-relatedNode", "-screenX", "-screenY", "-shiftKey", "-target", "-timeStamp", "-type", "-view", (char *) NULL }; CONST84 char *TclDOM_EventTypes[] = { "DOMFocusIn", "DOMFocusOut", "DOMActivate", "click", "mousedown", "mouseup", "mouseover", "mousemove", "mouseout", "DOMSubtreeModified", "DOMNodeInserted", "DOMNodeRemoved", "DOMNodeInsertedIntoDocument", "DOMNodeRemovedFromDocument", "DOMAttrModified", "DOMCharacterDataModified" }; CONST84 char *TclDOM_ParseCommandOptions[] = { "-baseuri", "-externalentitycommand", (char *) NULL }; CONST84 char *TclDOM_SerializeCommandOptions[] = { "-indent", "-method", "-encoding", "-omitxmldeclaration", (char *) NULL }; CONST84 char *TclDOM_SerializeMethods[] = { "xml", "html", "text", (char *) NULL }; CONST84 char *TclDOM_SelectNodeOptions[] = { "-namespaces", (char *) NULL }; #if 0 /* *---------------------------------------------------------------------------- * * Tcldom_Init -- * * Initialisation routine for generic module. * NB. As of TclDOM v3.0 this module no longer gets loaded as * a separate package. * * Results: * None. * * Side effects: * Creates variables. * *---------------------------------------------------------------------------- */ int Tcldom_Init (interp) Tcl_Interp *interp; /* Interpreter to initialise. */ { Tcl_Obj *objPtr; Tcl_SetVar(interp, "::dom::strictDOM", "0", TCL_GLOBAL_ONLY); Tcl_SetVar(interp, "::dom::maxSpecials", "10", TCL_GLOBAL_ONLY); objPtr = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(interp, objPtr, Tcl_NewIntObj(2)); Tcl_ListObjAppendElement(interp, objPtr, Tcl_NewStringObj(" ", -1)); Tcl_ListObjAppendElement(interp, objPtr, Tcl_NewStringObj("\t", -1)); Tcl_SetVar2Ex(interp, "::dom::indentspec", NULL, objPtr, TCL_GLOBAL_ONLY); Tcl_SetVar(interp, "::dom::xmlnsURI", "http://www.w3.org/2000/xmlns/", TCL_GLOBAL_ONLY); return TCL_OK; } #endif /* 0 */ /* *---------------------------------------------------------------------------- * * TclDOM_SetVars -- * * Initialisation routine for TclDOM modules. * * Results: * None. * * Side effects: * Creates variables. * *---------------------------------------------------------------------------- */ int TclDOM_SetVars(interp) Tcl_Interp *interp; { Tcl_SetVar2Ex(interp, "::dom::bubbles", "DOMFocusIn", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "DOMFocusOut", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "DOMActivate", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "click", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "mousedown", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "mouseup", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "mouseover", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "mousemove", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "mouseout", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "DOMSubtreeModified", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "DOMNodeInserted", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "DOMRemoved", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "DOMNodeInsertedIntoDocument", Tcl_NewIntObj(0), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "DOMRemovedFromDocument", Tcl_NewIntObj(0), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "DOMAttrModified", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "DOMAttrRemoved", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::bubbles", "DOMCharacterDataModified", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "DOMFocusIn", Tcl_NewIntObj(0), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "DOMFocusOut", Tcl_NewIntObj(0), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "DOMActivate", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "click", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "mousedown", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "mouseup", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "mouseover", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "mousemove", Tcl_NewIntObj(0), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "mouseout", Tcl_NewIntObj(1), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "DOMSubtreeModified", Tcl_NewIntObj(0), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "DOMNodeInserted", Tcl_NewIntObj(0), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "DOMRemoved", Tcl_NewIntObj(0), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "DOMNodeInsertedIntoDocument", Tcl_NewIntObj(0), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "DOMRemovedFromDocument", Tcl_NewIntObj(0), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "DOMAttrModified", Tcl_NewIntObj(0), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "DOMAttrRemoved", Tcl_NewIntObj(0), 0); Tcl_SetVar2Ex(interp, "::dom::cancelable", "DOMCharacterDataModified", Tcl_NewIntObj(0), 0); return TCL_OK; } tclxml-3.3~svn11.orig/tests/0000755000000000000000000000000011574742514014562 5ustar rootroottclxml-3.3~svn11.orig/tests/tclxml/0000755000000000000000000000000011574742514016065 5ustar rootroottclxml-3.3~svn11.orig/tests/tclxml/decls.test0000644000000000000000000002306111113705304020043 0ustar rootroot# Features covered: Declarations # # This file contains a collection of tests for the TclXML parser. # This file tests the parser's performance on markup declarations. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 2000-2004 Zveno Pty Ltd. # # $Id: decls.test,v 1.15 2004/02/20 09:15:52 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage $::tcltest::parser namespace eval ::xml::declsTest { namespace import -force ::tcltest::* variable SETUP { catch {unset elements} variable elements array set elements {} catch {unset attrs} variable attrs array set attrs {} catch {unset entities} variable entities array set entities {} catch {unset externals} variable externals array set externals {} catch {unset cdata} variable cdata {} proc elementDecl {name cmodel} { variable elements set elements($name) $cmodel } proc attlistDecl {name attName type default dfltValue} { variable attrs lappend attrs($name/$attName) $type $default $dfltValue } proc entityDecl {name args} { variable entities switch [llength $args] { 1 { set entities($name) [lindex $args 0] } 2 { set externals($name) $args } default { error "wrong number of arguments" } } } proc CData data { variable cdata append cdata [string trim $data] } set parser [xml::parser \ -elementdeclcommand [namespace code elementDecl] \ -attlistdeclcommand [namespace code attlistDecl] \ -entitydeclcommand [namespace code entityDecl]] } variable CLEANUP { catch {unset elements} catch {unset attrs} catch {unset entities} catch {unset externals} catch {unset cdata} rename elementDecl {} rename attlistDecl {} rename entityDecl {} rename CData {} $parser free } # Internal DTD subset test decls-1.1 {element declaration} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { ]> } array get elements } -cleanup $CLEANUP -result {Test (#PCDATA)} test decls-2.1 {attribute list declaration, implied} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { ]> } array get attrs } -cleanup $CLEANUP -result {Test/test {CDATA #IMPLIED {}}} test decls-2.2 {attribute list declaration, enum} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { ]> } array get attrs } -cleanup $CLEANUP -result {Test/test {LGL|OTH {} LGL}} # Disable this test for the moment test decls-2.3 {attribute list declaration, error} -setup $SETUP -match regexp -constraints {disabled} -body { expectError { $parser parse { ]> }} } -cleanup $CLEANUP -result {(unexpected text)|(.*space-required.*)} # Bug #714316 test decls-2.4 {attribute list declaration - multiple attribute definitions} -setup $SETUP -body { $parser parse { ]> } ok } -cleanup $CLEANUP -result {} test decls-3.1 {entity declarations} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { ]> } array get entities } -cleanup $CLEANUP -result {testEnt {replacement text}} test decls-4.1 {parameter entity declarations} -setup $SETUP -constraints {!xml_libxml2 && !xml_tcl} -body { expectError { $parser parse { %PEnt; ]> } } #list [array get entities] [array get elements] } -cleanup $CLEANUP -result {{PEnt {}} {Test (#PCDATA)}} # Example from XML Rec. section 4.5 test decls-4.2 {parameter entity declarations} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { ]> &book;} array get entities book } -cleanup $CLEANUP -result [list book [format {La Peste: Albert Camus, %c 1947 %cditions Gallimard. &rights;} 169 201]] # First example from XML Rec. appendix D # This test requires a validating parser test decls-4.3 {parameter entity declarations} -setup $SETUP -constraints {validating} -body { $parser configure -validate 1 $parser parse { An ampersand (&#38;) may be escaped numerically (&#38;#38;) or with a general entity (&amp;).

" > ]> &Example;} set cdata } -cleanup $CLEANUP -result {An ampersand (&) may be escaped numerically (&) or with a general entity (&).} # NB. entity.test tests entity replacement as well # External entities test decls-5.1 {external entity} -setup $SETUP -constraints {validating} -body { $parser configure \ -validate 1 \ -baseuri file://[file join [pwd] decls.test]] $parser parse { } array get elements } -cleanup $CLEANUP -result {Test (#PCDATA)} test decls-5.2 {external DTD subset} -setup $SETUP -constraints {validating} -body { $parser configure \ -validate 1 \ -parameterentitydeclcommand entityDecl \ -baseuri file://[file join [pwd] decls.test]] $parser parse { } list [array get elements] [array get entities] } -cleanup $CLEANUP -result {{Test (#PCDATA)} {content (#PCDATA)}} test decls-5.3 {external entity} -setup $SETUP -constraints {validating} -body { $parser configure \ -validate 1 \ -parameterentitydeclcommand entityDecl \ -baseuri file://[file join [pwd] decls.test]] $parser parse { %module; ]> } list [array get elements] [array get entities] [array get externals] } -cleanup $CLEANUP -result {{Test (#PCDATA)} {content (#PCDATA)} {module {dtd-5.2.dtd {}}}} # Bug #676399 test decls-5.4 {external entity w/- baseuri} -constraints {validating && !xml_tcl} -setup { set parser [::xml::parser -validate 1 -baseuri file://[file join [workingDirectory] decls.test]] } -constraints {xml_tcl} -body { $parser parse { } } -cleanup { $parser free } -result {} # Conditional Sections test decls-6.1 {conditional section: include} -setup $SETUP -constraints {validating} -body { $parser configure \ -validate 1 \ -baseuri file://[file join [pwd] decls.test]] $parser parse { } array get elements } -cleanup $CLEANUP -result {Test (#PCDATA)} test decls-6.2 {conditional section: include, empty} -setup $SETUP -constraints {validating} -body { $parser configure \ -validate 1 \ -baseuri file://[file join [pwd] decls.test]] $parser parse { } array get elements } -cleanup $CLEANUP -result {} test decls-6.3 {conditional section: include, empty} -setup $SETUP -constraints {validating} -body { $parser configure \ -validate 1 \ -baseuri file://[file join [pwd] decls.test]] $parser parse { } array get elements } -cleanup $CLEANUP -result {} test decls-6.4 {conditional section: include, nested} -setup $SETUP -constraints {validating} -body { $parser configure \ -validate 1 \ -baseuri file://[file join [pwd] decls.test]] $parser parse { } array size elements } -cleanup $CLEANUP -result 3 test decls-6.5 {conditional section: ignore} -setup $SETUP -constraints {validating} -body { $parser configure \ -validate 1 \ -baseuri file://[file join [pwd] decls.test]] $parser parse { } array size elements } -cleanup $CLEANUP -result 0 test decls-6.6 {conditional section/PE combo} -setup $SETUP -constraints {validating} -body { $parser configure \ -validate 1 \ -baseuri file://[file join [pwd] decls.test]] $parser parse { } array size elements } -cleanup $CLEANUP -result 2 test decls-7.1 {comment in DTD} -setup $SETUP -constraints !xml_libxml2 -body { $parser parse { ]> } array get elements } -cleanup $CLEANUP -result {Test (#PCDATA)} test decls-7.2 {complex comment in DTD} -setup $SETUP -constraints !xml_libxml2 -body { $parser parse { --> ]> } array get elements } -cleanup $CLEANUP -result {Test (#PCDATA)} cleanupTests } namespace delete ::xml::declsTest return tclxml-3.3~svn11.orig/tests/tclxml/tclxmlutils.tcl0000644000000000000000000000142711113705304021142 0ustar rootroot# tclxmlutils.tcl -- # # This script prepares the testing environment for TclXML. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 2003 Zveno Pty Ltd. # # $Id: tclxmlutils.tcl,v 1.2 2003/12/03 20:06:37 balls Exp $ package require tcltest tcltest::Option -parser xml { Selects the XML parser class. } AcceptAll parser source [file join [tcltest::workingDirectory] .. testutils.tcl] eval tcltest::configure $argv switch -- $tcltest::parser { xml { package require xml switch [xml::parserclass info default] { libxml2 { tcltest::testConstraint xml_libxml2 1 } tcl { tcltest::testConstraint xml_tcl 1 } } } libxml2 { tcltest::testConstraint xml_libxml2 1 } tclparser { tcltest::testConstraint xml_tcl 1 } } tclxml-3.3~svn11.orig/tests/tclxml/namespace.test0000644000000000000000000000647711115212012020710 0ustar rootroot# Features covered: XML Namespaces # # This file contains a collection of tests for the TclXML parser. # This file tests the parser's performance on XML namespaces. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 2000-2004 Zveno Pty Ltd. # # $Id: namespace.test,v 1.4 2004/02/20 09:15:52 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage $::tcltest::parser namespace eval ::xml::namespaceTest { namespace import -force ::tcltest::* variable SETUP { variable result {} variable nsdecls {} proc keysort args { array set keyvalue $args set result {} foreach key [lsort [array names keyvalue]] { lappend result $key $keyvalue($key) } return $result } proc EStart {tag attlist args} { variable result variable nsdecls array set extra $args catch {eval lappend nsdecls $extra(-namespacedecls)} if {[info exists extra(-namespace)]} { lappend result $extra(-namespace)^$tag } else { lappend result $tag } } set parser [xml::parser \ -elementstartcommand [namespace code EStart]] } variable CLEANUP { catch {unset result} catch {unset nsdecls} rename keysort {} rename EStart {} $parser free } test ns-1.1 {Namespace declaration} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { } list $result $nsdecls } -cleanup $CLEANUP -result {Test {http://tclxml.sf.net/Schemas test}} test ns-1.2 {Multiple namespace declarations} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { } list $result [eval keysort $nsdecls] } -cleanup $CLEANUP -result {Test {http://tclxml.sf.net/Schemas test urn:schema x}} test ns-1.3 {Default namespace declaration} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { } list $result [eval keysort $nsdecls] } -cleanup $CLEANUP -result {http://tclxml.sf.net/Schemas^Test {http://tclxml.sf.net/Schemas {} urn:schema x}} test ns-1.4 {Default namespace declaration w/- separate usage} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { } list $result [eval keysort $nsdecls] } -cleanup $CLEANUP -result {{urn:schema^Test http://tclxml.sf.net/Schemas^Test} {http://tclxml.sf.net/Schemas {} urn:schema x}} test ns-2.0 {Multiple namespace declarations, same prefix} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { } list $result [eval keysort $nsdecls] } -cleanup $CLEANUP -result {{Test http://tclxml.sf.net/Schemas^Test http://tclxml.sf.net/Schemas^y urn:schema^Test urn:schema^z} {http://tclxml.sf.net/Schemas x urn:schema x}} cleanupTests } namespace delete ::xml::namespaceTest return tclxml-3.3~svn11.orig/tests/tclxml/cdata.test0000755000000000000000000001530011113705304020025 0ustar rootroot# Features covered: CDATA sections # # This file contains a collection of tests for the TclXML parser. # This file tests the parser's performance on CDATA sections. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 1998-2003 Zveno Pty Ltd. # # $Id: cdata.test,v 1.8 2003/12/03 20:06:36 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage $::tcltest::parser namespace eval ::xml::cdataTest { namespace import -force ::tcltest::* variable SETUP { variable element 0 variable result {} proc pcdata data { variable result append result $data } proc EStart {tagName attrList args} { variable element switch -- $tagName { Test { } default { incr element } } } proc EStop {tagName args} { } set parser [xml::parser \ -elementstartcommand [namespace code EStart] \ -elementendcommand [namespace code EStop] \ -characterdatacommand [namespace code pcdata]] } variable CLEANUP { catch {unset result} catch {unset element} rename EStart {} rename pcdata {} rename EStop {} $parser free } test cdata-1.1 {Simple CDATA section} -setup $SETUP -body { $parser parse { } list $result $element } -cleanup $CLEANUP -result {{This is CDATA} 0} test cdata-1.2 {CDATA test contributed by Richard Emberson (emberson@netintouch.com)} -setup $SETUP -body { $parser parse { } list $result $element } -cleanup $CLEANUP -result {{ 928806871035 } 1} # Test bug: ']]>' is not valid character data (XML Rec. subsect. 2.4) - # this should produce a warning. test cdata-2.0 {CDATA section interpersed with comment} -setup $SETUP -body { $parser parse { ]]> -->]]>} list $result $element } -cleanup $CLEANUP -result {{ ]]>} 0} test cdata-2.1 {CDATA section with an angle bracket} -setup $SETUP -body { $parser parse { greater than sign]]> } list $result $element } -cleanup $CLEANUP -result {{This is a > greater than sign} 0} # Test case contributed by Marshall Rose (mrose@dbc.mtview.ca.us) test cdata-2.2 {CDATA section with multiple angle brackets} -setup $SETUP -body { $parser parse { ... ]]> } list $result $element } -cleanup $CLEANUP -result {{ ... } 1} # Test case contributed by J. Linnenkohl (jlinnen@c-s-k.de) test cdata-2.3 {CDATA section with square brackets and curly braces} -setup $SETUP -body { $parser parse { } list $result $element } -cleanup $CLEANUP -result {{ proc arithmetic_add {groups inputs outputs atts} { set ret_val "" set t "Hello World" set l [string length $t] return $ret_val } } 1} test cdata-2.4 {CDATA section with angle brackets and curly braces} -setup $SETUP -body { $parser parse { 2] set t "Hello World" set l [string length $t] return $ret_val } ]]> } list $result $element } -cleanup $CLEANUP -result {{ proc arithmetic_add {groups inputs outputs atts} { set ret_val [expr 1 > 2] set t "Hello World" set l [string length $t] return $ret_val } } 1} test cdata-2.5 {CDATA section with angle brackets, Tcl specials trailing CDATA section} -setup $SETUP -body { $parser parse { 2] set t "Hello World" set l [string length $t] return $ret_val } ]]> that is {jolly} $good } list $result $element } -cleanup $CLEANUP -result {{ proc arithmetic_add {groups inputs outputs atts} { set ret_val [expr 1 > 2] set t "Hello World" set l [string length $t] return $ret_val } that is {jolly} $good } 1} # Test case contributed by Marshall Rose (mrose@dbc.mtview.ca.us) # SRB 2001-02-11: Test had to modified (slightly) to due non-well-formedness test cdata-3.1 {CDATA section with PI and Tcl special characters} -setup $SETUP -body { $parser parse { this is a \ test ]]> } list $result $element } -cleanup $CLEANUP -result {{ this is a \ test } 2} # Test case from bug #130127 reported by rnurmi@users.sourceforge.net test cdata-3.2 {CDATA with Tcl special character} -setup $SETUP -body { $parser parse [format { } \\] set result } -cleanup $CLEANUP -result [format %s \\] # Test case from bug #130127 reported by rnurmi@users.sourceforge.net test cdata-3.3 {CDATA with Tcl regular expression} -setup $SETUP -body { $parser parse [format {([^<]*)[^%sn]*>([^<]*)[^%sn]*>([-+][0-9]*%s.[0-9][0-9]|-)[^%sn]*>([0-9]*%s.[0-9][0-9])[^%sn]*>([0-9]*%s.[0-9][0-9])[^%sn]*>([0-9]*%s.[0-9][0-9])[^%sn]*>([0-9]*%s.[0-9][0-9])[^%sn]*>([0-9]*%s.[0-9][0-9])[^%sn]*>([0-9]+)[^%sn]*%s>([0-9]*)%s.[0-9][0-9])]]>} \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\] set result } -cleanup $CLEANUP -result [format {NOWRAP ALIGN=LEFT>([^<]*)[^%sn]*>([^<]*)[^%sn]*>([-+][0-9]*%s.[0-9][0-9]|-)[^%sn]*>([0-9]*%s.[0-9][0-9])[^%sn]*>([0-9]*%s.[0-9][0-9])[^%sn]*>([0-9]*%s.[0-9][0-9])[^%sn]*>([0-9]*%s.[0-9][0-9])[^%sn]*>([0-9]*%s.[0-9][0-9])[^%sn]*>([0-9]+)[^%sn]*%s>([0-9]*)%s.[0-9][0-9])} \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\] test cdata-4.1 {CDATA section with entity reference} -setup $SETUP -body { $parser parse { } list $result $element } -cleanup $CLEANUP -result {{no entity <references>} 0} cleanupTests } namespace delete ::xml::cdataTest return tclxml-3.3~svn11.orig/tests/tclxml/element.test0000755000000000000000000000656311113705304020415 0ustar rootroot# Features covered: Elements # # This file contains a collection of tests for the TclXML parser. # This file tests the parser's performance on elements. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 2005 Explain # http://www.explain.com.au/ # Copyright (c) 1999-2003 Zveno Pty Ltd. # # $Id: element.test,v 1.6 2005/05/20 12:02:18 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage $::tcltest::parser namespace eval ::xml::elementTest { namespace import -force ::tcltest::* variable SETUP { variable started array set started {} variable ended array set ended {} variable elList {} proc parray arrayName { upvar #0 $arrayName arr set result {} foreach key [lsort [array names $arrayName]] { lappend result $key $arr($key) } return $result } proc Start {name atList args} { variable started array set opts $args if {![info exists started($name)]} { set started($name) 1 } else { incr started($name) } } proc End {name args} { variable ended array set opts $args if {![info exists ended($name)]} { set ended($name) 1 } else { incr ended($name) } } proc ElStart {name atList args} { variable elList array set opts {-empty 0} array set opts $args lappend elList start $name $opts(-empty) } proc ElEnd {name args} { variable elList array set opts {-empty 0} array set opts $args lappend elList end $name $opts(-empty) } set parser [xml::parser] } variable CLEANUP { catch {unset started} catch {unset ended} catch {unset elList} rename parray {} rename Start {} rename End {} rename ElStart {} rename ElEnd {} $parser free } test element-1.1 {document element} -setup $SETUP -body { $parser configure \ -elementstartcommand [namespace code Start] \ -elementendcommand [namespace code End] $parser parse {} list [array get started] [array get ended] } -cleanup $CLEANUP -result {{Test 1} {Test 1}} test element-1.2 {distinct elements} -setup $SETUP -body { $parser configure \ -elementstartcommand [namespace code Start] \ -elementendcommand [namespace code End] $parser parse {} list [parray [namespace current]::started] [parray [namespace current]::ended] } -cleanup $CLEANUP -result {{Child1 1 Child2 1 Test 1} {Child1 1 Child2 1 Test 1}} # Test case for bug #1029795 reported by zugilio@users.sf.net test element-1.3 {distinct empty elements} -setup $SETUP -body { $parser configure \ -elementstartcommand [namespace code Start] \ -elementendcommand [namespace code End] $parser parse {} list [parray [namespace current]::started] [parray [namespace current]::ended] } -cleanup $CLEANUP -result {{Child1 1 Child2 1 Test 1} {Child1 1 Child2 1 Test 1}} test element-2.1 {empty element} -setup $SETUP -constraints !xml_libxml2 -body { $parser configure \ -reportempty 1 \ -elementstartcommand [namespace code ElStart] \ -elementendcommand [namespace code ElEnd] $parser parse {} set elList } -cleanup $CLEANUP -result {start Test 0 start Child1 1 end Child1 1 end Test 0} cleanupTests } namespace delete ::xml::elementTest return tclxml-3.3~svn11.orig/tests/tclxml/license.terms0000755000000000000000000000434011113705304020550 0ustar rootrootThis software is copyrighted by the Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, and other parties. The following terms apply to all files associated with the software unless explicitly disclaimed in individual files. The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first page of each file where they apply. IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. GOVERNMENT USE: If you are acquiring this software on behalf of the U.S. government, the Government shall have only "Restricted Rights" in the software and related documentation as defined in the Federal Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you are acquiring the software on behalf of the Department of Defense, the software shall be classified as "Commercial Computer Software" and the Government shall have only "Restricted Rights" as defined in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license. tclxml-3.3~svn11.orig/tests/tclxml/attribute.test0000755000000000000000000002276311113705304020767 0ustar rootroot# Features covered: Attribute Lists # # This file contains a collection of tests for the TclXML parser. # This file tests the parser's performance on Attribute Lists. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 1998-2004 Zveno Pty Ltd. # # $Id: attribute.test,v 1.12 2004/02/20 09:15:52 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage $::tcltest::parser namespace eval ::xml::attributeTest { namespace import -force ::tcltest::* variable SETUP { variable countAttributesOnly 1 variable result catch {unset result} array set result {} proc EStart {tagName attrList args} { variable result variable countAttributesOnly if {![llength $attrList] && !$countAttributesOnly} { if {[info exists result($tagName)]} { set count 0 while {[info exists result($tagName/[incr count])]} {} set result($tagName/$count) {} } else { set result($tagName) {} } return {} } foreach {name value} $attrList { if {[info exists result($tagName,$name)]} { set count 0 while {[info exists result($tagName,$name,[incr count])]} {} set result($tagName,$name,$count) $value } else { set result($tagName,$name) $value } } } proc pcdata t { variable pcdata append pcdata $t } proc EntRef args { variable entrefs if {[catch {incr entrefs}]} { set entrefs 1 } } set parser [::xml::parser -elementstartcommand [namespace code EStart]] } variable SETUP2 { eval $SETUP $parser configure -characterdatacommand [namespace code pcdata] } variable SETUP3 { eval $SETUP $parser configure -entityreferencecommand [namespace code EntRef] variable entrefs 0 } variable CLEANUP { $parser free catch {unset result} catch {unset pcdata} catch {unset entrefs} rename EStart {} rename pcdata {} rename EntRef {} } test attrList-1.1 {empty attribute list} -setup $SETUP -body { $parser parse { } array size result } -cleanup $CLEANUP -result 0 test attrList-1.2 {single attribute} -setup $SETUP -body { $parser parse { } array get result } -cleanup $CLEANUP -result {Test,attr 1} test attrList-1.3 {multiple distinct attributes} -setup $SETUP -body { $parser parse { } list [array size result] $result(Test,first) $result(Test,second) } -cleanup $CLEANUP -result {2 1 2} test attrList-1.4 {hyphen in attribute name} -setup $SETUP -body { $parser parse { } array get result } -cleanup $CLEANUP -result {Test,first-attr 1} test attrList-2.1 {right angle bracket in attribute value} -setup $SETUP -body { $parser parse { } array get result } -cleanup $CLEANUP -result {Test,attr value>} test attrList-2.2 {right angle bracket in attribute value} -setup $SETUP -body { $parser parse { } array get result } -cleanup $CLEANUP -result {Test,attr value1>value2} test attrList-2.3 {right angle bracket in attribute value} -setup $SETUP -body { $parser parse { } sortedarray result } -cleanup $CLEANUP -result {Test,attr1 value1 Test,attr2 value2>} test attrList-2.4 {right angle bracket in attribute value} -setup $SETUP -body { $parser parse { } sortedarray result } -cleanup $CLEANUP -result {Test,attr1 value1 Test,attr2 value2>} test attrList-2.5 {right angle brackets in attribute values} -setup $SETUP -body { $parser parse { } sortedarray result } -cleanup $CLEANUP -result {Test,attr1 value>1 Test,attr2 value>2} test attrList-2.6 {right angle brackets in attribute values} -setup $SETUP2 -body { $parser parse { some text } list [array get result] $pcdata } -cleanup $CLEANUP -result {{Test,attr1 value>1} {some text}} test attrList-3.1 {unnested left brace in attribute value} -setup $SETUP -body { $parser parse [format { } \{] array get result } -cleanup $CLEANUP -result [list Test,attr [format {%svalue} \{]] test attrList-3.2 {unnested right brace in attribute value} -setup $SETUP -body { $parser parse [format { } \}] array get result } -cleanup $CLEANUP -result [list Test,attr [format {value%s} \}]] test attrList-3.3 {Tcl special characters in attribute value} -setup $SETUP -body { $parser parse { } array get result } -cleanup $CLEANUP -result {Test,attr {dollar $ backslash \ brackets [puts hello]}} test attrList-4.1 {Unquoted attribute value} -constraints {xml_tcl} -setup $SETUP -match glob -body { expectError { $parser parse { } } } -cleanup $CLEANUP -result {*invalid attribute list around line 2*} test attrList-4.1 {Unquoted attribute value} -constraints {xml_expat} -setup $SETUP -body { expectError { $parser parse { } } } -cleanup $CLEANUP -result {error "not well-formed" at line 3 character 11} test attrList-4.1 {Unquoted attribute value} -constraints {xml_libxml2} -match glob -setup $SETUP -body { expectError { $parser parse { } } } -cleanup $CLEANUP -result {*unterminatedattribute*} # Test case contributed by David Sutton test attrList-5.0 {Complicated attribute list} -setup $SETUP2 -body { variable countAttributesOnly 0 $parser parse { LightState = LightCtl LOG(AlarmSwitch) DISABLE(BlinkLight) NOTIFY( AlarmSwitch,"Alarm has been reset") } regsub -all "\[ \t\n\]+" $pcdata { } pcdata set sortedResult {} foreach key [lsort -dictionary [array names result]] { lappend sortedResult $key $result($key) } list $sortedResult $pcdata } -cleanup $CLEANUP -result [list {event,deleteOnCompletion no event,endDateTime {} event,ID 22 event,name LogAlarmReset event,startDateTime {} event,startDisabled no eventAction {} eventAction/1 {} eventAction/2 {} eventAction/3 {} stateChangeTrigger,condition {AlarmSwitch = FALSE} stateChangeTrigger,initialState true} { LightState = LightCtl LOG(AlarmSwitch) DISABLE(BlinkLight) NOTIFY( AlarmSwitch,"Alarm has been reset") }] # Test case contributed by Marshall Rose test attrList-5.1 {Attribute list with quoted value} -setup $SETUP -body { variable countAttributesOnly 0 $parser parse {} array get result } -cleanup $CLEANUP -result {test,example {isn't this legal?}} test attrList-5.2 {Attribute list with unresolved entity reference} -match glob -setup $SETUP -body { variable countAttributesOnly 0 expectError { $parser parse { } } } -cleanup $CLEANUP -result * test attrList-5.3 {Attribute list with unresolved entity reference and entity callback} -setup $SETUP3 -body { variable countAttributesOnly 0 $parser parse { } set entrefs } -cleanup $CLEANUP -result 0 test attrList-5.4 {Attribute list with entity reference} -setup $SETUP -body { variable countAttributesOnly 0 $parser parse { ]> } array get result } -cleanup $CLEANUP -result {test,example {isn't this great?}} test attrList-5.5 {Attribute list with nested entity references} -setup $SETUP -body { variable countAttributesOnly 0 $parser parse { ]> } array get result } -cleanup $CLEANUP -result {test,example {XML rules, OK?}} # Test case contributed by Joe English, bug #546295 test attrList-5.6 {Attribute list with character entity references} -setup $SETUP -body { variable countAttributesOnly 0 $parser parse { } array get result } -cleanup $CLEANUP -result {foo,bar {abc def}} # Test case contributed by Laurent Duperval, bug #620034 test attrList-5.7 {Attribute with right angle bracket} -setup $SETUP -body { variable countAttributesOnly 0 $parser parse { } array get result } -cleanup $CLEANUP -result {foo {} bar,att >=foo} cleanupTests } namespace delete ::xml::attributeTest return tclxml-3.3~svn11.orig/tests/tclxml/xpath.test0000644000000000000000000001257411113705304020104 0ustar rootroot# Features covered: XPath # # This file contains a collection of tests for the XPath parser. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 1998-2003 Zveno Pty Ltd. # # $Id: xpath.test,v 1.7 2003/12/03 20:06:37 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage xpath namespace eval ::xml::xpathTest { namespace import -force ::tcltest::* # Full syntax tests test xpath-1.1 {Location path} -body { xpath::split child::para } -result {{child para {}}} test xpath-1.2 {Location path} -body { xpath::split child::* } -result {{child * {}}} test xpath-1.3 {Location path} -body { xpath::split child::text() } -result {{child {text ()} {}}} test xpath-1.4 {Location path} -body { xpath::split child::node() } -result {{child {node ()} {}}} test xpath-1.5 {Location path} -body { xpath::split attribute::name } -result {{attribute name {}}} test xpath-1.6 {Location path} -body { xpath::split attribute::* } -result {{attribute * {}}} test xpath-1.7 {Location path} -body { xpath::split descendant::para } -result {{descendant para {}}} test xpath-1.8 {Location path} -body { xpath::split ancestor::div } -result {{ancestor div {}}} test xpath-1.9 {Location path} -body { xpath::split ancestor-or-self::div } -result {{ancestor-or-self div {}}} test xpath-1.10 {Location path} -body { xpath::split descendant-or-self::para } -result {{descendant-or-self para {}}} test xpath-1.11 {Location path} -body { xpath::split self::para } -result {{self para {}}} test xpath-1.12 {Location path} -body { xpath::split child::chapter/descendant::para } -result {{child chapter {}} {descendant para {}}} test xpath-1.13 {Location path} -body { xpath::split child::*/child::para } -result {{child * {}} {child para {}}} test xpath-1.14 {Location path} -body { xpath::split / } -result {{}} test xpath-1.15 {Location path} -body { xpath::split /descendant::para } -result {{} {descendant para {}}} test xpath-1.16 {Location path} -body { xpath::split /descendant::olist/child::item } -result {{} {descendant olist {}} {child item {}}} test xpath-1.17 {Location path} -body { xpath::split {child::para[position()=1]} } -result {{child para {{= {function position {}} {number 1}}}}} test xpath-1.18 {Location path} -body { xpath::split {child::para[position()=last()]} } -result {{child para {{= {function position {}} {function last {}}}}}} test xpath-1.19 {Location path} -body { xpath::split {child::para[position()=last()-1]} } -result {{child para {{expr - = {function position {}} {function last {}} {number 1}}}}} test xpath-1.20 {Location path} -body { xpath::split {child::para[position()=last()>1]} } -result {{child para {{> = {function position {}} {function last {}} {number 1}}}}} test xpath-1.21 {Location path} -body { xpath::split {following-sibling::chapter[position()=1]} } -result {{following-sibling chapter {{= {function position {}} {number 1}}}}} test xpath-1.22 {Location path} -body { xpath::split {/child::doc/child::chapter[position()=5]/child::section[position()=2]} } -result {{} {child doc {}} {child chapter {{= {function position {}} {number 5}}}} {child section {{= {function position {}} {number 2}}}}} test xpath-1.23 {Location path} -body { xpath::split {child::para[attribute::type="warning"]} } -result {{child para {{= {path {{attribute type {}}}} {literal warning}}}}} test xpath-1.24 {Location path} -body { xpath::split {child::para[attribute::type='warning'][position()=5]} } -result {{child para {{= {path {{attribute type {}}}} {literal warning}} {= {function position {}} {number 5}}}}} test xpath-1.25 {Location path} -body { xpath::split {child::chapter[child::title='Introduction']} } -result {{child chapter {{= {path {{child title {}}}} {literal Introduction}}}}} test xpath-1.26 {Location path} -body { xpath::split {child::chapter[child::title]} } -result {{child chapter {{{path {{child title {}}}}}}}} test xpath-1.27 {Location path} -body { xpath::split {child::*[self::chapter or self::appendix]} } -result {{child * {{or {path {{self chapter {}}}} {path {{self appendix {}}}}}}}} test xpath-1.28 {Location path} -body { xpath::split {child::*[self::chapter/child::appendix]} } -result {{child * {{{path {{self chapter {}} {child appendix {}}}}}}}} # Abbreviated syntax tests test xpath-2.1 {Abbreviated location path} -body { xpath::split {/article/listitem[7]/itemizedlist/text()} } -result {{} {child article {}} {child listitem {{= {function position {}} {number 7}}}} {child itemizedlist {}} {child {text ()} {}}} test xpath-2.2 {Location step after predicate using location path} -body { xpath::split {/article/listitem[@Id='xyz']/itemizedlist/text()} } -result {{} {child article {}} {child listitem {{= {path {{attribute Id {}}}} {literal xyz}}}} {child itemizedlist {}} {child {text ()} {}}} # Test for bug #568354 contributed by Marshall Rose test xpath-2.3 {Location step with node type test in predicate} -body { xpath::split {//key[text()="foo"]} } -result {{} {descendant-or-self key {{= {path {child {text ()} {}}} {literal foo}}}}} cleanupTests } namespace delete ::xml::xpathTest return tclxml-3.3~svn11.orig/tests/tclxml/dtd-5.2.dtd0000644000000000000000000000007211113705304017617 0ustar rootroot tclxml-3.3~svn11.orig/tests/tclxml/dtd-6.5.dtd0000644000000000000000000000013711113705304017625 0ustar rootroot ]]> tclxml-3.3~svn11.orig/tests/tclxml/parser.test0000755000000000000000000001661011113705304020252 0ustar rootroot# Features covered: Parser functions # # This file contains a collection of tests for the TclXML parser. # This file tests the parser's basic functions. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 1999-2004 Zveno Pty Ltd. # # $Id: parser.test,v 1.10 2004/02/20 09:15:52 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage $::tcltest::parser namespace eval ::xml::parserTest { namespace import -force ::tcltest::* variable SETUP { variable started array set started {} variable ended array set ended {} variable elList {} variable data {} proc parray arrayName { upvar #0 $arrayName arr foreach key [lsort [array names $arrayName]] { lappend result $key $arr($key) } return $result } proc Start {name atList args} { variable started array set opts $args array set atts $atList if {![info exists started($name)]} { set started($name) 1 } else { incr started($name) } if {[info exists atts(class)]} { switch $atts(class) { continue { return -code continue } break { return -code break } error { return -code error "error condition in callback" } default { return -code $atts(class) -errorcode $atts(class) } } } } proc End {name args} { variable ended array set opts $args if {![info exists ended($name)]} { set ended($name) 1 } else { incr ended($name) } } proc PI {name args} { return -code $name } proc ElStart {name atList args} { variable elList array set opts {-empty 0} array set opts $args lappend elList start $name $opts(-empty) } proc ElEnd {name args} { variable elList array set opts {-empty 0} array set opts $args lappend elList end $name $opts(-empty) } proc pcdata text { variable data append data $text } } variable SETUP2 { eval $SETUP set p [::xml::parser -elementstartcommand [namespace code Start]] } variable CLEANUP { catch {unset started} catch {unset ended} catch {unset elList} catch {unset data} rename parray {} rename Start {} rename End {} rename PI {} rename ElStart {} rename ElEnd {} rename pcdata {} catch {$p free} } test parser-1.1 {parser creation} -setup $SETUP -body { set p [::xml::parser] list [regexp {^xmlparser[0-9]+$} $p] \ [string equal [info commands $p] $p] } -cleanup $CLEANUP -result {1 1} test parser-1.2 {parser creation, only options} -setup $SETUP -body { set p [::xml::parser -elementstartcommand EStart] list [regexp {^xmlparser[0-9]+$} $p] \ [string equal [info commands $p] $p] } -cleanup $CLEANUP -result {1 1} test parser-1.3 {parser creation, named} -body { set result [::xml::parser testparser] list $result [info commands testparser] } -cleanup { rename testparser {} } -result {testparser testparser} test parser-1.4 {parser creation, named with options} -body { set result [::xml::parser testparser -elementstartcommand EStart] list $result [info commands testparser] } -cleanup { rename testparser {} } -result {testparser testparser} test parser-1.5 {configure -baseuri} -body { set parser [::xml::parser -baseuri file:///tmp/parser-1.5.test] ok } -cleanup { $parser free } -result {} # Test break return code from callback test parser-2.1 {break in callback} -setup $SETUP2 -body { $p parse { Should see this data Should not see this data Should not see this data } set started(Element) } -cleanup $CLEANUP -result 2 test parser-2.2 {break in callback} -setup $SETUP2 -body { $p parse { Should see this data Should see this data Should not see this data } set started(Element) } -cleanup $CLEANUP -result 3 test parser-2.3 {break in callback} -setup $SETUP2 -body { $p parse { Should see this data Should see this data Should not see this data } set started(Element) } -cleanup $CLEANUP -result 3 test parser-3.1 {continue in callback} -setup $SETUP2 -body { $p parse { Should see this data Should not see this data Should see this data } set started(Element) } -cleanup $CLEANUP -result 3 test parser-3.2 {continue in callback} -setup $SETUP2 -body { $p parse { Should see this data Should see this data Should not see this data Should see this data Should see this data } set started(Element) } -cleanup $CLEANUP -result 5 test parser-3.3 {continue in callback} -setup $SETUP2 -body { $p parse { Should see this data Should see this data Should not see this data break will have no effect Should see this data Should see this data } set started(Element) } -cleanup $CLEANUP -result 5 test parser-4.1 {error in callback} -setup $SETUP2 -body { set result [catch { $p parse { Should see this data Should not see this data } }] list $result $started(Element) } -cleanup $CLEANUP -result {1 2} # catch doesn't seem to return the actual error code test parser-4.2 {error in callback} -setup $SETUP2 -body { set errcode [catch {$p parse { Should see this data Should not see this data }} result] list $errcode $started(Element) } -cleanup $CLEANUP -result {1 2} test parser-5.0 {free parser} -body { set p [::xml::parser] $p free info commands $p } -result {} # Test for bug #510418 test parser-5.1 {free in namespace} -body { namespace eval ::xml::parserTest::test51 { set p [::xml::parser -elementstartcommand Foo] $p free } } -cleanup { namespace delete ::xml::parserTest::test51 } -result {} # Test for bug #510419 test parser-6.1 {reset parser instance} -setup $SETUP2 -body { $p reset $p parse {} set first $started(Test) catch {unset started} array set started {} $p reset $p parse {} list $first $started(Test) } -cleanup $CLEANUP -result [list 1 2] # Test for bug #579264 # libxml2 doesn't recognise ignorable whitespace unless validating test parser-7.1 {-ignorewhitespace option} -setup $SETUP -constraints {!xml_libxml2} -body { set p [::xml::parser -characterdatacommand [namespace code pcdata] -ignorewhitespace 1] $p parse { } string length $data } -cleanup $CLEANUP -result 0 cleanupTests } namespace delete ::xml::parserTest return tclxml-3.3~svn11.orig/tests/tclxml/pi.test0000755000000000000000000000465111113705304017370 0ustar rootroot# Features covered: Processing Instructions # # This file contains a collection of tests for the TclXML parser. # This file tests the parser's performance on Processing Instructions. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 1998-2004 Zveno Pty Ltd. # # $Id: pi.test,v 1.7 2004/02/20 09:15:52 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage $::tcltest::parser namespace eval ::xml::piTest { namespace import -force ::tcltest::* variable SETUP { variable result {} proc PI {target data args} { variable result lappend result $target $data } set parser [xml::parser \ -processinginstructioncommand [namespace code PI]] } variable CLEANUP { catch {unset result} $parser free } test pi-1.1 {PI} -setup $SETUP -body { $parser parse { } set result } -cleanup $CLEANUP -result {Test {This is a processing instruction}} test pi-1.2 {PI: missing trailing ?} -setup $SETUP -match regexp -body { expectError { $parser parse { } } } -cleanup $CLEANUP -result {(PI: expected '\?' character)|(error:.*PI Test never end)|(.*processing-instruction-not-finished.*)} # Test Tcl special characters in PI data. # NB. Tets had to modified since the PI target must be # an XML Name (reported by rolf@pointsman.de) test pi-2.1 {PI with special characters} -setup $SETUP -body { $parser parse { } set result } -cleanup $CLEANUP -result {if {[!VMLRender]}} test pi-2.2 {PI target with special characters} -setup $SETUP -match regexp -body { expectError { $parser parse { } } } -cleanup $CLEANUP -result {(illegal character.*in processing instruction target)|(no target name)} test pi-2.3 {PI target with "xml"} -setup $SETUP -constraints {!xml_libxml2} -match glob -body { expectError { $parser parse { } } } -cleanup $CLEANUP -result {*characters "xml" not permitted*} cleanupTests } namespace delete ::xml::piTest return tclxml-3.3~svn11.orig/tests/tclxml/dtd-6.1.dtd0000644000000000000000000000005211113705304017615 0ustar rootroot ]]> tclxml-3.3~svn11.orig/tests/tclxml/dtd-6.3.dtd0000644000000000000000000000002011113705304017612 0ustar rootroot tclxml-3.3~svn11.orig/tests/tclxml/xmltest.test0000755000000000000000000000547111113705304020461 0ustar rootroot# Features covered: Conformance # # This file contains a collection of tests for the TclXML parser. # This file tests the parser's performance against the W3C/OASIS/NIST # XML Conformance Test Suite. # # NB. These tests only check acceptance/rejection of whole XML documents. # As such it is crude and does not test callback features. # # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 1999-2003 Zveno Pty Ltd. # # $Id: xmltest.test,v 1.6 2003/12/03 20:06:37 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage $::tcltest::parser namespace eval ::xml::xmltestTest { namespace import -force ::tcltest::* set testDir [file join [workingDirectory] XML-Test-Suite] testConstraint xmltests [file exists $testDir] variable SETUP { proc ConfEStart {type attlist args} { variable base attrs pcdata catch {unset attrs} array set attr $attlist set pcdata {} switch -- $type { TESTSUITE { puts $attr(PROFILE) } TESTCASES { puts $attr(PROFILE) lappend base $attr(xml:base) } TEST { } } } proc ConfEEnd {name args} { variable base attrs pcdata switch -- $name { TESTCASES { set base [lreplace $base end end] } TEST { switch -- $attr(TYPE) { error - not-wf { set expect error } default { # Skip validity tests - not yet supported return } } set f [file join $base $attr(URI)] set ch [open $f] set data [read $ch] close $ch regsub -all [format {[ %s%s%s]+} \t \n \r] [string trim $pcdata] { } pcdata test xmltest-[lindex $base end]-$attr(ID) $pcdata -body { set parser [xml::parser $attr(ID)] if {[catch {$parser parse $data}]} { # Need to distinguish between not-wf, error and invalid set code error } else { set code valid } $parser free set $code } $expect } } } proc ConfCDATA text { variable pcdata append pcdata $text } } # Need a framework to test against each file: it's too time- # consuming to setup a test proc for each one. if {[testConstraint xmltests]} { if {[catch {open [file join $testDir xmlconf xmlconf.xml]} ch]} { puts stderr "unable to open XML Test Suite configuration file: skipping tests" return } else { set confXML [read $ch] close $ch set base [file join [pwd] XML-Test-Suite xmlconf] set confParser [::xml::parser \ -elementstartcommand [namespace code ConfEStart] \ -elementendcommand [namespace code ConfEEnd] \ -characterdatacommand [namespace code ConfPCDATA] \ -validate 1] $confParser parse $confXML } } cleanupTests } namespace delete ::xml::xmltestTest return tclxml-3.3~svn11.orig/tests/tclxml/dtd-5.1.dtd0000644000000000000000000000003211113705304017612 0ustar rootroot tclxml-3.3~svn11.orig/tests/tclxml/dtd-6.4.dtd0000644000000000000000000000015211113705304017621 0ustar rootroot ]]> ]]> tclxml-3.3~svn11.orig/tests/tclxml/doctype.test0000755000000000000000000000357611113705304020434 0ustar rootroot# Features covered: Document Type Declaration # # This file contains a collection of tests for the TclXML parser. # This file tests the parser's performance on Document Type Declarations. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 1998-2003 Zveno Pty Ltd. # # $Id: doctype.test,v 1.7 2003/12/03 20:06:36 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage $::tcltest::parser namespace eval ::xml::doctypeTest { namespace import -force ::tcltest::* variable SETUP { variable result {} proc doctype {name pub system dtd} { variable result lappend result $name $pub $system $dtd } set parser [xml::parser \ -doctypecommand [namespace code doctype]] } variable CLEANUP { catch {unset result} rename doctype {} $parser free } test doctype-1.1 {Document Type Declaration: no internal DTD subset} -setup $SETUP -constraints !xml_libxml2 -body { $parser parse { } set result } -cleanup $CLEANUP -result {Test {} {} {{}}} test doctype-2.1 {Document Type Declaration: internal DTD subset} -setup $SETUP -constraints !xml_libxml2 -body { $parser parse { ]> } set result } -cleanup $CLEANUP -result {Test {} {} {{}}} test doctype-2.2 {Document Type Declaration: internal DTD subset} -setup $SETUP -constraints !xml_libxml2 -body { $parser parse { ]> } set result } -cleanup $CLEANUP -result {Test {} {} {{ }}} cleanupTests } namespace delete ::xml::doctypeTest return tclxml-3.3~svn11.orig/tests/tclxml/all.tcl0000755000000000000000000000163711113705304017334 0ustar rootroot# all.tcl -- # # This file contains a support module to run all of the Tcl # tests. It must be invoked using "source all.test" by # a calling tcl script that has loaded the parser class it wishes to # test in this directory. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 2003 Zveno Pty Ltd # Copyright (c) 1998-1999 by Scriptics Corporation. # # All rights reserved. # # RCS: @(#) $Id: all.tcl,v 1.4 2003/12/03 20:06:36 balls Exp $ package require Tcl 8.4 package require tcltest 2.2 tcltest::Option -parser xml { Selects the XML parser class. } AcceptAll parser tcltest::configure -testdir [file dirname [file normalize [info script]]] eval tcltest::configure $argv if {$::tcltest::parser == "xml"} { foreach parser {libxml2 tclparser} { puts "\nTesting parser class \"$parser\"\n" tcltest::configure -parser $parser tcltest::runAllTests } } else { tcltest::runAllTests } tclxml-3.3~svn11.orig/tests/tclxml/README0000755000000000000000000000227411113705304016736 0ustar rootroot TclXML Test Suite This directory contains test scripts for the TclXML package. See ../tcldom and ../tclxslt for tests for TclDOM and TclXSLT respectively. The Tcl interfaces to libxml2 and the Tcl-only implementations of an XML parser may be tested. The test scripts accept the '-parser' argument to select which parser class to test. Accepted values are 'xml', 'libxml2' and 'tclparser'. Using the 'xml' value is not recommended, as the appropriate test constraint will not be set (this will result in various tests being performed that are not intended for the parser class that is the default - these will likely fail). all.tcl will test the parser class given by the 'parser' argument. If no '-parser' argument is given then all parser classes will be tested. The Tcl testing framework is used for testing TclXML. The file license.terms in this directory is from the Tcl distribution, and refers to this file, all.tcl and defs.tcl. MANIFEST: --------- README Tcl test suite design document. all.tcl support module that finds & runs all tests *.test test scripts *.dtd dtd files for external dtd test scripts RCS: @(#) $Id: README,v 1.4 2003/12/03 20:06:36 balls Exp $ tclxml-3.3~svn11.orig/tests/tclxml/dtd-6.6.dtd0000644000000000000000000000014411113705304017624 0ustar rootroot ]]> tclxml-3.3~svn11.orig/tests/tclxml/pcdata.test0000755000000000000000000000716711113705304020221 0ustar rootroot# Features covered: PCDATA # # This file contains a collection of tests for the TclXML parser. # This file tests the parser's performance on PCDATA. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 2005 Explain # http://www.explain.com.au/ # Copyright (c) 1998-2004 Zveno Pty Ltd. # # $Id: pcdata.test,v 1.10 2005/05/20 12:02:18 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage $::tcltest::parser namespace eval ::xml::pcdataTest { namespace import -force ::tcltest::* variable SETUP { variable result {} variable pcdataCounter 0 variable element 0 proc pcdata data { variable result variable pcdataCounter append result $data incr pcdataCounter } proc EStart {tagName attrList args} { variable element switch -- $tagName { Test { } default { incr element } } } proc EStop {tagname args} {} set parser [xml::parser \ -elementstartcommand [namespace code EStart] \ -elementendcommand [namespace code EStop] \ -characterdatacommand [namespace code pcdata]] } variable CLEANUP { catch {unset result} catch {unset pcdataCounter} catch {unset element} rename pcdata {} rename EStart {} rename EStop {} $parser free } test pcdata-1.1 {Simple PCDATA} -setup $SETUP -body { $parser parse { This is PCDATA } list $result $element } -cleanup $CLEANUP -result {{This is PCDATA} 0} test pcdata-1.2 {PCDATA section with Tcl specials} -setup $SETUP -body { $parser parse { Dollar $ backslash \ square brackets [ ] braces { } } list $result $element } -cleanup $CLEANUP -result {{Dollar $ backslash \ square brackets [ ] braces { }} 0} # Requested by Marshall Rose, 20/3/1999 test pcdata-1.3 {PCDATA with no entity expansion} -setup $SETUP -match regexp -body { $parser configure \ -defaultexpandinternalentities 0 $parser parse { This is <PCDATA> } list $result $pcdataCounter } -cleanup $CLEANUP -result {{This is (<|<)PCDATA(>|>)} 1} # Test case from bug #468029 contributed by kenstir@users.sourceforge.net test pcdata-1.4 {PCDATA with Tcl special character} -setup $SETUP -body { $parser parse {UPPER('new')$UPPER(TKT_STATE)} set result } -cleanup $CLEANUP -result {UPPER('new')$UPPER(TKT_STATE)} # Test case from bug #515972 contributed by kenstir@users.sourceforge.net # Similar to #468029 test pcdata-1.5 {PCDATA with Tcl special character} -setup $SETUP -body { $parser parse {Welcome $to [\{]asd &asd f@af!a.htm} set result } -cleanup $CLEANUP -result {Welcome $to [\{]asd &asd f@af!a.htm} # Test case from bug #1040550 contributed by imamit@users.sf.net test pcdata-1.6 {PCDATA with backslash characters} -setup $SETUP -body { $parser parse [format {%s%s( -type f -o -type d%s%s)} \\ \\ \\ \\] set result } -cleanup $CLEANUP -result [format {%s%s( -type f -o -type d%s%s)} \\ \\ \\ \\] test pcdata-2.1 {Bad PCDATA: illegal Unicode character} -setup $SETUP -match glob -body { expectError { $parser parse [format {Bad %s character} \x04] } } -cleanup $CLEANUP -result * test pcdata-2.2 {Bad PCDATA: entity resolves to illegal Unicode character} -setup $SETUP -match glob -body { expectError { $parser parse {Bad  character} } } -cleanup $CLEANUP -result * cleanupTests } namespace delete ::xml::pcdataTest return tclxml-3.3~svn11.orig/tests/tclxml/entity.test0000755000000000000000000001172111113705304020270 0ustar rootroot# Features covered: Entities # # This file contains a collection of tests for the TclXML parser. # This file tests the parser's performance on entities. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 1999-2003 Zveno Pty Ltd. # # $Id: entity.test,v 1.9 2003/12/03 20:06:36 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage $::tcltest::parser namespace eval ::xml::entityTest { namespace import -force ::tcltest::* variable SETUP { variable elements 0 variable result {} variable references {} proc Start {name attrList args} { variable elements incr elements } proc pcdata text { variable result append result $text } proc EntityRef name { variable references variable result lappend references $name append result ##entityreference## return {} } set parser [xml::parser \ -characterdatacommand [namespace code pcdata]] } variable CLEANUP { catch {unset elements} catch {unset result} catch {unset references} rename EntityRef {} rename Start {} rename pcdata {} $parser free } test entity-1.1 {parameter entity in document entity} -setup $SETUP -body { $parser parse { ]> %wrong;} set result } -cleanup $CLEANUP -result {%wrong;} test entity-1.2 {character entities in hex} -setup $SETUP -body { $parser parse {A<>$[]} set result } -cleanup $CLEANUP -result {A<>$[]} test entity-1.3 {character entities in decimal} -setup $SETUP -body { $parser parse {A<>$[]} set result } -cleanup $CLEANUP -result {A<>$[]} test entity-1.4 {illegal character entity} -setup $SETUP -match regexp -body { expectError { $parser parse {&#blah;} } } -cleanup $CLEANUP -result {(invalid decimal value)|(malformed character entity)} test entity-2.1 {predefined general entities} -setup $SETUP -body { $parser parse {<>&"'} set result } -cleanup $CLEANUP -result {<>&"'} test entity-2.2 {undefined general entities - no callback} -setup $SETUP -match regexp -body { expectError { $parser parse {&undefined;} } } -cleanup $CLEANUP -result {(Entity 'undefined' not defined)|(undefined entity reference)} test entity-2.3 {undefined general entities - with callback} -setup $SETUP -constraints {!xml_libxml2} -match glob -body { $parser configure \ -entityreferencecommand [namespace code EntityRef] $parser parse {&undefined;} list $result $references } -cleanup $CLEANUP -result {*##entityreference##* undefined} # This example is from the XML Recommendation, Appendix D p. 29. variable example1_p_content {An ampersand (&) may be escaped numerically (&) or with a general entity (&).} test entity-3.1 {replacement text with element markup} -setup $SETUP -constraints {!xml_libxml2} -body { $parser configure \ -elementstartcommand [namespace code Start] $parser parse {An ampersand (&#38;) may be escaped numerically (&#38;#38;) or with a general entity (&amp;).

"> ]> &example;} list $result $elements } -cleanup $CLEANUP -result [list $example1_p_content 2] test entity-4.1 {entity references} -setup $SETUP -constraints {!xml_libxml2} -body { $parser configure \ -entityreferencecommand [namespace code EntityRef] $parser parse {undefined &myentity; reference} list $result $references } -cleanup $CLEANUP -result {{undefined ##entityreference## reference} myentity} # Test case from bug #431353 submitted by Shaun Lowry test entity-5.1 {entity references w/- Tcl special characters} -setup $SETUP -body { $parser parse [format { & %s } \{] set result } -cleanup $CLEANUP -result [format { & %s } \{] test entity-5.2 {entity references w/- Tcl special characters} -setup $SETUP -body { $parser parse [format { & %s } \[] set result } -cleanup $CLEANUP -result [format { & %s } \[] test entity-5.3 {entity references w/- Tcl special characters} -setup $SETUP -body { $parser parse [format { & %s } \\] set result } -cleanup $CLEANUP -result [format { & %s } \\] test entity-5.4 {entity references w/- Tcl special characters} -setup $SETUP -body { $parser parse [format { & %s%s } \\ \{] set result } -cleanup $CLEANUP -result [format { & %s%s } \\ \{] cleanupTests } namespace delete ::xml::entityTest return tclxml-3.3~svn11.orig/tests/tclxml/comment.test0000755000000000000000000000773511113705304020430 0ustar rootroot# Features covered: comments # # This file contains a collection of tests for the TclXML parser. # This file tests the parser's performance on comments. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 1998-2003 Zveno Pty Ltd. # # $Id: comment.test,v 1.5 2003/12/03 20:06:36 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage $::tcltest::parser namespace eval ::xml::commentTest { namespace import -force ::tcltest::* variable SETUP { variable result {} variable comment {} variable element 0 proc pcdata data { variable result append result $data } proc comment data { variable comment append comment $data } proc EStart {tagName attrList args} { variable element switch -- $tagName { test - Test { } default { incr element } } } proc EStop {tagName args} { } set parser [xml::parser \ -elementstartcommand [namespace code EStart] \ -elementendcommand [namespace code EStop] \ -characterdatacommand [namespace code pcdata] \ -commentcommand [namespace code comment]] } variable CLEANUP { catch {unset result} catch {unset comment} catch {unset element} rename pcdata {} rename comment {} rename EStart {} rename EStop {} $parser free } test comment-1.1 {Simple comment} -setup $SETUP -body { $parser parse { } list $comment $result $element } -cleanup $CLEANUP -result {{ This is a comment } {} 0} test comment-1.2 {Simple comment, no white space} -setup $SETUP -body { $parser parse { } list $comment $result $element } -cleanup $CLEANUP -result {{This is a comment} {} 0} test comment-1.3 {Simple comment, within PCDATA} -setup $SETUP -body { $parser parse { surrounding PCDATA } list $comment $result $element } -cleanup $CLEANUP -result {{This is a comment} {surrounding PCDATA} 0} test comment-1.4 {Simple comment, no white space} -setup $SETUP -body { $parser parse { } list $comment $result $element } -cleanup $CLEANUP -result {comment {} 0} test comment-1.5 {comment, with nested element} -setup $SETUP -body { $parser parse { } list $comment $result $element } -cleanup $CLEANUP -result {{ comment } {} 0} test comment-2.1 {comment with an angle bracket} -setup $SETUP -body { $parser parse { } list $comment $result $element } -cleanup $CLEANUP -result {{ This is a > greater than sign } {} 0} test comment-2.2 {comment with multiple angle brackets} -setup $SETUP -body { $parser parse { } list $comment $result $element } -cleanup $CLEANUP -result {{ } {} 0} variable SETUP2 { eval $SETUP variable commentData [format {
} \}] } variable CLEANUP2 { eval $CLEANUP unset commentData } test comment-2.3 {comment with entities} -setup $SETUP2 -body { $parser parse " " list [string equal $comment $commentData] [string trim $result] $element } -cleanup $CLEANUP2 -result [list 1 {} 2] cleanupTests } namespace delete ::xml::commentTest return tclxml-3.3~svn11.orig/tests/tclxml/xmldecl.test0000644000000000000000000000474211113705304020406 0ustar rootroot# Features covered: XML Declaration # # This file contains a collection of tests for the TclXML parser. # This file tests the parser's performance on XML Declarations. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 2001-2003 Zveno Pty Ltd. # # $Id: xmldecl.test,v 1.3 2003/12/03 20:06:37 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxmlutils.tcl] testPackage $::tcltest::parser namespace eval ::xml::xmldeclTest { namespace import -force ::tcltest::* variable SETUP { variable result {} proc xmldecl {version encoding standalone} { variable result lappend result $version $encoding $standalone } set parser [xml::parser \ -xmldeclcommand [namespace code xmldecl]] } variable CLEANUP { catch {unset result} rename xmldecl {} $parser free } test xmldecl-1.1 {No XML Declaration} -setup $SETUP -body { $parser parse {} set result } -cleanup $CLEANUP -result {} test xmldecl-1.2 {Simple XML Declaration} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { } set result } -cleanup $CLEANUP -result [list 1.0 {} {}] test xmldecl-1.3 {XML Declaration w/- encoding} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { } set result } -cleanup $CLEANUP -result [list 1.0 utf-8 {}] test xmldecl-1.4 {XML Declaration w/- standalone} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { } set result } -cleanup $CLEANUP -result [list 1.0 {} yes] test xmldecl-1.5 {XML Declaration w/- the lot} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { } set result } -cleanup $CLEANUP -result [list 1.0 utf-8 yes] # Test case from bug #434304 submitted by Cameron Laird test xmldecl-2.1 {XML Declaration w/- whitespace} -setup $SETUP -constraints {!xml_libxml2} -body { $parser parse { } set result } -cleanup $CLEANUP -result [list 1.0 {} {}] test xmldecl-3.1 {XML Declaration w/- error} -setup $SETUP -match glob -body { expectError { $parser parse { } } } -cleanup $CLEANUP -result * cleanupTests } namespace delete ::xml::xmldeclTest return tclxml-3.3~svn11.orig/tests/tclxml/dtd-6.2.dtd0000644000000000000000000000001711113705304017617 0ustar rootroot tclxml-3.3~svn11.orig/tests/tclxml/dtd-5.4.dtd0000644000000000000000000000003211113705304017615 0ustar rootroot tclxml-3.3~svn11.orig/tests/tcldom/0000755000000000000000000000000011574742512016042 5ustar rootroottclxml-3.3~svn11.orig/tests/tcldom/perf-1.tcl0000644000000000000000000000066411113705304017631 0ustar rootroot# Create $childNum^2 elements set childNum 50 catch {set childNum $numChildren} set testNum 10 catch {set testNum $numTests} time { set doc [dom::DOMImplementation create] set top [dom::document createElement $doc Test] for {set i 0} {$i < $childNum} {incr i} { set child [dom::document createElement $top Top] for {set j 0} {$j < $childNum} {incr j} { dom::document createElement $child Child } } } $testNum tclxml-3.3~svn11.orig/tests/tcldom/element.test0000644000000000000000000001115411113705304020361 0ustar rootroot# Commands covered: ::dom::element # # This file contains a collection of tests for one or more of the # TclDOM commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 1998-2004 Zveno Pty Ltd. # # $Id: element.test,v 1.9 2004/02/24 20:16:10 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::elementTest { namespace import -force ::tcltest::* variable SETUP { set doc [dom::create] set top [$doc createElement Test] dom::node appendChild $doc $top set e1 [$doc createElement Element] $top appendChild $e1 } variable CLEANUP { dom::destroy $doc } test element-1.1 {cget -tagName} -setup $SETUP -body { dom::element cget $top -tagName } -cleanup $CLEANUP -result Test test element-1.2 {cget -tagName} -setup $SETUP -body { dom::element cget $e1 -tagName } -cleanup $CLEANUP -result Element test element-1.3 {error: cget -tagName on non-element node} -setup $SETUP -match glob -body { expectError { dom::element cget $doc -tagName } } -cleanup $CLEANUP -result {malformed node token*} test element-1.4 {error: cget} -setup $SETUP -match glob -body { expectError { dom::element cget } } -cleanup $CLEANUP -result {wrong # args*} test element-1.5 {error:cget} -setup $SETUP -match glob -body { expectError { dom::element cget $e1 } } -cleanup $CLEANUP -result {wrong # args*} test element-2.1 {error: configure -tagName, read-only option} -setup $SETUP -match glob -body { expectError { dom::element configure $e1 -tagName Error } } -cleanup $CLEANUP -result {option * cannot be modified} test element-3.1 {setAttribute} -constraints {dom_c} -setup $SETUP -body { dom::element setAttribute $e1 class success } -cleanup $CLEANUP -result {} test element-3.1 {setAttribute} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { dom::element setAttribute $e1 class success } -cleanup $CLEANUP -result success test element-3.2 {error: setAttribute, wrong number args} -setup $SETUP -match glob -body { expectError { dom::element setAttribute $e1 href } } -cleanup $CLEANUP -result {wrong # args*} # TODO: test that illegal attribute names are rejected test element-4.1 {getAttribute} -setup { eval $SETUP dom::element setAttribute $e1 class success } -body { dom::element getAttribute $e1 class } -cleanup $CLEANUP -result success test element-4.2 {error: getAttribute, wrong number args} -setup $SETUP -match glob -body { expectError { dom::element getAttribute $e1 } } -cleanup $CLEANUP -result {wrong # args*} test element-4.3 {getAttribute, undefined attribute} -setup $SETUP -body { # According to DOM spec this should not raise an exception set rc [catch {dom::element getAttribute $e1 unknown} ans] list $rc $ans } -cleanup $CLEANUP -result [list 0 {}] # TODO: check that attribute values are escaped correctly test element-5.1 {removeAttribute} -setup { eval $SETUP dom::element setAttribute $e1 class success } -body { dom::element removeAttribute $e1 class } -cleanup $CLEANUP -result {} test element-5.2 {removeAttribute a nonexistent attribute} -setup $SETUP -body { dom::element removeAttribute $e1 class # this should be a no-op. } -cleanup $CLEANUP -result {} # Attribute nodes are not yet implemented test element-6.1 {getAttributeNode} -constraints {not_implemented} -setup $SETUP -body { } -cleanup $CLEANUP -result {} test element-7.1 {setAttributeNode} -constraints {not_implemented} -setup $SETUP -body { } -cleanup $CLEANUP -result {} test element-8.1 {removeAttributeNode} -constraints {not_implemented} -setup $SETUP -body { } -cleanup $CLEANUP -result {} test element-9.1 {getElementsByTagName} -constraints {emptyTest} -setup $SETUP -body { } -cleanup $CLEANUP -result {} test element-10.1 {normalize} -constraints {emptyTest} -setup { set doc [dom::create] set top [dom::document createElement $doc test] dom::document createTextNode $top {First text} dom::document createTextNode $top {Second text} } -body { $top normalize list [llength [$top children]] [$top stringValue] } -cleanup $CLEANUP -result [list 1 {First textSecond text}] test element-11.1 {error: method} -setup $SETUP -match glob -body { expectError { dom::element foo $e1 } } -cleanup $CLEANUP -result {bad method "foo": *} cleanupTests } namespace delete ::dom::elementTest return tclxml-3.3~svn11.orig/tests/tcldom/validate.test0000644000000000000000000000724311215700771020533 0ustar rootroot# Commands covered: ::dom::validate # # This file contains a collection of tests for one or more of the # TclDOM commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2008-2009 Explain # Copyright (c) 2003-2004 Zveno Pty Ltd. # # $Id: validate.test,v 1.4 2004/01/19 21:37:41 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::validateTest { namespace import -force ::tcltest::* variable SETUP { set inst [dom::parse { ]> This is a valid document }] } variable CLEANUP { dom::destroy $inst } variable SCHEMASETUP { set inst [dom::parse {a simple test document}] set schema [dom::parse { }] } variable SCHEMACLEANUP { dom::destroy $inst dom::destroy $schema } ### DTD validation test validate-1.1 {validate too few args} -setup $SETUP -constraints {dom_libxml2} -match glob -body { expectError { $inst dtd } } -cleanup $CLEANUP -result {wrong # args*} test validate-1.2 {validate too many args} -setup $SETUP -constraints {dom_libxml2} -match glob -body { expectError { $inst dtd validate another } } -cleanup $CLEANUP -result {wrong # args*} test validate-1.3 {validate correct doc} -setup $SETUP -constraints {dom_libxml2} -body { $inst dtd validate } -cleanup $CLEANUP -result {} test validate-1.4 {validate invalid doc} -constraints {dom_libxml2} -setup { set bad [dom::parse { ]> This is not a valid document}] } -match glob -body { expectError { $bad dtd validate } } -cleanup { dom::destroy $bad } -result {*unknown-element-type*} ### WXS Schema-validation test validate-2.1 {schema compile} -setup $SCHEMASETUP -constraints {dom_libxml2} -match glob -body { $schema schema compile } -cleanup $SCHEMACLEANUP -result {} test validate-2.2 {schema method too few args} -setup $SCHEMASETUP -constraints {dom_libxml2} -match glob -body { expectError { $schema schema } } -cleanup $SCHEMACLEANUP -result {wrong # args*} test validate-2.3 {schema compile too many args} -setup $SCHEMASETUP -constraints {dom_libxml2} -match glob -body { expectError { $schema schema compile another } } -cleanup $SCHEMACLEANUP -result {wrong # args*} test validate-2.4 {schema validate valid doc} -constraints {dom_libxml2} -setup { eval $SCHEMASETUP $schema schema compile } -body { $schema schema validate $inst } -cleanup $SCHEMACLEANUP -result {} test validate-2.5 {schema validate invalid doc} -match regexp -constraints {dom_libxml2} -setup { eval $SCHEMASETUP $schema schema compile set bad [dom::parse {a simple test document}] } -body { expectError { $schema schema validate $bad } } -cleanup { eval $SCHEMACLEANUP } -result {.*invalid-element.*|.*Element content is not allowed.*} test validate-2.6 {schema compile invalid schema} -constraints {dom_libxml2} -match glob -setup { eval $SCHEMASETUP set badschema [dom::parse {this is not a schema}] } -body { expectError { $badschema schema compile } } -cleanup { eval $SCHEMACLEANUP } -result {* is not a schema*} cleanupTests } namespace delete ::dom::validateTest return tclxml-3.3~svn11.orig/tests/tcldom/node.test0000644000000000000000000013173511215700771017673 0ustar rootroot# Commands covered: ::dom::node # # This file contains a collection of tests for one or more of the # TclDOM commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2008-2009 Explain # Copyright (c) 1998-2004 Zveno Pty Ltd. # # $Id: node.test,v 1.12 2004/02/25 20:10:30 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::nodeTest { namespace import -force ::tcltest::* variable SETUP { set doc [::dom::create] set top [::dom::document createElement $doc Test] set child1 [$top appendChild [::dom::document createElement $top Child1]] set child2 [$top appendChild [::dom::document createTextNode $top Child2]] set child3 [$top appendChild [::dom::document createElement $top Child3]] } variable CLEANUP { dom::destroy $doc } testConstraint strictDOM [expr $::dom::strictDOM || [testConstraint dom_libxml2]] # NB. All factory methods are tested in document.test test node-1.1 {cget -nodeName} -setup $SETUP -body { ::dom::node cget $top -nodeName } -cleanup $CLEANUP -result Test test node-1.1.1 {cget -nodeName} -setup $SETUP -body { $top cget -nodeName } -cleanup $CLEANUP -result Test test node-1.2 {configure -nodeName} -setup $SETUP -body { ::dom::node configure $top -nodeName } -cleanup $CLEANUP -result Test test node-1.2.1 {configure -nodeName} -setup $SETUP -body { $top configure -nodeName } -cleanup $CLEANUP -result Test test node-1.3 {configure -nodeName readonly} -constraints strictDOM -setup $SETUP -match regexp -body { expectError { ::dom::node configure $top -nodeName XXX } } -cleanup $CLEANUP -result {(no modification allowed error: an attempt was made to modify an object\ where modifications are not allowed)|(attribute "-nodeName" is read-only)} test node-1.3 {configure -nodeName readonly} -constraints {!strictDOM} -setup $SETUP -body { ::dom::node configure $top -nodeName XXX ok } -cleanup $CLEANUP -result {} test node-1.4 {configure: too many parameters} -setup $SETUP -match regexp -body { expectError { ::dom::node configure $top -nodeValue XXX ZZZ } } -cleanup $CLEANUP -result {(wrong # args: should be "::dom::node configure node option")|()} test node-1.4.1 {configure: too many parameters} -setup $SETUP -match regexp -body { expectError { $top configure -nodeValue XXX ZZZ } } -cleanup $CLEANUP -result {(wrong # args: should be "::dom::node configure node option")|()} test node-2.1 {argument parsing} -setup $SETUP -match glob -body { expectError { dom::node } } -cleanup $CLEANUP -result {wrong # args*} test node-2.2 {argument parsing} -setup $SETUP -match regexp -body { expectError { dom::node foo } } -cleanup $CLEANUP -result {(bad method "foo": must be cget, configure, insertBefore, replaceChild, removeChild, appendChild, hasChildNodes, cloneNode, children, parent, path, createNode, selectNode, stringValue, addEventListener, removeEventListener, dispatchEvent, or isSameNode)|(^wrong # args.*)} test node-2.3 {argument parsing} -constraints {dom_tcl} -setup $SETUP -match glob -body { expectError { dom::node cget blah } } -cleanup $CLEANUP -result {wrong # args:*} test node-2.3 {argument parsing} -constraints {dom_libxml2} -setup $SETUP -match glob -body { expectError { dom::node cget blah } } -cleanup $CLEANUP -result {"blah" is neither a DOM document nor a DOM node} test node-2.4 {cget -nodeType} -setup $SETUP -body { ::dom::node cget $top -nodeType } -cleanup $CLEANUP -result element test node-2.4.1 {cget -nodeType} -setup $SETUP -body { $top cget -nodeType } -cleanup $CLEANUP -result element test node-2.5 {configure -nodeType} -setup $SETUP -body { $top configure -nodeType } -cleanup $CLEANUP -result element test node-2.6 {configure -nodeType readonly} -match regexp -constraints {strictDOM} -setup $SETUP -match regexp -body { expectError { ::dom::node configure $top -nodeType XXX } } -cleanup $CLEANUP -result {(no modification allowed error: an attempt was made to modify an object\ where modifications are not allowed)|(attribute "-nodeType" is read-only)} test node-2.6 {configure -nodeType readonly} -constraints {!strictDOM} -setup $SETUP -body { ::dom::node configure $top -nodeName XXX ok } -cleanup $CLEANUP -result {} test node-3.1 {cget -parentNode top} -setup $SETUP -body { compareNodes [::dom::node cget $top -parentNode] $doc } -cleanup $CLEANUP -result 1 test node-3.1.1 {cget -parentNode top} -setup $SETUP -body { compareNodes [$top cget -parentNode] $doc } -cleanup $CLEANUP -result 1 test node-3.2 {cget -parentNode document} -setup $SETUP -body { ::dom::node cget $doc -parentNode } -cleanup $CLEANUP -result {} test node-3.3 {cget -parentNode leaf} -setup $SETUP -body { compareNodes [::dom::node cget $child1 -parentNode] $top } -cleanup $CLEANUP -result 1 test node-3.3.1 {cget -parentNode leaf} -setup $SETUP -body { compareNodes [$child1 cget -parentNode] $top } -cleanup $CLEANUP -result 1 test node-3.4 {configure -parentNode top} -setup $SETUP -body { compareNodes [::dom::node configure $top -parentNode] $doc } -cleanup $CLEANUP -result 1 test node-3.4.1 {configure -parentNode top} -setup $SETUP -body { compareNodes [$top configure -parentNode] $doc } -cleanup $CLEANUP -result 1 test node-3.5 {cget -parentNode document} -setup $SETUP -body { ::dom::node configure $doc -parentNode } -cleanup $CLEANUP -result {} test node-3.6 {configure -parentNode leaf} -setup $SETUP -body { compareNodes [::dom::node configure $child1 -parentNode] $top } -cleanup $CLEANUP -result 1 test node-3.6.1 {configure -parentNode leaf} -setup $SETUP -body { compareNodes [$child1 configure -parentNode] $top } -cleanup $CLEANUP -result 1 test node-3.7 {configure -parentNode readonly} -constraints {dom_c} -setup $SETUP -body { expectError { ::dom::node configure $top -parentNode XXX } } -cleanup $CLEANUP -result {no modification allowed error: an attempt was made to modify an object\ where modifications are not allowed} test node-3.7 {configure -parentNode readonly} -constraints {dom_tcl||dom_libxml2} -setup $SETUP -body { expectError { ::dom::node configure $top -parentNode XXX } } -cleanup $CLEANUP -result {attribute "-parentNode" is read-only} test node-3.7.1 {configure -parentNode readonly} -constraints {dom_tcl||dom_libxml2} -setup $SETUP -body { expectError { $top configure -parentNode XXX } } -cleanup $CLEANUP -result {attribute "-parentNode" is read-only} test node-4.1 {cget -childNodes} -setup { eval $SETUP } -body { upvar 0 [::dom::node cget $doc -childNodes] childlist compareNodeList [set childlist] [list $top] } -cleanup { unset childlist eval $CLEANUP } -result 1 test node-4.2 {cget -childNodes top} -setup $SETUP -body { upvar 0 [::dom::node cget $top -childNodes] childlist compareNodeList $childlist [list $child1 $child2 $child3] } -cleanup $CLEANUP -result 1 test node-4.2.1 {cget -childNodes top} -setup $SETUP -body { upvar 0 [$top cget -childNodes] childlist compareNodeList $childlist [list $child1 $child2 $child3] } -cleanup $CLEANUP -result 1 test node-4.3 {cget -childNodes leaf} -setup $SETUP -body { upvar 0 [::dom::node cget $child1 -childNodes] childlist llength $childlist } -cleanup $CLEANUP -result 0 test node-4.3.1 {cget -childNodes leaf} -setup $SETUP -body { upvar 0 [$child1 cget -childNodes] childlist llength $childlist } -cleanup $CLEANUP -result 0 test node-4.4 {cget -childNodes textNode} -setup $SETUP -body { upvar 0 [::dom::node cget $child2 -childNodes] childlist llength $childlist } -cleanup $CLEANUP -result 0 test node-4.4.1 {cget -childNodes textNode} -setup $SETUP -body { upvar 0 [$child2 cget -childNodes] childlist llength $childlist } -cleanup $CLEANUP -result 0 test node-4.5 {configure -childNodes} -setup $SETUP -body { upvar 0 [::dom::node configure $doc -childNodes] childlist compareNodeList $childlist [list $top] } -cleanup $CLEANUP -result 1 test node-4.6 {configure -childNodes top} -setup $SETUP -body { upvar 0 [::dom::node cget $top -childNodes] childlist compareNodeList $childlist [list $child1 $child2 $child3] } -cleanup $CLEANUP -result 1 test node-4.6.1 {configure -childNodes top} -setup $SETUP -body { upvar 0 [$top cget -childNodes] childlist compareNodeList $childlist [list $child1 $child2 $child3] } -cleanup $CLEANUP -result 1 test node-4.6.2 {node children} -setup $SETUP -body { set children [::dom::node children $top] compareNodeList $children [list $child1 $child2 $child3] } -cleanup $CLEANUP -result 1 test node-4.6.3 {node children} -setup $SETUP -body { set children [$top children] compareNodeList $children [list $child1 $child2 $child3] } -cleanup $CLEANUP -result 1 test node-4.7 {cget -childNodes leaf} -setup $SETUP -body { set [::dom::node configure $child1 -childNodes] } -cleanup $CLEANUP -result {} test node-4.7.1 {cget -childNodes leaf} -setup $SETUP -body { set [$child1 configure -childNodes] } -cleanup $CLEANUP -result {} test node-4.8 {cget -childNodes textNode} -setup $SETUP -body { set [::dom::node configure $child2 -childNodes] } -cleanup $CLEANUP -result {} test node-4.8.1 {cget -childNodes textNode} -setup $SETUP -body { set [$child2 configure -childNodes] } -cleanup $CLEANUP -result {} test node-4.9 {configure -childNodes readonly} -constraints {dom_c} -setup $SETUP -body { expectError { ::dom::node configure $top -childNodes XXX } } -cleanup $CLEANUP -result {no modification allowed error: an attempt was made to modify an object\ where modifications are not allowed} test node-4.9 {configure -childNodes readonly} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { expectError { ::dom::node configure $top -childNodes XXX } } -cleanup $CLEANUP -result {attribute "-childNodes" is read-only} test node-4.9.1 {configure -childNodes readonly} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { expectError { $top configure -childNodes XXX } } -cleanup $CLEANUP -result {attribute "-childNodes" is read-only} test node-4.10 {cget -childNodes textNode} -setup $SETUP -body { # bug 3528 proc testChildNode {child} { set cl [::dom::node cget $child -childNodes] set $cl } testChildNode $child2 } -cleanup $CLEANUP -result {} test node-4.10.1 {cget -childNodes textNode} -setup $SETUP -body { proc testChildNode {child} { set cl [$child cget -childNodes] set $cl } testChildNode $child2 } -cleanup $CLEANUP -result {} test node-4.11 {cget -childNodes textNode} -setup $SETUP -body { # bug 3529 set cl [::dom::node cget $child2 -childNodes] set what [namespace which -variable $cl] set result [string range $what 0 6] } -cleanup $CLEANUP -result {::dom::} test node-5.1 {cget -firstChild} -setup $SETUP -body { compareNodes [::dom::node cget $top -firstChild] $child1 } -cleanup $CLEANUP -result 1 test node-5.1.1 {cget -firstChild} -setup $SETUP -body { compareNodes [$top cget -firstChild] $child1 } -cleanup $CLEANUP -result 1 test node-5.2 {cget -firstChild document} -setup $SETUP -body { compareNodes [::dom::node cget $doc -firstChild] $top } -cleanup $CLEANUP -result 1 test node-5.3 {configure -firstChild} -setup $SETUP -body { compareNodes [::dom::node configure $top -firstChild] $child1 } -cleanup $CLEANUP -result 1 test node-5.3.1 {configure -firstChild} -setup $SETUP -body { compareNodes [$top configure -firstChild] $child1 } -cleanup $CLEANUP -result 1 test node-5.4 {configure -firstChild document} -setup $SETUP -body { compareNodes [::dom::node configure $doc -firstChild] $top } -cleanup $CLEANUP -result 1 test node-5.5 {configure -firstChild readonly} -constraints {dom_c} -setup $SETUP -body { expectError { ::dom::node configure $top -firstChild XXX } } -cleanup $CLEANUP -result {no modification allowed error: an attempt was made to modify an object\ where modifications are not allowed} test node-5.5 {configure -firstChild readonly} -constraints {dom_tcl} -setup $SETUP -body { expectError { ::dom::node configure $top -firstChild XXX } } -cleanup $CLEANUP -result {attribute "-firstChild" is read-only} test node-5.5.1 {configure -firstChild readonly} -constraints {dom_tcl} -setup $SETUP -body { expectError { $top configure -firstChild XXX } } -cleanup $CLEANUP -result {attribute "-firstChild" is read-only} test node-6.1 {cget -lastChild} -setup $SETUP -body { compareNodes [::dom::node cget $top -lastChild] $child3 } -cleanup $CLEANUP -result 1 test node-6.1 {cget -lastChild} -setup $SETUP -body { compareNodes [$top cget -lastChild] $child3 } -cleanup $CLEANUP -result 1 test node-6.2 {cget -lastChild document} -setup $SETUP -body { compareNodes [::dom::node cget $doc -lastChild] $top } -cleanup $CLEANUP -result 1 test node-6.3 {configure -lastChild} -setup $SETUP -body { compareNodes [::dom::node configure $top -lastChild] $child3 } -cleanup $CLEANUP -result 1 test node-6.3.1 {configure -lastChild} -setup $SETUP -body { compareNodes [$top configure -lastChild] $child3 } -cleanup $CLEANUP -result 1 test node-6.4 {configure -lastChild document} -setup $SETUP -body { compareNodes [::dom::node configure $doc -lastChild] $top } -cleanup $CLEANUP -result 1 test node-6.5 {configure -lastChild readonly} -constraints {dom_c} -setup $SETUP -body { expectError { ::dom::node configure $top -lastChild XXX } } -cleanup $CLEANUP -result {no modification allowed error: an attempt was made to modify an object\ where modifications are not allowed} test node-6.5 {configure -lastChild readonly} -constraints {dom_tcl} -setup $SETUP -body { expectError { ::dom::node configure $top -lastChild XXX } } -cleanup $CLEANUP -result {attribute "-lastChild" is read-only} test node-7.1 {cget -previousSibling first} -setup $SETUP -body { ::dom::node cget $child1 -previousSibling } -cleanup $CLEANUP -result {} test node-7.1.1 {cget -previousSibling first} -setup $SETUP -body { $child1 cget -previousSibling } -cleanup $CLEANUP -result {} test node-7.2 {cget -previousSibling last} -setup $SETUP -body { compareNodes [::dom::node cget $child3 -previousSibling] $child2 } -cleanup $CLEANUP -result 1 test node-7.2 {cget -previousSibling last} -setup $SETUP -body { compareNodes [$child3 cget -previousSibling] $child2 } -cleanup $CLEANUP -result 1 test node-7.3 {configure -previousSibling first} -setup $SETUP -body { ::dom::node configure $child1 -previousSibling } -cleanup $CLEANUP -result {} test node-7.3.1 {configure -previousSibling first} -setup $SETUP -body { $child1 configure -previousSibling } -cleanup $CLEANUP -result {} test node-7.4 {configure -previousSibling last} -setup $SETUP -body { compareNodes [::dom::node configure $child3 -previousSibling] $child2 } -cleanup $CLEANUP -result 1 test node-7.4.1 {configure -previousSibling last} -setup $SETUP -body { compareNodes [$child3 configure -previousSibling] $child2 } -cleanup $CLEANUP -result 1 test node-7.5 {configure -previousSibling readonly} -constraints {dom_c} -setup $SETUP -body { expectError { ::dom::node configure $top -previousSibling XXX } } -cleanup $CLEANUP -result {no modification allowed error: an attempt was made to modify an object\ where modifications are not allowed} test node-7.5 {configure -previousSibling readonly} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { expectError { ::dom::node configure $top -previousSibling XXX } } -cleanup $CLEANUP -result {attribute "-previousSibling" is read-only} test node-8.1 {cget -nextSibling first} -setup $SETUP -body { compareNodes [::dom::node cget $child1 -nextSibling] $child2 } -cleanup $CLEANUP -result 1 test node-8.1.1 {cget -nextSibling first} -setup $SETUP -body { compareNodes [$child1 cget -nextSibling] $child2 } -cleanup $CLEANUP -result 1 test node-8.2 {cget -nextSibling last} -setup $SETUP -body { ::dom::node cget $child3 -nextSibling } -cleanup $CLEANUP -result {} test node-8.2.1 {cget -nextSibling last} -setup $SETUP -body { $child3 cget -nextSibling } -cleanup $CLEANUP -result {} test node-8.3 {configure -nextSibling first} -setup $SETUP -body { compareNodes [::dom::node configure $child1 -nextSibling] $child2 } -cleanup $CLEANUP -result 1 test node-8.3.1 {configure -nextSibling first} -setup $SETUP -body { compareNodes [$child1 configure -nextSibling] $child2 } -cleanup $CLEANUP -result 1 test node-8.4 {configure -nextSibling last} -setup $SETUP -body { ::dom::node configure $child3 -nextSibling } -cleanup $CLEANUP -result {} test node-8.4.1 {configure -nextSibling last} -setup $SETUP -body { $child3 configure -nextSibling } -cleanup $CLEANUP -result {} test node-8.5 {configure -nextSibling readonly} -constraints {dom_c} -setup $SETUP -body { expectError { ::dom::node configure $top -nextSibling XXX } } -cleanup $CLEANUP -result {no modification allowed error: an attempt was made to modify an object\ where modifications are not allowed} test node-8.5 {configure -nextSibling readonly} -constraints {dom_tcl} -setup $SETUP -body { expectError { ::dom::node configure $top -nextSibling XXX } } -cleanup $CLEANUP -result {attribute "-nextSibling" is read-only} test node-8.5.1 {configure -nextSibling readonly} -constraints {dom_tcl} -setup $SETUP -body { expectError { $top configure -nextSibling XXX } } -cleanup $CLEANUP -result {attribute "-nextSibling" is read-only} test node-9.1 {cget -attributes} -setup $SETUP -body { array get [::dom::node cget $top -attributes] } -cleanup $CLEANUP -result {} test node-9.1.1 {cget -attributes} -setup $SETUP -body { array get [$top cget -attributes] } -cleanup $CLEANUP -result {} test node-9.2 {configure -attributes} -setup $SETUP -body { array get [::dom::node configure $top -attributes] } -cleanup $CLEANUP -result {} test node-9.2.1 {configure -attributes} -setup $SETUP -body { array get [$top configure -attributes] } -cleanup $CLEANUP -result {} variable SETUP9 { set doc [dom::parse "Some Text\nMore Text\nText\n"] set top [::dom::document cget $doc -documentElement] } test node-9.4 {cget -attributes} -setup $SETUP9 -body { set attrArray [::dom::node cget $top -attributes] lsort [array names $attrArray] } -cleanup $CLEANUP -result {a b} test node-9.4.1 {cget -attributes} -setup $SETUP9 -body { set attrArray [$top cget -attributes] lsort [array names $attrArray] } -cleanup $CLEANUP -result {a b} test node-9.5 {configure -attributes} -setup $SETUP9 -body { set attrArray [::dom::node cget $top -attributes] lsort [array names $attrArray] } -cleanup $CLEANUP -result {a b} test node-9.5.1 {configure -attributes} -setup $SETUP9 -body { set attrArray [$top cget -attributes] lsort [array names $attrArray] } -cleanup $CLEANUP -result {a b} test node-9.6 {cget -attributes} -setup $SETUP9 -body { set attrArray [::dom::node cget $top -attributes] set result {} upvar 0 $attrArray attr foreach name [lsort [array names $attrArray]] { lappend result $name $attr($name) } set result } -cleanup $CLEANUP -result {a 123 b 456} test node-9.6.1 {cget -attributes} -setup $SETUP9 -body { set attrArray [$top cget -attributes] set result {} upvar 0 $attrArray attr foreach name [lsort [array names $attrArray]] { lappend result $name $attr($name) } set result } -cleanup $CLEANUP -result {a 123 b 456} test node-9.7 {configure -attributes} -setup $SETUP9 -body { set attrArray [::dom::node cget $top -attributes] set result {} upvar 0 $attrArray attr foreach name [lsort [array names $attrArray]] { lappend result $name $attr($name) } set result } -cleanup $CLEANUP -result {a 123 b 456} test node-9.7.1 {configure -attributes} -setup $SETUP9 -body { set attrArray [$top cget -attributes] set result {} upvar 0 $attrArray attr foreach name [lsort [array names $attrArray]] { lappend result $name $attr($name) } set result } -cleanup $CLEANUP -result {a 123 b 456} variable SETUP98 { set doc [dom::parse {foo}] set top [::dom::document cget $doc -documentElement] } test node-9.8 {cget -attributes} -setup $SETUP98 -body { set attrArray [::dom::node cget $top -attributes] set result {} upvar 0 $attrArray attr foreach name [lsort [array names $attrArray]] { lappend result $name $attr($name) } set result } -cleanup $CLEANUP -result {v1 ok1 v2 ok2} test node-9.8.1 {cget -attributes} -setup $SETUP98 -body { set attrArray [$top cget -attributes] set result {} upvar 0 $attrArray attr foreach name [lsort [array names $attrArray]] { lappend result $name $attr($name) } set result } -cleanup $CLEANUP -result {v1 ok1 v2 ok2} test node-9.9 {configure -attributes} -setup $SETUP98 -body { set attrArray [::dom::node configure $top -attributes] set result {} upvar 0 $attrArray attr foreach name [lsort [array names $attrArray]] { lappend result $name $attr($name) } set result } -cleanup $CLEANUP -result {v1 ok1 v2 ok2} test node-9.9.1 {configure -attributes} -setup $SETUP98 -body { set attrArray [$top configure -attributes] set result {} upvar 0 $attrArray attr foreach name [lsort [array names $attrArray]] { lappend result $name $attr($name) } set result } -cleanup $CLEANUP -result {v1 ok1 v2 ok2} # Discuss this with Joe English. # Destroying the document will destroy the namespace that contains the # attribute variable, so this script should result in an error. # NB. If the application wants to save the attributes and their values # then it should copy them to its own (array) variable. (FAQ topic) test node-9.10 {cget -attributes not global} -constraints {knownBug} -setup { proc xx {} { variable SETUP98 eval $SETUP98 set attrArray [::dom::node cget $top -attributes] dom::destroy $doc return [lsort [array get $attrArray]] } xx } -cleanup { rename xx {} } -result {ok1 ok2 v1 v2} test node-9.11 {cget -attributes not global} -setup $SETUP -body { # bug 3529 proc xx {} { variable SETUP98 variable top eval $SETUP98 set attrArray [::dom::node cget $top -attributes] return [lsort [array get $attrArray]] } proc xx2 {v} { return [lsort [array get $v]] } set r1 [xx] set attrArray [::dom::node cget $top -attributes] set r2 [lsort [array get $attrArray]] set r3 [xx2 $attrArray] list $r1 $r2 $r3 } -cleanup { dom::destroy [$top cget -ownerDocument] rename xx {} rename xx2 {} } -result {{ok1 ok2 v1 v2} {ok1 ok2 v1 v2} {ok1 ok2 v1 v2}} # See comments for node-9.10 test node-9.12 {configure -attributes not global} -constraints {knownBug} -setup $SETUP -body { proc xx {} { variable SETUP98 eval $SETUP98 set attrArray [::dom::node configure $top -attributes] dom::destroy $doc return [lsort [array get $attrArray]] } xx } -cleanup { rename xx {} } -result {ok1 ok2 v1 v2} test node-9.13 {configure -attributes readonly} -constraints {dom_c} -setup $SETUP -body { expectError { ::dom::node configure $top -attributes XXX } } -cleanup $CLEANUP -result {no modification allowed error: an attempt was made to modify an object\ where modifications are not allowed} test node-9.13 {configure -attributes readonly} -constraints {dom_tcl} -setup $SETUP -body { expectError { ::dom::node configure $top -attributes XXX } } -cleanup $CLEANUP -result {attribute "-attributes" is read-only} test node-9.13.1 {configure -attributes readonly} -constraints {dom_tcl} -setup $SETUP -body { expectError { $top configure -attributes XXX } } -cleanup $CLEANUP -result {attribute "-attributes" is read-only} test node-10.1 {cget -nodeValue} -setup $SETUP -body { ::dom::node cget $top -nodeValue } -cleanup $CLEANUP -result {} test node-10.1.1 {cget -nodeValue} -setup $SETUP -body { $top cget -nodeValue } -cleanup $CLEANUP -result {} test node-10.2 {cget -nodeValue text} -setup $SETUP -body { ::dom::node cget $child2 -nodeValue } -cleanup $CLEANUP -result Child2 test node-10.2.1 {cget -nodeValue text} -setup $SETUP -body { $child2 cget -nodeValue } -cleanup $CLEANUP -result Child2 test node-10.3 {configure -nodeValue} -setup $SETUP -body { ::dom::node configure $top -nodeValue } -cleanup $CLEANUP -result {} test node-10.3.1 {configure -nodeValue} -setup $SETUP -body { $top configure -nodeValue } -cleanup $CLEANUP -result {} test node-10.4 {configure -nodeValue text} -setup $SETUP -body { ::dom::node configure $child2 -nodeValue } -cleanup $CLEANUP -result Child2 test node-10.4.1 {configure -nodeValue text} -setup $SETUP -body { $child2 configure -nodeValue } -cleanup $CLEANUP -result Child2 # According to the DOM spec attributes which have obvious mapping to the node type, # ie nodeValue for Element nodes, return NULL for the value rather than an error. test node-10.5 {configure -nodeValue readonly for elements} -constraints {dom_c && knownBug} -setup $SETUP -body { expectError { ::dom::node configure $top -nodeValue XXX } } -cleanup $CLEANUP -result {no modification allowed error: an attempt was made to modify an object\ where modifications are not allowed} test node-10.5 {configure -nodeValue readonly for elements} -constraints {dom_tcl||dom_libxml2} -setup $SETUP -body { ::dom::node configure $top -nodeValue XXX } -cleanup $CLEANUP -result {} test node-10.5.1 {configure -nodeValue readonly for elements} -constraints {dom_tcl||dom_libxml2} -setup $SETUP -body { $top configure -nodeValue XXX } -cleanup $CLEANUP -result {} test node-10.6 {configure -nodeValue writable for text nodes} -setup $SETUP -body { set result1 [catch {::dom::node configure $child2 -nodeValue XXX} msg1] set result2 [catch {::dom::node configure $child2 -nodeValue} msg2] list $result1 $msg1 $result2 $msg2 } -cleanup $CLEANUP -result {0 {} 0 XXX} variable SETUP11 { eval $SETUP set branchA [$top appendChild [dom::document createElement $top BranchA]] set branchB [$top appendChild [dom::document createElement $top BranchB]] set new [$branchA appendChild [dom::document createElement $branchA MoveMe]] set ref [$branchB appendChild [dom::document createElement $branchB Reference]] } test node-11.1 {insertBefore, different parent} -setup $SETUP11 -body { ::dom::node insertBefore $branchB $new $ref # new should now have branchB as parent # branchA should have no children # branchB should have children {$new $ref} list [compareNodes [dom::node cget $new -parentNode] $branchB] \ [dom::node children $branchA] \ [compareNodeList [dom::node children $branchB] [list $new $ref]] } -cleanup $CLEANUP -result [list 1 {} 1] test node-11.2 {insertBefore, same parent} -setup $SETUP11 -body { ::dom::node insertBefore $branchB $new $ref ::dom::node insertBefore $branchB $ref $new # ref should still have branchB as its parent # branchB should have children {$ref $new} list [compareNodes [dom::node cget $ref -parentNode] $branchB] \ [compareNodeList [dom::node children $branchB] [list $ref $new]] } -cleanup $CLEANUP -result [list 1 1] test node-11.3 {insertBefore, no ref child given, node with no children} -setup $SETUP11 -body { ::dom::node insertBefore $branchB $new $ref ::dom::node insertBefore $branchB $ref $new ::dom::node insertBefore $branchA $new # new should have parent branchA # branchA should have child new # branchB should have only child ref list [compareNodes [dom::node cget $new -parentNode] $branchA] \ [compareNodeList [dom::node children $branchA] [list $new]] \ [compareNodeList [dom::node children $branchB] [list $ref]] } -cleanup $CLEANUP -result [list 1 1 1] test node-11.4 {insertBefore, no ref child given, node with children} -setup $SETUP11 -body { ::dom::node insertBefore $branchB $new $ref ::dom::node insertBefore $branchB $ref $new ::dom::node insertBefore $branchA $new ::dom::node insertBefore $branchA $ref # ref should have parent branchA # branchA should have children {$new $ref} # branchB should have no children list [compareNodes [dom::node cget $ref -parentNode] $branchA] \ [compareNodeList [dom::node children $branchA] [list $new $ref]] \ [dom::node children $branchB] } -cleanup $CLEANUP -result [list 1 1 {}] # TODO: test using node command, ie. $branchB insertBefore ... variable SETUP12 { eval $SETUP set parent [$top appendChild [dom::document createElement $top Remove]] set n1 [$parent appendChild [dom::document createTextNode $parent {Leave me alone}]] set rem [$parent appendChild [dom::document createElement $parent RemoveMe]] set n2 [$parent appendChild [dom::document createTextNode $parent {Leave me alone}]] } # test node-12.0 obsolete test node-12.1 {removeChild} -setup $SETUP12 -body { set oldchild [::dom::node removeChild $parent $rem] list [compareNodes $oldchild $rem] \ [compareNodeList [::dom::node children $parent] [list $n1 $n2]] \ [::dom::node children $oldchild] } -cleanup $CLEANUP -result [list 1 1 {}] test node-12.1.1 {removeChild} -setup $SETUP12 -body { set oldchild [$parent removeChild $rem] list [compareNodes $oldchild $rem] \ [compareNodeList [::dom::node children $parent] [list $n1 $n2]] \ [::dom::node children $oldchild] } -cleanup $CLEANUP -result [list 1 1 {}] test node-12.2 {removeChild: error, wrong num args} -setup $SETUP -match glob -body { expectError { ::dom::node removeChild $top } } -cleanup $CLEANUP -result {wrong # args: *} test node-12.2.1 {removeChild: error, wrong num args} -setup $SETUP -match glob -body { expectError { $top removeChild } } -cleanup $CLEANUP -result {wrong # args: *} test node-12.3 {removeChild: error, wrong num args} -setup $SETUP -match glob -body { expectError { ::dom::node removeChild $top $child1 $child3 } } -cleanup $CLEANUP -result {wrong # args: *} test node-12.3.1 {removeChild: error, wrong num args} -setup $SETUP -match glob -body { expectError { $top removeChild $child1 $child3 } } -cleanup $CLEANUP -result {wrong # args: *} test node-12.4 {removeChild: error, not a child} -setup $SETUP12 -match regexp -body { expectError { ::dom::node removeChild $doc $rem } } -cleanup $CLEANUP -result {^(document must have document element.*)|(not found.*)|(node "[^"]*" is not a child)} test node-12.5 {removeChild: error, not a child} -setup $SETUP12 -match regexp -body { expectError { ::dom::node removeChild $top $rem } } -cleanup $CLEANUP -result {(not found.*)|(node "[^"]*" is not a child)} test node-12.5.1 {removeChild: error, not a child} -setup $SETUP12 -match regexp -body { expectError { $top removeChild $rem } } -cleanup $CLEANUP -result {(not found.*)|(node "[^"]*" is not a child)} variable SETUP13 { eval $SETUP set branchA [$top appendChild [dom::document createElement $top ReplaceA]] set branchB [$top appendChild [dom::document createElement $top ReplaceB]] set new [$branchA appendChild [dom::document createElement $branchA MoveMe]] set replace [$branchB appendChild [dom::document createElement $branchB ReplaceMe]] } test node-13.1 {replaceChild} -setup $SETUP13 -body { set replaced [::dom::node replaceChild $branchB $new $replace] # replace becomes orphaned (no parent) # new has parent branchB # branchB has children {$new} # branchA has no children # returns $replace list [expr {[::dom::node cget $replace -parentNode] == {} ? 1 : [::dom::node isSameNode $doc [::dom::node cget $replace -parentNode]]}] \ [compareNodes [::dom::node cget $new -parentNode] $branchB ] \ [compareNodeList [::dom::node children $branchB] [list $new]] \ [::dom::node children $branchA] \ [$replace isSameNode $replaced] \ ; } -cleanup $CLEANUP -result [list 1 1 1 {} 1] variable SETUP14 { eval $SETUP set branchA [$top appendChild [dom::document createElement $top AppendA]] set branchB [$top appendChild [dom::document createElement $top AppendB]] set node [$branchA appendChild [dom::document createElement $branchA MoveMe]] set after [$branchB appendChild [dom::document createElement $branchB AfterMe]] } test node-14.1 {appendChild} -setup $SETUP14 -body { ::dom::node appendChild $branchB $node # node should have parent branchB # Branch A should have no children # Branch B should have children: {$after $node} list [compareNodes [::dom::node cget $node -parentNode] $branchB] \ [::dom::node children $branchA] \ [compareNodeList [::dom::node children $branchB] [list $after $node]] \ ; } -cleanup $CLEANUP -result [list 1 {} 1] test node-14.2 {appendChild return value} -setup { set doc [dom::create] set top [dom::document createElement $doc Top] set node [dom::document createElement $top Child] } -body { $node isSameNode [dom::node appendChild $top $node] } -cleanup $CLEANUP -result 1 test node-14.2.1 {appendChild return value} -setup { set doc [dom::create] set top [dom::document createElement $doc Top] set node [dom::document createElement $top Child] } -body { $node isSameNode [$top appendChild $node] } -cleanup $CLEANUP -result 1 test node-14.3 {appendChild - document element} -setup { set doc [dom::create] set top [$doc createElement Top] } -body { $top isSameNode [dom::node appendChild $doc $top] } -cleanup $CLEANUP -result 1 # cloneNode tests are disabled for libxml2 as it cannot serialize # a node (only an entire document). variable SETUP15 { eval $SETUP set cloneNode [$top appendChild [dom::document createElement $top Clone]] set clone1 [$cloneNode appendChild [dom::document createElement $cloneNode Nested]] ;#{id one} set clone2 [$cloneNode appendChild [dom::document createElement $cloneNode Nested]] ;#{id two} $cloneNode appendChild [dom::document createElement $cloneNode Nested] ;#{id three} $clone1 appendChild [dom::document createTextNode $clone1 {text for node 1}] $clone2 appendChild [dom::document createTextNode $clone2 {text for node 2}] } # test node-15.1 obsolete test node-15.2 {cloneNode part 2} -constraints {!dom_libxml2} -setup $SETUP15 -body { set cloned [dom::node cloneNode $cloneNode -deep yes] set orig [dom::DOMImplementation serialize $cloneNode] set new [dom::DOMImplementation serialize $cloned] list [string compare $orig $new] [dom::node parent $cloned] } -cleanup $CLEANUP -result {0 {}} test node-15.3 {cloneNode of document} -constraints {!dom_libxml2} -setup { set doc1 [dom::parse {foo}] } -body { set doc2 [dom::node cloneNode $doc1 -deep 1] set sdoc1 [dom::DOMImplementation serialize $doc1] set sdoc2 [dom::DOMImplementation serialize $doc2] string compare $sdoc1 $sdoc2 } -cleanup { dom::destroy $doc1 } -result {0} variable SETUP16 { set doc [dom::parse "Some Text\nMore Text\nText\n"] set top [::dom::document cget $doc -documentElement] } test node-16.1 {cget -startLine} -constraints {dom_c} -setup $SETUP16 -body { ::dom::node cget $top -startLine } -cleanup $CLEANUP -result 1 test node-16.2 {cget -endLine} -constraints {dom_c} -setup $SETUP16 -body { ::dom::node cget $top -endLine } -cleanup $CLEANUP -result 4 test node-16.3 {cget -startColumn} -constraints {dom_c} -setup { set doc [dom::parse "Some Text\nMore Text\nText\n"] set top [::dom::document cget $doc -documentElement] } -body { ::dom::node cget $top -startColumn } -cleanup $CLEANUP -result 8 test node-16.4 {cget -endColumn} -constraints {dom_c} -setup { set doc [dom::parse "Some Text\nMore Text\nText\nXXX"] set top [::dom::document cget $doc -documentElement] } -body { ::dom::node cget $top -endColumn } -cleanup $CLEANUP -result 3 test node-16.5 {cget -startWidth} -constraints {dom_c} -setup { set doc [dom::parse "Some Text\nMore Text\nText\nXXX"] set top [::dom::document cget $doc -documentElement] } -body { ::dom::node cget $top -startWidth } -cleanup $CLEANUP -result 10 test node-16.6 {cget -endWidth} -constraints {dom_c} -setup { set doc [dom::parse "Some Text\nMore Text\nText\nXXX"] set top [::dom::document cget $doc -documentElement] } -body { ::dom::node cget $top -endWidth } -cleanup $CLEANUP -result 11 # documentFragment tests have been disabled for libxml2 because # libxml2-2.5.1 (and earlier) appears to have a bug in serialising # a document containing a document fragment. variable SETUP17 { set doc [::dom::DOMImplementation create] set top [::dom::document createElement $doc top] ::dom::node appendChild $doc $top set fragment [::dom::document createDocumentFragment $doc] } test node-17.1 {document fragments} -constraints {!dom_libxml2} -setup $SETUP17 -body { set text [::dom::document createTextNode $doc \ "Now is the time for all good men to come to the aid of their party"] ::dom::node appendChild $fragment $text ::dom::node appendChild $top $fragment ::dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result { Now is the time for all good men to come to the aid of their party} test node-17.2 {document fragment append with multiple text children} -constraints {!dom_libxml2} -setup $SETUP17 -body { foreach xx {abc def ghi jkl mno} { set text [::dom::document createTextNode $doc $xx] ::dom::node appendChild $fragment $text } ::dom::node appendChild $top $fragment ::dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result { abcdefghijklmno} test node-17.3 {document fragment append with multiple children} -constraints {!dom_libxml2} -setup $SETUP17 -body { foreach xx {abc def ghi jkl} { set child [::dom::document createElement $doc [string toupper $xx]] set text [::dom::document createTextNode $doc $xx] ::dom::node appendChild $fragment $child ::dom::node appendChild $child $text } ::dom::node appendChild $top $fragment ::dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result { abcdefghijkl} test node-17.4 {document fragment insert} -constraints {!dom_libxml2} -setup $SETUP17 -body { foreach xx {abc jkl} { set child [::dom::document createElement $doc [string toupper $xx]] set text [::dom::document createTextNode $doc $xx] ::dom::node appendChild $fragment $child ::dom::node appendChild $child $text } ::dom::node appendChild $top $fragment set fragment [::dom::document createDocumentFragment $doc] foreach xx {def ghi} { set child2 [::dom::document createElement $doc [string toupper $xx]] set text [::dom::document createTextNode $doc $xx] ::dom::node appendChild $fragment $child2 ::dom::node appendChild $child2 $text } ::dom::node insertBefore $top $fragment $child ::dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result { abcdefghijkl} test node-17.5 {document fragment replace} -constraints {!dom_libxml2} -setup $SETUP17 -body { foreach xx {abc def xxx} { set child [::dom::document createElement $doc [string toupper $xx]] set text [::dom::document createTextNode $doc $xx] ::dom::node appendChild $fragment $child ::dom::node appendChild $child $text } ::dom::node appendChild $top $fragment set fragment [::dom::document createDocumentFragment $doc] foreach xx {ghi jkl} { set child2 [::dom::document createElement $doc [string toupper $xx]] set text [::dom::document createTextNode $doc $xx] ::dom::node appendChild $fragment $child2 ::dom::node appendChild $child2 $text } ::dom::node replaceChild $top $fragment $child ::dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result { abcdefghijkl} test node-18.1 {cget -parsingComplete} -constraints {dom_c} -setup $SETUP -body { ::dom::node cget $top -parsingComplete } -cleanup $CLEANUP -result 1 test node-18.2 {cget -parsingComplete document} -constraints {dom_c} -setup $SETUP -body { ::dom::node cget $doc -parsingComplete } -cleanup $CLEANUP -result 1 test node-18.3 {configure -parsingComplete} -constraints {dom_c} -setup $SETUP -body { ::dom::node configure $top -parsingComplete } -cleanup $CLEANUP -result 1 test node-18.4 {configure -parsingComplete document} -constraints {dom_c} -setup $SETUP -body { ::dom::node configure $doc -parsingComplete } -cleanup $CLEANUP -result 1 test node-18.5 {configure -parsingComplete readonly} -constraints {dom_c} -setup $SETUP -body { expectError { ::dom::node configure $top -parsingComplete 1 } } -cleanup $CLEANUP -result {no modification allowed error: an attempt was made to modify an object\ where modifications are not allowed} test node-19.1 {isSameNode - too few arguments} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -match glob -body { expectError { ::dom::node isSameNode } } -cleanup $CLEANUP -result {wrong # args*} test node-19.2 {isSameNode - too few arguments} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -match glob -body { expectError { ::dom::node isSameNode $top } } -cleanup $CLEANUP -result {wrong # args*} test node-19.2.1 {isSameNode - too few arguments} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -match glob -body { expectError { $top isSameNode } } -cleanup $CLEANUP -result {wrong # args*} test node-19.3 {isSameNode - too many arguments} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -match glob -body { expectError { ::dom::node isSameNode $top $child1 $child2 } } -cleanup $CLEANUP -result {wrong # args*} test node-19.4 {isSameNode - same node} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { ::dom::node isSameNode $top $top } -cleanup $CLEANUP -result 1 test node-19.4.1 {isSameNode - same node} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { $top isSameNode $top } -cleanup $CLEANUP -result 1 test node-19.5 {isSameNode - different node} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { ::dom::node isSameNode $top $child1 } -cleanup $CLEANUP -result 0 test node-19.5.1 {isSameNode - different node} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { $top isSameNode $child1 } -cleanup $CLEANUP -result 0 test node-19.4 {isSameNode - same doc} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { ::dom::node isSameNode $doc $doc } -cleanup $CLEANUP -result 1 test node-19.5 {isSameNode - different doc} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { ::dom::node isSameNode $doc $top } -cleanup $CLEANUP -result 0 test node-20.1 {stringValue - argument parsing} -setup $SETUP -match glob -body { expectError { dom::node stringValue } } -cleanup $CLEANUP -result {wrong # args*} test node-20.2 {stringValue - argument parsing} -setup $SETUP -match glob -body { expectError { dom::node stringValue $top FooBar } } -cleanup $CLEANUP -result {wrong # args*} test node-20.3 {stringValue - element} -setup $SETUP -body { dom::node stringValue $top } -cleanup $CLEANUP -result Child2 test node-20.3.1 {stringValue - element} -setup $SETUP -body { $top stringValue } -cleanup $CLEANUP -result Child2 test node-20.4 {stringValue - textNode} -setup $SETUP -body { dom::node stringValue $child2 } -cleanup $CLEANUP -result Child2 test node-20.4.1 {stringValue - textNode} -setup $SETUP -body { $child2 stringValue } -cleanup $CLEANUP -result Child2 test node-20.5 {stringValue - document only containing text node} -setup { set doc [dom::create] set txt [dom::document createTextNode $doc {filename.xml}] dom::node appendChild $doc $txt } -body { dom::node stringValue $doc } -cleanup { dom::destroy $doc } -result {filename.xml} # TODO: test multiple text nodes, attribute nodes, comments, PIs test node-21.1 {id generation} -setup { eval $SETUP set idtop [$top cget -id] set id1 [$child1 cget -id] set id2 [$child2 cget -id] set id3 [$child3 cget -id] } -body { list [expr {$idtop == ""}] [expr {$child1 == ""}] [expr {$child2 == ""}] [expr {$child3 == ""}] [expr {$idtop != $child1}] [expr {$child1 != $child2}] [expr {$child2 != $child3}] } -cleanup $CLEANUP -result {0 0 0 0 1 1 1} cleanupTests } namespace delete ::dom::nodeTest return tclxml-3.3~svn11.orig/tests/tcldom/zzlast.test0000644000000000000000000000173511113705304020263 0ustar rootroot# Commands covered: ::dom::DOMimplementation parse # # This file contains a collection of tests for one or more of the # TclDOM commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # Copyright (c) 1998-2003 Zveno Pty Ltd. # Copyright (c) 2000 Ajuba Solutions # # $Id: zzlast.test,v 1.3 2003/12/03 20:18:45 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::zzlastTest { namespace import -force ::tcltest::* test zzlast-1.1 {cleanup after incomplete parse} -constraints {!dom_libxml2} -body { set part1 {} set part2 {} set result1 [catch {::dom::DOMImplementation parse $part1 -final 0} m1] catch {::dom::DOMImplementation destroy $m2} list $result1 } -result 0 cleanupTests } namespace delete ::dom::zzlastTest return tclxml-3.3~svn11.orig/tests/tcldom/document.test0000644000000000000000000005767611113705304020571 0ustar rootroot# Commands covered: ::dom::document # # This file contains a collection of tests for one or more of the # TclDOM commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # Copyright (c) 1998-2004 Zveno Pty Ltd. # # $Id: document.test,v 1.11 2004/02/25 20:10:30 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::documentTest { namespace import -force ::tcltest::* variable SETUP { set doc [::dom::create] set top [$doc createElement Test] ::dom::node appendChild $doc $top } variable CLEANUP { dom::destroy $doc } test document-1.1 {cget -doctype} -setup $SETUP -constraints {dom_c} -body { ::dom::document cget $doc -doctype } -cleanup $CLEANUP -result {} test document-1.1 {cget -doctype} -setup $SETUP -constraints {dom_tcl} -body { string equal [::dom::document cget $doc -doctype] {} } -cleanup $CLEANUP -result 0 test document-1.1.1 {cget -doctype} -setup $SETUP -constraints {dom_c} -body { $doc cget -doctype } -cleanup $CLEANUP -result {} test document-1.1.1 {cget -doctype} -setup $SETUP -constraints {dom_tcl} -body { string equal [$doc cget -doctype] {} } -cleanup $CLEANUP -result 0 test document-1.2 {cget -implementation} -setup $SETUP -constraints {dom_c} -body { ::dom::document cget $doc -implementation } -cleanup $CLEANUP -result {::dom::DOMImplementation} test document-1.2 {cget -implementation} -setup $SETUP -constraints {dom_tcl} -body { ::dom::document cget $doc -implementation } -cleanup $CLEANUP -result {::dom::tcl::DOMImplementation} test document-1.2.1 {cget -implementation} -setup $SETUP -constraints {dom_tcl} -body { $doc cget -implementation } -cleanup $CLEANUP -result {::dom::tcl::DOMImplementation} test document-1.2 {cget -implementation} -setup $SETUP -constraints {dom_libxml2} -body { ::dom::document cget $doc -implementation } -cleanup $CLEANUP -result {::dom::libxml2::DOMImplementation} test document-1.2.1 {cget -implementation} -setup $SETUP -constraints {dom_libxml2} -body { $doc cget -implementation } -cleanup $CLEANUP -result {::dom::libxml2::DOMImplementation} test document-1.3 {cget -documentElement} -body { set doc [dom::create] ::dom::document cget $doc -documentElement } -cleanup $CLEANUP -result {} test document-1.3.1 {cget -documentElement} -body { set doc [dom::create] $doc cget -documentElement } -cleanup $CLEANUP -result {} test document-1.4 {error: cget too few arguments} -setup $SETUP -match glob -body { expectError { ::dom::document cget $doc } } -cleanup $CLEANUP -result {wrong # args*} test document-1.4.1 {error: cget too few arguments} -setup $SETUP -match glob -body { expectError { $doc cget } } -cleanup $CLEANUP -result {wrong # args*} test document-1.5 {error: cget too many arguments} -setup $SETUP -match glob -body { expectError { ::dom::document cget $doc -foo bar } } -cleanup $CLEANUP -result {wrong # args*} test document-1.5.1 {error: cget too many arguments} -setup $SETUP -match glob -body { expectError { $doc cget -foo bar } } -cleanup $CLEANUP -result {wrong # args*} test document-1.6 {error: cget unknown option} -setup $SETUP -match glob -body { expectError { ::dom::document cget $doc -foo } } -cleanup $CLEANUP -result {bad option*} test document-1.6.1 {error: cget unknown option} -setup $SETUP -match glob -body { expectError { $doc cget -foo } } -cleanup $CLEANUP -result {bad option*} test document-1.7 {cget -version} -constraints {dom_tcl} -setup $SETUP -body { ::dom::document cget $doc -version } -cleanup $CLEANUP -result 1.0 test document-1.7.1 {cget -version} -constraints {dom_tcl} -setup $SETUP -body { $doc cget -version } -cleanup $CLEANUP -result 1.0 test document-2.1 {configure} -body { set doc [dom::create] ::dom::document configure $doc -documentElement } -cleanup $CLEANUP -result {} test document-2.1.1 {configure} -body { set doc [dom::create] $doc configure -documentElement } -cleanup $CLEANUP -result {} test document-2.2 {error: configure read-only option} -setup $SETUP -match glob -body { expectError { ::dom::document configure $doc -documentElement $doc } } -cleanup $CLEANUP -result {attribute * read-only} test document-2.2.1 {error: configure read-only option} -setup $SETUP -match glob -body { expectError { $doc configure -documentElement $doc } } -cleanup $CLEANUP -result {attribute * read-only} test document-2.3 {configure -version} -constraints {dom_tcl} -setup $SETUP -body { ::dom::document configure $doc -version 1.0 } -cleanup $CLEANUP -result {} test document-2.3.1 {configure -version} -constraints {dom_tcl} -setup $SETUP -body { $doc configure -version 1.0 } -cleanup $CLEANUP -result {} test document-2.4 {error: configure -version} -constraints {dom_tcl} -setup $SETUP -match glob -body { expectError { ::dom::document configure $doc -version 1.1 } } -cleanup $CLEANUP -result * test document-2.4.1 {error: configure -version} -constraints {dom_tcl} -setup $SETUP -match glob -body { expectError { $doc configure -version 1.1 } } -cleanup $CLEANUP -result * test document-2.5 {configure -encoding} -constraints {dom_tcl} -setup $SETUP -body { ::dom::document configure $doc -encoding ISO-8859-1 ::dom::document cget $doc -encoding } -cleanup $CLEANUP -result ISO-8859-1 test document-2.5.1 {configure -encoding} -constraints {dom_tcl} -setup $SETUP -body { $doc configure -encoding ISO-8859-1 $doc cget -encoding } -cleanup $CLEANUP -result ISO-8859-1 test document-2.6 {configure -standalone} -constraints {dom_tcl} -setup $SETUP -body { ::dom::document configure $doc -standalone 1 ::dom::document cget $doc -standalone } -cleanup $CLEANUP -result yes test document-2.6.1 {configure -standalone} -constraints {dom_tcl} -setup $SETUP -body { $doc configure -standalone 1 $doc cget -standalone } -cleanup $CLEANUP -result yes test document-3.1 {create document element} -body { set doc [dom::create] set top [::dom::document createElement $doc Test] ::dom::node appendChild $doc $top ok } -cleanup $CLEANUP -result {} test document-3.1.1 {create document element} -body { set doc [dom::create] set top [$doc createElement Test] ::dom::node appendChild $doc $top ok } -cleanup $CLEANUP -result {} test document-3.2 {element node type} -setup $SETUP -body { ::dom::node cget $top -nodeType } -cleanup $CLEANUP -result element test document-3.2.1 {element node type} -setup $SETUP -body { $top cget -nodeType } -cleanup $CLEANUP -result element test document-3.3 {element name} -setup $SETUP -body { ::dom::node cget $top -nodeName } -cleanup $CLEANUP -result Test test document-3.3.1 {element name} -setup $SETUP -body { $top cget -nodeName } -cleanup $CLEANUP -result Test test document-3.4 {document element set} -setup $SETUP -body { $top isSameNode [::dom::document cget $doc -documentElement] } -cleanup $CLEANUP -result 1 test document-3.4.1 {document element set} -setup $SETUP -body { $top isSameNode [$doc cget -documentElement] } -cleanup $CLEANUP -result 1 test document-3.5 {error: no element name} -setup $SETUP -match glob -body { expectError { ::dom::document createElement $doc } } -cleanup $CLEANUP -result {wrong # args*} test document-3.5.1 {error: no element name} -setup $SETUP -match glob -body { expectError { $doc createElement } } -cleanup $CLEANUP -result {wrong # args*} test document-3.6 {error: invalid element name} -setup $SETUP -match glob -body { expectError { ::dom::document createElement $top {Has Space} } } -cleanup $CLEANUP -result {invalid * name *} test document-3.6.1 {error: invalid element name} -constraints {not_implemented} -setup $SETUP -match glob -body { expectError { $top createElement {Has Space} } } -cleanup $CLEANUP -result {invalid * name *} test document-3.7 {error: too many arguments} -setup $SETUP -match glob -body { expectError { ::dom::document createElement $doc Foo Bar } } -cleanup $CLEANUP -result {wrong # args*} test document-3.7.1 {error: too many arguments} -constraints {not_implemented} -setup $SETUP -match glob -body { expectError { $doc createElement Foo Bar } } -cleanup $CLEANUP -result {wrong # args*} test document-3.8 {create node command} -setup { set doc [dom::create] set node [dom::document createElement $doc Test] } -body { string equal [info commands $node] {} } -result 0 -cleanup $CLEANUP test document-3.9 {create unconnected element} -setup { set doc [dom::create] set docel [dom::document createElement $doc Test] } -body { set new [$doc createElement New] ok } -result {} -cleanup $CLEANUP test document-4.1 {create documentFragment} -setup $SETUP -body { set frag [::dom::document createDocumentFragment $top] ok } -cleanup $CLEANUP -result {} test document-4.1.1 {create documentFragment} -setup $SETUP -body { set frag [$doc createDocumentFragment] ok } -cleanup $CLEANUP -result {} test document-4.2 {documentFragment node type} -setup $SETUP -body { set frag [::dom::document createDocumentFragment $top] ::dom::node cget $frag -nodeType } -cleanup $CLEANUP -result documentFragment test document-4.2.1 {documentFragment node type} -setup $SETUP -body { set frag [::dom::document createDocumentFragment $top] $frag cget -nodeType } -cleanup $CLEANUP -result documentFragment test document-4.3 {error: documentFragment too many arguments} -setup $SETUP -match glob -body { expectError { ::dom::document createDocumentFragment $top Foo } } -cleanup $CLEANUP -result {wrong # args*} test document-4.3.1 {error: documentFragment too many arguments} -constraints {not_implemented} -setup $SETUP -match glob -body { expectError { $doc createDocumentFragment Foo } } -cleanup $CLEANUP -result {wrong # args*} test document-5.1 {create textNode} -setup $SETUP -body { set text [::dom::document createTextNode $top {Sample Data}] ok; } -cleanup $CLEANUP -result {} test document-5.1.1 {create textNode} -setup $SETUP -body { set text [$doc createTextNode {Sample Data}] ok; } -cleanup $CLEANUP -result {} test document-5.2 {textNode node type} -setup $SETUP -body { set text [$doc createTextNode {Sample Data}] ::dom::node cget $text -nodeType } -cleanup $CLEANUP -result textNode test document-5.2.1 {textNode node type} -setup $SETUP -body { set text [$doc createTextNode {Sample Data}] $text cget -nodeType } -cleanup $CLEANUP -result textNode test document-5.3 {textNode node name} -setup $SETUP -body { set text [$doc createTextNode {Sample Data}] ::dom::node cget $text -nodeName } -cleanup $CLEANUP -result {#text} test document-5.3.1 {textNode node name} -setup $SETUP -body { set text [$doc createTextNode {Sample Data}] $text cget -nodeName } -cleanup $CLEANUP -result {#text} test document-5.4 {textNode node value} -setup $SETUP -body { set text [$doc createTextNode {Sample Data}] ::dom::node cget $text -nodeValue } -cleanup $CLEANUP -result {Sample Data} test document-5.4.1 {textNode node value} -setup $SETUP -body { set text [$doc createTextNode {Sample Data}] $text cget -nodeValue } -cleanup $CLEANUP -result {Sample Data} test document-5.5 {error: textNode too few arguments} -setup $SETUP -match glob -body { expectError { ::dom::document createTextNode $top } } -cleanup $CLEANUP -result {wrong # args*} test document-5.5.1 {error: textNode too few arguments} -setup $SETUP -match glob -body { expectError { $doc createTextNode } } -cleanup $CLEANUP -result {wrong # args*} test document-5.6 {error: textNode too many arguments} -setup $SETUP -match glob -body { expectError { ::dom::document createTextNode $top {More Sample Data} Foo } } -cleanup $CLEANUP -result {wrong # args*} test document-5.6.1 {error: textNode too many arguments} -setup $SETUP -match glob -body { expectError { $doc createTextNode {More Sample Data} Foo } } -cleanup $CLEANUP -result {wrong # args*} test document-6.1 {create comment} -setup $SETUP -body { set comm [::dom::document createComment $top {Comment Data}] ok; } -cleanup $CLEANUP -result {} test document-6.1.1 {create comment} -setup $SETUP -body { set comm [$doc createComment {Comment Data}] ok; } -cleanup $CLEANUP -result {} test document-6.2 {comment node type} -setup $SETUP -body { set comm [::dom::document createComment $top {Comment Data}] ::dom::node cget $comm -nodeType } -cleanup $CLEANUP -result comment test document-6.2.1 {comment node type} -setup $SETUP -body { set comm [::dom::document createComment $top {Comment Data}] $comm cget -nodeType } -cleanup $CLEANUP -result comment test document-6.3 {comment node name} -setup $SETUP -body { set comm [::dom::document createComment $top {Comment Data}] ::dom::node cget $comm -nodeName } -cleanup $CLEANUP -result {#comment} test document-6.3.1 {comment node name} -setup $SETUP -body { set comm [::dom::document createComment $top {Comment Data}] $comm cget -nodeName } -cleanup $CLEANUP -result {#comment} test document-6.4 {comment node value} -setup $SETUP -body { set comm [::dom::document createComment $top {Comment Data}] ::dom::node cget $comm -nodeValue } -cleanup $CLEANUP -result {Comment Data} test document-6.4.1 {comment node value} -setup $SETUP -body { set comm [::dom::document createComment $top {Comment Data}] $comm cget -nodeValue } -cleanup $CLEANUP -result {Comment Data} test document-6.5 {error: comment too few arguments} -setup $SETUP -match glob -body { expectError { ::dom::document createComment $top } } -cleanup $CLEANUP -result {wrong # args*} test document-6.5.1 {error: comment too few arguments} -setup $SETUP -match glob -body { expectError { $doc createComment } } -cleanup $CLEANUP -result {wrong # args*} test document-6.6 {error: comment too many arguments} -setup $SETUP -match glob -body { expectError { ::dom::document createComment $top {More Comment Data} Foo } } -cleanup $CLEANUP -result {wrong # args*} test document-6.6.1 {error: comment too many arguments} -setup $SETUP -match glob -body { expectError { $doc createComment {More Comment Data} Foo } } -cleanup $CLEANUP -result {wrong # args*} # dom::tcl and dom::libxml2 treat CDATA Sections as plain text test document-7.1 {create CDATASection} -setup $SETUP -body { set cdata [::dom::document createCDATASection $top {CDATASection }] ok } -cleanup $CLEANUP -result {} test document-7.1.1 {create CDATASection} -setup $SETUP -body { set cdata [$doc createCDATASection {CDATASection }] ok } -cleanup $CLEANUP -result {} test document-7.2 {CDATASection node type} -constraints {dom_c} -setup $SETUP -body { set cdata [::dom::document createCDATASection $top {CDATASection }] ::dom::node cget $cdata -nodeType } -cleanup $CLEANUP -result CDATASection test document-7.2 {CDATASection node type} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { set cdata [::dom::document createCDATASection $top {CDATASection }] ::dom::node cget $cdata -nodeType } -cleanup $CLEANUP -result textNode test document-7.2.1 {CDATASection node type} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { set cdata [::dom::document createCDATASection $top {CDATASection }] $cdata cget -nodeType } -cleanup $CLEANUP -result textNode test document-7.3 {CDATASection node name} -constraints {dom_c} -setup $SETUP -body { set cdata [::dom::document createCDATASection $top {CDATASection }] ::dom::node cget $cdata -nodeName } -cleanup $CLEANUP -result {#cdata-section} test document-7.3 {CDATASection node name} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { set cdata [::dom::document createCDATASection $top {CDATASection }] ::dom::node cget $cdata -nodeName } -cleanup $CLEANUP -result {#text} test document-7.3.1 {CDATASection node name} -constraints {dom_tcl || dom_libxml2} -setup $SETUP -body { set cdata [::dom::document createCDATASection $top {CDATASection }] $cdata cget -nodeName } -cleanup $CLEANUP -result {#text} test document-7.4 {CDATASection node value} -setup $SETUP -body { set cdata [::dom::document createCDATASection $top {CDATASection }] ::dom::node cget $cdata -nodeValue } -cleanup $CLEANUP -result {CDATASection } test document-7.4.1 {CDATASection node value} -setup $SETUP -body { set cdata [::dom::document createCDATASection $top {CDATASection }] $cdata cget -nodeValue } -cleanup $CLEANUP -result {CDATASection } test document-7.5 {error: CDATASection too few arguments} -setup $SETUP -match glob -body { expectError { ::dom::document createCDATASection $top } } -cleanup $CLEANUP -result {wrong # args*} test document-7.5.1 {error: CDATASection too few arguments} -setup $SETUP -match glob -body { expectError { $doc createCDATASection } } -cleanup $CLEANUP -result {wrong # args*} test document-7.6 {error: CDATASection too many arguments} -setup $SETUP -match glob -body { expectError { ::dom::document createCDATASection $top {More CDATA} Foo } } -cleanup $CLEANUP -result {wrong # args*} test document-7.6.1 {error: CDATASection too many arguments} -setup $SETUP -match glob -body { expectError { $doc createCDATASection {More CDATA} Foo } } -cleanup $CLEANUP -result {wrong # args*} test document-8.1 {create processingInstruction} -setup $SETUP -body { set pi [::dom::document createProcessingInstruction $top target {PI Data}] ok; } -cleanup $CLEANUP -result {} test document-8.1.1 {create processingInstruction} -setup $SETUP -body { set pi [$doc createProcessingInstruction target {PI Data}] ok; } -cleanup $CLEANUP -result {} test document-8.2 {processingInstruction node type} -setup $SETUP -body { set pi [::dom::document createProcessingInstruction $top target {PI Data}] ::dom::node cget $pi -nodeType } -cleanup $CLEANUP -result processingInstruction test document-8.2.1 {processingInstruction node type} -setup $SETUP -body { set pi [::dom::document createProcessingInstruction $top target {PI Data}] $pi cget -nodeType } -cleanup $CLEANUP -result processingInstruction test document-8.3 {processingInstruction node name} -setup $SETUP -body { set pi [::dom::document createProcessingInstruction $top target {PI Data}] ::dom::node cget $pi -nodeName } -cleanup $CLEANUP -result target test document-8.3.1 {processingInstruction node name} -setup $SETUP -body { set pi [::dom::document createProcessingInstruction $top target {PI Data}] $pi cget -nodeName } -cleanup $CLEANUP -result target test document-8.4 {processingInstruction node value} -setup $SETUP -body { set pi [::dom::document createProcessingInstruction $top target {PI Data}] ::dom::node cget $pi -nodeValue } -cleanup $CLEANUP -result {PI Data} test document-8.4.1 {processingInstruction node value} -setup $SETUP -body { set pi [::dom::document createProcessingInstruction $top target {PI Data}] $pi cget -nodeValue } -cleanup $CLEANUP -result {PI Data} test document-8.5 {error: processingInstruction too few arguments} -setup $SETUP -match glob -body { expectError { ::dom::document createProcessingInstruction $top } } -cleanup $CLEANUP -result {wrong # args*} test document-8.5.1 {error: processingInstruction too few arguments} -setup $SETUP -match glob -body { expectError { $doc createProcessingInstruction } } -cleanup $CLEANUP -result {wrong # args*} test document-8.6 {error: processingInstruction too many arguments} -setup $SETUP -match glob -body { expectError { ::dom::document createProcessingInstruction $top target data Extra } } -cleanup $CLEANUP -result {wrong # args*} test document-8.6.1 {error: processingInstruction too many arguments} -setup $SETUP -match glob -body { expectError { $doc createProcessingInstruction target data Extra } } -cleanup $CLEANUP -result {wrong # args*} # TBD: Attribute # TBD: EntityReference variable SETUP10 { set doc [dom::create] set top [$doc createElement Test] set child1 [$doc createElement Child1] $top appendChild $child1 set child2 [$doc createElement Child2] $top appendChild $child2 set child3 [$doc createElement Test] $top appendChild $child3 } test document-10.1 {getElementsByTagName - document element} \ -constraints {!dom_libxml2} -setup $SETUP -body { set docTestElements [::dom::document getElementsByTagName $doc Test] list [llength [set $docTestElements]] [$top isSameNode [lindex [set $docTestElements] 0]] } -cleanup $CLEANUP -result [list 1 1] test document-10.1.1 {getElementsByTagName - document element} \ -constraints {!dom_libxml2} -setup $SETUP -body { set docTestElements [$doc getElementsByTagName Test] list [llength [set $docTestElements]] [$top isSameNode [lindex [set $docTestElements] 0]] } -cleanup $CLEANUP -result [list 1 1] test document-10.3 {getElementsByTagName - continued} \ -constraints {!dom_libxml2} -setup $SETUP10 -body { set docTestElements [$doc getElementsByTagName Test] set result [set $docTestElements] list [llength $result] [compareNodeList $result [list $top $child3]] } -cleanup $CLEANUP -result [list 2 1] test document-10.4 {getElementsByTagName - element} \ -constraints {!dom_libxml2} -setup $SETUP10 -body { set result [::dom::document getElementsByTagName $top Child2] list [llength [set $result]] [compareNodeList [set $result] [list $child2]] } -cleanup $CLEANUP -result [list 1 1] test document-10.5 {getElementsByTagName - remove node} \ -constraints {!dom_libxml2} -setup $SETUP10 -body { set docTestElements [$doc getElementsByTagName Test] dom::node removeChild $top $child3 list [llength [set $docTestElements]] [compareNodeList [set $docTestElements] [list $top]] } -cleanup $CLEANUP -result [list 1 1] test document-10.6 {getElementsByTagName - read-only variable} \ -constraints {!dom_libxml2} -match glob -setup $SETUP10 -body { set docTestElements [$doc getElementsByTagName Test] expectError { lappend $docTestElements -foo- } } -cleanup $CLEANUP -result {*: Read-only variable} test document-10.7 {getElementsByTagName - unset variable} -constraints {!dom_libxml2 && knownBug} -setup $SETUP10 -body { set docTestElements [$doc getElementsByTagName Test] unset $docTestElements ok } -cleanup $CLEANUP -result {} test document-11.1 {importNode} -constraints {dom_c} -body { set testXML "aaabbbaaa" # bug 3620 global testXML set doc [::dom::DOMImplementation parse $testXML] set copy [::dom::DOMImplementation create] set root [::dom::document cget $doc -documentElement] set result [catch {::dom::document importNode $copy $root -deep 1} node] ::dom::node insert $copy $node set xml [::dom::DOMImplementation serialize $copy] list $result $xml } -result {0 { aaabbbaaa}} variable IMPORTSETUP { set doc [dom::parse {text}] set other [dom::parse {import me!}] set replace [dom::selectNode $doc /test/element/text()] set parent [$replace parent] set with [dom::selectNode $other /other/element/text()] } variable IMPORTCLEANUP { dom::destroy $doc dom::destroy $other } test document-11.2 {importNode} -constraints {dom_c} -setup $IMPORTSETUP -match regexp -body { $parent replaceChild [$doc importNode $with -deep 1] $replace dom::serialize $doc } -cleanup $IMPORTCLEANUP -result {.*import me!} # cleanup ::tcltest::cleanupTests } namespace delete ::dom::documentTest return tclxml-3.3~svn11.orig/tests/tcldom/DOMImplementation.test0000644000000000000000000002275611113705304022267 0ustar rootroot# Commands covered: ::dom::DOMImplementation # # This file contains a collection of tests for one or more of the # TclDOM commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # Copyright (c) 1998-2004 Zveno Pty Ltd. # # $Id: DOMImplementation.test,v 1.10 2004/07/11 11:48:58 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::DOMImplementationTest { namespace import -force ::tcltest::* test DOMImplementation-1.1 {hasFeature create} -body { ::dom::DOMImplementation hasFeature create 1.0 } -result 1 test DOMImplementation-1.2 {hasFeature create wrong version} -body { ::dom::DOMImplementation hasFeature create 2.0 } -result 0 test DOMImplementation-1.3 {hasFeature destroy} -body { ::dom::DOMImplementation hasFeature destroy 1.0 } -result 1 test DOMImplementation-1.4 {hasFeature parse} -body { ::dom::DOMImplementation hasFeature parse 1.0 } -result 1 test DOMImplementation-1.5 {hasFeature serialize} -body { ::dom::DOMImplementation hasFeature serialize 1.0 } -result 1 test DOMImplementation-1.6 {hasFeature unknown feature} -body { ::dom::DOMImplementation hasFeature unknown 1.0 } -result 0 test DOMImplementation-1.7 {error: hasFeature too few arguments} -body { catch {::dom::DOMImplementation hasFeature error} } -result 1 test DOMImplementation-1.8 {error: hasFeature too many arguments} -body { catch {::dom::DOMImplementation hasFeature error 1.0 foo} } -result 1 test DOMImplementation-2.1 {create document} -body { set doc [::dom::DOMImplementation create] ok; } -cleanup { dom::destroy $doc } -result {} test DOMImplementation-2.1.1 {create document} -body { set doc [::dom::create] ok; } -cleanup { dom::destroy $doc } -result {} # test DOMImplementation-2.2 {create named document} is obsolete test DOMImplementation-2.3 {error: create too many arguments} -match glob -body { expectError { ::dom::DOMImplementation create Foo Bar } } -result * test DOMImplementation-2.3.1 {error: create too many arguments} -match glob -body { expectError { ::dom::create Foo Bar } } -result * test DOMImplementation-3.1 {destroy document} -constraints {dom_tcl} -setup { set doc [dom::DOMImplementation create] } -body { ::dom::DOMImplementation destroy $doc namespace exists [namespace qualifiers $doc] } -result 0 test DOMImplementation-3.1.0 {destroy document} -constraints {dom_tcl} -setup { set doc [dom::create] } -body { ::dom::DOMImplementation destroy $doc namespace exists [namespace qualifiers $doc] } -result 0 test DOMImplementation-3.1.1 {destroy document} -match glob -setup { set doc [dom::create] } -body { ::dom::destroy $doc expectError { dom::serialize $doc } } -result * test DOMImplementation-3.2 {error: destroy unknown document} -match glob -body { expectError { ::dom::DOMImplementation destroy {::Bar node1} } } -result * test DOMImplementation-3.2.1 {error: destroy unknown document} -match glob -body { expectError { ::dom::destroy {::Bar node1} } } -result * test DOMImplementation-3.3 {destroy too few arguments} -match glob -body { expectError { ::dom::DOMImplementation destroy } } -result * test DOMImplementation-3.3.1 {destroy too few arguments} -match glob -body { expectError { ::dom::destroy } } -result * test DOMImplementation-3.4 {destroy too many arguments} -match glob -body { expectError { ::dom::DOMImplementation destroy {::Bar node1} Extra } } -result * test DOMImplementation-3.4.1 {destroy too many arguments} -match glob -body { expectError { ::dom::destroy {::Bar node1} Extra } } -result * # Bug fix #453741 test DOMImplementation-3.5 {destroy an element node} -match regexp -setup { set doc [dom::DOMImplementation create] set root [dom::document createElement $doc top] set node1 [dom::document createElement $root node] set node2 [dom::document createElement $root node] dom::node removeChild $root $node1 } -body { dom::DOMImplementation destroy $node1 dom::DOMImplementation serialize $doc } -cleanup { dom::DOMImplementation destroy $doc } -result {<\?xml version=("|')1\.0("|')([ ]*encoding=("|')[^"']*("|'))?\?> ( )?} test DOMImplementation-3.5.1 {destroy an element node} -match regexp -setup { set doc [dom::create] set root [dom::document createElement $doc top] set node1 [dom::document createElement $root node] set node2 [dom::document createElement $root node] dom::node removeChild $root $node1 } -body { dom::destroy $node1 dom::serialize $doc } -cleanup { dom::DOMImplementation destroy $doc } -result {<\?xml version=("|')1\.0("|')([ ]*encoding=("|')[^"']*("|'))?\?> ( )?} test DOMImplementation-3.6 {destroy document} -setup { set doc [dom::create] } -body { dom::destroy $doc } -result {} test DOMImplementation-3.7 {destroy document - cleanup document command} -match glob -setup { set doc [dom::create] dom::destroy $doc } -body { expectError { $doc cget -implementation } } -result * test DOMImplementation-3.8 {destroy document - cleanup resources} -setup { set doc [dom::create] set top [$doc createElement Top] dom::node appendChild $doc $top } -body { dom::DOMImplementation destroy $doc list [expr [namespace exists ::dom::$doc] || [namespace exists ::dom::tcl::$doc]] \ [string equal {} [info commands $top]] \ [catch {$doc cget -implementation}] \ [catch {dom::node cget $top -nodeType}] } -result [list 0 1 1 1] test DOMImplementation-3.8.1 {destroy document - cleanup resources} -setup { set doc [dom::create] set top [$doc createElement Top] dom::node appendChild $doc $top } -body { dom::destroy $doc list [expr [namespace exists ::dom::$doc] || [namespace exists ::dom::tcl::$doc]] \ [string equal {} [info commands $top]] \ [catch {$doc cget -implementation}] \ [catch {dom::node cget $top -nodeType}] } -result [list 0 1 1 1] # This will fail when using dom_tcl with Tcl < 8.4 due to lack of command tracing test DOMImplementation-3.9 {destroy document - delete document command - cleanup resources} -setup { set doc [dom::create] set top [$doc createElement Top] dom::node appendChild $doc $top } -body { rename $doc {} list [expr [namespace exists ::dom::$doc] || [namespace exists ::dom::tcl::$doc]] \ [string equal {} [info commands $top]] \ [catch {$doc cget -implementation}] \ [catch {dom::node cget $top -nodeType}] } -result [list 0 1 1 1] test DOMImplementation-3.10 {destroy node - cleanup resources} -setup { set doc [dom::create] set top [dom::document createElement $doc Test] set node [$doc createTextNode {to be destroyed}] $top appendChild $node } -body { dom::destroy $node list [$top children] \ [dom::isNode $node] \ [info commands $node] } -result [list {} 0 {}] -cleanup { dom::destroy $doc } test DOMImplementation-3.11 {destroy node - delete node command} -setup { set doc [dom::create] set top [dom::document createElement $doc Test] set node [dom::document createTextNode $top {delete me}] } -body { rename $node {} list [$top children] \ [dom::isNode $node] \ [info commands $node] } -result [list {} 0 {}] -cleanup { dom::destroy $doc } # Bug #974323 test DOMImplementation-3.12 {destroy document - invalidate document token} -match glob -setup { set doc [dom::create] dom::document createElement $doc Test } -body { dom::destroy $doc set result $doc set doc {} set result } -result * variable xml { This is test DOMImplementation-4.X} test DOMImplementation-4.1 {parse document} -constraints {doParse} -body { set doc [::dom::DOMImplementation parse $xml] ok } -cleanup { dom::destroy $doc } -result {} test DOMImplementation-4.2 {error: parse too few arguments} -constraints {doParse} -match glob -body { expectError { ::dom::DOMImplementation parse } } -result * test DOMImplementation-4.3 {error: parse too many arguments} -constraints {doParse} -match glob -body { expectError { ::dom::DOMImplementation parse $xml Extra } } -result * test DOMImplementation-5.1 {isNode: document} -setup { set doc [dom::create] } -body { dom::DOMImplementation isNode $doc } -cleanup { dom::destroy $doc } -result 1 test DOMImplementation-5.1.1 {isNode: document} -setup { set doc [dom::create] } -body { dom::isNode $doc } -cleanup { dom::destroy $doc } -result 1 test DOMImplementation-5.2 {isNode: node} -setup { set doc [dom::create] set top [dom::document createElement $doc Top] } -body { dom::DOMImplementation isNode $top } -cleanup { dom::destroy $doc } -result 1 test DOMImplementation-5.2.1 {isNode: node} -setup { set doc [dom::create] set top [dom::document createElement $doc Top] } -body { dom::isNode $top } -cleanup { dom::destroy $doc } -result 1 test DOMImplementation-5.3 {isNode: not a node} -body { dom::DOMImplementation isNode {an arbitrary string} } -result 0 test DOMImplementation-5.3.1 {isNode: not a node} -body { dom::isNode whatever } -result 0 # cleanup ::tcltest::cleanupTests } namespace delete ::dom::DOMImplementationTest return tclxml-3.3~svn11.orig/tests/tcldom/stress.test0000644000000000000000000000204011113705304020245 0ustar rootroot# Features covered: Stress test # # This file contains a collection of tests for the TclDOM package. # This file tests the package's overall realtime and memory performance. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # Copyright (c) 2004 Zveno Pty Ltd. # # $Id: stress.test,v 1.1 2004/02/24 20:16:10 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::stressTest { namespace import -force ::tcltest::* variable SETUP { proc createdoc {} { set doc [dom::create] set top [dom::document createElement $doc top] dom::document createElement $top child return $doc } proc createAndDestroy {} { set doc [createdoc] dom::destroy $doc } } variable CLEANUP {} test stress-1.1 {} -setup $SETUP -body { time createAndDestroy 10000 ok } -result {} cleanupTests } namespace delete ::dom::stressTest return tclxml-3.3~svn11.orig/tests/tcldom/tcldomutils.tcl0000644000000000000000000000076411113705304021103 0ustar rootroot# tcldomutils.tcl -- # # This script prepares the testing environment for TclXML. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 2003 Zveno Pty Ltd. # # $Id: tclxmlutils.tcl,v 1.2 2003/12/03 20:06:37 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] .. testutils.tcl] eval tcltest::configure $argv if {[catch {package require dom::libxml2}]} { tcltest::testConstraint dom_tcl 1 } else { tcltest::testConstraint dom_libxml2 1 } tclxml-3.3~svn11.orig/tests/tcldom/relaxng.test0000644000000000000000000000441511215700771020400 0ustar rootroot# Commands covered: relaxng validate # # This file contains a collection of tests for one or more of the # TclDOM commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2009 Explain # # $Id$ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::relaxngTest { namespace import -force ::tcltest::* variable SETUP { set valid [dom::parse {This is a valid document}] set invalid [dom::parse {This is an invalid document}] set schema [dom::parse { }] } variable CLEANUP { dom::destroy $valid dom::destroy $invalid dom::destroy $schema } ### RELAX NG compilation test relaxng-1.1 {compile RELAX NG schema} -setup $SETUP -constraints {dom_libxml2} -match glob -body { $schema relaxng compile } -cleanup $CLEANUP -result {*} test relaxng-1.2 {RELAX NG compile too many args} -setup $SETUP -constraints {dom_libxml2} -match glob -body { expectError { $schema relaxng compile another } } -cleanup $CLEANUP -result {wrong # args*} test relaxng-1.3 {RELAX NG too few args} -setup $SETUP -constraints {dom_libxml2} -match glob -body { expectError { $schema relaxng } } -cleanup $CLEANUP -result {wrong # args*} test relaxng-2.1 {RELAX NG validate validate doc} -setup { eval $SETUP $schema relaxng compile } -constraints {dom_libxml2} -body { $schema relaxng validate $valid } -cleanup $CLEANUP -result {} test relaxng-2.2 {RELAX NG validate invalid doc} -constraints {dom_libxml2} -setup { eval $SETUP $schema relaxng compile } -match glob -body { expectError { $schema relaxng validate $invalid } } -cleanup $CLEANUP -result {*relaxng-validation error*Expecting element Test*} cleanupTests } namespace delete ::dom::relaxngTest return tclxml-3.3~svn11.orig/tests/tcldom/xmlswitch.test0000644000000000000000000000402411113705304020750 0ustar rootroot# Commands covered: ::xmlswitch::xmlswitch # # This file contains a collection of tests for one or more of the # xmlswitch commands. It also tests the XPath parsing package. # Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # Copyright (c) 2000-2003 Zveno Pty Ltd. # # $Id: xmlswitch.test,v 1.3 2003/12/03 20:18:45 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage xmlswitch namespace eval ::dom::xmlswitchTest { namespace import -force ::tcltest::* catch {namespace import ::xmlswitch::xmlswitch} test xmlswitch-1.1 {Empty statement} -constraints {!dom_libxml2} -body { xmlswitch {} { } } -result {} test xmlswitch-2.1 {Simple template in single argument} -constraints {!dom_libxml2} -setup { set result {} } -body { xmlswitch {} { test { append result test } * { append result * } } set result } -result {test*} test xmlswitch-2.2 {Match absolute path} -constraints {!dom_libxml2} -setup { set result {} } -body { xmlswitch {} { /test { append result absolute } test { append result relative } * { append result * } } set result } -result {absoluterelative} test xmlswitch-2.3 {Match predicate} -constraints {!dom_libxml2} -setup { set result {} } -body { xmlswitch {} { test[2] { append result second } test[1] { append result first } } set result } -result {firstsecond} test xmlswitch-3.1 {Simple template in multiple arguments} -constraints {!dom_libxml2} -setup { set result {} } -body { xmlswitch {} \ test { append result test } \ * { append result * } set result } -result {test} # Test break return code # Test continue return code cleanupTests } namespace delete ::dom::xmlswitchTest return tclxml-3.3~svn11.orig/tests/tcldom/parse.test0000644000000000000000000004106711113705304020050 0ustar rootroot# Commands covered: ::dom::DOMimplementation parse # # This file contains a collection of tests for one or more of the # TclDOM commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # Copyright (c) 1998-2004 Zveno Pty Ltd. # # $Id: parse.test,v 1.10 2004/02/25 20:10:31 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::parseTest { namespace import -force ::tcltest::* testConstraint sa [file exists $::tcltest::testsDirectory/sa] proc readUtfOrUnicode {name} { set f [open $name r] fconfigure $f -encoding binary set prefix [read $f 2] seek $f 0 start if {[string equal $prefix \u00ff\u00fe]} { fconfigure $f -encoding identity } else { fconfigure $f -encoding utf-8 } set xml [read $f] close $f return $xml } proc readBinary {name} { set f [open $name r] fconfigure $f -encoding binary set data [read $f] close $f return $data } proc makeUnicode {data} { return [encoding convertfrom identity [encoding convertto unicode $data]] } test parse-1.1 {single element document} -constraints {dom_c} -body { set result [::dom::DOMImplementation parse { }] checkTree $result { {pi xml} {pi DOCTYPE} {element Test {} {}} } } -cleanup { dom::destroy $result } -result 1 test parse-1.1 {single element document} -constraints {dom_tcl} -body { set result [::dom::DOMImplementation parse { }] dom::trim $result checkTree $result { {doctype Test {} {}} {element Test {} {}} } } -cleanup { dom::destroy $result } -result 1 test parse-1.1 {single element document} -constraints {dom_libxml2} -body { set result [::dom::DOMImplementation parse { }] dom::trim $result checkTree $result { {doctype Test {} {}} {element Test {} {}} } 0 } -cleanup { dom::destroy $result } -result 1 test parse-1.2 {nested element document} -constraints {dom_c} -body { set result [::dom::DOMImplementation parse { }] checkTree $result { {pi xml} {pi DOCTYPE} {element Test {} { {element Nested {} { {element Deeper {} {}} }} {element Nested {} {}} }} } } -cleanup { dom::destroy $result } -result 1 test parse-1.2 {nested element document} -constraints {dom_tcl} -body { set result [::dom::DOMImplementation parse { }] dom::trim $result checkTree $result { {doctype Test {} {}} {element Test {} { {element Nested {} { {element Deeper {} {}} }} {element Nested {} {}} }} } } -cleanup { dom::destroy $result } -result 1 test parse-1.2 {nested element document} -constraints {dom_libxml2} -body { set result [::dom::DOMImplementation parse { }] dom::trim $result checkTree $result { {doctype Test {} {}} {element Test {} { {element Nested {} { {element Deeper {} {}} }} {element Nested {} {}} }} } 0 } -cleanup { dom::destroy $result } -result 1 test parse-1.3 {elements with attributes} -constraints {dom_c} -body { set result [::dom::DOMImplementation parse { }] checkTree $result { {pi xml} {pi DOCTYPE} {element Test {} { {element Nested {depth 1} { {element Nested {depth 2} {}} }} }} } } -cleanup { dom::destroy $result } -result 1 test parse-1.3 {elements with attributes} -constraints {dom_tcl} -body { set result [::dom::DOMImplementation parse { }] dom::trim $result checkTree $result { {doctype Test {} {}} {element Test {} { {element Nested {depth 1} { {element Nested {depth 2} {}} }} }} } } -cleanup { dom::destroy $result } -result 1 test parse-1.3 {elements with attributes} -constraints {dom_libxml2} -body { set result [::dom::DOMImplementation parse { }] dom::trim $result checkTree $result { {doctype Test {} {}} {element Test {} { {element Nested {depth 1} { {element Nested {depth 2} {}} }} }} } 0 } -cleanup { dom::destroy $result } -result 1 test parse-1.4 {elements with text content} -constraints {dom_c} -body { set result [::dom::DOMImplementation parse { Inside DeeperSecond Nested}] checkTree $result { {pi xml} {pi DOCTYPE} {element Test {} { {element Nested {} { {element Deeper {} { {text {Inside Deeper}} }} }} {element Nested {} { {text {Second Nested}} }} }} } } -cleanup { dom::destroy $result } -result 1 test parse-1.4 {elements with text content} -constraints {dom_tcl} -body { set result [::dom::DOMImplementation parse { Inside DeeperSecond Nested}] dom::trim $result checkTree $result { {doctype Test {} {}} {element Test {} { {element Nested {} { {element Deeper {} { {text {Inside Deeper}} }} }} {element Nested {} { {text {Second Nested}} }} }} } } -cleanup { dom::destroy $result } -result 1 test parse-1.4 {elements with text content} -constraints {dom_libxml2} -body { set result [::dom::DOMImplementation parse { Inside DeeperSecond Nested}] dom::trim $result checkTree $result { {doctype Test {} {}} {element Test {} { {element Nested {} { {element Deeper {} { {text {Inside Deeper}} }} }} {element Nested {} { {text {Second Nested}} }} }} } 0 } -cleanup { dom::destroy $result } -result 1 test parse-1.5 {incremental parse} -constraints {!dom_libxml2} -setup { set part1 {} set part2 {} } -body { set result1 [catch {::dom::DOMImplementation parse $part1 -final 0} m1] set result2 [catch {::dom::DOMImplementation parse $part2 -final 1} m2] list $result1 $result2 } -cleanup { ::dom::DOMImplementation destroy $m2 } -result {0 0} test parse-1.6 {incremental parse -- parsingComplete flag} -constraints {dom_c} -setup { set part1 {abcdefxyz} set part2 {} } -body { # parse xml that contains ... set doc [::dom::DOMImplementation parse $part1 -final 0] set top [::dom::node cget $doc -firstChild] set child [::dom::node cget $top -firstChild] set textNode [::dom::node cget $child -lastChild] set value [::dom::node cget $child -nodeName] # get completion flags for first chunk of xml set flag1 [::dom::node cget $top -parsingComplete] set flag2 [::dom::node cget $child -parsingComplete] set flag3 [::dom::node cget $textNode -parsingComplete] # parse rest of xml -- close tag for top node ::dom::DOMImplementation parse $part2 -final 1 # get completion flags for completely parsed xml set flag4 [::dom::node cget $top -parsingComplete] set flag5 [::dom::node cget $child -parsingComplete] set flag6 [::dom::node cget $textNode -parsingComplete] list $flag1 $flag2 $flag3 $flag4 $flag5 $flag6 } -cleanup { ::dom::DOMImplementation destroy $doc } -result {0 1 1 1 1 1} test parse-2.1 {expat test suite; tests UTF-16 compliance} -constraints {sa} -body { set compositeResult 0 foreach fname [glob $::tcltest::testsDirectory/sa/*.xml] { set xml [readUtfOrUnicode $fname] set result [catch {::dom::DOMImplementation parse $xml} doc] if {$result == 0} { ::dom::DOMImplementation destroy $doc } else { if {$compositeResult == 0} { set compositeResult "" } lappend compositeResult [file tail $fname] } } set compositeResult } -result 0 test parse-2.2 {expat test suite with incrmental parsing} -constraints {sa} -body { set compositeResult 0 foreach fname [glob $::tcltest::testsDirectory/sa/*.xml] { set xml [readUtfOrUnicode $fname] set xml1 [string range $xml 0 10] set xml2 [string range $xml 11 end] catch {::dom::DOMImplementation parse $xml1 -final 0} set result [catch {::dom::DOMImplementation parse $xml2 -final 1} doc] if {$result == 0} { ::dom::DOMImplementation destroy $doc } else { if {$compositeResult == 0} { set compositeResult "" } lappend compositeResult [file tail $fname] } } set compositeResult } -result 0 test parse-2.3 {expat test suite with incremental parsing errors} -constraints {sa} -body { set count 0 set passCount 0 foreach fname [glob $::tcltest::testsDirectory/sa/*.xml] { set xml [readUtfOrUnicode $fname] set xml1 [string range $xml 0 10] set xml2 [string range $xml 11 end] catch {::dom::DOMImplementation parse $xml1 -final 0} # intentionally bad xml -- all parsing should fail set result [catch {::dom::DOMImplementation parse $xml1 -final 1} doc] if {$result == 0} { ::dom::DOMImplementation destroy $doc incr passCount } else { incr count } } list $count $passCount } -result {119 0} test parse-2.4 {incremental parsing errors -- error on first parse} -constraints {sa} -body { set count 0 set passCount 0 foreach fname [glob $::tcltest::testsDirectory/sa/*.xml] { set xml [readUtfOrUnicode $fname] set xml1 [string range $xml 0 10] set xml2 [string range $xml 11 end] set result [catch {::dom::DOMImplementation parse xx${xml1} -final 0}] if {$result == 1} { incr count continue } # intentionally bad xml -- all parsing should fail set result [catch {::dom::DOMImplementation parse $xml2 -final 1} doc] if {$result == 0} { ::dom::DOMImplementation destroy $doc incr passCount } else { incr count } } list $count $passCount } -result {119 0} test parse-3.1 {parse error reporting} -match regexp -body { expectError { ::dom::DOMImplementation parse { Here is some text } } } -result {(.*tag-name-mismatch.*)|(illegalendtag.*)} test parse-3.2 {parse error reporting; error at char pos 0} -match regexp -body { expectError { ::dom::DOMImplementation parse {>?xml version="1.0"?> Here is some text } } } -result {(.*document-empty.*)|(unexpectedtext.*)} test parse-3.3 {parse error reporting -- error at last char} -match regexp -body { expectError { ::dom::DOMImplementation parse { Here is some text "] } else { append badXML [makeUnicode "\u3c00\u5a00\u3e00"] } append badXML [encoding convertfrom identity $part2] expectError { ::dom::DOMImplementation parse $badXML } } -result {error "not well-formed*} test parse-3.5 {parse error reporting, UTF-16 source, error at first char} -constraints {sa} -body { set fname $::tcltest::testsDirectory/sa/049.xml set xml [readBinary $fname] set badXML [encoding convertfrom identity [string range $xml 0 1]] if {$tcl_platform(byteOrder) == "littleEndian"} { append badXML [makeUnicode ">"] } else { append badXML [makeUnicode "\u3e00"] } append badXML [encoding convertfrom identity [string range $xml 2 end]] expectError { ::dom::DOMImplementation parse $badXML } } -result {error "syntax error" at line 1 character 1; at ">£Z"} test parse-3.8 {parse error reporting, UTF-16 source, error is CR} -constraints {sa} -body { set fname $::tcltest::testsDirectory/sa/049.xml set xml [readBinary $fname] set badXML [encoding convertfrom identity [string range $xml 0 9]] set part2 [string range $xml 10 end] if {$tcl_platform(byteOrder) == "littleEndian"} { append badXML [makeUnicode "\n"] } else { append badXML [makeUnicode "\u0a00"] } append badXML [encoding convertfrom identity $part2] expectError { ::dom::DOMImplementation parse $badXML } } -result {error "syntax error" at line 1 character 1; at " Here is some text } } } -result {(.*NAME-required.*)|(unknowninstruction.*)} test parse-4.1 {white space trimming} -constraints {dom_c} -body { set part1 { abc def xyz} set part2 { } # parse xml that contains ... set doc [::dom::DOMImplementation parse $part1 -final 0 -trim] # parse rest of xml -- close tag for top node ::dom::DOMImplementation parse $part2 -final 1 -trim set result [::dom::DOMImplementation serialize $doc] } -cleanup { ::dom::DOMImplementation destroy $doc } -result { abc def xyz } # # Test processing instruction parsing. # variable PIPARSE { set piparse_text "" set doc [dom::DOMImplementation parse $piparse_text] dom::trim $doc set root [dom::document cget $doc -documentElement] set children [dom::node children $root] set pinode [lindex $children 0] } variable CLEANUP { dom::destroy $doc } test parse-5.0 {Processing instruction parsing} -setup $PIPARSE -body { dom::node cget $root -nodeName } -cleanup $CLEANUP -result {test} test parse-5.1 {PI present} -setup $PIPARSE -body { llength $children } -cleanup $CLEANUP -result 1 test parse-5.2 {PI right type} -setup $PIPARSE -body { dom::node cget $pinode -nodeType } -cleanup $CLEANUP -result {processingInstruction} test parse-5.3 {PI node name} -setup $PIPARSE -body { dom::node cget $pinode -nodeName } -cleanup $CLEANUP -result {PITGT} test parse-5.4 {PI node value} -setup $PIPARSE -body { dom::node cget $pinode -nodeValue } -cleanup $CLEANUP -result {processing instruction data} test parse-5.5 {PI serialization} -setup $PIPARSE -constraints {!dom_libxml2} -body { dom::DOMImplementation serialize $root } -cleanup $CLEANUP -result $piparse_text variable SETUP6 { variable result {} proc estart {tag attrs args} { variable result lappend result [list $tag $attrs] } proc pcdata {text args} { variable result lappend result $text } } variable CLEANUP6 { dom::destroy $doc catch {unset result} rename estart {} rename pcdata {} } # TODO: pure-Tcl implementation should support this usage as well test parse-6.0 {SAX callbacks} -setup $SETUP6 -constraints {dom_libxml2} -body { set doc [dom::DOMImplementation parse {World} \ -elementstartcommand [namespace code estart] \ -characterdatacommand [namespace code pcdata]] set result } -cleanup $CLEANUP6 -result {{Hello {}} World} cleanupTests } namespace delete ::dom::parseTest return tclxml-3.3~svn11.orig/tests/tcldom/treewalker.test0000644000000000000000000007115411113705304021103 0ustar rootroot# Commands covered: ::dom::treeWalker # # This file contains a collection of tests for one or more of the # TclDOM commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # Copyright (c) 2002-2003 Zveno Pty Ltd # Copyright (c) 2000 Ajuba Solutions # # $Id: treewalker.test,v 1.4 2003/12/03 20:18:45 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::treewalkerTest { namespace import -force ::tcltest::* variable xml1 { This is text.aaabbbaaa2cccdddccc2aaa3} variable SETUP { set doc [::dom::DOMImplementation parse { }] } variable CLEANUP { dom::destroy $doc } test treewalker-2.1 {argument parsing} -constraints {dom_c} -body { expectError { dom::treeWalker } } -result {wrong # args: should be "dom::treeWalker method handle ?arg ...?"} test treewalker-2.2 {argument parsing} -constraints {dom_c} -body { expectError { dom::treeWalker foo } } -result {bad method "foo": must be cget, configure, parentNode, firstChild, lastChild, previousSibling, nextSibling, previousNode, or nextNode} test treewalker-2.3 {argument parsing} -constraints {dom_c} -body { expectError { dom::treeWalker cget blah } } -result {token not found} test treewalker-1.1 {treewalker creation} -constraints {dom_c} -setup $SETUP -body { set result [catch {dom::DocumentTraversal createTreeWalker $doc} \ treewalker] set handle [string range $treewalker 0 9] list $result $handle } -cleanup $CLEANUP -result {0 treewalker} test treewalker-1.2 {treewalker creation} -constraints {dom_c} -setup $SETUP -body { set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result [catch {dom::treeWalker nextNode $treewalker} first] set handle [string range $first 0 3] list $result $handle } -cleanup $CLEANUP -result {0 node} test treewalker-2.1 {treewalker cget -show} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse {}] set treewalker [dom::DocumentTraversal createTreeWalker $doc -show \ [list element textNode]] } -body { set result [catch {::dom::treeWalker cget $treewalker -show} value] list $result $value } -cleanup $CLEANUP -result {0 {element textNode}} test treewalker-2.2 {treewalker configure -show} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse {}] set treewalker [dom::DocumentTraversal createTreeWalker $doc -show \ [list element textNode]] } -body { ::dom::treeWalker configure $treewalker -show } -cleanup $CLEANUP -result {element textNode} test treewalker-2.3 {treewalker configure -show readonly} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse {}] set treewalker [dom::DocumentTraversal createTreeWalker $doc -show \ [list element textNode]] } -body { expectError { ::dom::treeWalker configure $treewalker \ -show [list element] } } -cleanup $CLEANUP -result {no modification allowed error: an attempt was made to modify an object where modifications are not allowed} test treewalker-2.4 {treewalker cget -filter} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse {}] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -filter nodeFilter] } -body { ::dom::treeWalker cget $treewalker -filter } -cleanup $CLEANUP -result nodeFilter test treewalker-2.5 {treewalker configure -filter} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse {}] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -filter nodeFilter] } -body { ::dom::treeWalker configure $treewalker -filter } -cleanup $CLEANUP -result nodeFilter test treewalker-2.6 {treewalker configure -filter readonly} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse {}] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -filter nodeFilter] } -body { expectError { ::dom::treeWalker configure $treewalker \ -filter someFilter } } -cleanup $CLEANUP -result {no modification allowed error: an attempt was made to modify an object where modifications are not allowed} test treewalker-2.7 {treewalker cget -expandEntities} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse {}] set treewalker [dom::DocumentTraversal createTreeWalker $doc] } -body { ::dom::treeWalker cget $treewalker \ -expandEntities } -cleanup $CLEANUP -result {} test treewalker-2.8 {treewalker configure -expandEntities} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse {}] set treewalker [dom::DocumentTraversal createTreeWalker $doc] } -body { ::dom::treeWalker configure $treewalker \ -expandEntities } -cleanup $CLEANUP -result {} test treewalker-2.9 {treewalker configure -expandEntities readonly} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse {}] set treewalker [dom::DocumentTraversal createTreeWalker $doc] } -body { expectError { ::dom::treeWalker configure $treewalker \ -expandEntities 1 } } -cleanup $CLEANUP -result {no modification allowed error: an attempt was made to modify an object where modifications are not allowed} test treewalker-2.10 {treewalker cget -currentNode} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse {}] set treewalker [dom::DocumentTraversal createTreeWalker $doc] } -body { set value [::dom::treeWalker cget $treewalker \ -currentNode] string compare $doc $value } -cleanup $CLEANUP -result 0 test treewalker-2.10 {treewalker configure -currentNode} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse {}] set treewalker [dom::DocumentTraversal createTreeWalker $doc] } -body { set value [::dom::treeWalker configure $treewalker \ -currentNode] string compare $document $value } -cleanup $CLEANUP -result 0 test treewalker-2.10 {treewalker configure -currentNode writable} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse {}] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set topNode [dom::document cget $document -documentElement] } -body { set result [catch {::dom::treeWalker configure $treewalker \ -currentNode $topNode} value] set result [catch {::dom::treeWalker configure $treewalker \ -currentNode} value] list $result [string compare $topNode $value] } -cleanup $CLEANUP -result {0 0} test treewalker-3.1 {basic iteration} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse { This istext.}] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} } -body { for {set i 0} {$i < 9} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break; lappend result [dom::node cget $node -nodeType] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] } set result } -cleanup $CLEANUP -result {documentType Test {} element Test {} textNode #text {This } element b {} textNode #text is textNode #text text.} test treewalker-3.2 {basic iteration with -show} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse { This istext.}] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -show [list element textNode]] set result {} } -body { for {set i 0} {$i < 9} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break; lappend result [dom::node cget $node -nodeType] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] } set result } -cleanup $CLEANUP -result {element Test {} textNode #text {This } element b {} textNode #text is textNode #text text.} test treewalker-3.3 {basic reverse iteration} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse { This istext.}] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} } -body { for {set i 0} {$i < 9} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break; } for {set i 0} {$i < 9} {incr i} { set node [dom::treeWalker previousNode $treewalker] if {$node == ""} break; lappend result [dom::node cget $node -nodeType] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] } set result } -cleanup $CLEANUP -result {textNode #text is element b {} textNode #text {This } element Test {} documentType Test {} document #document {}} test treewalker-3.4 {basic reverse iteration with -show} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse { This istext.}] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -show [list element textNode]] set result {} } -body { for {set i 0} {$i < 9} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break; } for {set i 0} {$i < 9} {incr i} { set node [dom::treeWalker previousNode $treewalker] if {$node == ""} break; lappend result [dom::node cget $node -nodeType] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] } set result } -cleanup $CLEANUP -result {textNode #text is element b {} textNode #text {This } element Test {}} test treewalker-3.5 {complex iteration} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} } -body { for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } set result } -cleanup $CLEANUP -result {Test Test {This } b is { text.} A aaa B bbb aaa2 C ccc D ddd ccc2 aaa3} test treewalker-3.6 {complex iteration} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} } -body { for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break; } for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker previousNode $treewalker] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } set result } -cleanup $CLEANUP -result {ccc2 ddd D ccc C aaa2 bbb B aaa A { text.} is b {This } Test Test #document} test treewalker-3.7 {basic iteration both directions} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse { This istext.}] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} } -body { set node [dom::treeWalker nextNode $treewalker] lappend result [dom::node cget $node -nodeName] set node [dom::treeWalker previousNode $treewalker] lappend result [dom::node cget $node -nodeName] set result } -cleanup $CLEANUP -result {Test #document} test treewalker-3.8 {backup before start of list} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse { This istext.}] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} } -body { set node [dom::treeWalker previousNode $treewalker] set node } -cleanup $CLEANUP -result {} test treewalker-3.9 {backup before start of list then forward} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse { This istext.}] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} } -body { set node [dom::treeWalker previousNode $treewalker] set node [dom::treeWalker previousNode $treewalker] set node [dom::treeWalker previousNode $treewalker] set node [dom::treeWalker previousNode $treewalker] set node [dom::treeWalker nextNode $treewalker] lappend result [dom::node cget $node -nodeName] set result } -cleanup $CLEANUP -result {Test} test treewalker-3.10 {inserts while iterating} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} } -body { for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name if {$name == "A"} { set new [dom::document createTextNode $document "New Text"] dom::node insertBefore $node $new \ [dom::node cget $node -firstChild] } } else { lappend result [dom::node cget $node -nodeValue] } } set result } -cleanup $CLEANUP -result {Test Test {This } b is { text.} A {New Text} aaa B bbb aaa2 C ccc D ddd ccc2 aaa3} test treewalker-3.11 {deletions while iterating} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} } -body { for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name if {$name == "A"} { dom::node removeChild $node [dom::node cget $node -firstChild] } } else { lappend result [dom::node cget $node -nodeValue] } } set result } -cleanup $CLEANUP -result {Test Test {This } b is { text.} A B bbb aaa2 C ccc D ddd ccc2 aaa3} test treewalker-3.12 {reference node deletion while iterating} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} } -body { for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name if {$name == "B"} { dom::node removeChild [dom::node cget $node -parent] $node } } else { lappend result [dom::node cget $node -nodeValue] } } set result } -cleanup $CLEANUP -result {Test Test {This } b is { text.} A aaa B aaa2 C ccc D ddd ccc2 aaa3} test treewalker-3.13 {reference node deletion while iterating II} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} } -body { for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name if {$name == "C"} { set nodeToDelete $node } elseif {$name == "D"} { dom::node removeChild [dom::node cget $nodeToDelete -parent] \ $nodeToDelete } } else { lappend result [dom::node cget $node -nodeValue] } } set result } -cleanup $CLEANUP -result {Test Test {This } b is { text.} A aaa B bbb aaa2 C ccc D aaa3} test treewalker-3.14 {deletion of trailing reference node} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse { xxx}] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} set node {} } -body { for {set i 0} {$i < 9} {incr i} { set refNode $node set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break; } set node [dom::treeWalker previousNode $treewalker] dom::node removeChild [dom::node cget $refNode -parent] $refNode set node [dom::treeWalker previousNode $treewalker] lappend result [dom::node cget $node -nodeName] set result } -cleanup $CLEANUP -result {Test} test treewalker-3.15 {complex iteration with filter} -constraints {dom_c} -setup { proc nodeFilter {node} { set value [dom::node cget $node -nodeValue] if {$value == "aaa"} { return $::dom::skip } else { return $::dom::accept } } set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -filter nodeFilter] set result {} } -body { for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } rename nodeFilter {} set result } -cleanup { eval $CLEANUP rename nodeFilter {} } -result {Test Test {This } b is { text.} A B bbb aaa2 C ccc D ddd ccc2 aaa3} test treewalker-3.16 {firstChild} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} } -body { set node [dom::treeWalker firstChild $treewalker] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] set result } -cleanup $CLEANUP -result {Test {}} test treewalker-3.17 {firstChild with -show} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -show textNode] set result {} } -body { set node [dom::treeWalker firstChild $treewalker] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] set result } -cleanup $CLEANUP -result {#text {This }} test treewalker-3.18 {parentNode} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} set node [dom::treeWalker firstChild $treewalker] set node [dom::treeWalker nextSibling $treewalker] set node [dom::treeWalker firstChild $treewalker] } -body { set node [dom::treeWalker parentNode $treewalker] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] set result } -cleanup $CLEANUP -result {Test {}} test treewalker-3.19 {parentNode with -show} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -show [list document textNode]] set result {} set node [dom::treeWalker firstChild $treewalker] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] } -body { set node [dom::treeWalker parentNode $treewalker] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] set result } -cleanup $CLEANUP -result {#text {This } #document {}} test treewalker-3.20 {nextSibling with -show} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -show [list document textNode]] set result {} set node [dom::treeWalker firstChild $treewalker] lappend result [dom::node cget $node -nodeValue] } -body { while {1} { set node [dom::treeWalker nextSibling $treewalker] if {$node == ""} break lappend result [dom::node cget $node -nodeValue] } set result } -cleanup $CLEANUP -result {{This } is { text.} aaa bbb aaa2 ccc ddd ccc2 aaa3} test treewalker-3.21 {lastChild} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc] set result {} } -body { set node [dom::treeWalker lastChild $treewalker] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] set result } -cleanup $CLEANUP -result {Test {}} test treewalker-3.22 {lastChild with -show} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -show textNode] set result {} } -body { set node [dom::treeWalker lastChild $treewalker] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] set result } -cleanup $CLEANUP -result {#text aaa3} test treewalker-3.23 {previousSibling with -show} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -show [list document textNode]] set result {} set node [dom::treeWalker lastChild $treewalker] lappend result [dom::node cget $node -nodeValue] } -body { while {1} { set node [dom::treeWalker previousSibling $treewalker] if {$node == ""} break lappend result [dom::node cget $node -nodeValue] } set result } -cleanup $CLEANUP -result {aaa3 ccc2 ddd ccc aaa2 bbb aaa { text.} is {This }} test treewalker-3.24 {iteration with skip filter} -constraints {dom_c} -setup { proc nodeFilter {node} { set value [dom::node cget $node -nodeName] if {$value == "A"} { return $::dom::skip } else { return $::dom::accept } } set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -filter nodeFilter] set result {} } -body { for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } set result } -cleanup { eval $CLEANUP rename nodeFilter {} } -result {Test Test {This } b is { text.} aaa B bbb aaa2 C ccc D ddd ccc2 aaa3} test treewalker-3.25 {iteration with reject filter} -constraints {dom_c} -setup { proc nodeFilter {node} { set value [dom::node cget $node -nodeName] if {$value == "A"} { return $::dom::reject } else { return $::dom::accept } } set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -filter nodeFilter] set result {} } -body { for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } set result } -cleanup { eval $CLEANUP rename nodeFilter {} } -result {Test Test {This } b is { text.}} test treewalker-3.26 {reverse iteration with skip filter} -constraints {dom_c} -setup { proc nodeFilter {node} { set value [dom::node cget $node -nodeName] if {$value == "A"} { return $::dom::skip } else { return $::dom::accept } } set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -filter nodeFilter] set result {} } -body { for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break; } for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker previousNode $treewalker] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } set result } -cleanup { eval $CLEANUP rename nodeFilter {} } -result {ccc2 ddd D ccc C aaa2 bbb B aaa { text.} is b {This } Test Test #document} test treewalker-3.27 {reverse iteration with reject filter} -constraints {dom_c} -setup { # filter is noop while we go to last node proc nodeFilter {node} { return $::dom::accept } set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -filter nodeFilter] set result {} } -body { # advance to last node for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break; } proc nodeFilter {node} { set value [dom::node cget $node -nodeName] if {$value == "A"} { return $::dom::reject } else { return $::dom::accept } } for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker previousNode $treewalker] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } set result # child nodes of filtered element appear because we're going # backwards } -cleanup { eval $CLEANUP rename nodeFilter {} } -result {ccc2 ddd D ccc C aaa2 bbb B aaa { text.} is b {This } Test Test #document} test treewalker-3.28 {iteration with deletion in filter} -constraints {dom_c} -setup { # this example isn't good coding practice, but we need to test that the # code at least holds up proc nodeFilter {node} { set value [dom::node cget $node -nodeName] if {$value == "A"} { set parent [dom::node cget $node -parentNode] if {$parent != {}} { dom::node removeChild $parent $node } return $::dom::accept } else { return $::dom::accept } } set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -filter nodeFilter] set result {} } -body { for {set i 0} {$i < 40} {incr i} { set node [dom::treeWalker nextNode $treewalker] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } set result } -cleanup { eval $CLEANUP rename nodeFilter {} } -result {Test Test {This } b is { text.} A aaa B bbb aaa2 C ccc D ddd ccc2 aaa3} test treewalker-4.1 {treewalker deletion} -constraints {dom_c} -setup { set doc [::dom::DOMImplementation parse $xml1] set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -show [list document textNode]] } -body { ::dom::DocumentTraversal destroy $treewalker } -cleanup $CLEANUP -result {} test treewalker-5.1 {delete document in filter proc} -constraints {dom_c} -setup { proc nodeFilter {node} { variable doc dom::DOMImplementation destroy $doc return $::dom::accept } set doc [::dom::DOMImplementation parse $xml1] } -body { set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -filter nodeFilter] set node [dom::treeWalker nextNode $treewalker] expectError { dom::node cget $node -nodeName } } -cleanup { rename nodeFilter {} } -result {token not found} test treewalker-5.2 {delete document in filter proc} -constraints {dom_c} -setup { proc nodeFilter {node} { global document dom::DOMImplementation destroy $document return $::dom::accept } variable doc [::dom::DOMImplementation parse $xml1] } -body { set treewalker [dom::DocumentTraversal createTreeWalker $doc \ -filter nodeFilter] set node [dom::treeWalker nextNode $treewalker] set result [catch {dom::treeWalker nextNode $treewalker} errmsg] rename nodeFilter {} list $result $errmsg } -cleanup { rename nodeFilter {} } -result {0 {}} test treewalker-5.3 {delete treewalker in filter proc} -constraints {dom_c} -setup { proc nodeFilter {node} { variable treewalker ::dom::DocumentTraversal destroy $treewalker return $::dom::accept } set doc [::dom::DOMImplementation parse $xml1] variable treewalker [dom::DocumentTraversal createTreeWalker $doc \ -filter nodeFilter] } -body { # first invocation succeeds set node [dom::treeWalker nextNode $treewalker] expectError { dom::treeWalker nextNode $treewalker } } -cleanup { eval $CLEANUP rename nodeFilter {} } -result {token not found} test treewalker-5.4 {recursively invoke filter proc} -constraints {dom_c} -setup { proc nodeFilter {node} { variable treewalker set node [dom::treeWalker nextNode $treewalker] return $::dom::accept } set doc [::dom::DOMImplementation parse $xml1] variable treewalker [dom::DocumentTraversal createTreeWalker $doc \ -filter nodeFilter] expectError { dom::treeWalker nextNode $treewalker } } -cleanup { eval $CLEANUP rename nodeFilter {} } -result {too many nested calls * (infinite loop?)} cleanupTests } namespace delete ::dom::treewalkerTest return tclxml-3.3~svn11.orig/tests/tcldom/iterator.test0000644000000000000000000006321411113705304020565 0ustar rootroot# Commands covered: ::dom::nodeIterator # # This file contains a collection of tests for one or more of the # TclDOM commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # Copyright (c) 1999-2000 Ajuba Solutions # # $Id: iterator.test,v 1.4 2003/12/03 20:18:45 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::iteratorTest { namespace import -force ::tcltest::* proc IterateXML {xml showList} { set document [::dom::DOMImplementation parse $xml] set iterator [dom::DocumentTraversal createNodeIterator $document \ -show $showList] set result {} for {set i 0} {$i < 50} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break; if {[dom::node cget $node -nodeName] != "#text"} { lappend result [dom::node cget $node -nodeName] } else { lappend result [dom::node cget $node -nodeValue] } } for {set i 0} {$i < 50} {incr i} { set node [dom::nodeIterator previousNode $iterator] if {$node == ""} break; if {[dom::node cget $node -nodeName] != "#text"} { lappend result [dom::node cget $node -nodeName] } else { lappend result [dom::node cget $node -nodeValue] } } return $result } set xml1 { This istext.aaabbbcccdddccc2aaa2} test iterator-1.1 {argument parsing} -constraints {dom_c} -body { list [catch {dom::nodeIterator} msg] $msg } -result {1 {wrong # args: should be "dom::nodeIterator method handle ?arg ...?"}} test iterator-1.2 {argument parsing} -constraints {dom_c} -body { list [catch {dom::nodeIterator foo} msg] $msg } -result {1 {bad method "foo": must be cget, configure, previousNode, or nextNode}} test iterator-1.3 {argument parsing} -constraints {dom_c} -body { list [catch {dom::nodeIterator cget blah} msg] $msg } -result {1 {token not found}} test iterator-2.1 {iterator creation} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse { }] set result [catch {dom::DocumentTraversal createNodeIterator $document} \ iterator] set handle [string range $iterator 0 7] list $result $handle } -result {0 iterator} test iterator-2.2 {iterator creation} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse { }] set iterator [dom::DocumentTraversal createNodeIterator $document] set result [catch {dom::nodeIterator nextNode $iterator} first] set handle [string range $first 0 3] list $result $handle } -result {0 node} test iterator-3.1 {iterator cget -show} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse {}] set iterator [dom::DocumentTraversal createNodeIterator $document -show \ [list element textNode]] set result [catch {::dom::nodeIterator cget $iterator -show} value] list $result $value } -result {0 {element textNode}} test iterator-3.2 {iterator configure -show} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse {}] set iterator [dom::DocumentTraversal createNodeIterator $document -show \ [list element textNode]] set result [catch {::dom::nodeIterator configure $iterator -show} value] list $result $value } -result {0 {element textNode}} test iterator-3.3 {iterator configure -show readonly} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse {}] set iterator [dom::DocumentTraversal createNodeIterator $document -show \ [list element textNode]] set result [catch {::dom::nodeIterator configure $iterator \ -show [list element]} value] list $result $value } -result {1 {no modification allowed error: an attempt was made to modify an object where modifications are not allowed}} test iterator-3.4 {iterator cget -filter} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse {}] set iterator [dom::DocumentTraversal createNodeIterator $document \ -filter nodeFilter] set result [catch {::dom::nodeIterator cget $iterator -filter} value] list $result $value } -result {0 nodeFilter} test iterator-3.5 {iterator configure -filter} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse {}] set iterator [dom::DocumentTraversal createNodeIterator $document \ -filter nodeFilter] set result [catch {::dom::nodeIterator configure $iterator -filter} value] list $result $value } -result {0 nodeFilter} test iterator-3.6 {iterator configure -filter readonly} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse {}] set iterator [dom::DocumentTraversal createNodeIterator $document \ -filter nodeFilter] set result [catch {::dom::nodeIterator configure $iterator \ -filter someFilter} value] list $result $value } -result {1 {no modification allowed error: an attempt was made to modify an object where modifications are not allowed}} test iterator-3.7 {iterator cget -expandEntities} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse {}] set iterator [dom::DocumentTraversal createNodeIterator $document] set result [catch {::dom::nodeIterator cget $iterator \ -expandEntities} value] list $result $value } -result {0 0} test iterator-3.8 {iterator configure -expandEntities} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse {}] set iterator [dom::DocumentTraversal createNodeIterator $document] set result [catch {::dom::nodeIterator configure $iterator \ -expandEntities} value] list $result $value } -result {0 0} test iterator-3.9 {iterator configure -expandEntities readonly} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse {}] set iterator [dom::DocumentTraversal createNodeIterator $document] set result [catch {::dom::nodeIterator configure $iterator \ -expandEntities 1} value] list $result $value } -result {1 {no modification allowed error: an attempt was made to modify an object where modifications are not allowed}} test iterator-4.1 {basic iteration} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse { This istext.}] set iterator [dom::DocumentTraversal createNodeIterator $document] set result {} for {set i 0} {$i < 9} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break; lappend result [dom::node cget $node -nodeType] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] } set result } -result {document #document {} documentType Test {} element Test {} textNode #text {This } element b {} textNode #text is textNode #text text.} test iterator-4.2 {basic iteration with -show} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse { This istext.}] set iterator [dom::DocumentTraversal createNodeIterator $document \ -show [list element textNode]] set result {} for {set i 0} {$i < 9} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break; lappend result [dom::node cget $node -nodeType] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] } set result } -result {element Test {} textNode #text {This } element b {} textNode #text is textNode #text text.} test iterator-4.3 {basic reverse iteration} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse { This istext.}] set iterator [dom::DocumentTraversal createNodeIterator $document] set result {} for {set i 0} {$i < 9} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break; } for {set i 0} {$i < 9} {incr i} { set node [dom::nodeIterator previousNode $iterator] if {$node == ""} break; lappend result [dom::node cget $node -nodeType] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] } set result } -result {textNode #text text. textNode #text is element b {} textNode #text {This } element Test {} documentType Test {} document #document {}} test iterator-4.4 {basic reverse iteration with -show} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse { This istext.}] set iterator [dom::DocumentTraversal createNodeIterator $document \ -show [list element textNode]] set result {} for {set i 0} {$i < 9} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break; } for {set i 0} {$i < 9} {incr i} { set node [dom::nodeIterator previousNode $iterator] if {$node == ""} break; lappend result [dom::node cget $node -nodeType] lappend result [dom::node cget $node -nodeName] lappend result [dom::node cget $node -nodeValue] } set result } -result {textNode #text text. textNode #text is element b {} textNode #text {This } element Test {}} test iterator-4.5 {complex iteration} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document] set result {} for {set i 0} {$i < 40} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } set result } -result {#document Test Test {This } b is text. A aaa B bbb C ccc D ddd ccc2 aaa2} test iterator-4.6 {complex iteration} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document] set result {} for {set i 0} {$i < 40} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break; } for {set i 0} {$i < 40} {incr i} { set node [dom::nodeIterator previousNode $iterator] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } set result } -result {aaa2 ccc2 ddd D ccc C bbb B aaa A text. is b {This } Test Test #document} test iterator-4.7 {basic iteration both directions} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse { This istext.}] set iterator [dom::DocumentTraversal createNodeIterator $document] set result {} set node [dom::nodeIterator nextNode $iterator] lappend result [dom::node cget $node -nodeName] set node [dom::nodeIterator previousNode $iterator] lappend result [dom::node cget $node -nodeName] set result } -result {#document #document} test iterator-4.8 {backup before start of list} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse { This istext.}] set iterator [dom::DocumentTraversal createNodeIterator $document] set result {} set node [dom::nodeIterator previousNode $iterator] set node } -result {} test iterator-4.9 {backup before start of list then forward} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse { This istext.}] set iterator [dom::DocumentTraversal createNodeIterator $document] set result {} set node [dom::nodeIterator previousNode $iterator] set node [dom::nodeIterator previousNode $iterator] set node [dom::nodeIterator previousNode $iterator] set node [dom::nodeIterator previousNode $iterator] set node [dom::nodeIterator nextNode $iterator] lappend result [dom::node cget $node -nodeName] set result } -result {#document} test iterator-4.10 {inserts while iterating} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document] set result {} for {set i 0} {$i < 40} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name if {$name == "A"} { set new [dom::document createTextNode $document "New Text"] dom::node insertBefore $node $new \ [dom::node cget $node -firstChild] } } else { lappend result [dom::node cget $node -nodeValue] } } set result } -result {#document Test Test {This } b is text. A {New Text} aaa B bbb C ccc D ddd ccc2 aaa2} test iterator-4.11 {deletions while iterating} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document] set result {} for {set i 0} {$i < 40} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name if {$name == "A"} { dom::node removeChild $node [dom::node cget $node -firstChild] } } else { lappend result [dom::node cget $node -nodeValue] } } set result } -result {#document Test Test {This } b is text. A B bbb C ccc D ddd ccc2 aaa2} test iterator-4.12 {reference node deletion while iterating} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document] set result {} for {set i 0} {$i < 40} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name if {$name == "B"} { dom::node removeChild [dom::node cget $node -parent] $node } } else { lappend result [dom::node cget $node -nodeValue] } } set result } -result {#document Test Test {This } b is text. A aaa B C ccc D ddd ccc2 aaa2} test iterator-4.13 {reference node deletion while iterating II} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document] set result {} for {set i 0} {$i < 40} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name if {$name == "C"} { set nodeToDelete $node } elseif {$name == "D"} { dom::node removeChild [dom::node cget $nodeToDelete -parent] \ $nodeToDelete } } else { lappend result [dom::node cget $node -nodeValue] } } set result } -result {#document Test Test {This } b is text. A aaa B bbb C ccc D aaa2} test iterator-4.14 {deletion of trailing reference node} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse { xxx}] set iterator [dom::DocumentTraversal createNodeIterator $document] set result {} set node {} for {set i 0} {$i < 9} {incr i} { set refNode $node set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break; } set node [dom::nodeIterator previousNode $iterator] dom::node removeChild [dom::node cget $refNode -parent] $refNode set node [dom::nodeIterator previousNode $iterator] lappend result [dom::node cget $node -nodeName] set result } -result {Test} test iterator-4.15 {complex iteration with filter} -constraints {dom_c} -body { proc nodeFilter {node} { set value [dom::node cget $node -nodeValue] if {$value == "aaa"} { return $::dom::reject } else { return $::dom::accept } } set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document \ -filter nodeFilter] set result {} for {set i 0} {$i < 40} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } rename nodeFilter {} set result } -result {#document Test Test {This } b is text. A B bbb C ccc D ddd ccc2 aaa2} test iterator-4.16 {complex iteration} -constraints {dom_c} -body { set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document \ -show [list document textNode]] set result {} for {set i 0} {$i < 40} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break; } for {set i 0} {$i < 40} {incr i} { set node [dom::nodeIterator previousNode $iterator] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } set result } -result {aaa2 ccc2 ddd ccc bbb aaa text. is {This } #document} test iterator-4.17 {complex iteration} -constraints {dom_c} -body { set xml1 {abcd} IterateXML $xml1 [list document element] } -result {#document A B C D D C B A #document} test iterator-4.18 {complex iteration} -constraints {dom_c} -body { set xml1 {abcd} IterateXML $xml1 [list document element] } -result {#document Test A B C D D C B A Test #document} test iterator-4.19 {complex iteration} -constraints {dom_c} -body { IterateXML $xml1 [list document element textNode] } -result {#document Test A a B b C c D d d D c C b B a A Test #document} set xml1 { testeeefffgggccciiijjjkkkccc2} test iterator-4.20 {complex iteration} -constraints {dom_c} -body { IterateXML $xml1 [list document element textNode] } -result {#document Test test A B C D E eee F fff G ggg ccc H I iii J jjj K kkk ccc2 ccc2 kkk K jjj J iii I H ccc ggg G fff F eee E D C B A test Test #document} test iterator-4.21 {complex iteration} -constraints {dom_c} -body { IterateXML $xml1 [list document textNode] } -result {#document test eee fff ggg ccc iii jjj kkk ccc2 ccc2 kkk jjj iii ccc ggg fff eee test #document} set xml1 { abcdef} test iterator-4.22 {complex iteration} -constraints {dom_c} -body { IterateXML $xml1 [list document element textNode] } -result {#document Test A a B b C c D d E e F f f F e E d D c C b B a A Test #document} test iterator-4.23 {complex iteration} -constraints {dom_c} -body { IterateXML $xml1 [list document textNode] } -result {#document a b c d e f f e d c b a #document} set xml1 { fedcba} test iterator-4.24 {complex iteration} -constraints {dom_c} -body { IterateXML $xml1 [list document textNode] } -result {#document f e d c b a a b c d e f #document} set xml1 { test eeefffgggccc

iiijjjkkk

ccc2
} test iterator-4.25 {complex iteration} -constraints {dom_c} -body { IterateXML $xml1 [list document element textNode] } -result {#document Test {test } A B C { } D2 D3 D E eee F fff G ggg {ccc } H2 H3 H I iii J jjj K2 K3 K4 K kkk {ccc2 } {ccc2 } kkk K K4 K3 K2 jjj J iii I H H3 H2 {ccc } ggg G fff F eee E D D3 D2 { } C B A {test } Test #document} set xml1 { testabcefgc2

ijk

c3
} test iterator-4.26 {complex iteration} -constraints {dom_c} -body { IterateXML $xml1 [list document element textNode] } -result {#document Test test A a B b C c D2 D3 D E e F f G g c2 H2 H3 H I i J j K2 K3 K4 K k c3 c3 k K K4 K3 K2 j J i I H H3 H2 c2 g G f F e E D D3 D2 c C b B a A test Test #document} test iterator-4.27 {complex iteration} -constraints {dom_c} -body { IterateXML $xml1 [list document textNode] } -result {#document test a b c e f g c2 i j k c3 c3 k j i c2 g f e c b a test #document} set xml1 { xfg

h} test iterator-4.28 {complex iteration} -constraints {dom_c} -body { IterateXML $xml1 [list document element textNode] } -result {#document Test A B C D X x1 x2 x3 E e1 e2 e3 x F f1 f2 f G g1 g2 g H h1 h2 h h h2 h1 H g g2 g1 G f f2 f1 F x e3 e2 e1 E x3 x2 x1 X D C B A Test #document} test iterator-4.29 {complex iteration} -constraints {dom_c} -body { IterateXML $xml1 [list document textNode] } -result {#document x f g h h g f x #document} set xml1 { This istext.aaabbbcccdddccc2aaa2} test iterator-4.30 {complex iteration with filter} -constraints {dom_c} -body { proc nodeFilter {node} { set value [dom::node cget $node -nodeName] if {$value == "A"} { return $::dom::reject } else { return $::dom::accept } } set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document \ -filter nodeFilter] set result {} for {set i 0} {$i < 40} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } rename nodeFilter {} set result } -result {#document Test Test {This } b is text. aaa B bbb C ccc D ddd ccc2 aaa2} test iterator-4.31 {complex reverse iteration} -constraints {dom_c} -body { proc nodeFilter {node} { set value [dom::node cget $node -nodeName] if {$value == "A"} { return $::dom::reject } else { return $::dom::accept } } set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document \ -filter nodeFilter] set result {} for {set i 0} {$i < 30} {incr i} { set node [dom::nodeIterator nextNode $iterator] if {$node == ""} break; } for {set i 0} {$i < 30} {incr i} { set node [dom::nodeIterator previousNode $iterator] if {$node == ""} break; set name [dom::node cget $node -nodeName] if {$name != "#text"} { lappend result $name } else { lappend result [dom::node cget $node -nodeValue] } } rename nodeFilter {} set result } -result {aaa2 ccc2 ddd D ccc C bbb B aaa text. is b {This } Test Test #document} test iterator-5.1 {iterator destruction} -constraints {dom_c} -body { global xml1 set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document] set result [catch {::dom::DocumentTraversal destroy $iterator} errmsg] list $result $errmsg } -result {0 {}} test iterator-6.1 {delete document in filter proc} -constraints {dom_c} -body { proc nodeFilter {node} { global document dom::DOMImplementation destroy $document return $::dom::accept } set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document \ -filter nodeFilter] set node [::dom::nodeIterator nextNode $iterator] set result [catch {::dom::nodeIterator nextNode $iterator} errmsg] rename nodeFilter {} list $result $errmsg } -result {0 {}} test iterator-6.2 {delete document in filter proc} -constraints {dom_c} -body { proc nodeFilter {node} { global document dom::DOMImplementation destroy $document return $::dom::accept } set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document \ -filter nodeFilter] set node [::dom::nodeIterator nextNode $iterator] set result [catch {::dom::node cget $node -nodeName} errmsg] rename nodeFilter {} list $result $errmsg } -result {1 {token not found}} test iterator-6.3 {delete iterator in filter proc} -constraints {dom_c} -body { proc nodeFilter {node} { global iterator dom::DocumentTraversal destroy $iterator return $::dom::accept } set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document \ -filter nodeFilter] set node [::dom::nodeIterator nextNode $iterator] set result [catch {::dom::nodeIterator nextNode $iterator} errmsg] rename nodeFilter {} list $result $errmsg } -result {1 {token not found}} test iterator-6.4 {recursively invoke filter proc} -constraints {dom_c} -match glob -body { proc nodeFilter {node} { global iterator set node [::dom::nodeIterator nextNode $iterator] return $::dom::accept } set document [::dom::DOMImplementation parse $xml1] set iterator [dom::DocumentTraversal createNodeIterator $document \ -filter nodeFilter] expectError { ::dom::nodeIterator nextNode $iterator } } -cleanup { rename nodeFilter {} } -result {too many nested calls * (infinite loop?)} ::tcltest::cleanupTests } namespace delete ::dom::iteratorTest return tclxml-3.3~svn11.orig/tests/tcldom/serialization.test0000644000000000000000000002211211113705304021601 0ustar rootroot# Commands covered: ::dom::DOMimplementation serialize # # This file contains a collection of tests for one or more of the # TclDOM commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # Copyright (c) 1998-2004 Zveno Pty Ltd. # # $Id: serialization.test,v 1.17 2004/09/02 21:21:39 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::serializationTest { namespace import -force ::tcltest::* variable SETUP { set doc [::dom::DOMImplementation create] set top [::dom::document createElement $doc Test] dom::node appendChild $doc $top } variable SETUP2 { eval $SETUP $top appendChild [set e1 [::dom::document createElement $top Element1]] $top appendChild [set e2 [::dom::document createElement $top Element2]] $top appendChild [set e3 [::dom::document createElement $top Element3]] } variable CLEANUP { dom::destroy $doc } # The result may or may not use empty element syntax test serialize-1.1 {single element document} -match regexp -setup $SETUP -body { ::dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result {<\?xml version=('|")1\.0('|")( encoding=('|")[^'"]+('|"))?\?> ( )?|>)} test serialize-1.2 {element-only document} -match regexp -setup $SETUP2 -body { ::dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result {<\?xml version=('|")1.0('|")( encoding=('|")[^'"]+('|"))?\?> ( )?} test serialize-1.3 {serialize element} -constraints {!dom_libxml2} -setup $SETUP2 -body { ::dom::DOMImplementation serialize $top } -result {} test serialize-1.4 {serialize non-empty element} -match regexp -setup { eval $SETUP2 $e1 appendChild [::dom::document createElement $e1 Child1] } -body { ::dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result {<\?xml version=('|")1.0('|")( encoding=('|")[^'"]+('|"))?\?> ( )?} test serialize-2.1 {missing document element} -match regexp -setup { set doc [::dom::DOMImplementation create] } -body { ::dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result {(<\?xml version=('|")1.0('|")( encoding=('|")[^'"]+('|"))?\?>)?} # The result may or may not use empty element syntax test serialize-3.1 {XML declaration: attributes in correct order} -match regexp -setup { set doc [::dom::DOMImplementation parse { }] } -body { dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result {<\?xml version=('|")1\.0('|")( encoding=('|")[^'"]+('|"))?\?> ( )?|>)} # This test fails if using TclExpat test serialize-3.2 {XML declaration: attributes in correct order} -match regexp -setup { set doc [::dom::DOMImplementation parse { }] } -body { dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result {<\?xml version=('|")1.0('|")( encoding=('|")[^'"]+('|"))? standalone=('|")yes('|")\?> ( )?|>)} test serialize-3.3 {Doctype declaration} -match regexp -setup { set doc [::dom::DOMImplementation parse { }] } -body { dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result {<\?xml version=('|")1.0('|")( encoding=('|")[^'"]+('|"))?\?> ( )?|>)} # See bug #525505 test serialize-3.4 {Document prologue} -match regexp -setup { set doc [::dom::parse { }] } -body { dom::serialize $doc } -cleanup $CLEANUP -result {<\?xml version=('|")1.0('|")( encoding=('|")[^'"]+('|"))?\?> ( )?( )?} test serialize-3.5 {Document epilogue} -match regexp -setup { set doc [::dom::parse { }] } -body { dom::serialize $doc } -cleanup $CLEANUP -result {<\?xml version=('|")1.0('|")( encoding=('|")[^'"]+('|"))?\?> ( )?( )?} # Test serialization of markup characters: variable stText "LT: < GT: > AMP: &" test serialize-4.1 {Serialization of markup characters in #PCDATA} -constraints {!dom_libxml2} -setup { set doc [dom::DOMImplementation parse $stText] } -body { dom::DOMImplementation serialize [dom::document cget $doc -documentElement] } -cleanup $CLEANUP -result $stText variable stText { } # Result may use different attribute quotes. # Also, only the '<' and '&' are required to be escaped, # but its OK for others to be as well. test serialize-4.2 {Serialization of markup characters in attribute values} -constraints {!dom_libxml2} -match regexp -setup { set doc [dom::DOMImplementation parse $stText] } -body { dom::DOMImplementation serialize [dom::document cget $doc -documentElement] } -cleanup $CLEANUP -result { )('|")/> } # CDATA Sections may or may not be serialized using CDATA Section syntax variable stText \ {some plain text more text} test serialize-4.3 {Preserve CDATA sections} -constraints {!dom_libxml2} -match regexp -setup { set doc [dom::DOMImplementation parse $stText] } -body { dom::DOMImplementation serialize [dom::document cget $doc -documentElement] } -cleanup $CLEANUP -result {some plain text ()? more text} # Test for bug #512704 test serialize-5.1 {Serialize reserved characters in attribute value} -constraints {!dom_libxml2} -match regexp -setup { set doc [dom::DOMImplementation create] set top [dom::document createElement $doc test] dom::element setAttribute $top q {"all lll" } } -body { dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result {<\?xml version=('|")1.0('|")( encoding=('|")[^'"]+('|"))?\?> } test serialize-5.1 {Serialize reserved characters in attribute value} -constraints {dom_libxml2} -match regexp -setup { set doc [dom::DOMImplementation create] set top [dom::document createElement $doc test] dom::element setAttribute $top q {"all lll" } } -body { dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result {<\?xml version=('|")1.0('|")( encoding=('|")[^'"]+('|"))?\?> } # XML Namespace support test serialize-6.1 {XML Namespaces - from parsed document} -match regexp -setup { set doc [dom::DOMImplementation parse {ABC }] } -body { dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result {<\?xml version=("|')1\.0("|')( encoding=('|")[^'"]+('|"))?\?> ( )?ABC} test serialize-6.2 {XML Namespaces - from generated document, prefix supplied} -match regexp -setup { set doc [dom::DOMImplementation create] set de [dom::document createElementNS $doc urn:test-uri test:Test] dom::document createElementNS $de urn:test-uri test:Value } -body { dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result {<\?xml version=("|')1\.0("|')( encoding=('|")[^'"]+('|"))?\?> ( )?} test serialize-6.3 {XML Namespaces - from generated document, prefix not supplied} -match regexp -setup { set doc [dom::DOMImplementation create] set de [dom::document createElementNS $doc urn:test-uri Test] dom::document createElementNS $de urn:test-uri Value } -body { dom::DOMImplementation serialize $doc } -cleanup $CLEANUP -result {<\?xml version=("|')1\.0("|')( encoding=('|")[^'"]+('|"))?\?> ( )?<[a-zA-Z0-9]+:Test xmlns:[a-zA-Z0-9]+=("|')urn:test-uri("|')><[a-zA-Z0-9]+:Value/>} # Bug 606621 test serialize-7.1 {Document prologue} -match regexp -setup { set doc [dom::parse { }] } -body { dom::serialize $doc } -cleanup { dom::destroy $doc } -result {<\?xml version=("|')1.0("|') encoding=("|')utf-8("|') standalone=("|')no("|')\?> <\?xml-stylesheet type=("|')text/xsl("|') href=("|')test_view.xsl("|')\?> } cleanupTests } namespace delete ::dom::serializationTest return tclxml-3.3~svn11.orig/tests/tcldom/doctype.test0000644000000000000000000002214711113705304020403 0ustar rootroot# Commands covered: ::dom::doctype # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 2003 Zveno Pty Ltd. # Copyright (c) 2000 Ajuba Solutions. # All rights reserved. # # RCS: @(#) $Id: doctype.test,v 1.5 2004/02/24 20:16:10 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::doctypeTest { namespace import -force ::tcltest::* test doctype-1.1 {argument parsing errors} -constraints {dom_c} -body { list [catch {dom::doctype} msg] $msg } -result "1 {wrong \# args: should be \"dom::doctype method ?args...?\"}" test doctype-1.2 {argument parsing errors} -constraints {dom_c} -body { list [catch {dom::doctype foo} msg] $msg } -result {1 {bad method "foo": must be cget or configure}} test doctype-1.3 {argument parsing errors} -constraints {dom_c} -body { list [catch {dom::doctype cget foo} msg] $msg } -result {1 {token not found}} test doctype-1.4 {argument parsing errors} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse {}] } -body { list [catch {dom::doctype cget $root} msg] $msg } -cleanup { dom::DOMImplementation destroy $root } -result {1 {not a doctype type node}} test doctype-1.5 {argument parsing errors} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse {}] set doctype [dom::document cget $root -doctype] } -body { list [catch {dom::doctype cget $doctype} msg] $msg } -cleanup { dom::DOMImplementation destroy $root } -result "1 {wrong \# args: should be \"dom::doctype cget token option\"}" test doctype-1.6 {argument parsing errors} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse {}] set doctype [dom::document cget $root -doctype] } -body { list [catch {dom::doctype cget $doctype -foo} msg] $msg } -cleanup { dom::DOMImplementation destroy $root } -result {1 {unknown option '-foo', should be -internalSubset, -nodeName, -publicId, or -systemId}} test doctype-1.7 {argument parsing errors} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse {}] set doctype [dom::document cget $root -doctype] } -body { list [catch {dom::doctype configure $doctype} msg] $msg } -cleanup { dom::DOMImplementation destroy $root } -result {1 {doctype configure method not implemented}} test doctype-1.8 {argument parsing errors} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse {}] set doctype [dom::document cget $root -doctype] } -body { list [catch {dom::doctype foo $doctype} msg] $msg } -cleanup { dom::DOMImplementation destroy $root } -result {1 {bad method "foo": must be cget or configure}} test doctype-2.1 {cget options, -systemId, empty} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse {}] set doctype [dom::document cget $root -doctype] } -body { dom::doctype cget $doctype -systemId } -cleanup { dom::DOMImplementation destroy $root } -result {} test doctype-2.2 {cget options, -systemId, non-empty SYSTEM} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse { }] set doctype [dom::document cget $root -doctype] } -body { set result [dom::doctype cget $doctype -systemId] } -cleanup { dom::DOMImplementation destroy $root } -result foo.dtd test doctype-2.3 {cget options, -systemId, non-empty PUBLIC} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse { }] set doctype [dom::document cget $root -doctype] } -body { dom::doctype cget $doctype -systemId } -cleanup { dom::DOMImplementation destroy $root } -result foo.dtd test doctype-2.4 {cget options, -systemId, non-empty internal subset} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse { ]>}] set doctype [dom::document cget $root -doctype] } -body { dom::doctype cget $doctype -systemId } -cleanup { dom::DOMImplementation destroy $root } -result foo.dtd test doctype-3.1 {cget options, -publicId, empty} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse {}] set doctype [dom::document cget $root -doctype] } -body { dom::doctype cget $doctype -publicId } -cleanup { dom::DOMImplementation destroy $root } -result {} test doctype-3.2 {cget options, -publicId, non-empty SYSTEM} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse { }] set doctype [dom::document cget $root -doctype] } -body { dom::doctype cget $doctype -publicId } -cleanup { dom::DOMImplementation destroy $root } -result {} test doctype-3.3 {cget options, -publicId, non-empty PUBLIC} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse { }] set doctype [dom::document cget $root -doctype] } -body { dom::doctype cget $doctype -publicId } -cleanup { dom::DOMImplementation destroy $root } -result --Foo-- test doctype-3.4 {cget options, -publicId, non-empty internal subset} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse { ]>}] set doctype [dom::document cget $root -doctype] } -body { dom::doctype cget $doctype -publicId } -cleanup { dom::DOMImplementation destroy $root } -result --Foo-- test doctype-4.1 {cget options, -nodeName, empty} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse {}] set doctype [dom::document cget $root -doctype] } -body { set result [dom::doctype cget $doctype -nodeName] } -cleanup { dom::DOMImplementation destroy $root } -result foo test doctype-4.2 {cget options, -nodeName, non-empty SYSTEM} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse { }] set doctype [dom::document cget $root -doctype] } -body { dom::doctype cget $doctype -nodeName } -cleanup { dom::DOMImplementation destroy $root } -result foo test doctype-4.3 {cget options, -nodeName, non-empty PUBLIC} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse { }] set doctype [dom::document cget $root -doctype] } -body { dom::doctype cget $doctype -nodeName } -cleanup { dom::DOMImplementation destroy $root } -result foo test doctype-4.4 {cget options, -nodeName, non-empty internal subset} -constraints {dom_c} -setup { set root [dom::DOMImplementation parse { ]>}] set doctype [dom::document cget $root -doctype] } -body { dom::doctype cget $doctype -nodeName } -cleanup { dom::DOMImplementation destroy $root } -result foo test doctype-5.1 {cget options, -internalSubset} -constraints {dom_c} -setup { # Not implemented yet set root [dom::DOMImplementation parse { ]>}] set doctype [dom::document cget $root -doctype] } -body { dom::doctype cget $doctype -internalSubset } -cleanup { dom::DOMImplementation destroy $root } -result {} test doctype-6.1 {createDocumentType} -constraints {!dom_libxml2} -body { set dt [dom::DOMImplementation createDocumentType test {} {}] ok } -cleanup { dom::destroy $dt } -result {} test doctype-6.2 {createDocumentType w/- internal subset} -constraints {!dom_libxml2} -body { set dt [dom::DOMImplementation createDocumentType test {} {} { }] ok } -cleanup { dom::destroy $dt } -result {} test doctype-6.3 {createDocumentType: use with createDocument} -constraints {!dom_libxml2} -setup { set dt [dom::DOMImplementation createDocumentType test {} {}] } -body { set doc [dom::DOMImplementation createDocument {} test $dt] ok } -cleanup { dom::destroy $doc dom::destroy $dt } -result {} test doctype-6.4 {createDocumentType: use with createDocument} -constraints {!dom_libxml2} -setup { set dt [dom::DOMImplementation createDocumentType test {} {}] set doc [dom::DOMImplementation createDocument {} test $dt] } -body { string equal $dt [$doc cget -doctype] } -cleanup { dom::destroy $doc dom::destroy $dt } -result 1 cleanupTests } namespace delete ::dom::doctypeTest return tclxml-3.3~svn11.orig/tests/tcldom/events.test0000644000000000000000000005175311113705304020245 0ustar rootroot# Commands covered: ::dom::event # # This file contains a collection of tests for one or more of the # TclDOM commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # Copyright (c) 2000-2004 Zveno Pty Ltd. # # $Id: events.test,v 1.7 2004/01/15 08:18:35 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tcldomutils.tcl] testPackage dom namespace eval ::dom::eventsTest { namespace import -force ::tcltest::* testConstraint Events \ [dom::DOMImplementation hasFeature Events 1.0] # Event listener procs proc HandleEvent evid { variable data lappend data(currNode) [dom::event cget $evid -currentNode] lappend data(type) [dom::event cget $evid -type] lappend data(phase) [dom::event cget $evid -eventPhase] lappend data(target) [dom::event cget $evid -target] } proc HandleMutation evid { variable data lappend data(type) [dom::event cget $evid -type] lappend data(target) [dom::event cget $evid -target] lappend data(related) [$evid cget -relatedNode] lappend data(prev) [$evid cget -prevValue] lappend data(new) [$evid cget -newValue] lappend data(attrname) [$evid cget -attrName] lappend data(attrchange) [$evid cget -attrChange] } variable SETUP { set doc [dom::create] set top [dom::document createElement $doc Top] } variable BASICSETUP { eval $SETUP set l1 [dom::document createElement $top Node1] set l2 [dom::document createElement $top Node2] set l1_1 [dom::document createElement $l1 Node1_1] set l1_2 [dom::document createElement $l1 Node1_2] set l2_1 [dom::document createElement $l2 Node2_1] set l2_2 [dom::document createElement $l2 Node2_2] variable data catch {unset data} array set data { currNode {} type {} phase {} target {} } } variable E2SETUP { eval $SETUP set event [$doc createEvent click] } variable E2UISETUP { eval $SETUP set event [$doc createEvent DOMActivate] } variable EVENTSETUP { eval $SETUP set event [$doc createEvent DOMActivate] dom::event initUIEvent $event DOMActivate 0 1 {} 2 } variable MOUSEEVENTSETUP { eval $SETUP set event [$doc createEvent click] dom::event initMouseEvent $event click 0 1 {} 2 3 4 5 6 ctrl alt shift meta 7 $top } variable HANDLERSETUP { eval $BASICSETUP dom::node addEventListener $l1 DOMActivate [namespace code HandleEvent] set event [$doc createEvent DOMActivate] $event initUIEvent DOMActivate 1 1 {} 2 } variable CAPTURESETUP { eval $BASICSETUP dom::node addEventListener $l1 DOMActivate [namespace code HandleEvent] -usecapture 1 set event [$doc createEvent DOMActivate] $event initUIEvent DOMActivate 1 1 {} 2 } variable CAPTUREDOCSETUP { eval $BASICSETUP dom::node addEventListener $doc DOMActivate [namespace code HandleEvent] -usecapture 1 set event [$doc createEvent DOMActivate] $event initUIEvent DOMActivate 1 1 {} 2 } variable MUTATIONSETUP { eval $BASICSETUP foreach type {DOMSubtreeModified DOMNodeInserted DOMNodeRemoved DOMNodeInsertedIntoDocument DOMNodeRemovedFromDocument DOMAttrModified DOMCharacterDataModified} { dom::node addEventListener $doc $type [namespace code HandleMutation] -usecapture 1 } } variable CLEANUP { dom::destroy $doc catch {unset data} } # Test: # 1 creating an event test event-1.0 {event creation} -constraints Events -setup $SETUP -body { set event [dom::document createEvent $doc click] dom::isNode $event } -cleanup $CLEANUP -result 1 test event-1.0.1 {event creation} -constraints Events -setup $SETUP -body { set event [$doc createEvent click] dom::isNode $event } -cleanup $CLEANUP -result 1 test event-1.1 {event creation: user-defined event type} -constraints Events -setup $SETUP -body { set event [dom::document createEvent $doc myEvent] dom::isNode $event } -cleanup $CLEANUP -result 1 test event-1.2 {event creation: too few arguments} -constraints Events -match glob -setup $SETUP -body { expectError { dom::document createEvent $doc } } -cleanup $CLEANUP -result {wrong # args:*} test event-1.3 {event creation: too many arguments} -constraints Events -match glob -setup $SETUP -body { expectError { dom::document createEvent $doc click here } } -cleanup $CLEANUP -result {wrong # args:*} # 2 initialising an event test event-2.0 {initialise event} -constraints Events -setup $E2SETUP -body { dom::event initEvent $event click 1 1 } -cleanup $CLEANUP -result {} test event-2.0.1 {initialise event} -constraints Events -setup $E2SETUP -body { $event initEvent click 1 1 } -cleanup $CLEANUP -result {} test event-2.1 {initialise event: user-defined type} -constraints Events -setup { eval $SETUP set event [dom::document createEvent $doc myEvent] } -body { dom::event initEvent $event myEvent 1 1 } -cleanup $CLEANUP -result {} test event-2.2 {initialise event: too few arguments} -constraints Events -match glob -setup $E2SETUP -body { expectError { dom::event initEvent $event } } -cleanup $CLEANUP -result {wrong # args:*} test event-2.3 {initialise event: too few arguments} -constraints Events -match glob -setup $E2SETUP -body { expectError { dom::event initEvent $event click } } -cleanup $CLEANUP -result {wrong # args:*} test event-2.4 {initialise event: too few arguments} -constraints Events -match glob -setup $E2SETUP -body { expectError { dom::event initEvent $event click 1 } } -cleanup $CLEANUP -result {wrong # args:*} test event-2.5 {initialise event: too many arguments} -constraints Events -match glob -setup $E2SETUP -body { expectError { dom::event initEvent $event click 1 1 1 } } -cleanup $CLEANUP -result {wrong # args:*} test event-2.6 {initialise UI event} -constraints Events -setup $E2UISETUP -body { dom::event initUIEvent $event DOMActivate 1 1 {} 1 } -cleanup $CLEANUP -result {} test event-2.7 {initialise UI event: too few arguments} -constraints Events -setup $E2UISETUP -match glob -body { expectError { dom::event initUIEvent $event DOMActivate 1 1 } } -cleanup $CLEANUP -result {wrong # args:*} test event-2.8 {initialise UI event: no optional arguments} -constraints Events -setup $E2UISETUP -body { dom::event initUIEvent $event DOMActivate 1 1 {} } -cleanup $CLEANUP -result {} test event-2.9 {initialise UI event: too many arguments} -constraints Events -setup $E2UISETUP -match glob -body { expectError { dom::event initUIEvent $event DOMActivate 1 1 {} 2 extra } } -cleanup $CLEANUP -result {wrong # args:*} test event-2.10 {initialise mouse event} -constraints Events -setup $E2SETUP -body { dom::event initMouseEvent $event click 1 1 {} 1 100 100 10 10 {} {} {} {} 2 {} } -cleanup $CLEANUP -result {} test event-2.11 {initialise mouse event: too few arguments} -constraints Events -match glob -setup { eval $SETUP set event [dom::document createEvent $doc mousedown] } -body { expectError { dom::event initMouseEvent $event } } -cleanup $CLEANUP -result {wrong # args:*} test event-2.12 {initialise mouse event: too few arguments} -constraints Events -match glob -setup { eval $SETUP set event [dom::document createEvent $doc mouseup] } -body { expectError { dom::event initMouseEvent $event mouseup 1 1 {} 2 200 100 20 30 } } -cleanup $CLEANUP -result {wrong # args:*} test event-2.13 {initialise mouse event: too many arguments} -constraints Events -match glob -setup { eval $SETUP set event [dom::document createEvent $doc mouseover] } -body { expectError { dom::event initMouseEvent $event mouseover 1 1 {} 1 100 100 10 10 {} {} {} {} 2 {} toomany } } -cleanup $CLEANUP -result {wrong # args:*} test event-2.14 {initialise mutation event} -constraints Events -setup { eval $SETUP set event [dom::document createEvent $doc DOMSubtreeModified] } -body { dom::event initMutationEvent $event click 1 1 {} {} {} {} {} } -cleanup $CLEANUP -result {} test event-2.15 {initialise mutation event: too few arguments} -constraints Events -match glob -setup { eval $SETUP set event [dom::document createEvent $doc DOMNodeInserted] } -body { expectError { dom::event initMutationEvent $event } } -cleanup $CLEANUP -result {wrong # args:*} test event-2.16 {initialise mutation event: too few arguments} -constraints Events -match glob -setup { eval $SETUP set event [dom::document createEvent $doc DOMNodeRemoved] } -body { expectError { dom::event initMutationEvent $event DOMNodeRemoved 1 1 {} } } -cleanup $CLEANUP -result {wrong # args:*} test event-2.17 {initialise mutation event: too many arguments} -constraints Events -match glob -setup { eval $SETUP set event [dom::document createEvent $doc DOMAttrModified] } -body { expectError { dom::event initMutationEvent $event DOMAttrModified 1 1 $top old new my_attribute change extra } } -cleanup $CLEANUP -result {wrong # args:*} # 3 the event command test event-3.1 {dom::event command} -constraints Events -setup $SETUP -body { set event [dom::document createEvent $doc DOMActivate] $event initEvent DOMActivate 1 1 } -cleanup $CLEANUP -result {} test event-3.2 {dom::event cget -type} -constraints Events -setup $EVENTSETUP -body { dom::event cget $event -type } -cleanup $CLEANUP -result DOMActivate test event-3.2.1 {dom::event cget -type} -constraints Events -setup $EVENTSETUP -body { $event cget -type } -cleanup $CLEANUP -result DOMActivate test event-3.3 {dom::event cget -target} -constraints Events -setup $EVENTSETUP -body { $event cget -target } -cleanup $CLEANUP -result {} test event-3.4 {dom::event cget -currentNode} -constraints Events -setup $EVENTSETUP -body { $event cget -currentNode } -cleanup $CLEANUP -result {} test event-3.5 {dom::event cget -eventPhase} -constraints Events -setup $EVENTSETUP -body { $event cget -eventPhase } -cleanup $CLEANUP -result {} test event-3.6 {dom::event cget -bubbles} -constraints Events -setup $EVENTSETUP -body { $event cget -bubbles } -cleanup $CLEANUP -result 0 test event-3.7 {dom::event cget -cancelable} -constraints Events -setup $EVENTSETUP -body { $event cget -cancelable } -cleanup $CLEANUP -result 1 test event-3.8 {dom::event cget -timeStamp} -constraints Events -match regexp -setup $EVENTSETUP -body { $event cget -timeStamp } -cleanup $CLEANUP -result {[0-9]+} test event-3.9 {dom::event cget -detail} -constraints Events -setup $EVENTSETUP -body { $event cget -detail } -cleanup $CLEANUP -result 2 test event-3.10 {dom::event cget -view} -constraints Events -setup $EVENTSETUP -body { $event cget -view } -cleanup $CLEANUP -result {} test event-3.11 {dom::event cget -screenX} -constraints Events -setup $MOUSEEVENTSETUP -body { $event cget -screenX } -cleanup $CLEANUP -result 3 test event-3.12 {dom::event cget -screenY} -constraints Events -setup $MOUSEEVENTSETUP -body { $event cget -screenY } -cleanup $CLEANUP -result 4 test event-3.13 {dom::event cget -clientX} -constraints Events -setup $MOUSEEVENTSETUP -body { $event cget -clientX } -cleanup $CLEANUP -result 5 test event-3.14 {dom::event cget -clientY} -constraints Events -setup $MOUSEEVENTSETUP -body { $event cget -clientY } -cleanup $CLEANUP -result 6 test event-3.15 {dom::event cget -ctrlKey} -constraints Events -setup $MOUSEEVENTSETUP -body { $event cget -ctrlKey } -cleanup $CLEANUP -result ctrl test event-3.16 {dom::event cget -altKey} -constraints Events -setup $MOUSEEVENTSETUP -body { $event cget -altKey } -cleanup $CLEANUP -result alt test event-3.17 {dom::event cget -shiftKey} -constraints Events -setup $MOUSEEVENTSETUP -body { $event cget -shiftKey } -cleanup $CLEANUP -result shift test event-3.18 {dom::event cget -metaKey} -constraints Events -setup $MOUSEEVENTSETUP -body { $event cget -metaKey } -cleanup $CLEANUP -result meta test event-3.19 {dom::event cget -button} -constraints Events -setup $MOUSEEVENTSETUP -body { $event cget -button } -cleanup $CLEANUP -result 7 test event-3.20 {dom::event cget -relatedNode} -constraints Events -setup $MOUSEEVENTSETUP -body { $top isSameNode [$event cget -relatedNode] } -cleanup $CLEANUP -result 1 # TODO: options read-only # 4 destroying an event test event-4.1 {destroy event} -constraints Events -setup $EVENTSETUP -body { dom::destroy $event list [dom::isNode $event] [info commands $event] } -cleanup $CLEANUP -result {0 {}} test event-4.2 {destroy event: delete Tcl command} -constraints Events -setup $EVENTSETUP -match glob -body { rename $event {} dom::isNode $event } -cleanup $CLEANUP -result 0 # 5 adding an event listener test event-5.1 {register event listener} -constraints {Events} -setup $BASICSETUP -body { dom::node addEventListener $l1_1 click HandleEvent } -cleanup $CLEANUP -result {} test event-5.2 {register capturing event listener} -constraints {Events} -setup $BASICSETUP -body { dom::node addEventListener $l1_1 click HandleEvent -usecapture 1 } -cleanup $CLEANUP -result {} test event-5.3 {get event listener} -constraints {Events} -setup { eval $BASICSETUP dom::node addEventListener $l1_1 click HandleEvent } -body { dom::node addEventListener $l1_1 click } -cleanup $CLEANUP -result {HandleEvent} test event-5.4 {get event listener - bubbling vs capturing events} -constraints {Events} -setup { eval $BASICSETUP dom::node addEventListener $l1_1 click HandleEvent } -body { dom::node addEventListener $l1_1 click -usecapture 1 } -cleanup $CLEANUP -result {} test event-5.5 {get event listener} -constraints {Events} -setup { eval $BASICSETUP dom::node addEventListener $l1_1 click HandleEvent -usecapture 1 } -body { dom::node addEventListener $l1_1 click -usecapture 1 } -cleanup $CLEANUP -result {HandleEvent} test event-5.6 {get event listener - bubbling vs capturing events} -constraints {Events} -setup { eval $BASICSETUP dom::node addEventListener $l1_1 click HandleEvent -usecapture 1 } -body { dom::node addEventListener $l1_1 click } -cleanup $CLEANUP -result {} test event-5.7 {get event listener: multiple listeners} -constraints {Events} -setup { eval $BASICSETUP dom::node addEventListener $l1_1 click HandleEvent dom::node addEventListener $l1_1 click YetAnotherEventListener } -body { lsort [dom::node addEventListener $l1_1 click] } -cleanup $CLEANUP -result {HandleEvent YetAnotherEventListener} test event-5.8 {register event listener: too few arguments} -constraints {Events} -match glob -setup $BASICSETUP -body { expectError { dom::node addEventListener $l1_1 } } -cleanup $CLEANUP -result {wrong # args:*} test event-5.9 {register event listener: too many arguments} -constraints {Events} -match glob -setup $BASICSETUP -body { expectError { dom::node addEventListener $l1_1 click HandleEvent tooMany } } -cleanup $CLEANUP -result {missing value*} # 6 removing an event listener test event-6.1 {remove event listener} -constraints Events -setup { eval $BASICSETUP $l1_1 addEventListener click HandleEvent } -body { dom::node removeEventListener $l1_1 click HandleEvent } -cleanup $CLEANUP -result {} test event-6.2 {remove capturing event listener} -constraints {Events} -setup { eval $BASICSETUP $l1_1 addEventListener click HandleEvent -usecapture 1 } -body { dom::node removeEventListener $l1_1 click HandleEvent -usecapture 1 } -cleanup $CLEANUP -result {} test event-6.3 {remove event listener: multiple listeners} -constraints Events -setup { eval $BASICSETUP $l1_1 addEventListener click HandleEvent $l1_1 addEventListener click YetAnotherEventHandler } -body { dom::node removeEventListener $l1_1 click HandleEvent $l1_1 addEventListener click } -cleanup $CLEANUP -result YetAnotherEventHandler # 7 dispatching an event, w/- and w/o a listener test event-7.1 {dispatch an event, bubbling listener} -constraints {Events} -setup $HANDLERSETUP -body { $l1_1 dispatchEvent $event list [$l1 isSameNode $data(currNode)] $data(type) $data(phase) [$l1_1 isSameNode $data(target)] } -cleanup $CLEANUP -result {1 DOMActivate bubbling_phase 1} test event-7.2 {dispatch an event, capturing listener, doc} -constraints {Events} -setup $CAPTUREDOCSETUP -body { $l1_1 dispatchEvent $event list [dom::node isSameNode $doc $data(currNode)] $data(type) $data(phase) [$l1_1 isSameNode $data(target)] } -cleanup $CLEANUP -result {1 DOMActivate capturing_phase 1} test event-7.3 {dispatch an event, capturing listener, node} -constraints {Events} -setup $CAPTURESETUP -body { $l1_1 dispatchEvent $event list [dom::node isSameNode $l1 $data(currNode)] $data(type) $data(phase) [$l1_1 isSameNode $data(target)] } -cleanup $CLEANUP -result {1 DOMActivate capturing_phase 1} test event-7.4 {dispatch an event, no listener} -constraints {Events} -setup { eval $BASICSETUP set event [$doc createEvent DOMActivate] dom::event initUIEvent $event DOMActivate 0 1 {} 2 } -body { $l1_1 dispatchEvent $event llength $data(type) } -cleanup $CLEANUP -result 0 test event-7.5 {dispatch an event, user-defined type} -constraints {Events} -setup { eval $BASICSETUP $l1 addEventListener test [namespace code HandleEvent] set event [$doc createEvent test] dom::event initEvent $event test 1 1 } -body { $l1_1 dispatchEvent $event list [dom::node isSameNode $l1 $data(currNode)] $data(type) $data(phase) [$l1_1 isSameNode $data(target)] } -cleanup $CLEANUP -result {1 test bubbling_phase 1} # 7.X cancelling propagation: cancel allowed, cancel not allowed # 7.X no bubbles option: make sure bubbling phase does not occur # 8 posting an event, w/- and w/o a listener test event-8.1 {Post UI event} -constraints {Events} -setup { eval $BASICSETUP dom::node addEventListener $doc DOMActivate [namespace code HandleEvent] } -body { dom::event postUIEvent $l1_1 DOMActivate -detail 2 list [dom::node isSameNode $doc $data(currNode)] $data(type) $data(phase) [$l1_1 isSameNode $data(target)] } -cleanup $CLEANUP -result {1 DOMActivate bubbling_phase 1} test event-8.2 {Post mouse event} -constraints {Events} -setup { eval $BASICSETUP dom::node addEventListener $doc click [namespace code HandleEvent] } -body { dom::event postMouseEvent $l1_1 click -button 3 list [dom::node isSameNode $doc $data(currNode)] $data(type) $data(phase) [$l1_1 isSameNode $data(target)] } -cleanup $CLEANUP -result {1 click bubbling_phase 1} test event-8.3 {Post mutation event} -constraints {Events} -setup { eval $BASICSETUP dom::node addEventListener $doc DOMSubtreeModified [namespace code HandleEvent] } -body { dom::event postMutationEvent $l1_1 DOMSubtreeModified -relatedNode $l1 list [dom::node isSameNode $doc $data(currNode)] $data(type) $data(phase) [$l1_1 isSameNode $data(target)] } -cleanup $CLEANUP -result {1 DOMSubtreeModified bubbling_phase 1} # 9 Mutation events test event-9.1 {Mutation event: insert node} -constraints {Events} -setup $MUTATIONSETUP -body { set new [dom::document createElement $top New] list $data(type) \ [list [$new isSameNode [lindex $data(target) 0]] [$new isSameNode [lindex $data(target) 1]] [$top isSameNode [lindex $data(target) 2]]] \ [list [$top isSameNode [lindex $data(related) 0]] [lindex $data(related) 1] [lindex $data(related) 2]] \ $data(prev) $data(new) $data(attrname) $data(attrchange) } -cleanup $CLEANUP -result {{DOMNodeInserted DOMNodeInsertedIntoDocument DOMSubtreeModified} {1 1 1} {1 {} {}} {{} {} {}} {{} {} {}} {{} {} {}} {{} {} {}}} test event-9.2 {Mutation event: move node} -constraints {Events} -setup $MUTATIONSETUP -body { $l2 appendChild $l1_1 list $data(type) \ [list [$l1_1 isSameNode [lindex $data(target) 0]] [$l1 isSameNode [lindex $data(target) 1]] [$l2 isSameNode [lindex $data(target) 2]] [$l1_1 isSameNode [lindex $data(target) 3]]] \ [list [$l1 isSameNode [lindex $data(related) 0]] [lindex $data(related) 1] [lindex $data(related) 2] [lindex $data(related) 3]] \ $data(prev) $data(new) $data(attrname) $data(attrchange) } -cleanup $CLEANUP -result {{DOMNodeRemoved DOMSubtreeModified DOMSubtreeModified DOMNodeInserted} {1 1 1 1} {1 {} {} {}} {{} {} {} {}} {{} {} {} {}} {{} {} {} {}} {{} {} {} {}}} test event-9.3 {Mutation event: replace node} -constraints {Events} -setup $MUTATIONSETUP -body { $l2 replaceChild $l1_1 $l2_1 list $data(type) \ [list [$l1_1 isSameNode [lindex $data(target) 0]] [$l1 isSameNode [lindex $data(target) 1]] [$l1_1 isSameNode [lindex $data(target) 2]]] \ [list [$l1 isSameNode [lindex $data(related) 0]] [lindex $data(related) 1] [lindex $data(related) 2]] \ $data(prev) $data(new) $data(attrname) $data(attrchange) } -cleanup $CLEANUP -result {{DOMNodeRemoved DOMSubtreeModified DOMNodeInserted} {1 1 1} {1 {} {}} {{} {} {}} {{} {} {}} {{} {} {}} {{} {} {}}} # removeChild # attributes: create, change, remove cleanupTests } namespace delete ::dom::eventsTest return tclxml-3.3~svn11.orig/tests/tcldom/all.tcl0000755000000000000000000000120411113705304017301 0ustar rootroot# all.tcl -- # # This file contains a support module to run all of the Tcl # tests. It must be invoked using "source all.test" by # a calling tcl script that has loaded the parser class it wishes to # test in this directory. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 2003 Zveno Pty Ltd # Copyright (c) 1998-1999 by Scriptics Corporation. # # All rights reserved. # # RCS: @(#) $Id: all.tcl,v 1.4 2003/12/03 20:06:36 balls Exp $ package require Tcl 8.4 package require tcltest 2.2 tcltest::configure -testdir [file dirname [file normalize [info script]]] eval tcltest::configure $argv tcltest::runAllTests tclxml-3.3~svn11.orig/tests/tcldom/README0000644000000000000000000000015111113705304016702 0ustar rootrootTclDOM Test Suite ----------------- To run the tests, type "tclsh all.tcl" See tcltest(n) for details. tclxml-3.3~svn11.orig/tests/testutils.tcl0000644000000000000000000001245611113705304017317 0ustar rootroot# testutils.tcl -- # # Auxilliary utilities for use with the tcltest package. # Author: Joe English # Version: 1.1 # # This file is hereby placed in the public domain. # # $Id: testutils.tcl,v 1.3 2004/02/20 09:15:53 balls Exp $ variable tracing 0 ;# Set to '1' to enable the 'trace' command variable tracingErrors 0 ;# If set, 'expectError' prints error messages # ok -- # Returns an empty string. # May be used as the last statement in test scripts # that are only evaluated for side-effects or in cases # where you just want to make sure that an operation succeeds # proc ok {} { return {} } # result result -- # Just returns $result # proc result {result} { return $result } # tracemsg msg -- # Prints tracing message if $::tracing is nonzero. # proc tracemsg {string} { if {$::tracing} { puts $::tcltest::outputChannel $string } } # assert expr ?msg? -- # Evaluates 'expr' and signals an error # if the condition is not true. # proc assert {expr {message ""}} { if {![uplevel 1 [list expr $expr]]} { return -code error "Assertion {$expr} failed:\n$message" } } # expectError script ? pattern ? -- # Evaluate 'script', which is expected to fail # with an error message matching 'pattern'. # # Returns the error message if the script 'correctly' fails, # raises an error otherwise proc expectError {script {pattern "*"}} { set rc [catch [list uplevel 1 $script] result] if {$::tracingErrors} { puts stderr "==> [string replace $result 70 end ...]" } set rmsg [string replace $result 40 end ...] if {$rc != 1} { return -code error \ "Expected error, got '$rmsg' (rc=$rc)" } return $result } # sortedarray -- # # Return the contents of an array, sorted by index proc sortedarray arrName { upvar 1 $arrName thearray set result {} foreach idx [lsort [array names thearray]] { lappend result $idx $thearray($idx) } return $result } # compareNodes # Compares two nodes, taking implementations into account proc compareNodes {node1 node2} { if {[::tcltest::testConstraint dom_libxml2] || [::tcltest::testConstraint dom_tcl]} { ::dom::node isSameNode $node1 $node2 } else { return [expr ![string compare $node1 $node2]] } } # compareNodeList list1 list2 # Compares two lists of DOM nodes, in an ordered fashion. # NB. the node identities are compared, not their tokens. proc compareNodeList {list1 list2} { if {[llength $list1] != [llength $list2]} { return 0 } foreach node1 $list1 node2 $list2 { if {![compareNodes $node1 $node2]} { return 0 } } return 1 } # compareNodeset set1 set2 # Compares two sets of DOM nodes, in an unordered fashion. # NB. the node identities are compared, not their tokens. proc compareNodeset {set1 set2} { if {[llength $set1] != [llength $set2]} { return 0 } foreach node1 [lsort $set1] node2 [lsort $set2] { if {![compareNodes $node1 $node2]} { return 0 } } return 1 } # checkTree doc list # Tests that a DOM tree has a structure specified as a Tcl list proc checkTree {node spec {checktype 1}} { if {[dom::node cget $node -nodeType] == "document"} { if {$checktype} { if {[lindex [lindex $spec 0] 0] == "doctype"} { set doctype [dom::document cget $node -doctype] if {[dom::node cget $doctype -nodeType] != "documentType"} { return 0 } if {[dom::documenttype cget $doctype -name] != [lindex [lindex $spec 0] 1]} { return 0 } # Should also check external identifiers and internal subset set spec [lrange $spec 1 end] } } } foreach child [dom::node children $node] specchild $spec { switch [lindex $specchild 0] { element { if {[dom::node cget $child -nodeType] != "element"} { return 0 } if {[dom::node cget $child -nodeName] != [lindex $specchild 1]} { return 0 } foreach {name value} [lindex $specchild 2] { if {[dom::element getAttribute $child $name] != $value} { return 0 } } set result [checkTree $child [lindex $specchild 3]] if {!$result} { return 0 } } pi { if {[dom::node cget $child -nodeType] != "processingInstruction"} { return 0 } if {[dom::node cget $child -nodeName] != [lindex $specchild 1]} { return 0 } } dtd { if {[dom::node cget $child -nodeType] != "dtd"} { return 0 } } text { if {[dom::node cget $child -nodeType] != "textNode"} { return 0 } if {[dom::node cget $child -nodeValue] != [lindex $specchild 1]} { return 0 } } default { } } } return 1 } # testPackage package ?version? # Loads specified package with 'package require $package $version', # then prints message describing how the package was loaded. # # This is useful when you've got several versions of a # package to lying around and want to make sure you're # testing the right one. # proc testPackage {package {version ""}} { if {$package == "libxml2"} { # "libxml2" is shorthand for xml::libxml2 set package xml::libxml2 } if {![catch "package present $package $version"]} { return } set rc [catch "package require $package $version" result] if {$rc} { return -code $rc $result } set version $result set loadScript [package ifneeded $package $version] puts $::tcltest::outputChannel \ "Loaded $package version $version via {$loadScript}" return; } #*EOF* tclxml-3.3~svn11.orig/tests/tclxslt/0000755000000000000000000000000011574742515016260 5ustar rootroottclxml-3.3~svn11.orig/tests/tclxslt/tclxsltutils.tcl0000644000000000000000000000055311113705304021525 0ustar rootroot# tclxmlutils.tcl -- # # This script prepares the testing environment for TclXML. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 2003 Zveno Pty Ltd. # # $Id: tclxmlutils.tcl,v 1.2 2003/12/03 20:06:37 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] .. testutils.tcl] eval tcltest::configure $argv tclxml-3.3~svn11.orig/tests/tclxslt/test.xml0000644000000000000000000000255611113705304017751 0ustar rootroot
About Zveno Ms Polly Ball Zveno is a dedicated XML company, providing a comprehensive suite of services including consultancy, scheduled and in-house training and customised tools. Established in 1996, Zveno services a variety of clients worldwide. Our mission is to utilise the wealth of both open source and commercially produced packages to customise solutions to your XML requirements. Our dedicated vendor neutral stance coupled with our notably qualified staff, gives us a unique edge within the growing wealth of XML related companies operating today. Zveno offices are located in Canberra, ACT, Australia, and Perth, WA, Australia. You may contact us: by email info@zveno.com by phone +61 2 6242 4099 by fax +61 2 6242 4099 by snail mail
LPO Box A64 ANU CanberraACT2601 Australia
tclxml-3.3~svn11.orig/tests/tclxslt/test2-1.mod0000644000000000000000000000002611113705304020136 0ustar rootrootHere is some content tclxml-3.3~svn11.orig/tests/tclxslt/transform-1.3.xsl0000644000000000000000000003460411113705304021311 0ustar rootroot <xsl:value-of select="//article/artheader/title"/>

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

tclxml-3.3~svn11.orig/tests/tclxslt/testAB.xml0000644000000000000000000000006211113705304020142 0ustar rootroot Main test document tclxml-3.3~svn11.orig/tests/tclxslt/testutils.tcl0000644000000000000000000001060111113705304021002 0ustar rootroot# # testutils.tcl -- # # Auxilliary utilities for use with the tcltest package. # Author: Joe English # Version: 1.1 # # This file is hereby placed in the public domain. # variable tracing 0 ;# Set to '1' to enable the 'trace' command variable tracingErrors 0 ;# If set, 'expectError' prints error messages # ok -- # Returns an empty string. # May be used as the last statement in test scripts # that are only evaluated for side-effects or in cases # where you just want to make sure that an operation succeeds # proc ok {} { return {} } # result result -- # Just returns $result # proc result {result} { return $result } # tracemsg msg -- # Prints tracing message if $::tracing is nonzero. # proc tracemsg {string} { if {$::tracing} { puts $::tcltest::outputChannel $string } } # assert expr ?msg? -- # Evaluates 'expr' and signals an error # if the condition is not true. # proc assert {expr {message ""}} { if {![uplevel 1 [list expr $expr]]} { return -code error "Assertion {$expr} failed:\n$message" } } # expectError script ? pattern ? -- # Evaluate 'script', which is expected to fail # with an error message matching 'pattern'. # # Returns the error message if the script 'correctly' fails, # raises an error otherwise proc expectError {script {pattern "*"}} { set rc [catch [list uplevel 1 $script] result] if {$::tracingErrors} { puts stderr "==> [string replace $result 70 end ...]" } set rmsg [string replace $result 40 end ...] if {$rc != 1} { return -code error \ "Expected error, got '$rmsg' (rc=$rc)" } return $result } # comparenodes # Compares two nodes, taking implementations into account proc comparenodes {node1 node2} { if {[::tcltest::testConstraint dom_libxml2] || [::tcltest::testConstraint dom_tcl]} { ::dom::node isSameNode $node1 $node2 } else { return [expr ![string compare $node1 $node2]] } } # nodelist list1 list2 # Compares two lists of DOM nodes, in an ordered fashion. # NB. the node identities are compared, not their tokens. proc nodelist {list1 list2} { if {[llength $list1] != [llength $list2]} { return 0 } foreach node1 $list1 node2 $list2 { if {![comparenodes $node1 $node2]} { return 0 } } return 1 } # nodeset set1 set2 # Compares two sets of DOM nodes, in an unordered fashion. # NB. the node identities are compared, not their tokens. proc nodeset {set1 set2} { if {[llength $set1] != [llength $set2]} { return 0 } foreach node1 [lsort $set1] node2 [lsort $set2] { if {![comparenodes $node1 $node2]} { return 0 } } return 1 } # checkTree doc list # Tests that a DOM tree has a structure specified as a Tcl list proc checkTree {node spec} { foreach child [dom::node children $node] specchild $spec { switch [lindex $specchild 0] { element { if {[dom::node cget $child -nodeType] != "element"} { return 0 } if {[dom::node cget $child -nodeName] != [lindex $specchild 1]} { return 0 } foreach {name value} [lindex $specchild 2] { if {[dom::element getAttribute $child $name] != $value} { return 0 } } set result [checkTree $child [lindex $specchild 3]] if {!$result} { return 0 } } pi { if {[dom::node cget $child -nodeType] != "processingInstruction"} { return 0 } if {[dom::node cget $child -nodeName] != [lindex $specchild 1]} { return 0 } } dtd { if {[dom::node cget $child -nodeType] != "dtd"} { return 0 } } text { if {[dom::node cget $child -nodeType] != "textNode"} { return 0 } if {[dom::node cget $child -nodeValue] != [lindex $specchild 1]} { return 0 } } default { } } } return 1 } # testPackage package ?version? # Loads specified package with 'package require $package $version', # then prints message describing how the package was loaded. # # This is useful when you've got several versions of a # package to lying around and want to make sure you're # testing the right one. # proc testPackage {package {version ""}} { if {![catch "package present $package $version"]} { return } set rc [catch "package require $package $version" result] if {$rc} { return -code $rc $result } set version $result set loadScript [package ifneeded $package $version] puts $::tcltest::outputChannel \ "Loaded $package version $version via {$loadScript}" return; } #*EOF* tclxml-3.3~svn11.orig/tests/tclxslt/ext-test.xsl0000644000000000000000000000060311113705304020544 0ustar rootroot Test value: " " tclxml-3.3~svn11.orig/tests/tclxslt/transform-1.3-result.html0000644000000000000000000002470011113705304022757 0ustar rootroot Zveno - XML Specialists

 

 

 

 

 

tclxml-3.3~svn11.orig/tests/tclxslt/extension.test0000755000000000000000000001004611113705304021161 0ustar rootroot# Features covered: XSLT Extensions # # This file contains a collection of tests for the TclXSLT package. # This file tests the parser's performance on tranformations. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 2001-2003 Zveno Pty Ltd. # # $Id: extension.test,v 1.5 2003/12/03 20:20:39 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxsltutils.tcl] testPackage xslt namespace eval ::xslt::extensionTest { namespace import -force ::tcltest::* namespace eval ::xslt::extensionTest::exttest { namespace export countargs } proc ::xslt::extensionTest::exttest::countargs args { return [llength $args] } proc ::xslt::extensionTest::exttest::testnodes {ns args} { variable nodenames foreach node $ns { lappend nodenames [dom::node cget $node -nodeName] } return [lindex $ns end] } variable SETUP { variable nodenames {} xslt::extension add http://tclxml.sourceforge.net/schemas/exttest ::xslt::extensionTest::exttest set srcdoc [dom::parse { First value Second value Third value Fourth value }] } variable CLEANUP { catch {unset nodenames} xslt::extension remove http://tclxml.sourceforge.net/schemas/exttest dom::destroy $srcdoc dom::destroy $stydoc rename $ssheet {} } test extension-1.1 {Register extension namespace} -body { xslt::extension add http://tclxml.sourceforge.net/schemas/exttest ::exttest } -cleanup { xslt::extension remove http://tclxml.sourceforge.net/schemas/exttest } -result {} test extension-1.2 {Unregister extension namespace} -setup { xslt::extension add http://tclxml.sourceforge.net/schemas/exttest ::exttest } -body { xslt::extension remove http://tclxml.sourceforge.net/schemas/exttest } -result {} test extension-2.1 {Extension function} -setup { eval $SETUP set stydoc [dom::parse { }] set ssheet [xslt::compile $stydoc] } -body { set result [$ssheet transform $srcdoc] dom::serialize $result -method text } -cleanup $CLEANUP -result 2 test extension-2.2 {Extension function, no args} -setup { eval $SETUP set stydoc [dom::parse { }] set ssheet [xslt::compile $stydoc] } -body { set result [$ssheet transform $srcdoc] dom::serialize $result -method text } -cleanup $CLEANUP -result 0 test extension-2.3 {pass nodeset to function, return nodeset} -setup { eval $SETUP set stydoc [dom::parse { }] set ssheet [xslt::compile $stydoc] } -body { set result [$ssheet transform $srcdoc] list [dom::serialize $result -method text] $::xslt::extensionTest::exttest::nodenames } -cleanup $CLEANUP -result {{Third value} {value1 value2 value3 value4}} cleanupTests } namespace delete ::xslt::extensionTest return tclxml-3.3~svn11.orig/tests/tclxslt/included.xsl0000644000000000000000000000023011113705304020552 0ustar rootroot tclxml-3.3~svn11.orig/tests/tclxslt/test2.xml0000644000000000000000000000013211113705304020017 0ustar rootroot ]>
&ext;
tclxml-3.3~svn11.orig/tests/tclxslt/error.xsl0000644000000000000000000000040211113705304020115 0ustar rootroot This should be an error tclxml-3.3~svn11.orig/tests/tclxslt/ext-test.tcl0000644000000000000000000000076211113705304020526 0ustar rootroot# ext-test.tcl -- # # Implementation of test extension # # $Id: ext-test.tcl,v 1.1.1.1 2001/08/14 00:45:27 balls Exp $ package require xslt namespace eval extTest { namespace export test } proc extTest::test args { return "extTest::test passed [llength $args] arguments" } set ch [open ext-test.xsl] set xsl [read $ch] close $ch puts [list register extension] ::xslt::extension add http://tclxml.sf.net/XSLT/Test ::extTest puts [list do transformation] ::xslt::transform $xsl tclxml-3.3~svn11.orig/tests/tclxslt/all.tcl0000755000000000000000000000120411113705304017514 0ustar rootroot# all.tcl -- # # This file contains a support module to run all of the Tcl # tests. It must be invoked using "source all.test" by # a calling tcl script that has loaded the parser class it wishes to # test in this directory. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 2003 Zveno Pty Ltd # Copyright (c) 1998-1999 by Scriptics Corporation. # # All rights reserved. # # RCS: @(#) $Id: all.tcl,v 1.4 2003/12/03 20:06:36 balls Exp $ package require Tcl 8.4 package require tcltest 2.2 tcltest::configure -testdir [file dirname [file normalize [info script]]] eval tcltest::configure $argv tcltest::runAllTests tclxml-3.3~svn11.orig/tests/tclxslt/test.xsl0000644000000000000000000000040111113705304017742 0ustar rootroot Awesome! tclxml-3.3~svn11.orig/tests/tclxslt/transform-1.3.xml0000644000000000000000000000100211113705304021265 0ustar rootroot
Zveno - XML Specialists Zveno website entrance page
zveno_information/about-zveno.html zveno_information/about-zveno.html zveno_information/xml-resources.html open_source/ courses/ zveno_information/about-zveno.html
tclxml-3.3~svn11.orig/tests/tclxslt/error.xml0000644000000000000000000000254011113705304020114 0ustar rootroot
About Zveno Ms Polly Ball Zveno is a dedicated XML company, providing a comprehensive suite of services including consultancy, scheduled and in-house training and customised tools. Established in 1996, Zveno services a variety of clients worldwide. Our mission is to utilise the wealth of both open source and commercially produced packages to customise solutions to your XML requirements. Our dedicated vendor neutral stance coupled with our notably qualified staff, gives us a unique edge within the growing wealth of XML related companies operating today. Zveno offices are located in Canberra, ACT, Australia, and Perth, WA, Australia. You may contact us: by email info@zveno.com by phone +61 2 6242 4099 by fax +61 2 6242 4099 by snail mail
LPO Box A64 ANU CanberraACT2601 Australia
tclxml-3.3~svn11.orig/tests/tclxslt/dummy.xml0000644000000000000000000000315211113705304020116 0ustar rootroot About Zveno

About Zveno

Ms. Polly Ball


Awesome!

Zveno is a dedicated XML company, providing a comprehensive suite of services including consultancy, scheduled and in-house training and customised tools. Established in 1996, Zveno services a variety of clients worldwide.

Awesome!

Our mission is to utilise the wealth of both open source and commercially produced packages to customise solutions to your XML requirements. Our dedicated vendor neutral stance coupled with our notably qualified staff, gives us a unique edge within the growing wealth of XML related companies operating today.

Awesome!

Zveno offices are located in Canberra, ACT, Australia, and Perth, WA, Australia. You may contact us:

  • Awesome!

    by email info@zveno.com

  • Awesome!

    by phone +61 2 6242 4099

  • Awesome!

    by fax +61 2 6242 4099

  • Awesome!

    by snail mail


    LPO Box A64 ANU
    CanberraACT2601
    Australia
        
tclxml-3.3~svn11.orig/tests/tclxslt/transform.test0000755000000000000000000002055511113705304021166 0ustar rootroot# Features covered: XSLT Transformations # # This file contains a collection of tests for the TclXSLT package. # This file tests the parser's performance on tranformations. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 2008 Explain # http://www.explain.com.au/ # Copyright (c) 2001-2003 Zveno Pty Ltd. # # $Id: transform.test,v 1.4 2003/12/03 20:20:39 balls Exp $ package require tcltest source [file join [tcltest::workingDirectory] tclxsltutils.tcl] testPackage xslt namespace eval ::xslt::transformTest { namespace import -force ::tcltest::* variable SETUP { variable style1 [dom::parse { }] set xml1 [dom::parse ] set xml2 [dom::parse ] } variable SETUP2 { eval $SETUP set ssheet [xslt::compile $style1] } variable CLEANUP { dom::destroy $style1 dom::destroy $xml1 dom::destroy $xml2 } variable CLEANUP2 { eval $CLEANUP rename $ssheet {} } test transform-1.1 {Compile and destroy stylesheet} -setup $SETUP -body { set s1 [xslt::compile $style1] rename $s1 {} } -cleanup $CLEANUP -result {} test transform-1.2 {Compile stylesheet} -setup $SETUP -body { variable s1 [xslt::compile $style1] string equal [info commands $s1] {} } -cleanup { eval $CLEANUP rename $s1 {} } -result 0 test transform-1.3 {-method option, default} -setup { set stydoc [dom::parse { }] set ssheet [xslt::compile $stydoc] } -body { $ssheet cget -method } -cleanup { dom::destroy $stydoc rename $ssheet {} } -result {} test transform-1.4 {-method option, text} -setup $SETUP2 -body { $ssheet cget -method } -cleanup $CLEANUP2 -result text test transform-1.5 {-method option, html} -setup { set stydoc [dom::parse { }] set ssheet [xslt::compile $stydoc] } -body { $ssheet cget -method } -cleanup { dom::destroy $stydoc rename $ssheet {} } -result html test transform-1.5 {-method option, xml} -setup { set stydoc [dom::parse { }] set ssheet [xslt::compile $stydoc] } -body { $ssheet cget -method } -cleanup { dom::destroy $stydoc rename $ssheet {} } -result xml test transform-1.6 {configure -method} -match glob -setup { set stydoc [dom::parse { }] set ssheet [xslt::compile $stydoc] } -body { expectError { $ssheet configure -method html } } -cleanup { dom::destroy $stydoc rename $ssheet {} } -result {*read-only*} test transform-1.7 {error: too many arguments} -setup $SETUP -match glob -body { expectError { ::xslt::compile $style1 somethingelse } } -cleanup $CLEANUP -result {wrong # args*} # In-memory tests test transform-2.1 {Single, simple XSLT Transformation} -setup $SETUP2 -body { set result [$ssheet transform $xml1] dom::serialize $result -method text } -cleanup $CLEANUP2 -result {Test} test transform-2.2 {Multiple simple XSLT Transformations} -setup $SETUP2 -body { set result1 [$ssheet transform $xml1] set result2 [$ssheet transform $xml2] list [::dom::serialize $result1 -method text] \ [::dom::serialize $result2 -method text] } -cleanup $CLEANUP2 -result [list Test AnotherTest] test transform-2.3 {Complex XSLT Transformation} -setup { set ch [open [file join [workingDirectory] transform-1.3.xsl]] set ssheetdoc [::dom::parse [read $ch]] close $ch set ch [open [file join [workingDirectory] transform-1.3.xml]] set source [::dom::parse [read $ch]] close $ch set ch [open [file join [workingDirectory] transform-1.3-result.html]] set expectedxml [read $ch] close $ch } -body { set ssheet [xslt::compile $ssheetdoc] set result [$ssheet transform $source] string equal [dom::serialize $result -method html] $expectedxml } -cleanup { dom::destroy $ssheetdoc dom::destroy $source dom::destroy $result rename $ssheet {} catch {unset expectedxml} } -result 1 # Parameters test transform-5.1 {Pass parameters} -setup { eval $SETUP set styledoc [::dom::parse { wrong value }] set style [xslt::compile $styledoc] } -body { set result [$style transform $xml1 test {'correct value'}] ::dom::serialize $result -method text } -cleanup { eval $CLEANUP dom::destroy $styledoc dom::destroy $result rename $style {} } -result {correct value} test transform-5.2 {Pass parameter, calculate result} -setup { # Create a large source document set sourcexml { } for {set i 0} {$i < 1000} {incr i} { append sourcexml " \n" } append sourcexml { } set source [::dom::parse $sourcexml] set styledoc [::dom::parse { ooooXXXXoooo }] set style [xslt::compile $styledoc] } -body { set result [$style transform $source test '2'] expr {[string length [dom::serialize $result -method text]] == 1000 * 2 * [string length "ooooXXXXoooo"]} } -cleanup { unset sourcexml dom::destroy $source dom::destroy $styledoc dom::destroy $result rename $style {} } -result 1 test transform-5.3 {get parameters} -setup { set stydoc [dom::parse { second value }] set style [xslt::compile $stydoc] } -body { $style get parameters } -cleanup { dom::destroy $stydoc rename $style {} } -result {{firstParameter {} {"firstValue"}} {secondParameter {} {}}} test transform-6.1 {-message} -setup { variable msg {} proc message text { variable msg append msg $text } set src [dom::parse value] set stydoc [dom::parse { Testing message command }] set ssheet [xslt::compile $stydoc] } -body { $ssheet configure -messagecommand [namespace code message] set result [$ssheet transform $src] set msg } -cleanup { dom::destroy $src dom::destroy $stydoc rename $ssheet {} catch {unset msg} } -result {Testing message command } test transform-7.1 {error while compiling} -match glob -setup { set srcdoc [dom::parse whatever] set stydoc [dom::parse { }] } -body { expectError { xslt::compile $stydoc } } -cleanup { dom::destroy $srcdoc dom::destroy $stydoc } -result {*document is not a stylesheet*} cleanupTests } namespace delete ::xslt::transformTest return tclxml-3.3~svn11.orig/tests/README0000755000000000000000000000052111113705304015424 0ustar rootroot TclXML Test Suite This directory contains test scripts for TclXML, TclDOM and TclXSLT. MANIFEST: --------- README Tcl test suite design document. all.tcl support module that finds & runs all tests tclxml TclXML tests tcldom TclDOM tests tclxslt TclXSLT tests RCS: @(#) $Id: README,v 1.4 2003/12/03 20:06:36 balls Exp $ tclxml-3.3~svn11.orig/tclxslt-libxslt.c0000644000000000000000000022015511215700771016734 0ustar rootroot/* * tclxslt.c -- * * Interface to Gnome libxslt. * * Copyright (c) 2005-2009 Explain * http://www.explain.com.au/ * Copyright (c) 2001-2004 Zveno Pty Ltd * http://www.zveno.com/ * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * $Id: tclxslt.c,v 1.30.2.2 2005/12/30 02:40:41 balls Exp $ * */ #include #include #include #include #include #include #include #include #include #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT /*#ifdef __WIN32__ *# include "win/win32config.h" #endif */ /* * Manage stylesheet objects */ typedef struct TclXSLT_Stylesheet { Tcl_Interp *interp; char *name; xsltStylesheetPtr stylesheet; Tcl_HashEntry *entryPtr; Tcl_Obj *resulturi; Tcl_Obj *profilechannelObj; Tcl_Obj *messagecommand; } TclXSLT_Stylesheet; /* * Extension management */ typedef struct TclXSLT_Extension { Tcl_Interp *interp; Tcl_Obj *nsuri; Tcl_Obj *tclns; xsltTransformContextPtr xformCtxt; } TclXSLT_Extension; typedef struct ThreadSpecificData { int initialised; Tcl_Interp *interp; int ssheetCntr; Tcl_HashTable *stylesheets; Tcl_HashTable *extensions; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * Prototypes for procedures defined later in this file: */ /* * Forward declarations for private functions. */ static void TclXSLTGenericError _ANSI_ARGS_((void *ctx, const char *msg, ...)); static int TclXSLTCompileCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int TclXSLTInstanceCommand _ANSI_ARGS_((ClientData ssheet, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static void TclXSLTDeleteStylesheet _ANSI_ARGS_((ClientData ssheet)); static int TclXSLTExtensionCommand _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static Tcl_Obj * GetParameters _ANSI_ARGS_((Tcl_Interp *interp, xsltStylesheetPtr stylesheet)); static int TclXSLTTransform _ANSI_ARGS_((TclXSLT_Stylesheet *stylesheet, Tcl_Obj *source, int paramc, Tcl_Obj *CONST paramv[])); static void TclXSLT_RegisterAll _ANSI_ARGS_((TclXSLT_Extension *extinfo, const xmlChar *nsuri)); /* static xsltExtInitFunction TclXSLTExtInit; */ static void *TclXSLTExtInit _ANSI_ARGS_((xsltTransformContextPtr ctxt, const xmlChar *URI)); /* static xsltExtShutdownFunction TclXSLTExtShutdown; */ static void TclXSLTExtShutdown _ANSI_ARGS_((xsltTransformContextPtr ctxt, const xmlChar *URI, void *userdata)); /* static xmlXPathEvalFunc TclXSLTExtFunction; */ static void TclXSLTExtFunction _ANSI_ARGS_((xmlXPathParserContextPtr xpathCtxt, int nargs)); /* static xsltPreComputeFunction TclXSLTExtElementPreComp; */ static xsltElemPreCompPtr TclXSLTExtElementPreComp _ANSI_ARGS_((xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function)); /* static xsltTransformFunction TclXSLTExtElementTransform; */ static void TclXSLTExtElementTransform _ANSI_ARGS_((xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp)); /* static xsltSecurityCheck TclXSLTSecurityReadFile; */ static int TclXSLTSecurityReadFile _ANSI_ARGS_((xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const char *value)); /* static xsltSecurityCheck TclXSLTSecurityWriteFile; */ static int TclXSLTSecurityWriteFile _ANSI_ARGS_((xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const char *value)); /* static xsltSecurityCheck TclXSLTSecurityCreateDirectory; */ static int TclXSLTSecurityCreateDirectory _ANSI_ARGS_((xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const char *value)); /* static xsltSecurityCheck TclXSLTSecurityReadNetwork; */ static int TclXSLTSecurityReadNetwork _ANSI_ARGS_((xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const char *value)); /* static xsltSecurityCheck TclXSLTSecurityWriteNetwork; */ static int TclXSLTSecurityWriteNetwork _ANSI_ARGS_((xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const char *value)); static Tcl_Obj * TclXSLT_ConvertXPathObjToTclObj _ANSI_ARGS_((Tcl_Interp *interp, xmlXPathObjectPtr xpobj)); static xmlXPathObjectPtr TclXSLT_ConvertTclObjToXPathObj _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr)); /* Copied from libxslt-1.1.24 transform.c */ static void xsltApplySequenceConstructor(xsltTransformContextPtr ctxt, xmlNodePtr contextNode, xmlNodePtr list, xsltTemplatePtr templ); /* * Error context for passing error result back to caller. */ typedef struct GenericError_Info { Tcl_Interp *interp; TclXSLT_Stylesheet *stylesheet; int code; Tcl_Obj *msg; } GenericError_Info; /* * Switch tables */ #ifndef CONST84 #define CONST84 /* Before 8.4 no 'const' required */ #endif static CONST84 char *instanceCommandMethods[] = { "cget", "configure", "get", "transform", (char *) NULL }; enum instanceCommandMethods { TCLXSLT_CGET, TCLXSLT_CONFIGURE, TCLXSLT_GET, TCLXSLT_TRANSFORM }; static CONST84 char *instanceCommandOptions[] = { "-messagecommand", "-method", "-indent", "-resulturi", "-profilechannel", "-encoding", "-omitxmldeclaration", (char *) NULL }; enum instanceCommandOptions { TCLXSLT_OPTION_MESSAGECOMMAND, TCLXSLT_OPTION_METHOD, TCLXSLT_OPTION_INDENT, TCLXSLT_OPTION_RESULTURI, TCLXSLT_OPTION_PROFILECHANNEL, TCLXSLT_OPTION_ENCODING, TCLXSLT_OPTION_OMITXMLDECLARATION }; static CONST84 char *instanceGetMethods[] = { "parameters", (char *) NULL }; enum instanceGetMethods { TCLXSLT_GET_PARAMETERS }; static CONST84 char *extensionCommandMethods[] = { "add", "remove", (char *) NULL }; enum extensionCommandMethods { TCLXSLT_EXT_ADD, TCLXSLT_EXT_REMOVE }; /* * libxml2 and libxslt are mostly thread-safe, * but there are issues with error callbacks. */ TCL_DECLARE_MUTEX(libxslt) /* *---------------------------------------------------------------------------- * * Tclxslt_libxslt_Init -- * * Initialisation routine for loadable module * * Results: * None. * * Side effects: * Creates commands in the interpreter, * *---------------------------------------------------------------------------- */ int Tclxslt_libxslt_Init (interp) Tcl_Interp *interp; /* Interpreter to initialise */ { ThreadSpecificData *tsdPtr; xsltSecurityPrefsPtr sec; tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialised) { tsdPtr->initialised = 1; tsdPtr->interp = interp; tsdPtr->ssheetCntr = 0; tsdPtr->stylesheets = (Tcl_HashTable *) Tcl_Alloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(tsdPtr->stylesheets, TCL_ONE_WORD_KEYS); tsdPtr->extensions = (Tcl_HashTable *) Tcl_Alloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(tsdPtr->extensions, TCL_STRING_KEYS); } /* only need to init the library once per process */ Tcl_CreateObjCommand(interp, "xslt::compile", TclXSLTCompileCommand, NULL, NULL); Tcl_CreateObjCommand(interp, "xslt::extension", TclXSLTExtensionCommand, NULL, NULL); Tcl_MutexLock(&libxslt); #ifndef TCLXML_STATIC_TCLXSLT exsltRegisterAll(); #endif /* TCLXML_STATIC_TCLXSLT */ /* * Setup security preferences */ sec = xsltNewSecurityPrefs(); if (xsltSetSecurityPrefs(sec, XSLT_SECPREF_READ_FILE, TclXSLTSecurityReadFile)) { Tcl_SetResult(interp, "unable to set readfile security", NULL); return TCL_ERROR; } if (xsltSetSecurityPrefs(sec, XSLT_SECPREF_WRITE_FILE, TclXSLTSecurityWriteFile)) { Tcl_SetResult(interp, "unable to set writefile security", NULL); return TCL_ERROR; } if (xsltSetSecurityPrefs(sec, XSLT_SECPREF_CREATE_DIRECTORY, TclXSLTSecurityCreateDirectory)) { Tcl_SetResult(interp, "unable to set createdirectory security", NULL); return TCL_ERROR; } if (xsltSetSecurityPrefs(sec, XSLT_SECPREF_READ_NETWORK, TclXSLTSecurityReadNetwork)) { Tcl_SetResult(interp, "unable to set readnetwork security", NULL); return TCL_ERROR; } if (xsltSetSecurityPrefs(sec, XSLT_SECPREF_WRITE_NETWORK, TclXSLTSecurityWriteNetwork)) { Tcl_SetResult(interp, "unable to set writenetwork security", NULL); return TCL_ERROR; } /* xsltSetCtxtSecurityPrefs(sec, userCtxt); */ xsltSetDefaultSecurityPrefs(sec); Tcl_MutexUnlock(&libxslt); Tcl_SetVar2Ex(interp, "::xslt::libxsltversion", NULL, Tcl_NewStringObj(xsltEngineVersion, -1), 0); Tcl_SetVar2Ex(interp, "::xslt::libexsltversion", NULL, Tcl_NewStringObj(exsltLibraryVersion, -1), 0); return TCL_OK; } /* * XSLT is not safe due to the document(), xsl:include and xsl:import functions/elements. * However, libxslt checks whether access is permitted to external resources. * * NOTE: need to make sure decision to allow access to resources is made by a trusted interpreter, not the untrusted slave. Even better, use a mechanism similar to TclXML/libxml2 to access external resources. */ int Tclxslt_libxslt_SafeInit (interp) Tcl_Interp *interp; /* Interpreter to initialise */ { return Tclxslt_libxslt_Init(interp); } /* *---------------------------------------------------------------------------- * * TclXSLTCompileCommand -- * * Class creation command for xslt stylesheet objects. * * Results: * Compiles the XSLT stylesheet. * Creates a Tcl command associated with that stylesheet. * * Side effects: * Memory allocated, stylesheet is compiled. * *---------------------------------------------------------------------------- */ static int TclXSLTCompileCommand(dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); TclXSLT_Stylesheet *info; xmlDocPtr origDoc, doc; xsltStylesheetPtr ssheetPtr = NULL; void *oldxsltErrorCtx, *oldxmlErrorCtx; xmlGenericErrorFunc old_xsltGenericError, old_xmlGenericError; GenericError_Info *errorInfoPtr; Tcl_Obj *errObjPtr = NULL; int new; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "stylesheet-doc"); return TCL_ERROR; } if (TclXML_libxml2_GetDocFromObj(interp, objv[1], &origDoc) != TCL_OK) { return TCL_ERROR; } Tcl_MutexLock(&libxslt); doc = xmlCopyDoc(origDoc, 1); /* * xmlCopyDoc doesn't copy some of the fields. */ if (origDoc->URL) { doc->URL = (const xmlChar *) xmlMalloc(strlen((char *) origDoc->URL) + 1); strcpy((char *) doc->URL, (char *) origDoc->URL); } /* * Prepare for compiling stylesheet */ TclXML_libxml2_ResetError(interp); errorInfoPtr = (GenericError_Info *) Tcl_Alloc(sizeof(GenericError_Info)); errorInfoPtr->interp = interp; errorInfoPtr->stylesheet = NULL; errorInfoPtr->code = TCL_OK; errorInfoPtr->msg = NULL; xmlSetGenericErrorFunc((void *) errorInfoPtr, TclXSLTGenericError); /* * Save the previous error context so that it can * be restored upon completion of the operation. */ old_xsltGenericError = xsltGenericError; oldxsltErrorCtx = xsltGenericErrorContext; old_xmlGenericError = xmlGenericError; oldxmlErrorCtx = xmlGenericErrorContext; xmlSetGenericErrorFunc((void *) errorInfoPtr, TclXSLTGenericError); xsltSetGenericErrorFunc((void *) errorInfoPtr, TclXSLTGenericError); /* * Compile stylesheet */ ssheetPtr = xsltParseStylesheetDoc(doc); xmlSetGenericErrorFunc((void *) oldxmlErrorCtx, old_xmlGenericError); xsltSetGenericErrorFunc((void *) oldxsltErrorCtx, old_xsltGenericError); Tcl_MutexUnlock(&libxslt); errObjPtr = TclXML_libxml2_GetErrorObj(interp); if (ssheetPtr == NULL) { Tcl_SetResult(interp, "error compiling stylesheet", NULL); goto error; } if (ssheetPtr->errors > 0) { Tcl_SetResult(interp, "error compiling XSLT stylesheet", NULL); goto error; } if (errorInfoPtr->code != TCL_OK) { goto error; } /* TODO: notify app of any warnings */ info = (TclXSLT_Stylesheet *) Tcl_Alloc(sizeof(TclXSLT_Stylesheet)); info->interp = interp; info->name = Tcl_Alloc(20); sprintf(info->name, "style%d", tsdPtr->ssheetCntr++); info->stylesheet = ssheetPtr; info->messagecommand = NULL; info->resulturi = NULL; info->profilechannelObj = NULL; /* * Create reverse mapping of stylesheet to name of stylesheet command. */ info->entryPtr = Tcl_CreateHashEntry(tsdPtr->stylesheets, (ClientData) ssheetPtr, &new); /* sanity check: new == 1 */ Tcl_SetHashValue(info->entryPtr, (ClientData) info->name); Tcl_CreateObjCommand(interp, info->name, TclXSLTInstanceCommand, (ClientData) info, TclXSLTDeleteStylesheet); Tcl_SetObjResult(interp, Tcl_NewStringObj(info->name, -1)); return TCL_OK; error: if (errObjPtr) { Tcl_SetObjResult(interp, errObjPtr); } else if (errorInfoPtr->msg) { Tcl_SetObjResult(interp, errorInfoPtr->msg); Tcl_DecrRefCount(errorInfoPtr->msg); } Tcl_Free((char *) errorInfoPtr); Tcl_MutexLock(&libxslt); if (ssheetPtr) { xsltFreeStylesheet(ssheetPtr); } else { xmlFreeDoc(doc); } Tcl_MutexUnlock(&libxslt); return TCL_ERROR; } /* *---------------------------------------------------------------------------- * * TclXSLTDeleteStylesheet -- * * Class destruction command for xslt stylesheet objects. * * Results: * Frees memory associated with a stylesheet. * * Side effects: * Memory deallocated. * *---------------------------------------------------------------------------- */ static void TclXSLTDeleteStylesheet(clientData) ClientData clientData; { TclXSLT_Stylesheet *ssheet = (TclXSLT_Stylesheet *) clientData; Tcl_DeleteHashEntry(ssheet->entryPtr); Tcl_Free(ssheet->name); if (ssheet->messagecommand) { Tcl_DecrRefCount(ssheet->messagecommand); } if (ssheet->resulturi) { Tcl_DecrRefCount(ssheet->resulturi); } if (ssheet->profilechannelObj) { Tcl_DecrRefCount(ssheet->profilechannelObj); } Tcl_MutexLock(&libxslt); xsltFreeStylesheet(ssheet->stylesheet); /* Also frees document */ Tcl_MutexUnlock(&libxslt); Tcl_Free((char *) ssheet); } /* *---------------------------------------------------------------------------- * * TclXSLTInstanceCommand -- * * Handles the stylesheet object command. * * Results: * Depends on method. * * Side effects: * Depends on method. * *---------------------------------------------------------------------------- */ static int TclXSLTInstanceCommand(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { TclXSLT_Stylesheet *ssheet = (TclXSLT_Stylesheet *) clientData; int method, option, indent = 0, theOmitXMLDeclaration = 0; const xmlChar *theMethod, *theEncoding; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "method ?args ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], instanceCommandMethods, "method", 0, &method) != TCL_OK) { return TCL_ERROR; } switch ((enum instanceCommandMethods) method) { case TCLXSLT_CGET: if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "option"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[2], instanceCommandOptions, "option", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum instanceCommandOptions) option) { case TCLXSLT_OPTION_METHOD: XSLT_GET_IMPORT_PTR(theMethod, ssheet->stylesheet, method); if (theMethod != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj((CONST char *) theMethod, -1)); } /* theMethod == NULL means XML method; result should be empty. EXCEPTION: if the result document is of type XML_HTML_DOCUMENT_NODE then the method should be "html". */ break; case TCLXSLT_OPTION_ENCODING: XSLT_GET_IMPORT_PTR(theEncoding, ssheet->stylesheet, encoding); if (theEncoding != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj((CONST char *) theEncoding, -1)); } /* theEncoding == NULL means default (UTF-8) encoding; result should be empty. */ break; case TCLXSLT_OPTION_OMITXMLDECLARATION: XSLT_GET_IMPORT_INT(theOmitXMLDeclaration, ssheet->stylesheet, omitXmlDeclaration); Tcl_SetObjResult(interp, Tcl_NewBooleanObj(theOmitXMLDeclaration == 1)); break; case TCLXSLT_OPTION_INDENT: XSLT_GET_IMPORT_INT(indent, ssheet->stylesheet, indent); Tcl_SetObjResult(interp, Tcl_NewBooleanObj(indent)); break; case TCLXSLT_OPTION_MESSAGECOMMAND: if (ssheet->messagecommand != NULL) { Tcl_SetObjResult(interp, ssheet->messagecommand); } break; case TCLXSLT_OPTION_RESULTURI: if (ssheet->resulturi != NULL) { Tcl_SetObjResult(interp, ssheet->resulturi); } break; case TCLXSLT_OPTION_PROFILECHANNEL: if (ssheet->profilechannelObj != NULL) { Tcl_SetObjResult(interp, ssheet->profilechannelObj); } break; default: Tcl_SetResult(interp, "unknown option", NULL); return TCL_ERROR; } break; case TCLXSLT_CONFIGURE: if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "option value"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[2], instanceCommandOptions, "option", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum instanceCommandOptions) option) { case TCLXSLT_OPTION_METHOD: case TCLXSLT_OPTION_INDENT: case TCLXSLT_OPTION_ENCODING: case TCLXSLT_OPTION_OMITXMLDECLARATION: Tcl_SetResult(interp, "read-only option", NULL); return TCL_ERROR; break; case TCLXSLT_OPTION_MESSAGECOMMAND: if (ssheet->messagecommand != NULL) { Tcl_DecrRefCount(ssheet->messagecommand); } ssheet->messagecommand = objv[3]; Tcl_IncrRefCount(ssheet->messagecommand); break; case TCLXSLT_OPTION_RESULTURI: if (ssheet->resulturi != NULL) { Tcl_DecrRefCount(ssheet->resulturi); } ssheet->resulturi = objv[3]; Tcl_IncrRefCount(ssheet->resulturi); break; case TCLXSLT_OPTION_PROFILECHANNEL: if (ssheet->profilechannelObj != NULL) { Tcl_DecrRefCount(ssheet->profilechannelObj); } #ifdef __WIN32__ Tcl_SetResult(interp, "profiling not available", NULL); return TCL_ERROR; #else ssheet->profilechannelObj = objv[3]; Tcl_IncrRefCount(ssheet->profilechannelObj); #endif break; default: Tcl_SetResult(interp, "unknown option", NULL); return TCL_ERROR; } break; case TCLXSLT_GET: if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "name"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[2], instanceGetMethods, "name", 0, &option) != TCL_OK) { return TCL_ERROR; } switch ((enum instanceGetMethods) option) { case TCLXSLT_GET_PARAMETERS: Tcl_SetObjResult(interp, GetParameters(interp, ssheet->stylesheet)); break; default: Tcl_SetResult(interp, "unknown name", NULL); return TCL_ERROR; } break; case TCLXSLT_TRANSFORM: if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "source ?param value...?"); return TCL_ERROR; } return TclXSLTTransform(ssheet, objv[2], objc - 3, &objv[3]); break; default: Tcl_SetResult(interp, "unknown method", NULL); return TCL_OK; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXSLTTransform -- * * Performs an XSL transformation. * * Results: * Result document created. * * Side effects: * Memory allocated for result document. * *---------------------------------------------------------------------------- */ static int TclXSLTTransform(stylesheet, source, paramc, paramv) TclXSLT_Stylesheet *stylesheet; Tcl_Obj *source; int paramc; Tcl_Obj *CONST paramv[]; { xmlDocPtr doc, result; char **params = NULL; int nbparams = 0, i; GenericError_Info *errorInfoPtr; void *oldxsltErrorCtx, *oldxmlErrorCtx; xmlGenericErrorFunc old_xsltGenericError, old_xmlGenericError; Tcl_Obj *resultObjPtr, *errObjPtr = NULL; char *resulturi = NULL; FILE *profile = NULL; xsltTransformContextPtr userCtxt = NULL; errorInfoPtr = (GenericError_Info *) Tcl_Alloc(sizeof(GenericError_Info)); errorInfoPtr->interp = stylesheet->interp; errorInfoPtr->stylesheet = stylesheet; errorInfoPtr->code = TCL_OK; errorInfoPtr->msg = NULL; if (TclXML_libxml2_GetDocFromObj(stylesheet->interp, source, &doc) != TCL_OK) { goto error; } TclXML_libxml2_ResetError(stylesheet->interp); params = (char **) Tcl_Alloc(sizeof(char **) * (paramc + 1)); for (i = 0; i < paramc; i++) { params[nbparams++] = Tcl_GetStringFromObj(paramv[i++], NULL); params[nbparams++] = Tcl_GetStringFromObj(paramv[i], NULL); } params[nbparams] = NULL; if (stylesheet->resulturi) { resulturi = Tcl_GetStringFromObj(stylesheet->resulturi, NULL); } #ifdef __WIN32__ /* Tcl_GetOpenFile not available on Windows */ #else if (stylesheet->profilechannelObj) { if (Tcl_GetOpenFile(stylesheet->interp, Tcl_GetStringFromObj(stylesheet->profilechannelObj, NULL), 1, 1, (ClientData *) &profile) != TCL_OK) { goto error; } } #endif /* * Perform the transformation */ Tcl_MutexLock(&libxslt); /* * Save the previous error context so that it can * be restored upon completion of the transformation. * This is necessary because transformations may occur * recursively (usually due to extensions). */ old_xsltGenericError = xsltGenericError; oldxsltErrorCtx = xsltGenericErrorContext; old_xmlGenericError = xmlGenericError; oldxmlErrorCtx = xmlGenericErrorContext; xmlSetGenericErrorFunc((void *) errorInfoPtr, TclXSLTGenericError); xsltSetGenericErrorFunc((void *) errorInfoPtr, TclXSLTGenericError); userCtxt = xsltNewTransformContext(stylesheet->stylesheet, doc); if (userCtxt == NULL) { xmlSetGenericErrorFunc((void *) oldxmlErrorCtx, old_xmlGenericError); xsltSetGenericErrorFunc((void *) oldxsltErrorCtx, old_xsltGenericError); Tcl_MutexUnlock(&libxslt); Tcl_SetResult(stylesheet->interp, "unable to create transformation context", NULL); goto error; } result = xsltApplyStylesheetUser(stylesheet->stylesheet, doc, (const char **)params, resulturi, profile, userCtxt); xsltFreeTransformContext(userCtxt); xmlSetGenericErrorFunc((void *) oldxmlErrorCtx, old_xmlGenericError); xsltSetGenericErrorFunc((void *) oldxsltErrorCtx, old_xsltGenericError); Tcl_MutexUnlock(&libxslt); errObjPtr = TclXML_libxml2_GetErrorObj(stylesheet->interp); if (result == NULL) { Tcl_Obj *resultPtr = Tcl_NewStringObj("no result document: ", -1); if (errObjPtr) { Tcl_AppendObjToObj(resultPtr, errObjPtr); Tcl_SetObjResult(stylesheet->interp, resultPtr); goto error; } else { if (errorInfoPtr->msg) { Tcl_AppendObjToObj(resultPtr, errorInfoPtr->msg); } Tcl_SetObjResult(stylesheet->interp, resultPtr); goto error; } } if ((errObjPtr || (errorInfoPtr->code != TCL_OK && errorInfoPtr->msg)) && stylesheet->messagecommand) { /* We have produced a result, but there may possibly * have been errors. Trouble is, there might also * have been some completely innocent messages. * -messageCommand is the only way to find out about these. */ Tcl_Obj *cmdPtr = Tcl_DuplicateObj(stylesheet->messagecommand); if (errObjPtr) { if (Tcl_ListObjAppendElement(stylesheet->interp, cmdPtr, errObjPtr) != TCL_OK) { goto error; } } else { if (Tcl_ListObjAppendElement(stylesheet->interp, cmdPtr, errorInfoPtr->msg) != TCL_OK) { goto error; } } if (Tcl_GlobalEvalObj(stylesheet->interp, cmdPtr) != TCL_OK) { Tcl_Obj *resultPtr = Tcl_NewStringObj("message command failed: ", -1); Tcl_AppendObjToObj(resultPtr, Tcl_GetObjResult(stylesheet->interp)); Tcl_SetObjResult(stylesheet->interp, resultPtr); goto error; } } resultObjPtr = TclDOM_libxml2_CreateObjFromDoc(stylesheet->interp, result); Tcl_SetObjResult(stylesheet->interp, resultObjPtr); if (errorInfoPtr->msg) { Tcl_DecrRefCount(errorInfoPtr->msg); } Tcl_Free((char *) errorInfoPtr); Tcl_Free((char *) params); return TCL_OK; error: if (errorInfoPtr->msg) { Tcl_DecrRefCount(errorInfoPtr->msg); } if (params) { Tcl_Free((char *) params); } Tcl_Free((char *) errorInfoPtr); return TCL_ERROR; } void ListObjAppendUniqueList(interp, tablePtr, listPtr, newElementsPtr) Tcl_Interp *interp; Tcl_HashTable *tablePtr; Tcl_Obj *listPtr; Tcl_Obj *newElementsPtr; { int len, idx; Tcl_Obj *elementPtr, *keyPtr, *namePtr, *nameURIPtr; Tcl_HashEntry *entryPtr; Tcl_ListObjLength(interp, newElementsPtr, &len); for (idx = 0; idx < len; idx++) { Tcl_ListObjIndex(interp, newElementsPtr, idx, &elementPtr); Tcl_ListObjIndex(interp, elementPtr, 0, &namePtr); Tcl_ListObjIndex(interp, elementPtr, 1, &nameURIPtr); keyPtr = Tcl_NewObj(); Tcl_AppendStringsToObj(keyPtr, Tcl_GetStringFromObj(nameURIPtr, NULL), "^", Tcl_GetStringFromObj(namePtr, NULL), NULL); entryPtr = Tcl_FindHashEntry(tablePtr, (CONST char *) keyPtr); if (entryPtr == NULL) { Tcl_ListObjAppendElement(interp, listPtr, elementPtr); } Tcl_DecrRefCount(keyPtr); } } /* *---------------------------------------------------------------------------- * * GetParameters -- * * Retrieves the parameters for a stylesheet. * * Results: * Returns a Tcl list object. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static Tcl_Obj * GetParameters(interp, stylesheet) Tcl_Interp *interp; xsltStylesheetPtr stylesheet; { Tcl_Obj *resultPtr, *objPtr, *keyPtr; xsltStackElemPtr varPtr; Tcl_HashTable entries; /* to keep track of parameter qnames */ int new; if (stylesheet == NULL) { return NULL; } resultPtr = Tcl_NewListObj(0, NULL); Tcl_InitObjHashTable(&entries); for (varPtr = stylesheet->variables; varPtr; varPtr = varPtr->next) { Tcl_Obj *listPtr; if (strcmp((char *) varPtr->comp->inst->name, "param") == 0) { listPtr = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(interp, listPtr, Tcl_NewStringObj((CONST char *) varPtr->name, -1)); Tcl_ListObjAppendElement(interp, listPtr, Tcl_NewStringObj((CONST char *) varPtr->nameURI, -1)); Tcl_ListObjAppendElement(interp, listPtr, Tcl_NewStringObj((CONST char *) varPtr->select, -1)); Tcl_ListObjAppendElement(interp, resultPtr, listPtr); keyPtr = Tcl_NewStringObj((CONST char *) varPtr->nameURI, -1); Tcl_AppendStringsToObj(keyPtr, "^", varPtr->name, NULL); Tcl_CreateHashEntry(&entries, (CONST char *) keyPtr, &new); } } objPtr = GetParameters(interp, stylesheet->next); if (objPtr) { ListObjAppendUniqueList(interp, &entries, resultPtr, objPtr); } objPtr = GetParameters(interp, stylesheet->imports); if (objPtr) { ListObjAppendUniqueList(interp, &entries, resultPtr, objPtr); } Tcl_DeleteHashTable(&entries); return resultPtr; } /* *---------------------------------------------------------------------------- * * TclXSLTGenericError -- * * Handler for stylesheet errors. * * NB. Cannot distinguish between errors and use of xsl:message element. * * Results: * Stores error message. * * Side effects: * Transform will return error condition. * *---------------------------------------------------------------------------- */ static void TclXSLTGenericError (void *ctx, const char *msg, ...) { va_list args; char buf[2048]; int len; GenericError_Info *errorInfoPtr = (GenericError_Info *) ctx; if (ctx < (void *) 0x1000) { fprintf(stderr, "TclXSLT: bad context\n"); va_start(args,msg); vfprintf(stderr, msg, args); va_end(args); return; } va_start(args,msg); len = vsnprintf(buf, 2047, msg, args); va_end(args); if (!errorInfoPtr->interp) { return; } if (errorInfoPtr->stylesheet && errorInfoPtr->stylesheet->messagecommand) { Tcl_Obj *cmdPtr = Tcl_DuplicateObj(errorInfoPtr->stylesheet->messagecommand); if (Tcl_ListObjAppendElement(errorInfoPtr->interp, cmdPtr, Tcl_NewStringObj(buf, len)) != TCL_OK) { Tcl_BackgroundError(errorInfoPtr->interp); return; } if (Tcl_GlobalEvalObj(errorInfoPtr->interp, cmdPtr) != TCL_OK) { Tcl_BackgroundError(errorInfoPtr->interp); return; } } else { if (!errorInfoPtr->msg) { errorInfoPtr->msg = Tcl_NewObj(); Tcl_IncrRefCount(errorInfoPtr->msg); } errorInfoPtr->code = TCL_ERROR; Tcl_AppendToObj(errorInfoPtr->msg, buf, len); } } /* *---------------------------------------------------------------------------- * * TclXSLTExtensionCommand -- * * Command for xslt::extension command. * * Results: * Depends on method. * * Side effects: * Depends on method * *---------------------------------------------------------------------------- */ static int TclXSLTExtensionCommand(dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); int method, new; TclXSLT_Extension *extinfo; Tcl_HashEntry *entry; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "method ?args ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], extensionCommandMethods, "method", 0, &method) != TCL_OK) { return TCL_ERROR; } switch ((enum extensionCommandMethods) method) { case TCLXSLT_EXT_ADD: if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "nsuri tcl-namespace"); return TCL_ERROR; } Tcl_MutexLock(&libxslt); if (xsltRegisterExtModule((const xmlChar *) Tcl_GetStringFromObj(objv[2], NULL), TclXSLTExtInit, TclXSLTExtShutdown)) { Tcl_MutexUnlock(&libxslt); Tcl_SetResult(interp, "cannot register extension module", NULL); } Tcl_MutexUnlock(&libxslt); extinfo = (TclXSLT_Extension *) Tcl_Alloc(sizeof(TclXSLT_Extension)); extinfo->interp = interp; extinfo->nsuri = objv[2]; Tcl_IncrRefCount(objv[2]); extinfo->tclns = objv[3]; Tcl_IncrRefCount(objv[3]); extinfo->xformCtxt = NULL; entry = Tcl_CreateHashEntry(tsdPtr->extensions, Tcl_GetStringFromObj(objv[2], NULL), &new); if (!new) { Tcl_SetResult(interp, "extension already exists", NULL); Tcl_Free((char *) extinfo); return TCL_ERROR; } Tcl_SetHashValue(entry, extinfo); TclXSLT_RegisterAll(extinfo, (const xmlChar *) Tcl_GetStringFromObj(objv[2], NULL)); Tcl_ResetResult(interp); break; case TCLXSLT_EXT_REMOVE: if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "nsuri"); return TCL_ERROR; } /* * TODO: Remove previously registered elements and functions. */ entry = Tcl_FindHashEntry(tsdPtr->extensions, Tcl_GetStringFromObj(objv[2], NULL)); if (entry == NULL) { Tcl_SetResult(interp, "unknown XML Namespace URI", NULL); return TCL_ERROR; } extinfo = (TclXSLT_Extension *) Tcl_GetHashValue(entry); Tcl_DecrRefCount(extinfo->nsuri); Tcl_DecrRefCount(extinfo->tclns); Tcl_Free((char *) extinfo); Tcl_DeleteHashEntry(entry); break; default: Tcl_SetResult(interp, "unknown method", NULL); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXSLTExtInit -- * * Load extensions into a transformation context. * * Results: * Returns pointer to extension data. * Elements and functions are pre-registered. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static void * TclXSLTExtInit(ctxt, URI) xsltTransformContextPtr ctxt; const xmlChar *URI; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entry; TclXSLT_Extension *extinfo; entry = Tcl_FindHashEntry(tsdPtr->extensions, (CONST char *) URI); if (entry == NULL) { /* Extension module was removed */ return NULL; } extinfo = (TclXSLT_Extension *) Tcl_GetHashValue(entry); extinfo->xformCtxt = ctxt; return (void *) extinfo; } void TclXSLT_RegisterAll(extinfo, nsuri) TclXSLT_Extension *extinfo; const xmlChar *nsuri; { Tcl_Obj *cmdPtr, *objPtr; Tcl_Obj **reg; int ret, i, len; /* * Q: How to distinguish between extension elements and functions? * A: Use the formal parameters. If the command can accept * a variable argument list, then it is registered as a function. * Otherwise it will be registered as an extension (and expected * to accept certain arguments). */ cmdPtr = Tcl_NewStringObj("::xslt::getprocs ", -1); Tcl_IncrRefCount(cmdPtr); Tcl_AppendObjToObj(cmdPtr, extinfo->tclns); ret = Tcl_EvalObjEx(extinfo->interp, cmdPtr, TCL_EVAL_GLOBAL|TCL_EVAL_DIRECT); objPtr = Tcl_GetObjResult(extinfo->interp); Tcl_IncrRefCount(objPtr); Tcl_DecrRefCount(cmdPtr); if (ret != TCL_OK || objPtr == NULL) { /* * Something went wrong, therefore nothing to register. */ return; } ret = Tcl_ListObjGetElements(extinfo->interp, objPtr, &len, ®); if (ret != TCL_OK || len != 2) { /* * Something went wrong, therefore nothing to register. */ return; } /* * reg[0] contains extension elements * reg[1] contains extension functions */ Tcl_MutexLock(&libxslt); /* * First register the extension elements. */ ret = Tcl_ListObjLength(extinfo->interp, reg[0], &len); if (ret == TCL_OK && len > 0) { for (i = 0; i < len; i++) { if (Tcl_ListObjIndex(extinfo->interp, reg[0], i, &objPtr) != TCL_OK) { continue; } xsltRegisterExtModuleElement((const xmlChar *) Tcl_GetStringFromObj(objPtr, NULL), nsuri, (xsltPreComputeFunction) TclXSLTExtElementPreComp, (xsltTransformFunction) TclXSLTExtElementTransform); } } /* * Now register the extension functions. */ ret = Tcl_ListObjLength(extinfo->interp, reg[1], &len); if (ret != TCL_OK || len == 0) { Tcl_MutexUnlock(&libxslt); return; } for (i = 0; i < len; i++) { if (Tcl_ListObjIndex(extinfo->interp, reg[1], i, &objPtr) != TCL_OK) { continue; } xsltRegisterExtModuleFunction((const xmlChar *) Tcl_GetStringFromObj(objPtr, NULL), nsuri, TclXSLTExtFunction); } Tcl_MutexUnlock(&libxslt); Tcl_DecrRefCount(objPtr); return; } /* *---------------------------------------------------------------------------- * * TclXSLTExtElementPreComp -- * * Compilation step for extension element. * * Results: * Not currently used. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static xsltElemPreCompPtr TclXSLTExtElementPreComp(style, inst, function) xsltStylesheetPtr style; xmlNodePtr inst; xsltTransformFunction function; { return NULL; } /* *---------------------------------------------------------------------------- * * TclXSLTExtElementTransform -- * * Implements extension element. * * Results: * Returns string returned by Tcl command evaluation. * * Side effects: * Depends on Tcl command evaluated. * *---------------------------------------------------------------------------- */ /* * xsltAddTextString -- * Copied from libxslt-1.1.24 transform.c * (without the debugging code) */ static xmlNodePtr xsltAddTextString(xsltTransformContextPtr ctxt, xmlNodePtr target, const xmlChar *string, int len) { if ((len <= 0) || (string == NULL) || (target == NULL)) return(target); if (ctxt->lasttext == target->content) { if (ctxt->lasttuse + len >= ctxt->lasttsize) { xmlChar *newbuf; int size; size = ctxt->lasttsize + len + 100; size *= 2; newbuf = (xmlChar *) xmlRealloc(target->content,size); if (newbuf == NULL) { xsltTransformError(ctxt, NULL, target, "xsltCopyText: text allocation failed\n"); return(NULL); } ctxt->lasttsize = size; ctxt->lasttext = newbuf; target->content = newbuf; } memcpy(&(target->content[ctxt->lasttuse]), string, len); ctxt->lasttuse += len; target->content[ctxt->lasttuse] = 0; } else { xmlNodeAddContent(target, string); ctxt->lasttext = target->content; len = xmlStrlen(target->content); ctxt->lasttsize = len; ctxt->lasttuse = len; } return(target); } /* * xsltCopyNamespaceListInternal -- * Copied from libxslt-1.1.24 transform.c * (without the debugging code) */ static xmlNsPtr xsltCopyNamespaceListInternal(xmlNodePtr elem, xmlNsPtr ns) { xmlNsPtr ret = NULL; xmlNsPtr p = NULL, q, luNs; if (ns == NULL) return(NULL); if ((elem != NULL) && (elem->type != XML_ELEMENT_NODE)) elem = NULL; do { if (ns->type != XML_NAMESPACE_DECL) break; if (elem != NULL) { if ((elem->ns != NULL) && xmlStrEqual(elem->ns->prefix, ns->prefix) && xmlStrEqual(elem->ns->href, ns->href)) { ns = ns->next; continue; } luNs = xmlSearchNs(elem->doc, elem, ns->prefix); if ((luNs != NULL) && (xmlStrEqual(luNs->href, ns->href))) { ns = ns->next; continue; } } q = xmlNewNs(elem, ns->href, ns->prefix); if (p == NULL) { ret = p = q; } else if (q != NULL) { p->next = q; p = q; } ns = ns->next; } while (ns != NULL); return(ret); } /* * xsltCopyText -- * Copied from libxslt-1.1.24 transform.c * (without the debugging code) */ static xmlNodePtr xsltCopyText(xsltTransformContextPtr ctxt, xmlNodePtr target, xmlNodePtr cur, int interned) { xmlNodePtr copy; if ((cur->type != XML_TEXT_NODE) && (cur->type != XML_CDATA_SECTION_NODE)) return(NULL); if (cur->content == NULL) return(NULL); if ((target == NULL) || (target->children == NULL)) { ctxt->lasttext = NULL; } if ((ctxt->style->cdataSection != NULL) && (ctxt->type == XSLT_OUTPUT_XML) && (target != NULL) && (target->type == XML_ELEMENT_NODE) && (((target->ns == NULL) && (xmlHashLookup2(ctxt->style->cdataSection, target->name, NULL) != NULL)) || ((target->ns != NULL) && (xmlHashLookup2(ctxt->style->cdataSection, target->name, target->ns->href) != NULL)))) { if ((target->last != NULL) && (target->last->type == XML_CDATA_SECTION_NODE)) { copy = xsltAddTextString(ctxt, target->last, cur->content, xmlStrlen(cur->content)); goto exit; } else { unsigned int len; len = xmlStrlen(cur->content); copy = xmlNewCDataBlock(ctxt->output, cur->content, len); if (copy == NULL) goto exit; ctxt->lasttext = copy->content; ctxt->lasttsize = len; ctxt->lasttuse = len; } } else if ((target != NULL) && (target->last != NULL) && (((target->last->type == XML_TEXT_NODE) && (target->last->name == cur->name)) || (((target->last->type == XML_CDATA_SECTION_NODE) && (cur->name == xmlStringTextNoenc))))) { copy = xsltAddTextString(ctxt, target->last, cur->content, xmlStrlen(cur->content)); goto exit; } else if ((interned) && (target != NULL) && (target->doc != NULL) && (target->doc->dict == ctxt->dict)) { copy = xmlNewTextLen(NULL, 0); if (copy == NULL) goto exit; if (cur->name == xmlStringTextNoenc) copy->name = xmlStringTextNoenc; if (xmlDictOwns(ctxt->dict, cur->content)) copy->content = cur->content; else { if ((copy->content = xmlStrdup(cur->content)) == NULL) return NULL; } } else { unsigned int len; len = xmlStrlen(cur->content); copy = xmlNewTextLen(cur->content, len); if (copy == NULL) goto exit; if (cur->name == xmlStringTextNoenc) copy->name = xmlStringTextNoenc; ctxt->lasttext = copy->content; ctxt->lasttsize = len; ctxt->lasttuse = len; } if (copy != NULL) { if (target != NULL) { copy->doc = target->doc; xmlAddChild(target, copy); } } else { xsltTransformError(ctxt, NULL, target, "xsltCopyText: text copy failed\n"); } exit: if ((copy == NULL) || (copy->content == NULL)) { xsltTransformError(ctxt, NULL, target, "Internal error in xsltCopyText(): " "Failed to copy the string.\n"); ctxt->state = XSLT_STATE_STOPPED; } return(copy); } /* * xsltShallowCopyElem -- * Copied from libxslt-1.1.24 transform.c * (without the debugging code) */ static xmlNodePtr xsltShallowCopyElem(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr insert, int isLRE) { xmlNodePtr copy; if ((node->type == XML_DTD_NODE) || (insert == NULL)) return(NULL); if ((node->type == XML_TEXT_NODE) || (node->type == XML_CDATA_SECTION_NODE)) return(xsltCopyText(ctxt, insert, node, 0)); copy = xmlDocCopyNode(node, insert->doc, 0); if (copy != NULL) { copy->doc = ctxt->output; xmlAddChild(insert, copy); if (node->type == XML_ELEMENT_NODE) { if (node->nsDef != NULL) { if (isLRE) xsltCopyNamespaceList(ctxt, copy, node->nsDef); else xsltCopyNamespaceListInternal(copy, node->nsDef); } if (node->ns != NULL) { if (isLRE) { copy->ns = xsltGetNamespace(ctxt, node, node->ns, copy); } else { copy->ns = xsltGetSpecialNamespace(ctxt, node, node->ns->href, node->ns->prefix, copy); } } else if ((insert->type == XML_ELEMENT_NODE) && (insert->ns != NULL)) { xsltGetSpecialNamespace(ctxt, node, NULL, NULL, copy); } } } else { xsltTransformError(ctxt, NULL, node, "xsltShallowCopyElem: copy %s failed\n", node->name); } return(copy); } /* * xsltApplyFallbacks -- * Copied from libxslt-1.1.24 transform.c * (without the debugging code) */ static int xsltApplyFallbacks(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst) { xmlNodePtr child; int ret = 0; if ((ctxt == NULL) || (node == NULL) || (inst == NULL) || (inst->children == NULL)) return(0); child = inst->children; while (child != NULL) { if ((IS_XSLT_ELEM(child)) && (xmlStrEqual(child->name, BAD_CAST "fallback"))) { ret++; xsltApplySequenceConstructor(ctxt, node, child->children, NULL); } child = child->next; } return(ret); } /* * xsltReleaseLocalRVTs -- * Copied from libxslt-1.1.24 transform.c * (without the debugging code) */ static void xsltReleaseLocalRVTs(xsltTransformContextPtr ctxt, xmlDocPtr base) { xmlDocPtr cur = ctxt->localRVT, tmp; while ((cur != NULL) && (cur != base)) { if (cur->psvi == (void *) ((long) 1)) { cur = (xmlDocPtr) cur->next; } else { tmp = cur; cur = (xmlDocPtr) cur->next; if (tmp == ctxt->localRVT) ctxt->localRVT = cur; if (tmp == ctxt->localRVTBase) ctxt->localRVTBase = cur; if (tmp->prev) tmp->prev->next = (xmlNodePtr) cur; if (cur) cur->prev = tmp->prev; xsltReleaseRVT(ctxt, tmp); } } } /* * xsltApplySequenceConstructor -- * Copied from libxslt-1.1.24 transform.c * (without the debugging code) */ static void xsltApplySequenceConstructor(xsltTransformContextPtr ctxt, xmlNodePtr contextNode, xmlNodePtr list, xsltTemplatePtr templ) { xmlNodePtr oldInsert, oldInst, oldCurInst, oldContextNode; xmlNodePtr cur, insert, copy = NULL; int level = 0, oldVarsNr; xmlDocPtr oldLocalFragmentTop, oldLocalFragmentBase; #ifdef XSLT_REFACTORED xsltStylePreCompPtr info; #endif if (ctxt == NULL) return; if (list == NULL) return; CHECK_STOPPED; oldLocalFragmentTop = ctxt->localRVT; oldInsert = insert = ctxt->insert; oldInst = oldCurInst = ctxt->inst; oldContextNode = ctxt->node; oldVarsNr = ctxt->varsNr; cur = list; while (cur != NULL) { ctxt->inst = cur; if (insert == NULL) { goto error; } #ifdef XSLT_REFACTORED if (cur->type == XML_ELEMENT_NODE) { info = (xsltStylePreCompPtr) cur->psvi; if (info == NULL) { if (IS_XSLT_ELEM_FAST(cur) && IS_XSLT_NAME(cur, "message")) { xsltMessage(ctxt, contextNode, cur); goto skip_children; } /* * Something really went wrong: */ xsltTransformError(ctxt, NULL, cur, "Internal error in xsltApplySequenceConstructor(): " "The element '%s' in the stylesheet has no compiled " "representation.\n", cur->name); goto skip_children; } if (info->type == XSLT_FUNC_LITERAL_RESULT_ELEMENT) { xsltStyleItemLRElementInfoPtr lrInfo = (xsltStyleItemLRElementInfoPtr) info; copy = xmlDocCopyNode(cur, insert->doc, 0); if (copy == NULL) { xsltTransformError(ctxt, NULL, cur, "Internal error in xsltApplySequenceConstructor(): " "Failed to copy literal result element '%s'.\n", cur->name); goto error; } else { copy->doc = ctxt->output; xmlAddChild(insert, copy); if (lrInfo->effectiveNs != NULL) { xsltEffectiveNsPtr effNs = lrInfo->effectiveNs; xmlNsPtr ns, lastns = NULL; while (effNs != NULL) { ns = xmlSearchNs(copy->doc, copy, effNs->prefix); if ((ns != NULL) && (xmlStrEqual(ns->href, effNs->nsName))) { effNs = effNs->next; continue; } ns = xmlNewNs(copy, effNs->nsName, effNs->prefix); if (ns == NULL) { xsltTransformError(ctxt, NULL, cur, "Internal error in " "xsltApplySequenceConstructor(): " "Failed to copy a namespace " "declaration.\n"); goto error; } if (lastns == NULL) copy->nsDef = ns; else lastns->next =ns; lastns = ns; effNs = effNs->next; } } if (cur->ns != NULL) { copy->ns = xsltGetSpecialNamespace(ctxt, cur, cur->ns->href, cur->ns->prefix, copy); } else { if (copy->nsDef || ((insert != NULL) && (insert->type == XML_ELEMENT_NODE) && (insert->ns != NULL))) { xsltGetSpecialNamespace(ctxt, cur, NULL, NULL, copy); } } } if (cur->properties != NULL) { xsltAttrListTemplateProcess(ctxt, copy, cur->properties); } } else if (IS_XSLT_ELEM_FAST(cur)) { if (info->type == XSLT_FUNC_UNKOWN_FORWARDS_COMPAT) { ctxt->insert = insert; if (!xsltApplyFallbacks(ctxt, contextNode, cur)) { xsltTransformError(ctxt, NULL, cur, "The is no fallback behaviour defined for " "the unknown XSLT element '%s'.\n", cur->name); } ctxt->insert = oldInsert; } else if (info->func != NULL) { ctxt->insert = insert; info->func(ctxt, contextNode, cur, (xsltElemPreCompPtr) info); if (oldLocalFragmentTop != ctxt->localRVT) xsltReleaseLocalRVTs(ctxt, oldLocalFragmentTop); ctxt->insert = oldInsert; } else if (info->type == XSLT_FUNC_VARIABLE) { xsltStackElemPtr tmpvar = ctxt->vars; xsltParseStylesheetVariable(ctxt, cur); if (tmpvar != ctxt->vars) { ctxt->vars->level = level; } } else if (info->type == XSLT_FUNC_MESSAGE) { xsltMessage(ctxt, contextNode, cur); } else { xsltTransformError(ctxt, NULL, cur, "Unexpected XSLT element '%s'.\n", cur->name); } goto skip_children; } else { xsltTransformFunction func; if (cur->psvi == xsltExtMarker) { func = (xsltTransformFunction) xsltExtElementLookup(ctxt, cur->name, cur->ns->href); } else func = ((xsltElemPreCompPtr) cur->psvi)->func; if (func == NULL) { ctxt->insert = insert; if (!xsltApplyFallbacks(ctxt, contextNode, cur)) { xsltTransformError(ctxt, NULL, cur, "Unknown extension instruction '{%s}%s'.\n", cur->ns->href, cur->name); } ctxt->insert = oldInsert; } else { ctxt->insert = insert; oldLocalFragmentBase = ctxt->localRVTBase; ctxt->localRVTBase = NULL; func(ctxt, contextNode, cur, cur->psvi); ctxt->localRVTBase = oldLocalFragmentBase; if (oldLocalFragmentTop != ctxt->localRVT) xsltReleaseLocalRVTs(ctxt, oldLocalFragmentTop); ctxt->insert = oldInsert; } goto skip_children; } } else if (XSLT_IS_TEXT_NODE(cur)) { if (xsltCopyText(ctxt, insert, cur, ctxt->internalized) == NULL) goto error; } #else /* XSLT_REFACTORED */ if (IS_XSLT_ELEM(cur)) { xsltStylePreCompPtr info = (xsltStylePreCompPtr) cur->psvi; if (info == NULL) { if (IS_XSLT_NAME(cur, "message")) { xsltMessage(ctxt, contextNode, cur); } else { ctxt->insert = insert; if (!xsltApplyFallbacks(ctxt, contextNode, cur)) { xsltGenericError(xsltGenericErrorContext, "xsltApplySequenceConstructor: %s was not compiled\n", cur->name); } ctxt->insert = oldInsert; } goto skip_children; } if (info->func != NULL) { oldCurInst = ctxt->inst; ctxt->inst = cur; ctxt->insert = insert; oldLocalFragmentBase = ctxt->localRVTBase; ctxt->localRVTBase = NULL; info->func(ctxt, contextNode, cur, (xsltElemPreCompPtr) info); ctxt->localRVTBase = oldLocalFragmentBase; if (oldLocalFragmentTop != ctxt->localRVT) xsltReleaseLocalRVTs(ctxt, oldLocalFragmentTop); ctxt->insert = oldInsert; ctxt->inst = oldCurInst; goto skip_children; } if (IS_XSLT_NAME(cur, "variable")) { xsltStackElemPtr tmpvar = ctxt->vars; oldCurInst = ctxt->inst; ctxt->inst = cur; xsltParseStylesheetVariable(ctxt, cur); ctxt->inst = oldCurInst; if (tmpvar != ctxt->vars) { ctxt->vars->level = level; } } else if (IS_XSLT_NAME(cur, "message")) { xsltMessage(ctxt, contextNode, cur); } else { xsltTransformError(ctxt, NULL, cur, "Unexpected XSLT element '%s'.\n", cur->name); } goto skip_children; } else if ((cur->type == XML_TEXT_NODE) || (cur->type == XML_CDATA_SECTION_NODE)) { if (xsltCopyText(ctxt, insert, cur, ctxt->internalized) == NULL) goto error; } else if ((cur->type == XML_ELEMENT_NODE) && (cur->ns != NULL) && (cur->psvi != NULL)) { xsltTransformFunction function; oldCurInst = ctxt->inst; ctxt->inst = cur; if (cur->psvi == xsltExtMarker) function = (xsltTransformFunction) xsltExtElementLookup(ctxt, cur->name, cur->ns->href); else function = ((xsltElemPreCompPtr) cur->psvi)->func; if (function == NULL) { xmlNodePtr child; int found = 0; child = cur->children; while (child != NULL) { if ((IS_XSLT_ELEM(child)) && (IS_XSLT_NAME(child, "fallback"))) { found = 1; xsltApplySequenceConstructor(ctxt, contextNode, child->children, NULL); } child = child->next; } if (!found) { xsltTransformError(ctxt, NULL, cur, "xsltApplySequenceConstructor: failed to find extension %s\n", cur->name); } } else { ctxt->insert = insert; oldLocalFragmentBase = ctxt->localRVTBase; ctxt->localRVTBase = NULL; function(ctxt, contextNode, cur, cur->psvi); if (oldLocalFragmentTop != ctxt->localRVT) xsltReleaseLocalRVTs(ctxt, oldLocalFragmentTop); ctxt->localRVTBase = oldLocalFragmentBase; ctxt->insert = oldInsert; } ctxt->inst = oldCurInst; goto skip_children; } else if (cur->type == XML_ELEMENT_NODE) { oldCurInst = ctxt->inst; ctxt->inst = cur; if ((copy = xsltShallowCopyElem(ctxt, cur, insert, 1)) == NULL) goto error; if ((templ != NULL) && (oldInsert == insert) && (ctxt->templ != NULL) && (ctxt->templ->inheritedNs != NULL)) { int i; xmlNsPtr ns, ret; for (i = 0; i < ctxt->templ->inheritedNsNr; i++) { const xmlChar *URI = NULL; xsltStylesheetPtr style; ns = ctxt->templ->inheritedNs[i]; style = ctxt->style; while (style != NULL) { if (style->nsAliases != NULL) URI = (const xmlChar *) xmlHashLookup(style->nsAliases, ns->href); if (URI != NULL) break; style = xsltNextImport(style); } if (URI == UNDEFINED_DEFAULT_NS) continue; if (URI == NULL) URI = ns->href; ret = xmlSearchNs(copy->doc, copy, ns->prefix); if ((ret == NULL) || (!xmlStrEqual(ret->href, URI))) { xmlNewNs(copy, URI, ns->prefix); } } if (copy->ns != NULL) { copy->ns = xsltGetNamespace(ctxt, cur, copy->ns, copy); } } if (cur->properties != NULL) { xsltAttrListTemplateProcess(ctxt, copy, cur->properties); } ctxt->inst = oldCurInst; } #endif /* else of XSLT_REFACTORED */ if (cur->children != NULL) { if (cur->children->type != XML_ENTITY_DECL) { cur = cur->children; level++; if (copy != NULL) insert = copy; continue; } } skip_children: if (ctxt->state == XSLT_STATE_STOPPED) break; if (cur->next != NULL) { cur = cur->next; continue; } do { cur = cur->parent; level--; if ((ctxt->varsNr > oldVarsNr) && (ctxt->vars->level > level)) { xsltLocalVariablePop(ctxt, oldVarsNr, level); } insert = insert->parent; if (cur == NULL) break; if (cur == list->parent) { cur = NULL; break; } if (cur->next != NULL) { cur = cur->next; break; } } while (cur != NULL); } error: if (ctxt->varsNr > oldVarsNr) xsltLocalVariablePop(ctxt, oldVarsNr, -1); ctxt->node = oldContextNode; ctxt->inst = oldInst; ctxt->insert = oldInsert; } static void TclXSLTExtElementTransform(ctxt, node, inst, comp) xsltTransformContextPtr ctxt; /* unused */ xmlNodePtr node; xmlNodePtr inst; xsltStylePreCompPtr comp; /* unused */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); TclXSLT_Extension *extinfo; Tcl_HashEntry *entry; Tcl_Obj *cmdPtr, *objPtr, *avtObjPtr, *elemObj; xsltStylesheetPtr style = NULL; xmlDocPtr oldOutput, res = NULL; xmlNodePtr oldInsert; xsltOutputType oldType; xmlAttrPtr attr; int ret; if (inst == NULL) { return; } entry = Tcl_FindHashEntry(tsdPtr->extensions, (CONST char *) inst->ns->href); if (entry == NULL) { /* * Cannot find extension module. * Must have been removed. */ return; } extinfo = (TclXSLT_Extension *) Tcl_GetHashValue(entry); /* * Evaluate every attribute as an AVT. * Pass these values on to the callback as a list. * Each list element is (name, ns, value) */ avtObjPtr = Tcl_NewListObj(0, NULL); for (attr = inst->properties; attr != NULL; attr = attr->next) { elemObj = Tcl_NewListObj(0, NULL); if (Tcl_ListObjAppendElement(extinfo->interp, elemObj, Tcl_NewStringObj((CONST char *) attr->name, -1))) { goto error; } if (attr->ns != NULL) { if (Tcl_ListObjAppendElement(extinfo->interp, elemObj, Tcl_NewStringObj((CONST char *) attr->ns->href, -1))) { goto error; } } else { if (Tcl_ListObjAppendElement(extinfo->interp, elemObj, Tcl_NewObj())) { goto error; } } if (Tcl_ListObjAppendElement(extinfo->interp, elemObj, Tcl_NewStringObj((char *) xsltEvalAttrValueTemplate(ctxt, inst, attr->name, NULL), -1))) { goto error; } if (Tcl_ListObjAppendElement(extinfo->interp, avtObjPtr, elemObj)) { goto error; } } /* * Evaluate the element content. */ oldOutput = ctxt->output; oldInsert = ctxt->insert; oldType = ctxt->type; style = xsltNewStylesheet(); if (style == NULL) { xsltTransformError(ctxt, NULL, inst, "TclXSLT: out of memory\n"); goto error; } res = xmlNewDoc(style->version); res->charset = XML_CHAR_ENCODING_UTF8; ctxt->output = res; ctxt->insert = (xmlNodePtr) res; xsltApplySequenceConstructor(ctxt, node, inst->children, NULL); /* * Start constructing the script by first defining the command. */ cmdPtr = Tcl_DuplicateObj(extinfo->tclns); Tcl_AppendStringsToObj(cmdPtr, "::", inst->name, NULL); if (res != NULL) { objPtr = TclDOM_libxml2_CreateObjFromDoc(extinfo->interp, res); if (objPtr == NULL) { Tcl_DecrRefCount(cmdPtr); Tcl_BackgroundError(extinfo->interp); goto error; } if (Tcl_ListObjAppendElement(extinfo->interp, cmdPtr, objPtr) != TCL_OK) { Tcl_DecrRefCount(cmdPtr); Tcl_BackgroundError(extinfo->interp); goto error; } } else { if (Tcl_ListObjAppendElement(extinfo->interp, cmdPtr, Tcl_NewObj()) != TCL_OK) { Tcl_DecrRefCount(cmdPtr); Tcl_BackgroundError(extinfo->interp); goto error; } } if (node != NULL) { objPtr = TclDOM_libxml2_CreateObjFromNode(extinfo->interp, node); if (objPtr == NULL) { Tcl_DecrRefCount(cmdPtr); Tcl_BackgroundError(extinfo->interp); goto error; } if (Tcl_ListObjAppendElement(extinfo->interp, cmdPtr, objPtr) != TCL_OK) { Tcl_DecrRefCount(cmdPtr); Tcl_BackgroundError(extinfo->interp); goto error; } } else { if (Tcl_ListObjAppendElement(extinfo->interp, cmdPtr, Tcl_NewObj()) != TCL_OK) { Tcl_DecrRefCount(cmdPtr); Tcl_BackgroundError(extinfo->interp); goto error; } } if (inst != NULL) { objPtr = TclDOM_libxml2_CreateObjFromNode(extinfo->interp, inst); if (objPtr == NULL) { Tcl_DecrRefCount(cmdPtr); Tcl_BackgroundError(extinfo->interp); goto error; } if (Tcl_ListObjAppendElement(extinfo->interp, cmdPtr, objPtr) != TCL_OK) { Tcl_DecrRefCount(cmdPtr); Tcl_BackgroundError(extinfo->interp); goto error; } } else { if (Tcl_ListObjAppendElement(extinfo->interp, cmdPtr, Tcl_NewObj()) != TCL_OK) { Tcl_DecrRefCount(cmdPtr); Tcl_BackgroundError(extinfo->interp); goto error; } } if (Tcl_ListObjAppendElement(extinfo->interp, cmdPtr, avtObjPtr) != TCL_OK) { Tcl_DecrRefCount(cmdPtr); Tcl_BackgroundError(extinfo->interp); goto error; } /* * Converting the stylesheet node to a TclDOM node may clobber the * _private pointer. It would be nice to find the equivalent node * in the original DOM tree, but it may not even exist anymore :-( * * TODO: make extension elements more effective, and allow * pre-computation. */ /* * Now evaluate the complete command. */ ret = Tcl_EvalObjEx(extinfo->interp, cmdPtr, TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT); if (ret != TCL_OK) { xsltTransformError(ctxt, NULL, NULL, "TclXSLT extension failed: \"%s\"", Tcl_GetStringFromObj(Tcl_GetObjResult(extinfo->interp), NULL)); Tcl_BackgroundError(extinfo->interp); } /* * TODO: * If the script evaluation is successful, then the return * result is either a DOM node to be inserted into the result tree * or a string to be added as a text node. */ error: ctxt->output = oldOutput; ctxt->insert = oldInsert; ctxt->type = oldType; } /* *---------------------------------------------------------------------------- * * TclXSLTExtFunction -- * * Handles evaluation of an extension function. * * Results: * Returns string returned by Tcl command evaluation. * * Side effects: * Depends on Tcl command evaluated. * *---------------------------------------------------------------------------- */ static void TclXSLTExtFunction(xpathCtxt, nargs) xmlXPathParserContextPtr xpathCtxt; int nargs; { xsltTransformContextPtr xformCtxt; TclXSLT_Extension *extinfo; Tcl_Obj *cmdPtr, *resultPtr; xmlXPathObjectPtr obj; int ret; Tcl_MutexLock(&libxslt); xformCtxt = xsltXPathGetTransformContext(xpathCtxt); /* * In order to find the instance data we need the * XML Namespace URI of this function. */ extinfo = (TclXSLT_Extension *) xsltGetExtData(xformCtxt, xpathCtxt->context->functionURI); /* * Start constructing the script by first defining the command. */ cmdPtr = Tcl_DuplicateObj(extinfo->tclns); Tcl_IncrRefCount(cmdPtr); Tcl_AppendStringsToObj(cmdPtr, "::", xpathCtxt->context->function, NULL); /* * Each argument on the stack is converted to a Tcl_Obj * of an appropriate type and passed as an argument to the Tcl command. */ while (nargs) { Tcl_Obj *objv[2]; obj = (xmlXPathObjectPtr) valuePop(xpathCtxt); if (obj == NULL) { xmlXPathSetError(xpathCtxt, XPATH_INVALID_OPERAND); Tcl_DecrRefCount(cmdPtr); Tcl_MutexUnlock(&libxslt); return; } objv[0] = TclXSLT_ConvertXPathObjToTclObj(extinfo->interp, obj); objv[1] = NULL; if (Tcl_ListObjReplace(extinfo->interp, cmdPtr, 1, 0, 1, objv) != TCL_OK) { Tcl_BackgroundError(extinfo->interp); Tcl_DecrRefCount(objv[0]); Tcl_DecrRefCount(cmdPtr); Tcl_MutexUnlock(&libxslt); return; } /* When should this XPath object be freed? * Immediately before returning from the function call? * What if the application retains a pointer to it? * If the application destroys the contents, then memory * will leak because the XPath object is not freed. * * TODO: take a copy of the object's content and pass that * to the application callback. That would allow this object * to be freed and allow the application to manage the copy. xmlXPathFreeObject(obj); */ nargs--; } ret = Tcl_EvalObjEx(extinfo->interp, cmdPtr, TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT); resultPtr = Tcl_GetObjResult(extinfo->interp); Tcl_DecrRefCount(cmdPtr); Tcl_IncrRefCount(resultPtr); if (ret == TCL_OK) { obj = TclXSLT_ConvertTclObjToXPathObj(extinfo->interp, resultPtr); valuePush(xpathCtxt, obj); } else { xmlGenericError(xmlGenericErrorContext, Tcl_GetStringFromObj(resultPtr, NULL)); /* Need to define a new error code - this is the closest in meaning */ xpathCtxt->error = XPATH_UNKNOWN_FUNC_ERROR; } Tcl_MutexUnlock(&libxslt); Tcl_DecrRefCount(resultPtr); } /* *---------------------------------------------------------------------------- * * TclXSLT_ConvertTclObjToXPathObj -- * * Convert a Tcl Object to an XPath object. * Data type is preserved, with nodesets being * mapped from a list of nodes. * * NB. Mutex is assumed to be locked when invoking this routine. * * Results: * XPath Object. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static xmlXPathObjectPtr TclXSLT_ConvertTclObjToXPathObj(interp, objPtr) Tcl_Interp *interp; Tcl_Obj *objPtr; { xmlNodePtr nodePtr; xmlDocPtr docPtr; if (TclDOM_libxml2_GetNodeFromObj(interp, objPtr, &nodePtr) == TCL_OK) { return xmlXPathNewNodeSet(nodePtr); } if (TclXML_libxml2_GetDocFromObj(interp, objPtr, &docPtr) == TCL_OK) { return xmlXPathNewNodeSet((xmlNodePtr) docPtr); } if (objPtr->typePtr == Tcl_GetObjType("int") || objPtr->typePtr == Tcl_GetObjType("double")) { double number; if (Tcl_GetDoubleFromObj(interp, objPtr, &number) == TCL_OK) { return xmlXPathNewFloat(number); } else { return NULL; } } else if (objPtr->typePtr == Tcl_GetObjType("boolean")) { int bool; if (Tcl_GetBooleanFromObj(interp, objPtr, &bool) == TCL_OK) { return xmlXPathNewBoolean(bool); } else { return NULL; } } else if (objPtr->typePtr == Tcl_GetObjType("list")) { /* * If each of the elements can be converted to a node, * then return a nodeset. */ int i, len; Tcl_Obj **listPtr; xmlNodeSetPtr nset; Tcl_ListObjGetElements(interp, objPtr, &len, &listPtr); if (len == 0) { return xmlXPathNewNodeSet(NULL); } /* * First pass: check that the elements are all nodes. */ for (i = 0; i < len; i++) { if (TclXML_libxml2_GetDocFromObj(interp, listPtr[i], &docPtr) == TCL_OK) { continue; } if (TclDOM_libxml2_GetNodeFromObj(interp, listPtr[i], &nodePtr) != TCL_OK) { return xmlXPathNewString((const xmlChar *) Tcl_GetStringFromObj(objPtr, NULL)); } } /* * Now go ahead and create the nodeset (we already did the hard * work to create internal reps in pass 1). */ if (TclXML_libxml2_GetDocFromObj(interp, listPtr[0], &docPtr) == TCL_OK) { nset = xmlXPathNodeSetCreate((xmlNodePtr) docPtr); } else { TclDOM_libxml2_GetNodeFromObj(interp, listPtr[0], &nodePtr); nset = xmlXPathNodeSetCreate(nodePtr); } for (i = 1; i < len; i++) { if (TclXML_libxml2_GetDocFromObj(interp, listPtr[i], &docPtr) == TCL_OK) { xmlXPathNodeSetAdd(nset, (xmlNodePtr) docPtr); } else { TclDOM_libxml2_GetNodeFromObj(interp, listPtr[i], &nodePtr); xmlXPathNodeSetAdd(nset, nodePtr); } } return xmlXPathWrapNodeSet(nset); } else { return xmlXPathNewString((const xmlChar *) Tcl_GetStringFromObj(objPtr, NULL)); } } /* *---------------------------------------------------------------------------- * * TclXSLT_ConvertXPathObjToTclObj -- * * Convert an XPath object to a Tcl Object. * Data type is preserved, with nodesets being * mapped to a list of nodes. * * Results: * Tcl Object. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static Tcl_Obj * TclXSLT_ConvertXPathObjToTclObj(interp, xpobj) Tcl_Interp *interp; xmlXPathObjectPtr xpobj; { Tcl_Obj *objPtr; int i; switch (xpobj->type) { case XPATH_XSLT_TREE: case XPATH_NODESET: objPtr = Tcl_NewListObj(0, NULL); if (xpobj->nodesetval) { for (i = 0; i < xpobj->nodesetval->nodeNr; i++) { Tcl_Obj *nodeObjPtr = NULL; if (xpobj->nodesetval->nodeTab[i] && xpobj->nodesetval->nodeTab[i]->type == XML_DOCUMENT_NODE) { nodeObjPtr = TclXML_libxml2_CreateObjFromDoc((xmlDocPtr) xpobj->nodesetval->nodeTab[i]); } else if (xpobj->nodesetval->nodeTab[i]) { nodeObjPtr = TclDOM_libxml2_CreateObjFromNode(interp, xpobj->nodesetval->nodeTab[i]); } Tcl_ListObjAppendElement(interp, objPtr, nodeObjPtr); } } break; case XPATH_BOOLEAN: objPtr = Tcl_NewBooleanObj(xpobj->boolval); break; case XPATH_NUMBER: objPtr = Tcl_NewDoubleObj(xpobj->floatval); break; case XPATH_STRING: case XPATH_UNDEFINED: case XPATH_POINT: case XPATH_RANGE: case XPATH_LOCATIONSET: case XPATH_USERS: default: objPtr = Tcl_NewStringObj((CONST char *) xmlXPathCastToString(xpobj), -1); break; } return objPtr; } /* *---------------------------------------------------------------------------- * * TclXSLTExtShutdown -- * * Clean up. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static void TclXSLTExtShutdown(ctxt, URI, userdata) xsltTransformContextPtr ctxt; const xmlChar *URI; void *userdata; { /* Nothing to do */ } /* *---------------------------------------------------------------------------- * * TclXSLTSecurity -- * TclXSLTSecurityReadFile -- * TclXSLTSecurityWriteFile -- * TclXSLTSecurityCreateDirectory -- * TclXSLTSecurityReadNetwork -- * TclXSLTSecurityWriteNetwork -- * * Check if external operations are permitted. * * Results: * Returns boolean value. * * Side effects: * Depends on callback. * *---------------------------------------------------------------------------- */ static int TclXSLTSecurity(name, method, value) Tcl_Obj *name; const char *method; const char *value; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_Interp *master; Tcl_Obj *cmdPtr, *pathPtr; int result, permitted; if (Tcl_IsSafe(tsdPtr->interp)) { /* * Invoke hidden command */ master = Tcl_GetMaster(tsdPtr->interp); if (!Tcl_IsSafe(master)) { return 0; } if (Tcl_GetInterpPath(master, tsdPtr->interp) != TCL_OK) { return 0; } pathPtr = Tcl_GetObjResult(master); cmdPtr = Tcl_NewListObj(0, NULL); Tcl_IncrRefCount(cmdPtr); Tcl_ListObjAppendElement(master, cmdPtr, Tcl_NewStringObj("interp", -1)); Tcl_ListObjAppendElement(master, cmdPtr, Tcl_NewStringObj("invokehidden", -1)); Tcl_ListObjAppendElement(master, cmdPtr, pathPtr); Tcl_ListObjAppendElement(master, cmdPtr, Tcl_NewStringObj("-global", -1)); Tcl_ListObjAppendElement(master, cmdPtr, Tcl_NewStringObj("::xslt::security", -1)); Tcl_ListObjAppendElement(master, cmdPtr, name); Tcl_ListObjAppendElement(master, cmdPtr, Tcl_NewStringObj(method, -1)); Tcl_ListObjAppendElement(master, cmdPtr, Tcl_NewStringObj(value, -1)); result = Tcl_EvalObjEx(master, cmdPtr, TCL_EVAL_GLOBAL|TCL_EVAL_DIRECT); Tcl_DecrRefCount(cmdPtr); } else { /* * Invoke command normally */ cmdPtr = Tcl_NewListObj(0, NULL); Tcl_IncrRefCount(cmdPtr); Tcl_ListObjAppendElement(tsdPtr->interp, cmdPtr, Tcl_NewStringObj("::xslt::security", -1)); Tcl_ListObjAppendElement(tsdPtr->interp, cmdPtr, name); Tcl_ListObjAppendElement(tsdPtr->interp, cmdPtr, Tcl_NewStringObj(method, -1)); Tcl_ListObjAppendElement(tsdPtr->interp, cmdPtr, Tcl_NewStringObj(value, -1)); result = Tcl_EvalObjEx(tsdPtr->interp, cmdPtr, TCL_EVAL_GLOBAL|TCL_EVAL_DIRECT); Tcl_DecrRefCount(cmdPtr); } if (result == TCL_OK) { if (Tcl_GetBooleanFromObj(tsdPtr->interp, Tcl_GetObjResult(tsdPtr->interp), &permitted) == TCL_OK) { return permitted; } else if (Tcl_IsSafe(tsdPtr->interp)) { return 0; } else { return 1; } } else if (Tcl_IsSafe(tsdPtr->interp)) { return 0; } else { return 1; } } static Tcl_Obj * TclXSLTSecurityGetName(ctxt) xsltTransformContextPtr ctxt; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr; if (ctxt) { entryPtr = Tcl_FindHashEntry(tsdPtr->stylesheets, (ClientData) ctxt->style); if (entryPtr) { return Tcl_NewStringObj((char *) Tcl_GetHashValue(entryPtr), -1); } else { return Tcl_NewObj(); } } else { return Tcl_NewObj(); } } static int TclXSLTSecurityReadFile(sec, ctxt, value) xsltSecurityPrefsPtr sec; xsltTransformContextPtr ctxt; const char *value; { return TclXSLTSecurity(TclXSLTSecurityGetName(ctxt), "readfile", value); } static int TclXSLTSecurityWriteFile(sec, ctxt, value) xsltSecurityPrefsPtr sec; xsltTransformContextPtr ctxt; const char *value; { return TclXSLTSecurity(TclXSLTSecurityGetName(ctxt), "writefile", value); } static int TclXSLTSecurityCreateDirectory(sec, ctxt, value) xsltSecurityPrefsPtr sec; xsltTransformContextPtr ctxt; const char *value; { return TclXSLTSecurity(TclXSLTSecurityGetName(ctxt), "createdirectory", value); } static int TclXSLTSecurityReadNetwork(sec, ctxt, value) xsltSecurityPrefsPtr sec; xsltTransformContextPtr ctxt; const char *value; { return TclXSLTSecurity(TclXSLTSecurityGetName(ctxt), "readnetwork", value); } static int TclXSLTSecurityWriteNetwork(sec, ctxt, value) xsltSecurityPrefsPtr sec; xsltTransformContextPtr ctxt; const char *value; { return TclXSLTSecurity(TclXSLTSecurityGetName(ctxt), "writenetwork", value); } tclxml-3.3~svn11.orig/doc/0000755000000000000000000000000011574742521014163 5ustar rootroottclxml-3.3~svn11.orig/doc/txt.xsl0000644000000000000000000001601011117300450015510 0ustar rootroot Text Stylesheet 2008 Explain This stylesheet produces a text rendition of a DocBook document. Version , ( ) - = * [ ] tclxml-3.3~svn11.orig/doc/transform.tcl0000644000000000000000000000316111215700771016674 0ustar rootroot#!/bin/sh # -*- tcl -*- \ exec tclsh "$0" "$@" # transform.tcl -- # # Transform a source document with a XSL stylesheet. # # Arguments: # source-doc Source XML document # style-doc XSL Stylesheet # result-doc Result HTML document # # Copyright (c) 2008-2009 Explain # http://www.explain.com.au/ # # $Id$ package require xml package require xslt set srcFname {} set styleFname {} set resultFname {} foreach {srcFname styleFname resultFname} $argv break if {$srcFname == "" || $styleFname == "" || $resultFname == ""} { puts stderr "Usage: $argv0 source-doc style-doc result-doc" exit 1 } proc ReadXML fname { if {[catch {open $fname} ch]} { puts stderr "unable to open \"$fname\" due to \"$ch\"" exit 2 } set xml [read $ch] close $ch if {[catch {dom::parse $xml -baseuri file://[file normalize [file join [pwd] $fname]]} doc]} { puts stderr "unable to read XML document due to \"$doc\"" exit 3 } return $doc } proc Message args { if {[string length [string trim {*}$args]]} { puts {*}$args } } set srcdoc [ReadXML $srcFname] set styledoc [ReadXML $styleFname] if {[catch {xslt::compile $styledoc} style]} { puts stderr "unable to compile XSL stylesheet due to \"$style\"" exit 4 } $style configure -messagecommand Message if {[catch {$style transform $srcdoc} resultdoc]} { puts stderr "error while performing transformation: \"$resultdoc\"" exit 5 } if {[catch {open $resultFname w} ch]} { puts stderr "unable to open file \"$resultFname\" for writing due to \"$ch\"" exit 6 } puts $ch [dom::serialize $resultdoc -method [$style cget -method]] close $ch exit 0 tclxml-3.3~svn11.orig/doc/xsltsl/0000755000000000000000000000000011574742521015514 5ustar rootroottclxml-3.3~svn11.orig/doc/xsltsl/date-time.xsl0000644000000000000000000021245611116050505020111 0ustar rootroot $Id: date-time.xsl,v 1.13 2004/11/28 10:48:09 balls Exp $ Diamond Jason 2004 Steve Ball 2001 Jason Diamond Date/Time Processing
Introduction This module provides templates for formatting and parsing date/time strings. See http://www.tondering.dk/claus/calendar.html for more information on calendars and the calculations this library performs.
Returns a string with a formatted date/time. The formatted date/time is determined by the format parameter. The default format is %Y-%m-%dT%H:%M:%S%z, the W3C format. xsd-date-time The date-time value in XML Schemas (WXS) format. If this value is specified, it takes priority over other parameters. year Year, in either 2 or 4+ digit format.. If the year is given as a two digit value, it will be converted to a four digit value using the fixed window method. Values between 00 and 49 will be prepended by "20". Values between 50 and 99 will be prepended by "19". month Month (1 - 12; January = 1) day Day of month (1 - 31) hour Hours since midnight (0 - 23) minute Minutes after hour (0 - 59) second Seconds after minute (0 - 59) time-zone Time zone string (e.g., 'Z' or '-08:00') format The format specification. %a Abbreviated weekday name %A Full weekday name %b Abbreviated month name %B Full month name %c Date and time representation appropriate for locale %d Day of month as decimal number (01 - 31) %e Day of month as decimal number (1 - 31) %H Hour in 24-hour format (00 - 23) %I Hour in 12-hour format (01 - 12) %i Hour in 12-hour format (1 - 12) %j Day of year as decimal number (001 - 366) %m Month as decimal number (01 - 12) %n Month as decimal number (1 - 12) %M Minute as decimal number (00 - 59) %P Current locale's A.M./P.M. indicator for 12-hour clock, uppercase %Q Current locale's A.M./P.M. indicator for 12-hour clock, uppercase with periods %p Current locale's A.M./P.M. indicator for 12-hour clock, lowercase %q Current locale's A.M./P.M. indicator for 12-hour clock, lowercase with periods %S Second as decimal number (00 - 59) %U Week of year as decimal number, with Sunday as first day of week (00 - 53) %w Weekday as decimal number (0 - 6; Sunday is 0) %W Week of year as decimal number, with Monday as first day of week (00 - 53) %x Date representation for current locale %X Time representation for current locale %y Year without century, as decimal number (00 - 99) %Y Year with century, as decimal number %z Time-zone name or abbreviation; no characters if time zone is unknown %% Percent sign Returns a formatted date/time string. % [not implemented] 0 0 12 0 0 12 [not implemented] 0 0 am pm am p.m. AM PM AM P.M. 0 [not implemented] [not implemented] invalid year value 00 invalid year value invalid year value % Calculates the day of the week. Given any Gregorian date, this calculates the day of the week. year Year month Month (1 - 12; January = 1) day Day of month (1 - 31) Returns the day of the week (0 - 6; Sunday = 0). Calculates the number of days for a specified month. Given any Gregorian month, this calculates the last day of the month. year Year month Month (1 - 12; January = 1) Returns the number of days in given month as a decimal number. 29 28 30 31 30 31 Gets the day of the week's full name. Converts a numeric day of the week value into a string representing the day's full name. day-of-the-week Day of the week (0 - 6; Sunday = 0) Returns a string. Sunday Monday Tuesday Wednesday Thursday Friday Saturday error: Gets the day of the week's abbreviation. Converts a numeric day of the week value into a string representing the day's abbreviation. day-of-the-week Day of the week (0 - 6; Sunday = 0) Returns a string. Sun Mon Tue Wed Thu Fri Sat error: Gets the month's full name. Converts a numeric month value into a string representing the month's full name. month Month (1 - 12; Januaray = 1) Returns a string. January February March April May June July August September October November December error: Gets the month's abbreviation. Converts a numeric month value into a string representing the month's abbreviation. month Month (1 - 12; Januaray = 1) Returns a string. Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec error: Calculates the Julian Day for a specified date. Given any Gregorian date, this calculates the Julian Day. year Year month Month (1 - 12; January = 1) day Day of month (1 - 31) Returns the Julian Day as a decimal number. Returns a string with a formatted date for a specified Julian Day. Given any Julian Day, this returns a string according to the format specification. julian-day A Julian Day format The format specification. See dt:format-date-time for more details. A string. Calculates the week number for a specified date. Assumes Monday is the first day of the week. year Year month Month (1 - 12; January = 1) day Day of month (1 - 31) Returns the week number as a decimal number. Take a month by name and return a number which can be used as input to the templates. Input month Month as described either by full name or abbreviation. Return a month as a decimal number. (Jan = 1) Return year component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns year component. Return month component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns month component. Return day component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns day component. Return hour component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns hour component. Return minute component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns minute component. Return second component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns second component. Return timezone component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns timezone component. Z + - Return two digit year as four digit year value. Prepend century to two digit year value. Century value is calculated according to suggested solutions in RFC2626 (section 5). Fixed window solution: 20 is prepended to year if the year is less than 50, otherwise 19 is prepended to year. Sliding window solution: The year is considered in the future if the year is less than the current 2 digit year plus 'n' years (where 'n' is a param), otherwise it is considered in the past. year A year value in 2 digit format. method RFC2626 suggested solution ('fixed' or 'sliding'). Default is 'fixed'. n No. of years. Used in sliding windows solution. Returns four digit year value. invalid year value 20 19 not yet implemented invalid method Return number of years. Extract year value from a Duration value. duration A XSD Duration format value. Returns year value. If the duration is not formatted correctly, returns empty string. Return number of months. Extract month value from a Duration value. duration A XSD Duration format value. Returns month value. If the duration is not formatted correctly, returns empty string. Return number of days. Extract day value from a Duration value. duration A XSD Duration format value. Returns day value. If the duration is not formatted correctly, returns empty string. Return number of hours. Extract hour value from a Duration value. duration A XSD Duration format value. Returns hour value. If the duration is not formatted correctly, returns empty string. Return number of minutes. Extract minute value from a Duration value. duration A XSD Duration format value. Returns minute value. If the duration is not formatted correctly, returns empty string. Return number of seconds. Extract second value from a Duration value. duration A XSD Duration format value. Returns second value. If the duration is not formatted correctly, returns empty string. - 0 0 0 0 0 0 0 0 0 0 0 0 . Return number of seconds in a duration. Converts a Duration value to seconds. This function will be unreliable for values greater than one month: months are assumed to have thirty days, and does not take into account leap days or seconds. duration A XSD Duration format value. Returns an integer value. If the duration is not formatted correctly, returns empty string.
tclxml-3.3~svn11.orig/doc/xsltsl/example.xsl0000644000000000000000000000522711116050505017667 0ustar rootroot $Id: example.xsl,v 1.5 2002/01/04 23:43:17 balls Exp $ Ball Steve 2001 Steve Ball Example Stylesheet
Introduction This module provides a template for adding stylesheet modules to the XSLT Standard Library. To add a new module to the library, follow these easy steps: Copy this file and replace its contents with the new module templates and documentation. Copy the corresponding test file in the test directory. Replace its contents with tests for the new module. Add an include element in the stdlib.xsl stylesheet. Add an entry in the test/test.xml file. Add entries in the test/test.xsl stylesheet. Add an entry in the doc/build.xml file. The example.xsl stylesheet provides a more extensive example.
Template Example Provides a template for writing templates. Replace this paragraph with a description of your template text The example string Returns nothing.
tclxml-3.3~svn11.orig/doc/xsltsl/svg.xsl0000644000000000000000000001575311116050505017040 0ustar rootroot $Id: svg.xsl,v 1.1 2003/03/31 21:07:35 balls Exp $ Ball Steve 2002 Steve Ball SVG Stylesheet
Introduction This module provides templates for creating SVG images.
Aqua-style Button Part of the mechanism to create an Aqua-style button. Include a call to this template in your SVG document's defs element. This template only needs to be included once. Use this in conjunction with svg:aqua-button. The default values for color1, color2 and color3 result in a grey button. prefix A prefix to append to the identifiers used, so that they don't clash with other identifiers. Default: "aqua-". color1 The base colour of the button. Default: "#d9d9d9". color2 A "background" colour for the button. Should be a darker colour than color1. Default: "#a9a9a9". color3 A highlight colour for the button. Should be a lighter colour than color1. Default: "#f9f9f9". Returns SVG result-tree-fragment. Aqua-style Button Part of the mechanism to create an Aqua-style button. Include a call to this template in your SVG document where you want a button to appear. This template can be used many times in a single SVG document. Use this in conjunction with svg:aqua-button-defs. prefix A prefix to append to the identifiers used, so that they don't clash with other identifiers. Default: "aqua-". Returns SVG result-tree-fragment.
tclxml-3.3~svn11.orig/doc/xsltsl/uri.xsl0000644000000000000000000006016111116050505017031 0ustar rootroot $Id: uri.xsl,v 1.6 2002/01/11 22:07:08 injektilo Exp $ Diamond Jason 2005 Steve Ball 2001 Jason Diamond URI (Uniform Resource Identifier) Processing
Introduction This module provides templates for processing URIs (Uniform Resource Identifers).
Determines if a URI is absolute or relative. Absolute URIs start with a scheme (like "http:" or "mailto:"). uri An absolute or relative URI. Returns 'true' if the URI is absolute or '' if it's not. Gets the scheme part of a URI. The ':' is not part of the scheme. uri An absolute or relative URI. Returns the scheme (without the ':') or '' if the URI is relative. Gets the authority part of a URI. The authority usually specifies the host machine for a resource. It always follows '//' in a typical URI. uri An absolute or relative URI. Returns the authority (without the '//') or '' if the URI has no authority. Gets the path part of a URI. The path usually comes after the '/' in a URI. uri An absolute or relative URI. Returns the path (with any leading '/') or '' if the URI has no path. Gets the query part of a URI. The query comes after the '?' in a URI. uri An absolute or relative URI. Returns the query (without the '?') or '' if the URI has no query. Gets the fragment part of a URI. The fragment comes after the '#' in a URI. uri An absolute or relative URI. Returns the fragment (without the '#') or '' if the URI has no fragment. Resolves a URI reference against a base URI. This template follows the guidelines specified by RFC 2396. reference A (potentially relative) URI reference. base The base URI. document The URI of the current document. This defaults to the value of the base URI if not specified. The "combined" URI. Escape Characters Escape special characters in a URI. text Text to escape. Returns string, possibly with escaped special characters. '"[]<>`#%{}|/\^~ ' "
tclxml-3.3~svn11.orig/doc/xsltsl/string.xsl0000644000000000000000000014642511116050505017550 0ustar rootroot $Id: string.xsl,v 1.14 2004/11/28 10:48:09 balls Exp $ Ball Steve 2002 2001 Steve Ball String Processing
Introduction This module provides templates for manipulating strings.
Make string uppercase Converts all lowercase letters to uppercase. text The string to be converted Returns string with all uppercase letters. ß S S Make string lowercase Converts all uppercase letters to lowercase. text The string to be converted Returns string with all lowercase letters. Capitalise string Converts first character of string to an uppercase letter. All remaining characters are converted to lowercase. text The string to be capitalised all Boolean controlling whether all words in the string are capitalised. Default is true. Returns string with first character uppcase and all remaining characters lowercase. Convert a string to one camelcase word Converts a string to one lowerCamelCase or UpperCamelCase word, depending on the setting of the "upper" parameter. UpperCamelCase is also called MixedCase while lowerCamelCase is also called just camelCase. The template removes any spaces, tabs and slashes, but doesn't deal with other punctuation. It's purpose is to convert strings like "hollow timber flush door" to a term suitable as identifier or XML tag like "HollowTimberFlushDoor". text The string to be capitalised upper Boolean controlling whether the string becomes an UpperCamelCase word or a lowerCamelCase word. Default is true. Returns string with first character uppcase and all remaining characters lowercase. String extraction Extracts the portion of string 'text' which occurs before any of the characters in string 'chars'. text The string from which to extract a substring. chars The string containing characters to find. Returns string. String extraction Extracts the portion of string 'text' which occurs after the last of the character in string 'chars'. text The string from which to extract a substring. chars The string containing characters to find. Returns string. String extraction Searches the string 'text' for the last occurrance of one of the characters listed in 'chars', then extracts the portion of string 'text' which follows that character's last occurrance. Example: substring-after-last-character("abcdabcdabcd", "ac") returns "d". text The string from which to extract a substring. chars The characters to search for. Returns string. String extraction Extracts the portion of string 'text' which occurs before the first character of the last occurance of string 'chars'. text The string from which to extract a substring. chars The string containing characters to find. Returns string. String substitution Substitute 'replace' for 'with' in string 'text'. text The string upon which to perform substitution. replace The string to substitute. with The string to be substituted. disable-output-escaping A value of yes indicates that the result should have output escaping disabled. Any other value allows normal escaping of text values. The default is to enable output escaping. Returns string. no Count Substrings Counts the number of times a substring occurs in a string. This can also counts the number of times a character occurs in a string, since a character is simply a string of length 1. Counting Lines ]]> text The source string. chars The substring to count. Returns a non-negative integer value. 0 0 String extraction Extracts the portion of a 'char' delimited 'text' string "array" at a given 'position'. text The string from which to extract a substring. chars delimiters position position of the elements all If true all of the remaining string is returned, otherwise only the element at the given position is returned. Default: false(). Returns string. String extraction Extracts the portion of a 'char' delimited 'text' string "array" at a given 'position' text The string from which to extract a substring. chars delimiters position position of the elements Returns string. String insertion Insert 'chars' into "text' at any given "position' text The string upon which to perform insertion position the position where insertion will be performed with The string to be inserted Returns string. String reversal Reverse the content of a given string text The string to be reversed Returns string. Format a string Inserts newlines and spaces into a string to format it as a block of text. text String to be formatted. max Maximum line length. indent Number of spaces to insert at the beginning of each line. justify Justify left, right or both. Not currently implemented (fixed at "left"). Formatted block of text. Find first occurring character in a string Finds which of the given characters occurs first in a string. text The source string. chars The characters to search for. Match A String To A Pattern Performs globbing-style pattern matching on a string. Match Pattern ]]> text The source string. pattern The pattern to match against. Certain characters have special meaning: * Matches zero or more characters. ? Matches a single character. \ Character escape. The next character is taken as a literal character. Returns "1" if the string matches the pattern, "0" otherwise. 1 1 0 0 1 0 1 0 0 Create A Repeating Sequence of Characters Repeats a string a given number of times. text The string to repeat. count The number of times to repeat the string.
tclxml-3.3~svn11.orig/doc/xsltsl/stdlib.xsl0000644000000000000000000003237011116050505017514 0ustar rootroot ]> XSLT Standard Library Version &version; Ball Steve 2004 2002 Steve Ball The XSLT Standard Library, xsltsl, provides the XSLT developer with a set of XSLT templates for commonly used functions. These are implemented purely in XSLT, that is they do not use any extensions. xsltsl is a SourceForge project. SourceForge Logo Goals of the xsltsl project include: Provision of a high-quality library of XSLT templates, suitable for inclusion by vendors in XSLT processor software products. Demonstration of best practice in XSLT stylesheet development and documentation. Provide examples of various techniques used to develop XSLT stylesheets (ie. a working FAQ). Using The Library There are two ways of using the library: Use a local copy of the library. Download the distribution (see below). Unpack the distribution, using either gunzip/tar or unzip. In your stylesheet import or include either the main stylesheet, stdlib.xsl, or the stylesheet module you wish to use, such as string.xsl. This example assumes that the distribution has been extracted into the same directory as your own stylesheet: ]]> Import or include either the main stylesheet, or the stylesheet module you wish to use, directly from the library website; http://xsltsl.sourceforge.net/modules/. The modules directory always contains the latest stable release. For example: ]]> Older versions of the library are available in subdirectories. For example, to access version 1.1 of the library use: ]]> Next, add XML Namespace declarations for the modules you wish to use. For example, to use templates from the string module, your stylesheet should have the following declaration: ]]> Finally, use a template with the call-template element. Most templates require parameters, which are passed using the with-param element. For example: a word another word ]]> Obtaining The Library The XSLT Standard Library is available for download as either: Gzip'd tarball: http://prdownloads.sourceforge.net/xsltsl/xsltsl-&version;.tar.gz Zip file: http://prdownloads.sourceforge.net/xsltsl/xsltsl-&version;.zip Getting Involved Contributions to the project are most welcome, and may be in the form of stylesheet modules, patches, bug reports or sample code. Any contributed code must use the LGPL license to be accepted into the library. See the SourceForge Project Page http://sourceforge.net/projects/xsltsl/ for information on the development of the project. Bug reports may be submitted here. See the project Web Page http://xsltsl.sourceforge.net/ for documentation. There are three mailing lists for the project: xsltsl-users@lists.sourceforge.net Discussion of the use of xsltsl. xsltsl-devel@lists.sourceforge.net Discussion of the development of xsltsl. xsltsl-announce@lists.sourceforge.net Project announcements. XML Namespaces Apart from the XSLT XML Namespace (http://www.w3.org/1999/XSL/Transform), xsltsl employs a number of XML Namespaces to allow inclusion of the library in developer stylesheets. In addition, documentation is defined in a separate namespace. Each module is allocated a namespace URI by appending the module name to the URI for the project, http://xsltsl.org/. For example, the string module has the namespace URI http://xsltsl.org/string. All documentation is written using an extension of DocBook designed for embedding DocBook into XSLT stylesheets. The namespace URI for DocBook embedded in stylesheets is http://xsltsl.org/xsl/documentation/1.0 Engineering Standards In order to maintain a high engineering standard, all modules and contributions to the xsltsl project must adhere to the following coding and documentation standards. Submissions which do not meet (or exceed) this standard will not be accepted. All stylesheets must be indented, with each level indented by two spaces. NB. a simple stylesheet could be used to enforce/fix this. Templates are named using a qualified name (QName). The namespace URI for the template's containing stylesheet is assigned as above. Parameters for templates should use sensible names. Where possible (or if in doubt), follow these conventions: A parameter containing a single node is named node. Where more than one parameter contains a single node, the suffix Node is appended to the parameter name, eg. referenceNode A parameter which potentially contains multiple nodes is named nodes. Where more than one parameter potentially contains multiple nodes, the suffix Nodes is appended to the parameter name, eg. copyNodes A parameter which contains a string value is named text. All templates in each stylesheet must be documented. A template is documented as a DocBook RefEntry. Every stylesheet must include a test suite. The test system is in the test subdirectory. See test/test.html for further details. An example stylesheet has been provided, which acts as a template for new stylesheet modules. Related Work The EXSLT project is creating a library to standardise extension functions. The XSLT Standard Library is complementary to the EXSLT project. Reference Documentation Reference documentation is available for each module.
String Processing string.xsl
Nodes node.xsl
Date/Time Processing date-time.xsl
Mathematics math.xsl
URI (Uniform Resource Identifier) Processing uri.xsl
Comparing Nodesets cmp.xsl
Generating XML Markup markup.xsl
Presentation Media Support Scalable Vector Graphics: svg.xsl
Example example.xsl
tclxml-3.3~svn11.orig/doc/xsltsl/node.xsl0000644000000000000000000001443711116050505017164 0ustar rootroot $Id: node.xsl,v 1.6 2003/03/31 21:07:30 balls Exp $ Ball Steve 2001 Steve Ball Node Templates
Introduction This stylesheet module provides functions for reporting on or manipulating nodes and nodesets.
Returns an XPath location path This template returns an XPath location path that uniquely identifies the given node within the document. node The node to create an XPath for. If this parameter is given as a nodeset, then the first node in the nodeset is used. Returns an XPath location path as a string. / [] /comment() [] /processing-instruction() [] /text() [] / /namespace:: /@ /.. Return node type Returns the type of a node as a string. node The node to get the type for. If this parameter is given as a nodeset, then the first node in the nodeset is used. Returns node type as a string. Values returned are: Element element Text Node text Comment comment Processing Instruction processing instruction element text comment processing instruction root namespace attribute Copy Nodes Makes a copy of the given nodes, including attributes and descendants. nodes The nodes to copy. Returns the copied nodes as a result tree fragment.
tclxml-3.3~svn11.orig/doc/xsltsl/math.xsl0000644000000000000000000006107111116050505017164 0ustar rootroot $Id: math.xsl,v 1.6 2004/10/30 12:35:19 balls Exp $ Ball Steve 2004 2002 Steve Ball Math Module
Introduction This module provides mathematical functions.
Power Raises a number to a power. base The base number. Must be a number. power The power to raise the number to. Must be an integer. Returns base multiplied by itself power times. If the base or power are not numbers or if the power is fractional then an empty string is returned. 1 1 0 Absolute Value Absolute value of a number. number The number. Must be a number. Returns the absolute value of the number. Conversion Converts a hexidecimal value to a decimal value. value The hexidecimal number. Must be a number in hexidecimal format. Returns the value as a decimal string. If the value is not a number then a NaN value is returned. 10 11 12 13 14 15 Conversion Converts a decimal value to a hexidecimal value. value The decimal number. Returns the value as a hexidecimal string (lowercase). If the value is not a number then a NaN value is returned. 0 NaN a b c d e f Ordinal number Gives the ordinal number of a given counting number. For example, 1 becomes "1st". number An integer number. Returns the number with an ordinal suffix. th st nd rd th Returns an ordinal number This template returns the ordinal number for a given counting number as a word. For example "first" for 1. Only handles numbers less than 10000000 (ten million). number The counting number. conjunctive Whether to add the word "and" to the result, for example "one hundred and first" rather than "one hundred first". Default is "yes". Returns the ordinal number as a string. zeroth and first and second and third and fourth and fifth and sixth and seventh and eighth and ninth and tenth and eleventh and twelveth and thirteenth and fourteenth and fifteenth and sixteenth and seventeenth and eighteenth and nineteenth and twentieth and thirtieth and fortieth and fiftieth and sixtieth and seventieth and eightieth and ninetieth millionth and thousandth and hundredth and and and and Returns a number as a word This template returns the word for a given integer number, for example "one" for 1. Only handles numbers less than 10000000 (ten million). number The counting number. conjunctive Adds the word "and" where appropriate, for example. Returns the number as a string. zero minus million million thousand thousand and hundred hundred and one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty thirty forty fifty sixty seventy eighty ninety
tclxml-3.3~svn11.orig/doc/xsltsl/markup.xsl0000644000000000000000000005760011116050505017535 0ustar rootroot $Id: markup.xsl,v 1.5 2003/03/31 21:07:28 balls Exp $ Ball Steve 2003 2001 Steve Ball XML Markup Templates
Introduction This stylesheet module provides functions for generating literal XML markup.
Create an XML Declaration This template returns an XML Declaration. Although the XSLT standard provides control over the generation of the XML Declaration, this template may be useful in circumstances where the values must be computed at runtime. version Version number. standalone Standalone indication. Must be value "yes" or "no". encoding Character encoding. Returns an XML Declaration as a string. <?xml version=" " standalone=" " invalid value "" for standalone attribute encoding=" " ?> Create a Document Type Declaration This template returns a Document Type Declaration. Although the XSLT standard provides control over the generation of a Document Type Declaration, this template may be useful in circumstances where the values for the identifiers or the internal subset must be computed at runtime. docel The name of the document element. publicid The public identifier for the external DTD subset. systemid The system identifier for the external DTD subset. internaldtd The internal DTD subset. Returns a Document Type Declaration as a string. No document element specified <!DOCTYPE [ ] > Create an Element Declaration This template returns an element declaration.. type The element type. content-spec The content specification. Returns an element declaration as a string. element type must be specified content specification must be specified <!ELEMENT > Create an Attribute List Declaration This template returns an attribute list declaration. type The element type. attr-defns Attribute definitions. Returns an attribute list declaration as a string. element type must be specified <!ATTLIST > Create an Attribute Definition This template returns an attribute definition. name The attribute name. type The attribute type. default The attribute default. Returns an attribute definition as a string. attribute name must be specified attribute type must be specified attribute default must be specified Create an Entity Declaration This template returns an entity declaration. If the 'text' parameter is given a value, then an internal entity is created. If either the 'publicid' or 'systemid' parameters are given a value then an external entity is created. It is an error for the 'text' parameter to have value as well as the 'publicid', 'systemid' or 'notation' parameters. name The entity name. parameter Boolean value to determine whether a parameter entity is created. Default is 'false()'. text The replacement text. Must be a string. nodes The replacement text as a nodeset. The nodeset is formatted as XML using the as-xml template. If both text and nodes are specified then nodes takes precedence. publicid The public identifier for an external entity. systemid The system identifier for an external entity. notation The notation for an external entity. Returns an entity declaration as a string. entity name must be specified both replacement text and external identifier specified <!ENTITY % NDATA " " > Quote an Attribute Value This template returns a quoted value. value The value to quote. Returns a quote value as a string. < &lt; " ' " " &quot; " ' ' " " Create an External Identifier This template returns an external identifier. publicid The public identifier. systemid The system identifier. Returns an external identifier as a string. PUBLIC " " " " SYSTEM " " Create an Entity Reference This template returns an entity reference. name The name of the entity. Returns an entity reference as a string. & ; Create a Notation Declaration This template returns a notation declaration. name The notation name. publicid The public identifier for the notation. systemid The system identifier for the notation. Returns a notation declaration as a string. notation name must be specified external identifier must be specified <!NOTATION > Create a CDATA Section This template returns a CDATA Section. The XSLT specification provides a mechanism for instructing the XSL processor to output character data in a CDATA section for certain elements, but this template may be useful in those circumstances where not all instances of an element are to have their content placed in a CDATA section. text The content of the CDATA section. Returns a CDATA section as a string. CDATA section contains "]]>" <![CDATA[ ]]> Format Nodeset As XML Markup This template returns XML markup. Each node in the given nodeset is converted to its equivalent XML markup. BUG: This version may not adequately handle XML Namespaces. nodes Nodeset to format as XML. Returns XML markup. < = > </ > /> <!-- --> <? ?>
tclxml-3.3~svn11.orig/doc/xsltsl/cmp.xsl0000755000000000000000000002701411116050505017014 0ustar rootroot $Id: cmp.xsl,v 1.6 2005/01/18 02:31:28 mhummel Exp $ Hummel Mark 2003 Mark Hummel XML Compare
Introduction This module provides a template for comparing two xml documents.
Find differences Compare two xml documents and display differences. Two xml documents are defined to be the same if: They have the matching elements and attributes, and that the data in the elements also match. The comparison is order sensitive. The element names from the documents at the current depth are compared, followed by their values, then any attribute names and values are compared. The process is applied then to the subtrees of the documents. Notes: If there are leaf nodes in one nodeset which don't exist in the other, the value of those 'extra' elements won't appear as a difference. ns1 ns2 The two nodesets which are to be compared. Returns the difference between the documents. The format of the output is an xml document. A node is added to the result tree for every difference. The node contains the type of difference (e.g element name difference, attribute value difference, etc), the value in the first nodeset and the value in the second nodeset, and the parent node. The indentation level is the depth at which the difference was found relative to the first document. node[]: Compare Recursively compare two xml nodesets, stop when a difference is found and return false. Otherwise return true if the document is identical. The element names from the documents at the current depth are compared, followed by their values, then any attribute names and values are compared. The process is applied then to the subtrees of the documents. Notes: If there are leaf nodes in one nodeset which don't exist in the other, the value of those 'extra' elements won't appear as a difference. ns1 ns2 The two nodesets which are to be compared. False when the nodesets are not identical, empty otherwise.
tclxml-3.3~svn11.orig/doc/man.macros0000644000000000000000000001152611113705304016134 0ustar rootroot'\" The definitions below are for supplemental macros used in Tcl/Tk '\" manual entries. '\" '\" .AP type name in/out ?indent? '\" Start paragraph describing an argument to a library procedure. '\" type is type of argument (int, etc.), in/out is either "in", "out", '\" or "in/out" to describe whether procedure reads or modifies arg, '\" and indent is equivalent to second arg of .IP (shouldn't ever be '\" needed; use .AS below instead) '\" '\" .AS ?type? ?name? '\" Give maximum sizes of arguments for setting tab stops. Type and '\" name are examples of largest possible arguments that will be passed '\" to .AP later. If args are omitted, default tab stops are used. '\" '\" .BS '\" Start box enclosure. From here until next .BE, everything will be '\" enclosed in one large box. '\" '\" .BE '\" End of box enclosure. '\" '\" .CS '\" Begin code excerpt. '\" '\" .CE '\" End code excerpt. '\" '\" .VS ?version? ?br? '\" Begin vertical sidebar, for use in marking newly-changed parts '\" of man pages. The first argument is ignored and used for recording '\" the version when the .VS was added, so that the sidebars can be '\" found and removed when they reach a certain age. If another argument '\" is present, then a line break is forced before starting the sidebar. '\" '\" .VE '\" End of vertical sidebar. '\" '\" .DS '\" Begin an indented unfilled display. '\" '\" .DE '\" End of indented unfilled display. '\" '\" .SO '\" Start of list of standard options for a Tk widget. The '\" options follow on successive lines, in four columns separated '\" by tabs. '\" '\" .SE '\" End of list of standard options for a Tk widget. '\" '\" .OP cmdName dbName dbClass '\" Start of description of a specific option. cmdName gives the '\" option's name as specified in the class command, dbName gives '\" the option's name in the option database, and dbClass gives '\" the option's class in the option database. '\" '\" .UL arg1 arg2 '\" Print arg1 underlined, then print arg2 normally. '\" '\" RCS: @(#) $Id: man.macros,v 1.2 2003/12/03 20:06:33 balls Exp $ '\" '\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. .if t .wh -1.3i ^B .nr ^l \n(.l .ad b '\" # Start an argument description .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 .\} .\} .. '\" # define tabbing values for .AP .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 '\" # BS - start boxed text '\" # ^y = starting y location '\" # ^b = 1 .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. '\" # BE - end boxed text (draw box now) .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 .. '\" # VS - start vertical sidebar '\" # ^Y = starting y location '\" # ^v = 1 (for troff; for nroff this doesn't matter) .de VS .if !"\\$2"" .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. '\" # VE - end of vertical sidebar .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 .. '\" # Special macro to handle page bottom: finish off current '\" # box/sidebar if in box/sidebar mode, then invoked standard '\" # page bottom macro. .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 .\} .. '\" # DS - begin display .de DS .RS .nf .sp .. '\" # DE - end display .de DE .fi .RE .sp .. '\" # SO - start of list of standard options .de SO .SH "STANDARD OPTIONS" .LP .nf .ta 5.5c 11c .ft B .. '\" # SE - end of list of standard options .de SE .fi .ft R .LP See the \\fBoptions\\fR manual entry for details on the standard options. .. '\" # OP - start of full description for a single option .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. '\" # CS - begin code excerpt .de CS .RS .nf .ta .25i .5i .75i 1i .. '\" # CE - end code excerpt .de CE .fi .RE .. .de UL \\$1\l'|0\(ul'\\$2 .. tclxml-3.3~svn11.orig/doc/html.xsl0000644000000000000000000004155611120363561015660 0ustar rootroot <xsl:apply-templates select="d:info/d:title" mode='html-title'/>

Contents

Footnotes

<xsl:copy-of select="$title"/>

Contents

Footnotes

,
,


? " ... " ?
package require  ??

Tcl Namespace Usage


        
      

        
      
  • |
    unmatched element "" in "/"
    tclxml-3.3~svn11.orig/doc/tclxml.css0000644000000000000000000000021211120323557016162 0ustar rootrootbody { bgcolor: white; color: black; font-family: sans-serif; } div.note { margin-left: 15px; margin-right: 15px; } tclxml-3.3~svn11.orig/doc/tclxml.xml.in0000644000000000000000000025365111120323557016620 0ustar rootroot ]> Steve Ball 2007 2005 Explain 2004 2003 2000 Zveno Pty Ltd See the file "LICENSE" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. 3.2 2007-12-11 SRB Updated author details and legal notice. 3.1 2005-03-02 SRB Updated details on -externalentitycommand callback. Fixed minor typo. 3.0 2003-08-22 SRB Added libxml2 parser class. TclXML n TclXML XML parser support for Tcl package require xml package require parserclass xml &version; ::xml ::sgml ::xml::tclparser ::xml::libxml2 ::xml::parserclass arg arg ::xml::parser name value parser option arg Description TclXML provides event-based parsing of XML documents. The application may register callback scripts for certain document features, and when the parser encounters those features while parsing the document the callback is evaluated. The parser may also perform other functions, such as normalisation, validation and/or entity expansion. Generally, these functions are under the control of configuration options. Whether these functions can be performed at all depends on the parser implementation. The TclXML package provides a generic interface for use by a Tcl application, along with a low-level interface for use by a parser implementation. Each implementation provides a class of XML parser, and these register themselves using the ::xml::parserclass create command. One of the registered parser classes will be the default parser class. Loading the package with the generic package require xml command allows the package to automatically determine the default parser class. In order to select a particular parser class as the default, that class' package may be loaded directly, eg. package require xml::libxml2. In all cases, all available parser classes are registered with the TclXML package, the difference is simply in which one becomes the default. Commands ::xml::parserclass The ::xml::parserclass command is used to manage XML parser classes. Command Options The following command options may be used: create create name script script script script script script Creates an XML parser class with the given name. destroy destroy name Destroys an XML parser class. info names default Returns information about registered XML parser classes. ::xml::parser The ::xml::parser command creates an XML parser object. The return value of the command is the name of the newly created parser. The parser scans an XML document's syntactical structure, evaluating callback scripts for each feature found. At the very least the parser will normalise the document and check the document for well-formedness. If the document is not well-formed then the option will be evaluated. Some parser classes may perform additional functions, such as validation. Additional features provided by the various parser classes are described in the section Parser Classes Parsing is performed synchronously. The command blocks until the entire document has been parsed. Parsing may be terminated by an application callback, see the section Callback Return Codes. Incremental parsing is also supported by using the configuration option. Configuration Options The ::xml::parser command accepts the following configuration options: script Specifies the prefix of a Tcl command to be evaluated whenever an attribute list declaration is encountered in the DTD subset of an XML document. The command evaluated is: script name attrname type default value where: name Element type name attrname Attribute name being declared type Attribute type default Attribute default, such as #IMPLIED value Default attribute value. Empty string if none given. URI URI Specifies the base URI for resolving relative URIs that may be used in the XML document to refer to external entities. is deprecated in favour of . script Specifies the prefix of a Tcl command to be evaluated whenever character data is encountered in the XML document being parsed. The command evaluated is: script data where: data Character data in the document script Specifies the prefix of a Tcl command to be evaluated whenever a comment is encountered in the XML document being parsed. The command evaluated is: script data where: data Comment data script Specifies the prefix of a Tcl command to be evaluated when no other callback has been defined for a document feature which has been encountered. The command evaluated is: script data where: data Document data boolean Specifies whether entities declared in the internal DTD subset are expanded with their replacement text. If entities are not expanded then the entity references will be reported with no expansion. script Specifies the prefix of a Tcl command to be evaluated when the document type declaration is encountered. The command evaluated is: script name public system dtd where: name The name of the document element public Public identifier for the external DTD subset system System identifier for the external DTD subset. Usually a URI. dtd The internal DTD subset See also and . script Specifies the prefix of a Tcl command to be evaluated when an element markup declaration is encountered. The command evaluated is: script name model where: name The element type name model Content model specification script Specifies the prefix of a Tcl command to be evaluated when an element end tag is encountered. The command evaluated is: script name args where: name The element type name that has ended args Additional information about this element Additional information about the element takes the form of configuration options. Possible options are: boolean The empty element syntax was used for this element uri The element is in the XML namespace associated with the given URI script Specifies the prefix of a Tcl command to be evaluated when an element start tag is encountered. The command evaluated is: script name attlist args where: name The element type name that has started attlist A Tcl list containing the attributes for this element. The list of attributes is formatted as pairs of attribute names and their values. args Additional information about this element Additional information about the element takes the form of configuration options. Possible options are: boolean The empty element syntax was used for this element uri The element is in the XML namespace associated with the given URI list The start tag included one or more XML Namespace declarations. list is a Tcl list giving the namespaces declared. The list is formatted as pairs of values, the first value is the namespace URI and the second value is the prefix used for the namespace in this document. A default XML namespace declaration will have an empty string for the prefix. value Gives the character encoding of the document. This option only has an effect before a document is parsed. The default character encoding is utf-8. If the value unknown is given, or any value other than utf-8, then the document text is treated as binary data. If the value is given as unknown then the parser will attempt to automatically determine the character encoding of the document (using byte-order-marks, etc). If any value other than utf-8 or unknown is given then the parser will read the document text using that character encoding. script Specifies the prefix of a Tcl command to be evaluated when end of a CDATA section is encountered. The command is evaluated with no further arguments. script Specifies the prefix of a Tcl command to be evaluated when end of the document type declaration is encountered. The command is evaluated with no further arguments. script Specifies the prefix of a Tcl command to be evaluated when an entity declaration is encountered. The command evaluated is: script name args where: name The name of the entity being declared args Additional information about the entity declaration. An internal entity shall have a single argument, the replacement text. An external parsed entity shall have two additional arguments, the public and system indentifiers of the external resource. An external unparsed entity shall have three additional arguments, the public and system identifiers followed by the notation name. script Specifies the prefix of a Tcl command to be evaluated when an entity reference is encountered. The command evaluated is: script name where: name The name of the entity being referenced script Specifies the prefix of a Tcl command to be evaluated when a fatal error is detected. The error may be due to the XML document not being well-formed. In the case of a validating parser class, the error may also be due to the XML document not obeying validity constraints. By default, a callback script is provided which causes an error return code, but an application may supply a script which attempts to continue parsing. The command evaluated is: script errorcode errormsg where: errorcode A single word description of the error, intended for use by an application errormsg A human-readable description of the error script Specifies the prefix of a Tcl command to be evaluated to resolve an external entity reference. If the parser has been configured to validate the XML document, a default script is supplied that resolves the URI given as the system identifier of the external entity and recursively parses the entity's data. If the parser has been configured as a non-validating parser, then by default external entities are not resolved. This option can be used to override the default behaviour. The command evaluated is: script name baseuri uri id where: name The Tcl command name of the current parser baseuri An absolute URI for the current entity which is to be used to resolve relative URIs uri The system identifier of the external entity, usually a URI id The public identifier of the external entity. If no public identifier was given in the entity declaration then id will be an empty string. The return result of the callback script determines the action of the parser. Note that these codes are interpreted in a different manner to other callbacks. TCL_OK The return result of the callback script is used as the external entity's data. The URI passed to the callback script is used as the entity's base URI. This is useful to either override the normal loading of an entity's data, or to implement new or alternative URI schemes. As an example, the script below sets an external entity handler that intercepts "tcl:" URIs and evaluates them as inline Tcl scripts: package require xml proc External {name baseuri uri id} { switch -glob -- $uri { tcl:* { regexp {^tcl:(.*)$} $uri discard script return [uplevel #0 $script] } default { return -code continue {} } } } set parser [xml::parser -externalentitycommand External] $parser parse {<!DOCTYPE example [ <!ENTITY example SYSTEM "tcl:set%20example%20HelloWorld"> ]> <example> &example; </example> } puts $example This script will print "HelloWorld" to stdout. TCL_CONTINUE In a normal (non-safe) interpreter, the default external entity handler is used to load the external entity data as per normal operation of the parser. If the parser is executing in a Safe Tcl interpreter then the entity is not loaded at all. This is useful to interpose on the loading of external entities without interfering with the loading of entities. TCL_BREAK No data is returned for this entity, ie. the entity is ignored. No error is propagated. TCL_ERROR No data is returned for this entity, ie. the entity is ignored. A background error is registered, using the result of the callback script. boolean Specifies whether the XML document being parsed is complete. If the document is to be incrementally parsed then this option will be set to false, and when the last fragment of document is parsed it is set to true. For example, set parser [::xml::parser -final 0] $parser parse $data1 . . . $parser parse $data2 . . . $parser configure -final 1 $parser parse $finaldata boolean If this option is set to true then spans of character data in the XML document which are composed only of white-space (CR, LF, space, tab) will not be reported to the application. In other words, the data passed to every invocation of the script will contain at least one non-white-space character. script Specifies the prefix of a Tcl command to be evaluated when a notation declaration is encountered. The command evaluated is: script name uri where: name The name of the notation uri An external identifier for the notation, usually a URI. script Specifies the prefix of a Tcl command to be evaluated when the parser determines that the XML document being parsed is not a standalone document. boolean Controls whether external parameter entities are parsed. script Specifies the prefix of a Tcl command to be evaluated when a parameter entity declaration is encountered. The command evaluated is: script name args where: name The name of the parameter entity args For an internal parameter entity there is only one additional argument, the replacement text. For external parameter entities there are two additional arguments, the system and public identifiers respectively. name The name of the parser class to instantiate for this parser object. This option may only be specified when the parser instance is created. script Specifies the prefix of a Tcl command to be evaluated when a processing instruction is encountered. The command evaluated is: script target data where: target The name of the processing instruction target data Remaining data from the processing instruction boolean If this option is enabled then when an element is encountered that uses the special empty element syntax, additional arguments are appended to the and callbacks. The arguments -empty 1 are appended. For example: script 1 script Specifies the prefix of a Tcl command to be evaluated when the start of a CDATA section section is encountered. No arguments are appended to the script. script Specifies the prefix of a Tcl command to be evaluated at the start of a document type declaration. No arguments are appended to the script. script Specifies the prefix of a Tcl command to be evaluated when a character is encountered with an unknown encoding. This option has not been implemented. script Specifies the prefix of a Tcl command to be evaluated when a declaration is encountered for an unparsed entity. The command evaluated is: script system public notation where: system The system identifier of the external entity, usually a URI public The public identifier of the external entity notation The name of the notation for the external entity boolean Enables validation of the XML document to be parsed. Any changes to this option are ignored after an XML document has started to be parsed, but the option may be changed after a reset. script Specifies the prefix of a Tcl command to be evaluated when a warning condition is detected. A warning condition is where the XML document has not been authored correctly, but is still well-formed and may be valid. For example, the special empty element syntax may be used for an element which has not been declared to have empty content. By default, a callback script is provided which silently ignores the warning. The command evaluated is: script warningcode warningmsg where: warningcode A single word description of the warning, intended for use by an application wanringmsg A human-readable description of the warning script Specifies the prefix of a Tcl command to be evaluated when the XML declaration is encountered. The command evaluated is: script version encoding standalone where: version The version number of the XML specification to which this document purports to conform encoding The character encoding of the document standalone A boolean declaring whether the document is standalone Parser Command The ::xml::parser command creates a new Tcl command with the same name as the parser. This command may be used to invoke various operations on the parser object. It has the following general form: name arg and the arg determine the exact behaviour of the command. The following commands are possible for parser objects: -option Returns the current value of the configuration option given by . may have any of the values accepted by the parser object. -option value Modify the configuration options of the parser object. may have any of the values accepted by the parser object. option value Creates a new parser object. The new object inherits the same configuration options as the parent parser object, but is able to parse XML data in a parsed entity. The option allows markup declarations to be treated as being in the internal or external DTD subset. name Frees all resources associated with the parser object. The object is not usable after this command has been invoked. name args Returns information about the XML document being parsed. Each parser class provides different information, see the documentation for the parser class. xml args Parses the XML document. The usual desired effect is for various application callbacks to be evaluated. Other functions will also be performed by the parser class, at the very least this includes checking the XML document for well-formedness. Initialises the parser object in preparation for parsing a new XML document. Callback Return Codes Every callback script evaluated by a parser may return a return code other than TCL_OK. Return codes are interpreted as follows: break Suppresses invocation of all further callback scripts. The method returns the TCL_OK return code. continue Suppresses invocation of further callback scripts until the current element has finished. error Suppresses invocation of all further callback scripts. The method also returns the TCL_ERROR return code. default Any other return code suppresses invocation of all further callback scripts. The method returns the same return code. Error Messages If an error or warning condition is detected then an error message is returned. These messages are structured as a Tcl list, as described below: {domain level code node line message int1 int2 string1 string2 string3} domain A code for the subsystem that detected the error. level Severity level of the problem. code A one word string describing the error. node If available, the token of the DOM node associated with the problem. line If known, the line number in the source XML document where the problem was detected. message A human-readable description of the problem. int1 Additional integer data. For the parser domain, this is usually the column number where the problem was detected. int2 Additional integer data. string1 Additional string data. string2 Additional string data. string3 Additional string data. Application Examples This script outputs the character data of an XML document read from stdin. package require xml proc cdata {data args} { puts -nonewline $data } set parser [::xml::parser -characterdatacommand cdata] $parser parse [read stdin] This script counts the number of elements in an XML document read from stdin. package require xml proc EStart {varName name attlist args} { upvar #0 $varName var incr var } set count 0 set parser [::xml::parser -elementstartcommand [list EStart count]] $parser parse [read stdin] puts "The XML document contains $count elements" Safe XML TclXML/Tcl and TclXML/libxml2 may be used in a Safe Tcl interpreter. When a document is parsed in a Safe Tcl interpreter, any attempt by the XML document to load an external entity is handled by the -externalentitycommand callback. This callback is evaluated in the context of the safe interpreter and therefore is subject to the security policy in force for that interpreter. The default entity loader will not be invoked, even if the callback script returns a TCL_CONTINUE code. See the description of the -externalentitycommand for further details. Parser Classes This section will discuss how a parser class is implemented. Tcl Parser Class The pure-Tcl parser class requires no compilation - it is a collection of Tcl scripts. This parser implementation is non-validating, ie. it can only check well-formedness in a document. However, by enabling the option it will read the document's DTD and resolve external entities. This parser class is referred to as TclXML/tcl. This parser implementation aims to implement XML v1.0 and supports XML Namespaces. Generally the parser produces XML Infoset information items. That is, it gives the application a slightly higher-level view than the raw XML syntax. For example, it does not report CDATA Sections. TclXML/tcl is not able to handle character encodings other than UTF-8. libxml2 Parser Class The libxml2 parser class provides a Tcl interface to the libxml2 XML parser library. This parser class is referred to as TclXML/libxml2. When the package is loaded the variable ::xml::libxml2::libxml2version is set to the version number of the libxml2 library being used. On MS Windows, it is necessary to load the generic XML package first, and then the TclXML/libxml2 package. For example, package require xml package require xml::libxml2 get Method TclXML/libxml2 provides the following arguments to the get method: document Returns the parsed document object. libxml2 builds an in-memory data structure of the XML document it parses (a DOM tree). This method returns a handle (or token) for that structure. TclXML/libxml2 manages the document object as a Tcl object. See the for further information. Additional Options normal | implicit Controls how the TclXML/libxml2 packages manages the document object. The default value is implicit; the document is destroyed when the Tcl Object's internal representation is freed. If the option is given the value normal then the document must be explicit destroyed. The only way to explicitly destroy the document is by using the C API. xpath The given XPath location path specifies which part of the document is to be kept after the parsing operation has completed. By default, all document data is discard after it has been parsed. prefix ns ... The value of this option is a list of pairs of XML Namespace prefixes and their corresponding namespace URIs. These are used by the XPath location path given in the -retainpath option. Limitations The libxml2 parser classes has the following limitations: has no effect. libxml2 does not report empty element syntax. Incremental (push) parsing, ie.  0 is not supported. TclXML/libxml2 does not provide (DTD) validation, (WXS) schema validation or Relax NG validation, although the libxml2 library does provide those functions. These functions are provided by the TclDOM/libxml2 package, but only in a "posteriori" fashion (ie. only after the document has been parsed). libxml2 supports XML Namespaces. The use of XML Namespaces can be queried, but the declaration of a XML Namespace is not reported. Keywords XML parse tclxml-3.3~svn11.orig/doc/README.xml.in0000644000000000000000000004241111120363561016237 0ustar rootroot ]> XML Support For Tcl TclXML, TclDOM and TclXSLT $Id: README.xml,v 1.7 2005/05/20 12:02:18 balls Exp $ &version; Steve Ball Explain www.explain.com.au This package provides XML parsers, DOM scripting and XSL Transformations for Tcl. In previous distributions, these features were supplied as separate packages. Now they have been combined into a single package to make installation easier. Contact Steve Ball for information about this release. TclXML TclXML provides a streaming parser for XML documents. This is the lowest-level interface for processing XML documents in Tcl. The package has a generic front-end interface with plugin parser implementations. A number of parser implementations or wrappers are provided: Gnome libxml2 library. This package is known as TclXML/libxml2. A generic Tcl implementation (which does not require compilation). This package is known as TclXML/tcl. Both of these implementations may be installed at the same time. See the manual page for more information. TclDOM TclDOM provides a tree view for XML documents. This is usually the best interface for scripting XML documents using Tcl. The package has two implementations: Gnome libxml2 library. This package is known as TclDOM/libxml2. A generic Tcl implementation (which does not require compilation). This package is known as TclDOM/tcl. Only one of these will be installed. See the manual page for more information. TclXSLT TclXSLT provides a method to invoke XSL Transformations upon XML documents. This package is a wrapper for the libxslt library. See the manual page for more information. Installation Dependencies Tcllib http://www.tcl.tk/software/tcllib/ In order for the Tcl-only parser to resolve external entities, the tcllib package must be installed. Be sure to get a version which includes the uri package. Version 1.11 or better is recommended. GZip'd tarball ZIP file The latest CVS snapshot may be found at the SourceForge project page. libxml2 libxml2 is required for the compiled version of the TclXML/libxml2 package. libiconv may also be required. The source code for libxml2 and libiconv is not supplied with this package. Download libxml2 from xmlsoft.org separately. libiconv may also be required; download from a GNU mirror site. Version 2.7.2 (or better) is recommended. Pure-Tcl Installation no compilation required Run the configure script and invoke the command: make install If the pure-Tcl parser is good enough for you, then read no further. Compiled Installation Unix/Linux You must have Tcl/Tk version 8.2 or better installed on your system. Tcl/Tk 8.3 or better is recommended. Make sure you have Tcllib 1.11 (or better) installed. Tcllib is still required, even for the compiled parser. If you wish to use TclXML/libxml2, make sure libxml2-2.7.2 (or better) is installed. Unpack the TclXML distribution and cd into the tclxml-&version; directory. Run the configure script, with the --prefix and --enable-threads switches (the latter only if Tcl has been built with threads enabled). Use the --with-xml2-config switch to specify the location of the libxml2 configuration script, xml2Conf.sh. Similarly, use the --with-xslt-config if necessary. TclXML/libxml2 may be configured to statically link the libxml2 and libxslt libraries to the libtclxml.so shared library. This is advantageous when using TclXML/libxml2 in a StarKit. To statically link the libraries use the --with-xml-static switch. For example, on my system I have Tcl 8.5 installed in /usr/local/tcl8.5 and libxm2 installed in /usr/local/gnome. I also need to statically link the libraries. Therefore I would use the command: ./configure --prefix=/usr/local/tcl8.5 --enable-threads --with-xml2-config=/usr/local/gnome/bin/xml2Conf.sh --with-xml-static=1 make Don't test the package using make test until all of the packages are installed (it is a current deficiency of the build system that the package cannot be tested before installation - we hope to fix this soon!). make install You may need to do this as root, depending on your installation. make test make doc make install-doc Windows (MSYS/MINGW) [Advice: ActiveTcl includes binaries for TclXML.] You must have Tcl/Tk version 8.2 or better installed on your system. Tcl/Tk 8.5.5 or better is recommended. Before starting, download the binaries for libxml2 (or build them from source). xmlsoft has a link to the MS Windows binary distribution. If you have a TEA build environment setup, just use the normal configure/make/make install pattern. Windows (NMAKE/VC++ 6.0) TclXML/libxml2 is built with MSYS/MINGW, see above, so this build system is untested. Alternatively, the win subdirectory contains a makefile.vc file for Visual Studio C++ v6.0. In a Command Prompt window set up your environment so that nmake is on the path (by running VCVARS32.BAT), then type the following: nmake -f makefile.vc TCLDIR=C:\Path\To\Tcl INSTALLDIR=C:\Path\To\Tcl LIBZDIR=C:\Path\To\libz LIBICONVDIR=C:\Path\To\libiconv LIBXML2DIR=C:\Path\To\libxml2 LIBXSLTDIR=C:\Path\To\libxslt As an example, on my system I have Tcl installed in C:\Tcl and the libxml2 and libxslt binaries unpacked in the directory C:\gnome. Accordingly, I would use the following command line: nmake -f makefile.vc TCLDIR=C:\Tcl INSTALLDIR=C:\Tcl LIBZDIR=C:\gnome\zlib-1.1.4.win32 LIBICONVDIR=C:\gnome\libiconv-1.9.1.win32 LIBXML2DIR=C:\gnome\libxml2-2.7.2.win32 LIBXSLTDIR=C:\gnome\libxslt-1.1.24.win32 Install the package by appending 'install' to the command line used above, for example: nmake -f makefile.vc TCLDIR=C:\Path\To\Tcl INSTALLDIR=C:\Path\To\Tcl LIBZDIR=C:\Path\To\libz LIBICONVDIR=C:\Path\To\libiconv LIBXML2DIR=C:\Path\To\libxml2 LIBXSLTDIR=C:\Path\To\libxslt install Macintosh OS X Binary distributions of libxml2, libxslt and TclXML as frameworks are provided by Explain. There are two ways to build TclXML under Mac OS X: The usual Unix way, see above. As an embedded Framework using Xcode. The macosx directory contains the Xcode files for building under OS X (Leopard/Panther). TclXML/libxml2 has been tested on OS X 10.5 (or is that X.5?). Start-up the project. Make sure that the references to the libxml2 and Tcl external frameworks are correct. Select the 'Make' target and build. This builds everything. The result is two Mac OS X Frameworks; a "normal" and an "embedded". The embedded framework will be in the embedded subdirectory of the Build Products directory. Copy tclxml.framework to any of the usual places for frameworks (~/Library/Frameworks, /Library/Frameworks, etc). For earlier version of OS X using Project Builder, you will have to retrieve a previous version of the Project Builder files from the CVS repository. Usage See the website for links to tutorials and the reference manual. In the meantime, here's a quick tutorial: Parsing XML, Streaming This is the lowest-level access to an XML document; use SAX-like events to stream through the document. The simple program below counts the number of characters in the content of an XML document. package require xml &version; set parser [xml::parser] $parser configure -elementstartcommand EStart \ -characterdatacommand PCData proc EStart {tag attlist args} { array set attr $attlist puts "Element \"$tag\" started with [array size attr] attributes" } proc PCData text { incr ::count [string length $text] } set count 0 $parser parse [read stdin] puts "The document contains $count characters" exit 0 Parsing XML with DOM This is the next level up in accessing an XML document; use the Document Object Model (DOM) to view the XML document as a tree. The simple program below counts the number of characters in the content of an XML document. package require xml &version; set doc [dom::parse [read stdin]] set count 0 foreach textNode [dom::selectNode $doc //text()] { incr count [string length [$textNode cget -nodeValue]] } puts "The document contains $count characters" Transforming XML with XSLT This is the highest level in processing an XML document; use a XSL stylesheet to transform a XML document. The simple program below reads two XML documents, compiles one into a XSL stylesheet and performs the transformation. package require xml &version; set chan [open "count.xsl"] set styleDoc [dom::parse [read $chan]] close $chan set sourceDoc [dom::parse [read stdin]] set style [xslt::compile $styleDoc] set resultDoc [$style transform $sourceDoc] puts [dom::serialize $resultDoc] The XSL stylesheet count.xsl, which counts the number of characters in the source document, looks like this: The document contains characters. ]]> XPath In addition to XML parsing packages, TclXML also provides a package for parsing XPath location paths. The XPath package only parsing the path's syntax, it does interpret the path. See TclDOM for a package that will interpret XPath location paths. This package is in its infancy, and does not support the full range of XPath features. Only a very limited subset of location paths are supported, of the form "/simple/example[2]". Paths within predicates will definitely fail. To use the XPath package: package require xpath To parse a location path: xpath::split {/simple/example} This returns a Tcl list, each element of which is a three element sublist: {axis node-test {?predicate ...?}}. tclxml-3.3~svn11.orig/doc/tcldom.xml.in0000644000000000000000000040524011215700771016572 0ustar rootroot ]> Steve Ball 2009 2008 2007 Explain 2004 2003 2002 Zveno Pty Ltd See the file "LICENSE" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. TclDOM n ::dom::DOMImplementation ::dom::hasfeature ::dom::create ::dom::destroy ::dom::parse ::dom::serialize ::dom::document ::dom::documenttype ::dom::node ::dom::element ::dom::event ::dom::selectNode ::dom::isNode ::dom::xinclude ::dom::prefix2namespaceURI ::dom::trim Tcl language binding for the W3C Document Object Model package require dom dom &version; ::dom ::dom::tcl ::dom::libxml2 ::dom::DOMImplementation method args ::dom::hasfeature feature version ::dom::create ::dom::destroy token ::dom::parse xml option value ::dom::serialize token option value ::dom::document method token args ::dom::documenttype method token args ::dom::node method token args ::dom::element method token args ::dom::event method token args ::dom::selectNode token xpath option value ::dom::isNode token ::dom::xinclude doc ::dom::prefix2namespaceURI node prefix ::dom::trim doc Description TclDOM is a Tcl language binding for the W3C Document Object Model (DOM). DOM provides a view of a XML (or HTML) document as a tree structure. Currently, TclDOM only supports XML documents. The package implements most of the DOM Level 1 interfaces and also some Level 2 and Level 3 interfaces. There are also a number of non-standard commands and methods provided for the convenience of application developers (these are documented). The DOM specification should be read in conjunction with this reference manual, as it explains the meaning and purpose of the various interfaces. This manual is not a tutorial on how to use the DOM. TclDOM also provides two implementations of the API: a pure-Tcl implementation and a C implementation based on the Gnome libxml2 library. Packages and Namespaces TclDOM defines the dom package and also a Tcl namespace using that same name. Implementations define their own package name and Tcl namespace within the ::dom Tcl namespace: Tcl implementation Package dom::tcl, Tcl namespace ::dom::tcl. libxml2 Package dom::libxml2, Tcl namespace ::dom::libxml2. Each DOM Document is allocated a Tcl namespace within the ::dom Tcl namespace. All storage for the document and commands are defined within that Tcl namespace. Tokens The TclDOM API uses tokens as identifiers for nodes within the document tree. This technique has been used to allow alternate implementations of TclDOM to be efficient, while retaining compatibility with the pure-Tcl implementation. The format of the token itself as well as the data structure referred to by the token are not public and an application should not rely on these. Instead, an application should use the accessor methods provided by the API. There is no requirement to always use the same token for a node. In fact, an important performance optimisation for some implementations is to create a new token when a node is accessed, regardless of whether a token has already been issued for that node. This implies that in order to test whether two tokens refer to the same node it is not sufficient to test the string values of the tokens; the isSameNode method must be used for this purpose. For example, proc NodeCompare1 {A B} { return [string equal $A $B] } proc NodeCompare2 {A B} { return [$A isSameNode $B] } In the above example, NodeCompare2 correctly determines whether its two arguments refer to the same node. Document and Node Commands Each Document and Node has a Tcl command defined that may be used to control the object. This command may be used to invoke the methods by the ::dom::document command (for Documents) or the ::dom::node command (for all other Nodes). If a Document' or Node's Tcl command is destroyed then the Document or Node is also destroyed. DOM Interfaces Each Interface in the DOM specification is implemented with a Tcl command in the dom namespace. A few interfaces have not been mapped to Tcl commands because Tcl already provides the required functionality, for example the CharacterData interface. methods for interfaces are methods (subcommands) of the corresponding Tcl command. Each attribute of an interface is a configuration option for an object in the document tree. Convenience Commands and Methods DOM doesn't always provide an interface, method or attribute for every function required. For example, until DOM Level 3 for was no standard for creating, parsing and serializing a document. Sometimes using the standard DOM interface is awkward. TclDOM provides a number of non-standard features to overcome these problems. A major convenience is that each method of the DOMImplementation interface is also defined as a command. For example, rather than using dom::DOMImplementation create to create a new document, the shorter command dom::create may be used. Implementations may also provide direct access to specific features. Refer to the documentation for a DOM implementation. Commands ::dom::DOMImplementation The ::dom::DOMImplementation command implements the DOMImplementation DOM interface. It is used to provide implementation-specific features not explicitly defined in the DOM specification. Command Options The following command options may be used. These are also available as commands. hasFeature hasFeature feature Provides a test for existence of a feature. Returns 1 if a feature is implemented, 0 otherwise. create create type Creates the root node of a new DOM document. The document element type may be specified as an argument, in which case that element is created. The return value is a token referring to the root node of the newly created document. A Tcl command is also created with the same name as the document's token. This command is a shortcut for the ::dom::document command. Non-standard method. DOM Level 2 introduced the createDocument method. createDocument createDocument nsURI type doctype Creates the root node of a new DOM document. The document element namespace URI and local-name (element type) may be specified as an argument, in which case that element is created. If the document type is given then the newly created document is configured to use that document type. The return value is a token referring to the root node of the newly created document. A Tcl command is also created with the same name as the document's token. This command is a shortcut for the ::dom::document command. createDocumentType createDocumentType name publicid systemid internaldtd Creates a Document Type Declaration. The return value is a token for the newly created document type declaration. A Tcl command is also created with the same name as the document type's token. This command is a shortcut for the ::dom::documenttype command. createNode createNode token xpath May create a node in the document. specifies a context for the XPath expression given by . The expression must resolve to a node. If the node exists then no further action is taken. Otherwise the node is created. The token of the matched or newly created node is returned. Non-standard method. destroy destroy token This method frees all data structures associated with a DOM document or node. The argument must refer to a valid token for any document or any node in the tree of a document. When the given token refers to a DOM document then the entire document is destroyed; the Tcl namespace for the document is deleted and all document and node commands are deleted. All tokens for the document or nodes in the document become invalid. When the token refers to a node the node is removed from the tree before it is destroyed. If the node has children or attributes, they will also be destroyed. The Tcl command for the node is deleted. isNode isNode token Tests whether the given token is a valid token for some DOM node. Non-standard method. parse parse xml option value This method parses XML formatted text given by the argument and constructs a DOM tree for the document. The return result is the token of the root node of the newly created document. The document will also have a Tcl command associated with it, see the createDocument method. This method uses the TclXML package to perform the parsing operation. The dom package itself does not include an XML parser. TclXML supports the use of multiple parser implementations. The may be used to specify which XML parser class to use. All options not listed below are passed to the TclXML parser. Valid configuration options are: -baseuri URI Gives the Base URI for the document. Any relative URIs specified in the document are resolved against the given base URI. Examples of relative URIs include external entity references. If no Base URI is given then relative URIs are resolved in the current context, namely the current working directory. -parser {} libxml2 tcl This option specifies the name of a TclXML parser class to use to parse the XML data. The given parser class must be registered with the TclXML package. If an empty string is given then the default parser class is used. If an explicit value is given and that parser class is not registered then the command will fail, despite the fact that another parser may be available. -progresscommand script This option specifies a Tcl command to be invoked from time to time while the DOM tree is being constructed. The script will be invoked after a certain number of element start tags have been processed, given by the option. -chunksize integer This option specifies how many element start tags to process before invoking the script given by the option. selectNode selectNode token xpath option value Resolves the XPath location path given by . is the initial context for the location path. Returns the resulting nodeset as a (static) Tcl list. The following options may be specified: The value for this option is a list of prefix-URI pairs. Each of these pairs defines an XML Namespace and its prefix for the purposes of evaluating the XPath expression. The document itself may use a different prefix for the same XML Namespace. This option may be repeated, in which case the lists of namespace pairs are merged and all of the XML Namespaces registered. Non-standard method. serialize serialize token option value This method returns the XML formatted text corresponding to the node given by . The text is guaranteed to be a well-formed XML document, unless the option specifies a non-XML output method. Valid configuration options are: -method xml|html|text Specifies how the document tree is to be serialized as text. The allowed values correspond to the output methods defined by the XSLT v1.0 W3C Recommendation. The xml method produces output that conforms to the XML syntax. The html method produces output that conforms to HTML syntax. The text method serializes only the text nodes of the document and disables all output escaping. -indent boolean Specifies that the output is to be "pretty-printed", ie. element content is indented to provide a visual indication of nesting levels. -encoding encoding Specifies that the output is to be encoded using the given character encoding. If the encoding is utf-8 (the default) then the output is treated as a string within Tcl. If any other encoding is specified then the output is treated as a ByteArray object (ie. as binary). -newline elementlist This option specifies a list of element types for which newline characters will be added before and after the start and end tags for those elements upon serialization. This option is deprecated: the -indent option should be used instead. White space is significant in XML, so the dom package never adds extra white space for purposes of "pretty-printing" the XML source document. On some platforms, such as VMS, this can actually cause serious problems due to line length limitations. This option provides the convenience of adding newlines to certain nominated element types for formatting the source into lines. Examples: Suppose the following DOM document is constructed: set doc [::dom::DOMImplementation create] set top [::dom::document createElement $doc Root] set node [::dom::document createElement $top First] ::dom::document createElement $node Second ::dom::document createElement $top First Without the option the serialized document would be: ::dom::DOMImplementation serialize $doc <?xml version="1.0"?> <!DOCTYPE Root> <Root><First><Second/></First><First/></Root> With the option the serialized document would be: ::dom::DOMImplementation serialize $doc -newline First <?xml version="1.0"?> <!DOCTYPE Root> <Root> <First> <Second/> </First> <First/> </Root> trim trim token This method removes any node containing only white space from the document tree of the node given by . ::dom::document This command implements the Document interface in the DOM specification. The most important aspect of this command are its factory methods for creating nodes. The methods accepted by this command are as follows: cget cget token -option This method returns the value of the given configuration option. configure configure token option value This method sets the value of the given configuration options. Valid configuration options are: -doctype Specifies the token of the Document Type Declaration node. This is a read-only option. Use the factory method to create a Document Type Declaration node. -documentElement Specifies the token of the document's document element node. A document node may only have one document element, but may have other types of children (such as comments). This is a read-only option. Use the factory method to create the document element node. -keep normal|implicit Specifies the memory management strategy for the document. The value normal specifies that the document must be explicitly destroyed in order for resources consumed by the document to be freed. The value implicit specifies that the resources consumed by the document are freed when there are no longer any references to the document. Note that object shimmering can prematurely remove document references. The default value is implicit. -implementation Specifies the token of the document's implementation. This is a read-only option. createElement createElement token type This method creates an element node as a child of the given node specified by and returns the new node's token as its result. must be a node of type element, document or documentFragment. The new, child element is added as the last child of 's list of children. The new element's type is given by the argument. The new element is created with an empty attribute list. A Tcl command is created with the same name as the new node's token. This command is a shortcut for the ::dom::node command. createElementNS createElementNS token nsuri qualname This method creates an element node in an XML Namespace as a child of the given node specified by and returns the new node's token as its result. must be a node of type element, document or documentFragment. The new, child element is added as the last child of 's list of children. The new element is created in the XML Namespace given by the namespace URI . The new element's qualifed name (QName) is given by the argument. Qualified names have the form prefix:local-part. The new element is created with an empty attribute list. A Tcl command is created with the same name as the new node's token. This command is a shortcut for the ::dom::node command. createDocumentFragment createDocumentFragment token This method creates a documentFragment node as a child of the given node specified by and returns the new node's token as its result. must be a node of type element, document or documentFragment. A Tcl command is created with the same name as the new node's token. This command is a shortcut for the ::dom::node command. createTextNode createTextNode token text This method creates a textNode node as a child of the given node specified by and returns the new node's token as its result. must be a node of type element, document or documentFragment. The new, child textNode is added as the last child of 's list of children. The new textNode is created with its value set to . A Tcl command is created with the same name as the new node's token. This command is a shortcut for the ::dom::node command. createComment createComment token data This method creates a comment node as a child of the given node specified by and returns the new node's token as its result. must be a node of type element, document or documentFragment. The new, child comment is added as the last child of 's list of children. The new comment is created with its value set to . A Tcl command is created with the same name as the new node's token. This command is a shortcut for the ::dom::node command. createCDATASection createCDATASection token text TclDOM does not distinguish between textNodes and CDATASection nodes. Accordingly, this method creates a textNode node as a child of the given node specified by and returns the new node's token as its result. must be a node of type element, document or documentFragment. The new, child textNode is added as the last child of 's list of children. The new node is created with its value set to and has the attribute set to the value 1. A Tcl command is created with the same name as the new node's token. This command is a shortcut for the ::dom::node command. createProcessingInstruction createProcessingInstruction token target data This method creates a processingInstruction node as a child of the given node specified by and returns the new node's token as its result. must be a node of type element, document or documentFragment. The new, child processingInstruction is added as the last child of 's list of children. The new node is created with its name set to and its value set to . A Tcl command is created with the same name as the new node's token. This command is a shortcut for the ::dom::node command. createAttribute createAttribute token name This method creates an attribute node for the given element specified by and returns the new node's token as its result. must be a node of type element. The new attribute is created with its name set to and an empty value. A Tcl command is created with the same name as the new node's token. This command is a shortcut for the ::dom::node command. This method is included for completeness with respect to the DOM specification. The preferred method for setting element attributes is to use the ::dom::element command. createEntity createEntity token Not currently implemented. createEntityReference createEntityReference token name Not currently implemented. createEvent createEvent token name This method creates an event node in the document specified by and returns the new node's token as its result. must be a node of type document. The event type is specified by . A Tcl command is created with the same name as the new node's token. This command is a shortcut for the ::dom::event command. getElementsByTagName getElementsByTagName token name This method searches the node given by the argument for child elements with a type matching the argument . The name * matches all elements. All descendants of are searched. This method returns a "live-list"; the return result of this method is the name of a Tcl variable, the content of which is a Tcl list containing tokens for all elements that match. dtd dtd validate This method performs DTD validation upon the document. If the method returns successfully, then the document is valid. Otherwise the document is invalid and the error returned contains the reason. relaxng submethod args This method performs RELAX NG Schema validation upon the document. RELAX NG Schema validation is performed in two steps. First the document is compiled into a schema document. Second, the schema document is used to schema-validate an instance document. Example: set schema [dom::parse $XML] $schema relaxng compile set instance [dom::parse $XML2] $schema relaxng validate $instance If the document is changed after compiling, then schema document must be recompiled. schema submethod args This method performs XML Schema validation upon the document. Schema validation is performed in two steps. First the document is compiled into a schema document. Second, the schema document is used to schema-validate an instance document. Example: set schema [dom::parse $XML] $schema schema compile set instance [dom::parse $XML2] $schema schema validate $instance If the document is changed after compiling, then schema document must be recompiled. dom::node This command implements generic functions for DOM nodes. The methods accepted by this command are as follows: cget cget token option This method returns the value of the given configuration option for the node given by . configure configure token option value This method sets the value of the given configuration option for the node given by . Valid configuration options are as follows: -nodeName Returns the node name. This is a read-only option. The DOM specification gives the meaning of names for different types of nodes. For example, the option of an element node is the element type. -nodeType Returns the type of the node given by . This is a read-only option. Returns the parent node of the node given by . This is a read-only option. Returns the name of a Tcl variable which contains a list of the children of the node given by . The variable contains the "live" list of children. This is a read-only option. Returns the first child node of the node given by . This is a read-only option. Returns the last child node of the node given by . This is a read-only option. Returns the parent's child node which appears before this node. If this child is the first child of its parent then returns an empty string. This is a read-only option. Returns the parent's child node which appears after this node. If this child is the last child of its parent then returns an empty string. This is a read-only option. Returns the name of a Tcl array variable which contains the attribute list for an element node. If the node is not an element type node then returns an empty string. The indices of the array are attribute names, and the values of the array elements are their corresponding attribute values. This is a read-only option. data Specifies the value of a node. The DOM specification gives the meaning of values for different types of nodes. For example, the option of a textNode node is the node's text. Read-only. Returns a unique identifier for the node. The same identifier is always returned for the same node. insertBefore insertBefore token newchild refchild This method removes the node given by from its parent. If no argument is given then is appended to 's list of children. If the argument is given then this method adds as a child of . The new child node is positioned before the node in 's list of children. Returns an empty string. replaceChild replaceChild token newchild oldchild This method removes the node given by from its parent. It then also removes the node given by from . is then added as a child of in 's original position in the list of children. The method returns the token , which will now have no parent. removeChild removeChild token oldchild This method removes the node given by from its parent, . The method returns the token , which will now have no parent. appendChild appendChild token newchild This method removes the node given by from its parent. is then appended to the end of the list of children for node . The method returns the token . hasChildNodes hasChildNodes token Returns 1 if the given node has any child nodes, 0 otherwise. isSameNode isSameNode token ref Returns 1 if the given node is the same node as the node given by the ref token, 0 otherwise. cloneNode cloneNode token deep This method makes a copy the node given by . If the argument is not specified or has the value 0 then only the node itself is copied, not its children. If the argument has the value 1 then 's children are also copied recursively. This method returns the token of the newly created node. This new node will have no parent. children children token This is a convenience method which returns the list of child nodes for the given node as a (static) Tcl list. This is not a standard DOM method for this interface. parent parent token This is a convenience method which returns the parent node for the given node. This is not a standard DOM method for this interface. path path token Returns a Tcl list of the ancestor nodes of the given node, starting with the root node. This is not a standard DOM method for this interface. createNode createNode token xpath May create nodes in order to satisfy the given XPath location path. The initial context for the location path is the node token. For more detail, see the ::dom::createNode command. This is not a standard DOM method for this interface. selectNode selectNode token xpath Returns a (static) Tcl list of nodes selected by the XPath location path xpath. The initial context for the location path is the node token. For more detail, see the ::dom::selectNode command. This is not a standard DOM method for this interface. stringValue stringValue token Returns the string value of the node given by token. The string value of a node is defined by the XPath specification: for element nodes it is the concatenation of the string values of all descendant text nodes, for text nodes it is the node's character data value, for attribute nodes it is the attribute value, for comment nodes it is the comment data and for processing instruction nodes it is the PI data. This is not a standard DOM method for this interface. addEventListener addEventListener token type listener option value Register an event listener for the node given by token listening for events of type type. The event mechanism functions as described in the W3C DOM Level 2 Event module. When an event of type type occurs the script listener is evaluated, in the global context. The token of the event node is appended to the script. If the listener argument is omitted then the listener for the given event type is returned. Valid options are: -usecapture boolean If true the listener is triggered in the event capturing phase. If false the listener is triggered in the event bubbling phase. removeEventListener removeEventListener token type listener option value Removes an event listener previously registered for the node given by token listening for events of type type. Valid options are: -usecapture boolean If true the capturing listener is removed. If false the bubbling listener is removed. dispatchEvent dispatchEvent token event Dispatches the event given by event with target node token. The event mechanism functions as described in the W3C DOM Level 2 Event module. The event enters the capturing phase first, followed by the bubbling phase. During each phase any event listeners registered for the same event type as the event event are triggered; their script is evaluated. Unless the script invokes the stopPropagation method of the dom::event command, all registered event listeners will be triggered. The order in which listeners registered at a particular node for a particular phase are triggered is undefined. dom::element This command provides functions for element type nodes. Valid methods for this command are as follows: cget cget token option This method returns the current setting of configuration options for an element. See the configure method for the list of valid configuration options. configure configure token option value This method sets configuration options for an element. Note that element type nodes only have read-only options. Valid configuration options are as follows: name The tag name, or element type, of this element. boolean Sets whether this element was specified as an empty element when the document was parsed. That is, XML empty element syntax such as <Empty/> was used. This option has no effect upon output (serialization) of the XML document. Empty element syntax is automatically used where appropriate. getAttribute getAttribute token name This method returns the attribute value of the attribute given by . If the attribute does not exist, then an empty string is returned. setAttribute setAttribute token name value This method sets the attribute value of the attribute given by . If the attribute already exists then its value is replaced, otherwise the attribute is created. removeAttribute removeAttribute token name This method deletes the attribute given by . If the attribute does not exist then the method has no effect. getAttributeNode getAttributeNode token name Not implemented. setAttributeNode setAttributeNode token name Not implemented. removeAttributeNode removeAttributeNode token name Not implemented. getAttributeNS getAttributeNS token ns name This method returns the attribute value of the attribute given by in the XML namespace ns. If the attribute does not exist, then an empty string is returned. setAttributeNS setAttributeNS token ns name value This method sets the attribute value of the attribute given by in the XML namespace ns. If the attribute already exists then its value is replaced, otherwise the attribute is created. removeAttributeNS removeAttributeNS token ns name This method deletes the attribute given by in the XML namespace ns. If the attribute does not exist then the method has no effect. getElementsByTagName getElementsByTagName token name This method searches the node given by the argument for descendant child elements with a type matching the argument . The wildcard character * matches any element type. The return result is a "live-list" which is represented by a Tcl variable. This method returns the name of the Tcl variable that contains the list of tokens that match. normalize normalize token This method recursively coalesces textNodes within the children of the given node. textNodes which are adjacent in the DOM tree cannot be distinguished in the serialized XML document. dom::processinginstruction This command provides functions for processingInstruction type nodes. Valid methods for this command are as follows: cget cget token option This method returns the current setting of configuration options for an element. See the configure method for the list of valid configuration options. configure configure token option value This method sets configuration options for a processing instruction. Valid configuration options are as follows: name This option sets the target of the processing instruction. This is a read-only configuration option. data This option sets the data of the processing instruction. dom::event This command provides functions for event type nodes. Valid methods for this command are as follows: cget cget token This method retrieves configuration options for an event. Valid configuration options are as follows: This option determines whether the ALT modifier key has been specified for this event. This option gives the name of the attribute associated with this event. This option determines whether the event uses the bubbling phase. This option gives the button pressed for this event. This option determines whether the event may be cancelled. This option gives the window X coordinate for this event. This option gives the window Y coordinate for this event. This option determines whether the control modifier key has been specified for this event. The current node of the capturing or bubbling phase. This option gives an additional information item for the event, for example the key that was pressed or the button number. The current phase of the event. This option determines whether the META modifier key has been specified for this event. This option gives the new value of a node. This option gives the previous value of a node. This option gives a related node for this event. See the W3C DOM Level 2 Event module specification for further details. This option gives the screen X coordinate for this event. This option gives the screen Y coordinate for this event. This option determines whether the shift modifier key has been specified for this event. The node that is the target of this event. This option gives the time at which the event was posted. The value is the number of milliseconds since the epoch, which is compatible with the Tcl clock command. The implementation of this method depends on the Tcl_GetTime function.This function only became publically available in Tcl 8.4. If a version of Tcl prior to 8.4 is being used, then this option will have the value 0. The type of this event. This option gives whether the view of the event. configure configure token option value This method sets the configuration options for an event. However, all event options are read-only. See the cget method for the list of valid configuration options. stopPropagation stopPropagation token This method cancels further propagation of the event. Invoking this method does not prevent event listeners at the current node from being triggered. preventDefault preventDefault token This method stops the default action for this event from occurring. initEvent initEvent token type bubbles cancelable Initialise the event. type gives the type of the event. Any of the event types defined by the W3C DOM Level 2 Event module may be specified, or a user-defined event type may be used instead. bubbles indicates whether the event will enter the bubbling phase after the capturing phase. cancelable indicates whether the event may be cancelled. initUIEvent initUIEvent token type bubbles cancelable view detail Initialise a user interface event. See initEvent for further information. view gives the view for the event (not supported by TclDOM). detail provides extra data for the event. initMouseEvent initMouseEvent token type bubbles cancelable view detail screenX screenY clientX clientY ctrlKey altKey shiftKey metaKey button relatedNode Initialise a mouse event. See initUIEvent for further information. screenX and screenY give the coordinates at which the event occurred relative to the screen. screenX and screenY give the coordinates at which the event occurred relative to the window. ctrlKey, altKey, shiftKey, metaKey indicate whether the respective modifier key was pressed when the event occurred. button indicates which button, if any, was pressed when the event occurred. relatedNode specifies that a DOM node is associated with the event. initMutationEvent initMutationEvent token type bubbles cancelable relatedNode prevValue newValue attrName Initialise a tree mutation event event. See initEvent for further information. relatedNode specifies a DOM node to associate with the event. prevValue gives the previous value of the node. newValue gives the new value of the node. attrName gives the name of the attribute where the event is modifying an attribute value. postUIEvent postUIEvent token type option value Non-standard convenience method that handles posting an user interface event with token as the target node. This method performs the following functions: Create an event node, Initialise the event node (using default values where required), Dispatch the event, Destroy the event node. type gives the event type. The following options are valid: Indicates whether the event bubbles. Indicates whether the event can be cancelled. The view. Extra data for the event. postMouseEvent postMouseEvent token type option value Non-standard convenience method that handles posting a mouse event with token as the target node. This method performs the following functions: Create an event node, Initialise the event node (using default values where required), Dispatch the event, Destroy the event node. type gives the event type. The following options are valid: Indicates whether the event bubbles. Indicates whether the event can be cancelled. The view. Extra data for the event. Gives the screen X coordinate. Gives the screen Y coordinate. Gives the window X coordinate. Gives the window Y coordinate. Indicates whether the control modifier key was pressed. Indicates whether the ALT modifier key was pressed. Indicates whether the shift modifier key was pressed. Indicates whether the meta modifier key was pressed. Gives the button pressed. Gives a node to associate with the event. postMutationEvent postMutationEvent token type option value Non-standard convenience method that handles posting a mutation event with token as the target node. This method performs the following functions: Create an event node, Initialise the event node (using default values where required), Dispatch the event, Destroy the event node. type gives the event type. The following options are valid: Indicates whether the event bubbles. Indicates whether the event can be cancelled. Gives a node to associate with the event. Gives the previous value of the target node. Gives the new value of the target node. Gives the name of the attribute modified. Errors If an operation results in an error condition, an error message is returned as a structured Tcl list. The list has members as follows: {domain level code node line message int1 int2 string1 string2 string3} The format of the list is described in the TclXML manual page. Implementations This section documents the various implmentations of the TclDOM API. Tcl Implementation The Tcl implementation is provided by the dom::tcl package. Limitations This implementation is not able to preform the following functions: Validation: DTD, XML Schema or RelaxNG validation are not supported. Character encodings: The TclDOM/tcl implementation itself does not handle character encodings other than utf-8. Character encodings are handled by Tcl itself. libxml2 Implementation The TclDOM/libxml2 implementation is a wrapper for the Gnome libxml2 library. It is provided by the dom::libxml2 package. It is a high-performance library, making use of Tcl objects for fast access to tree nodes. Limitations The TclXML/libxml2 parser must be used to parse an XML document. It is not possible to use any other parser class. The importNode method has not been implemented. tclxml-3.3~svn11.orig/doc/tcldoc-1.0.dtd0000644000000000000000000000467311113705304016421 0ustar rootroot %DocBook; tclxml-3.3~svn11.orig/doc/tclxslt.xml.in0000644000000000000000000006230711215700771017010 0ustar rootroot ]> Steve Ball 2009 2008 2007 2005 Explain 2004 2003 2002 Zveno Pty Ltd See the file LICENSE for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. TclXSLT n ::xslt::compile ::xslt::extension ::xslt::security package require xslt xslt &version; ::xslt ::xslt::compile doc ssheet method option value args ::xslt::extension add nsuri tcl-namespace ::xslt::security request detail Description TclXSLT is a wrapper for the Gnome libxslt library that allows an application to perform XSL transformations (XSLT). The package also provides a binding to the XSLT extension mechanism so that XSLT extension may be implemented using Tcl scripts. Transformation only works with documents created by TclDOM/libxml2. The TclXSLT package makes extensive use of Tcl objects. Compiled XSL stylesheets are stored as the internal representation of a Tcl object. Source and result documents are accessed via TclDOM's C interface as Tcl objects. This allows the application to cache parsed XML documents and compiled XSL stylesheets for better runtime performance. Packages and Namespaces The TclXSLT package defines the xslt package and also a Tcl namespace using that name. Commands ::xslt::compile The ::xslt::compile command compiles a stylesheet document. It returns a compiled stylesheet object and also defines a Tcl command to access the stylesheet. This Tcl command may be used to transform XML documents. Example set source_doc [::dom::libxml2::parse $XML] set ssheet_doc [::dom::libxml2::parse $XSLstylesheet] set ssheet [::xslt::compile $ssheet_doc] set result [$ssheet transform $source_doc] NB. It is advisable to use the option when parsing the source and stylesheet documents to allow external resources to be resolved. Stylesheet Command The stylesheet command created by ::xslt::compile command accesses a compiled stylesheet. Command Methods The following command methods may be used: cget option Returns the value of an option. See below for the list of valid options. configure option value Sets the value of an option. Available options are as follows: Specifies whether the output being produced by the stylesheet should be idented (or "pretty-printed"). This is usually set by the styesheet's xsl:output element. The result is a boolean value. This is a read-only option. script This option specifies a Tcl command to be evaluated when a message is produced by the stylesheet. Messages may be produced when the stylesheet detects an error during processing, or when the stylesheet uses the xsl:message element. It is currently not possible to distinguish between an error message and a message produced using xsl:message. Specifies the output being produced by the stylesheet. This is usually set by the styesheet's xsl:output element. May have the value xml, html, xhtml, text or an empty string. If the result is an empty string, then the output method used depends on the type of the result document. If the result document is of type "HTML" (ie. if [dom::node cget $resultdoc -nodeType] returns HTMLdocument), then the html output method should be used. Otherwise the output method to use is xml. This is a read-only option. Specifies the name of a channel into which profiling information is written. The channel must have been opened for writing, or an error will be returned when attempting a transformation. Only file channels may be used and only on Unix systems. Specifies the target URI for the transformation, ie. where the result will be written to. The result document is not written to this URI automatically; the application should write the result document to this URI itself. Some transformation constructs resolve relative URIs against this URI. For example, a subsidiary result document produced using the document element. get what Returns information from the stylesheet. The following values may be used for what: parameters Returns a Tcl list describing the parameters that the stylesheet accepts. Each member of the list is itself a Tcl list with three members: {name ns select}. name is the name of the parameter, ns is the XML namespace for the parameter and select is the value of the select attribute of the param element, if any (ie. the default value of the parameter). This implementation is not able to return a default value set using the content of the param element. All stylesheet parameters are returned by this method, including those in included/imported stylesheets. Where more than one parameter is defined with the same name, only the parameter with the highest import precedence is included in the returned list. transform source name value Performs an XSL transformation on the given source document. Stylesheet parameters may be specified as name-value pairs. The return result is the DOM token for the result document. Stylesheet Parameters Any number of name-value pairs may be specified as arguments to the stylesheet transform method. These are passed as values for parameters in the stylesheet. libxslt interprets the values as XPath expressions, where the context node is the root node for the source document. To pass a value as a string it must be XPath-quoted, for example set library "Gnome libxslt" $ssheet transform $source_doc \ library '$library' \ author "'Daniel Veillard'" \ node {/*/Element[3]} Following is an example of how to use the stylesheet transform method. Example set source_doc [::dom::libxml2::parse $XML] set ssheet_doc [::dom::libxml2::parse $XSLstylesheet] set ssheet [::xslt::compile $ssheet_doc] set result_doc [$ssheet transform $source_doc] set result_xml [::dom::libxml2::serialize $result_doc \ -method [$ssheet cget -method]] ::xslt::extension The ::xslt::extension command is used to manage extensions of the libxslt library. The add is used to register an extension. The remove is used to unregister an extension. See EXTENSIONS for more detail. ::xslt::security The ::xslt::security command is a "call-in" used to manage the security of a stylesheet performing a transformation. The TclXSLT package does not create this command. A stylesheet may need to perform an operation on an external resource, such as reading or writing a file, or opening a network connection. Before performing such an operation, TclXSLT will invoke the ::xslt::security command. It interprets the result of the command as a boolean value, and only if the "true" value is returned will it instruct the libxslt library to continue. TclXSLT will invoke the ::xslt::security command in a different fashion depending on whether the current interpreter is safe or unsafe. If the current interpeter is unsafe (ie. it is a trusted interpreter) then the command is invoked in the usual manner (see below for arguments). If the command does not exist then the value "true" is the default, ie. the operation will be permitted. If the current interpreter is safe then the command is invoked as a hidden command. This is to ensure that the untrusted script cannot intercept the invocation of the command. If the hidden command does not exist then the value "false" is the default, ie. the operation will not be permitted. When the ::xslt::security command is invoked two arguments are appended: ::xslt::security request detail request This indicates the operation being requested and may have one of the following values: readfile Extensions The TclXSLT package allows an application to bind Tcl scripts to the extension mechanism of libxslt. This means that Tcl scripts may provide the implementation of an XSLT extension element or function. The binding is achieved to associating a Tcl namespace with an XML namespace. Implementing An Extension The Tcl application uses the ::xslt::extension add command to register an extension. An XML Namespace for the extension is specified as an argument, along with a Tcl namespace that will provide implementations of extension elements and functions. For example, ::xslt::extension add http://tclxml.sourceforge.net/Example ::example Everytime the ::xslt::transform command is executed, a newly-created XSLT engine is initialized. For each registered extension, every procedure in the associated Tcl namespace is defined in the XSLT engine as either an extension element or an extension function. The procedure is defined as an extension function if it has a variable argument list, otherwise it is defined as an extension element. The procedure name is used as the local part of the extension name. For example, namespace eval example { namespace export myfunc myelement } proc example::myfunc {name args} { global app return $app($name) } proc example::myelement {content node inst avts} { global app puts $app([dom::libxml2::node cget $node -nodeName]) return {} } "myfunc" is defined as an extension function and "myelement" is defined as an extension element. Extension Functions The arguments to an extension function are passed as parameters to the Tcl procedure. Each argument may be passed as a string or as a nodeset. Nodesets are presented as TclDOM nodes. The return result of the Tcl procedure becomes the return value of the extension function. The type of the result is preserved where possible, otherwise it is converted to a string value. Extension Elements When an extension element associated with a registered namespace is instantiated all attributes of the extension element are evaluated as Attribute Value Templates and the content of the extension element is evaluated as a sequence constructor. The Tcl procedure associated with the extension element is then invoked. The Tcl procedure is passed four parameters: The first parameter is a DOM document, an RVT, that is the result of the sequence constructor. The second parameter is the current node in the source document. The third parameter is the extension element in the stylesheet document. The fourth parameter is a list. Each element in the list represents an attribute of the extension element. The list elements are each a sublist that has three values: Attribute name Attribute XML namespace Attribute value after evaluation as an AVT Any result returned by the Tcl procedure is discarded (in the current implementation). If the Tcl procedure raises an error then this is passed through to the XSL stylesheet as an XSLT exception condition. Using An Extension To invoke an extension in an XSL stylesheet, use the normal XSLT extension mechanism. The XML Namespace matches the extension to the registered Tcl namespace (NB. the stylesheet author is free to choose any prefix for the extension namespace). For example, <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:eg='http://tclxml.sourceforge.net/Example'> <xsl:template match='/'> <xsl:text>Result of calling extension is "</xsl:text> <xsl:value-of select='eg:myfunc("foo")'/> <xsl:text>". </xsl:text> </xsl:template> </xsl:stylesheet> This stylesheet would result in the following Tcl script being evaluated: ::example::myfunc foo tclxml-3.3~svn11.orig/doc/nroff.xsl0000644000000000000000000002057411120333251016014 0ustar rootroot '\" '\" '\" RCS: @(#) $Id: nroff.xsl,v 1.4 2005/05/20 12:02:18 balls Exp $ '\" .so man.macros '\" Copyright (c) '\" '\" '\" '\" .TH TclXML "TclXML Package Commands" .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME \- .BE .SH SYNOPSIS .BE \fP .sp \fP \fB \fI \fR ? ? ? ... ? \fI \fI \fR \fB \fR .SH .PP * .SS .RS .RE .TP \fI \fP .TP \fI \fP .PP .PP .PP .CS .CE No template matching (parent ) tclxml-3.3~svn11.orig/configure.in0000755000000000000000000003015311215700771015725 0ustar rootroot#!/bin/bash -norc dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. # # Copyright (c) 2007-2009 Explain/Packaged Press. # # $Id: configure.in,v 1.15.2.1 2005/12/28 06:49:50 balls Exp $ #-------------------------------------------------------------------- # Configure script for package 'TclXML', # TEA compliant. #-------------------------------------------------------------------- #-------------------------------------------------------------------- # This very first macro is used to verify that the configure script can # find the sources. The argument to AC_INIT is a unique filename for # this package. #-------------------------------------------------------------------- AC_INIT([Tclxml], [3.3]) PACKAGE_NAME=Tclxml PACKAGE_VERSION=3.3 TEA_INIT([3.6]) AC_CONFIG_AUX_DIR(tclconfig) TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG TEA_PREFIX TEA_SETUP_COMPILER #----------------------------------------------------------------------- # 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. #----------------------------------------------------------------------- TEA_ADD_SOURCES([tclxml.c docObj.c tclxml-libxml2.c nodeObj.c tcldom-libxml2.c tclxslt-libxslt.c]) TEA_ADD_HEADERS([include/tclxml-libxml2/docObj.h include/tclxml-libxml2/tclxml-libxml2.h include/tcldom/tcldom.h include/tcldom-libxml2/tcldom-libxml2.h include/tclxslt/tclxslt.h]) TEA_ADD_INCLUDES([-Iinclude]) #TEA_ADD_LIBS([-lexslt]) TEA_ADD_LIBS([]) TEA_ADD_CFLAGS([]) TEA_ADD_STUB_SOURCES([tclxmlStubInit.c tclxmlStubLib.c]) TEA_ADD_TCL_SOURCES([tclxml-tcl/xml__tcl.tcl tclxml-tcl/sgml-8.0.tcl tclxml-tcl/sgml-8.1.tcl tclxml-tcl/xml-8.0.tcl tclxml-tcl/xml-8.1.tcl tclxml-tcl/sgmlparser.tcl tclxml-tcl/tclparser-8.0.tcl tclxml-tcl/tclparser-8.1.tcl tclxml-tcl/xmldep.tcl tclxml-tcl/xpath.tcl tcldom-libxml2.tcl tcldom-tcl/xmlswitch.tcl tclxslt/process.tcl tclxslt/resources.tcl tclxslt/utilities.tcl tclxslt/xsltcache.tcl tclxslt-libxslt.tcl]) #-------------------------------------------------------------------- # A few miscellaneous platform-specific items: # # We have to define a special symbol for Windows (BUILD_Tclxml 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. # We can add more files to clean if our extension creates any extra # files in the future. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- CLEANFILES=pkgIndex.tcl if test "${TEA_PLATFORM}" = "windows" ; then AC_DEFINE(BUILD_Tclxml, 1, [Build windows export dll]) CLEANFILES="$CLEANFILES *.lib *.dll *.exp *.ilk *.pdb vc*.pch" else : fi AC_SUBST(CLEANFILES) TEA_PUBLIC_TCL_HEADERS #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # So far only Tcl responds to this one. #-------------------------------------------------------------------- TEA_ENABLE_THREADS #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- TEA_ENABLE_SHARED #-------------------------------------------------------------------- # 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. #-------------------------------------------------------------------- TEA_CONFIG_CFLAGS #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- TEA_ENABLE_SYMBOLS #-------------------------------------------------------------------- # 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. #-------------------------------------------------------------------- AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl 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. #-------------------------------------------------------------------- TEA_MAKE_LIB #-------------------------------------------------------------------- # On Mac OS X we may want to build as a framework. # This affects the location and naming of headers and libaries. #-------------------------------------------------------------------- AC_ARG_ENABLE(framework, [ --enable-framework build as a Mac OS X framework], [tcl_ok=$enableval], [tcl_ok=$1]) #-------------------------------------------------------------------- # Load libxml2 configuration #-------------------------------------------------------------------- AC_MSG_CHECKING([for xml2-config script]) AC_ARG_WITH(xml2-config, [ --with-xml2-config the xml2-config configuration script], with_xml2_config=${withval}) LIBXML2_CONFIG= if test "x${with_xml2_config}" = "x" ; then for c in \ /Library/Frameworks/libxml.framework/Resources/Scripts/xml2-config \ ${prefix}/bin/xml2-config \ /usr/bin/xml2-config \ /usr/local/bin/xml2-config do if test -x "$c" ; then LIBXML2_CONFIG="$c" break fi done else LIBXML2_CONFIG="${with_xml2_config}" fi if test "x$LIBXML2_CONFIG" = "x" ; then AC_MSG_ERROR([unable to find xml2-config]) else AC_MSG_RESULT([${LIBXML2_CONFIG}]) XML2_VERSION=`${LIBXML2_CONFIG} --version` XML2_PREFIX=`${LIBXML2_CONFIG} --prefix` XML2_LIBS="`${LIBXML2_CONFIG} --libs`" XML2_CFLAGS=`${LIBXML2_CONFIG} --cflags` fi AC_SUBST(XML2_PREFIX) AC_SUBST(XML2_CFLAGS) AC_SUBST(XML2_VERSION) #-------------------------------------------------------------------- # Load libxslt configuration #-------------------------------------------------------------------- AC_MSG_CHECKING([for xslt-config script]) AC_ARG_WITH(xslt-config, [ --with-xslt-config the xslt-config configuration script], with_xslt_config=${withval}) LIBXSLT_CONFIG= if test "x${with_xslt_config}" = "x" ; then if test "x${with_xml2_config}" = "x" ; then : else if test -x "`dirname ${with_xml2_config}`/xslt-config" ; then LIBXSLT_CONFIG="`dirname ${with_xml2_config}`/xslt-config" fi fi else LIBXSLT_CONFIG="${with_xslt_config}" fi if test "x${LIBXSLT_CONFIG}" = "x" ; then for c in \ /Library/Frameworks/libxslt.framework/Resources/Scripts/xslt-config \ ${prefix}/bin/xslt-config \ /usr/bin/xslt-config \ /usr/local/bin/xslt-config do if test -x "$c" ; then LIBXSLT_CONFIG="$c" break fi done fi if test "x$LIBXSLT_CONFIG" = "x" ; then AC_MSG_ERROR([unable to find xslt-config script]) else AC_MSG_RESULT([${LIBXSLT_CONFIG}]) XSLT_VERSION=`${LIBXSLT_CONFIG} --version` XSLT_PREFIX=`${LIBXSLT_CONFIG} --prefix` XSLT_CFLAGS=`${LIBXSLT_CONFIG} --cflags` XSLT_LIBS="`${LIBXSLT_CONFIG} --libs` -lexslt" fi AC_SUBST(XSLT_VERSION) AC_SUBST(XSLT_PREFIX) AC_SUBST(XSLT_CFLAGS) #-------------------------------------------------------------------- # See if we want to statically link the libxml2 and libxslt # libraries. This is desirable for Tclkit. #-------------------------------------------------------------------- AC_MSG_CHECKING([for static linking of XML/XSLT libraries]) AC_ARG_WITH(xml-static, [ --with-xml-static statically link the XML libraries], with_xml_static=${withval}) XML_STATIC="0" if test "${with_xml_static}" = "1" ; then XML_STATIC="1" AC_MSG_RESULT([use static linking]) else AC_MSG_RESULT([use dynamic linking]) fi AC_SUBST(XML_STATIC) #-------------------------------------------------------------------- # __CHANGE__ # Add platform libs to LIBS or SHLIB_LD_LIBS as necessary. #-------------------------------------------------------------------- FIX_LIB=":" if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${LIBXSLT_LIBDIR}/libxslt.lib`\"" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${LIBXSLT_LIBDIR}/libexslt.lib`\"" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${LIBXML2_LIBDIR}/libxml2.lib`\"" else if test "${XML_STATIC}" = "0" ; then echo "setting up dynamic linking" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \${XSLT_LIBS}" else SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${XSLT_PREFIX}/lib/libexslt.a" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${XSLT_PREFIX}/lib/libxslt.a" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${XML2_PREFIX}/lib/libxml2.a" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -L/usr/lib -lgcrypt -lgpg-error -lz -lm" XML2_LIBS= XSLT_LIBS= FIX_LIB="chcon -t texrel_shlib_t" fi fi # Enabling static linking modifies the setting of the libraries, # so delay substitution until this point. AC_SUBST(XML2_LIBS) AC_SUBST(XSLT_LIBS) AC_SUBST(FIX_LIB) #-------------------------------------------------------------------- # 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. #-------------------------------------------------------------------- TEA_PROG_TCLSH #-------------------------------------------------------------------- # These are for tclxmlConfig.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 Tclxml_LIB_FLAG="-l${PACKAGE_NAME}${PACKAGE_VERSION}${DBGX}" else eval Tclxml_LIB_FLAG="-l${PACKAGE_NAME}`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}" fi Tclxml_BUILD_LIB_SPEC="-L`pwd` ${Tclxml_LIB_FLAG}" Tclxml_LIB_SPEC="-L${pkglibdir} ${Tclxml_LIB_FLAG}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval Tclxml_STUB_LIB_FLAG="-l${PACKAGE_NAME}stub${PACKAGE_VERSION}${DBGX}" else eval Tclxml_STUB_LIB_FLAG="-l${PACKAGE_NAME}stub`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}" fi Tclxml_BUILD_STUB_LIB_SPEC="-L`pwd` ${Tclxml_STUB_LIB_FLAG}" Tclxml_STUB_LIB_SPEC="-L${pkglibdir} ${Tclxml_STUB_LIB_FLAG}" Tclxml_BUILD_STUB_LIB_PATH="`pwd`/${Tclxmlstub_LIB_FILE}" Tclxml_STUB_LIB_PATH="${pkglibdir}/${Tclxmlstub_LIB_FILE}" eval pkgincludedir="${includedir}" Tclxml_INCLUDE_SPEC="-I${pkgincludedir}" AC_SUBST(Tclxml_BUILD_LIB_SPEC) AC_SUBST(Tclxml_LIB_SPEC) AC_SUBST(Tclxml_BUILD_STUB_LIB_SPEC) AC_SUBST(Tclxml_STUB_LIB_SPEC) AC_SUBST(Tclxml_BUILD_STUB_LIB_PATH) AC_SUBST(Tclxml_STUB_LIB_PATH) AC_SUBST(Tclxml_INCLUDE_SPEC) #-------------------------------------------------------------------- # TODO: search for an appropriate xsltproc to use #-------------------------------------------------------------------- XSLTPROC=xsltproc AC_SUBST(XSLTPROC) #-------------------------------------------------------------------- # 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_OUTPUT([Makefile Makefile.macosx pkgIndex.tcl TclxmlConfig.sh include/tclxml/tclxml.h doc/tclxml.xml doc/tcldom.xml doc/tclxslt.xml doc/README.xml]) #-------------------------------------------------------------------- tclxml-3.3~svn11.orig/Makefile.macosx.in0000644000000000000000000000101311113705304016732 0ustar rootroot######################## # # Makefile to build TclXML/libxml2 for macosx. # # Usage: # cd tclxml-3.X # make -f Makefile.macosx # # $Id: Makefile.macosx,v 1.1 2005/05/20 12:04:19 balls Exp $ # ######################## PACKAGE_VERSION := @PACKAGE_VERSION@ LIBXML2_VERSION := $(shell eval echo $$(ls -dt ../libxml2* | head -1 | sed -e '1s/.*\-//')) all: build build: cd macosx; xcodebuild -project tclxml.pbproj -target Make -buildstyle Deployment FRAMEWORK_VERSION=${PACKAGE_VERSION} LIBXML2_VERSION=${LIBXML2_VERSION} tclxml-3.3~svn11.orig/tclxml.decls0000644000000000000000000001346711113705304015733 0ustar rootroot# tclxml.decls -- # # This file contains the declarations for all supported public functions # that are exported by the TCLXML library via the stubs table. This file # is used to generate the tclxmlDecls.h/tclxmlStubsLib.c/tclxmlStubsInit.c # files. # # Declare each of the functions in the public TclXML interface. Note that # the an index should never be reused for a different function in order # to preserve backwards compatibility. library tclxml # Define the TCLXML interface: interface tclxml #hooks {} declare 0 generic { int Tclxml_Init(Tcl_Interp *interp) } declare 1 generic { int Tclxml_SafeInit(Tcl_Interp *interp) } ######################################################################### ### Parser registration API declare 2 generic { int TclXML_RegisterXMLParser (Tcl_Interp *interp, \ TclXML_ParserClassInfo *parser) } ######################################################################### ### Application callback C API. ### These are equivalent to the Tcl API, and may be used in conjunction. declare 3 generic { int TclXML_RegisterElementStartProc (Tcl_Interp *interp, \ TclXML_Info *parser, ClientData clientData, \ TclXML_ElementStartProc *callback) } declare 4 generic { int TclXML_RegisterElementEndProc (Tcl_Interp *interp, \ TclXML_Info *parser, ClientData clientData, \ TclXML_ElementEndProc *callback) } declare 5 generic { int TclXML_RegisterCharacterDataProc (Tcl_Interp *interp, \ TclXML_Info *parser, ClientData clientData, \ TclXML_CharacterDataProc *callback) } declare 6 generic { int TclXML_RegisterPIProc (Tcl_Interp *interp, TclXML_Info *parser, \ ClientData clientData, TclXML_PIProc *callback) } declare 7 generic { int TclXML_RegisterDefaultProc (Tcl_Interp *interp, \ TclXML_Info *parser, ClientData clientData, \ TclXML_DefaultProc *callback) } declare 8 generic { int TclXML_RegisterUnparsedProc (Tcl_Interp *interp, \ TclXML_Info *parser, ClientData clientData, \ TclXML_UnparsedProc *callback) } declare 9 generic { int TclXML_RegisterNotationDeclProc (Tcl_Interp *interp, \ TclXML_Info *parser, ClientData clientData, \ TclXML_NotationDeclProc *callback) } declare 10 generic { int TclXML_RegisterEntityProc (Tcl_Interp *interp, TclXML_Info *parser, \ ClientData clientData, TclXML_EntityProc *callback) } declare 11 generic { int TclXML_RegisterUnknownEncodingProc (Tcl_Interp *interp, \ TclXML_Info *parser, ClientData clientData, \ TclXML_UnknownEncodingProc *callback) } declare 12 generic { int TclXML_RegisterCommentProc (Tcl_Interp *interp, TclXML_Info *parser, \ ClientData clientData, TclXML_CommentProc *callback) } declare 13 generic { int TclXML_RegisterNotStandaloneProc (Tcl_Interp *interp, \ TclXML_Info *parser, ClientData clientData, \ TclXML_NotStandaloneProc *callback) } declare 14 generic { int TclXML_RegisterElementDeclProc (Tcl_Interp *interp, \ TclXML_Info *parser, ClientData clientData, \ TclXML_ElementDeclProc *callback) } declare 15 generic { int TclXML_RegisterAttListDeclProc (Tcl_Interp *interp, \ TclXML_Info *parser, ClientData clientData, \ TclXML_AttlistDeclProc *callback) } declare 16 generic { int TclXML_RegisterStartDoctypeDeclProc (Tcl_Interp *interp, \ TclXML_Info *parser, ClientData clientData, \ TclXML_StartDoctypeDeclProc *callback) } declare 17 generic { int TclXML_RegisterEndDoctypeDeclProc (Tcl_Interp *interp, \ TclXML_Info *parser, ClientData clientData, \ TclXML_EndDoctypeDeclProc *callback) } ######################################################################### ### Call-ins for parser class implementations. ### A parser implementation calls these functions. ### The generic layer then invokes application callbacks ### that may be defined. declare 18 generic { void TclXML_ElementStartHandler (void *userdata, Tcl_Obj *name, \ Tcl_Obj *nsuri, \ Tcl_Obj *atts, Tcl_Obj *nsDeclsObj) } declare 19 generic { void TclXML_ElementEndHandler (void *userData, Tcl_Obj *name) } declare 20 generic { void TclXML_CharacterDataHandler (void *userData, Tcl_Obj *s) } declare 21 generic { void TclXML_ProcessingInstructionHandler (void *userData, \ Tcl_Obj *target, Tcl_Obj *data) } declare 22 generic { int TclXML_ExternalEntityRefHandler (ClientData clientData, \ Tcl_Obj *openEntityNames, Tcl_Obj *base, Tcl_Obj *systemId, \ Tcl_Obj *publicId) } declare 23 generic { void TclXML_DefaultHandler (void *userData, Tcl_Obj *s) } declare 24 generic { void TclXML_UnparsedDeclHandler (void *userData, Tcl_Obj *entityname, \ Tcl_Obj *base, Tcl_Obj *systemId, Tcl_Obj *publicId, \ Tcl_Obj *notationName) } declare 25 generic { void TclXML_NotationDeclHandler (void *userData, Tcl_Obj *notationName, \ Tcl_Obj *base, Tcl_Obj *systemId, Tcl_Obj *publicId) } declare 26 generic { int TclXML_UnknownEncodingHandler (void *encodingHandlerData, \ Tcl_Obj *name, void *info) } ######################################################################### ### Following added by ericm@scriptics, 1999.6.25 ### Prototype definition for the comment handler declare 27 generic { void TclXML_CommentHandler (void *userData, Tcl_Obj *data) } ### Prototype for Not Standalone Handler declare 28 generic { int TclXML_NotStandaloneHandler (void *userData) } ######################################################################### ### Added by ericm@scriptics.com, 1999.09.13 ### Prototype for (Element|Attlist) Declaration Handlers declare 31 generic { void TclXML_ElementDeclHandler (void *userData, Tcl_Obj *name, \ Tcl_Obj *contentspec) } declare 32 generic { void TclXML_AttlistDeclHandler (void *userData, Tcl_Obj *name, \ Tcl_Obj *attributes) } ### Prototypes for the Doctype Decl handlers declare 33 generic { void TclXML_StartDoctypeDeclHandler (void *userData, Tcl_Obj *name) } declare 34 generic { void TclXML_EndDoctypeDeclHandler (void *userData) } tclxml-3.3~svn11.orig/configure0000755000000000000000000121463011215700771015325 0ustar rootroot#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for Tclxml 3.3. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # 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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done 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) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= 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=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' 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$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" exec 7<&0 &1 # 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` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='Tclxml' PACKAGE_TARNAME='tclxml' PACKAGE_VERSION='3.3' PACKAGE_STRING='Tclxml 3.3' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef 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 datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias 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 GREP 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 TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB XML2_PREFIX XML2_CFLAGS XML2_VERSION XSLT_VERSION XSLT_PREFIX XSLT_CFLAGS XML_STATIC XML2_LIBS XSLT_LIBS FIX_LIB TCLSH_PROG Tclxml_BUILD_LIB_SPEC Tclxml_LIB_SPEC Tclxml_BUILD_STUB_LIB_SPEC Tclxml_STUB_LIB_SPEC Tclxml_BUILD_STUB_LIB_PATH Tclxml_STUB_LIB_PATH Tclxml_INCLUDE_SPEC XSLTPROC LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$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 ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -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'` 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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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'` 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; }; } 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 directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 the parent directory. ac_confdir=`$as_dirname -- "$0" || $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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 Tclxml 3.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 \`..'] 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] --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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/tclxml] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Tclxml 3.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-framework build as a Mac OS X framework 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-tclinclude directory containing the public Tcl header files --with-celib=DIR use Windows/CE support library from DIR --with-xml2-config the xml2-config configuration script --with-xslt-config the xslt-config configuration script --with-xml-static statically link the XML libraries 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 LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective 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 ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested 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 else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Tclxml configure 3.3 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Tclxml $as_me 3.3, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { 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` /usr/bin/hostinfo = `(/usr/bin/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 IFS=$as_save_IFS } >&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_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_arg'" ;; 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. 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, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r 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 -f -r conftest* 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 -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file 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 $ac_precious_vars; 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 PACKAGE_NAME=Tclxml PACKAGE_VERSION=3.3 # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_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 "$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 # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # # 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 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 # Bug fix #1367779 (by Wart) 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/lib64 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}\"" 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 # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_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 $# != 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then 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 # Check that 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' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { 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 ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag 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 ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 IFS=$as_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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. 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 x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_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_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 #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)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 core.conftest.* 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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f core 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return sin (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return setsockopt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char setsockopt (); int main () { return setsockopt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return accept (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; 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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 #----------------------------------------------------------------------- # 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="tclxml.c docObj.c tclxml-libxml2.c nodeObj.c tcldom-libxml2.c tclxslt-libxslt.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="include/tclxml-libxml2/docObj.h include/tclxml-libxml2/tclxml-libxml2.h include/tcldom/tcldom.h include/tcldom-libxml2/tcldom-libxml2.h include/tclxslt/tclxslt.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="-Iinclude" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done #TEA_ADD_LIBS([-lexslt]) 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 PKG_CFLAGS="$PKG_CFLAGS " vars="tclxmlStubInit.c tclxmlStubLib.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="tclxml-tcl/xml__tcl.tcl tclxml-tcl/sgml-8.0.tcl tclxml-tcl/sgml-8.1.tcl tclxml-tcl/xml-8.0.tcl tclxml-tcl/xml-8.1.tcl tclxml-tcl/sgmlparser.tcl tclxml-tcl/tclparser-8.0.tcl tclxml-tcl/tclparser-8.1.tcl tclxml-tcl/xmldep.tcl tclxml-tcl/xpath.tcl tcldom-libxml2.tcl tcldom-tcl/xmlswitch.tcl tclxslt/process.tcl tclxslt/resources.tcl tclxslt/utilities.tcl tclxslt/xsltcache.tcl tclxslt-libxslt.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 #-------------------------------------------------------------------- # A few miscellaneous platform-specific items: # # We have to define a special symbol for Windows (BUILD_Tclxml 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. # We can add more files to clean if our extension creates any extra # files in the future. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- CLEANFILES=pkgIndex.tcl if test "${TEA_PLATFORM}" = "windows" ; then cat >>confdefs.h <<\_ACEOF #define BUILD_Tclxml 1 _ACEOF CLEANFILES="$CLEANFILES *.lib *.dll *.exp *.ilk *.pdb vc*.pch" else : fi { 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 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}\" #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # So far only Tcl responds to this one. #-------------------------------------------------------------------- # Check whether --enable-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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char __pthread_mutex_init (); int main () { return __pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 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 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 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 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 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 "* ) ;; *) 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gettimeofday (); int main () { return gettimeofday (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (); int main () { return inet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { as_var=$as_ac_var; eval "test \"\${$as_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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 #-------------------------------------------------------------------- # 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 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. #-------------------------------------------------------------------- cat >>confdefs.h <<\_ACEOF #define USE_TCL_STUBS 1 _ACEOF #-------------------------------------------------------------------- # 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 #-------------------------------------------------------------------- # On Mac OS X we may want to build as a framework. # This affects the location and naming of headers and libaries. #-------------------------------------------------------------------- # Check whether --enable-framework was given. if test "${enable_framework+set}" = set; then enableval=$enable_framework; tcl_ok=$enableval else tcl_ok=$1 fi #-------------------------------------------------------------------- # Load libxml2 configuration #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking for xml2-config script" >&5 echo $ECHO_N "checking for xml2-config script... $ECHO_C" >&6; } # Check whether --with-xml2-config was given. if test "${with_xml2_config+set}" = set; then withval=$with_xml2_config; with_xml2_config=${withval} fi LIBXML2_CONFIG= if test "x${with_xml2_config}" = "x" ; then for c in \ /Library/Frameworks/libxml.framework/Resources/Scripts/xml2-config \ ${prefix}/bin/xml2-config \ /usr/bin/xml2-config \ /usr/local/bin/xml2-config do if test -x "$c" ; then LIBXML2_CONFIG="$c" break fi done else LIBXML2_CONFIG="${with_xml2_config}" fi if test "x$LIBXML2_CONFIG" = "x" ; then { { echo "$as_me:$LINENO: error: unable to find xml2-config" >&5 echo "$as_me: error: unable to find xml2-config" >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: result: ${LIBXML2_CONFIG}" >&5 echo "${ECHO_T}${LIBXML2_CONFIG}" >&6; } XML2_VERSION=`${LIBXML2_CONFIG} --version` XML2_PREFIX=`${LIBXML2_CONFIG} --prefix` XML2_LIBS="`${LIBXML2_CONFIG} --libs`" XML2_CFLAGS=`${LIBXML2_CONFIG} --cflags` fi #-------------------------------------------------------------------- # Load libxslt configuration #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking for xslt-config script" >&5 echo $ECHO_N "checking for xslt-config script... $ECHO_C" >&6; } # Check whether --with-xslt-config was given. if test "${with_xslt_config+set}" = set; then withval=$with_xslt_config; with_xslt_config=${withval} fi LIBXSLT_CONFIG= if test "x${with_xslt_config}" = "x" ; then if test "x${with_xml2_config}" = "x" ; then : else if test -x "`dirname ${with_xml2_config}`/xslt-config" ; then LIBXSLT_CONFIG="`dirname ${with_xml2_config}`/xslt-config" fi fi else LIBXSLT_CONFIG="${with_xslt_config}" fi if test "x${LIBXSLT_CONFIG}" = "x" ; then for c in \ /Library/Frameworks/libxslt.framework/Resources/Scripts/xslt-config \ ${prefix}/bin/xslt-config \ /usr/bin/xslt-config \ /usr/local/bin/xslt-config do if test -x "$c" ; then LIBXSLT_CONFIG="$c" break fi done fi if test "x$LIBXSLT_CONFIG" = "x" ; then { { echo "$as_me:$LINENO: error: unable to find xslt-config script" >&5 echo "$as_me: error: unable to find xslt-config script" >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: result: ${LIBXSLT_CONFIG}" >&5 echo "${ECHO_T}${LIBXSLT_CONFIG}" >&6; } XSLT_VERSION=`${LIBXSLT_CONFIG} --version` XSLT_PREFIX=`${LIBXSLT_CONFIG} --prefix` XSLT_CFLAGS=`${LIBXSLT_CONFIG} --cflags` XSLT_LIBS="`${LIBXSLT_CONFIG} --libs` -lexslt" fi #-------------------------------------------------------------------- # See if we want to statically link the libxml2 and libxslt # libraries. This is desirable for Tclkit. #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking for static linking of XML/XSLT libraries" >&5 echo $ECHO_N "checking for static linking of XML/XSLT libraries... $ECHO_C" >&6; } # Check whether --with-xml-static was given. if test "${with_xml_static+set}" = set; then withval=$with_xml_static; with_xml_static=${withval} fi XML_STATIC="0" if test "${with_xml_static}" = "1" ; then XML_STATIC="1" { echo "$as_me:$LINENO: result: use static linking" >&5 echo "${ECHO_T}use static linking" >&6; } else { echo "$as_me:$LINENO: result: use dynamic linking" >&5 echo "${ECHO_T}use dynamic linking" >&6; } fi #-------------------------------------------------------------------- # __CHANGE__ # Add platform libs to LIBS or SHLIB_LD_LIBS as necessary. #-------------------------------------------------------------------- FIX_LIB=":" if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${LIBXSLT_LIBDIR}/libxslt.lib`\"" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${LIBXSLT_LIBDIR}/libexslt.lib`\"" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${LIBXML2_LIBDIR}/libxml2.lib`\"" else if test "${XML_STATIC}" = "0" ; then echo "setting up dynamic linking" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \${XSLT_LIBS}" else SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${XSLT_PREFIX}/lib/libexslt.a" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${XSLT_PREFIX}/lib/libxslt.a" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${XML2_PREFIX}/lib/libxml2.a" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -L/usr/lib -lgcrypt -lgpg-error -lz -lm" XML2_LIBS= XSLT_LIBS= FIX_LIB="chcon -t texrel_shlib_t" fi fi # Enabling static linking modifies the setting of the libraries, # so delay substitution until this point. #-------------------------------------------------------------------- # 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; } #-------------------------------------------------------------------- # These are for tclxmlConfig.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 Tclxml_LIB_FLAG="-l${PACKAGE_NAME}${PACKAGE_VERSION}${DBGX}" else eval Tclxml_LIB_FLAG="-l${PACKAGE_NAME}`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}" fi Tclxml_BUILD_LIB_SPEC="-L`pwd` ${Tclxml_LIB_FLAG}" Tclxml_LIB_SPEC="-L${pkglibdir} ${Tclxml_LIB_FLAG}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval Tclxml_STUB_LIB_FLAG="-l${PACKAGE_NAME}stub${PACKAGE_VERSION}${DBGX}" else eval Tclxml_STUB_LIB_FLAG="-l${PACKAGE_NAME}stub`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}" fi Tclxml_BUILD_STUB_LIB_SPEC="-L`pwd` ${Tclxml_STUB_LIB_FLAG}" Tclxml_STUB_LIB_SPEC="-L${pkglibdir} ${Tclxml_STUB_LIB_FLAG}" Tclxml_BUILD_STUB_LIB_PATH="`pwd`/${Tclxmlstub_LIB_FILE}" Tclxml_STUB_LIB_PATH="${pkglibdir}/${Tclxmlstub_LIB_FILE}" eval pkgincludedir="${includedir}" Tclxml_INCLUDE_SPEC="-I${pkgincludedir}" #-------------------------------------------------------------------- # TODO: search for an appropriate xsltproc to use #-------------------------------------------------------------------- XSLTPROC=xsltproc #-------------------------------------------------------------------- # 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 Makefile.macosx pkgIndex.tcl TclxmlConfig.sh include/tclxml/tclxml.h doc/tclxml.xml doc/tcldom.xml doc/tclxslt.xml doc/README.xml" 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end 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 "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' # 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 branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` 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_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # 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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done 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) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' 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$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by Tclxml $as_me 3.3, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF 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 and configuration settings, 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="\\ Tclxml config.status 3.3 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' 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 ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { 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" ac_need_defaults=false ;; 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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Makefile.macosx") CONFIG_FILES="$CONFIG_FILES Makefile.macosx" ;; "pkgIndex.tcl") CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; "TclxmlConfig.sh") CONFIG_FILES="$CONFIG_FILES TclxmlConfig.sh" ;; "include/tclxml/tclxml.h") CONFIG_FILES="$CONFIG_FILES include/tclxml/tclxml.h" ;; "doc/tclxml.xml") CONFIG_FILES="$CONFIG_FILES doc/tclxml.xml" ;; "doc/tcldom.xml") CONFIG_FILES="$CONFIG_FILES doc/tcldom.xml" ;; "doc/tclxslt.xml") CONFIG_FILES="$CONFIG_FILES doc/tclxslt.xml" ;; "doc/README.xml") CONFIG_FILES="$CONFIG_FILES doc/README.xml" ;; *) { { 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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for 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 _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CYGPATH!$CYGPATH$ac_delim EXEEXT!$EXEEXT$ac_delim PKG_LIB_FILE!$PKG_LIB_FILE$ac_delim PKG_STUB_LIB_FILE!$PKG_STUB_LIB_FILE$ac_delim PKG_STUB_SOURCES!$PKG_STUB_SOURCES$ac_delim PKG_STUB_OBJECTS!$PKG_STUB_OBJECTS$ac_delim PKG_TCL_SOURCES!$PKG_TCL_SOURCES$ac_delim PKG_HEADERS!$PKG_HEADERS$ac_delim PKG_INCLUDES!$PKG_INCLUDES$ac_delim PKG_LIBS!$PKG_LIBS$ac_delim PKG_CFLAGS!$PKG_CFLAGS$ac_delim TCL_VERSION!$TCL_VERSION$ac_delim TCL_BIN_DIR!$TCL_BIN_DIR$ac_delim TCL_SRC_DIR!$TCL_SRC_DIR$ac_delim TCL_LIB_FILE!$TCL_LIB_FILE$ac_delim TCL_LIB_FLAG!$TCL_LIB_FLAG$ac_delim TCL_LIB_SPEC!$TCL_LIB_SPEC$ac_delim TCL_STUB_LIB_FILE!$TCL_STUB_LIB_FILE$ac_delim TCL_STUB_LIB_FLAG!$TCL_STUB_LIB_FLAG$ac_delim TCL_STUB_LIB_SPEC!$TCL_STUB_LIB_SPEC$ac_delim TCL_LIBS!$TCL_LIBS$ac_delim TCL_DEFS!$TCL_DEFS$ac_delim TCL_EXTRA_CFLAGS!$TCL_EXTRA_CFLAGS$ac_delim TCL_LD_FLAGS!$TCL_LD_FLAGS$ac_delim TCL_SHLIB_LD_LIBS!$TCL_SHLIB_LD_LIBS$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim SET_MAKE!$SET_MAKE$ac_delim RANLIB!$RANLIB$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim MATH_LIBS!$MATH_LIBS$ac_delim PKG_SOURCES!$PKG_SOURCES$ac_delim PKG_OBJECTS!$PKG_OBJECTS$ac_delim CLEANFILES!$CLEANFILES$ac_delim TCL_INCLUDES!$TCL_INCLUDES$ac_delim TCL_THREADS!$TCL_THREADS$ac_delim SHARED_BUILD!$SHARED_BUILD$ac_delim AR!$AR$ac_delim CELIB_DIR!$CELIB_DIR$ac_delim LIBOBJS!$LIBOBJS$ac_delim DL_LIBS!$DL_LIBS$ac_delim CFLAGS_DEBUG!$CFLAGS_DEBUG$ac_delim CFLAGS_OPTIMIZE!$CFLAGS_OPTIMIZE$ac_delim CFLAGS_WARNING!$CFLAGS_WARNING$ac_delim STLIB_LD!$STLIB_LD$ac_delim SHLIB_LD!$SHLIB_LD$ac_delim SHLIB_LD_LIBS!$SHLIB_LD_LIBS$ac_delim SHLIB_CFLAGS!$SHLIB_CFLAGS$ac_delim LD_LIBRARY_PATH_VAR!$LD_LIBRARY_PATH_VAR$ac_delim TCL_DBGX!$TCL_DBGX$ac_delim CFLAGS_DEFAULT!$CFLAGS_DEFAULT$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF LDFLAGS_DEFAULT!$LDFLAGS_DEFAULT$ac_delim MAKE_LIB!$MAKE_LIB$ac_delim MAKE_SHARED_LIB!$MAKE_SHARED_LIB$ac_delim MAKE_STATIC_LIB!$MAKE_STATIC_LIB$ac_delim MAKE_STUB_LIB!$MAKE_STUB_LIB$ac_delim RANLIB_STUB!$RANLIB_STUB$ac_delim XML2_PREFIX!$XML2_PREFIX$ac_delim XML2_CFLAGS!$XML2_CFLAGS$ac_delim XML2_VERSION!$XML2_VERSION$ac_delim XSLT_VERSION!$XSLT_VERSION$ac_delim XSLT_PREFIX!$XSLT_PREFIX$ac_delim XSLT_CFLAGS!$XSLT_CFLAGS$ac_delim XML_STATIC!$XML_STATIC$ac_delim XML2_LIBS!$XML2_LIBS$ac_delim XSLT_LIBS!$XSLT_LIBS$ac_delim FIX_LIB!$FIX_LIB$ac_delim TCLSH_PROG!$TCLSH_PROG$ac_delim Tclxml_BUILD_LIB_SPEC!$Tclxml_BUILD_LIB_SPEC$ac_delim Tclxml_LIB_SPEC!$Tclxml_LIB_SPEC$ac_delim Tclxml_BUILD_STUB_LIB_SPEC!$Tclxml_BUILD_STUB_LIB_SPEC$ac_delim Tclxml_STUB_LIB_SPEC!$Tclxml_STUB_LIB_SPEC$ac_delim Tclxml_BUILD_STUB_LIB_PATH!$Tclxml_BUILD_STUB_LIB_PATH$ac_delim Tclxml_STUB_LIB_PATH!$Tclxml_STUB_LIB_PATH$ac_delim Tclxml_INCLUDE_SPEC!$Tclxml_INCLUDE_SPEC$ac_delim XSLTPROC!$XSLTPROC$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 26; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # 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 cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # 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. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $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'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $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'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? 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&@top_builddir@&$ac_top_builddir_sub&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (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 #-------------------------------------------------------------------- tclxml-3.3~svn11.orig/tclxmlStubInit.c0000644000000000000000000000355611113705304016543 0ustar rootroot/* * tclxmlStubInit.c -- */ #include /* * Remove macros that will interfere with the definitions below. */ /* * WARNING: The contents of this file is automatically generated by the * genStubs.tcl script. Any modifications to the function declarations * below should be made in the tclxml.decls script. */ /* !BEGIN!: Do not edit below this line. */ TclxmlStubs tclxmlStubs = { TCL_STUB_MAGIC, NULL, Tclxml_Init, /* 0 */ Tclxml_SafeInit, /* 1 */ TclXML_RegisterXMLParser, /* 2 */ TclXML_RegisterElementStartProc, /* 3 */ TclXML_RegisterElementEndProc, /* 4 */ TclXML_RegisterCharacterDataProc, /* 5 */ TclXML_RegisterPIProc, /* 6 */ TclXML_RegisterDefaultProc, /* 7 */ TclXML_RegisterUnparsedProc, /* 8 */ TclXML_RegisterNotationDeclProc, /* 9 */ TclXML_RegisterEntityProc, /* 10 */ TclXML_RegisterUnknownEncodingProc, /* 11 */ TclXML_RegisterCommentProc, /* 12 */ TclXML_RegisterNotStandaloneProc, /* 13 */ TclXML_RegisterElementDeclProc, /* 14 */ TclXML_RegisterAttListDeclProc, /* 15 */ TclXML_RegisterStartDoctypeDeclProc, /* 16 */ TclXML_RegisterEndDoctypeDeclProc, /* 17 */ TclXML_ElementStartHandler, /* 18 */ TclXML_ElementEndHandler, /* 19 */ TclXML_CharacterDataHandler, /* 20 */ TclXML_ProcessingInstructionHandler, /* 21 */ TclXML_ExternalEntityRefHandler, /* 22 */ TclXML_DefaultHandler, /* 23 */ TclXML_UnparsedDeclHandler, /* 24 */ TclXML_NotationDeclHandler, /* 25 */ TclXML_UnknownEncodingHandler, /* 26 */ TclXML_CommentHandler, /* 27 */ TclXML_NotStandaloneHandler, /* 28 */ NULL, /* 29 */ NULL, /* 30 */ TclXML_ElementDeclHandler, /* 31 */ TclXML_AttlistDeclHandler, /* 32 */ TclXML_StartDoctypeDeclHandler, /* 33 */ TclXML_EndDoctypeDeclHandler, /* 34 */ }; /* !END!: Do not edit above this line. */ tclxml-3.3~svn11.orig/Makefile.macosx0000644000000000000000000000077511215700771016351 0ustar rootroot######################## # # Makefile to build TclXML/libxml2 for macosx. # # Usage: # cd tclxml-3.X # make -f Makefile.macosx # # $Id: Makefile.macosx,v 1.1 2005/05/20 12:04:19 balls Exp $ # ######################## PACKAGE_VERSION := 3.3 LIBXML2_VERSION := $(shell eval echo $$(ls -dt ../libxml2* | head -1 | sed -e '1s/.*\-//')) all: build build: cd macosx; xcodebuild -project tclxml.pbproj -target Make -buildstyle Deployment FRAMEWORK_VERSION=${PACKAGE_VERSION} LIBXML2_VERSION=${LIBXML2_VERSION} tclxml-3.3~svn11.orig/nodeObj.c0000644000000000000000000000231611113705304015127 0ustar rootroot/* nodeObj.c -- * * This module manages libxml2 xmlNodePtr Tcl objects. * * Copyright (c) 2007 Explain * http://www.explain.com.au/ * Copyright (c) 2003 Zveno Pty Ltd * http://www.zveno.com/ * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * $Id: nodeObj.c,v 1.3 2003/12/09 04:56:43 balls Exp $ */ #include #define TCL_DOES_STUBS \ (TCL_MAJOR_VERSION > 8 || TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION > 1 || \ (TCL_MINOR_VERSION == 1 && TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE))) #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT extern Tcl_ObjType NodeObjType; /* * For debugging */ extern Tcl_Channel stderrChan; extern char dbgbuf[200]; /* *---------------------------------------------------------------------------- * * TclDOM_libxml2_NodeObjInit -- * * Initialise node obj module. * * Results: * None. * * Side effects: * Registers new object type. * *---------------------------------------------------------------------------- */ int TclDOM_libxml2_NodeObjInit(interp) Tcl_Interp *interp; { Tcl_RegisterObjType(&NodeObjType); return TCL_OK; } tclxml-3.3~svn11.orig/tclxmlStubLib.c0000644000000000000000000000340711113705304016341 0ustar rootroot/* * tclxmlStubLib.c -- * * Stub object that will be statically linked into extensions that wish * to access the TCLXML API. * * Copyright (c) 1998 Paul Duffin. * Copyright (c) 1998-1999 by Scriptics Corporation. * Copyright (c) 2004 Zveno Pty Ltd. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id: tclxmlStubLib.c,v 1.3 2004/02/26 05:12:21 balls Exp $ */ #ifndef USE_TCL_STUBS #define USE_TCL_STUBS #endif #include TclxmlStubs *tclxmlStubsPtr; /* *---------------------------------------------------------------------- * * TclXML_InitStubs -- * * Checks that the correct version of Blt is loaded and that it * supports stubs. It then initialises the stub table pointers. * * Results: * The actual version of BLT that satisfies the request, or * NULL to indicate that an error occurred. * * Side effects: * Sets the stub table pointers. * *---------------------------------------------------------------------- */ CONST char * TclXML_InitStubs(interp, version, exact) Tcl_Interp *interp; CONST char *version; int exact; { CONST char *result; /* HACK: de-CONST 'version' if compiled against 8.3. * The API has no CONST despite not modifying the argument * And a debug build with high warning-level on windows * will abort the compilation. */ #if ((TCL_MAJOR_VERSION < 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 4))) #define UNCONST (char*) #else #define UNCONST #endif result = Tcl_PkgRequireEx(interp, "xml::c", UNCONST version, exact, (ClientData *) &tclxmlStubsPtr); if (!result || !tclxmlStubsPtr) { return (char *) NULL; } return result; } #undef UNCONST tclxml-3.3~svn11.orig/docObj.c0000644000000000000000000020144111215700771014755 0ustar rootroot/* docObj.c -- * * This module manages libxml2 xmlDocPtr Tcl objects. * * Copyright (c) 2005-2009 by Explain. * http://www.explain.com.au/ * Copyright (c) 2003-2004 Zveno Pty Ltd * http://www.zveno.com/ * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * $Id: docObj.c,v 1.8.2.1 2005/12/28 06:49:51 balls Exp $ */ #include #include #include #define TCL_DOES_STUBS \ (TCL_MAJOR_VERSION > 8 || TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION > 1 || \ (TCL_MINOR_VERSION == 1 && TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE))) #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT /* * Basic list for tracking Tcl_Obj's for a document. */ typedef struct ObjList { Tcl_Obj *objPtr; struct ObjList *next; } ObjList; /* * Prototypes for procedures defined later in this file: */ static void DestroyTclDoc _ANSI_ARGS_((TclXML_libxml2_Document *tDocPtr)); Tcl_FreeInternalRepProc TclXMLlibxml2_DocFree; Tcl_DupInternalRepProc TclXMLlibxml2_DocDup; Tcl_UpdateStringProc TclXMLlibxml2_DocUpdate; Tcl_SetFromAnyProc TclXMLlibxml2_DocSetFromAny; Tcl_ObjType TclXMLlibxml2_DocObjType = { "libxml2-doc", TclXMLlibxml2_DocFree, TclXMLlibxml2_DocDup, TclXMLlibxml2_DocUpdate, TclXMLlibxml2_DocSetFromAny }; typedef struct ThreadSpecificData { int initialized; /* * Hash table for mapping string rep to doc structure. */ Tcl_HashTable *documents; int docCntr; /* * Hash table for tracking doc objects. */ Tcl_HashTable *docByPtr; /* * Structured error handling */ TclXML_ErrorInfo *errorInfoPtr; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * libxml2 is mostly thread-safe, but just-in-case use a mutex to control access. */ TCL_DECLARE_MUTEX(libxml2) /* *---------------------------------------------------------------------------- * * TclXML_libxml2_InitDocObj -- * * Initialise this module. * * Results: * Returns success code * * Side effects: * Memory may be allocated * *---------------------------------------------------------------------------- */ int TclXML_libxml2_InitDocObj(interp) Tcl_Interp *interp; { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); tsdPtr->initialized = 1; tsdPtr->documents = (Tcl_HashTable *) Tcl_Alloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(tsdPtr->documents, TCL_STRING_KEYS); tsdPtr->docByPtr = (Tcl_HashTable *) Tcl_Alloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(tsdPtr->docByPtr, TCL_ONE_WORD_KEYS); tsdPtr->docCntr = 0; /* * Setup an error handler that stores structured error info */ tsdPtr->errorInfoPtr = (TclXML_ErrorInfo *) Tcl_Alloc(sizeof(TclXML_ErrorInfo)); tsdPtr->errorInfoPtr->interp = interp; tsdPtr->errorInfoPtr->listPtr = NULL; tsdPtr->errorInfoPtr->nodeHandlerProc = NULL; xmlSetStructuredErrorFunc((void *) tsdPtr->errorInfoPtr, TclXML_libxml2_ErrorHandler); return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXML_libxml2_NewDocObj -- * * Creates a new xmlDocPtr and wraps it in a Tcl_Obj. * * Results: * Returns a *TclObj * * Side effects: * Objects allocated. * *---------------------------------------------------------------------------- */ Tcl_Obj * TclXML_libxml2_NewDocObj(interp) Tcl_Interp *interp; { xmlDocPtr new; Tcl_MutexLock(&libxml2); new = xmlNewDoc((const xmlChar *) "1.0"); Tcl_MutexUnlock(&libxml2); if (!new) { Tcl_SetResult(interp, "unable to create document", NULL); return NULL; } return TclXML_libxml2_CreateObjFromDoc(new); } /* *---------------------------------------------------------------------------- * * TclXML_libxml2_CreateObjFromDoc -- * * Create a Tcl_Obj to wrap a xmlDocPtr. * * Results: * Returns Tcl_Obj*. * * Side effects: * Allocates object. * *---------------------------------------------------------------------------- */ Tcl_Obj * ImportDoc (docPtr, tDocPtrPtr) xmlDocPtr docPtr; TclXML_libxml2_Document **tDocPtrPtr; { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); TclXML_libxml2_Document *tDocPtr; Tcl_HashEntry *entryPtr; Tcl_Obj *objPtr; ObjList *listPtr; /* * This xmlDocPtr may already have been wrapped by a Tcl object. * If so, return an already existing wrapper. * If not, create a new wrapper. */ entryPtr = Tcl_FindHashEntry(tsdPtr->docByPtr, (ClientData) docPtr); if (entryPtr) { tDocPtr = (TclXML_libxml2_Document *) Tcl_GetHashValue(entryPtr); if (tDocPtr->objs) { /* The first object is sufficient */ listPtr = (ObjList *) tDocPtr->objs; objPtr = listPtr->objPtr; } else { /* Create a new Tcl_Obj to refer to existing structure */ objPtr = Tcl_NewObj(); listPtr = (ObjList *) Tcl_Alloc(sizeof(ObjList)); listPtr->objPtr = objPtr; listPtr->next = NULL; tDocPtr->objs = (void *) listPtr; objPtr->length = strlen(tDocPtr->token); objPtr->bytes = Tcl_Alloc(objPtr->length + 1); strcpy(objPtr->bytes, tDocPtr->token); objPtr->internalRep.twoPtrValue.ptr1 = (void *) tDocPtr; objPtr->internalRep.twoPtrValue.ptr2 = NULL; objPtr->typePtr = &TclXMLlibxml2_DocObjType; } } else { int new; objPtr = Tcl_NewObj(); tDocPtr = (TclXML_libxml2_Document *) Tcl_Alloc(sizeof(TclXML_libxml2_Document)); tDocPtr->docPtr = docPtr; tDocPtr->token = Tcl_Alloc(20); sprintf(tDocPtr->token, "doc%d", tsdPtr->docCntr++); tDocPtr->keep = TCLXML_LIBXML2_DOCUMENT_IMPLICIT; tDocPtr->dom = NULL; tDocPtr->domfree = NULL; tDocPtr->apphook = NULL; tDocPtr->appfree = NULL; listPtr = (ObjList *) Tcl_Alloc(sizeof(ObjList)); listPtr->objPtr = objPtr; listPtr->next = NULL; tDocPtr->objs = (void *) listPtr; entryPtr = Tcl_CreateHashEntry(tsdPtr->documents, tDocPtr->token, &new); Tcl_SetHashValue(entryPtr, (ClientData) tDocPtr); entryPtr = Tcl_CreateHashEntry(tsdPtr->docByPtr, (ClientData) docPtr, &new); Tcl_SetHashValue(entryPtr, (ClientData) tDocPtr); objPtr->length = strlen(tDocPtr->token); objPtr->bytes = Tcl_Alloc(objPtr->length + 1); strcpy(objPtr->bytes, tDocPtr->token); objPtr->internalRep.twoPtrValue.ptr1 = (void *) tDocPtr; objPtr->internalRep.twoPtrValue.ptr2 = NULL; objPtr->typePtr = &TclXMLlibxml2_DocObjType; } /* Bug fix #1032660. David Welton. */ Tcl_IncrRefCount(objPtr); if (tDocPtrPtr != NULL) { *tDocPtrPtr = tDocPtr; } return objPtr; } Tcl_Obj * TclXML_libxml2_CreateObjFromDoc (docPtr) xmlDocPtr docPtr; { return ImportDoc(docPtr, NULL); } TclXML_libxml2_Document * TclXML_libxml2_NewDoc (docPtr) xmlDocPtr docPtr; { Tcl_Obj *objPtr; TclXML_libxml2_Document *tDocPtr; objPtr = ImportDoc(docPtr, &tDocPtr); return tDocPtr; } /* *---------------------------------------------------------------------------- * * TclXML_libxml2_GetDocFromObj -- * * Retrieve the xmlDocPtr from a Tcl object. * * Results: * Returns success code. * * Side effects: * May set internal rep of object. * *---------------------------------------------------------------------------- */ int TclXML_libxml2_GetDocFromObj (interp, objPtr, docPtr) Tcl_Interp *interp; Tcl_Obj *objPtr; xmlDocPtr *docPtr; { TclXML_libxml2_Document *tDocPtr; if (TclXML_libxml2_GetTclDocFromObj(interp, objPtr, &tDocPtr) != TCL_OK) { return TCL_ERROR; } *docPtr = tDocPtr->docPtr; return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXML_libxml2_GetTclDocFromNode -- * * Retrieve a pointer to the TclXML Doc structure from a xmlNodePtr. * * Results: * Returns success code. * * Side effects: * Sets pointer * *---------------------------------------------------------------------------- */ int TclXML_libxml2_GetTclDocFromNode (interp, nodePtr, tDocPtrPtr) Tcl_Interp *interp; xmlNodePtr nodePtr; TclXML_libxml2_Document **tDocPtrPtr; { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr; entryPtr = Tcl_FindHashEntry(tsdPtr->docByPtr, (ClientData) nodePtr->doc); if (!entryPtr) { /* We haven't seen this doc before - probably a RVT */ *tDocPtrPtr = TclXML_libxml2_NewDoc(nodePtr->doc); return TCL_OK; } *tDocPtrPtr = (TclXML_libxml2_Document *) Tcl_GetHashValue(entryPtr); return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXML_libxml2_GetTclDocFromObj -- * * Retrieve the TclXML_libxml2_Document from a Tcl object. * * Results: * Returns success code. * * Side effects: * May set internal rep of object. * *---------------------------------------------------------------------------- */ int TclXML_libxml2_GetTclDocFromObj (interp, objPtr, tDocPtr) Tcl_Interp *interp; Tcl_Obj *objPtr; TclXML_libxml2_Document **tDocPtr; { if (objPtr->typePtr == &TclXMLlibxml2_DocObjType) { *tDocPtr = (TclXML_libxml2_Document *) objPtr->internalRep.twoPtrValue.ptr1; } else if (TclXMLlibxml2_DocSetFromAny(interp, objPtr) == TCL_OK) { *tDocPtr = (TclXML_libxml2_Document *) objPtr->internalRep.twoPtrValue.ptr1; } else { return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXML_libxml2_GetTclDocFromDoc -- * * Retrieve the TclXML_libxml2_Document from a xmlDocPtr. * * Results: * Returns success code. * * Side effects: * Sets pointer. * *---------------------------------------------------------------------------- */ int TclXML_libxml2_GetTclDocFromDoc (interp, docPtr, tDocPtrPtr) Tcl_Interp *interp; xmlDocPtr docPtr; TclXML_libxml2_Document **tDocPtrPtr; { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr; entryPtr = Tcl_FindHashEntry(tsdPtr->docByPtr, (ClientData) docPtr); if (!entryPtr) { *tDocPtrPtr = NULL; Tcl_SetResult(interp, "document not known", NULL); return TCL_ERROR; } *tDocPtrPtr = (TclXML_libxml2_Document *) Tcl_GetHashValue(entryPtr); return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXML_libxml2_DestroyDocument -- * * Manage destruction of a document. * The trick here is to make sure that all Tcl_Obj's * that reference this document have their internal rep * invalidated. * * Results: * None. * * Side effects: * Memory deallocated, object internal reps changed. * *---------------------------------------------------------------------------- */ void TclXML_libxml2_DestroyDocument (tDocPtr) TclXML_libxml2_Document *tDocPtr; { ObjList *listPtr = (ObjList *) tDocPtr->objs; ObjList *next; /* * Invalidate the internal representation of all Tcl_Obj's * that refer to this document. */ while (listPtr) { next = listPtr->next; TclXMLlibxml2_DocFree(listPtr->objPtr); listPtr = next; } if (tDocPtr->keep == TCLXML_LIBXML2_DOCUMENT_KEEP) { DestroyTclDoc(tDocPtr); } } /* *---------------------------------------------------------------------------- * * TclXML_libxml2_DocKeep -- * * Changes how the document's destruction is handled. * * Results: * None. * * Side effects: * Changes document configuration. * *---------------------------------------------------------------------------- */ void TclXML_libxml2_DocKeep(objPtr, keep) Tcl_Obj *objPtr; TclXML_libxml2_DocumentHandling keep; { TclXML_libxml2_Document *tDocPtr; if (TclXML_libxml2_GetTclDocFromObj(NULL, objPtr, &tDocPtr) != TCL_OK) { return; } tDocPtr->keep = keep; } /* *---------------------------------------------------------------------------- * * TclXML_libxml2_GetBaseURIFromDoc -- * * Returns the base URI of a document. * * Results: * Returns Tcl object. * *---------------------------------------------------------------------------- */ Tcl_Obj * TclXML_libxml2_GetBaseURIFromDoc(docPtr) xmlDocPtr docPtr; { return Tcl_NewStringObj((char *) docPtr->URL, -1); } /* *---------------------------------------------------------------------------- * * TclXML_libxml2_SetBaseURI -- * * Sets the base URI of a document. * * Results: * Returns success code. * * Side effects: * Changes the xml document's URL. * *---------------------------------------------------------------------------- */ int TclXML_libxml2_SetBaseURI(interp, docPtr, uriObj) Tcl_Interp *interp; xmlDocPtr docPtr; Tcl_Obj *uriObj; { char *url; int len; if (docPtr == NULL) { Tcl_SetResult(interp, "no document", NULL); return TCL_ERROR; } if (uriObj == NULL) { Tcl_SetResult(interp, "no URL", NULL); return TCL_ERROR; } if (docPtr->URL) { xmlFree((xmlChar *) docPtr->URL); } url = Tcl_GetStringFromObj(uriObj, &len); docPtr->URL = xmlCharStrndup(url, len); return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXMLlibxml2_DocSetFromAny -- * * Finds the xmlDocPtr wrapper for a Tcl object. * * Results: * Returns success code. * * Side effects: * Changes the Tcl_Obj's internal rep. * *---------------------------------------------------------------------------- */ int TclXMLlibxml2_DocSetFromAny(interp, objPtr) Tcl_Interp *interp; Tcl_Obj *objPtr; { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr; TclXML_libxml2_Document *tDocPtr; ObjList *listPtr; entryPtr = Tcl_FindHashEntry(tsdPtr->documents, Tcl_GetStringFromObj(objPtr, NULL)); if (entryPtr) { if (objPtr->typePtr != NULL && objPtr->typePtr->freeIntRepProc != NULL) { objPtr->typePtr->freeIntRepProc(objPtr); } objPtr->internalRep.twoPtrValue.ptr1 = Tcl_GetHashValue(entryPtr); objPtr->typePtr = &TclXMLlibxml2_DocObjType; tDocPtr = (TclXML_libxml2_Document *) objPtr->internalRep.twoPtrValue.ptr1; /* * Add this object to the Tcl_Obj list. * NB. There should be no duplicates. */ listPtr = (ObjList *) tDocPtr->objs; if (listPtr == NULL) { listPtr = (ObjList *) Tcl_Alloc(sizeof(ObjList)); listPtr->objPtr = objPtr; listPtr->next = NULL; tDocPtr->objs = listPtr; } else { ObjList *newPtr; newPtr = (ObjList *) Tcl_Alloc(sizeof(ObjList)); newPtr->objPtr = objPtr; newPtr->next = listPtr; tDocPtr->objs = (void *) newPtr; } /* SANITY CHECK NEEDED: no duplicates in the list */ } else { if (interp) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "token \"", Tcl_GetStringFromObj(objPtr, NULL), "\" is not a libxml2 document", NULL); } return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * TclXMLlibxml2_DocUpdate -- * * Finds the token for a xmlDocPtr wrapper. * * Results: * None. * * Side effects: * Changes the Tcl_Obj's string rep. * *---------------------------------------------------------------------------- */ void TclXMLlibxml2_DocUpdate(objPtr) Tcl_Obj *objPtr; { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr; entryPtr = Tcl_FindHashEntry(tsdPtr->docByPtr, objPtr->internalRep.twoPtrValue.ptr1); Tcl_InvalidateStringRep(objPtr); if (entryPtr != NULL) { TclXML_libxml2_Document *tDocPtr = (TclXML_libxml2_Document *) Tcl_GetHashValue(entryPtr); objPtr->length = strlen(tDocPtr->token); objPtr->bytes = Tcl_Alloc(objPtr->length + 1); strcpy(objPtr->bytes, tDocPtr->token); } } /* *---------------------------------------------------------------------------- * * TclXMLlibxml2_DocDup -- * * Duplicates the Tcl wrapper. * NB. This does *not* copy the document itself - it simply creates * another reference to the same document. * * Results: * None. * * Side effects: * Changes the target Tcl_Obj. * *---------------------------------------------------------------------------- */ void TclXMLlibxml2_DocDup(srcPtr, dstPtr) Tcl_Obj *srcPtr; Tcl_Obj *dstPtr; { TclXML_libxml2_Document *tDocPtr; ObjList *listPtr; if (dstPtr->typePtr != NULL && dstPtr->typePtr->freeIntRepProc != NULL) { dstPtr->typePtr->freeIntRepProc(dstPtr); } tDocPtr = (TclXML_libxml2_Document *) srcPtr->internalRep.twoPtrValue.ptr1; listPtr = (ObjList *) Tcl_Alloc(sizeof(ObjList)); listPtr->objPtr = dstPtr; listPtr->next = ((ObjList *) tDocPtr->objs)->next; tDocPtr->objs = listPtr; Tcl_InvalidateStringRep(dstPtr); dstPtr->internalRep.twoPtrValue.ptr1 = srcPtr->internalRep.twoPtrValue.ptr1; dstPtr->internalRep.twoPtrValue.ptr2 = NULL; dstPtr->typePtr = srcPtr->typePtr; } /* *---------------------------------------------------------------------------- * * TclXMLlibxml2_DocFree -- * * Removes a Tcl wrapper to a libxml2 document. * * Results: * None. * * Side effects: * May free the document. * *---------------------------------------------------------------------------- */ void TclXMLlibxml2_DocFree(objPtr) Tcl_Obj *objPtr; { TclXML_libxml2_Document *tDocPtr = (TclXML_libxml2_Document *) objPtr->internalRep.twoPtrValue.ptr1; ObjList *listPtr = tDocPtr->objs; ObjList *prevPtr = NULL; while (listPtr) { if (listPtr->objPtr == objPtr) { break; } prevPtr = listPtr; listPtr = listPtr->next; } if (listPtr == NULL) { /* internal error */ } else if (prevPtr == NULL) { tDocPtr->objs = listPtr->next; } else { prevPtr->next = listPtr->next; } Tcl_Free((char *) listPtr); if (tDocPtr->objs == NULL && tDocPtr->keep == TCLXML_LIBXML2_DOCUMENT_IMPLICIT) { DestroyTclDoc(tDocPtr); } objPtr->internalRep.twoPtrValue.ptr1 = NULL; objPtr->internalRep.twoPtrValue.ptr2 = NULL; objPtr->typePtr = NULL; } /* *---------------------------------------------------------------------------- * * DestroyTclDoc -- * * Destroy the Tcl wrapper for a document. * * Results: * None. * * Side effects: * Free memory. * *---------------------------------------------------------------------------- */ void DestroyTclDoc(tDocPtr) TclXML_libxml2_Document *tDocPtr; { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr; if (tDocPtr->domfree) { (tDocPtr->domfree)(tDocPtr->dom); } if (tDocPtr->appfree) { (tDocPtr->appfree)(tDocPtr->dom); } entryPtr = Tcl_FindHashEntry(tsdPtr->documents, tDocPtr->token); if (entryPtr) { Tcl_DeleteHashEntry(entryPtr); } else { /* Internal error */ } entryPtr = Tcl_FindHashEntry(tsdPtr->docByPtr, (ClientData) tDocPtr->docPtr); if (entryPtr) { Tcl_DeleteHashEntry(entryPtr); } else { /* Internal error */ } Tcl_MutexLock(&libxml2); xmlFreeDoc(tDocPtr->docPtr); Tcl_MutexUnlock(&libxml2); Tcl_Free(tDocPtr->token); Tcl_Free((char *) tDocPtr); } /* *---------------------------------------------------------------------------- * * TclXML_libxml2_ErrorHandler -- * * Handler for structured error reports * * Results: * None. * * Side effects: * Creates a Tcl_Obj to store the error information. * *---------------------------------------------------------------------------- */ static Tcl_Obj * ErrorDomainToString(domain) int domain; { switch ((xmlErrorDomain) domain) { case XML_FROM_NONE: return Tcl_NewStringObj("none", -1); case XML_FROM_PARSER: return Tcl_NewStringObj("parser", -1); case XML_FROM_TREE: return Tcl_NewStringObj("tree", -1); case XML_FROM_NAMESPACE: return Tcl_NewStringObj("namespace", -1); case XML_FROM_DTD: return Tcl_NewStringObj("dtd-validation", -1); case XML_FROM_HTML: return Tcl_NewStringObj("html-parser", -1); case XML_FROM_MEMORY: return Tcl_NewStringObj("memory", -1); case XML_FROM_OUTPUT: return Tcl_NewStringObj("output", -1); case XML_FROM_IO: return Tcl_NewStringObj("io", -1); case XML_FROM_FTP: return Tcl_NewStringObj("ftp", -1); case XML_FROM_HTTP: return Tcl_NewStringObj("http", -1); case XML_FROM_XINCLUDE: return Tcl_NewStringObj("XInclude", -1); case XML_FROM_XPOINTER: return Tcl_NewStringObj("XPointer", -1); case XML_FROM_REGEXP: return Tcl_NewStringObj("regexp", -1); case XML_FROM_DATATYPE: return Tcl_NewStringObj("schemas-datatype", -1); case XML_FROM_SCHEMASP: return Tcl_NewStringObj("schemas-parser", -1); case XML_FROM_SCHEMASV: return Tcl_NewStringObj("schemas-validation", -1); case XML_FROM_RELAXNGP: return Tcl_NewStringObj("relaxng-parser", -1); case XML_FROM_RELAXNGV: return Tcl_NewStringObj("relaxng-validation", -1); case XML_FROM_CATALOG: return Tcl_NewStringObj("catalog", -1); case XML_FROM_C14N: return Tcl_NewStringObj("canonicalization", -1); case XML_FROM_XSLT: return Tcl_NewStringObj("xslt", -1); default: return Tcl_NewObj(); } } static Tcl_Obj * ErrorLevelToString(level) xmlErrorLevel level; { switch (level) { case XML_ERR_WARNING: return Tcl_NewStringObj("warning", -1); case XML_ERR_ERROR: return Tcl_NewStringObj("error", -1); case XML_ERR_FATAL: return Tcl_NewStringObj("fatal", -1); case XML_ERR_NONE: default: return Tcl_NewStringObj("none", -1); } } static Tcl_Obj * ErrorCodeToString(code) int code; { switch ((xmlParserErrors) code) { case XML_ERR_OK: return Tcl_NewObj(); case XML_ERR_INTERNAL_ERROR: return Tcl_NewStringObj("internal-error", -1); case XML_ERR_NO_MEMORY: return Tcl_NewStringObj("no-memory", -1); case XML_ERR_DOCUMENT_START: return Tcl_NewStringObj("document-start", -1); case XML_ERR_DOCUMENT_EMPTY: return Tcl_NewStringObj("document-empty", -1); case XML_ERR_DOCUMENT_END: return Tcl_NewStringObj("document-end", -1); case XML_ERR_INVALID_HEX_CHARREF: return Tcl_NewStringObj("invalid-hex-character-reference", -1); case XML_ERR_INVALID_DEC_CHARREF: return Tcl_NewStringObj("invalid-decimal-character-reference", -1); case XML_ERR_INVALID_CHARREF: return Tcl_NewStringObj("invalid-character-reference", -1); case XML_ERR_INVALID_CHAR: return Tcl_NewStringObj("invalid-character", -1); case XML_ERR_CHARREF_AT_EOF: return Tcl_NewStringObj("character-reference-at-eof", -1); case XML_ERR_CHARREF_IN_PROLOG: return Tcl_NewStringObj("character-reference-in-prolog", -1); case XML_ERR_CHARREF_IN_EPILOG: return Tcl_NewStringObj("character-reference-in-epilog", -1); case XML_ERR_CHARREF_IN_DTD: return Tcl_NewStringObj("character-reference-in-dtd", -1); case XML_ERR_ENTITYREF_AT_EOF: return Tcl_NewStringObj("entity-reference-at-eof", -1); case XML_ERR_ENTITYREF_IN_PROLOG: return Tcl_NewStringObj("entity-reference-in-prolog", -1); case XML_ERR_ENTITYREF_IN_EPILOG: return Tcl_NewStringObj("entity-reference-in-epilog", -1); case XML_ERR_ENTITYREF_IN_DTD: return Tcl_NewStringObj("entity-reference-in-dtd", -1); case XML_ERR_PEREF_AT_EOF: return Tcl_NewStringObj("parameter-entity-reference-at-eof", -1); case XML_ERR_PEREF_IN_PROLOG: return Tcl_NewStringObj("parameter-entity-reference-in-prolog", -1); case XML_ERR_PEREF_IN_EPILOG: return Tcl_NewStringObj("parameter-entity-reference-in-epilog", -1); case XML_ERR_PEREF_IN_INT_SUBSET: return Tcl_NewStringObj("parameter-entity-reference-in-internal-subset", -1); case XML_ERR_ENTITYREF_NO_NAME: return Tcl_NewStringObj("entity-reference-no-name", -1); case XML_ERR_ENTITYREF_SEMICOL_MISSING: return Tcl_NewStringObj("entity-reference-semicolon-missing", -1); case XML_ERR_PEREF_NO_NAME: return Tcl_NewStringObj("parameter-entity-reference-no-name", -1); case XML_ERR_PEREF_SEMICOL_MISSING: return Tcl_NewStringObj("parameter-entity-reference-semicolon-missing", -1); case XML_ERR_UNDECLARED_ENTITY: return Tcl_NewStringObj("undeclared-entity", -1); case XML_WAR_UNDECLARED_ENTITY: return Tcl_NewStringObj("undeclared-entity", -1); case XML_ERR_UNPARSED_ENTITY: return Tcl_NewStringObj("unparsed-entity", -1); case XML_ERR_ENTITY_IS_EXTERNAL: return Tcl_NewStringObj("entity-is-external", -1); case XML_ERR_ENTITY_IS_PARAMETER: return Tcl_NewStringObj("entity-is-parameter", -1); case XML_ERR_UNKNOWN_ENCODING: return Tcl_NewStringObj("unknown-encoding", -1); case XML_ERR_UNSUPPORTED_ENCODING: return Tcl_NewStringObj("unsupported-encoding", -1); case XML_ERR_STRING_NOT_STARTED: return Tcl_NewStringObj("string-not-started", -1); case XML_ERR_STRING_NOT_CLOSED: return Tcl_NewStringObj("string-not-closed", -1); case XML_ERR_NS_DECL_ERROR: return Tcl_NewStringObj("namespace-declaration-error", -1); case XML_ERR_ENTITY_NOT_STARTED: return Tcl_NewStringObj("entity-not-started", -1); case XML_ERR_ENTITY_NOT_FINISHED: return Tcl_NewStringObj("entity-not-finished", -1); case XML_ERR_LT_IN_ATTRIBUTE: return Tcl_NewStringObj("less-than-character-in-attribute", -1); case XML_ERR_ATTRIBUTE_NOT_STARTED: return Tcl_NewStringObj("attribute-not-started", -1); case XML_ERR_ATTRIBUTE_NOT_FINISHED: return Tcl_NewStringObj("attribute-not-finished", -1); case XML_ERR_ATTRIBUTE_WITHOUT_VALUE: return Tcl_NewStringObj("attribute-without-value", -1); case XML_ERR_ATTRIBUTE_REDEFINED: return Tcl_NewStringObj("attribute-redefined", -1); case XML_ERR_LITERAL_NOT_STARTED: return Tcl_NewStringObj("literal-not-started", -1); case XML_ERR_LITERAL_NOT_FINISHED: return Tcl_NewStringObj("literal-not-finished", -1); case XML_ERR_COMMENT_NOT_FINISHED: return Tcl_NewStringObj("comment-not-finished", -1); case XML_ERR_PI_NOT_STARTED: return Tcl_NewStringObj("processing-instruction-not-started", -1); case XML_ERR_PI_NOT_FINISHED: return Tcl_NewStringObj("processing-instruction-not-finished", -1); case XML_ERR_NOTATION_NOT_STARTED: return Tcl_NewStringObj("notation-not-started", -1); case XML_ERR_NOTATION_NOT_FINISHED: return Tcl_NewStringObj("notation-not-finished", -1); case XML_ERR_ATTLIST_NOT_STARTED: return Tcl_NewStringObj("attribute-list-not-started", -1); case XML_ERR_ATTLIST_NOT_FINISHED: return Tcl_NewStringObj("attribute-list-not-finished", -1); case XML_ERR_MIXED_NOT_STARTED: return Tcl_NewStringObj("mixed-content-not-started", -1); case XML_ERR_MIXED_NOT_FINISHED: return Tcl_NewStringObj("mixed-content-not-finished", -1); case XML_ERR_ELEMCONTENT_NOT_STARTED: return Tcl_NewStringObj("element-content-not-started", -1); case XML_ERR_ELEMCONTENT_NOT_FINISHED: return Tcl_NewStringObj("element-content-not-finished", -1); case XML_ERR_XMLDECL_NOT_STARTED: return Tcl_NewStringObj("xml-declaration-not-started", -1); case XML_ERR_XMLDECL_NOT_FINISHED: return Tcl_NewStringObj("xml-declaration-not-finished", -1); case XML_ERR_CONDSEC_NOT_STARTED: return Tcl_NewStringObj("conditional-section-not-started", -1); case XML_ERR_CONDSEC_NOT_FINISHED: return Tcl_NewStringObj("conditional-section-not-finished", -1); case XML_ERR_EXT_SUBSET_NOT_FINISHED: return Tcl_NewStringObj("external-dtd-subset-not-finished", -1); case XML_ERR_DOCTYPE_NOT_FINISHED: return Tcl_NewStringObj("document-type-declaration-not-finished", -1); case XML_ERR_MISPLACED_CDATA_END: return Tcl_NewStringObj("misplaced-cdata-section-end", -1); case XML_ERR_CDATA_NOT_FINISHED: return Tcl_NewStringObj("cdata-section-not-finished", -1); case XML_ERR_RESERVED_XML_NAME: return Tcl_NewStringObj("reserved-xml-name", -1); case XML_ERR_SPACE_REQUIRED: return Tcl_NewStringObj("space-required", -1); case XML_ERR_SEPARATOR_REQUIRED: return Tcl_NewStringObj("separator-required", -1); case XML_ERR_NMTOKEN_REQUIRED: return Tcl_NewStringObj("NMTOKEN-required", -1); case XML_ERR_NAME_REQUIRED: return Tcl_NewStringObj("NAME-required", -1); case XML_ERR_PCDATA_REQUIRED: return Tcl_NewStringObj("PCDATA-required", -1); case XML_ERR_URI_REQUIRED: return Tcl_NewStringObj("URI-required", -1); case XML_ERR_PUBID_REQUIRED: return Tcl_NewStringObj("public-identifier-required", -1); case XML_ERR_LT_REQUIRED: return Tcl_NewStringObj("less-than-character-required", -1); case XML_ERR_GT_REQUIRED: return Tcl_NewStringObj("greater-than-character-required", -1); case XML_ERR_LTSLASH_REQUIRED: return Tcl_NewStringObj("less-than-and-slash-characters-required", -1); case XML_ERR_EQUAL_REQUIRED: return Tcl_NewStringObj("equal-character-required", -1); case XML_ERR_TAG_NAME_MISMATCH: return Tcl_NewStringObj("tag-name-mismatch", -1); case XML_ERR_TAG_NOT_FINISHED: return Tcl_NewStringObj("tag-not-finished", -1); case XML_ERR_STANDALONE_VALUE: return Tcl_NewStringObj("standalone-value", -1); case XML_ERR_ENCODING_NAME: return Tcl_NewStringObj("encoding-name", -1); case XML_ERR_HYPHEN_IN_COMMENT: return Tcl_NewStringObj("hyphen-in-comment", -1); case XML_ERR_INVALID_ENCODING: return Tcl_NewStringObj("invalid-encoding", -1); case XML_ERR_EXT_ENTITY_STANDALONE: return Tcl_NewStringObj("external-entity-standalone", -1); case XML_ERR_CONDSEC_INVALID: return Tcl_NewStringObj("conditional-section-invalid", -1); case XML_ERR_VALUE_REQUIRED: return Tcl_NewStringObj("value-required", -1); case XML_ERR_NOT_WELL_BALANCED: return Tcl_NewStringObj("not-well-balanced", -1); case XML_ERR_EXTRA_CONTENT: return Tcl_NewStringObj("extra-content", -1); case XML_ERR_ENTITY_CHAR_ERROR: return Tcl_NewStringObj("entity-character-error", -1); case XML_ERR_ENTITY_PE_INTERNAL: return Tcl_NewStringObj("parameter-entity-internal-error", -1); case XML_ERR_ENTITY_LOOP: return Tcl_NewStringObj("entity-loop", -1); case XML_ERR_ENTITY_BOUNDARY: return Tcl_NewStringObj("entity-boundary", -1); case XML_ERR_INVALID_URI: return Tcl_NewStringObj("invalid-URI", -1); case XML_ERR_URI_FRAGMENT: return Tcl_NewStringObj("URI-fragment", -1); case XML_WAR_CATALOG_PI: return Tcl_NewStringObj("catalog-processing-instruction", -1); case XML_ERR_NO_DTD: return Tcl_NewStringObj("no-document-type-definition", -1); case XML_ERR_CONDSEC_INVALID_KEYWORD: return Tcl_NewStringObj("conditional-section-invalid-keyword", -1); case XML_ERR_VERSION_MISSING: return Tcl_NewStringObj("version-missing", -1); case XML_WAR_UNKNOWN_VERSION: return Tcl_NewStringObj("unknown-version", -1); case XML_WAR_LANG_VALUE: return Tcl_NewStringObj("lang-value", -1); case XML_WAR_NS_URI: return Tcl_NewStringObj("namespace-uri", -1); case XML_WAR_NS_URI_RELATIVE: return Tcl_NewStringObj("namespace-uri-relative", -1); case XML_NS_ERR_XML_NAMESPACE: return Tcl_NewStringObj("xml-namespace", -1); case XML_NS_ERR_UNDEFINED_NAMESPACE: return Tcl_NewStringObj("undefined-namespace", -1); case XML_NS_ERR_QNAME: return Tcl_NewStringObj("qualified-name", -1); case XML_NS_ERR_ATTRIBUTE_REDEFINED: return Tcl_NewStringObj("attribute-redefined", -1); case XML_DTD_ATTRIBUTE_DEFAULT: return Tcl_NewStringObj("attribute-default", -1); case XML_DTD_ATTRIBUTE_REDEFINED: return Tcl_NewStringObj("attribute-redefined", -1); case XML_DTD_ATTRIBUTE_VALUE: return Tcl_NewStringObj("attribute-value", -1); case XML_DTD_CONTENT_ERROR: return Tcl_NewStringObj("content-error", -1); case XML_DTD_CONTENT_MODEL: return Tcl_NewStringObj("content-model", -1); case XML_DTD_CONTENT_NOT_DETERMINIST: return Tcl_NewStringObj("content-model-not-deterministic", -1); case XML_DTD_DIFFERENT_PREFIX: return Tcl_NewStringObj("different-prefix", -1); case XML_DTD_ELEM_DEFAULT_NAMESPACE: return Tcl_NewStringObj("element-default-namespace", -1); case XML_DTD_ELEM_NAMESPACE: return Tcl_NewStringObj("element-namespace", -1); case XML_DTD_ELEM_REDEFINED: return Tcl_NewStringObj("element-type-redefined", -1); case XML_DTD_EMPTY_NOTATION: return Tcl_NewStringObj("empty-notation", -1); case XML_DTD_ENTITY_TYPE: return Tcl_NewStringObj("entity-type", -1); case XML_DTD_ID_FIXED: return Tcl_NewStringObj("ID-fixed", -1); case XML_DTD_ID_REDEFINED: return Tcl_NewStringObj("ID-redefined", -1); case XML_DTD_ID_SUBSET: return Tcl_NewStringObj("ID-subset", -1); case XML_DTD_INVALID_CHILD: return Tcl_NewStringObj("invalid-child", -1); case XML_DTD_INVALID_DEFAULT: return Tcl_NewStringObj("invalid-default", -1); case XML_DTD_LOAD_ERROR: return Tcl_NewStringObj("load-error", -1); case XML_DTD_MISSING_ATTRIBUTE: return Tcl_NewStringObj("missing-attribute", -1); case XML_DTD_MIXED_CORRUPT: return Tcl_NewStringObj("mixed-content-corrupt", -1); case XML_DTD_MULTIPLE_ID: return Tcl_NewStringObj("multiple-ID", -1); case XML_DTD_NO_DOC: return Tcl_NewStringObj("no-document", -1); case XML_DTD_NO_DTD: return Tcl_NewStringObj("no-document-type-definition", -1); case XML_DTD_NO_ELEM_NAME: return Tcl_NewStringObj("no-element-name", -1); case XML_DTD_NO_PREFIX: return Tcl_NewStringObj("no-prefix", -1); case XML_DTD_NO_ROOT: return Tcl_NewStringObj("no-root", -1); case XML_DTD_NOTATION_REDEFINED: return Tcl_NewStringObj("notation-redefined", -1); case XML_DTD_NOTATION_VALUE: return Tcl_NewStringObj("notation-value", -1); case XML_DTD_NOT_EMPTY: return Tcl_NewStringObj("not-empty", -1); case XML_DTD_NOT_PCDATA: return Tcl_NewStringObj("not-PCDATA", -1); case XML_DTD_NOT_STANDALONE: return Tcl_NewStringObj("not-standalone", -1); case XML_DTD_ROOT_NAME: return Tcl_NewStringObj("root-name", -1); case XML_DTD_STANDALONE_WHITE_SPACE: return Tcl_NewStringObj("standalone-white-space", -1); case XML_DTD_UNKNOWN_ATTRIBUTE: return Tcl_NewStringObj("unknown-attribute", -1); case XML_DTD_UNKNOWN_ELEM: return Tcl_NewStringObj("unknown-element-type", -1); case XML_DTD_UNKNOWN_ENTITY: return Tcl_NewStringObj("unknown-entity", -1); case XML_DTD_UNKNOWN_ID: return Tcl_NewStringObj("unknown-ID", -1); case XML_DTD_UNKNOWN_NOTATION: return Tcl_NewStringObj("unknown-notation", -1); case XML_HTML_STRUCURE_ERROR: return Tcl_NewStringObj("structure-error", -1); case XML_HTML_UNKNOWN_TAG: return Tcl_NewStringObj("unknown-tag", -1); case XML_RNGP_ANYNAME_ATTR_ANCESTOR: return Tcl_NewStringObj("anyname-attribute-ancestor", -1); case XML_RNGP_ATTR_CONFLICT: return Tcl_NewStringObj("attribute-conflict", -1); case XML_RNGP_ATTRIBUTE_CHILDREN: return Tcl_NewStringObj("attribute-children", -1); case XML_RNGP_ATTRIBUTE_CONTENT: return Tcl_NewStringObj("attribute-content", -1); case XML_RNGP_ATTRIBUTE_EMPTY: return Tcl_NewStringObj("attribute-empty", -1); case XML_RNGP_ATTRIBUTE_NOOP: return Tcl_NewStringObj("attribute-noop", -1); case XML_RNGP_CHOICE_CONTENT: return Tcl_NewStringObj("choice-content", -1); case XML_RNGP_CREATE_FAILURE: return Tcl_NewStringObj("create-failure", -1); case XML_RNGP_DATA_CONTENT: return Tcl_NewStringObj("data-content", -1); case XML_RNGP_DEF_CHOICE_AND_INTERLEAVE: return Tcl_NewStringObj("def-choice-and-interleave", -1); case XML_RNGP_DEFINE_CREATE_FAILED: return Tcl_NewStringObj("define-create-failed", -1); case XML_RNGP_DEFINE_EMPTY: return Tcl_NewStringObj("define-empty", -1); case XML_RNGP_DEFINE_MISSING: return Tcl_NewStringObj("define-missing", -1); case XML_RNGP_DEFINE_NAME_MISSING: return Tcl_NewStringObj("define-name-missing", -1); case XML_RNGP_ELEM_CONTENT_EMPTY: return Tcl_NewStringObj("elem-content-empty", -1); case XML_RNGP_ELEM_CONTENT_ERROR: return Tcl_NewStringObj("elem-content-error", -1); case XML_RNGP_ELEMENT_EMPTY: return Tcl_NewStringObj("element-empty", -1); case XML_RNGP_ELEMENT_CONTENT: return Tcl_NewStringObj("element-content", -1); case XML_RNGP_ELEMENT_NAME: return Tcl_NewStringObj("element-name", -1); case XML_RNGP_ELEMENT_NO_CONTENT: return Tcl_NewStringObj("element-no-content", -1); case XML_RNGP_ELEM_TEXT_CONFLICT: return Tcl_NewStringObj("element-text-conflict", -1); case XML_RNGP_EMPTY: return Tcl_NewStringObj("empty", -1); case XML_RNGP_EMPTY_CONSTRUCT: return Tcl_NewStringObj("empty-construct", -1); case XML_RNGP_EMPTY_CONTENT: return Tcl_NewStringObj("empty-content", -1); case XML_RNGP_EMPTY_NOT_EMPTY: return Tcl_NewStringObj("empty-not-empty", -1); case XML_RNGP_ERROR_TYPE_LIB: return Tcl_NewStringObj("error-type-library", -1); case XML_RNGP_EXCEPT_EMPTY: return Tcl_NewStringObj("except-empty", -1); case XML_RNGP_EXCEPT_MISSING: return Tcl_NewStringObj("except-missing", -1); case XML_RNGP_EXCEPT_MULTIPLE: return Tcl_NewStringObj("except-multiple", -1); case XML_RNGP_EXCEPT_NO_CONTENT: return Tcl_NewStringObj("except-no-content", -1); case XML_RNGP_EXTERNALREF_EMTPY: return Tcl_NewStringObj("external-reference-empty", -1); case XML_RNGP_EXTERNAL_REF_FAILURE: return Tcl_NewStringObj("external-reference-failure", -1); case XML_RNGP_EXTERNALREF_RECURSE: return Tcl_NewStringObj("external-reference-recursive", -1); case XML_RNGP_FORBIDDEN_ATTRIBUTE: return Tcl_NewStringObj("forbidden-attribute", -1); case XML_RNGP_FOREIGN_ELEMENT: return Tcl_NewStringObj("foreign-element", -1); case XML_RNGP_GRAMMAR_CONTENT: return Tcl_NewStringObj("grammar-content", -1); case XML_RNGP_GRAMMAR_EMPTY: return Tcl_NewStringObj("grammar-empty", -1); case XML_RNGP_GRAMMAR_MISSING: return Tcl_NewStringObj("grammar-missing", -1); case XML_RNGP_GRAMMAR_NO_START: return Tcl_NewStringObj("grammar-no-start", -1); case XML_RNGP_GROUP_ATTR_CONFLICT: return Tcl_NewStringObj("group-attribute-conflict-", -1); case XML_RNGP_HREF_ERROR: return Tcl_NewStringObj("href-error", -1); case XML_RNGP_INCLUDE_EMPTY: return Tcl_NewStringObj("include-empty", -1); case XML_RNGP_INCLUDE_FAILURE: return Tcl_NewStringObj("include-failure", -1); case XML_RNGP_INCLUDE_RECURSE: return Tcl_NewStringObj("include-recurse", -1); case XML_RNGP_INTERLEAVE_ADD: return Tcl_NewStringObj("interleave-add", -1); case XML_RNGP_INTERLEAVE_CREATE_FAILED: return Tcl_NewStringObj("interleave-create-failed", -1); case XML_RNGP_INTERLEAVE_EMPTY: return Tcl_NewStringObj("interleave-empty", -1); case XML_RNGP_INTERLEAVE_NO_CONTENT: return Tcl_NewStringObj("interleave-no-content", -1); case XML_RNGP_INVALID_DEFINE_NAME: return Tcl_NewStringObj("invalid-define-name", -1); case XML_RNGP_INVALID_URI: return Tcl_NewStringObj("invalid-URI", -1); case XML_RNGP_INVALID_VALUE: return Tcl_NewStringObj("invalid-value", -1); case XML_RNGP_MISSING_HREF: return Tcl_NewStringObj("missing-href", -1); case XML_RNGP_NAME_MISSING: return Tcl_NewStringObj("NAME-missing", -1); case XML_RNGP_NEED_COMBINE: return Tcl_NewStringObj("need-combine", -1); case XML_RNGP_NOTALLOWED_NOT_EMPTY: return Tcl_NewStringObj("notallowed-not-empty", -1); case XML_RNGP_NSNAME_ATTR_ANCESTOR: return Tcl_NewStringObj("nsname-attr-ancestor", -1); case XML_RNGP_NSNAME_NO_NS: return Tcl_NewStringObj("nsname-no-namespace", -1); case XML_RNGP_PARAM_FORBIDDEN: return Tcl_NewStringObj("param-forbidden", -1); case XML_RNGP_PARAM_NAME_MISSING: return Tcl_NewStringObj("param-name-missing", -1); case XML_RNGP_PARENTREF_CREATE_FAILED: return Tcl_NewStringObj("parentref-create-failed", -1); case XML_RNGP_PARENTREF_NAME_INVALID: return Tcl_NewStringObj("parentref-name-invalid", -1); case XML_RNGP_PARENTREF_NO_NAME: return Tcl_NewStringObj("parentref-no-name", -1); case XML_RNGP_PARENTREF_NO_PARENT: return Tcl_NewStringObj("parentref-no-parent", -1); case XML_RNGP_PARENTREF_NOT_EMPTY: return Tcl_NewStringObj("parentref-not-empty", -1); case XML_RNGP_PARSE_ERROR: return Tcl_NewStringObj("parse-error", -1); case XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME: return Tcl_NewStringObj("pat-anyname-except-anyname", -1); case XML_RNGP_PAT_ATTR_ATTR: return Tcl_NewStringObj("par-attr-attr", -1); case XML_RNGP_PAT_ATTR_ELEM: return Tcl_NewStringObj("pat-attr-elem", -1); case XML_RNGP_PAT_DATA_EXCEPT_ATTR: return Tcl_NewStringObj("pat-data-except-attr", -1); case XML_RNGP_PAT_DATA_EXCEPT_ELEM: return Tcl_NewStringObj("pat-data-except-elem", -1); case XML_RNGP_PAT_DATA_EXCEPT_EMPTY: return Tcl_NewStringObj("pat-data-except-empty", -1); case XML_RNGP_PAT_DATA_EXCEPT_GROUP: return Tcl_NewStringObj("pat-data-except-group", -1); case XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE: return Tcl_NewStringObj("pat-data-except-interleave", -1); case XML_RNGP_PAT_DATA_EXCEPT_LIST: return Tcl_NewStringObj("pat-data-except-list", -1); case XML_RNGP_PAT_DATA_EXCEPT_ONEMORE: return Tcl_NewStringObj("pat-data-except-onemore", -1); case XML_RNGP_PAT_DATA_EXCEPT_REF: return Tcl_NewStringObj("pat-data-except-ref", -1); case XML_RNGP_PAT_DATA_EXCEPT_TEXT: return Tcl_NewStringObj("pat-data-except-text", -1); case XML_RNGP_PAT_LIST_ATTR: return Tcl_NewStringObj("pat-list-attr", -1); case XML_RNGP_PAT_LIST_ELEM: return Tcl_NewStringObj("pat-list-elem", -1); case XML_RNGP_PAT_LIST_INTERLEAVE: return Tcl_NewStringObj("pat-list-interleave", -1); case XML_RNGP_PAT_LIST_LIST: return Tcl_NewStringObj("pat-list-list", -1); case XML_RNGP_PAT_LIST_REF: return Tcl_NewStringObj("pat-list-ref", -1); case XML_RNGP_PAT_LIST_TEXT: return Tcl_NewStringObj("pat-list-text", -1); case XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME: return Tcl_NewStringObj("pat-nsname-except-anyname", -1); case XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME: return Tcl_NewStringObj("pat-nsname-except-nsname", -1); case XML_RNGP_PAT_ONEMORE_GROUP_ATTR: return Tcl_NewStringObj("pat-onemore-group-attr", -1); case XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR: return Tcl_NewStringObj("pat-onemore-interleave-attr", -1); case XML_RNGP_PAT_START_ATTR: return Tcl_NewStringObj("pat-start-attr", -1); case XML_RNGP_PAT_START_DATA: return Tcl_NewStringObj("pat-start-data", -1); case XML_RNGP_PAT_START_EMPTY: return Tcl_NewStringObj("pat-start-empty", -1); case XML_RNGP_PAT_START_GROUP: return Tcl_NewStringObj("pat-start-group", -1); case XML_RNGP_PAT_START_INTERLEAVE: return Tcl_NewStringObj("pat-start-interleave", -1); case XML_RNGP_PAT_START_LIST: return Tcl_NewStringObj("pat-start-list", -1); case XML_RNGP_PAT_START_ONEMORE: return Tcl_NewStringObj("pat-start-onemore", -1); case XML_RNGP_PAT_START_TEXT: return Tcl_NewStringObj("pat-start-text", -1); case XML_RNGP_PAT_START_VALUE: return Tcl_NewStringObj("pat-start-value", -1); case XML_RNGP_PREFIX_UNDEFINED: return Tcl_NewStringObj("prefix-undefined", -1); case XML_RNGP_REF_CREATE_FAILED: return Tcl_NewStringObj("ref-create-failed", -1); case XML_RNGP_REF_CYCLE: return Tcl_NewStringObj("ref-cycle", -1); case XML_RNGP_REF_NAME_INVALID: return Tcl_NewStringObj("ref-name-invalid", -1); case XML_RNGP_REF_NO_DEF: return Tcl_NewStringObj("ref-no-def", -1); case XML_RNGP_REF_NO_NAME: return Tcl_NewStringObj("ref-no-name", -1); case XML_RNGP_REF_NOT_EMPTY: return Tcl_NewStringObj("ref-not-empty", -1); case XML_RNGP_START_CHOICE_AND_INTERLEAVE: return Tcl_NewStringObj("start-choice-and-interleave", -1); case XML_RNGP_START_CONTENT: return Tcl_NewStringObj("start-content", -1); case XML_RNGP_START_EMPTY: return Tcl_NewStringObj("start-empty", -1); case XML_RNGP_START_MISSING: return Tcl_NewStringObj("start-missing", -1); case XML_RNGP_TEXT_EXPECTED: return Tcl_NewStringObj("text-expected", -1); case XML_RNGP_TEXT_HAS_CHILD: return Tcl_NewStringObj("text-has-child", -1); case XML_RNGP_TYPE_MISSING: return Tcl_NewStringObj("type-missing", -1); case XML_RNGP_TYPE_NOT_FOUND: return Tcl_NewStringObj("type-not-found", -1); case XML_RNGP_UNKNOWN_ATTRIBUTE: return Tcl_NewStringObj("unknown-attribute", -1); case XML_RNGP_UNKNOWN_COMBINE: return Tcl_NewStringObj("unknown-combine", -1); case XML_RNGP_UNKNOWN_CONSTRUCT: return Tcl_NewStringObj("unknown-construct", -1); case XML_RNGP_UNKNOWN_TYPE_LIB: return Tcl_NewStringObj("unknown-type-lib", -1); case XML_RNGP_URI_FRAGMENT: return Tcl_NewStringObj("URI-fragment", -1); case XML_RNGP_URI_NOT_ABSOLUTE: return Tcl_NewStringObj("URI-not-absolute", -1); case XML_RNGP_VALUE_EMPTY: return Tcl_NewStringObj("value-empty", -1); case XML_RNGP_VALUE_NO_CONTENT: return Tcl_NewStringObj("value-no-content", -1); case XML_RNGP_XMLNS_NAME: return Tcl_NewStringObj("xmlns-name", -1); case XML_RNGP_XML_NS: return Tcl_NewStringObj("xml-ns", -1); case XML_XPATH_EXPRESSION_OK: return Tcl_NewStringObj("expression-ok", -1); case XML_XPATH_NUMBER_ERROR: return Tcl_NewStringObj("number-error", -1); case XML_XPATH_UNFINISHED_LITERAL_ERROR: return Tcl_NewStringObj("unfinished-literal", -1); case XML_XPATH_START_LITERAL_ERROR: return Tcl_NewStringObj("start-literal", -1); case XML_XPATH_VARIABLE_REF_ERROR: return Tcl_NewStringObj("variable-reference", -1); case XML_XPATH_UNDEF_VARIABLE_ERROR: return Tcl_NewStringObj("undefined-variable", -1); case XML_XPATH_INVALID_PREDICATE_ERROR: return Tcl_NewStringObj("invalid-predicate", -1); case XML_XPATH_EXPR_ERROR: return Tcl_NewStringObj("expression-error", -1); case XML_XPATH_UNCLOSED_ERROR: return Tcl_NewStringObj("unclosed", -1); case XML_XPATH_UNKNOWN_FUNC_ERROR: return Tcl_NewStringObj("unknown-function", -1); case XML_XPATH_INVALID_OPERAND: return Tcl_NewStringObj("invalid-operand", -1); case XML_XPATH_INVALID_TYPE: return Tcl_NewStringObj("invalid-type", -1); case XML_XPATH_INVALID_ARITY: return Tcl_NewStringObj("invalid-arity", -1); case XML_XPATH_INVALID_CTXT_SIZE: return Tcl_NewStringObj("invalid-context-size", -1); case XML_XPATH_INVALID_CTXT_POSITION: return Tcl_NewStringObj("invalid-context-position", -1); case XML_XPATH_MEMORY_ERROR: return Tcl_NewStringObj("memory-error", -1); case XML_XPTR_SYNTAX_ERROR: return Tcl_NewStringObj("syntax-error", -1); case XML_XPTR_RESOURCE_ERROR: return Tcl_NewStringObj("resource-error", -1); case XML_XPTR_SUB_RESOURCE_ERROR: return Tcl_NewStringObj("sub-resource-error", -1); case XML_XPATH_UNDEF_PREFIX_ERROR: return Tcl_NewStringObj("undefined-prefix", -1); case XML_XPATH_ENCODING_ERROR: return Tcl_NewStringObj("encoding-error", -1); case XML_XPATH_INVALID_CHAR_ERROR: return Tcl_NewStringObj("invalid-character", -1); case XML_TREE_INVALID_HEX: return Tcl_NewStringObj("invalid-hex", -1); case XML_TREE_INVALID_DEC: return Tcl_NewStringObj("invalid-decimal", -1); case XML_TREE_UNTERMINATED_ENTITY: return Tcl_NewStringObj("unterminated-entity", -1); case XML_SAVE_NOT_UTF8: return Tcl_NewStringObj("not-utf8", -1); case XML_SAVE_CHAR_INVALID: return Tcl_NewStringObj("invalid-character", -1); case XML_SAVE_NO_DOCTYPE: return Tcl_NewStringObj("no-document-type-declaration", -1); case XML_SAVE_UNKNOWN_ENCODING: return Tcl_NewStringObj("unknown-encoding", -1); case XML_REGEXP_COMPILE_ERROR: return Tcl_NewStringObj("compile-error", -1); case XML_IO_UNKNOWN: return Tcl_NewStringObj("unknown", -1); case XML_IO_EACCES: return Tcl_NewStringObj("eacces", -1); case XML_IO_EAGAIN: return Tcl_NewStringObj("eagain", -1); case XML_IO_EBADF: return Tcl_NewStringObj("ebadf", -1); case XML_IO_EBADMSG: return Tcl_NewStringObj("ebadmsg", -1); case XML_IO_EBUSY: return Tcl_NewStringObj("ebusy", -1); case XML_IO_ECANCELED: return Tcl_NewStringObj("ecanceled", -1); case XML_IO_ECHILD: return Tcl_NewStringObj("echild", -1); case XML_IO_EDEADLK: return Tcl_NewStringObj("edeadlk", -1); case XML_IO_EDOM: return Tcl_NewStringObj("edom", -1); case XML_IO_EEXIST: return Tcl_NewStringObj("eexist", -1); case XML_IO_EINPROGRESS: return Tcl_NewStringObj("einprogress", -1); case XML_IO_EINTR: return Tcl_NewStringObj("eintr", -1); case XML_IO_EINVAL: return Tcl_NewStringObj("einval", -1); case XML_IO_EIO: return Tcl_NewStringObj("eio", -1); case XML_IO_EISDIR: return Tcl_NewStringObj("eisdir", -1); case XML_IO_EMFILE: return Tcl_NewStringObj("emfile", -1); case XML_IO_EMLINK: return Tcl_NewStringObj("emlink", -1); case XML_IO_EMSGSIZE: return Tcl_NewStringObj("emsgsize", -1); case XML_IO_ENAMETOOLONG: return Tcl_NewStringObj("enametoolong", -1); case XML_IO_ENFILE: return Tcl_NewStringObj("enfile", -1); case XML_IO_ENODEV: return Tcl_NewStringObj("enodev", -1); case XML_IO_ENOENT: return Tcl_NewStringObj("enoent", -1); case XML_IO_ENOEXEC: return Tcl_NewStringObj("enoexec", -1); case XML_IO_ENOLCK: return Tcl_NewStringObj("enolck", -1); case XML_IO_ENOMEM: return Tcl_NewStringObj("enomem", -1); case XML_IO_ENOSPC: return Tcl_NewStringObj("enospc", -1); case XML_IO_ENOSYS: return Tcl_NewStringObj("enosys", -1); case XML_IO_ENOTDIR: return Tcl_NewStringObj("enotdir", -1); case XML_IO_ENOTEMPTY: return Tcl_NewStringObj("enotempty", -1); case XML_IO_ENOTSUP: return Tcl_NewStringObj("enotsup", -1); case XML_IO_ENOTTY: return Tcl_NewStringObj("enotty", -1); case XML_IO_ENXIO: return Tcl_NewStringObj("enxio", -1); case XML_IO_EPERM: return Tcl_NewStringObj("eperm", -1); case XML_IO_EPIPE: return Tcl_NewStringObj("epipe", -1); case XML_IO_ERANGE: return Tcl_NewStringObj("erange", -1); case XML_IO_EROFS: return Tcl_NewStringObj("erofs", -1); case XML_IO_ESPIPE: return Tcl_NewStringObj("espipe", -1); case XML_IO_ESRCH: return Tcl_NewStringObj("esrch", -1); case XML_IO_ETIMEDOUT: return Tcl_NewStringObj("etimedout", -1); case XML_IO_EXDEV: return Tcl_NewStringObj("exdev", -1); case XML_IO_NETWORK_ATTEMPT: return Tcl_NewStringObj("network-attempt", -1); case XML_IO_ENCODER: return Tcl_NewStringObj("encoder", -1); case XML_IO_FLUSH: return Tcl_NewStringObj("flush", -1); case XML_IO_WRITE: return Tcl_NewStringObj("write", -1); case XML_IO_NO_INPUT: return Tcl_NewStringObj("no-input", -1); case XML_IO_BUFFER_FULL: return Tcl_NewStringObj("buffer-full", -1); case XML_IO_LOAD_ERROR: return Tcl_NewStringObj("load-error", -1); case XML_IO_ENOTSOCK: return Tcl_NewStringObj("enotsock", -1); case XML_IO_EISCONN: return Tcl_NewStringObj("eisconn", -1); case XML_IO_ECONNREFUSED: return Tcl_NewStringObj("econnrefused", -1); case XML_IO_ENETUNREACH: return Tcl_NewStringObj("enetunreach", -1); case XML_IO_EADDRINUSE: return Tcl_NewStringObj("eaddrinuse", -1); case XML_IO_EALREADY: return Tcl_NewStringObj("ealready", -1); case XML_IO_EAFNOSUPPORT: return Tcl_NewStringObj("eafnosupport", -1); case XML_XINCLUDE_RECURSION: return Tcl_NewStringObj("recursion", -1); case XML_XINCLUDE_PARSE_VALUE: return Tcl_NewStringObj("parse-value", -1); case XML_XINCLUDE_ENTITY_DEF_MISMATCH: return Tcl_NewStringObj("entity-def-mismatch", -1); case XML_XINCLUDE_NO_HREF: return Tcl_NewStringObj("no-href", -1); case XML_XINCLUDE_NO_FALLBACK: return Tcl_NewStringObj("no-fallback", -1); case XML_XINCLUDE_HREF_URI: return Tcl_NewStringObj("href-URI", -1); case XML_XINCLUDE_TEXT_FRAGMENT: return Tcl_NewStringObj("text-fragment", -1); case XML_XINCLUDE_TEXT_DOCUMENT: return Tcl_NewStringObj("text-document", -1); case XML_XINCLUDE_INVALID_CHAR: return Tcl_NewStringObj("invalid-character", -1); case XML_XINCLUDE_BUILD_FAILED: return Tcl_NewStringObj("build-failed", -1); case XML_XINCLUDE_UNKNOWN_ENCODING: return Tcl_NewStringObj("unknown-encoding", -1); case XML_XINCLUDE_MULTIPLE_ROOT: return Tcl_NewStringObj("multiple-root", -1); case XML_XINCLUDE_XPTR_FAILED: return Tcl_NewStringObj("XPointer-failed", -1); case XML_XINCLUDE_XPTR_RESULT: return Tcl_NewStringObj("XPointer-result", -1); case XML_XINCLUDE_INCLUDE_IN_INCLUDE: return Tcl_NewStringObj("include-in-include", -1); case XML_XINCLUDE_FALLBACKS_IN_INCLUDE: return Tcl_NewStringObj("fallbacks-in-include", -1); case XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE: return Tcl_NewStringObj("fallback-not-in-include", -1); case XML_CATALOG_MISSING_ATTR: return Tcl_NewStringObj("missing-attribute", -1); case XML_CATALOG_ENTRY_BROKEN: return Tcl_NewStringObj("entry-broken", -1); case XML_CATALOG_PREFER_VALUE: return Tcl_NewStringObj("prefer-value", -1); case XML_CATALOG_NOT_CATALOG: return Tcl_NewStringObj("not-catalog", -1); case XML_CATALOG_RECURSION: return Tcl_NewStringObj("recursion", -1); case XML_SCHEMAP_PREFIX_UNDEFINED: return Tcl_NewStringObj("prefix-undefined", -1); case XML_SCHEMAP_ATTRFORMDEFAULT_VALUE: return Tcl_NewStringObj("attribute-form-default-value", -1); case XML_SCHEMAP_ATTRGRP_NONAME_NOREF: return Tcl_NewStringObj("attribute-group-noname-noref", -1); case XML_SCHEMAP_ATTR_NONAME_NOREF: return Tcl_NewStringObj("attribute-noname-noref", -1); case XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF: return Tcl_NewStringObj("complexType-noname-noref", -1); case XML_SCHEMAP_ELEMFORMDEFAULT_VALUE: return Tcl_NewStringObj("element-form-default-value", -1); case XML_SCHEMAP_ELEM_NONAME_NOREF: return Tcl_NewStringObj("element-noname-noref", -1); case XML_SCHEMAP_EXTENSION_NO_BASE: return Tcl_NewStringObj("extension-no-base", -1); case XML_SCHEMAP_FACET_NO_VALUE: return Tcl_NewStringObj("facet-no-value", -1); case XML_SCHEMAP_FAILED_BUILD_IMPORT: return Tcl_NewStringObj("failed-build-import", -1); case XML_SCHEMAP_GROUP_NONAME_NOREF: return Tcl_NewStringObj("group-noname-noref", -1); case XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URI: return Tcl_NewStringObj("import-namespace-not-URI", -1); case XML_SCHEMAP_IMPORT_REDEFINE_NSNAME: return Tcl_NewStringObj("import-redefine-nsname", -1); case XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI: return Tcl_NewStringObj("import-schema-not-URI", -1); case XML_SCHEMAP_INVALID_BOOLEAN: return Tcl_NewStringObj("invalid-boolean", -1); case XML_SCHEMAP_INVALID_ENUM: return Tcl_NewStringObj("invalid-enumeration", -1); case XML_SCHEMAP_INVALID_FACET: return Tcl_NewStringObj("invalid-facet", -1); case XML_SCHEMAP_INVALID_FACET_VALUE: return Tcl_NewStringObj("invalid-facet-value", -1); case XML_SCHEMAP_INVALID_MAXOCCURS: return Tcl_NewStringObj("invalid-maxOccurs", -1); case XML_SCHEMAP_INVALID_MINOCCURS: return Tcl_NewStringObj("invalid-minOccurs", -1); case XML_SCHEMAP_INVALID_REF_AND_SUBTYPE: return Tcl_NewStringObj("invalid-ref-and-subtype", -1); case XML_SCHEMAP_INVALID_WHITE_SPACE: return Tcl_NewStringObj("invalid-white-space", -1); case XML_SCHEMAP_NOATTR_NOREF: return Tcl_NewStringObj("noattr-noref", -1); case XML_SCHEMAP_NOTATION_NO_NAME: return Tcl_NewStringObj("notation-no-name", -1); case XML_SCHEMAP_NOTYPE_NOREF: return Tcl_NewStringObj("notype-noref", -1); case XML_SCHEMAP_REF_AND_SUBTYPE: return Tcl_NewStringObj("ref-and-subtype", -1); case XML_SCHEMAP_RESTRICTION_NONAME_NOREF: return Tcl_NewStringObj("restriction-noname-noref", -1); case XML_SCHEMAP_SIMPLETYPE_NONAME: return Tcl_NewStringObj("simpleType-noname", -1); case XML_SCHEMAP_TYPE_AND_SUBTYPE: return Tcl_NewStringObj("type-and-subtype", -1); case XML_SCHEMAP_UNKNOWN_ALL_CHILD: return Tcl_NewStringObj("unknown-all-child", -1); case XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD: return Tcl_NewStringObj("unknown-anyattribute-child", -1); case XML_SCHEMAP_UNKNOWN_ATTR_CHILD: return Tcl_NewStringObj("unknown-attribute-child", -1); case XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILD: return Tcl_NewStringObj("unknown-attributeGroup-child", -1); case XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP: return Tcl_NewStringObj("unknown-attributeGroup", -1); case XML_SCHEMAP_UNKNOWN_BASE_TYPE: return Tcl_NewStringObj("unknown-base-type", -1); case XML_SCHEMAP_UNKNOWN_CHOICE_CHILD: return Tcl_NewStringObj("unknown-choice-child", -1); case XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD: return Tcl_NewStringObj("unknown-complexContent-child", -1); case XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD: return Tcl_NewStringObj("unknown-complexType-child", -1); case XML_SCHEMAP_UNKNOWN_ELEM_CHILD: return Tcl_NewStringObj("unknown-element-child", -1); case XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD: return Tcl_NewStringObj("unknown-extension-child", -1); case XML_SCHEMAP_UNKNOWN_FACET_CHILD: return Tcl_NewStringObj("unknown-facet-child", -1); case XML_SCHEMAP_UNKNOWN_FACET_TYPE: return Tcl_NewStringObj("unknown-facet-type", -1); case XML_SCHEMAP_UNKNOWN_GROUP_CHILD: return Tcl_NewStringObj("unknown-group-child", -1); case XML_SCHEMAP_UNKNOWN_IMPORT_CHILD: return Tcl_NewStringObj("unknown-import-child", -1); case XML_SCHEMAP_UNKNOWN_LIST_CHILD: return Tcl_NewStringObj("unknown-list-child", -1); case XML_SCHEMAP_UNKNOWN_NOTATION_CHILD: return Tcl_NewStringObj("unknown-notation-child", -1); case XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD: return Tcl_NewStringObj("unknown-processContent-child", -1); case XML_SCHEMAP_UNKNOWN_REF: return Tcl_NewStringObj("unknown-ref", -1); case XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILD: return Tcl_NewStringObj("unknown-restriction-child", -1); case XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILD: return Tcl_NewStringObj("unknown-schemas-child", -1); case XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILD: return Tcl_NewStringObj("unknown-sequence-child", -1); case XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD: return Tcl_NewStringObj("unknown-simpleType-child", -1); case XML_SCHEMAP_UNKNOWN_TYPE: return Tcl_NewStringObj("unknown-type", -1); case XML_SCHEMAP_UNKNOWN_UNION_CHILD: return Tcl_NewStringObj("unknown-union-child", -1); case XML_SCHEMAP_ELEM_DEFAULT_FIXED: return Tcl_NewStringObj("element-default-fixed", -1); case XML_SCHEMAP_REGEXP_INVALID: return Tcl_NewStringObj("regexp-invalid", -1); case XML_SCHEMAP_FAILED_LOAD: return Tcl_NewStringObj("failed-load", -1); case XML_SCHEMAP_NOTHING_TO_PARSE: return Tcl_NewStringObj("nothing-to-parse", -1); case XML_SCHEMAP_NOROOT: return Tcl_NewStringObj("no-root", -1); case XML_SCHEMAP_REDEFINED_GROUP: return Tcl_NewStringObj("redefined-group", -1); case XML_SCHEMAP_REDEFINED_TYPE: return Tcl_NewStringObj("redefined-type", -1); case XML_SCHEMAP_REDEFINED_ELEMENT: return Tcl_NewStringObj("redefined-element", -1); case XML_SCHEMAP_REDEFINED_ATTRGROUP: return Tcl_NewStringObj("redefined-attributeGroup", -1); case XML_SCHEMAP_REDEFINED_ATTR: return Tcl_NewStringObj("redefined-attribute", -1); case XML_SCHEMAP_REDEFINED_NOTATION: return Tcl_NewStringObj("redefined-notation", -1); case XML_SCHEMAP_FAILED_PARSE: return Tcl_NewStringObj("failed-parse", -1); case XML_SCHEMAV_NOROOT: return Tcl_NewStringObj("no-root", -1); case XML_SCHEMAV_UNDECLAREDELEM: return Tcl_NewStringObj("undeclared-element", -1); case XML_SCHEMAV_NOTTOPLEVEL: return Tcl_NewStringObj("not-toplevel", -1); case XML_SCHEMAV_MISSING: return Tcl_NewStringObj("missing", -1); case XML_SCHEMAV_WRONGELEM: return Tcl_NewStringObj("wrong-element", -1); case XML_SCHEMAV_NOTYPE: return Tcl_NewStringObj("no-type", -1); case XML_SCHEMAV_NOROLLBACK: return Tcl_NewStringObj("no-rollback", -1); case XML_SCHEMAV_ISABSTRACT: return Tcl_NewStringObj("is-abstract", -1); case XML_SCHEMAV_NOTEMPTY: return Tcl_NewStringObj("not-empty", -1); case XML_SCHEMAV_ELEMCONT: return Tcl_NewStringObj("element-content", -1); case XML_SCHEMAV_HAVEDEFAULT: return Tcl_NewStringObj("have-default", -1); case XML_SCHEMAV_NOTNILLABLE: return Tcl_NewStringObj("not-nillable", -1); case XML_SCHEMAV_EXTRACONTENT: return Tcl_NewStringObj("extra-content", -1); case XML_SCHEMAV_INVALIDATTR: return Tcl_NewStringObj("invalid-attribute", -1); case XML_SCHEMAV_INVALIDELEM: return Tcl_NewStringObj("invalid-element", -1); case XML_SCHEMAV_NOTDETERMINIST: return Tcl_NewStringObj("not-deterministic", -1); case XML_SCHEMAV_CONSTRUCT: return Tcl_NewStringObj("construct", -1); case XML_SCHEMAV_INTERNAL: return Tcl_NewStringObj("internal", -1); case XML_SCHEMAV_NOTSIMPLE: return Tcl_NewStringObj("not-simple", -1); case XML_SCHEMAV_ATTRUNKNOWN: return Tcl_NewStringObj("attribute-unknown", -1); case XML_SCHEMAV_ATTRINVALID: return Tcl_NewStringObj("attribute-invalid", -1); case XML_SCHEMAV_VALUE: return Tcl_NewStringObj("value", -1); case XML_SCHEMAV_FACET: return Tcl_NewStringObj("facet", -1); case XML_XPTR_UNKNOWN_SCHEME: return Tcl_NewStringObj("unknown-scheme", -1); case XML_XPTR_CHILDSEQ_START: return Tcl_NewStringObj("child-sequence-start", -1); case XML_XPTR_EVAL_FAILED: return Tcl_NewStringObj("eval-failed", -1); case XML_XPTR_EXTRA_OBJECTS: return Tcl_NewStringObj("extra-objects", -1); case XML_C14N_CREATE_CTXT: return Tcl_NewStringObj("create-context", -1); case XML_C14N_REQUIRES_UTF8: return Tcl_NewStringObj("requires-utf-8", -1); case XML_C14N_CREATE_STACK: return Tcl_NewStringObj("create-stack", -1); case XML_C14N_INVALID_NODE: return Tcl_NewStringObj("invalid-node", -1); case XML_FTP_PASV_ANSWER: return Tcl_NewStringObj("pasv-answer", -1); case XML_FTP_EPSV_ANSWER: return Tcl_NewStringObj("epsv-answer", -1); case XML_FTP_ACCNT: return Tcl_NewStringObj("account", -1); case XML_HTTP_URL_SYNTAX: return Tcl_NewStringObj("URL-syntax", -1); case XML_HTTP_USE_IP: return Tcl_NewStringObj("use-IP", -1); case XML_HTTP_UNKNOWN_HOST: return Tcl_NewStringObj("unknown-host", -1); default: return Tcl_NewIntObj(code); } } void TclXML_libxml2_ErrorHandler (ctx, error) void *ctx; /* ignore - depends on context */ xmlErrorPtr error; { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_Obj *objPtr; if (tsdPtr->errorInfoPtr->listPtr == NULL) { tsdPtr->errorInfoPtr->listPtr = Tcl_NewObj(); Tcl_IncrRefCount(tsdPtr->errorInfoPtr->listPtr); } objPtr = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, ErrorDomainToString(error->domain)); Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, ErrorLevelToString(error->level)); Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, ErrorCodeToString(error->code)); if (error->node == NULL) { Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, Tcl_NewObj()); } else if (((xmlDocPtr) error->node)->type == XML_DOCUMENT_NODE) { Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, TclXML_libxml2_CreateObjFromDoc((xmlDocPtr) error->node)); } else if (tsdPtr->errorInfoPtr->nodeHandlerProc != NULL) { Tcl_Obj *nodeObjPtr; nodeObjPtr = (tsdPtr->errorInfoPtr->nodeHandlerProc)(tsdPtr->errorInfoPtr->interp, (ClientData) error->node); if (nodeObjPtr != NULL) { Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, nodeObjPtr); } else { Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, Tcl_NewObj()); } } else { Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, Tcl_NewObj()); } Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, Tcl_NewIntObj(error->line)); Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, Tcl_NewStringObj(error->message, -1)); Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, Tcl_NewIntObj(error->int1)); Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, Tcl_NewIntObj(error->int2)); if (error->str1) { Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, Tcl_NewStringObj(error->str1, -1)); } if (error->str2) { Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, Tcl_NewStringObj(error->str2, -1)); } if (error->str3) { Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, objPtr, Tcl_NewStringObj(error->str3, -1)); } Tcl_ListObjAppendElement(tsdPtr->errorInfoPtr->interp, tsdPtr->errorInfoPtr->listPtr, objPtr); } void TclXML_libxml2_ResetError(interp) Tcl_Interp *interp; { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->errorInfoPtr->listPtr != NULL) { Tcl_DecrRefCount(tsdPtr->errorInfoPtr->listPtr); tsdPtr->errorInfoPtr->listPtr = NULL; } } Tcl_Obj * TclXML_libxml2_GetErrorObj(interp) Tcl_Interp *interp; { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); return tsdPtr->errorInfoPtr->listPtr; } void TclXML_libxml2_SetErrorNodeFunc(interp, proc) Tcl_Interp *interp; TclXML_ErrorNodeHandlerProc *proc; { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialized) { Tcl_SetObjResult(interp, Tcl_NewStringObj("internal error: docObj data not initialized", -1)); Tcl_BackgroundError(interp); return; } tsdPtr->errorInfoPtr->nodeHandlerProc = proc; } tclxml-3.3~svn11.orig/tclxmlDecls.h0000644000000000000000000003520611113705304016036 0ustar rootroot/* * tclxmlDecls.h -- * * Declarations of functions in the platform independent public TCLXML API. * */ #ifndef _TCLXMLDECLS #define _TCLXMLDECLS /* * WARNING: The contents of this file is automatically generated by the * genStubs.tcl script. Any modifications to the function declarations * below should be made in the tclxml.decls script. */ /* !BEGIN!: Do not edit below this line. */ /* * Exported function declarations: */ /* 0 */ EXTERN int Tclxml_Init _ANSI_ARGS_((Tcl_Interp * interp)); /* 1 */ EXTERN int Tclxml_SafeInit _ANSI_ARGS_((Tcl_Interp * interp)); /* 2 */ EXTERN int TclXML_RegisterXMLParser _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_ParserClassInfo * parser)); /* 3 */ EXTERN int TclXML_RegisterElementStartProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_ElementStartProc * callback)); /* 4 */ EXTERN int TclXML_RegisterElementEndProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_ElementEndProc * callback)); /* 5 */ EXTERN int TclXML_RegisterCharacterDataProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_CharacterDataProc * callback)); /* 6 */ EXTERN int TclXML_RegisterPIProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_PIProc * callback)); /* 7 */ EXTERN int TclXML_RegisterDefaultProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_DefaultProc * callback)); /* 8 */ EXTERN int TclXML_RegisterUnparsedProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_UnparsedProc * callback)); /* 9 */ EXTERN int TclXML_RegisterNotationDeclProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_NotationDeclProc * callback)); /* 10 */ EXTERN int TclXML_RegisterEntityProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_EntityProc * callback)); /* 11 */ EXTERN int TclXML_RegisterUnknownEncodingProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_UnknownEncodingProc * callback)); /* 12 */ EXTERN int TclXML_RegisterCommentProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_CommentProc * callback)); /* 13 */ EXTERN int TclXML_RegisterNotStandaloneProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_NotStandaloneProc * callback)); /* 14 */ EXTERN int TclXML_RegisterElementDeclProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_ElementDeclProc * callback)); /* 15 */ EXTERN int TclXML_RegisterAttListDeclProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_AttlistDeclProc * callback)); /* 16 */ EXTERN int TclXML_RegisterStartDoctypeDeclProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_StartDoctypeDeclProc * callback)); /* 17 */ EXTERN int TclXML_RegisterEndDoctypeDeclProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_EndDoctypeDeclProc * callback)); /* 18 */ EXTERN void TclXML_ElementStartHandler _ANSI_ARGS_(( void * userdata, Tcl_Obj * name, Tcl_Obj * nsuri, Tcl_Obj * atts, Tcl_Obj * nsDeclsObj)); /* 19 */ EXTERN void TclXML_ElementEndHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * name)); /* 20 */ EXTERN void TclXML_CharacterDataHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * s)); /* 21 */ EXTERN void TclXML_ProcessingInstructionHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * target, Tcl_Obj * data)); /* 22 */ EXTERN int TclXML_ExternalEntityRefHandler _ANSI_ARGS_(( ClientData clientData, Tcl_Obj * openEntityNames, Tcl_Obj * base, Tcl_Obj * systemId, Tcl_Obj * publicId)); /* 23 */ EXTERN void TclXML_DefaultHandler _ANSI_ARGS_((void * userData, Tcl_Obj * s)); /* 24 */ EXTERN void TclXML_UnparsedDeclHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * entityname, Tcl_Obj * base, Tcl_Obj * systemId, Tcl_Obj * publicId, Tcl_Obj * notationName)); /* 25 */ EXTERN void TclXML_NotationDeclHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * notationName, Tcl_Obj * base, Tcl_Obj * systemId, Tcl_Obj * publicId)); /* 26 */ EXTERN int TclXML_UnknownEncodingHandler _ANSI_ARGS_(( void * encodingHandlerData, Tcl_Obj * name, void * info)); /* 27 */ EXTERN void TclXML_CommentHandler _ANSI_ARGS_((void * userData, Tcl_Obj * data)); /* 28 */ EXTERN int TclXML_NotStandaloneHandler _ANSI_ARGS_(( void * userData)); /* Slot 29 is reserved */ /* Slot 30 is reserved */ /* 31 */ EXTERN void TclXML_ElementDeclHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * name, Tcl_Obj * contentspec)); /* 32 */ EXTERN void TclXML_AttlistDeclHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * name, Tcl_Obj * attributes)); /* 33 */ EXTERN void TclXML_StartDoctypeDeclHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * name)); /* 34 */ EXTERN void TclXML_EndDoctypeDeclHandler _ANSI_ARGS_(( void * userData)); typedef struct TclxmlStubs { int magic; struct TclxmlStubHooks *hooks; int (*tclxml_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */ int (*tclxml_SafeInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 1 */ int (*tclXML_RegisterXMLParser) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_ParserClassInfo * parser)); /* 2 */ int (*tclXML_RegisterElementStartProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_ElementStartProc * callback)); /* 3 */ int (*tclXML_RegisterElementEndProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_ElementEndProc * callback)); /* 4 */ int (*tclXML_RegisterCharacterDataProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_CharacterDataProc * callback)); /* 5 */ int (*tclXML_RegisterPIProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_PIProc * callback)); /* 6 */ int (*tclXML_RegisterDefaultProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_DefaultProc * callback)); /* 7 */ int (*tclXML_RegisterUnparsedProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_UnparsedProc * callback)); /* 8 */ int (*tclXML_RegisterNotationDeclProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_NotationDeclProc * callback)); /* 9 */ int (*tclXML_RegisterEntityProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_EntityProc * callback)); /* 10 */ int (*tclXML_RegisterUnknownEncodingProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_UnknownEncodingProc * callback)); /* 11 */ int (*tclXML_RegisterCommentProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_CommentProc * callback)); /* 12 */ int (*tclXML_RegisterNotStandaloneProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_NotStandaloneProc * callback)); /* 13 */ int (*tclXML_RegisterElementDeclProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_ElementDeclProc * callback)); /* 14 */ int (*tclXML_RegisterAttListDeclProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_AttlistDeclProc * callback)); /* 15 */ int (*tclXML_RegisterStartDoctypeDeclProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_StartDoctypeDeclProc * callback)); /* 16 */ int (*tclXML_RegisterEndDoctypeDeclProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_EndDoctypeDeclProc * callback)); /* 17 */ void (*tclXML_ElementStartHandler) _ANSI_ARGS_((void * userdata, Tcl_Obj * name, Tcl_Obj * nsuri, Tcl_Obj * atts, Tcl_Obj * nsDeclsObj)); /* 18 */ void (*tclXML_ElementEndHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * name)); /* 19 */ void (*tclXML_CharacterDataHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * s)); /* 20 */ void (*tclXML_ProcessingInstructionHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * target, Tcl_Obj * data)); /* 21 */ int (*tclXML_ExternalEntityRefHandler) _ANSI_ARGS_((ClientData clientData, Tcl_Obj * openEntityNames, Tcl_Obj * base, Tcl_Obj * systemId, Tcl_Obj * publicId)); /* 22 */ void (*tclXML_DefaultHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * s)); /* 23 */ void (*tclXML_UnparsedDeclHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * entityname, Tcl_Obj * base, Tcl_Obj * systemId, Tcl_Obj * publicId, Tcl_Obj * notationName)); /* 24 */ void (*tclXML_NotationDeclHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * notationName, Tcl_Obj * base, Tcl_Obj * systemId, Tcl_Obj * publicId)); /* 25 */ int (*tclXML_UnknownEncodingHandler) _ANSI_ARGS_((void * encodingHandlerData, Tcl_Obj * name, void * info)); /* 26 */ void (*tclXML_CommentHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * data)); /* 27 */ int (*tclXML_NotStandaloneHandler) _ANSI_ARGS_((void * userData)); /* 28 */ void *reserved29; void *reserved30; void (*tclXML_ElementDeclHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * name, Tcl_Obj * contentspec)); /* 31 */ void (*tclXML_AttlistDeclHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * name, Tcl_Obj * attributes)); /* 32 */ void (*tclXML_StartDoctypeDeclHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * name)); /* 33 */ void (*tclXML_EndDoctypeDeclHandler) _ANSI_ARGS_((void * userData)); /* 34 */ } TclxmlStubs; #ifdef __cplusplus extern "C" { #endif extern TclxmlStubs *tclxmlStubsPtr; #ifdef __cplusplus } #endif #if defined(USE_TCLXML_STUBS) && !defined(USE_TCLXML_STUB_PROCS) /* * Inline function declarations: */ #ifndef Tclxml_Init #define Tclxml_Init \ (tclxmlStubsPtr->tclxml_Init) /* 0 */ #endif #ifndef Tclxml_SafeInit #define Tclxml_SafeInit \ (tclxmlStubsPtr->tclxml_SafeInit) /* 1 */ #endif #ifndef TclXML_RegisterXMLParser #define TclXML_RegisterXMLParser \ (tclxmlStubsPtr->tclXML_RegisterXMLParser) /* 2 */ #endif #ifndef TclXML_RegisterElementStartProc #define TclXML_RegisterElementStartProc \ (tclxmlStubsPtr->tclXML_RegisterElementStartProc) /* 3 */ #endif #ifndef TclXML_RegisterElementEndProc #define TclXML_RegisterElementEndProc \ (tclxmlStubsPtr->tclXML_RegisterElementEndProc) /* 4 */ #endif #ifndef TclXML_RegisterCharacterDataProc #define TclXML_RegisterCharacterDataProc \ (tclxmlStubsPtr->tclXML_RegisterCharacterDataProc) /* 5 */ #endif #ifndef TclXML_RegisterPIProc #define TclXML_RegisterPIProc \ (tclxmlStubsPtr->tclXML_RegisterPIProc) /* 6 */ #endif #ifndef TclXML_RegisterDefaultProc #define TclXML_RegisterDefaultProc \ (tclxmlStubsPtr->tclXML_RegisterDefaultProc) /* 7 */ #endif #ifndef TclXML_RegisterUnparsedProc #define TclXML_RegisterUnparsedProc \ (tclxmlStubsPtr->tclXML_RegisterUnparsedProc) /* 8 */ #endif #ifndef TclXML_RegisterNotationDeclProc #define TclXML_RegisterNotationDeclProc \ (tclxmlStubsPtr->tclXML_RegisterNotationDeclProc) /* 9 */ #endif #ifndef TclXML_RegisterEntityProc #define TclXML_RegisterEntityProc \ (tclxmlStubsPtr->tclXML_RegisterEntityProc) /* 10 */ #endif #ifndef TclXML_RegisterUnknownEncodingProc #define TclXML_RegisterUnknownEncodingProc \ (tclxmlStubsPtr->tclXML_RegisterUnknownEncodingProc) /* 11 */ #endif #ifndef TclXML_RegisterCommentProc #define TclXML_RegisterCommentProc \ (tclxmlStubsPtr->tclXML_RegisterCommentProc) /* 12 */ #endif #ifndef TclXML_RegisterNotStandaloneProc #define TclXML_RegisterNotStandaloneProc \ (tclxmlStubsPtr->tclXML_RegisterNotStandaloneProc) /* 13 */ #endif #ifndef TclXML_RegisterElementDeclProc #define TclXML_RegisterElementDeclProc \ (tclxmlStubsPtr->tclXML_RegisterElementDeclProc) /* 14 */ #endif #ifndef TclXML_RegisterAttListDeclProc #define TclXML_RegisterAttListDeclProc \ (tclxmlStubsPtr->tclXML_RegisterAttListDeclProc) /* 15 */ #endif #ifndef TclXML_RegisterStartDoctypeDeclProc #define TclXML_RegisterStartDoctypeDeclProc \ (tclxmlStubsPtr->tclXML_RegisterStartDoctypeDeclProc) /* 16 */ #endif #ifndef TclXML_RegisterEndDoctypeDeclProc #define TclXML_RegisterEndDoctypeDeclProc \ (tclxmlStubsPtr->tclXML_RegisterEndDoctypeDeclProc) /* 17 */ #endif #ifndef TclXML_ElementStartHandler #define TclXML_ElementStartHandler \ (tclxmlStubsPtr->tclXML_ElementStartHandler) /* 18 */ #endif #ifndef TclXML_ElementEndHandler #define TclXML_ElementEndHandler \ (tclxmlStubsPtr->tclXML_ElementEndHandler) /* 19 */ #endif #ifndef TclXML_CharacterDataHandler #define TclXML_CharacterDataHandler \ (tclxmlStubsPtr->tclXML_CharacterDataHandler) /* 20 */ #endif #ifndef TclXML_ProcessingInstructionHandler #define TclXML_ProcessingInstructionHandler \ (tclxmlStubsPtr->tclXML_ProcessingInstructionHandler) /* 21 */ #endif #ifndef TclXML_ExternalEntityRefHandler #define TclXML_ExternalEntityRefHandler \ (tclxmlStubsPtr->tclXML_ExternalEntityRefHandler) /* 22 */ #endif #ifndef TclXML_DefaultHandler #define TclXML_DefaultHandler \ (tclxmlStubsPtr->tclXML_DefaultHandler) /* 23 */ #endif #ifndef TclXML_UnparsedDeclHandler #define TclXML_UnparsedDeclHandler \ (tclxmlStubsPtr->tclXML_UnparsedDeclHandler) /* 24 */ #endif #ifndef TclXML_NotationDeclHandler #define TclXML_NotationDeclHandler \ (tclxmlStubsPtr->tclXML_NotationDeclHandler) /* 25 */ #endif #ifndef TclXML_UnknownEncodingHandler #define TclXML_UnknownEncodingHandler \ (tclxmlStubsPtr->tclXML_UnknownEncodingHandler) /* 26 */ #endif #ifndef TclXML_CommentHandler #define TclXML_CommentHandler \ (tclxmlStubsPtr->tclXML_CommentHandler) /* 27 */ #endif #ifndef TclXML_NotStandaloneHandler #define TclXML_NotStandaloneHandler \ (tclxmlStubsPtr->tclXML_NotStandaloneHandler) /* 28 */ #endif /* Slot 29 is reserved */ /* Slot 30 is reserved */ #ifndef TclXML_ElementDeclHandler #define TclXML_ElementDeclHandler \ (tclxmlStubsPtr->tclXML_ElementDeclHandler) /* 31 */ #endif #ifndef TclXML_AttlistDeclHandler #define TclXML_AttlistDeclHandler \ (tclxmlStubsPtr->tclXML_AttlistDeclHandler) /* 32 */ #endif #ifndef TclXML_StartDoctypeDeclHandler #define TclXML_StartDoctypeDeclHandler \ (tclxmlStubsPtr->tclXML_StartDoctypeDeclHandler) /* 33 */ #endif #ifndef TclXML_EndDoctypeDeclHandler #define TclXML_EndDoctypeDeclHandler \ (tclxmlStubsPtr->tclXML_EndDoctypeDeclHandler) /* 34 */ #endif #endif /* defined(USE_TCLXML_STUBS) && !defined(USE_TCLXML_STUB_PROCS) */ /* !END!: Do not edit above this line. */ #endif /* _TCLXMLDECLS */ tclxml-3.3~svn11.orig/LICENSE0000644000000000000000000000325311215700771014417 0ustar rootrootCopyright (c) 2005-2009 Explain http://www.explain.com.au/ Explain makes this software available free of charge for any purpose. This software may be copied, and distributed, with or without modifications; but this notice must be included on any copy. The software was developed for research purposes only and Explain does not warrant that it is error free or fit for any purpose. Explain disclaims any liability for all claims, expenses, losses, damages and costs any user may incur as a result of using, copying or modifying this software. Copyright (c) 1998-2004 Zveno Pty Ltd http://www.zveno.com/ Zveno makes this software available free of charge for any purpose. This software may be copied, and distributed, with or without modifications; but this notice must be included on any copy. The software was developed for research purposes only and Zveno does not warrant that it is error free or fit for any purpose. Zveno disclaims any liability for all claims, expenses, losses, damages and costs any user may incur as a result of using, copying or modifying this software. Copyright (c) 1997 ANU and CSIRO on behalf of the participants in the CRC for Advanced Computational Systems ('ACSys'). ACSys makes this software and all associated data and documentation ('Software') 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. The Software was developed for research purposes and ACSys does not warrant that it is error free or fit for any purpose. ACSys 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. tclxml-3.3~svn11.orig/include/0000755000000000000000000000000011574742525015045 5ustar rootroottclxml-3.3~svn11.orig/include/tcldom-libxml2/0000755000000000000000000000000011574742525017676 5ustar rootroottclxml-3.3~svn11.orig/include/tcldom-libxml2/nodeObj.h0000644000000000000000000000135411113705304021411 0ustar rootroot/* nodeObj.h -- * * This module manages libxml2 xmlNodePtr and event node Tcl objects. * * Copyright (c) 2003 Zveno Pty Ltd * http://www.zveno.com/ * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * $Id: nodeObj.h,v 1.3 2003/12/09 04:56:43 balls Exp $ */ #ifndef TCLDOM_LIBXML2_NODEOBJ_H #define TCLDOM_LIBXML2_NODEOBJ_H #include "tcl.h" #include #include "tcldom-libxml2.h" #define TCLDOM_LIBXML2_NODE_NODE 0 #define TCLDOM_LIBXML2_NODE_EVENT 1 typedef void (TclDOM_libxml2Node_FreeHookProc) _ANSI_ARGS_((ClientData clientData)); int TclDOM_libxml2_NodeObjInit _ANSI_ARGS_((Tcl_Interp *interp)); #endif /* TCLDOM_LIBXML2_NODEOBJ_H */ tclxml-3.3~svn11.orig/include/tcldom-libxml2/tcldom-libxml2.h0000644000000000000000000001720111215700771022666 0ustar rootroot /* tcldom-libxml2.h -- * * libxml2 wrapper for TclDOM. * * Copyright (c) 2005-2008 Explain * http://www.explain.com.au/ * Copyright (c) 2002-2003 Zveno Pty Ltd * http://www.zveno.com/ * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * $Id: tcldomlibxml2.h,v 1.2 2005/05/24 21:09:56 balls Exp $ */ #ifndef __TCLDOM_LIBXML2_H__ #define __TCLDOM_LIBXML2_H__ #include #include #include #include #include #include #include /* * For C++ compilers, use extern "C" */ #ifdef __cplusplus extern "C" { #endif /* * These macros are used to control whether functions are being declared for * import or export in Windows, * They map to no-op declarations on non-Windows systems. * Assumes that tcl.h defines DLLEXPORT & DLLIMPORT correctly. * The default build on windows is for a DLL, which causes the DLLIMPORT * and DLLEXPORT macros to be nonempty. To build a static library, the * macro STATIC_BUILD should be defined before the inclusion of tcl.h * * If a function is being declared while it is being built * to be included in a shared library, then it should have the DLLEXPORT * storage class. If is being declared for use by a module that is going to * link against the shared library, then it should have the DLLIMPORT storage * class. If the symbol is beind declared for a static build or for use from a * stub library, then the storage class should be empty. * * The convention is that a macro called BUILD_xxxx, where xxxx is the * name of a library we are building, is set on the compile line for sources * that are to be placed in the library. When this macro is set, the * storage class will be set to DLLEXPORT. At the end of the header file, the * storage class will be reset to DLLIMPORt. */ #undef TCL_STORAGE_CLASS #ifdef BUILD_Tcldom_libxml2 # define TCL_STORAGE_CLASS DLLEXPORT #else # ifdef USE_TCL_STUBS # define TCL_STORAGE_CLASS # else # define TCL_STORAGE_CLASS DLLIMPORT # endif #endif /* * The following function is required to be defined in all stubs aware * extensions of TclDOM. The function is actually implemented in the stub * library, not the main Tcldom library, although there is a trivial * implementation in the main library in case an extension is statically * linked into an application. */ EXTERN CONST char * Tcldom_libxml2_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, CONST char *version, int exact)); #ifndef USE_TCLDOMXML_STUBS /* * When not using stubs, make it a macro. */ #define Tcldom_libxml2_InitStubs(interp, version, exact) \ Tcl_PkgRequire(interp, "dom::generic", version, exact) #endif /* * DOM-specific data structure to hook onto documents. */ typedef struct TclDOM_libxml2_Document { Tcl_Interp *interp; TclXML_libxml2_Document *tDocPtr; /* Pointer back to main document structure */ Tcl_Obj *objPtr; /* An object to hold onto for this document */ Tcl_Command cmd; /* Tcl command for this document */ Tcl_HashTable *nodes; int nodeCntr; /* * Validation support */ xmlSchemaPtr schema; /* XML Schemas */ xmlRelaxNGPtr relaxng; /* RELAX NG Schemas */ /* * Event support. * * These tables are indexed by xmlNodePtr. */ Tcl_HashTable *captureListeners; Tcl_HashTable *bubbleListeners; /* * Optimisation: boolean flag to indicate whether an * event listener is registered for an event type. * If no event listeners are registered then there is * no point in propagating the event. */ int listening[TCLDOM_NUM_EVENT_TYPES]; } TclDOM_libxml2_Document; /* * Node management */ /* * "nodes" are overloaded: they can be either a libxml2 xmlNodePtr or * an event, which is defined by this module. */ typedef struct _TclDOM_libxml2_Node TclDOM_libxml2_Node; #define TCLDOM_LIBXML2_NODE_NODE 0 #define TCLDOM_LIBXML2_NODE_EVENT 1 /* * Data structure to support Events */ typedef struct TclDOM_libxml2_Event { TclDOM_libxml2_Node *tNodePtr; /* Generic node structure for this event */ TclDOM_libxml2_Document *ownerDocument; /* Toplevel Document for this event */ enum TclDOM_EventTypes type; /* Enumerate rep of event type */ Tcl_Obj *typeObjPtr; /* For user defined event type */ int stopPropagation; int preventDefault; int dispatched; Tcl_Obj *altKey; Tcl_Obj *attrName; Tcl_Obj *attrChange; Tcl_Obj *bubbles; Tcl_Obj *button; Tcl_Obj *cancelable; Tcl_Obj *clientX; Tcl_Obj *clientY; Tcl_Obj *ctrlKey; Tcl_Obj *currentNode; Tcl_Obj *detail; Tcl_Obj *eventPhase; Tcl_Obj *metaKey; Tcl_Obj *newValue; Tcl_Obj *prevValue; Tcl_Obj *relatedNode; Tcl_Obj *screenX; Tcl_Obj *screenY; Tcl_Obj *shiftKey; Tcl_Obj *target; Tcl_Obj *timeStamp; Tcl_Obj *view; } TclDOM_libxml2_Event; typedef void (TclDOM_libxml2_Node_FreeHookProc) _ANSI_ARGS_((ClientData clientData)); struct _TclDOM_libxml2_Node { union { xmlNodePtr nodePtr; TclDOM_libxml2_Event *eventPtr; } ptr; int type; /* Distinguish between libxml2 nodes and events */ char *token; /* string rep of this node */ Tcl_Command cmd; /* Tcl command that access this structure */ void *objs; /* Opaque object for tracking Tcl_Obj's that refer to this node */ ClientData apphook; /* Application hook - not used by TclXML or TclDOM */ TclDOM_libxml2_Node_FreeHookProc *appfree; }; /* * Public API */ Tcl_Obj * TclDOM_libxml2_CreateObjFromDoc _ANSI_ARGS_((Tcl_Interp *interp, xmlDocPtr docPtr)); Tcl_Obj * TclDOM_libxml2_CreateObjFromNode _ANSI_ARGS_((Tcl_Interp *interp, xmlNodePtr nodePtr)); int TclDOM_libxml2_GetNodeFromObj _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, xmlNodePtr *nodePtrPtr)); int TclDOM_libxml2_GetTclNodeFromObj _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, TclDOM_libxml2_Node **tNodePtrPtr)); int TclDOM_libxml2_GetEventFromObj _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, TclDOM_libxml2_Event **eventPtrPtr)); int TclDOM_libxml2_GetTclEventFromObj _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, TclDOM_libxml2_Node **tNodePtrPtr)); int TclDOM_PostMutationEvent _ANSI_ARGS_((Tcl_Interp *interp, TclXML_libxml2_Document *tDocPtr, Tcl_Obj *nodeObjPtr, enum TclDOM_EventTypes type, Tcl_Obj *typeObjPtr, Tcl_Obj *bubblesPtr, Tcl_Obj *cancelablePtr, Tcl_Obj *relatedNodePtr, Tcl_Obj *prevValuePtr, Tcl_Obj *newValuePtr, Tcl_Obj *attrNamePtr, Tcl_Obj *attrChangePtr)); int TclDOM_AddEventListener _ANSI_ARGS_((Tcl_Interp *interp, TclXML_libxml2_Document *tDocPtr, void *tokenPtr, /* xmlNodePtr or xmlDocPtr */ enum TclDOM_EventTypes type, Tcl_Obj *typeObjPtr, Tcl_Obj *listenerPtr, int capturer)); Tcl_Obj * TclDOM_GetEventListener _ANSI_ARGS_((Tcl_Interp *interp, TclXML_libxml2_Document *tDocPtr, void *tokenPtr, enum TclDOM_EventTypes type, Tcl_Obj *typeObjPtr, int capturer)); int TclDOM_RemoveEventListener _ANSI_ARGS_((Tcl_Interp *interp, TclXML_libxml2_Document *tDocPtr, void *tokenPtr, enum TclDOM_EventTypes type, Tcl_Obj *typeObjPtr, Tcl_Obj *listenerPtr, int capturer)); int TclDOM_DispatchEvent _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *nodeObjPtr, Tcl_Obj *eventObjPtr, TclDOM_libxml2_Event *eventPtr)); /* * Accessor functions => Stubs */ /* #include #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT */ #ifdef __cplusplus } #endif #endif /* TCLDOM_LIBXML2_H__ */ tclxml-3.3~svn11.orig/include/tclxml/0000755000000000000000000000000011574742524016347 5ustar rootroottclxml-3.3~svn11.orig/include/tclxml/tclxml.h.in0000755000000000000000000002702211113705304020416 0ustar rootroot/* * tclxml.h -- * * Generic interface to XML parsers. * * Copyright (c) 2005-2007 by Explain. * Copyright (c) 1999-2004 Steve Ball, Zveno Pty Ltd * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * $Id: tclxml.h.in,v 1.1.2.1 2005/12/28 06:49:51 balls Exp $ * */ #ifndef __TCLXML_H__ #define __TCLXML_H__ #ifdef TCLXML_BUILD_AS_FRAMEWORK #include #else #include #endif /* TCLXML_BUILD_AS_FRAMEWORK */ #define TCLXML_VERSION "@PACKAGE_VERSION@" /* * Used to block the rest of this header file from resource compilers so * we can just get the version info. */ #ifndef RC_INVOKED /* TIP 27 update. If CONST84 is not defined we are compiling against a * core before 8.4 and have to disable some CONST'ness. */ #ifndef CONST84 # define CONST84 #endif /* * Fix the Borland bug that's in the EXTERN macro from tcl.h. */ #ifndef TCL_EXTERN # undef DLLIMPORT # undef DLLEXPORT # if defined(STATIC_BUILD) # define DLLIMPORT # define DLLEXPORT # elif (defined(__WIN32__) && (defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || (defined(__GNUC__) && defined(__declspec)))) || (defined(MAC_TCL) && FUNCTION_DECLSPEC) # define DLLIMPORT __declspec(dllimport) # define DLLEXPORT __declspec(dllexport) # elif defined(__BORLANDC__) # define OLDBORLAND 1 # define DLLIMPORT __import # define DLLEXPORT __export # else # define DLLIMPORT # define DLLEXPORT # endif /* Avoid name mangling from C++ compilers. */ # ifdef __cplusplus # define TCL_EXTRNC extern "C" # else # define TCL_EXTRNC extern # endif /* Pre-5.5 Borland requires the attributes be placed after the */ /* return type. */ # ifdef OLDBORLAND # define TCL_EXTERN(RTYPE) TCL_EXTRNC RTYPE TCL_STORAGE_CLASS # else # define TCL_EXTERN(RTYPE) TCL_EXTRNC TCL_STORAGE_CLASS RTYPE # endif #endif /* * These macros are used to control whether functions are being declared for * import or export in Windows, * They map to no-op declarations on non-Windows systems. * Assumes that tcl.h defines DLLEXPORT & DLLIMPORT correctly. * The default build on windows is for a DLL, which causes the DLLIMPORT * and DLLEXPORT macros to be nonempty. To build a static library, the * macro STATIC_BUILD should be defined before the inclusion of tcl.h * * If a function is being declared while it is being built * to be included in a shared library, then it should have the DLLEXPORT * storage class. If is being declared for use by a module that is going to * link against the shared library, then it should have the DLLIMPORT storage * class. If the symbol is beind declared for a static build or for use from a * stub library, then the storage class should be empty. * * The convention is that a macro called BUILD_xxxx, where xxxx is the * name of a library we are building, is set on the compile line for sources * that are to be placed in the library. When this macro is set, the * storage class will be set to DLLEXPORT. At the end of the header file, the * storage class will be reset to DLLIMPORt. */ #undef TCL_STORAGE_CLASS #ifdef BUILD_Tclxml # define TCL_STORAGE_CLASS DLLEXPORT #else # ifdef USE_TCLXML_STUBS # define TCL_STORAGE_CLASS # else # define TCL_STORAGE_CLASS DLLIMPORT # endif #endif /* * C API for TclXML generic layer * * C callback functions to application code and their registration functions. * These all mimic the Tcl callbacks. */ typedef int (TclXML_ElementStartProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData, Tcl_Obj *namePtr, Tcl_Obj *nsuri, Tcl_Obj *attListPtr, Tcl_Obj *nsDeclsPtr)); typedef int (TclXML_ElementEndProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData, Tcl_Obj *namePtr)); typedef int (TclXML_CharacterDataProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData, Tcl_Obj *dataPtr)); typedef int (TclXML_PIProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData, Tcl_Obj *targetPtr, Tcl_Obj *dataPtr)); typedef int (TclXML_DefaultProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData, Tcl_Obj *dataPtr)); typedef int (TclXML_UnparsedProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData, Tcl_Obj *entityPtr, Tcl_Obj *basePtr, Tcl_Obj *systemIdPtr, Tcl_Obj *publicIdPtr, Tcl_Obj *notationNamePtr)); typedef int (TclXML_NotationDeclProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData, Tcl_Obj *namePtr, Tcl_Obj *basePtr, Tcl_Obj *systemIdPtr, Tcl_Obj *publicIdPtr)); typedef int (TclXML_EntityProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData, Tcl_Obj *namePtr, Tcl_Obj *basePtr, Tcl_Obj *systemIdPtr, Tcl_Obj *publicIdPtr)); typedef int (TclXML_UnknownEncodingProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData, Tcl_Obj *dataPtr, void *info)); typedef int (TclXML_CommentProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData, Tcl_Obj *dataPtr)); typedef int (TclXML_NotStandaloneProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData)); typedef int (TclXML_ElementDeclProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData, Tcl_Obj *namePtr, Tcl_Obj *contentspecPtr)); typedef int (TclXML_AttlistDeclProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData, Tcl_Obj *elementnamePtr, Tcl_Obj *attrdefnsPtr)); typedef int (TclXML_StartDoctypeDeclProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData, Tcl_Obj *namePtr)); typedef int (TclXML_EndDoctypeDeclProc) _ANSI_ARGS_((Tcl_Interp *interp, ClientData clientData)); /* * The structure below is used to refer to a parser object. */ typedef struct TclXML_Info { Tcl_Interp *interp; /* Interpreter for this instance */ Tcl_Obj *name; /* name of this instance */ Tcl_Obj *base; /* base URI for document entity */ Tcl_Obj *encoding; /* character encoding */ void *parserClass; /* Parser-specific functions * Actually of type TclXML_ParserClassInfo */ ClientData clientData; /* Parser-specific data structure */ int final; /* input data complete? */ int validate; /* Validate document? */ int status; /* application status */ Tcl_Obj *result; /* application return result */ int continueCount; /* reference count for continue */ Tcl_Obj *context; /* reference to the context pointer */ Tcl_Obj *cdata; /* Accumulates character data */ int nowhitespace; /* Whether to ignore white space */ int reportempty; /* Whether to report empty elements */ int expandinternalentities; /* Whether to expand internal entities */ int paramentities; /* Whether to include parameter entities */ Tcl_Obj *elementstartcommand; /* Script for element start */ TclXML_ElementStartProc *elementstart; /* Callback for element start */ ClientData elementstartdata; Tcl_Obj *elementendcommand; /* Script for element end */ TclXML_ElementEndProc *elementend; /* Callback for element end */ ClientData elementenddata; Tcl_Obj *datacommand; /* Script for character data */ TclXML_CharacterDataProc *cdatacb; /* Callback for character data */ ClientData cdatacbdata; Tcl_Obj *picommand; /* Script for processing instruction */ TclXML_PIProc *pi; /* Callback for processing instruction */ ClientData pidata; Tcl_Obj *defaultcommand; /* Script for default data */ TclXML_DefaultProc *defaultcb; /* Callback for default data */ ClientData defaultdata; Tcl_Obj *unparsedcommand; /* Script for unparsed entity declaration */ TclXML_UnparsedProc *unparsed; /* Callback for unparsed entity declaraion */ ClientData unparseddata; Tcl_Obj *notationcommand; /* Script for notation declaration */ TclXML_NotationDeclProc *notation; /* Callback for notation declaraion */ ClientData notationdata; Tcl_Obj *entitycommand; /* Script for external entity */ TclXML_EntityProc *entity; /* Callback for external entity */ ClientData entitydata; Tcl_Obj *unknownencodingcommand; /* Script for unknown encoding */ TclXML_UnknownEncodingProc *unknownencoding; /* Callback for unknown encoding */ ClientData unknownencodingdata; /* Following added by ericm@scriptics */ Tcl_Obj *commentCommand; /* Script for comments */ TclXML_CommentProc *comment; /* Callback for comments */ ClientData commentdata; Tcl_Obj *notStandaloneCommand; /* Script for "not standalone" docs */ TclXML_NotStandaloneProc *notStandalone; /* Callback for "not standalone" docs */ ClientData notstandalonedata; Tcl_Obj *elementDeclCommand; /* Script for #ifdef USE_TCLXML_STUBS TCL_EXTRNC CONST char * TclXML_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, CONST char *version, int exact)); #endif #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #endif /* RC_INVOKED */ #endif /* __TCLXML_H__ */ tclxml-3.3~svn11.orig/include/tclxml/tclxmlDecls.h0000644000000000000000000003520611113705304020764 0ustar rootroot/* * tclxmlDecls.h -- * * Declarations of functions in the platform independent public TCLXML API. * */ #ifndef _TCLXMLDECLS #define _TCLXMLDECLS /* * WARNING: The contents of this file is automatically generated by the * genStubs.tcl script. Any modifications to the function declarations * below should be made in the tclxml.decls script. */ /* !BEGIN!: Do not edit below this line. */ /* * Exported function declarations: */ /* 0 */ EXTERN int Tclxml_Init _ANSI_ARGS_((Tcl_Interp * interp)); /* 1 */ EXTERN int Tclxml_SafeInit _ANSI_ARGS_((Tcl_Interp * interp)); /* 2 */ EXTERN int TclXML_RegisterXMLParser _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_ParserClassInfo * parser)); /* 3 */ EXTERN int TclXML_RegisterElementStartProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_ElementStartProc * callback)); /* 4 */ EXTERN int TclXML_RegisterElementEndProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_ElementEndProc * callback)); /* 5 */ EXTERN int TclXML_RegisterCharacterDataProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_CharacterDataProc * callback)); /* 6 */ EXTERN int TclXML_RegisterPIProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_PIProc * callback)); /* 7 */ EXTERN int TclXML_RegisterDefaultProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_DefaultProc * callback)); /* 8 */ EXTERN int TclXML_RegisterUnparsedProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_UnparsedProc * callback)); /* 9 */ EXTERN int TclXML_RegisterNotationDeclProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_NotationDeclProc * callback)); /* 10 */ EXTERN int TclXML_RegisterEntityProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_EntityProc * callback)); /* 11 */ EXTERN int TclXML_RegisterUnknownEncodingProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_UnknownEncodingProc * callback)); /* 12 */ EXTERN int TclXML_RegisterCommentProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_CommentProc * callback)); /* 13 */ EXTERN int TclXML_RegisterNotStandaloneProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_NotStandaloneProc * callback)); /* 14 */ EXTERN int TclXML_RegisterElementDeclProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_ElementDeclProc * callback)); /* 15 */ EXTERN int TclXML_RegisterAttListDeclProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_AttlistDeclProc * callback)); /* 16 */ EXTERN int TclXML_RegisterStartDoctypeDeclProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_StartDoctypeDeclProc * callback)); /* 17 */ EXTERN int TclXML_RegisterEndDoctypeDeclProc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_EndDoctypeDeclProc * callback)); /* 18 */ EXTERN void TclXML_ElementStartHandler _ANSI_ARGS_(( void * userdata, Tcl_Obj * name, Tcl_Obj * nsuri, Tcl_Obj * atts, Tcl_Obj * nsDeclsObj)); /* 19 */ EXTERN void TclXML_ElementEndHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * name)); /* 20 */ EXTERN void TclXML_CharacterDataHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * s)); /* 21 */ EXTERN void TclXML_ProcessingInstructionHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * target, Tcl_Obj * data)); /* 22 */ EXTERN int TclXML_ExternalEntityRefHandler _ANSI_ARGS_(( ClientData clientData, Tcl_Obj * openEntityNames, Tcl_Obj * base, Tcl_Obj * systemId, Tcl_Obj * publicId)); /* 23 */ EXTERN void TclXML_DefaultHandler _ANSI_ARGS_((void * userData, Tcl_Obj * s)); /* 24 */ EXTERN void TclXML_UnparsedDeclHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * entityname, Tcl_Obj * base, Tcl_Obj * systemId, Tcl_Obj * publicId, Tcl_Obj * notationName)); /* 25 */ EXTERN void TclXML_NotationDeclHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * notationName, Tcl_Obj * base, Tcl_Obj * systemId, Tcl_Obj * publicId)); /* 26 */ EXTERN int TclXML_UnknownEncodingHandler _ANSI_ARGS_(( void * encodingHandlerData, Tcl_Obj * name, void * info)); /* 27 */ EXTERN void TclXML_CommentHandler _ANSI_ARGS_((void * userData, Tcl_Obj * data)); /* 28 */ EXTERN int TclXML_NotStandaloneHandler _ANSI_ARGS_(( void * userData)); /* Slot 29 is reserved */ /* Slot 30 is reserved */ /* 31 */ EXTERN void TclXML_ElementDeclHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * name, Tcl_Obj * contentspec)); /* 32 */ EXTERN void TclXML_AttlistDeclHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * name, Tcl_Obj * attributes)); /* 33 */ EXTERN void TclXML_StartDoctypeDeclHandler _ANSI_ARGS_(( void * userData, Tcl_Obj * name)); /* 34 */ EXTERN void TclXML_EndDoctypeDeclHandler _ANSI_ARGS_(( void * userData)); typedef struct TclxmlStubs { int magic; struct TclxmlStubHooks *hooks; int (*tclxml_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */ int (*tclxml_SafeInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 1 */ int (*tclXML_RegisterXMLParser) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_ParserClassInfo * parser)); /* 2 */ int (*tclXML_RegisterElementStartProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_ElementStartProc * callback)); /* 3 */ int (*tclXML_RegisterElementEndProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_ElementEndProc * callback)); /* 4 */ int (*tclXML_RegisterCharacterDataProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_CharacterDataProc * callback)); /* 5 */ int (*tclXML_RegisterPIProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_PIProc * callback)); /* 6 */ int (*tclXML_RegisterDefaultProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_DefaultProc * callback)); /* 7 */ int (*tclXML_RegisterUnparsedProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_UnparsedProc * callback)); /* 8 */ int (*tclXML_RegisterNotationDeclProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_NotationDeclProc * callback)); /* 9 */ int (*tclXML_RegisterEntityProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_EntityProc * callback)); /* 10 */ int (*tclXML_RegisterUnknownEncodingProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_UnknownEncodingProc * callback)); /* 11 */ int (*tclXML_RegisterCommentProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_CommentProc * callback)); /* 12 */ int (*tclXML_RegisterNotStandaloneProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_NotStandaloneProc * callback)); /* 13 */ int (*tclXML_RegisterElementDeclProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_ElementDeclProc * callback)); /* 14 */ int (*tclXML_RegisterAttListDeclProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_AttlistDeclProc * callback)); /* 15 */ int (*tclXML_RegisterStartDoctypeDeclProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_StartDoctypeDeclProc * callback)); /* 16 */ int (*tclXML_RegisterEndDoctypeDeclProc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_Info * parser, ClientData clientData, TclXML_EndDoctypeDeclProc * callback)); /* 17 */ void (*tclXML_ElementStartHandler) _ANSI_ARGS_((void * userdata, Tcl_Obj * name, Tcl_Obj * nsuri, Tcl_Obj * atts, Tcl_Obj * nsDeclsObj)); /* 18 */ void (*tclXML_ElementEndHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * name)); /* 19 */ void (*tclXML_CharacterDataHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * s)); /* 20 */ void (*tclXML_ProcessingInstructionHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * target, Tcl_Obj * data)); /* 21 */ int (*tclXML_ExternalEntityRefHandler) _ANSI_ARGS_((ClientData clientData, Tcl_Obj * openEntityNames, Tcl_Obj * base, Tcl_Obj * systemId, Tcl_Obj * publicId)); /* 22 */ void (*tclXML_DefaultHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * s)); /* 23 */ void (*tclXML_UnparsedDeclHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * entityname, Tcl_Obj * base, Tcl_Obj * systemId, Tcl_Obj * publicId, Tcl_Obj * notationName)); /* 24 */ void (*tclXML_NotationDeclHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * notationName, Tcl_Obj * base, Tcl_Obj * systemId, Tcl_Obj * publicId)); /* 25 */ int (*tclXML_UnknownEncodingHandler) _ANSI_ARGS_((void * encodingHandlerData, Tcl_Obj * name, void * info)); /* 26 */ void (*tclXML_CommentHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * data)); /* 27 */ int (*tclXML_NotStandaloneHandler) _ANSI_ARGS_((void * userData)); /* 28 */ void *reserved29; void *reserved30; void (*tclXML_ElementDeclHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * name, Tcl_Obj * contentspec)); /* 31 */ void (*tclXML_AttlistDeclHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * name, Tcl_Obj * attributes)); /* 32 */ void (*tclXML_StartDoctypeDeclHandler) _ANSI_ARGS_((void * userData, Tcl_Obj * name)); /* 33 */ void (*tclXML_EndDoctypeDeclHandler) _ANSI_ARGS_((void * userData)); /* 34 */ } TclxmlStubs; #ifdef __cplusplus extern "C" { #endif extern TclxmlStubs *tclxmlStubsPtr; #ifdef __cplusplus } #endif #if defined(USE_TCLXML_STUBS) && !defined(USE_TCLXML_STUB_PROCS) /* * Inline function declarations: */ #ifndef Tclxml_Init #define Tclxml_Init \ (tclxmlStubsPtr->tclxml_Init) /* 0 */ #endif #ifndef Tclxml_SafeInit #define Tclxml_SafeInit \ (tclxmlStubsPtr->tclxml_SafeInit) /* 1 */ #endif #ifndef TclXML_RegisterXMLParser #define TclXML_RegisterXMLParser \ (tclxmlStubsPtr->tclXML_RegisterXMLParser) /* 2 */ #endif #ifndef TclXML_RegisterElementStartProc #define TclXML_RegisterElementStartProc \ (tclxmlStubsPtr->tclXML_RegisterElementStartProc) /* 3 */ #endif #ifndef TclXML_RegisterElementEndProc #define TclXML_RegisterElementEndProc \ (tclxmlStubsPtr->tclXML_RegisterElementEndProc) /* 4 */ #endif #ifndef TclXML_RegisterCharacterDataProc #define TclXML_RegisterCharacterDataProc \ (tclxmlStubsPtr->tclXML_RegisterCharacterDataProc) /* 5 */ #endif #ifndef TclXML_RegisterPIProc #define TclXML_RegisterPIProc \ (tclxmlStubsPtr->tclXML_RegisterPIProc) /* 6 */ #endif #ifndef TclXML_RegisterDefaultProc #define TclXML_RegisterDefaultProc \ (tclxmlStubsPtr->tclXML_RegisterDefaultProc) /* 7 */ #endif #ifndef TclXML_RegisterUnparsedProc #define TclXML_RegisterUnparsedProc \ (tclxmlStubsPtr->tclXML_RegisterUnparsedProc) /* 8 */ #endif #ifndef TclXML_RegisterNotationDeclProc #define TclXML_RegisterNotationDeclProc \ (tclxmlStubsPtr->tclXML_RegisterNotationDeclProc) /* 9 */ #endif #ifndef TclXML_RegisterEntityProc #define TclXML_RegisterEntityProc \ (tclxmlStubsPtr->tclXML_RegisterEntityProc) /* 10 */ #endif #ifndef TclXML_RegisterUnknownEncodingProc #define TclXML_RegisterUnknownEncodingProc \ (tclxmlStubsPtr->tclXML_RegisterUnknownEncodingProc) /* 11 */ #endif #ifndef TclXML_RegisterCommentProc #define TclXML_RegisterCommentProc \ (tclxmlStubsPtr->tclXML_RegisterCommentProc) /* 12 */ #endif #ifndef TclXML_RegisterNotStandaloneProc #define TclXML_RegisterNotStandaloneProc \ (tclxmlStubsPtr->tclXML_RegisterNotStandaloneProc) /* 13 */ #endif #ifndef TclXML_RegisterElementDeclProc #define TclXML_RegisterElementDeclProc \ (tclxmlStubsPtr->tclXML_RegisterElementDeclProc) /* 14 */ #endif #ifndef TclXML_RegisterAttListDeclProc #define TclXML_RegisterAttListDeclProc \ (tclxmlStubsPtr->tclXML_RegisterAttListDeclProc) /* 15 */ #endif #ifndef TclXML_RegisterStartDoctypeDeclProc #define TclXML_RegisterStartDoctypeDeclProc \ (tclxmlStubsPtr->tclXML_RegisterStartDoctypeDeclProc) /* 16 */ #endif #ifndef TclXML_RegisterEndDoctypeDeclProc #define TclXML_RegisterEndDoctypeDeclProc \ (tclxmlStubsPtr->tclXML_RegisterEndDoctypeDeclProc) /* 17 */ #endif #ifndef TclXML_ElementStartHandler #define TclXML_ElementStartHandler \ (tclxmlStubsPtr->tclXML_ElementStartHandler) /* 18 */ #endif #ifndef TclXML_ElementEndHandler #define TclXML_ElementEndHandler \ (tclxmlStubsPtr->tclXML_ElementEndHandler) /* 19 */ #endif #ifndef TclXML_CharacterDataHandler #define TclXML_CharacterDataHandler \ (tclxmlStubsPtr->tclXML_CharacterDataHandler) /* 20 */ #endif #ifndef TclXML_ProcessingInstructionHandler #define TclXML_ProcessingInstructionHandler \ (tclxmlStubsPtr->tclXML_ProcessingInstructionHandler) /* 21 */ #endif #ifndef TclXML_ExternalEntityRefHandler #define TclXML_ExternalEntityRefHandler \ (tclxmlStubsPtr->tclXML_ExternalEntityRefHandler) /* 22 */ #endif #ifndef TclXML_DefaultHandler #define TclXML_DefaultHandler \ (tclxmlStubsPtr->tclXML_DefaultHandler) /* 23 */ #endif #ifndef TclXML_UnparsedDeclHandler #define TclXML_UnparsedDeclHandler \ (tclxmlStubsPtr->tclXML_UnparsedDeclHandler) /* 24 */ #endif #ifndef TclXML_NotationDeclHandler #define TclXML_NotationDeclHandler \ (tclxmlStubsPtr->tclXML_NotationDeclHandler) /* 25 */ #endif #ifndef TclXML_UnknownEncodingHandler #define TclXML_UnknownEncodingHandler \ (tclxmlStubsPtr->tclXML_UnknownEncodingHandler) /* 26 */ #endif #ifndef TclXML_CommentHandler #define TclXML_CommentHandler \ (tclxmlStubsPtr->tclXML_CommentHandler) /* 27 */ #endif #ifndef TclXML_NotStandaloneHandler #define TclXML_NotStandaloneHandler \ (tclxmlStubsPtr->tclXML_NotStandaloneHandler) /* 28 */ #endif /* Slot 29 is reserved */ /* Slot 30 is reserved */ #ifndef TclXML_ElementDeclHandler #define TclXML_ElementDeclHandler \ (tclxmlStubsPtr->tclXML_ElementDeclHandler) /* 31 */ #endif #ifndef TclXML_AttlistDeclHandler #define TclXML_AttlistDeclHandler \ (tclxmlStubsPtr->tclXML_AttlistDeclHandler) /* 32 */ #endif #ifndef TclXML_StartDoctypeDeclHandler #define TclXML_StartDoctypeDeclHandler \ (tclxmlStubsPtr->tclXML_StartDoctypeDeclHandler) /* 33 */ #endif #ifndef TclXML_EndDoctypeDeclHandler #define TclXML_EndDoctypeDeclHandler \ (tclxmlStubsPtr->tclXML_EndDoctypeDeclHandler) /* 34 */ #endif #endif /* defined(USE_TCLXML_STUBS) && !defined(USE_TCLXML_STUB_PROCS) */ /* !END!: Do not edit above this line. */ #endif /* _TCLXMLDECLS */ tclxml-3.3~svn11.orig/include/tclxml-libxml2/0000755000000000000000000000000011574742525017717 5ustar rootroottclxml-3.3~svn11.orig/include/tclxml-libxml2/docObj.h0000644000000000000000000000352711113705304021256 0ustar rootroot/* docObj.h -- * * This module manages libxml2 xmlDocPtr Tcl objects. * * Copyright (c) 2003 Zveno Pty Ltd * http://www.zveno.com/ * * 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. * * $Id: docObj.h,v 1.2 2003/12/03 20:06:34 balls Exp $ */ #ifndef TCLXML_LIBXML2_DOCOBJ_H #define TCLXML_LIBXML2_DOCOBJ_H #ifdef TCLXML_BUILD_AS_FRAMEWORK #include #else #include #endif /* TCLXML_BUILD_AS_FRAMEWORK */ #include typedef void (TclXML_libxml2Doc_FreeHookProc) _ANSI_ARGS_((ClientData clientData)); /* * Values that define how documents are handled: * KEEP means that documents must be explicitly destroyed, * IMPLICIT means that documents will be destroyed when there are no longer * any references to it. */ typedef enum TclXML_libxml2_DocumentHandling { TCLXML_LIBXML2_DOCUMENT_KEEP, TCLXML_LIBXML2_DOCUMENT_IMPLICIT } TclXML_libxml2_DocumentHandling; typedef struct TclXML_libxml2_Document { xmlDocPtr docPtr; char *token; /* string rep of this document */ TclXML_libxml2_DocumentHandling keep; /* how to handle document destruction */ void *objs; /* List of Tcl_Obj's that reference this document */ ClientData dom; /* Hook for TclDOM data */ TclXML_libxml2Doc_FreeHookProc *domfree; ClientData apphook; /* Application hook - not used by TclXML or TclDOM */ TclXML_libxml2Doc_FreeHookProc *appfree; } TclXML_libxml2_Document; #endif /* TCLXML_LIBXML2_DOCOBJ_H */ tclxml-3.3~svn11.orig/include/tclxml-libxml2/tclxml-libxml2Decls.h0000644000000000000000000001411711215700771023706 0ustar rootroot/* * tclxml-libxml2Decls.h -- * * Declarations of functions in the platform independent public TCLXML/libxml2 API. * */ #ifndef _TCLXMLLIBXML2DECLS #define _TCLXMLLIBXML2DECLS /* * WARNING: The contents of this file is automatically generated by the * genStubs.tcl script. Any modifications to the function declarations * below should be made in the tcllibxml2.decls script. */ #include "docObj.h" #include /* !BEGIN!: Do not edit below this line. */ /* * Exported function declarations: */ /* 0 */ EXTERN int Tclxml_libxml2_Init _ANSI_ARGS_((Tcl_Interp * interp)); /* Slot 1 is reserved */ /* 2 */ EXTERN int TclXML_libxml2_InitDocObj _ANSI_ARGS_(( Tcl_Interp * interp)); /* 3 */ EXTERN Tcl_Obj * TclXML_libxml2_NewDocObj _ANSI_ARGS_(( Tcl_Interp * interp)); /* 4 */ EXTERN Tcl_Obj * TclXML_libxml2_CreateObjFromDoc _ANSI_ARGS_(( xmlDocPtr docPtr)); /* 5 */ EXTERN int TclXML_libxml2_GetDocFromObj _ANSI_ARGS_(( Tcl_Interp * interp, Tcl_Obj * objPtr, xmlDocPtr * docPtr)); /* 6 */ EXTERN int TclXML_libxml2_GetTclDocFromObj _ANSI_ARGS_(( Tcl_Interp * interp, Tcl_Obj * objPtr, TclXML_libxml2_Document ** tDocPtrPtr)); /* 7 */ EXTERN int TclXML_libxml2_GetTclDocFromNode _ANSI_ARGS_(( Tcl_Interp * interp, xmlNodePtr nodePtr, TclXML_libxml2_Document ** tDocPtrPtr)); /* 8 */ EXTERN void TclXML_libxml2_DestroyDocument _ANSI_ARGS_(( TclXML_libxml2_Document * tDocPtr)); /* 9 */ EXTERN void TclXML_libxml2_DocKeep _ANSI_ARGS_((Tcl_Obj * objPtr, TclXML_libxml2_DocumentHandling keep)); /* 10 */ EXTERN void TclXML_libxml2_ErrorHandler _ANSI_ARGS_((void * ctx, xmlErrorPtr error)); /* 11 */ EXTERN void TclXML_libxml2_ResetError _ANSI_ARGS_(( Tcl_Interp * interp)); /* 12 */ EXTERN Tcl_Obj * TclXML_libxml2_GetErrorObj _ANSI_ARGS_(( Tcl_Interp * interp)); /* 13 */ EXTERN void TclXML_libxml2_SetErrorNodeFunc _ANSI_ARGS_(( Tcl_Interp * interp, TclXML_ErrorNodeHandlerProc * proc)); /* 14 */ EXTERN int TclXML_libxml2_GetTclDocFromDoc _ANSI_ARGS_(( Tcl_Interp * interp, xmlDocPtr docPtr, TclXML_libxml2_Document ** tDocPtrPtr)); /* 15 */ EXTERN Tcl_Obj * TclXML_libxml2_GetBaseURIFromDoc _ANSI_ARGS_(( xmlDocPtr docPtr)); /* 16 */ EXTERN int TclXML_libxml2_SetBaseURI _ANSI_ARGS_(( Tcl_Interp * interp, xmlDocPtr docPtr, Tcl_Obj * uriObj)); typedef struct Tclxml_libxml2Stubs { int magic; struct Tclxml_libxml2StubHooks *hooks; int (*tclxml_libxml2_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */ void *reserved1; int (*tclXML_libxml2_InitDocObj) _ANSI_ARGS_((Tcl_Interp * interp)); /* 2 */ Tcl_Obj * (*tclXML_libxml2_NewDocObj) _ANSI_ARGS_((Tcl_Interp * interp)); /* 3 */ Tcl_Obj * (*tclXML_libxml2_CreateObjFromDoc) _ANSI_ARGS_((xmlDocPtr docPtr)); /* 4 */ int (*tclXML_libxml2_GetDocFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, xmlDocPtr * docPtr)); /* 5 */ int (*tclXML_libxml2_GetTclDocFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, TclXML_libxml2_Document ** tDocPtrPtr)); /* 6 */ int (*tclXML_libxml2_GetTclDocFromNode) _ANSI_ARGS_((Tcl_Interp * interp, xmlNodePtr nodePtr, TclXML_libxml2_Document ** tDocPtrPtr)); /* 7 */ void (*tclXML_libxml2_DestroyDocument) _ANSI_ARGS_((TclXML_libxml2_Document * tDocPtr)); /* 8 */ void (*tclXML_libxml2_DocKeep) _ANSI_ARGS_((Tcl_Obj * objPtr, TclXML_libxml2_DocumentHandling keep)); /* 9 */ void (*tclXML_libxml2_ErrorHandler) _ANSI_ARGS_((void * ctx, xmlErrorPtr error)); /* 10 */ void (*tclXML_libxml2_ResetError) _ANSI_ARGS_((Tcl_Interp * interp)); /* 11 */ Tcl_Obj * (*tclXML_libxml2_GetErrorObj) _ANSI_ARGS_((Tcl_Interp * interp)); /* 12 */ void (*tclXML_libxml2_SetErrorNodeFunc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_ErrorNodeHandlerProc * proc)); /* 13 */ } Tclxml_libxml2Stubs; #ifdef __cplusplus extern "C" { #endif extern Tclxml_libxml2Stubs *tclxml_libxml2StubsPtr; #ifdef __cplusplus } #endif #if defined(USE_TCLXML_LIBXML2_STUBS) && !defined(USE_TCLXML_LIBXML2_STUB_PROCS) /* * Inline function declarations: */ #ifndef Tclxml_libxml2_Init #define Tclxml_libxml2_Init \ (tclxml_libxml2StubsPtr->tclxml_libxml2_Init) /* 0 */ #endif /* Slot 1 is reserved */ #ifndef TclXML_libxml2_InitDocObj #define TclXML_libxml2_InitDocObj \ (tclxml_libxml2StubsPtr->tclXML_libxml2_InitDocObj) /* 2 */ #endif #ifndef TclXML_libxml2_NewDocObj #define TclXML_libxml2_NewDocObj \ (tclxml_libxml2StubsPtr->tclXML_libxml2_NewDocObj) /* 3 */ #endif #ifndef TclXML_libxml2_CreateObjFromDoc #define TclXML_libxml2_CreateObjFromDoc \ (tclxml_libxml2StubsPtr->tclXML_libxml2_CreateObjFromDoc) /* 4 */ #endif #ifndef TclXML_libxml2_GetDocFromObj #define TclXML_libxml2_GetDocFromObj \ (tclxml_libxml2StubsPtr->tclXML_libxml2_GetDocFromObj) /* 5 */ #endif #ifndef TclXML_libxml2_GetTclDocFromObj #define TclXML_libxml2_GetTclDocFromObj \ (tclxml_libxml2StubsPtr->tclXML_libxml2_GetTclDocFromObj) /* 6 */ #endif #ifndef TclXML_libxml2_GetTclDocFromNode #define TclXML_libxml2_GetTclDocFromNode \ (tclxml_libxml2StubsPtr->tclXML_libxml2_GetTclDocFromNode) /* 7 */ #endif #ifndef TclXML_libxml2_DestroyDocument #define TclXML_libxml2_DestroyDocument \ (tclxml_libxml2StubsPtr->tclXML_libxml2_DestroyDocument) /* 8 */ #endif #ifndef TclXML_libxml2_DocKeep #define TclXML_libxml2_DocKeep \ (tclxml_libxml2StubsPtr->tclXML_libxml2_DocKeep) /* 9 */ #endif #ifndef TclXML_libxml2_ErrorHandler #define TclXML_libxml2_ErrorHandler \ (tclxml_libxml2StubsPtr->tclXML_libxml2_ErrorHandler) /* 10 */ #endif #ifndef TclXML_libxml2_ResetError #define TclXML_libxml2_ResetError \ (tclxml_libxml2StubsPtr->tclXML_libxml2_ResetError) /* 11 */ #endif #ifndef TclXML_libxml2_GetErrorObj #define TclXML_libxml2_GetErrorObj \ (tclxml_libxml2StubsPtr->tclXML_libxml2_GetErrorObj) /* 12 */ #endif #ifndef TclXML_libxml2_SetErrorNodeFunc #define TclXML_libxml2_SetErrorNodeFunc \ (tclxml_libxml2StubsPtr->tclXML_libxml2_SetErrorNodeFunc) /* 13 */ #endif #endif /* defined(USE_TCLXML_LIBXML2_STUBS) && !defined(USE_TCLXML_LIBXML2_STUB_PROCS) */ /* !END!: Do not edit above this line. */ #endif /* _TCLXMLLLIBXML2DECLS */ tclxml-3.3~svn11.orig/include/tclxml-libxml2/tclxml-libxml2.h0000644000000000000000000000560611113705304022730 0ustar rootroot/* tcllibxml2.h -- * * This module provides an interface to libxml2. * * Copyright (c) 2005 Explain * http://www.explain.com.au/ * Copyright (c) 2003 Zveno Pty Ltd * http://www.zveno.com/ * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * $Id: tclxml-libxml2.h,v 1.2.2.1 2005/12/28 06:49:51 balls Exp $ */ #ifndef TCLXML_LIBXML2_H #define TCLXML_LIBXML2_H #include #include #include "docObj.h" /* * For C++ compilers, use extern "C" */ #ifdef __cplusplus extern "C" { #endif /* * These macros are used to control whether functions are being declared for * import or export in Windows, * They map to no-op declarations on non-Windows systems. * Assumes that tcl.h defines DLLEXPORT & DLLIMPORT correctly. * The default build on windows is for a DLL, which causes the DLLIMPORT * and DLLEXPORT macros to be nonempty. To build a static library, the * macro STATIC_BUILD should be defined before the inclusion of tcl.h * * If a function is being declared while it is being built * to be included in a shared library, then it should have the DLLEXPORT * storage class. If is being declared for use by a module that is going to * link against the shared library, then it should have the DLLIMPORT storage * class. If the symbol is beind declared for a static build or for use from a * stub library, then the storage class should be empty. * * The convention is that a macro called BUILD_xxxx, where xxxx is the * name of a library we are building, is set on the compile line for sources * that are to be placed in the library. When this macro is set, the * storage class will be set to DLLEXPORT. At the end of the header file, the * storage class will be reset to DLLIMPORt. */ #undef TCL_STORAGE_CLASS #ifdef BUILD_TclXML_libxml2 # define TCL_STORAGE_CLASS DLLEXPORT #else # ifdef USE_TCL_STUBS # define TCL_STORAGE_CLASS # else # define TCL_STORAGE_CLASS DLLIMPORT # endif #endif /* * The following function is required to be defined in all stubs aware * extensions of TclXML/libxml2. The function is actually implemented in the stub * library, not the main TclXML/libxml2 library, although there is a trivial * implementation in the main library in case an extension is statically * linked into an application. */ EXTERN CONST char * TclXML_libxml2_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, CONST char *version, int exact)); #ifndef USE_TCLXML_LIBXML2_STUBS /* * When not using stubs, make it a macro. */ #define TclXML_libxml2_InitStubs(interp, version, exact) \ Tcl_PkgRequire(interp, "xml::libxml2", version, exact) #endif /* * Accessor functions => Stubs */ #include #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #ifdef __cplusplus } #endif #endif /* TCLXML_LIBXML2_H */ tclxml-3.3~svn11.orig/include/tcldom/0000755000000000000000000000000011574742524016326 5ustar rootroottclxml-3.3~svn11.orig/include/tcldom/tcldom.h0000644000000000000000000002015411215700771017751 0ustar rootroot/* tcldom.h -- * * Generic layer of TclDOM API. * * Copyright (c) 2006-2009 Explain * http://www.explain.com.au/ * Copyright (c) 2002-2004 Zveno Pty Ltd * http://www.zveno.com/ * * 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. * * $Id: tcldom.h,v 1.11 2004/02/25 20:10:27 balls Exp $ */ #ifndef __TCLDOM_H__ #define __TCLDOM_H__ #include /* * For C++ compilers, use extern "C" */ #ifdef __cplusplus extern "C" { #endif /* * These macros are used to control whether functions are being declared for * import or export in Windows, * They map to no-op declarations on non-Windows systems. * Assumes that tcl.h defines DLLEXPORT & DLLIMPORT correctly. * The default build on windows is for a DLL, which causes the DLLIMPORT * and DLLEXPORT macros to be nonempty. To build a static library, the * macro STATIC_BUILD should be defined before the inclusion of tcl.h * * If a function is being declared while it is being built * to be included in a shared library, then it should have the DLLEXPORT * storage class. If is being declared for use by a module that is going to * link against the shared library, then it should have the DLLIMPORT storage * class. If the symbol is beind declared for a static build or for use from a * stub library, then the storage class should be empty. * * The convention is that a macro called BUILD_xxxx, where xxxx is the * name of a library we are building, is set on the compile line for sources * that are to be placed in the library. When this macro is set, the * storage class will be set to DLLEXPORT. At the end of the header file, the * storage class will be reset to DLLIMPORt. */ #undef TCL_STORAGE_CLASS #ifdef BUILD_tcldom # define TCL_STORAGE_CLASS DLLEXPORT #else # ifdef USE_TCL_STUBS # define TCL_STORAGE_CLASS # else # define TCL_STORAGE_CLASS DLLIMPORT # endif #endif /* * The main purpose of this module is to provide common switch tables * for command methods and options. */ enum TclDOM_DOMImplementationCommandMethods { TCLDOM_IMPL_HASFEATURE, TCLDOM_IMPL_CREATEDOCUMENT, TCLDOM_IMPL_CREATE, TCLDOM_IMPL_CREATEDOCUMENTTYPE, TCLDOM_IMPL_CREATENODE, TCLDOM_IMPL_DESTROY, TCLDOM_IMPL_ISNODE, TCLDOM_IMPL_PARSE, TCLDOM_IMPL_SELECTNODE, TCLDOM_IMPL_SERIALIZE, TCLDOM_IMPL_TRIM }; enum TclDOM_DocumentCommandMethods { TCLDOM_DOCUMENT_CGET, TCLDOM_DOCUMENT_CONFIGURE, TCLDOM_DOCUMENT_CREATEELEMENT, TCLDOM_DOCUMENT_CREATEDOCUMENTFRAGMENT, TCLDOM_DOCUMENT_CREATETEXTNODE, TCLDOM_DOCUMENT_CREATECOMMENT, TCLDOM_DOCUMENT_CREATECDATASECTION, TCLDOM_DOCUMENT_CREATEPI, TCLDOM_DOCUMENT_CREATEATTRIBUTE, TCLDOM_DOCUMENT_CREATEENTITY, TCLDOM_DOCUMENT_CREATEENTITYREFERENCE, TCLDOM_DOCUMENT_CREATEDOCTYPEDECL, TCLDOM_DOCUMENT_IMPORTNODE, TCLDOM_DOCUMENT_CREATEELEMENTNS, TCLDOM_DOCUMENT_CREATEATTRIBUTENS, TCLDOM_DOCUMENT_GETELEMENTSBYTAGNAMENS, TCLDOM_DOCUMENT_GETELEMENTSBYID, TCLDOM_DOCUMENT_CREATEEVENT, TCLDOM_DOCUMENT_GETELEMENTSBYTAGNAME, TCLDOM_DOCUMENT_DTD, TCLDOM_DOCUMENT_SCHEMA, TCLDOM_DOCUMENT_RELAXNG }; enum TclDOM_DocumentCommandOptions { TCLDOM_DOCUMENT_DOCTYPE, TCLDOM_DOCUMENT_IMPLEMENTATION, TCLDOM_DOCUMENT_DOCELEMENT, TCLDOM_DOCUMENT_KEEP, TCLDOM_DOCUMENT_BASEURI }; enum TclDOM_DocumentDTDSubmethods { TCLDOM_DOCUMENT_DTD_VALIDATE }; enum TclDOM_DocumentSchemaSubmethods { TCLDOM_DOCUMENT_SCHEMA_COMPILE, TCLDOM_DOCUMENT_SCHEMA_VALIDATE }; enum TclDOM_DocumentRelaxNGSubmethods { TCLDOM_DOCUMENT_RELAXNG_COMPILE, TCLDOM_DOCUMENT_RELAXNG_VALIDATE }; enum TclDOM_NodeCommandMethods { TCLDOM_NODE_CGET, TCLDOM_NODE_CONFIGURE, TCLDOM_NODE_INSERTBEFORE, TCLDOM_NODE_REPLACECHILD, TCLDOM_NODE_REMOVECHILD, TCLDOM_NODE_APPENDCHILD, TCLDOM_NODE_HASCHILDNODES, TCLDOM_NODE_CLONENODE, TCLDOM_NODE_CHILDREN, TCLDOM_NODE_PARENT, TCLDOM_NODE_PATH, TCLDOM_NODE_CREATENODE, TCLDOM_NODE_SELECTNODE, TCLDOM_NODE_STRINGVALUE, TCLDOM_NODE_ADDEVENTLISTENER, TCLDOM_NODE_REMOVEEVENTLISTENER, TCLDOM_NODE_DISPATCHEVENT, TCLDOM_NODE_ISSAMENODE }; enum TclDOM_NodeCommandOptions { TCLDOM_NODE_NODETYPE, TCLDOM_NODE_PARENTNODE, TCLDOM_NODE_CHILDNODES, TCLDOM_NODE_FIRSTCHILD, TCLDOM_NODE_LASTCHILD, TCLDOM_NODE_PREVIOUSSIBLING, TCLDOM_NODE_NEXTSIBLING, TCLDOM_NODE_ATTRIBUTES, TCLDOM_NODE_NAMESPACEURI, TCLDOM_NODE_PREFIX, TCLDOM_NODE_LOCALNAME, TCLDOM_NODE_NODEVALUE, TCLDOM_NODE_CDATASECTION, TCLDOM_NODE_NODENAME, TCLDOM_NODE_OWNERDOCUMENT, TCLDOM_NODE_ID }; enum TclDOM_NodeCommandAddEventListenerOptions { TCLDOM_NODE_ADDEVENTLISTENER_USECAPTURE }; enum TclDOM_ElementCommandMethods { TCLDOM_ELEMENT_CGET, TCLDOM_ELEMENT_CONFIGURE, TCLDOM_ELEMENT_GETATTRIBUTE, TCLDOM_ELEMENT_SETATTRIBUTE, TCLDOM_ELEMENT_REMOVEATTRIBUTE, TCLDOM_ELEMENT_GETATTRIBUTENS, TCLDOM_ELEMENT_SETATTRIBUTENS, TCLDOM_ELEMENT_REMOVEATTRIBUTENS, TCLDOM_ELEMENT_GETATTRIBUTENODE, TCLDOM_ELEMENT_SETATTRIBUTENODE, TCLDOM_ELEMENT_REMOVEATTRIBUTENODE, TCLDOM_ELEMENT_GETATTRIBUTENODENS, TCLDOM_ELEMENT_SETATTRIBUTENODENS, TCLDOM_ELEMENT_REMOVEATTRIBUTENODENS, TCLDOM_ELEMENT_GETELEMENTSBYTAGNAME, TCLDOM_ELEMENT_NORMALIZE }; enum TclDOM_ElementCommandOptions { TCLDOM_ELEMENT_TAGNAME, TCLDOM_ELEMENT_EMPTY }; enum TclDOM_EventCommandMethods { TCLDOM_EVENT_CGET, TCLDOM_EVENT_CONFIGURE, TCLDOM_EVENT_STOPPROPAGATION, TCLDOM_EVENT_PREVENTDEFAULT, TCLDOM_EVENT_INITEVENT, TCLDOM_EVENT_INITUIEVENT, TCLDOM_EVENT_INITMOUSEEVENT, TCLDOM_EVENT_INITMUTATIONEVENT, TCLDOM_EVENT_POSTUIEVENT, TCLDOM_EVENT_POSTMOUSEEVENT, TCLDOM_EVENT_POSTMUTATIONEVENT }; enum TclDOM_EventCommandOptions { TCLDOM_EVENT_ALTKEY, TCLDOM_EVENT_ATTRNAME, TCLDOM_EVENT_ATTRCHANGE, TCLDOM_EVENT_BUBBLES, TCLDOM_EVENT_BUTTON, TCLDOM_EVENT_CANCELABLE, TCLDOM_EVENT_CLIENTX, TCLDOM_EVENT_CLIENTY, TCLDOM_EVENT_CTRLKEY, TCLDOM_EVENT_CURRENTNODE, TCLDOM_EVENT_DETAIL, TCLDOM_EVENT_EVENTPHASE, TCLDOM_EVENT_METAKEY, TCLDOM_EVENT_NEWVALUE, TCLDOM_EVENT_PREVVALUE, TCLDOM_EVENT_RELATEDNODE, TCLDOM_EVENT_SCREENX, TCLDOM_EVENT_SCREENY, TCLDOM_EVENT_SHIFTKEY, TCLDOM_EVENT_TARGET, TCLDOM_EVENT_TIMESTAMP, TCLDOM_EVENT_TYPE, TCLDOM_EVENT_VIEW }; /* * NB. TCLDOM_EVENT_USERDEFINED does not have an entry in the string table. */ enum TclDOM_EventTypes { TCLDOM_EVENT_DOMFOCUSIN, TCLDOM_EVENT_DOMFOCUSOUT, TCLDOM_EVENT_DOMACTIVATE, TCLDOM_EVENT_CLICK, TCLDOM_EVENT_MOUSEDOWN, TCLDOM_EVENT_MOUSEUP, TCLDOM_EVENT_MOUSEOVER, TCLDOM_EVENT_MOUSEMOVE, TCLDOM_EVENT_MOUSEOUT, TCLDOM_EVENT_DOMSUBTREEMODIFIED, TCLDOM_EVENT_DOMNODEINSERTED, TCLDOM_EVENT_DOMNODEREMOVED, TCLDOM_EVENT_DOMNODEINSERTEDINTODOCUMENT, TCLDOM_EVENT_DOMNODEREMOVEDFROMDOCUMENT, TCLDOM_EVENT_DOMATTRMODIFIED, TCLDOM_EVENT_DOMCHARACTERDATAMODIFIED, TCLDOM_EVENT_USERDEFINED }; enum TclDOM_ParseCommandOptions { TCLDOM_PARSE_BASEURI, TCLDOM_PARSE_EXTERNALENTITYCOMMAND }; enum TclDOM_SerializeCommandOptions { TCLDOM_SERIALIZE_INDENT, TCLDOM_SERIALIZE_METHOD, TCLDOM_SERIALIZE_ENCODING, TCLDOM_SERIALIZE_OMIT_XML_DECLARATION }; enum TclDOM_SerializeMethods { TCLDOM_SERIALIZE_METHOD_XML, TCLDOM_SERIALIZE_METHOD_HTML, TCLDOM_SERIALIZE_METHOD_TEXT }; enum TclDOM_SelectNodeOptions { TCLDOM_SELECTNODE_OPTION_NAMESPACES }; /* * DOM Level 2 Event support */ #define TCLDOM_NUM_EVENT_TYPES 17 /* * The following function is required to be defined in all stubs aware * extensions of TclDOM. The function is actually implemented in the stub * library, not the main Tcldom library, although there is a trivial * implementation in the main library in case an extension is statically * linked into an application. */ #ifndef USE_TCLDOM_STUBS #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #endif #ifdef __cplusplus } #endif #endif /* __TCLDOM_H__ */ tclxml-3.3~svn11.orig/include/tclxslt/0000755000000000000000000000000011574742525016542 5ustar rootroottclxml-3.3~svn11.orig/include/tclxslt/tclxslt.h0000644000000000000000000000536311113705304020376 0ustar rootroot/* tclxslt.h -- * * Public interfaces to TclXSLT package. * * Copyright (c) 2005-2007 Explain * http://www.explain.com.au/ * Copyright (c) 2001-2004 Zveno Pty Ltd * http://www.zveno.com/ * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * $Id: tclxslt.h,v 1.5 2005/05/24 21:12:18 balls Exp $ */ #ifndef __TCLXSLT_H__ #define __TCLXSLT_H__ #ifdef TCLXML_BUILD_AS_FRAMEWORK #include #else #include #endif /* TCLXML_BUILD_AS_FRAMEWORK */ #include #include #include #include #include #include #include #include #include /* * For C++ compilers, use extern "C" */ #ifdef __cplusplus extern "C" { #endif /* * These macros are used to control whether functions are being declared for * import or export in Windows, * They map to no-op declarations on non-Windows systems. * Assumes that tcl.h defines DLLEXPORT & DLLIMPORT correctly. * The default build on windows is for a DLL, which causes the DLLIMPORT * and DLLEXPORT macros to be nonempty. To build a static library, the * macro STATIC_BUILD should be defined before the inclusion of tcl.h * * If a function is being declared while it is being built * to be included in a shared library, then it should have the DLLEXPORT * storage class. If is being declared for use by a module that is going to * link against the shared library, then it should have the DLLIMPORT storage * class. If the symbol is beind declared for a static build or for use from a * stub library, then the storage class should be empty. * * The convention is that a macro called BUILD_xxxx, where xxxx is the * name of a library we are building, is set on the compile line for sources * that are to be placed in the library. When this macro is set, the * storage class will be set to DLLEXPORT. At the end of the header file, the * storage class will be reset to DLLIMPORt. */ #undef TCL_STORAGE_CLASS #ifdef BUILD_Tclxslt # define TCL_STORAGE_CLASS DLLEXPORT #else # ifdef USE_TCL_STUBS # define TCL_STORAGE_CLASS # else # define TCL_STORAGE_CLASS DLLIMPORT # endif #endif /* * Declarations for externally visible functions. */ EXTERN int Tclxslt_libxslt_Init _ANSI_ARGS_((Tcl_Interp *interp)); EXTERN int Tclxslt_libxslt_SafeInit _ANSI_ARGS_((Tcl_Interp *interp)); /* * Class creation command for XSLT compiled stylesheet objects. */ EXTERN Tcl_ObjCmdProc TclXSLTCompileStylesheet; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #ifdef __cplusplus } #endif #endif /* __TCLXSLT_H__ */