richter     00/05/18 13:47:25

  Modified:    .        Tag: Embperl2 epdom.c
  Log:
  
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.12  +26 -15    embperl/Attic/epdom.c
  
  Index: epdom.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.c,v
  retrieving revision 1.1.2.11
  retrieving revision 1.1.2.12
  diff -u -r1.1.2.11 -r1.1.2.12
  --- epdom.c   2000/05/18 07:44:59     1.1.2.11
  +++ epdom.c   2000/05/18 20:47:23     1.1.2.12
  @@ -513,9 +513,6 @@
       {
       struct tNodeData *       pParent = Node_self (pDomTree, xParent) ;
   
  -    if (pCurrReq -> bDebug & dbgParse)
  -        lprintf (pCurrReq, "[%d]PARSE: AddNode: +%02d parent=%d %*s type=%d 
text=%*.*s (#%d)\n", pCurrReq -> nPid, nLevel, xParent, nLevel * 2, "", nType, 
nTextLen, nTextLen, sText, sText?String2Ndx (sText, nTextLen):-1) ; 
  -
       if (nType == ntypAttr)
        {           
        struct tNodePad *   pPad = (struct tNodePad * )(((tUInt8 *)pParent) - pParent 
-> nPadOffset) ;
  @@ -563,12 +560,19 @@
        pParent -> numAttr++ ;
        pPad -> nFill += sizeof (struct tAttrData) ;
        numAttr++ ;
  +
  +     if (pCurrReq -> bDebug & dbgParse)
  +         lprintf (pCurrReq, "[%d]PARSE: AddNode: +%02d %*s Attribut parent=%d 
node=%d type=%d text=%*.*s (#%d)\n", pCurrReq -> nPid, nLevel, nLevel * 2, "", 
xParent, xNdx, nType, nTextLen, nTextLen, sText, sText?String2Ndx (sText, 
nTextLen):-1) ; 
  +
        return xNdx ;
        }
       else if (nType == ntypAttrValue)
        {           
        struct tAttrData * pNew = (struct tAttrData * )pDomTree -> pLookup[xParent] ; 
// ((struct tAttrData * )pParent + 1) + (pParent -> numAttr - 1);
        pNew -> xValue = String2Ndx (sText, nTextLen) ;
  +     if (pCurrReq -> bDebug & dbgParse)
  +         lprintf (pCurrReq, "[%d]PARSE: AddNode: +%02d %*s AttributValue parent=%d 
node=%d type=%d text=%*.*s (#%d)\n", pCurrReq -> nPid, nLevel, nLevel * 2, "", 
xParent, pNew -> xNdx, nType, nTextLen, nTextLen, sText, sText?String2Ndx (sText, 
nTextLen):-1) ; 
  +
        return 1 ;
        }
       else
  @@ -628,6 +632,10 @@
        pChilds -> numChilds++ ;
        pChilds -> nFill += sizeof (struct tNodeData) ;
        numNodes++ ;
  +     
  +     if (pCurrReq -> bDebug & dbgParse)
  +         lprintf (pCurrReq, "[%d]PARSE: AddNode: +%02d %*s Element parent=%d 
node=%d type=%d text=%*.*s (#%d)\n", pCurrReq -> nPid, nLevel, nLevel * 2, "", 
xParent, xNdx, nType, nTextLen, nTextLen, sText, sText?String2Ndx (sText, 
nTextLen):-1) ; 
  +
        return xNdx ;
        }
       }
  @@ -818,20 +826,21 @@
       {
       struct tNodePad *        pPad    = (struct tNodePad * )(((tUInt8 *)pNode) - 
pNode -> nPadOffset) ;
   
  -    int nOffset = sizeof (struct tNodeData) + sizeof (struct tAttrData) * pNode -> 
numAttr ;
  -    
  -    if (pPad -> nFill <= pNode -> nPadOffset + nOffset) 
  -     { /* next pad */
  -     if (!pPad -> xNext)
  -         return 0 ;
  +    do
  +     {
  +     int nOffset = sizeof (struct tNodeData) + sizeof (struct tAttrData) * pNode -> 
numAttr ;
  +     if (pPad -> nFill <= pNode -> nPadOffset + nOffset) 
  +         { /* next pad */
  +         if (!pPad -> xNext)
  +             return 0 ;
   
  -     pPad = pDomTree -> pLookup[pPad -> xNext] ;
  -     return ((struct tNodeData *)(pPad + 1))  ;
  +         pPad  = pDomTree -> pLookup[pPad -> xNext] ;
  +         pNode = ((struct tNodeData *)(pPad + 1))  ;
  +         }
  +     else
  +         pNode = (struct tNodeData *)(((tUInt8 *)pNode) + nOffset) ;
        }
  -    
  -    pNode = (struct tNodeData *)(((tUInt8 *)pNode) + nOffset) ;
  -    if (!pNode -> bFlags) 
  -     return Node_selfNextSibling (pDomTree, pNode) ;
  +    while (!pNode -> bFlags) ;
           
       return pNode  ;
       }
  @@ -877,6 +886,8 @@
       while (xNode)
        {
        struct tNodeData * pNode = Node_self (pDomTree, xNode) ;
  +
  +     lprintf (r, "[%d]toString: Node=%d type=%d flags=%x text=>%s<= (#%d)\n", r, 
xNode, pNode -> nType,  pNode -> bFlags, Ndx2String (pNode -> nText), pNode -> nText) 
; 
   
        if (pNode -> nType == ntypTag || pNode -> nType == ntypStartTag)
            {
  
  
  

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

Reply via email to