richter     00/06/07 02:23:05

  Modified:    .        Tag: Embperl2 Changes.pod Embperl.xs embpcgi.bat
                        embpcgi.pl embpcgi.test.bat embpcgi.test.pl
                        embpexec.bat embpexec.pl epcmd2.c epcomp.c epdom.c
                        epdom.h test.pl
               test/cmp Tag: Embperl2 lists.htm
               test/html Tag: Embperl2 lists.htm
  Log:
  Embperl 2 - Attr_value inside loops
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.115.2.8 +3 -2      embperl/Changes.pod
  
  Index: Changes.pod
  ===================================================================
  RCS file: /home/cvs/embperl/Changes.pod,v
  retrieving revision 1.115.2.7
  retrieving revision 1.115.2.8
  diff -u -r1.115.2.7 -r1.115.2.8
  --- Changes.pod       2000/06/06 10:25:24     1.115.2.7
  +++ Changes.pod       2000/06/07 09:22:52     1.115.2.8
  @@ -31,13 +31,14 @@
      - The following options are currently not supported:
        optDisableHtmlScan, optDisableTableScan,
        optDisableInputScan, optDisableMetaScan 
  -   - Nesting must be properly. I.e. you cannot put a table tag (for an
  -     dynamic table) inside an if and the /table inside another if.
  +   - Nesting must be properly. I.e. you cannot put a <table> tag (for an
  +     dynamic table) inside an if and the </table> inside another if.
        (That still works for static tables)
      - optUndefToEmptyValue is always set and cannot be disabled.
      - make test works with Apache that has mod_jserv compiled in
      - [$ foreach $x (@x) $] requires now the bracket around the
        array (like Perl)
  +   - [* *] blocks works now as expected.
   
   
   =head1 1.3b4_dev -- That's what currently under developement
  
  
  
  1.26.2.18 +2 -2      embperl/Embperl.xs
  
  Index: Embperl.xs
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl.xs,v
  retrieving revision 1.26.2.17
  retrieving revision 1.26.2.18
  diff -u -r1.26.2.17 -r1.26.2.18
  --- Embperl.xs        2000/06/05 13:55:57     1.26.2.17
  +++ Embperl.xs        2000/06/07 09:22:52     1.26.2.18
  @@ -782,7 +782,7 @@
       char * sA = SV2String (sAttr, nAttr) ;
       tDomTree * pDomTree = DomTree_self (xDomTree) ;
   
  -    Element_selfSetAttribut (pDomTree, Node_self (pDomTree, xNode), sA, nAttr, sT, 
nText) ;
  +    Element_selfSetAttribut (pDomTree, Node_self (pDomTree, xNode), sA, nAttr, sT, 
nText, 1) ;
   
   
   
  @@ -797,7 +797,7 @@
       char * sA = SV2String (sAttr, nAttr) ;
       tDomTree * pDomTree = DomTree_self (xDomTree) ;
   
  -    Element_selfRemoveAttribut (pDomTree, Node_self (pDomTree, xNode), sA, nAttr) ;
  +    Element_selfRemoveAttribut (pDomTree, Node_self (pDomTree, xNode), sA, nAttr, 
1) ;
   
   
   SV *
  
  
  
  1.7.2.5   +2 -2      embperl/embpcgi.bat
  
  Index: embpcgi.bat
  ===================================================================
  RCS file: /home/cvs/embperl/embpcgi.bat,v
  retrieving revision 1.7.2.4
  retrieving revision 1.7.2.5
  diff -u -r1.7.2.4 -r1.7.2.5
  --- embpcgi.bat       2000/06/06 14:39:11     1.7.2.4
  +++ embpcgi.bat       2000/06/07 09:22:53     1.7.2.5
  @@ -1,9 +1,9 @@
   @rem = '--*-Perl-*--
   @echo off
  -/usr/bin/perl -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
  +D:\Perl\5.00502\bin\MSWin32-x86\perl -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
   goto endofperl
   @rem ';
  -#!/usr/bin/perl --
  +#!D:\Perl\5.00502\bin\MSWin32-x86\perl --
   #line 8
   ###################################################################################
   #
  
  
  
  1.7.2.5   +1 -1      embperl/embpcgi.pl
  
  Index: embpcgi.pl
  ===================================================================
  RCS file: /home/cvs/embperl/embpcgi.pl,v
  retrieving revision 1.7.2.4
  retrieving revision 1.7.2.5
  diff -u -r1.7.2.4 -r1.7.2.5
  --- embpcgi.pl        2000/06/06 14:39:12     1.7.2.4
  +++ embpcgi.pl        2000/06/07 09:22:53     1.7.2.5
  @@ -1,4 +1,4 @@
  -#!/usr/bin/perl 
  +#!D:\Perl\5.00502\bin\MSWin32-x86\perl 
   ###################################################################################
   #
   #   Embperl - Copyright (c) 1997-1999 Gerald Richter / ECOS
  
  
  
  1.5.2.5   +2 -2      embperl/embpcgi.test.bat
  
  Index: embpcgi.test.bat
  ===================================================================
  RCS file: /home/cvs/embperl/embpcgi.test.bat,v
  retrieving revision 1.5.2.4
  retrieving revision 1.5.2.5
  diff -u -r1.5.2.4 -r1.5.2.5
  --- embpcgi.test.bat  2000/06/06 14:39:13     1.5.2.4
  +++ embpcgi.test.bat  2000/06/07 09:22:53     1.5.2.5
  @@ -1,9 +1,9 @@
   @rem = '--*-Perl-*--
   @echo off
  -/usr/bin/perl -x -T %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
  +D:\Perl\5.00502\bin\MSWin32-x86\perl -x -T %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
   goto endofperl
   @rem ';
  -#!/usr/bin/perl --
  +#!D:\Perl\5.00502\bin\MSWin32-x86\perl --
   #line 8
   ###################################################################################
   #
  
  
  
  1.7.2.5   +1 -1      embperl/embpcgi.test.pl
  
  Index: embpcgi.test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/embpcgi.test.pl,v
  retrieving revision 1.7.2.4
  retrieving revision 1.7.2.5
  diff -u -r1.7.2.4 -r1.7.2.5
  --- embpcgi.test.pl   2000/06/06 14:39:13     1.7.2.4
  +++ embpcgi.test.pl   2000/06/07 09:22:53     1.7.2.5
  @@ -1,4 +1,4 @@
  -#!/usr/bin/perl 
  +#!D:\Perl\5.00502\bin\MSWin32-x86\perl 
   ###################################################################################
   #
   #   Embperl - Copyright (c) 1997-1999 Gerald Richter / ECOS
  
  
  
  1.18.2.5  +2 -2      embperl/embpexec.bat
  
  Index: embpexec.bat
  ===================================================================
  RCS file: /home/cvs/embperl/embpexec.bat,v
  retrieving revision 1.18.2.4
  retrieving revision 1.18.2.5
  diff -u -r1.18.2.4 -r1.18.2.5
  --- embpexec.bat      2000/06/06 14:39:13     1.18.2.4
  +++ embpexec.bat      2000/06/07 09:22:54     1.18.2.5
  @@ -1,9 +1,9 @@
   @rem = '--*-Perl-*--
   @echo off
  -/usr/bin/perl -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
  +D:\Perl\5.00502\bin\MSWin32-x86\perl -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
   goto endofperl
   @rem ';
  -#!/usr/bin/perl --
  +#!D:\Perl\5.00502\bin\MSWin32-x86\perl --
   #line 8
   ###################################################################################
   #
  
  
  
  1.18.2.5  +1 -1      embperl/embpexec.pl
  
  Index: embpexec.pl
  ===================================================================
  RCS file: /home/cvs/embperl/embpexec.pl,v
  retrieving revision 1.18.2.4
  retrieving revision 1.18.2.5
  diff -u -r1.18.2.4 -r1.18.2.5
  --- embpexec.pl       2000/06/06 14:39:13     1.18.2.4
  +++ embpexec.pl       2000/06/07 09:22:55     1.18.2.5
  @@ -1,4 +1,4 @@
  -#!/usr/bin/perl 
  +#!D:\Perl\5.00502\bin\MSWin32-x86\perl 
   ###################################################################################
   #
   #   Embperl - Copyright (c) 1997-1999 Gerald Richter / ECOS
  
  
  
  1.1.2.5   +2 -2      embperl/Attic/epcmd2.c
  
  Index: epcmd2.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epcmd2.c,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- epcmd2.c  2000/06/05 07:22:54     1.1.2.4
  +++ epcmd2.c  2000/06/07 09:22:56     1.1.2.5
  @@ -65,10 +65,10 @@
   
        if (bEqual)
            {
  -         Element_selfSetAttribut (pDomTree, pNode, sAttrName, nAttrLen, NULL, 0) ;
  +         Element_selfSetAttribut (pDomTree, pNode, sAttrName, nAttrLen, NULL, 0, 1) 
;
            }
        else
  -         Element_selfRemoveAttribut (pDomTree, pNode, sAttrName, nAttrLen) ;
  +         Element_selfRemoveAttribut (pDomTree, pNode, sAttrName, nAttrLen, 1) ;
        }
       else
        if (Element_selfGetAttribut (pDomTree, pNode, sAttrName, nAttrLen))
  
  
  
  1.1.2.27  +5 -0      embperl/Attic/epcomp.c
  
  Index: epcomp.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epcomp.c,v
  retrieving revision 1.1.2.26
  retrieving revision 1.1.2.27
  diff -u -r1.1.2.26 -r1.1.2.27
  --- epcomp.c  2000/06/06 10:25:26     1.1.2.26
  +++ epcomp.c  2000/06/07 09:22:56     1.1.2.27
  @@ -931,6 +931,11 @@
        if (pSV)
            {
            SV * args[2] ;
  +
  +         nCheckpointCache = 0 ;
  +         xCheckpointCache[nCheckpointCache++] = 0 ;
  +         xCheckpointCache[nCheckpointCache++] = 0 ;
  +         
            args[0] = r -> pReqSV ;
            args[1] = newSViv (r -> xCurrDomTree) ;
            CallStoredCV (r, pProg, (CV *)pSV, 2, args, 0, &pSV) ;
  
  
  
  1.1.2.30  +131 -26   embperl/Attic/epdom.c
  
  Index: epdom.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.c,v
  retrieving revision 1.1.2.29
  retrieving revision 1.1.2.30
  diff -u -r1.1.2.29 -r1.1.2.30
  --- epdom.c   2000/06/06 14:39:13     1.1.2.29
  +++ epdom.c   2000/06/07 09:22:56     1.1.2.30
  @@ -32,6 +32,11 @@
   tIndex xNoName  = 0 ;
   tIndex xDomTreeAttr = 0 ;
   
  +int nCheckpointCache = 0 ;
  +int nCheckpointCacheMask = 0x1ff ;
  +tIndex xCheckpointCache[512] ;
  +
  +
   #define dom_malloc(s)  (nMemUsage += s, malloc(s))
   #define dom_free(s)    (free(s))
   
  @@ -427,7 +432,7 @@
       ArrayNew (&pDomTree -> pLookup, 128, sizeof (struct tNodeData *)) ; 
       ArrayAdd (&pDomTree -> pLookup, 1) ;
   
  -    ArrayNew (&pDomTree -> pOrder, 128, sizeof (tNode)) ; 
  +    ArrayNew (&pDomTree -> pOrder, 128, sizeof (tDomTreeOrder)) ; 
   
       pDomTree -> xNdx = n ;
       pDomTree -> pLookup[0] = NULL ;
  @@ -464,7 +469,7 @@
       pDomTree -> xDocument = pOrgDomTree -> xDocument ;
   
       ArrayClone (pOrgDomTree, &pDomTree -> pLookup) ; 
  -    ArrayNew (&pDomTree -> pOrder, 128, sizeof (tNode)) ; 
  +    ArrayNew (&pDomTree -> pOrder, 128, sizeof (tDomTreeOrder)) ; 
   
       if (pDomTree -> pSV = pOrgDomTree -> pSV)
           SvREFCNT_inc (pDomTree -> pSV) ;
  @@ -474,7 +479,7 @@
       if (pDocument -> nType == ntypDocumentFraq)
        {
        pDocument = Node_selfCloneNode (pDomTree, pDocument, 1) ;
  -     Element_selfSetAttribut (pDomTree, pDocument, NULL, xDomTreeAttr, NULL, 
pDomTree -> xNdx) ;
  +     Element_selfSetAttribut (pDomTree, pDocument, NULL, xDomTreeAttr, NULL, 
pDomTree -> xNdx, 0) ;
        pDomTree -> xDocument = pDocument -> xNdx ;
        }
       
  @@ -498,7 +503,8 @@
       {
       tDomTree * pDomTree = DomTree_self (xDomTree) ;
       int n = ArrayAdd (&pDomTree -> pOrder, 1) ;
  -    (pDomTree -> pOrder)[n] = xChild ;
  +    (pDomTree -> pOrder)[n].xFromNode = xChild ;
  +    (pDomTree -> pOrder)[n].xToNode   = 0 ;
       if (pCurrReq -> bDebug & dbgParse)
        lprintf (pCurrReq, "[%d]Checkpoint: Node=%d OrderIndex %d\n", pCurrReq -> 
nPid, xChild, n) ; 
       }
  @@ -512,14 +518,15 @@
   /*                                                                          */
   /* ------------------------------------------------------------------------ */
   
  -void DomTree_selfCheckpoint (tDomTree * pDomTree, tNode xChild)
  +void DomTree_selfCheckpoint (tDomTree * pDomTree, tNode xFromNode, tNode xToNode)
   
   
       {
       int n = ArrayAdd (&pDomTree -> pOrder, 1) ;
  -    (pDomTree -> pOrder)[n] = xChild ;
  +    (pDomTree -> pOrder)[n].xFromNode = xFromNode ;
  +    (pDomTree -> pOrder)[n].xToNode   = xToNode ;
       if (pCurrReq -> bDebug & dbgParse)
  -     lprintf (pCurrReq, "[%d]Checkpoint: Node=%d OrderIndex %d\n", pCurrReq -> 
nPid, xChild, n) ; 
  +     lprintf (pCurrReq, "[%d]Checkpoint: Node=%d -> %d OrderIndex %d\n", pCurrReq 
-> nPid, xFromNode, xToNode, n) ; 
       }
   
   
  @@ -540,7 +547,7 @@
       {
       tNode    xNode ;
       tNodeData * pChild ;    
  -    tNode *     pOrder ;
  +    tDomTreeOrder *  pOrder ;
       int         n ;
       int         o ;
   
  @@ -572,7 +579,7 @@
       o = n = ArrayGetSize (pOrder) ;
       while (--n >= 0)
        {
  -     if (pOrder[n] == xNode)
  +     if (pOrder[n].xFromNode == xNode)
            break ;
        }
       ArraySetSize (&pDomTree -> pOrder, n) ;
  @@ -1109,6 +1116,7 @@
   
       {
       int              bFlags = nflgModified | nflgReturn ;
  +    tNode    xOrgChild  = xOldChild ;
       tNodeData *      pOldChild  = Node_self (pOldChildDomTree, xOldChild) ;
       tNodeData *      pNode      = Node_self (pDomTree, xNode) ;
       
  @@ -1168,10 +1176,10 @@
        }
   
       if (pOldChild -> nType == ntypDocumentFraq)
  -     Element_selfSetAttribut (pOldChildDomTree, pOldChild, NULL, xDomTreeAttr, 
NULL, pDomTree -> xNdx) ;
  +     Element_selfSetAttribut (pOldChildDomTree, pOldChild, NULL, xDomTreeAttr, 
NULL, pDomTree -> xNdx, 0) ;
   
        
  -    DomTree_selfCheckpoint (pOldChildDomTree, xOldChild) ;
  +    DomTree_selfCheckpoint (pOldChildDomTree, xOrgChild, xOldChild) ;
       
       return xOldChild ;
       }
  @@ -1195,8 +1203,11 @@
   
       {
       struct tNodeData *       pOldChild  = Node_self (pDomTree, xOldChild) ;
  +    tNode    xOrgChild  = xOldChild ;
       
   
  +    xCheckpointCache[nCheckpointCache++] = xOldChild ;
  +
       if (pOldChild -> bFlags & nflgModified)
        {
        pOldChild -> bFlags |= bFlags ;
  @@ -1204,8 +1215,13 @@
        xOldChild = pOldChild -> xNdx ;
        }
       
  -    DomTree_selfCheckpoint (pDomTree, xOldChild) ;
  +    DomTree_selfCheckpoint (pDomTree, xOrgChild, xOldChild) ;
       
  +    xCheckpointCache[nCheckpointCache++] = xOldChild ;
  +    nCheckpointCache &= nCheckpointCacheMask ;
  +    xCheckpointCache[nCheckpointCache] = 0 ;
  +
  +   
       if (nEscMode != -1)
        {
        pOldChild -> nType  = (nEscMode & 3)?ntypText:ntypCDATA ;
  @@ -1445,6 +1461,7 @@
       tNode xFirstNode = xNode ;
       tNode xNextNode ;
       int   nOrderNdx = *pOrderNdx ;
  +    int   nOrderIndexNode = -1 ;
       tNodeData * pNextNode ;
       tNodeData * pSavedNode = NULL ;
       tNodeData * pLastStartTag = NULL ;
  @@ -1462,7 +1479,7 @@
        {
        if (pNode -> bFlags & nflgCheckpoint)
            { /* see how the control flow contiounes */
  -         if ((xNextNode = pDomTree -> pOrder[nOrderNdx]) != pNode -> xNdx && 
xNextNode)      
  +         if ((xNextNode = pDomTree -> pOrder[nOrderNdx].xFromNode) != pNode -> xNdx 
&& xNextNode)    
                {
                tNodeData * pNewNode ;
                   tNodeData * pNewParent ;
  @@ -1499,14 +1516,24 @@
   
        if (pNode -> bFlags & nflgReturn)
            { /* we should use another node to replace this one */
  -         if ((xNextNode = pDomTree -> pOrder[nOrderNdx]) != pNode -> xNdx && 
xNextNode)      
  +         tDomTreeOrder * pOrder = pDomTree -> pOrder ;
  +         int             n      = ArrayGetSize (pOrder) ;
  +         int             i      = nOrderNdx ;
  +
  +         while (pOrder[i].xFromNode != pNode -> xNdx && i < n)  
  +             i++ ;
  +         
  +         if ((xNextNode = pOrder[i].xToNode) != pNode -> xNdx && xNextNode)  
                {
                if (pCurrReq -> bDebug & dbgParse)
                    lprintf (r, "[%d]toString: Replace Node=%d with Node=%d\n", r -> 
nPid, pNode -> xNdx, xNextNode) ; 
                pSavedNode = pNode ;    
                pNode  = Node_self (pDomTree, xNextNode) ;
                }
  -         nOrderNdx++ ;
  +         if (i == nOrderNdx)
  +             nOrderNdx++, nOrderIndexNode = -1 ;
  +         else
  +             nOrderIndexNode = i ;
            }
   
   
  @@ -1583,7 +1610,9 @@
            owrite (r, s, l);
            }
   
  -     
  +     if (nOrderNdx == nOrderIndexNode)
  +         nOrderNdx++ ;
  +
        if (pNode -> nType == ntypDocumentFraq)
            pNextNode = NULL ;
        else
  @@ -1597,7 +1626,7 @@
            while (pNextNode == NULL)
                {
                pNextNode = Node_selfParentNode (pDomTree, pNode) ;
  -             if (pNextNode == NULL || pNextNode  == pFirstNode)
  +             if (pNextNode == NULL || pNextNode  == pFirstNode || pNextNode -> 
nType == ntypAttr)
                       {
                       *pOrderNdx = nOrderNdx ;
                       return ;
  @@ -1606,7 +1635,7 @@
                pNode = pNextNode ;
                pNextNode  = Node_selfNextSibling (pDomTree, pNextNode) ;
                if (pNode -> nType == ntypStartTag && (pNode -> bFlags & nflgIgnore) 
== 0 &&
  -                 (pNextNode == NULL || (pNextNode -> bFlags & nflgCheckpoint) == 0 
|| pDomTree -> pOrder[nOrderNdx] == pNextNode -> xNdx))
  +                 (pNextNode == NULL || (pNextNode -> bFlags & nflgCheckpoint) == 0 
|| pDomTree -> pOrder[nOrderNdx].xFromNode == pNextNode -> xNdx))
                    {
                    oputs (r, "</") ;
                    oputs (r, Node_selfNodeName (pNode)) ;
  @@ -1722,7 +1751,7 @@
       struct tAttrData * pAttr = (struct tAttrData * )(pNode + 1) ;
       int  n = pNode -> numAttr ;
   
  -    while (n > 0 && nAttrName != pAttr -> xName && pAttr -> bFlags)
  +    while (n > 0 && (nAttrName != pAttr -> xName || !pAttr -> bFlags))
        {
        n-- ;
        pAttr++ ;
  @@ -1778,19 +1807,51 @@
                                      /*in*/ const char *       sAttrName,
                                      /*in*/ int                nAttrNameLen,
                                      /*in*/ const char *       sNewValue, 
  -                                   /*in*/ int                nNewValueLen)
  +                                   /*in*/ int                nNewValueLen,
  +                                   /*in*/ int                bClone)
   
       {
  -    struct tAttrData * pAttr = Element_selfGetAttribut (pDomTree, pNode, sAttrName, 
nAttrNameLen) ;
  +    tAttrData * pAttr = Element_selfGetAttribut (pDomTree, pNode, sAttrName, 
nAttrNameLen) ;
       tNode xAttr ;
  +    tNodeData * pNewNode ;
   
  +    if (bClone)
  +     pNode -> bFlags |= nflgReturn ;
  +    
       if (pAttr)
        {
  -     pAttr -> xValue = sNewValue?String2Ndx (sNewValue, nNewValueLen):nNewValueLen ;
  +     tIndex xValue = sNewValue?String2Ndx (sNewValue, nNewValueLen):nNewValueLen ;
  +     
  +     if (bClone)
  +         {
  +         if (pAttr -> xValue != xValue && (pNode -> bFlags & nflgModified))
  +             {
  +             pNewNode = Node_selfCloneNode (pDomTree, pNode, 1) ;
  +             pAttr = Element_selfGetAttribut (pDomTree, pNewNode, sAttrName, 
nAttrNameLen) ;
  +             
  +             DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNewNode -> xNdx) ;
  +             }
  +         else
  +             DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNode -> xNdx) ;
  +
  +         pNode -> bFlags |= nflgModified ;
  +         }
  +     pAttr -> xValue = xValue ;
        return pAttr ;
        }
  +
  +    if (pNode -> bFlags & nflgModified)
  +     pNewNode = Node_selfCloneNode (pDomTree, pNode, 1) ;
  +    else
  +     pNewNode = pNode ;
   
  -    xAttr = Node_appendChild (pDomTree, ntypAttr, 0, sAttrName, nAttrNameLen, pNode 
-> xNdx, 0) ;
  +    if (bClone)
  +     {
  +     pNode -> bFlags |= nflgModified ;
  +     DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNewNode -> xNdx) ;
  +     }
  +    
  +    xAttr = Node_appendChild (pDomTree, ntypAttr, 0, sAttrName, nAttrNameLen, 
pNewNode -> xNdx, 0) ;
       Node_appendChild (pDomTree, ntypAttrValue, 0, sNewValue, nNewValueLen, xAttr, 
0) ;
       return (tAttrData *)Node_self(pDomTree, xAttr) ;
       }
  @@ -1809,11 +1870,33 @@
   tAttrData *  Element_selfRemoveAttribut (/*in*/ tDomTree *           pDomTree,
                                      /*in*/ struct tNodeData * pNode,
                                      /*in*/ const char *       sAttrName,
  -                                   /*in*/ int                nAttrNameLen)
  +                                   /*in*/ int                nAttrNameLen,
  +                                   /*in*/ int                bClone)
   
       {
  -    struct tAttrData * pAttr = Element_selfGetAttribut (pDomTree, pNode, sAttrName, 
nAttrNameLen) ;
  +    tAttrData * pAttr ;
  +    tNodeData * pNewNode ;
  +    
  +    pAttr = Element_selfGetAttribut (pDomTree, pNode, sAttrName, nAttrNameLen) ;
  +    if (bClone)
  +     {
  +     if (pAttr != NULL && (pNode -> bFlags & nflgModified))
  +         {
  +         pNode -> bFlags |= nflgReturn | nflgModified ;
  +
  +         pNewNode = Node_selfCloneNode (pDomTree, pNode, 1) ;
  +         pAttr = Element_selfGetAttribut (pDomTree, pNewNode, sAttrName, 
nAttrNameLen) ;
       
  +         DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNewNode -> xNdx) ;
  +         }
  +     else
  +         {
  +         pNode -> bFlags |= nflgReturn | nflgModified ;
  +
  +         DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNode -> xNdx) ;
  +         }
  +     }
  +
       if (pAttr)
        pAttr -> bFlags = 0 ;
       /*
  @@ -1888,7 +1971,29 @@
        {
        char * s ;
        int    l ;
  -     Ndx2StringLen (pNode -> nText,s,l) ;
  +
  +     if (pNode -> bFlags & nflgReturn)
  +         {
  +         tIndex xNdx = pNode -> xNdx ;
  +         tNodeData * pUseNode ;
  +         int i = nCheckpointCache - 2 ;
  +     
  +         i &= nCheckpointCacheMask ;
  +         
  +         while (xCheckpointCache[i] && xCheckpointCache[i] != xNdx)
  +             {
  +             i -= 2 ;
  +             i &= nCheckpointCacheMask ;
  +             }
  +
  +         if (xCheckpointCache[i])
  +             xNdx = xCheckpointCache[i+1] ;
  +
  +         pUseNode = Node_self (pDomTree, xNdx) ;
  +         Ndx2StringLen (pUseNode -> nText,s,l) ;
  +         }
  +     else    
  +         Ndx2StringLen (pNode -> nText,s,l) ;
        StringAdd (ppAttr, s, l) ;
        pNode = Node_selfNextSibling (pDomTree, pNode) ;
        }
  
  
  
  1.1.2.23  +21 -7     embperl/Attic/epdom.h
  
  Index: epdom.h
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.h,v
  retrieving revision 1.1.2.22
  retrieving revision 1.1.2.23
  diff -u -r1.1.2.22 -r1.1.2.23
  --- epdom.h   2000/06/06 10:25:27     1.1.2.22
  +++ epdom.h   2000/06/07 09:22:56     1.1.2.23
  @@ -145,13 +145,22 @@
       aflgAttrChilds  = 4,
       } ;
   
  +struct tDomTreeOrder
  +    {
  +    tNode  xFromNode ;           
  +    tNode  xToNode ;
  +    } ;
  +
  +typedef struct tDomTreeOrder tDomTreeOrder ;
  +
  +
   struct tDomTree
       {
  -    void * * pLookup ;       /* table for converting tNode, tNodePad and tAttr to 
pointers */
  -    tNode *     pOrder ;     /* Order of dom tree after execution of code */
  -    tIndex   xNdx ;          /* Index of Dom Tree */
  -    tNode    xDocument ;     /* root document node */
  -    SV *        pSV ;
  +    void * *     pLookup ;   /* table for converting tNode, tNodePad and tAttr to 
pointers */
  +    tDomTreeOrder * pOrder ; /* Order of dom tree after execution of code */
  +    tIndex       xNdx ;      /* Index of Dom Tree */
  +    tNode        xDocument ; /* root document node */
  +    SV *         pSV ;
       } ;
   
   typedef struct tDomTree tDomTree ;
  @@ -164,6 +173,9 @@
   extern tIndex              xNoName ;              /* String index for Attribut with 
noname */
   extern tIndex              xDomTreeAttr ;         /* String index for Attribut 
which holds the DomTree index */
   
  +extern int nCheckpointCache ;
  +extern int nCheckpointCacheMask ;
  +extern tIndex xCheckpointCache[] ;
   
   
   tStringIndex String2Ndx (/*in*/ const char *     sText,
  @@ -309,13 +321,15 @@
                                      /*in*/ const char *       sAttrName,
                                      /*in*/ int                nAttrNameLen,
                                      /*in*/ const char *       sNewValue, 
  -                                   /*in*/ int                nNewValueLen) ;
  +                                   /*in*/ int                nNewValueLen,
  +                                   /*in*/ int                bClone) ;
   
   
   tAttrData *  Element_selfRemoveAttribut (/*in*/ tDomTree *           pDomTree,
                                      /*in*/ struct tNodeData * pNode,
                                      /*in*/ const char *       sAttrName,
  -                                   /*in*/ int                nAttrNameLen) ;
  +                                   /*in*/ int                nAttrNameLen,
  +                                   /*in*/ int                bClone) ;
   
   #define Attr_self(pDomTree,xAttr)        ((struct tAttrData *)(pDomTree -> 
