richter 00/10/31 00:02:59
Modified: . Tag: Embperl2c Changes.pod Cmd.xs Embperl.pm
MANIFEST MANIFEST.2 ep2.h epcomp.c epdat.h epmain.c
test.pl
Embperl Tag: Embperl2c Syntax.pm
Added: test/cmp Tag: Embperl2c executesub.htm
test/html Tag: Embperl2c executesub.htm subexec.htm
Log:
Embperl 2 - call imported subs
Revision Changes Path
No revision
No revision
1.129.4.3 +2 -1 embperl/Changes.pod
Index: Changes.pod
===================================================================
RCS file: /home/cvs/embperl/Changes.pod,v
retrieving revision 1.129.4.2
retrieving revision 1.129.4.3
diff -u -r1.129.4.2 -r1.129.4.3
--- Changes.pod 2000/10/26 06:35:57 1.129.4.2
+++ Changes.pod 2000/10/31 08:02:46 1.129.4.3
@@ -39,7 +39,8 @@
- [* *] blocks works now as expected.
- option tag can take value optional from html text, so
<option value="foo"> and <option>foo</option> are the same
-
+ - Execute ('file.htm#subname') works now without a previous
+ import
=head1 1.3b6 (BETA) 18. Oct 2000
1.1.2.3 +7 -0 embperl/Cmd.xs
Index: Cmd.xs
===================================================================
RCS file: /home/cvs/embperl/Cmd.xs,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Cmd.xs 2000/09/14 05:08:25 1.1.2.2
+++ Cmd.xs 2000/10/31 08:02:46 1.1.2.3
@@ -64,3 +64,10 @@
+void
+embperl_SubStart (pDomTreeSV, xDomTree)
+ SV * pDomTreeSV ;
+ int xDomTree
+CODE:
+ embperl_ExecuteSubStart (pCurrReq, SvRV(pDomTreeSV), xDomTree) ;
+
1.118.4.5 +3 -2 embperl/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl.pm,v
retrieving revision 1.118.4.4
retrieving revision 1.118.4.5
diff -u -r1.118.4.4 -r1.118.4.5
--- Embperl.pm 2000/10/26 07:32:50 1.118.4.4
+++ Embperl.pm 2000/10/31 08:02:46 1.118.4.5
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Embperl.pm,v 1.118.4.4 2000/10/26 07:32:50 richter Exp $
+# $Id: Embperl.pm,v 1.118.4.5 2000/10/31 08:02:46 richter Exp $
#
###################################################################################
@@ -1733,7 +1733,8 @@
sub CleanupSession
{
- my $r = shift || HTML::Embperl::CurrReq () ;
+ my $r = shift ;
+ $r = HTML::Embperl::CurrReq () if (!(ref ($r) =~ /^HTML::Embperl/));
if ($HTML::Embperl::SessionMgnt && (!defined ($r) || !$r -> SubReq))
{
1.50.4.5 +3 -0 embperl/MANIFEST
Index: MANIFEST
===================================================================
RCS file: /home/cvs/embperl/MANIFEST,v
retrieving revision 1.50.4.4
retrieving revision 1.50.4.5
diff -u -r1.50.4.4 -r1.50.4.5
--- MANIFEST 2000/10/26 07:32:51 1.50.4.4
+++ MANIFEST 2000/10/31 08:02:47 1.50.4.5
@@ -24,6 +24,9 @@
test/html2/errormismatch.htm
test/html2/errormismatchcmd.htm
test/html/rawinput/include.htm
+test/html/executesub.htm
+test/html/subexec.htm
+test/cmp/executesub.htm
Changes.pod
Embperl.pm
Embperl.xs
1.1.2.3 +3 -0 embperl/Attic/MANIFEST.2
Index: MANIFEST.2
===================================================================
RCS file: /home/cvs/embperl/Attic/MANIFEST.2,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- MANIFEST.2 2000/10/26 07:32:51 1.1.2.2
+++ MANIFEST.2 2000/10/31 08:02:47 1.1.2.3
@@ -24,3 +24,6 @@
test/html2/errormismatch.htm
test/html2/errormismatchcmd.htm
test/html/rawinput/include.htm
+test/html/executesub.htm
+test/html/subexec.htm
+test/cmp/executesub.htm
1.1.2.4 +4 -0 embperl/Attic/ep2.h
Index: ep2.h
===================================================================
RCS file: /home/cvs/embperl/Attic/ep2.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- ep2.h 2000/10/18 06:51:46 1.1.2.3
+++ ep2.h 2000/10/31 08:02:48 1.1.2.4
@@ -88,6 +88,10 @@
/*in*/ SV ** ppPreCompResult,
/*out*/ SV ** ppCompResult) ;
+int embperl_ExecuteSubStart (/*in*/ tReq * r,
+ /*in*/ SV * pDomTreeSV,
+ /*in*/ tIndex xDomTree) ;
+
1.4.2.13 +41 -0 embperl/Attic/epcomp.c
Index: epcomp.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epcomp.c,v
retrieving revision 1.4.2.12
retrieving revision 1.4.2.13
diff -u -r1.4.2.12 -r1.4.2.13
--- epcomp.c 2000/10/30 21:07:27 1.4.2.12
+++ epcomp.c 2000/10/31 08:02:48 1.4.2.13
@@ -717,6 +717,12 @@
int l = sprintf (s, "%u", pNode -> xNdx) ;
StringAdd (ppCode, s, l) ;
}
+ else if (*p == 'q')
+ {
+ char s [20] ;
+ int l = sprintf (s, "%u", pDomTree -> xNdx) ;
+ StringAdd (ppCode, s, l) ;
+ }
}
sPerlCode = q + 1 ;
@@ -1392,6 +1398,39 @@
return ok ;
}
+
+
+int embperl_ExecuteSubStart (/*in*/ tReq * r,
+ /*in*/ SV * pDomTreeSV,
+ /*in*/ tIndex xDomTree)
+
+ {
+ tIndex xOrgDomTree ;
+ tDomTree * pDomTree ;
+ tDomTree * pCurrDomTree ;
+
+
+ if (SvIOK (pDomTreeSV))
+ if (xOrgDomTree = SvIVX (pDomTreeSV))
+ {
+ SAVEI32 (r -> xCurrDomTree) ;
+ return r -> xCurrDomTree = xOrgDomTree ; /* DomTree already cloned */
+ }
+
+ pDomTree = DomTree_self (xDomTree) ;
+
+ if (!(r -> xCurrDomTree = DomTree_clone (pDomTree, &pCurrDomTree, 1)))
+ return 0 ;
+
+ av_push (r -> pDomTreeAV, pCurrDomTree -> pDomTreeSV) ;
+ av_push (r -> pCleanupAV, newRV_inc (pDomTreeSV)) ;
+
+ SAVEI32 (r -> xCurrDomTree) ;
+ sv_setiv (pDomTreeSV, r -> xCurrDomTree) ;
+
+ return r -> xCurrDomTree ;
+ }
+
/* ------------------------------------------------------------------------ */
/* */
/* embperl_Executer */
@@ -1459,6 +1498,8 @@
SvREFCNT_dec (sDomTreeSV) ;
sv_setiv (pDomTreeSV, r -> xCurrDomTree) ;
+ av_push (r -> pCleanupAV, newRV_inc (pDomTreeSV)) ;
+
nCheckpointCache = 0 ;
xCheckpointCache[nCheckpointCache++] = 0 ;
xCheckpointCache[nCheckpointCache++] = 0 ;
1.20.4.8 +1 -0 embperl/epdat.h
Index: epdat.h
===================================================================
RCS file: /home/cvs/embperl/epdat.h,v
retrieving revision 1.20.4.7
retrieving revision 1.20.4.8
diff -u -r1.20.4.7 -r1.20.4.8
--- epdat.h 2000/10/30 21:07:28 1.20.4.7
+++ epdat.h 2000/10/31 08:02:48 1.20.4.8
@@ -445,6 +445,7 @@
HV * pHeaderHash ;/* http headers */
#ifdef EP2
AV * pDomTreeAV ; /* holds all DomTrees alocated during the request */
+ AV * pCleanupAV ; /* set all sv's that are conatined in that array to undef
after the whole request */
#endif
/* --- for statistics --- */
1.75.4.9 +14 -0 embperl/epmain.c
Index: epmain.c
===================================================================
RCS file: /home/cvs/embperl/epmain.c,v
retrieving revision 1.75.4.8
retrieving revision 1.75.4.9
diff -u -r1.75.4.8 -r1.75.4.9
--- epmain.c 2000/10/30 21:07:28 1.75.4.8
+++ epmain.c 2000/10/31 08:02:48 1.75.4.9
@@ -1482,6 +1482,13 @@
LogError (r, rcArrayError) ;
return 1 ;
}
+
+ if (!(r -> pCleanupAV = newAV ()))
+ {
+ LogError (r, rcArrayError) ;
+ return 1 ;
+ }
+
#endif
rc = 0 ;
@@ -2279,6 +2286,7 @@
{
tFile * pFile ;
tFile * pNext ;
+ int i ;
hv_clear (r -> pHeaderHash) ;
av_clear (r -> pFormArray) ;
@@ -2287,6 +2295,12 @@
hv_clear (r -> pFormSplitHash) ;
#ifdef EP2
av_clear (r -> pDomTreeAV) ;
+ for (i = 0 ; i < AvFILL (r -> pCleanupAV); i++)
+ {
+ sv_setsv (SvRV(*av_fetch (r -> pCleanupAV, i, 0)), &sv_undef) ;
+ }
+ av_clear (r -> pCleanupAV) ;
+
#endif
if ((pFile = r -> pFiles2Free))
{
1.70.4.14 +4 -0 embperl/test.pl
Index: test.pl
===================================================================
RCS file: /home/cvs/embperl/test.pl,v
retrieving revision 1.70.4.13
retrieving revision 1.70.4.14
diff -u -r1.70.4.13 -r1.70.4.14
--- test.pl 2000/10/30 21:07:29 1.70.4.13
+++ test.pl 2000/10/31 08:02:49 1.70.4.14
@@ -193,6 +193,10 @@
'callsub.htm' => {
'repeat' => 2,
},
+ 'executesub.htm' => {
+ 'version' => 2,
+ 'repeat' => 2,
+ },
'importsub.htm' => {
# 'version' => 1,
'repeat' => 2,
No revision
No revision
1.1.4.5 +6 -2 embperl/Embperl/Attic/Syntax.pm
Index: Syntax.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Attic/Syntax.pm,v
retrieving revision 1.1.4.4
retrieving revision 1.1.4.5
diff -u -r1.1.4.4 -r1.1.4.5
--- Syntax.pm 2000/09/26 19:32:09 1.1.4.4
+++ Syntax.pm 2000/10/31 08:02:54 1.1.4.5
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Syntax.pm,v 1.1.4.4 2000/09/26 19:32:09 richter Exp $
+# $Id: Syntax.pm,v 1.1.4.5 2000/10/31 08:02:54 richter Exp $
#
###################################################################################
@@ -688,7 +688,7 @@
'endtag' => 'endsub',
'procinfo' => {
embperl => {
- perlcode => 'sub %&<noname>% { ',
+ perlcode => 'sub %&<noname>% {
HTML::Embperl::Cmd::SubStart(\\$_ep_DomTree,%$q%); ',
removenode => 10,
mayjump => 1,
stackname => 'metacmd',
@@ -961,6 +961,10 @@
=item %$l+%
Unique label and increment to next label
+
+=item %$q+%
+
+Source Dom Tree id
=back
No revision
No revision
1.1.2.1 +44 -0 embperl/test/cmp/Attic/executesub.htm
No revision
No revision
1.1.2.1 +28 -0 embperl/test/html/Attic/executesub.htm
1.1.2.1 +19 -0 embperl/test/html/Attic/subexec.htm
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]