richter 00/07/05 04:51:21
Modified: . Tag: Embperl2 epcomp.c epdom.c epmain.c test.pl
test/cmp Tag: Embperl2 lists.htm
Log:
Embperl 2
Revision Changes Path
No revision
No revision
1.1.2.40 +25 -10 embperl/Attic/epcomp.c
Index: epcomp.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epcomp.c,v
retrieving revision 1.1.2.39
retrieving revision 1.1.2.40
diff -u -r1.1.2.39 -r1.1.2.40
--- epcomp.c 2000/07/05 06:27:41 1.1.2.39
+++ epcomp.c 2000/07/05 11:50:40 1.1.2.40
@@ -316,7 +316,11 @@
return ;
if (*ppSV == NULL || SvTYPE (*ppSV) != SVt_RV)
+ {
+ if (*ppSV)
+ SvREFCNT_dec (*ppSV) ;
*ppSV = newRV_noinc ((SV *)(pAV = newAV ())) ;
+ }
else
pAV = (AV *)SvRV (*ppSV) ;
@@ -348,7 +352,8 @@
if (ppSV == NULL || *ppSV == NULL || SvTYPE (*ppSV) != SVt_RV)
return ;
- av_pop ((AV *)SvRV (*ppSV)) ;
+ pSV = av_pop ((AV *)SvRV (*ppSV)) ;
+ SvREFCNT_dec (pSV) ;
}
/* ------------------------------------------------------------------------ */
@@ -380,13 +385,18 @@
s = SvPV (pSV, l) ;
if (strcmp (s, sStackValue) == 0)
+ {
+ SvREFCNT_dec (pSV) ;
return ok ;
-
+ }
+
strncpy (pCurrReq -> errdat1, Node_selfNodeName (pNode), sizeof (pCurrReq ->
errdat1)) ;
sprintf (pCurrReq -> errdat2, "'%s', starttag should be '%s'", s, sStackValue) ;
pCurrReq -> Buf.pCurrPos = NULL ;
pCurrReq -> Buf.nSourceline = pNode -> nLinenumber ;
+ SvREFCNT_dec (pSV) ;
+
return rcTagMismatch ;
}
@@ -1048,6 +1058,9 @@
}
else if (*ppSV == NULL || !SvIOKp (*ppSV) )
{
+ if (*ppSV)
+ SvREFCNT_dec (*ppSV) ;
+
if ((rc = ParseFile (r)) != ok)
{
*ppSV = newSVpvf ("%s\t%s", r -> errdat1, r -> errdat2) ;
@@ -1163,17 +1176,19 @@
rc = CallStoredCV (r, pProgRun, (CV *)pSV, 2, args, 0, &pSV) ;
if (pSV)
SvREFCNT_dec (pSV) ;
- }
- cl2 = clock () ;
+ cl2 = clock () ;
#ifdef CLOCKS_PER_SEC
- if (r -> bDebug)
- {
- lprintf (r, "[%d]PERF: Run Start Time: %d ms \n", r -> nPid, ((cl1 - r ->
startclock) * 1000 / CLOCKS_PER_SEC)) ;
- lprintf (r, "[%d]PERF: Run End Time: %d ms \n", r -> nPid, ((cl2 - r ->
startclock) * 1000 / CLOCKS_PER_SEC)) ;
- lprintf (r, "[%d]PERF: Run Time: %d ms \n", r -> nPid, ((cl2 - cl1)
* 1000 / CLOCKS_PER_SEC)) ;
- }
+ if (r -> bDebug)
+ {
+ lprintf (r, "[%d]PERF: Run Start Time: %d ms \n", r -> nPid, ((cl1 - r
-> startclock) * 1000 / CLOCKS_PER_SEC)) ;
+ lprintf (r, "[%d]PERF: Run End Time: %d ms \n", r -> nPid, ((cl2 - r
-> startclock) * 1000 / CLOCKS_PER_SEC)) ;
+ lprintf (r, "[%d]PERF: Run Time: %d ms \n", r -> nPid, ((cl2 -
cl1) * 1000 / CLOCKS_PER_SEC)) ;
+ }
#endif
+
+ }
+
if (rc != ok && rc != rcEvalErr)
return rc ;
1.1.2.47 +112 -17 embperl/Attic/epdom.c
Index: epdom.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epdom.c,v
retrieving revision 1.1.2.46
retrieving revision 1.1.2.47
diff -u -r1.1.2.46 -r1.1.2.47
--- epdom.c 2000/07/05 07:38:54 1.1.2.46
+++ epdom.c 2000/07/05 11:50:41 1.1.2.47
@@ -976,6 +976,7 @@
struct tNodeData * pNewNode = NodePad_selfFirstChild (pDomTree, pNext) ;
int nCopySize ;
int nOffset ;
+ void * * pLookup ;
if (pPad -> numChilds == 1)
@@ -1006,6 +1007,7 @@
pPad -> nFill -= nCopySize ;
pNext -> nFill += nCopySize ;
+ pLookup = pDomTree -> pLookup ;
while (pNewNode)
{
int n = pNewNode -> numAttr ;
@@ -1013,12 +1015,12 @@
while (n--)
{
- pDomTree -> pLookup[pAttr -> xNdx] = pAttr ;
+ pLookup[pAttr -> xNdx] = pAttr ;
pAttr++ ;
}
pNewNode -> nPadOffset = ((tUInt8 *)pNewNode) - ((tUInt8 *)pNext) ;
- pDomTree -> pLookup[pNewNode -> xNdx] = pNewNode ;
+ pLookup[pNewNode -> xNdx] = pNewNode ;
pPad -> numChilds-- ;
pNext -> numChilds++ ;
nOffset = sizeof (struct tNodeData) + sizeof (struct tAttrData) * pNewNode ->
numAttr ;
@@ -1036,11 +1038,86 @@
}
+/* ------------------------------------------------------------------------ */
+/* */
+/* NodePad_clonePad */
+/* */
+/* clone a pad */
+/* */
+/* ------------------------------------------------------------------------ */
+
+tNodePad * NodePad_clonePad (/*in*/ tDomTree * pDomTree,
+ /*in*/ tNodePad * pPad)
+
+ {
+ tNodePad * pNewPad ;
+ tIndex xNdx = pPad -> xNdx ;
+ tNodeData * pNewNode ;
+ int nOffset ;
+ void * * pLookup = pDomTree -> pLookup ;
+
+ if ((pLookup[xNdx] = pNewPad = dom_malloc (pPad -> nMax)) == NULL)
+ return NULL ;
+
+ memcpy (pNewPad, pPad, pPad -> nMax) ;
+ pNewPad -> xDomTree = pDomTree -> xNdx ;
+ pNewNode = NodePad_selfFirstChild (pDomTree, pNewPad) ;
+ while (pNewNode)
+ {
+ int n = pNewNode -> numAttr ;
+ tAttrData * pAttr = Node_selfFirstAttr(pNewNode) ;
+
+ while (n--)
+ {
+ pLookup[pAttr -> xNdx] = pAttr ;
+ pAttr++ ;
+ }
+
+ pLookup[pNewNode -> xNdx] = pNewNode ;
+ nOffset = sizeof (struct tNodeData) + sizeof (struct tAttrData) * pNewNode ->
numAttr ;
+ if (pNewPad -> nFill <= pNewNode -> nPadOffset + nOffset)
+ break ;
+ pNewNode = (struct tNodeData *)(((tUInt8 *)pNewNode) + nOffset) ;
+ }
+
+ return pNewPad ;
+ }
+
/* ------------------------------------------------------------------------ */
/* */
+/* Node_condClonePad */
+/* */
+/* clone the pad pointed to by node if it lives in another DomTree */
+/* */
+/* ------------------------------------------------------------------------ */
+
+tNodePad * Node_condClonePad (/*in*/ tDomTree * pDomTree,
+ /*in*/ tNode xNode)
+
+ {
+ tNodeData * pNode = Node_self (pDomTree, xNode) ;
+ tNodePad * pPad = NULL ;
+
+ if (pNode)
+ {
+ if (pNode -> nType == ntypAttr)
+ pPad = Node_selfPad (Attr_selfNode(((tAttrData *)pNode))) ;
+ else
+ pPad = Node_selfPad (pNode) ;
+
+ if (pPad -> xDomTree != pDomTree -> xNdx)
+ NodePad_clonePad (pDomTree, pPad) ;
+ }
+
+ return pPad ;
+ }
+
+
+/* ------------------------------------------------------------------------ */
+/* */
/* Node_appendChild */
/* */
/* Append a child node to a parent node */
@@ -1059,14 +1136,20 @@
/*in*/ int nLinenumber)
{
- struct tNodeData * pParent = Node_self (pDomTree, xParent) ;
+ tNodeData * pParent;
+ tNodePad * pPad ;
+ pPad = Node_condClonePad (pDomTree, xParent) ;
+ pParent = Node_self (pDomTree, xParent) ;
+
if (nType == ntypAttr)
{
- struct tNodePad * pPad = (struct tNodePad * )(((tUInt8 *)pParent) - pParent
-> nPadOffset) ;
- struct tAttrData * pNew = ((struct tAttrData * )(pParent + 1)) + pParent ->
numAttr ;
+ tNodePad * pPad = Node_selfPad (pParent) ;
+ struct tAttrData * pNew ;
tIndex xNdx ;
+ pNew = ((struct tAttrData * )(pParent + 1)) + pParent -> numAttr ;
+
if (((tUInt8 *)pNew) - ((tUInt8 *)pPad) != pPad -> nFill)
{ /* not last child in pad -> move following node to new pad */
NodePad_splitPad (pDomTree, pPad, (tNodeData *)pNew, 0) ;
@@ -1251,11 +1334,13 @@
/*in*/ struct tNodeData * pChild)
{
- struct tNodePad * pPad = (struct tNodePad * )(((tUInt8 *)pChild) -
pChild -> nPadOffset) ;
+ tNodePad * pPad = Node_condClonePad (pDomTree, pChild -> xNdx) ;
if (xNode != -1 && pPad -> xParent != xNode)
return 0 ;
+ /* relookup in case Pad has cloned */
+ pChild = Node_self (pDomTree, pChild -> xNdx) ;
pChild -> bFlags = nflgDeleted ;
/* pPad -> numChilds-- ; */
@@ -1336,7 +1421,8 @@
/* */
/* Node_replaceChild */
/* */
-/* Replace child node */
+/* Replaces the node pointed by pOldChildDomTree/xOldChild, with the node */
+/* pointed by pDomTree/xNode */
/* */
/* ------------------------------------------------------------------------ */
@@ -1350,9 +1436,11 @@
{
int bFlags = nflgModified | nflgReturn ;
tNode xOrgChild = xOldChild ;
- tNodeData * pOldChild = Node_self (pOldChildDomTree, xOldChild) ;
tNodeData * pNode = Node_self (pDomTree, xNode) ;
+ tNodeData * pOldChild ;
+ Node_condClonePad (pOldChildDomTree, xOldChild) ;
+ pOldChild = Node_self (pOldChildDomTree, xOldChild) ;
if (pOldChild -> bFlags & nflgModified)
{
@@ -1435,9 +1523,12 @@
/*in*/ int bFlags)
{
- struct tNodeData * pOldChild = Node_self (pDomTree, xOldChild) ;
+ tNodeData * pOldChild ;
tNode xOrgChild = xOldChild ;
+ Node_condClonePad (pDomTree, xOldChild) ;
+ pOldChild = Node_self (pDomTree, xOldChild) ;
+
lprintf (pCurrReq, "rp1--> SVs=%d %s DomTree Old=%d\n", sv_count, sText,
Node_selfDomTree (pOldChild)) ;
xCheckpointCache[nCheckpointCache++] = xOldChild ;
@@ -2115,17 +2206,18 @@
/*in*/ int bClone)
{
- tAttrData * pAttr = Element_selfGetAttribut (pDomTree, pNode, sAttrName,
nAttrNameLen) ;
+ tAttrData * pAttr ;
tNode xAttr ;
tNodeData * pNewNode ;
- if (bClone)
- pNode -> bFlags |= nflgReturn | nflgModified ;
-
+ Node_condClonePad (pDomTree, pNode -> xNdx) ;
+ pNode = Node_self (pDomTree, pNode -> xNdx) ;
+ pAttr = Element_selfGetAttribut (pDomTree, pNode, sAttrName, nAttrNameLen) ;
+
if (pAttr)
{
tIndex xValue = sNewValue?String2Ndx (sNewValue, nNewValueLen):nNewValueLen ;
-
+
if (bClone)
{
if (pAttr -> xValue != xValue && (pNode -> bFlags & nflgModified))
@@ -2138,8 +2230,9 @@
else
DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNode -> xNdx) ;
- pNode -> bFlags |= nflgModified ;
+ pNode -> bFlags |= nflgReturn | nflgModified ;
}
+
pAttr -> xValue = xValue ;
return pAttr ;
}
@@ -2151,7 +2244,7 @@
if (bClone)
{
- pNode -> bFlags |= nflgModified ;
+ pNode -> bFlags |= nflgReturn | nflgModified ;
DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNewNode -> xNdx) ;
}
@@ -2181,10 +2274,12 @@
tAttrData * pAttr ;
tNodeData * pNewNode ;
+ Node_condClonePad (pDomTree, pNode -> xNdx) ;
+ pNode = Node_self (pDomTree, pNode -> xNdx) ;
+
pAttr = Element_selfGetAttribut (pDomTree, pNode, sAttrName, nAttrNameLen) ;
if (bClone)
{
- pNode -> bFlags |= nflgReturn | nflgModified ;
if (pAttr != NULL && (pNode -> bFlags & nflgModified))
{
pNode -> bFlags |= nflgReturn | nflgModified ;
1.65.2.16 +2 -2 embperl/epmain.c
Index: epmain.c
===================================================================
RCS file: /home/cvs/embperl/epmain.c,v
retrieving revision 1.65.2.15
retrieving revision 1.65.2.16
diff -u -r1.65.2.15 -r1.65.2.16
--- epmain.c 2000/07/05 06:27:45 1.65.2.15
+++ epmain.c 2000/07/05 11:50:44 1.65.2.16
@@ -1742,11 +1742,11 @@
if (mtime == 0 || f -> mtime != mtime)
{
- hv_clear (f -> pCacheHash) ;
-
if (r -> bDebug)
lprintf (r, "[%d]MEM: Reload %s in %s\n", r -> nPid, sSourcefile,
f -> sCurrPackage) ;
+ hv_clear (f -> pCacheHash) ;
+
f -> mtime = mtime ; /* last modification time of file */
f -> nFilesize = nFilesize ; /* size of File */
f -> bKeep = (r -> bOptions & optKeepSrcInMemory) != 0 ;
1.57.2.34 +21 -5 embperl/test.pl
Index: test.pl
===================================================================
RCS file: /home/cvs/embperl/test.pl,v
retrieving revision 1.57.2.33
retrieving revision 1.57.2.34
diff -u -r1.57.2.33 -r1.57.2.34
--- test.pl 2000/07/05 06:27:46 1.57.2.33
+++ test.pl 2000/07/05 11:50:45 1.57.2.34
@@ -55,8 +55,8 @@
'inputjava.htm',
'post.htm',
'upload.htm?multval=A&multval=B&multval=C&single=S',
- 'reqrec.htm',
- 'reqrec.htm',
+## 'reqrec.htm',
+## 'reqrec.htm',
'rawinput/include.htm????16',
'includeerr1.htm???1',
'includeerr2.htm???1',
@@ -115,7 +115,8 @@
$EPSESSIONDS $EPSESSIONCLASS $EPSESSIONVERSION
$opt_offline $opt_ep1 $opt_cgi $opt_modperl $opt_execute $opt_nokill
$opt_loop
$opt_multchild $opt_memcheck $opt_exitonmem $opt_exitonsv $opt_config
$opt_nostart $opt_uniquefn
- $opt_quite $opt_ignoreerror $opt_tests $opt_blib $opt_help
$opt_dbgbreak $opt_finderr) ;
+ $opt_quite $opt_ignoreerror $opt_tests $opt_blib $opt_help
$opt_dbgbreak $opt_finderr
+ $opt_ddd $opt_gdb) ;
{
local $^W = 0 ;
@@ -188,7 +189,8 @@
Getopt::Long::Configure ('bundling') ;
$ret = GetOptions ("offline|o", "ep1|1", "cgi|c", "modperl|httpd|h", "execute|e",
"nokill|r", "loop|l:i",
"multchild|m", "memcheck|v", "exitonmem|g", "exitonsv", "config|f=s",
"nostart|x", "uniquefn|u",
- "quite|q", "ignoreerror|i", "tests|t", "blib|b", "help|?", "dbgbreak",
"finderr") ;
+ "quite|q", "ignoreerror|i", "tests|t", "blib|b", "help|?", "dbgbreak",
"finderr",
+ "ddd", "gdb") ;
$opt_help = 1 if ($ret == 0) ;
@@ -252,6 +254,8 @@
print "-i ignore errors\n" ;
print "-t list tests\n" ;
# print "-b use uninstalled version (from blib/..)\n" ;
+ print "--ddd start apache under ddd\n" ;
+ print "--gdb start apache under gdb\n" ;
print "\n\n" ;
print "path\t$EPPATH\n" ;
print "httpd\t$EPHTTPD\n" ;
@@ -1000,7 +1004,19 @@
}
else
{
- system ("$EPHTTPD $XX -f $EPPATH/$httpdconf &") and die "***Cannot start
$EPHTTPD" ;
+ if ($opt_gdb || $opt_ddd)
+ {
+ open FH, ">dbinitembperlapache" or die "Cannot write to
dbinitembperlapache ($!)" ;
+ print FH "set args $XX -f $EPPATH/$httpdconf\n" ;
+ print FH "r\n" ;
+ print FH "BT\n" if ($opt_gdb) ;
+ close FH ;
+ system (($opt_ddd?'ddd':'gdb') . " -x dbinitembperlapache $EPHTTPD &")
and die "***Cannot start $EPHTTPD" ;
+ }
+ else
+ {
+ system ("$EPHTTPD $XX -f $EPPATH/$httpdconf &") and die "***Cannot
start $EPHTTPD" ;
+ }
}
sleep (3) ;
if (!open FH, "$tmppath/httpd.pid")
No revision
No revision
1.3.2.3 +5 -5 embperl/test/cmp/lists.htm
Index: lists.htm
===================================================================
RCS file: /home/cvs/embperl/test/cmp/lists.htm,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -u -r1.3.2.2 -r1.3.2.3
--- lists.htm 2000/07/01 13:04:31 1.3.2.2
+++ lists.htm 2000/07/05 11:51:17 1.3.2.3
@@ -70,7 +70,7 @@
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>
@@ -132,10 +132,10 @@
<option value="C">3</option>
<option value="C" size=5>3</option>
- <option selected value="D">4</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>
@@ -211,4 +211,4 @@
</dir>
</body>
</html>
-
+
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]