pLookup[xAttr]))
   
  
  
  
  1.57.2.21 +1 -1      embperl/test.pl
  
  Index: test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test.pl,v
  retrieving revision 1.57.2.20
  retrieving revision 1.57.2.21
  diff -u -r1.57.2.20 -r1.57.2.21
  --- test.pl   2000/06/07 04:10:38     1.57.2.20
  +++ test.pl   2000/06/07 09:22:57     1.57.2.21
  @@ -39,7 +39,7 @@
       'loopperl.htm?erstes=Hallo&zweites=Leer+zeichen&drittes=%21%22%23&erstes=Wert2',
       'table.htm',
       'table.htm??1',
  -##    'lists.htm?sel=2&SEL1=B&SEL3=D&SEL4=cc',
  +    'lists.htm?sel=2&SEL1=B&SEL3=D&SEL4=cc',
       'mix.htm',
   ##    'nesting.htm',
       'object.htm',
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.1   +25 -25    embperl/test/cmp/lists.htm
  
  Index: lists.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/cmp/lists.htm,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- lists.htm 1999/10/05 06:02:13     1.3
  +++ lists.htm 2000/06/07 09:23:02     1.3.2.1
  @@ -71,11 +71,10 @@
       If you request this document with list.htm?sel1=x you can specify that the
       element of the dropdownlist is initialy selected
       
  -
       <p><select name="SEL1">
           <option value="A">1</option>
       
  -        <option value="B" SELECTED>2</option>
  +        <option value="B" selected>2</option>
       
           <option value="C">3</option>
       
  @@ -85,6 +84,7 @@
       
           <option value="F">6</option>
       </select></p>
  +
   </form>
   
   <form method="POST">
  @@ -120,37 +120,37 @@
           <option value="F" selected size=5>6</option>
       </select></p>
       <p><select name="SEL3">
  -        <option  value="A">1</option>
  -        <option value="A" >1</option>
  -        <option value="A"  size=5>1</option>
  -    
  -        <option  value="B">2</option>
  -        <option value="B" >2</option>
  -        <option value="B"  size=5>2</option>
  -    
  -        <option  value="C">3</option>
  -        <option value="C" >3</option>
  -        <option value="C"  size=5>3</option>
  +        <option value="A">1</option>
  +        <option value="A">1</option>
  +        <option value="A" size=5>1</option>
       
  -        <option selected value="D">4</option>
  +        <option value="B">2</option>
  +        <option value="B">2</option>
  +        <option value="B" size=5>2</option>
  +    
  +        <option value="C">3</option>
  +        <option value="C">3</option>
  +        <option value="C" size=5>3</option>
  +    
           <option value="D" selected>4</option>
  -        <option value="D" selected size=5>4</option>
  +        <option value="D" selected>4</option>
  +        <option value="D" size=5 selected>4</option>
  +    
  +        <option value="E">5</option>
  +        <option value="E">5</option>
  +        <option value="E" size=5>5</option>
       
  -        <option  value="E">5</option>
  -        <option value="E" >5</option>
  -        <option value="E"  size=5>5</option>
  -    
  -        <option  value="F">6</option>
  -        <option value="F" >6</option>
  -        <option value="F"  size=5>6</option>
  +        <option value="F">6</option>
  +        <option value="F">6</option>
  +        <option value="F" size=5>6</option>
       </select></p>
       <p><select name="SEL4">
  -        <option  value="aa">aaaa</option>
  -        <option value="bb" >bbbb</option>
  +        <option value="aa">aaaa</option>
  +        <option value="bb">bbbb</option>
           <option value="cc" selected size=5>cccc</option>
           <option value="dd">aaaa</option>
           <option value="ee">bbbb</option>
  -        <option value="cc" size=5 SELECTED>cccc</option>
  +        <option value="cc" size=5 selected>cccc</option>
       </select></p>
   </form>
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1.2.1 +2 -1      embperl/test/html/lists.htm
  
  Index: lists.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/html/lists.htm,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.1.2.1
  diff -u -r1.1.2.1 -r1.1.2.1.2.1
  --- lists.htm 1998/07/14 20:11:21     1.1.2.1
  +++ lists.htm 2000/06/07 09:23:04     1.1.2.1.2.1
  @@ -10,6 +10,7 @@
   
   [- @k = (1, 2, 3, 4, 5, 6) -]
   [- @v = ('A', 'B', 'C', 'D', 'E', 'F') -]
  +
   </p>
   <hr>
   <P>OL Tag</P>
  @@ -43,10 +44,10 @@
       If you request this document with list.htm?sel1=x you can specify that the
       element of the dropdownlist is initialy selected
       
  -
       <p><select name="SEL1">
           <option value="[+ $v[$row] +]">[+ $k[$row] +]</option>
       </select></p>
  +
   </form>
   
   <form method="POST">
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to