richter 00/06/06 12:49:08
Modified: . Tag: Embperl2 Embperl.pm TODO epdat.h epmain.c
test.pl
test/html Tag: Embperl2 var.htm
Added: test/cmp Tag: Embperl2 error.htm-1 var.htm-1 varerr.htm-1
Log:
Embperl 2 - Embperl 1 Compat
Revision Changes Path
No revision
No revision
1.104.2.8 +2 -1 embperl/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl.pm,v
retrieving revision 1.104.2.7
retrieving revision 1.104.2.8
diff -u -r1.104.2.7 -r1.104.2.8
--- Embperl.pm 2000/06/05 13:55:56 1.104.2.7
+++ Embperl.pm 2000/06/06 19:48:50 1.104.2.8
@@ -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.104.2.7 2000/06/05 13:55:56 richter Exp $
+# $Id: Embperl.pm,v 1.104.2.8 2000/06/06 19:48:50 richter Exp $
#
###################################################################################
@@ -648,6 +648,7 @@
$$req{'output_func'} = $ENV{EMBPERL_OUTPUT_FUNC} if (exists
($ENV{EMBPERL_OUTPUT_FUNC})) ;
$$req{'allow'} = $ENV{EMBPERL_ALLOW} if (exists
($ENV{EMBPERL_ALLOW})) ;
$$req{'debug'} = $ENV{EMBPERL_DEBUG} || 0 ;
+ $$req{'ep1compat'} = $ENV{EMBPERL_EP1COMPAT} || 0 ;
$$req{'options'} = $ENV{EMBPERL_OPTIONS} || 0 ;
$$req{'log'} = $ENV{EMBPERL_LOG} || $DefaultLog ;
$$req{'path'} = $ENV{EMBPERL_PATH} || '' ;
1.90.2.8 +13 -0 embperl/TODO
Index: TODO
===================================================================
RCS file: /home/cvs/embperl/TODO,v
retrieving revision 1.90.2.7
retrieving revision 1.90.2.8
diff -u -r1.90.2.7 -r1.90.2.8
--- TODO 2000/06/06 14:39:11 1.90.2.7
+++ TODO 2000/06/06 19:48:50 1.90.2.8
@@ -104,6 +104,10 @@
- File::Spec for EmbperlObject
+
+
+-------------
+
1.3
---
@@ -155,3 +159,12 @@
- errdoc
- http_header / meta http-equiv -> http.htm
+
+- use vars -> cleanup
+
+
+Docs 2.0
+--------
+
+- ep1compat
+
1.17.2.5 +2 -1 embperl/epdat.h
Index: epdat.h
===================================================================
RCS file: /home/cvs/embperl/epdat.h,v
retrieving revision 1.17.2.4
retrieving revision 1.17.2.5
diff -u -r1.17.2.4 -r1.17.2.5
--- epdat.h 2000/06/06 10:25:26 1.17.2.4
+++ epdat.h 2000/06/06 19:48:50 1.17.2.5
@@ -38,6 +38,7 @@
char cMultFieldSep ;
char * pOpenBracket ;
char * pCloseBracket ;
+ bool bEP1Compat ; /* run in Embperl 1.x compatible mode */
} tConf ;
/*-----------------------------------------------------------------*/
@@ -259,7 +260,7 @@
int nSessionMgnt ; /* how to retrieve the session id */
int nInsideSub ; /* Are we inside of a sub? */
int bExit ; /* We should exit the page */
-
+ bool bEP1Compat ; /* run in Embperl 1.x compatible mode */
tNode xDocument ;
tNode xCurrNode ;
1.65.2.10 +21 -27 embperl/epmain.c
Index: epmain.c
===================================================================
RCS file: /home/cvs/embperl/epmain.c,v
retrieving revision 1.65.2.9
retrieving revision 1.65.2.10
diff -u -r1.65.2.9 -r1.65.2.10
--- epmain.c 2000/06/06 14:39:14 1.65.2.9
+++ epmain.c 2000/06/06 19:48:51 1.65.2.10
@@ -16,7 +16,6 @@
#include "ep.h"
#include "epmacro.h"
-#define EP2 1
/* Version */
@@ -1501,7 +1500,6 @@
ADDOPTMG (dbgImport ) ;
-#ifdef EP2
DomInit () ;
embperl_CompileInit () ;
@@ -1516,7 +1514,6 @@
LogError (r, rc) ;
return rc ;
}
-#endif
bInitDone = 1 ;
@@ -1621,6 +1618,7 @@
pConf -> bDebug = GetHashValueInt (pReqInfo, "debug", pCurrReq ->
pConf?pCurrReq -> pConf -> bDebug:pCurrReq -> bDebug) ; /* Debugging options */
pConf -> bOptions = GetHashValueInt (pReqInfo, "options", pCurrReq ->
pConf?pCurrReq -> pConf -> bOptions:pCurrReq -> bOptions) ; /* Options */
+ pConf -> bEP1Compat = GetHashValueInt (pReqInfo, "ep1compat", pCurrReq ->
pConf?pCurrReq -> pConf -> bEP1Compat:pCurrReq -> bEP1Compat) ; /* EP1Compat */
pConf -> nEscMode = GetHashValueInt (pReqInfo, "escmode", pCurrReq ->
pConf?pCurrReq -> pConf -> nEscMode:escStd) ; /* EscMode */
pConf -> sPackage = sstrdup (GetHashValueStr (pReqInfo, "package",
NULL)) ; /* Packagename */
pConf -> sLogFilename = sstrdup (GetHashValueStr (pReqInfo, "log", NULL)) ;
/* name of logfile */
@@ -1870,6 +1868,7 @@
r -> nPid = getpid () ; /* reget pid, because it could be chaned
when loaded with PerlModule */
r -> bDebug = pConf -> bDebug ;
+ r -> bEP1Compat = pConf -> bEP1Compat ;
if (rc != ok)
r -> bDebug = 0 ; /* Turn debbuging off, only errors will go to stderr if
logfile not open */
r -> bOptions = pConf -> bOptions ;
@@ -2446,10 +2445,8 @@
char * pData ;
int l ;
- #ifdef EP2
- if (!bError)
+ if (!bError && !r -> bEP1Compat)
Node_toString (DomTree_self (r -> xCurrDomTree), r, r -> xDocument) ;
- #endif
oputs (r, "\r\n") ;
l = GetContentLength (r) + 1 ;
@@ -2465,26 +2462,27 @@
if (r -> bAppendToMainReq)
{
tReq * l = r -> pLastReq ;
- #ifdef EP2
- if (!bError)
- Node_replaceChildWithNode (DomTree_self (r -> xCurrDomTree), r ->
xDocument, DomTree_self (l -> xCurrDomTree), l -> xCurrNode) ;
- #else
- l -> pFirstBuf = r -> pFirstBuf ;
- l -> pLastBuf = r -> pLastBuf ;
- l -> pFreeBuf = r -> pFreeBuf ;
- l -> pLastFreeBuf= r -> pLastFreeBuf ;
- #endif
- }
+ if (r -> bEP1Compat)
+ {
+ l -> pFirstBuf = r -> pFirstBuf ;
+ l -> pLastBuf = r -> pLastBuf ;
+ l -> pFreeBuf = r -> pFreeBuf ;
+ l -> pLastFreeBuf= r -> pLastFreeBuf ;
+ }
+ else
+ {
+ if (!bError)
+ Node_replaceChildWithNode (DomTree_self (r -> xCurrDomTree), r
-> xDocument, DomTree_self (l -> xCurrDomTree), l -> xCurrNode) ;
+ }
+ }
else
{
oCommit (r, NULL) ;
- #ifdef EP2
- if (!bError)
+ if (!bError && !r -> bEP1Compat)
{
Node_toString (DomTree_self (r -> xCurrDomTree), r, r ->
xDocument) ;
oputs (r, "\r\n") ;
}
- #endif
}
}
}
@@ -2493,11 +2491,8 @@
oRollbackOutput (r, NULL) ;
if (bOutToMem)
sv_setsv (pOut, &sv_undef) ;
- #ifdef EP2
- else
+ else if (!r -> bEP1Compat)
Node_toString (DomTree_self (r -> xCurrDomTree), r, r -> xDocument) ;
-
- #endif
}
if (!r -> bAppendToMainReq)
@@ -2586,9 +2581,9 @@
r -> Buf.pSourcelinePos = r -> Buf.pCurrPos = r -> Buf.pBuf ;
r -> Buf.pEndPos = r -> Buf.pBuf + nFileSize ;
-#ifdef EP2
- rc = embperl_CompileDocument (r) ;
-#else
+ if (!r -> bEP1Compat)
+ rc = embperl_CompileDocument (r) ;
+ else
{
clock_t cl1 = clock () ;
clock_t cl2 ;
@@ -2605,7 +2600,6 @@
}
#endif
}
-#endif
if ((r -> bOptions & optNoUncloseWarn) == 0)
{
1.57.2.18 +76 -68 embperl/test.pl
Index: test.pl
===================================================================
RCS file: /home/cvs/embperl/test.pl,v
retrieving revision 1.57.2.17
retrieving revision 1.57.2.18
diff -u -r1.57.2.17 -r1.57.2.18
--- test.pl 2000/06/06 14:39:14 1.57.2.17
+++ test.pl 2000/06/06 19:48:54 1.57.2.18
@@ -668,81 +668,89 @@
$t_offline = 0 ;
$n_offline = 0 ;
$testnum = -1 ;
- foreach $url (@tests)
- {
- $testnum++ ;
- ($file, $query_info, $debug, $errcnt, $option, $ns) = split (/\?/,
$url) ;
- next if ($file eq 'http.htm') ;
- next if ($file eq 'taint.htm') ;
- next if ($file eq 'reqrec.htm') ;
- next if ($file eq 'http.htm') ;
- next if ($file eq 'post.htm') ;
- next if ($file eq 'upload.htm') ;
- next if ($file =~ /^exit.htm/) ;
- next if ($file =~ /registry/) ;
- next if ($file =~ /match/) ;
- next if ($file =~ /sess\.htm/) ;
- next if ($file =~ /EmbperlObject/) ;
- next if ($DProf && ($file =~ /safe/)) ;
- next if ($DProf && ($file =~ /opmask/)) ;
- $errcnt = 7 if ($file eq 'varerr.htm' && $^V && $^V ge v5.6.0) ;
+ foreach $ep1compat (0, 1)
+ {
+ $ENV{EMBPERL_EP1COMPAT} = $ep1compat ;
+ print "\nTesting Embperl 1.x compatibility mode...\n\n" if ($ep1compat) ;
+
+ foreach $url (@tests)
+ {
+ $testnum++ ;
+ ($file, $query_info, $debug, $errcnt, $option, $ns) = split (/\?/,
$url) ;
+ next if ($file eq 'http.htm') ;
+ next if ($file eq 'taint.htm') ;
+ next if ($file eq 'reqrec.htm') ;
+ next if ($file eq 'http.htm') ;
+ next if ($file eq 'post.htm') ;
+ next if ($file eq 'upload.htm') ;
+ next if ($file =~ /^exit.htm/) ;
+ next if ($file =~ /registry/) ;
+ next if ($file =~ /match/) ;
+ next if ($file =~ /sess\.htm/) ;
+ next if ($file =~ /EmbperlObject/) ;
+ next if ($DProf && ($file =~ /safe/)) ;
+ next if ($DProf && ($file =~ /opmask/)) ;
+ $errcnt = 7 if ($file eq 'varerr.htm' && $^V && $^V ge v5.6.0) ;
- $debug ||= $defaultdebug ;
- $page = "$inpath/$file" ;
- $errcnt ||= 0 ;
-
- $notseen = $seen{"o:$page"}?0:1 ;
- $seen{"o:$page"} = 1 ;
-
- delete $ENV{EMBPERL_OPTIONS} if (defined ($ENV{EMBPERL_OPTIONS})) ;
- $ENV{EMBPERL_OPTIONS} = $option if (defined ($option)) ;
- $ENV{EMBPERL_COMPARTMENT} = $ns if (defined ($ns)) ;
- @testargs = ( '-o', $outfile ,
- '-l', $logfile,
- '-d', $debug,
- $page, $query_info || '') ;
- unshift (@testargs, 'dbgbreak') if ($dbgbreak) ;
-
- $txt = "#$testnum ". $file . ($debug != $defaultdebug ?"-d $debug ":"") .
'...' ;
- $txt .= ' ' x (30 - length ($txt)) ;
- print $txt ;
+ $debug ||= $defaultdebug ;
+ $page = "$inpath/$file" ;
+ $errcnt ||= 0 ;
+
+ $notseen = $seen{"o:$page"}?0:1 ;
+ $seen{"o:$page"} = 1 ;
+
+ delete $ENV{EMBPERL_OPTIONS} if (defined ($ENV{EMBPERL_OPTIONS})) ;
+ $ENV{EMBPERL_OPTIONS} = $option if (defined ($option)) ;
+ $ENV{EMBPERL_COMPARTMENT} = $ns if (defined ($ns)) ;
+ @testargs = ( '-o', $outfile ,
+ '-l', $logfile,
+ '-d', $debug,
+ $page, $query_info || '') ;
+ unshift (@testargs, 'dbgbreak') if ($dbgbreak) ;
+
+ $txt = "#$testnum ". $file . ($debug != $defaultdebug ?"-d $debug
":"") . '...' ;
+ $txt .= ' ' x (30 - length ($txt)) ;
+ print $txt ;
- unlink ($outfile) ;
+ unlink ($outfile) ;
- $n_offline++ ;
- $t1 = HTML::Embperl::Clock () ;
- $err = HTML::Embperl::run (@testargs) ;
- $t_offline += HTML::Embperl::Clock () - $t1 ;
+ $n_offline++ ;
+ $t1 = HTML::Embperl::Clock () ;
+ $err = HTML::Embperl::run (@testargs) ;
+ $t_offline += HTML::Embperl::Clock () - $t1 ;
- if ($memcheck)
- {
- my $vmsize = GetMem ($$) ;
- $vminitsize = $vmsize if $loopcnt == 2 ;
- print "\#$loopcnt size=$vmsize init=$vminitsize " ;
- print "GROWN! at iteration = $loopcnt " if ($vmsize > $vmmaxsize) ;
- $vmmaxsize = $vmsize if ($vmsize > $vmmaxsize) ;
- CheckSVs ($loopcnt, $n) ;
- }
-
- $errin = $err ;
- $err = CheckError ($errcnt) if ($err == 0 || ($errcnt > 0 && $err == 500)
|| $file eq 'notfound.htm' || $file eq 'notallow.xhtm') ;
-
-
- if ($err == 0 && $errin != 500 && $file ne 'notfound.htm' && $file ne
'notallow.xhtm')
- {
- $page =~ /.*\/(.*)$/ ;
- $org = "$cmppath/$1" ;
- $org .= '56' if ($file eq 'varerr.htm' && $^V && $^V ge v5.6.0) ;
+ if ($memcheck)
+ {
+ my $vmsize = GetMem ($$) ;
+ $vminitsize = $vmsize if $loopcnt == 2 ;
+ print "\#$loopcnt size=$vmsize init=$vminitsize " ;
+ print "GROWN! at iteration = $loopcnt " if ($vmsize > $vmmaxsize)
;
+ $vmmaxsize = $vmsize if ($vmsize > $vmmaxsize) ;
+ CheckSVs ($loopcnt, $n) ;
+ }
+
+ $errin = $err ;
+ $err = CheckError ($errcnt) if ($err == 0 || ($errcnt > 0 && $err ==
500) || $file eq 'notfound.htm' || $file eq 'notallow.xhtm') ;
+
+
+ if ($err == 0 && $errin != 500 && $file ne 'notfound.htm' && $file ne
'notallow.xhtm')
+ {
+ $page =~ /.*\/(.*)$/ ;
+ $org = "$cmppath/$1" ;
+ $org .= '56' if ($file eq 'varerr.htm' && $^V && $^V ge v5.6.0)
;
+ $org .= '-1' if ($ep1compat && -e "$org-1") ;
- $err = CmpFiles ($outfile, $org, $errin) ;
- }
+ $err = CmpFiles ($outfile, $org, $errin) ;
+ }
- print "ok\n" unless ($err) ;
- $err = 0 if ($ignoreerror) ;
- last if $err ;
- $n++ ;
- }
+ print "ok\n" unless ($err) ;
+ $err = 0 if ($ignoreerror) ;
+ last if $err ;
+ $n++ ;
+ }
+ last if $err ;
+ }
}
if ($testtype =~ /e/)
No revision
No revision
1.1.2.1 +25 -0 embperl/test/cmp/Attic/error.htm-1
1.1.2.1 +50 -0 embperl/test/cmp/Attic/var.htm-1
1.1.2.1 +13 -0 embperl/test/cmp/Attic/varerr.htm-1
No revision
No revision
1.3.2.2 +1 -1 embperl/test/html/var.htm
Index: var.htm
===================================================================
RCS file: /home/cvs/embperl/test/html/var.htm,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -r1.3.2.1 -r1.3.2.2
--- var.htm 2000/05/23 07:05:11 1.3.2.1
+++ var.htm 2000/06/06 19:49:07 1.3.2.2
@@ -6,7 +6,7 @@
<body>
-[$var $a $b $c $d $e $]
+[$var $a $b $c $d $e %CLEANUP $][- %CLEANUP = ('a' => 1, 'b' => 1, 'c' => 1, 'd' =>
1, 'e' => 1) ; -]
Here it starts with some HTML Text<P>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]