see changelog
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
19990727-07:50 CET Felipe Coury
|
||||
* tests/working/hscript/dir.hs; tests/working/hscript/hello.hs;
|
||||
tests/working/hscript/hscript.prg; tests/working/hscript/multiply.hs;
|
||||
tests/working/hscript/ugly.hs
|
||||
New version
|
||||
* tests/working/testcgi.prg
|
||||
New version as well
|
||||
|
||||
19990727-06:12 GMT+1 Antonio Linares <alinares@fivetech.com>
|
||||
* makefile.b32
|
||||
+ Added inkey.c module
|
||||
|
||||
@@ -10,9 +10,8 @@ FUNCTION Main()
|
||||
LOCAL i
|
||||
|
||||
IF !empty( GetEnv( "SERVER_NAME" ) )
|
||||
qqOut( "HTTP/1.0 200 OK" )
|
||||
qOut( "CONTENT-TYPE: TEXT/HTML" )
|
||||
qOut( "" )
|
||||
OutStd( "HTTP/1.0 200 OK" + chr(10) )
|
||||
OutStd( "CONTENT-TYPE: TEXT/HTML" + chr(10) + chr(10) )
|
||||
ENDIF
|
||||
|
||||
aSort( aDir,,, { |x, y| x[1] < y[1] } )
|
||||
@@ -33,11 +32,11 @@ FUNCTION Main()
|
||||
FOR i := 1 TO len( aDir )
|
||||
%>
|
||||
<TR>
|
||||
<TD><% qOut( aDir[i,1] ) %></TD>
|
||||
<TD><% qOut( aDir[i,2] ) %></TD>
|
||||
<TD><% qOut( aDir[i,3] ) %></TD>
|
||||
<TD><% qOut( aDir[i,4] ) %></TD>
|
||||
<TD><% qOut( aDir[i,5] ) %></TD>
|
||||
<TD><% OutStr( aDir[i,1] ) %></TD>
|
||||
<TD><% OutStr( aDir[i,2] ) %></TD>
|
||||
<TD><% OutStr( aDir[i,3] ) %></TD>
|
||||
<TD><% OutStr( aDir[i,4] ) %></TD>
|
||||
<TD><% OutStr( aDir[i,5] ) %></TD>
|
||||
</TR>
|
||||
<%
|
||||
NEXT
|
||||
|
||||
@@ -13,9 +13,8 @@ FUNCTION Main()
|
||||
|
||||
// Add content-type parameter if using active page on a Web Server
|
||||
IF !empty( GetEnv( "SERVER_NAME" ) )
|
||||
qqOut( "HTTP/1.0 200 OK" )
|
||||
qOut( "CONTENT-TYPE: TEXT/HTML" )
|
||||
qOut( "" )
|
||||
OutStd( "HTTP/1.0 200 OK" + chr(10) )
|
||||
OutStd( "CONTENT-TYPE: TEXT/HTML" + chr(10) + chr(10) )
|
||||
ENDIF
|
||||
|
||||
%>
|
||||
@@ -28,11 +27,11 @@ FUNCTION Main()
|
||||
<%
|
||||
// Now saying hello to the world in 3 different ways:
|
||||
// 1. Pure harbour:
|
||||
qOut( "<H1>Hello world!</H1></P>" )
|
||||
OutStd( "<H1>Hello world!</H1></P>" )
|
||||
|
||||
// 2. Hybrid harbour-html:
|
||||
%>
|
||||
<H1><% qOut( "Hello world!" ) %></H1></P>
|
||||
<H1><% OutStd( "Hello world!" ) %></H1></P>
|
||||
<%
|
||||
// 3. Pure html:
|
||||
%>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* HScript.PRG
|
||||
* HarbourScript translation engine
|
||||
@@ -32,12 +32,17 @@
|
||||
*
|
||||
* 1999/06/13 First implementation.
|
||||
* 1999/06/24 Enhanced tag matching routines.
|
||||
* 1999/07/26 Corrections to CGI output, qOut() -> OutStd().
|
||||
*
|
||||
**/
|
||||
|
||||
#include "CGI.ch"
|
||||
#define IF_BUFFER 65535
|
||||
#define NewLine chr(13)+chr(10)
|
||||
#ifdef __HARBOUR__
|
||||
#define NewLine chr(10)
|
||||
#else
|
||||
#define NewLine chr(13)
|
||||
#endif
|
||||
|
||||
FUNCTION Main( cScript )
|
||||
|
||||
@@ -54,29 +59,30 @@ FUNCTION Main( cScript )
|
||||
|
||||
IF empty( GetEnv( "SERVER_NAME" ) )
|
||||
cScriptName := cScript
|
||||
cLocation := GetEnv( "PATH_TRANSLATED" ) + ;
|
||||
strtran( GetEnv( "SCRIPT_NAME" ), "/", "\" )
|
||||
cLocation := substr( cLocation, 1, rat( "\", cLocation ) )
|
||||
cHarbourDir := cLocation
|
||||
cLocation := cHarbourDir
|
||||
|
||||
ELSE
|
||||
cScriptName := GetEnv( "QUERY_STRING" )
|
||||
IF at( "=", cScriptName ) != 0
|
||||
cScriptName := ParseString( cScriptName, "=", 2 )
|
||||
ENDIF
|
||||
cLocation := GetEnv( "PATH_TRANSLATED" ) + ;
|
||||
strtran( GetEnv( "SCRIPT_NAME" ), "/", "\" )
|
||||
cLocation := substr( cLocation, 1, rat( "\", cLocation ) )
|
||||
cHarbourDir := cLocation
|
||||
|
||||
ENDIF
|
||||
|
||||
IF empty( cScriptName )
|
||||
IF !empty( GetEnv( "SERVER_NAME" ) )
|
||||
qqOut( "content-type: text/html" )
|
||||
qOut( "" )
|
||||
qOut( "<HTML><BODY><H1>Server Error</H1><P>" )
|
||||
qOut( "Must specify scriptname using hscript.exe?script=<scriptname>" )
|
||||
qOut( "</BODY></HTML>" )
|
||||
OutStd( "content-type: text/html" + NewLine )
|
||||
OutStd( NewLine )
|
||||
OutStd( "<HTML><BODY><H1>Server Error</H1><P>" + NewLine )
|
||||
OutStd( "Must specify scriptname using hscript.exe?script=<scriptname>" + NewLine )
|
||||
OutStd( "</BODY></HTML>" + NewLine )
|
||||
|
||||
ELSE
|
||||
qOut( "Please give .hs name" )
|
||||
OutStd( "Please give .hs name" + NewLine )
|
||||
|
||||
ENDIF
|
||||
|
||||
@@ -86,9 +92,9 @@ FUNCTION Main( cScript )
|
||||
// Script not found
|
||||
IF !file( cScriptName )
|
||||
IF !empty( GetEnv( "SERVER_NAME" ) )
|
||||
qqOut( "CONTENT-TYPE: text/html" )
|
||||
OutStd( "CONTENT-TYPE: text/html" + NewLine )
|
||||
ENDIF
|
||||
qOut( "<H1>Server Error</H1><P>Script not found: " + cScriptName )
|
||||
OutStd( "<H1>Server Error</H1><P>Script not found: " + cScriptName + NewLine )
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
@@ -101,7 +107,7 @@ FUNCTION Main( cScript )
|
||||
nLen := len( cLine )
|
||||
|
||||
IF lOpen
|
||||
cTrans += "qOut( '"
|
||||
cTrans += "OutStd( '"
|
||||
ENDIF
|
||||
|
||||
FOR i := 1 TO nLen
|
||||
@@ -119,7 +125,7 @@ FUNCTION Main( cScript )
|
||||
cTrans += NewLine
|
||||
ENDIF
|
||||
IF i + 1 < nLen
|
||||
cTrans += "qOut( '"
|
||||
cTrans += "OutStd( '"
|
||||
ENDIF
|
||||
lOpen := .t.
|
||||
|
||||
@@ -132,7 +138,7 @@ FUNCTION Main( cScript )
|
||||
|
||||
ELSE
|
||||
// Fecha script
|
||||
cTrans += "' )"
|
||||
cTrans += "' + chr(10) )"
|
||||
lOpen := .f.
|
||||
IF i < nLen
|
||||
// cTrans += " ; "
|
||||
@@ -150,7 +156,7 @@ FUNCTION Main( cScript )
|
||||
NEXT
|
||||
|
||||
IF lOpen .AND. substr( cLine, nLen - 1, 2 ) <> "%>"
|
||||
cTrans += "' )"
|
||||
cTrans += "' + chr(10) )"
|
||||
ENDIF
|
||||
|
||||
aadd( aResult, cTrans )
|
||||
@@ -168,7 +174,8 @@ FUNCTION Main( cScript )
|
||||
fClose( hFile )
|
||||
|
||||
// Creates the temporary HRB, erases the PRG
|
||||
__Run( cHarbourDir + "harbour.exe " + cFile + " /q /n /gHRB" )
|
||||
__Run( cHarbourDir + "harbour.exe " + cFile + " /q /n /gHRB /o" + ;
|
||||
left( cHarbourDir, len( cHarbourDir ) - 1 ) )
|
||||
fErase( cFile )
|
||||
|
||||
// Runs using Tugboat
|
||||
|
||||
@@ -14,9 +14,8 @@ FUNCTION Main()
|
||||
LOCAL i, j
|
||||
|
||||
IF !empty( GetEnv( "SERVER_NAME" ) )
|
||||
qqOut( "HTTP/1.0 200 OK" )
|
||||
qOut( "CONTENT-TYPE: TEXT/HTML" )
|
||||
qOut( "" )
|
||||
OutStd( "HTTP/1.0 200 OK" + chr(10) )
|
||||
OutStd( "CONTENT-TYPE: TEXT/HTML" + chr(10) + chr(10) )
|
||||
ENDIF
|
||||
%>
|
||||
<HTML>
|
||||
@@ -24,7 +23,7 @@ FUNCTION Main()
|
||||
<TITLE>Testing script</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<H1><% qOut( "Teste de HarbourScript!" ) %></H1>
|
||||
<H1><% OutStd( "HarbourScript Test!" ) %></H1>
|
||||
|
||||
<BODY>
|
||||
<%
|
||||
@@ -36,8 +35,8 @@ FUNCTION Main()
|
||||
FOR j := 1 TO 10
|
||||
%>
|
||||
<TR>
|
||||
<TD><% qOut( str( i, 2 ) + " x " + str( j, 2 ) ) %></TD>
|
||||
<TD><% qOut( i*j ) %></TD>
|
||||
<TD><% OutStd( str( i, 2 ) + " x " + str( j, 2 ) ) %></TD>
|
||||
<TD><% OutStd( i*j ) %></TD>
|
||||
</TR>
|
||||
<%
|
||||
NEXT
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
*/
|
||||
|
||||
LOCAL a := "Hello Mom!" %><HTML><BODY><%
|
||||
qOut( a ) %><P>This is a <B>very ugly</B> script!!!<%
|
||||
qOut( "Line 2" )
|
||||
OutStd( a ) %><P>This is a <B>very ugly</B> script!!!<%
|
||||
OutStd( "Line 2" )
|
||||
%>
|
||||
<P>
|
||||
<%
|
||||
qOut( a, a, a )
|
||||
OutStd( a, a, a )
|
||||
%>
|
||||
</HTML><%RETURN( NIL )%>
|
||||
|
||||
@@ -21,12 +21,17 @@
|
||||
* (See http://www.flexsys-ci.com/harbour-project/functions.htm)
|
||||
* 1999/06/11 List can be viewed online at
|
||||
* http://www.flexsys-ci.com/cgi-bin/testcgi.exe
|
||||
* 1999/07/29 Changed qOut() calls to OutStd() calls.
|
||||
*
|
||||
**/
|
||||
|
||||
#include "cgi.ch"
|
||||
#define IF_BUFFER 65535
|
||||
#define NewLine chr(10)+chr(13)
|
||||
#ifdef __HARBOUR__
|
||||
#define NewLine chr(10)
|
||||
#else
|
||||
#define NewLine chr(13)
|
||||
#endif
|
||||
|
||||
FUNCTION Main()
|
||||
|
||||
@@ -320,7 +325,7 @@ STATIC FUNCTION ShowResult()
|
||||
|
||||
LOCAL Self := QSelf()
|
||||
|
||||
qqOut( ;
|
||||
OutStd( ;
|
||||
"HTTP/1.0 200 OK" + NewLine + ;
|
||||
"CONTENT-TYPE: TEXT/HTML" + NewLine + NewLine + ;
|
||||
::cContent )
|
||||
|
||||
Reference in New Issue
Block a user