Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:wip
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wip
Files: files | file ages | folders
SHA3-256: 4e69c38f1c2ca10c26ce9e357a458145a27371ca9c11218d8d6ecd5c9f24e4e6
User & Date: rolf 2024-07-06 01:51:15
Context
2024-07-06
13:01
wip check-in: d5a6827d04 user: rolf tags: wip
01:51
wip check-in: 4e69c38f1c user: rolf tags: wip
01:49
wip check-in: e337d16a06 user: rolf tags: wip
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/dom.c.

519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
\--------------------------------------------------------------------------*/
int
domIsComment (
    const char *str
    )
{
    const char *p;
    int   len, i = 0;
    
    p = str;
    len = strlen (str);
    while (i < len) {
        if (*p == '-') {
            if (i == len - 1) return 0;
            p++; i++;







|







519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
\--------------------------------------------------------------------------*/
int
domIsComment (
    const char *str
    )
{
    const char *p;
    size_t len, i = 0;
    
    p = str;
    len = strlen (str);
    while (i < len) {
        if (*p == '-') {
            if (i == len - 1) return 0;
            p++; i++;
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
\--------------------------------------------------------------------------*/
int
domIsCDATA (
    const char *str
    )
{
    const char *p;
    int   len, i = 0;

    p = str;
    len = strlen (str);
    while (i < len - 2) {
        if (  *p == ']'
            && p[1] == ']'
            && p[2] == '>') return 0;







|







544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
\--------------------------------------------------------------------------*/
int
domIsCDATA (
    const char *str
    )
{
    const char *p;
    size_t len, i = 0;

    p = str;
    len = strlen (str);
    while (i < len - 2) {
        if (  *p == ']'
            && p[1] == ']'
            && p[2] == '>') return 0;
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
\--------------------------------------------------------------------------*/
int
domIsPIValue (
    const char *str
    )
{
    const char *p;
    int   len, i = 0;

    p = str;
    len = strlen (str);
    while (i < len - 1) {
        if (*p == '?' && p[1] == '>') return 0;
        p++; i++;
    }







|







567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
\--------------------------------------------------------------------------*/
int
domIsPIValue (
    const char *str
    )
{
    const char *p;
    size_t len, i = 0;

    p = str;
    len = strlen (str);
    while (i < len - 1) {
        if (*p == '?' && p[1] == '>') return 0;
        p++; i++;
    }
1217
1218
1219
1220
1221
1222
1223

1224
1225
1226
1227
1228
1229
1230
1231
{
    domReadInfo   *info = userData;
    domNode       *node, *parentNode;
    domLineColumn *lc;
    domAttrNode   *attrnode, *lastAttr;
    const char   **atPtr, **idAttPtr;
    Tcl_HashEntry *h;

    int            hnew, len, pos, idatt, newNS, result;
    const char    *xmlns, *localname;
    char           tagPrefix[MAX_PREFIX_LEN];
    char           prefix[MAX_PREFIX_LEN];
    domNS         *ns;
    char           feedbackCmd[24];

    if (info->feedbackAfter) {







>
|







1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
{
    domReadInfo   *info = userData;
    domNode       *node, *parentNode;
    domLineColumn *lc;
    domAttrNode   *attrnode, *lastAttr;
    const char   **atPtr, **idAttPtr;
    Tcl_HashEntry *h;
    size_t         len;
    int            hnew, pos, idatt, newNS, result;
    const char    *xmlns, *localname;
    char           tagPrefix[MAX_PREFIX_LEN];
    char           prefix[MAX_PREFIX_LEN];
    domNS         *ns;
    char           feedbackCmd[24];

    if (info->feedbackAfter) {
1763
1764
1765
1766
1767
1768
1769

1770
1771
1772
1773
1774
1775
1776
1777
    const char  *s
)
{
    domReadInfo   *info = userData;
    domTextNode   *node;
    domNode       *parentNode;
    domLineColumn *lc;

    int            len, hnew;
    Tcl_HashEntry *h;

    if (info->insideDTD) {
        DBG(fprintf (stderr, "commentHandler: insideDTD, skipping\n");)
        return;
    }








>
|







1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
    const char  *s
)
{
    domReadInfo   *info = userData;
    domTextNode   *node;
    domNode       *parentNode;
    domLineColumn *lc;
    size_t         len;
    int            hnew;
    Tcl_HashEntry *h;

    if (info->insideDTD) {
        DBG(fprintf (stderr, "commentHandler: insideDTD, skipping\n");)
        return;
    }

1843
1844
1845
1846
1847
1848
1849

1850
1851
1852
1853
1854
1855
1856
1857
    const char *data
)
{
    domProcessingInstructionNode *node;
    domReadInfo                  *info = userData;
    domNode                      *parentNode;
    domLineColumn                *lc;

    int                           len,hnew;
    Tcl_HashEntry                *h;

    if (info->insideDTD) {
        DBG(fprintf (stderr, 
                     "processingInstructionHandler: insideDTD, skipping\n");)
        return;
    }







>
|







1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
    const char *data
)
{
    domProcessingInstructionNode *node;
    domReadInfo                  *info = userData;
    domNode                      *parentNode;
    domLineColumn                *lc;
    size_t                        len;
    int                           hnew;
    Tcl_HashEntry                *h;

    if (info->insideDTD) {
        DBG(fprintf (stderr, 
                     "processingInstructionHandler: insideDTD, skipping\n");)
        return;
    }

Changes to generic/domalloc.c.

349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
domFree (
    void  * mem
)
{
    domAllocBlock * block;
    domAllocBlock * hashedBlock;
    domAllocBlock * prevBlock;
    int             slotNr, i, foundInCache;
    unsigned int  * usedBitmap;
    unsigned int    mask;

    DBG(fprintf(stderr, "domFree...\n");)

    if (mem == NULL) return;








|







349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
domFree (
    void  * mem
)
{
    domAllocBlock * block;
    domAllocBlock * hashedBlock;
    domAllocBlock * prevBlock;
    domLength       slotNr, i, foundInCache;
    unsigned int  * usedBitmap;
    unsigned int    mask;

    DBG(fprintf(stderr, "domFree...\n");)

    if (mem == NULL) return;

Changes to generic/domhtml.c.

2338
2339
2340
2341
2342
2343
2344
2345

2346
2347
2348
2349
2350
2351
2352
{
    char *z;     /* Pointer to nodeValue to rewrite */
    int from;    /* Read characters from this position in z[] */
    int to;      /* Write characters into this position in z[] */
    int h;       /* A hash on the entity reference */
    char *zVal;  /* The substituted value */
    Er *p;       /* For looping down the entity reference collision chain */
    int value, zlen, overlen; 

    char *ole, *newNodeValue;
    
    if (textOrAtt->nodeType == ATTRIBUTE_NODE) {
        z = ((domAttrNode*)textOrAtt)->nodeValue;
        zlen = ((domAttrNode*)textOrAtt)->valueLength;
    } else {
        z = textOrAtt->nodeValue;







|
>







2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
{
    char *z;     /* Pointer to nodeValue to rewrite */
    int from;    /* Read characters from this position in z[] */
    int to;      /* Write characters into this position in z[] */
    int h;       /* A hash on the entity reference */
    char *zVal;  /* The substituted value */
    Er *p;       /* For looping down the entity reference collision chain */
    int value, overlen;
    domLength  zlen;
    char *ole, *newNodeValue;
    
    if (textOrAtt->nodeType == ATTRIBUTE_NODE) {
        z = ((domAttrNode*)textOrAtt)->nodeValue;
        zlen = ((domAttrNode*)textOrAtt)->valueLength;
    } else {
        z = textOrAtt->nodeValue;

Changes to generic/domxpath.c.

2318
2319
2320
2321
2322
2323
2324

2325
2326
2327
2328
2329
2330
2331
2332
    char           **prefixMappings, 
    xpathParseVarCB *varParseCB,
    ast             *t,
    char           **errMsg
)
{
    XPathTokens tokens;

    int  i, l, len, newlen, slen;
    int  useNamespaceAxis = 0;
    char tmp[200];

    DDBG(fprintf(stderr, "\nLex output following tokens for '%s':\n", xpath);)
    *errMsg = NULL;
    tokens = xpathLexer(xpath, exprContext, prefixMappings, &useNamespaceAxis, 
                        varParseCB, errMsg);







>
|







2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
    char           **prefixMappings, 
    xpathParseVarCB *varParseCB,
    ast             *t,
    char           **errMsg
)
{
    XPathTokens tokens;
    int  i, l;
    size_t len, newlen, slen;
    int  useNamespaceAxis = 0;
    char tmp[200];

    DDBG(fprintf(stderr, "\nLex output following tokens for '%s':\n", xpath);)
    *errMsg = NULL;
    tokens = xpathLexer(xpath, exprContext, prefixMappings, &useNamespaceAxis, 
                        varParseCB, errMsg);

Changes to generic/domxslt.c.

924
925
926
927
928
929
930

931
932
933
934
935
936
937
938
    int               value,
    Tcl_DString      *str,
    char             *groupingSeparator,
    long              groupingSize,
    int               addSeparater
)
{

    int         len, fulllen, gslen, upper = 0, e, m, b, i, z, v;
    char        tmp[80], *pt;
    Tcl_DString tmp1;
    static struct { char *digit; char *ldigit; int value; } RomanDigit[] = {
          { "M" , "m" , 1000, },
          { "CM", "cm",  900, },
          { "D" , "d" ,  500, },
          { "CD", "cd",  400, },







>
|







924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
    int               value,
    Tcl_DString      *str,
    char             *groupingSeparator,
    long              groupingSize,
    int               addSeparater
)
{
    size_t      len, fulllen, gslen;
    int         upper = 0, e, m, b, i, z, v;
    char        tmp[80], *pt;
    Tcl_DString tmp1;
    static struct { char *digit; char *ldigit; int value; } RomanDigit[] = {
          { "M" , "m" , 1000, },
          { "CM", "cm",  900, },
          { "D" , "d" ,  500, },
          { "CD", "cd",  400, },
1145
1146
1147
1148
1149
1150
1151

1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
)
{
    Tcl_UniChar prefix1[800], prefix2[800], suffix1[800], suffix2[800];
    Tcl_UniChar save = '\0', save1, t, *prefix, *suffix, n[800], f[800];
    Tcl_UniChar uniCharNull = '\0';
    char stmp[240], ftmp[80], *tstr;
    char wrongFormat[] = "Unable to interpret format pattern.";

    int i, j, k, l, zl, g, nHash, nZero, fHash, fZero, gLen, isNeg;
    int prefixMinux, percentMul = 0, perMilleMul = 0;
    Tcl_DString  dStr, s;
    Tcl_UniChar *format, *negformat = NULL, *p, *p1;
    DBG(Tcl_DString dbStr;)

    DBG(fprintf(stderr, "number: '%f'\nformatStr='%s' \n", number, formatStr);)
    prefix1[0] = '\0';
    prefix2[0] = '\0';
    suffix1[0] = '\0';
    suffix2[0] = '\0';
    n[0] = '\0';







>
|



|







1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
)
{
    Tcl_UniChar prefix1[800], prefix2[800], suffix1[800], suffix2[800];
    Tcl_UniChar save = '\0', save1, t, *prefix, *suffix, n[800], f[800];
    Tcl_UniChar uniCharNull = '\0';
    char stmp[240], ftmp[80], *tstr;
    char wrongFormat[] = "Unable to interpret format pattern.";
    size_t l, zl, gLen;
    int i, j, k, g, nHash, nZero, fHash, fZero, isNeg;
    int prefixMinux, percentMul = 0, perMilleMul = 0;
    Tcl_DString  dStr, s;
    Tcl_UniChar *format, *negformat = NULL, *p, *p1;
    DBG(Tcl_DString bStr;)

    DBG(fprintf(stderr, "number: '%f'\nformatStr='%s' \n", number, formatStr);)
    prefix1[0] = '\0';
    prefix2[0] = '\0';
    suffix1[0] = '\0';
    suffix2[0] = '\0';
    n[0] = '\0';
1754
1755
1756
1757
1758
1759
1760

1761
1762
1763
1764
1765
1766
1767
1768
\---------------------------------------------------------------------------*/
static void StripXMLSpace (
    xsltState  * xs,
    domNode    * node
)
{
    domNode       *child, *newChild, *parent;

    int            i, len, onlySpace, found, strip;
    char          *p, prefix[MAX_PREFIX_LEN];
    const char    *localName;
    double        *f;
    domNS         *ns;
    Tcl_HashEntry *h;
    Tcl_DString    dStr;








>
|







1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
\---------------------------------------------------------------------------*/
static void StripXMLSpace (
    xsltState  * xs,
    domNode    * node
)
{
    domNode       *child, *newChild, *parent;
    size_t         i, len;
    int            onlySpace, found, strip;
    char          *p, prefix[MAX_PREFIX_LEN];
    const char    *localName;
    double        *f;
    domNS         *ns;
    Tcl_HashEntry *h;
    Tcl_DString    dStr;

2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
    double      realA,
    double      realB,
    int       * greater
)
{
    int             rc;
    char           *strAptr, *strBptr;
    int             lenA, lenB, len;
    Tcl_UniChar     unicharA, unicharB;

    *greater = 0;

    if (typeText) {
        lenA = Tcl_NumUtfChars (strA, -1);
        lenB = Tcl_NumUtfChars (strB, -1);







|







2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
    double      realA,
    double      realB,
    int       * greater
)
{
    int             rc;
    char           *strAptr, *strBptr;
    domLength       lenA, lenB, len;
    Tcl_UniChar     unicharA, unicharB;

    *greater = 0;

    if (typeText) {
        lenA = Tcl_NumUtfChars (strA, -1);
        lenB = Tcl_NumUtfChars (strB, -1);

Changes to generic/xmlsimple.c.

339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
    int          keepCDATA,
    int          forest,
    char       **errStr
) {
    register int   c;          /* Next character of the input file */
    register char *pn;
    register char *x, *start, *piSep;
    int            saved;
    int            hasContent;
    domNode       *node;
    domNode       *parent_node = parent;
    domTextNode   *tnode;
    domAttrNode   *attrnode, *lastAttr, *attrList;
    int            ampersandSeen = 0;
    int            only_whites   = 0;







|







339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
    int          keepCDATA,
    int          forest,
    char       **errStr
) {
    register int   c;          /* Next character of the input file */
    register char *pn;
    register char *x, *start, *piSep;
    domLength      saved;
    int            hasContent;
    domNode       *node;
    domNode       *parent_node = parent;
    domTextNode   *tnode;
    domAttrNode   *attrnode, *lastAttr, *attrList;
    int            ampersandSeen = 0;
    int            only_whites   = 0;
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
            attrList = NULL;
#ifdef TDOM_NS
            lastNSAttr = NULL;
            NSattrList = NULL;
#endif            
            while ( (c=*x) && (c!='/') && (c!='>') ) {
                char *ArgName = x;
                int nArgName;
                char *ArgVal = NULL;
                int nArgVal = 0;

                while ((c=*x)!=0 && c!='=' && c!='>' && !SPACE(c) ) {
                    x++;
                }
                nArgName = x - ArgName;
                while (SPACE(*x)) {
                    x++;







|

|







770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
            attrList = NULL;
#ifdef TDOM_NS
            lastNSAttr = NULL;
            NSattrList = NULL;
#endif            
            while ( (c=*x) && (c!='/') && (c!='>') ) {
                char *ArgName = x;
                domLength nArgName;
                char *ArgVal = NULL;
                domLength nArgVal = 0;

                while ((c=*x)!=0 && c!='=' && c!='>' && !SPACE(c) ) {
                    x++;
                }
                nArgName = x - ArgName;
                while (SPACE(*x)) {
                    x++;