2007-10-27 01:23 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* include/hbsetup.h
     - Removed HOST_OS_UNIX_COMPATIBLE which was a misleading 
       alias for OS_UNIX_COMPATIBLE.

   * source/compiler/hbcomp.c
     % HOST_OS_UNIX_COMPATIBLE -> OS_UNIX_COMPATIBLE

   * common.mak
   * harbour-ce-spec
   * make_xmingw.sh
   * make_xmingwce.sh
   * makefile.bc
   * makefile.gc
   * makefile.vc
   * source/pp/Makefile
   - source/pp/ppgen.c
   + source/pp/hbppgen.c
     ! executable ppgen renamed to hbppgen.

   * samples/pe/editorlo.c
   * samples/pe/pe.prg
   + samples/pe/bld_b32.bat
     + Added BCC build batch file.
     ! Fixed to compile under current Harbour.
     ! Fixed filename casing.
     ! Fixed several warnings (quite some signedness problem still remain).
     ; This is a very nice editor written in C (Harbour callable),
       I think it is the work of Ryszard.

   * samples/hscript/bld_b32.bat
   * samples/hscript/hscript.prg
   * samples/hscript/dir.hs
   * samples/hscript/multiply.hs
   * samples/hscript/ugly.hs
   * samples/hscript/hello.hs
     ! Fixed build batch file.
     ! Fixed to use NFLib file IO rather than libmisc, because 
       latter was broken (it is a clone of the NFLib file IO).
     ! Fixed scripts to use Start instead of Main as an entry 
       point otherwise __hrbRun() got confused and called the 
       app Main().
     ! Fixed some other problems to make it run.
This commit is contained in:
Viktor Szakats
2007-10-26 23:26:59 +00:00
parent 082820305e
commit 72526bc283
21 changed files with 212 additions and 143 deletions

View File

@@ -8,6 +8,50 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-10-27 01:23 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* include/hbsetup.h
- Removed HOST_OS_UNIX_COMPATIBLE which was a misleading
alias for OS_UNIX_COMPATIBLE.
* source/compiler/hbcomp.c
% HOST_OS_UNIX_COMPATIBLE -> OS_UNIX_COMPATIBLE
* common.mak
* harbour-ce-spec
* make_xmingw.sh
* make_xmingwce.sh
* makefile.bc
* makefile.gc
* makefile.vc
* source/pp/Makefile
- source/pp/ppgen.c
+ source/pp/hbppgen.c
! executable ppgen renamed to hbppgen.
* samples/pe/editorlo.c
* samples/pe/pe.prg
+ samples/pe/bld_b32.bat
+ Added BCC build batch file.
! Fixed to compile under current Harbour.
! Fixed filename casing.
! Fixed several warnings (quite some signedness problem still remain).
; This is a very nice editor written in C (Harbour callable),
I think it is the work of Ryszard.
* samples/hscript/bld_b32.bat
* samples/hscript/hscript.prg
* samples/hscript/dir.hs
* samples/hscript/multiply.hs
* samples/hscript/ugly.hs
* samples/hscript/hello.hs
! Fixed build batch file.
! Fixed to use NFLib file IO rather than libmisc, because
latter was broken (it is a clone of the NFLib file IO).
! Fixed scripts to use Start instead of Main as an entry
point otherwise __hrbRun() got confused and called the
app Main().
! Fixed some other problems to make it run.
2007-10-26 20:46 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/win32/w32_prn.c
+ Using hb_retptrGC()/hb_parptrGC().

View File

@@ -207,7 +207,7 @@ GTXWC_LIB = $(LIB_DIR)\$(LIBPREF)gtxwc$(LIBEXT)
HARBOUR_EXE = $(BIN_DIR)\harbour$(EXEEXT)
# required (intermediate) utility
# to generate pptable.c
HBPPGEN_EXE = $(BIN_DIR)\ppgen$(EXEEXT)
HBPPGEN_EXE = $(BIN_DIR)\hbppgen$(EXEEXT)
HBPP_EXE = $(BIN_DIR)\hbpp$(EXEEXT)
HBPPTEST_EXE = $(BIN_DIR)\hbpptest$(EXEEXT)
HBRUN_EXE = $(BIN_DIR)\hbrun$(EXEEXT)
@@ -937,7 +937,7 @@ HBPP_EXE_OBJS = \
#**********************************************************
HBPPGEN_EXE_OBJS = \
$(OBJ_DIR)\ppgen$(OBJEXT) \
$(OBJ_DIR)\hbppgen$(OBJEXT) \
#**********************************************************

View File

@@ -97,7 +97,7 @@ export HB_ARCHITECTURE=w32
export HB_COMPILER=cemgw
mkdir -p source/pp/${HB_ARCHITECTURE}/${HB_COMPILER}
ln -s ../../linux/gcc/ppgen source/pp/${HB_ARCHITECTURE}/${HB_COMPILER}/ppgen.exe
ln -s ../../linux/gcc/hbppgen source/pp/${HB_ARCHITECTURE}/${HB_COMPILER}/hbppgen.exe
mkdir -p source/main/${HB_ARCHITECTURE}/${HB_COMPILER}
ln -s ../../linux/gcc/harbour source/main/${HB_ARCHITECTURE}/${HB_COMPILER}/harbour.exe

View File

@@ -280,7 +280,6 @@
! ( defined(__DJGPP__) || defined(__EMX__) || defined(__RSXNT__) || \
defined(_Windows) || defined(_WIN32) || defined(_WINCE) ) ) || \
( defined(__WATCOMC__) && defined(__LINUX__) )
#define HOST_OS_UNIX_COMPATIBLE
#define OS_UNIX_COMPATIBLE
#define OS_PATH_LIST_SEPARATOR ':'
#define OS_PATH_DELIMITER '/'

View File

@@ -60,7 +60,7 @@ else
exit 1
fi
(cd `dirname $0`; ln -s `pwd`/source/pp/linux/gcc/ppgen ${HB_BIN_COMPILE}/ppgen.exe)
(cd `dirname $0`; ln -s `pwd`/source/pp/linux/gcc/hbppgen ${HB_BIN_COMPILE}/hbppgen.exe)
export HB_PPGEN_PATH=${HB_BIN_COMPILE}
export PATH CCPATH CCPREFIX

View File

@@ -42,8 +42,8 @@ else
fi
(cd `dirname $0`
ln -s `pwd`/source/pp/`echo "$UNAME"|tr A-Z a-z`/gcc/ppgen \
${HB_BIN_COMPILE}/ppgen.exe)
ln -s `pwd`/source/pp/`echo "$UNAME"|tr A-Z a-z`/gcc/hbppgen \
${HB_BIN_COMPILE}/hbppgen.exe)
export HB_PPGEN_PATH=${HB_BIN_COMPILE}
case "$1" in

View File

@@ -609,7 +609,7 @@ $(DLL_OBJ_DIR)\mainstd.obj : $(VM_DIR)\mainstd.c
#**********************************************************
#**********************************************************
# Generated by an intermediate utility ppgen.exe
# Generated by an intermediate utility hbppgen.exe
# built at the initial phase of build process
$(OBJ_DIR)\pptable.obj : $(PP_DIR)\pptable.c
$(PP_DIR)\pptable.c : include\hbstdgen.ch

View File

@@ -399,7 +399,7 @@ $(HBVER_EXE) :: $(HBVER_EXE_OBJS)
# EXTRA Object's DEPENDENCIES
#**********************************************************
# Generated by an intermediate utility ppgen.exe
# Generated by an intermediate utility hbppgen.exe
# built at the initial phase of build process
$(OBJ_DIR)/pptable$(OBJEXT) : $(OBJ_DIR)/pptable.c
$(OBJ_DIR)/pptable.c : $(HBPPGEN) include/hbstdgen.ch include/std.ch $(PP_DIR)/ppcore.c $(PP_DIR)/ppgen.c

View File

@@ -975,7 +975,7 @@ $(DLL_OBJ_DIR)\mainstd.obj : $(VM_DIR)\mainstd.c
# EXTRA Object's DEPENDENCIES
#**********************************************************
# Generated by an intermediate utility ppgen.exe
# Generated by an intermediate utility hbppgen.exe
# built at the initial phase of build process
$(OBJ_DIR)\pptable.obj : $(PP_DIR)\pptable.c
$(PP_DIR)\pptable.c : include\hbstdgen.ch

View File

@@ -3,6 +3,8 @@ rem
rem $Id$
rem
rem NOTE: This sample program need nf.lib from contrib/libnf
..\..\bin\harbour hscript /n /i..\..\include
bcc32 -O2 -I..\..\include -L..\..\lib -ehscript.exe hscript.c debug.lib vm.lib rtl.lib gtwin.lib lang.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib dbffpt.lib hbsix.lib common.lib
rem del hscript.c
bcc32 -O2 -I..\..\include -L..\..\lib -ehscript.exe hscript.c debug.lib vm.lib rtl.lib gtwin.lib lang.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib dbffpt.lib codepage.lib hbsix.lib common.lib hbpcre.lib hsx.lib nf.lib
del hscript.c

View File

@@ -4,7 +4,7 @@
* www - http://www.harbour-project.org
*
*/
FUNCTION Main()
FUNCTION Start()
LOCAL aDir := directory( "c:\*.*" )
LOCAL i

View File

@@ -9,7 +9,7 @@
*
*/
FUNCTION Main()
FUNCTION Start()
// Add content-type parameter if using active page on a Web Server
IF !empty( GetEnv( "SERVER_NAME" ) )

View File

@@ -51,66 +51,60 @@
*
* 1999/06/13 First implementation.
* 1999/06/24 Enhanced tag matching routines.
* 1999/07/26 Corrections to CGI output, qOut() -> OutStd().
* 1999/07/26 Corrections to CGI output, QOut() -> OutStd().
*
*/
#include "hbextern.ch"
#include "cgi.ch"
#define IF_BUFFER 65535
REQUEST DIRECTORY
REQUEST GETENV
REQUEST ASORT
#define IF_BUFFER 65535
FUNCTION Main( cScript )
LOCAL aHRSHandle := {} // Handle for script lines
LOCAL aResult := {} // Handle for transl'd lines
LOCAL cLocation := {} // Location of scripts
LOCAL cLocation // Location of scripts
LOCAL cHarbourDir := GetEnv( "HARBOURDIR" ) // Harbour.exe dir with '\'
LOCAL cHost := strtran( alltrim( ; // Random (not et al)
str( seconds() ) ), '.' ) // file name
LOCAL cHost := StrTran( alltrim( ; // Random (not et al)
Str( Seconds() ) ), '.' ) // file name
LOCAL cScriptName, cFile, cLine, cTrans, c
LOCAL hFile, i, lOpen, nLen
WHILE .t.
WHILE .T.
IF empty( GetEnv( "SERVER_NAME" ) )
IF Empty( GetEnv( "SERVER_NAME" ) )
cScriptName := cScript
cLocation := cHarbourDir
ELSE
cScriptName := GetEnv( "QUERY_STRING" )
IF at( "=", cScriptName ) != 0
IF At( "=", cScriptName ) != 0
cScriptName := ParseString( cScriptName, "=", 2 )
ENDIF
cLocation := GetEnv( "PATH_TRANSLATED" ) + ;
strtran( GetEnv( "SCRIPT_NAME" ), "/", "\" )
cLocation := substr( cLocation, 1, rat( "\", cLocation ) )
StrTran( GetEnv( "SCRIPT_NAME" ), "/", "\" )
cLocation := SubStr( cLocation, 1, RAt( "\", cLocation ) )
cHarbourDir := cLocation
ENDIF
IF empty( cScriptName )
IF !empty( GetEnv( "SERVER_NAME" ) )
IF Empty( cScriptName )
IF !Empty( GetEnv( "SERVER_NAME" ) )
OutStd( "content-type: text/html" + hb_OSNewLine() )
OutStd( hb_OSNewLine() )
OutStd( "<HTML><BODY><H1>Server Error</H1><P>" + hb_OSNewLine() )
OutStd( "Must specify scriptname using hscript.exe?script=<scriptname>" + hb_OSNewLine() )
OutStd( "</BODY></HTML>" + hb_OSNewLine() )
ELSE
OutStd( "Please give .hs name" + hb_OSNewLine() )
ENDIF
EXIT
ENDIF
// Script not found
IF !file( cScriptName )
IF !empty( GetEnv( "SERVER_NAME" ) )
IF !File( cScriptName )
IF !Empty( GetEnv( "SERVER_NAME" ) )
OutStd( "CONTENT-TYPE: text/html" + hb_OSNewLine() )
ENDIF
OutStd( "<H1>Server Error</H1><P>Script not found: " + cScriptName + hb_OSNewLine() )
@@ -118,12 +112,12 @@ FUNCTION Main( cScript )
ENDIF
lOpen := .f.
hb_fUse( cScriptName )
WHILE !hb_fEof()
ft_FUse( cScriptName )
WHILE !ft_FEof()
cLine := alltrim( hb_fReadLn() )
cLine := AllTrim( ft_FReadLn() )
cTrans := ""
nLen := len( cLine )
nLen := Len( cLine )
IF lOpen
cTrans += "OutStd( '"
@@ -131,12 +125,11 @@ FUNCTION Main( cScript )
FOR i := 1 TO nLen
c := substr( cLine, i, 1 )
c := SubStr( cLine, i, 1 )
IF c = "%" .AND. substr( cLine, i + 1, 1 ) = ">"
IF lOpen
// Error - Already in htm mode
ELSE
// Abre script
IF i > 1
@@ -154,7 +147,6 @@ FUNCTION Main( cScript )
ELSEIF c = "<" .AND. substr( cLine, i + 1, 1 ) = "%"
IF !lOpen
// Error - Not in htm mode
ELSE
// Fecha script
cTrans += "' + chr(10) )"
@@ -169,46 +161,43 @@ FUNCTION Main( cScript )
ELSE
cTrans += c
ENDIF
NEXT
IF lOpen .AND. substr( cLine, nLen - 1, 2 ) <> "%>"
cTrans += "' + chr(10) )"
ENDIF
aadd( aResult, cTrans )
AAdd( aResult, cTrans )
hb_fSkip()
ft_FSkip()
ENDDO
hb_fUse()
ft_FUse()
cFile := cLocation + cHost + ".prg" // Output file name
hFile := fCreate( cFile )
FOR i := 1 TO len( aResult )
fWrite( hFile, aResult[i] + chr(13)+chr(10) )
hFile := FCreate( cFile )
FOR i := 1 TO Len( aResult )
FWrite( hFile, aResult[i] + hb_OSNewLine() )
NEXT
fClose( hFile )
FClose( hFile )
// Creates the temporary HRB, erases the PRG
__Run( cHarbourDir + "harbour.exe " + cFile + " /q /n /gh /o" + ;
left( cHarbourDir, len( cHarbourDir ) - 1 ) + "\" )
fErase( cFile )
__Run( cHarbourDir + "harbour.exe " + cFile + " /q /n /gh /o" + Left( cHarbourDir, Len( cHarbourDir ) - 1 ) + iif( !Empty( Left( cHarbourDir, Len( cHarbourDir ) - 1 ) ), "\", "" ) )
FErase( cFile )
// Runs using Tugboat
cFile := strtran( upper( cFile ), ".PRG", ".hrb" )
cFile := StrTran( Upper( cFile ), ".PRG", ".hrb" )
__hrbRun( cFile )
// Erases the HRB file
fErase( cFile )
FErase( cFile )
// That's all, folks!
EXIT
ENDDO
RETURN( NIL )
RETURN NIL
FUNCTION ParseString( cString, cDelim, nRet )

View File

@@ -9,7 +9,7 @@
*
*/
FUNCTION Main()
FUNCTION Start()
LOCAL i, j

View File

@@ -1,4 +1,4 @@
<% FUNCTION Main()
<% FUNCTION Start()
/* Written by Felipe Coury <fcoury@flexsys-ci.com>
* www - http://www.harbour-project.org

View File

@@ -0,0 +1,28 @@
@echo off
rem
rem $Id$
rem
..\..\bin\harbour /n pe /i..\..\include\
..\..\bin\harbour /n editorhi /i..\..\include\
echo -O2 -I..\..\include -L..\..\lib > build.tmp
echo -epe.exe >> build.tmp
echo pe.c editorhi.c editorlo.c >> build.tmp
echo debug.lib >> build.tmp
echo vm.lib >> build.tmp
echo rtl.lib >> build.tmp
echo gtwin.lib >> build.tmp
echo lang.lib >> build.tmp
echo rdd.lib >> build.tmp
echo macro.lib >> build.tmp
echo pp.lib >> build.tmp
echo dbfntx.lib >> build.tmp
echo dbfcdx.lib >> build.tmp
echo dbffpt.lib >> build.tmp
echo hbsix.lib >> build.tmp
echo common.lib >> build.tmp
bcc32 @build.tmp
del build.tmp
pe

View File

@@ -29,7 +29,7 @@
#define TRUE !0
#endif
#define CLIPPER_ACTION(action) void pascal action( void )
#define CLIPPER_ACTION(action) HB_FUNC( action )
#define Eof '\x0'
@@ -253,7 +253,7 @@ static void New(EDITOR *E, int tab, int ll, long int BuforSize)
** Creates new editor and returns index into internal editors table
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_NEW )
CLIPPER_ACTION( ED_NEW )
#else
int HB_ED_NEW( int ll, int tab, long int BuforSize )
#endif
@@ -346,7 +346,7 @@ static void FormatText ( EDITOR *E )
* operation if a very large file is edited
*/
wsk =E->begin +E->last_line;
while( (wsk = strchr( wsk, '\t' )) )
while( (wsk = strchr( wsk, '\t' )) != 0 )
{
j = wsk - E->begin;
@@ -379,7 +379,8 @@ static void FormatText ( EDITOR *E )
*/
static void NewText( EDITOR *E )
{
unsigned int i, dl;
unsigned int dl;
int i;
/* text in buffer have to end with CR/LF
*/
@@ -443,7 +444,7 @@ static void AddText( int nEdit, char *adres )
** Appends passed text at the end of existing one
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_ADDTEXT )
CLIPPER_ACTION( ED_ADDTEXT )
#else
CLIPPER HB_ED_ADDTEXT ( int nEdit, char *adres )
#endif
@@ -497,7 +498,7 @@ static long int GoToLine( EDITOR *E, int linia )
i =0;
p =E->begin;
while( (++i <= linia) && (p=strchr( p, '\n' )) )
while( (++i <= linia) && (p=strchr( p, '\n' )) != 0 )
p +=2;
if( i > linia )
@@ -626,7 +627,7 @@ static long int InsText ( EDITOR *E, char *adres, long int line )
** Inserts passed text into text buffer
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_INSTEXT )
CLIPPER_ACTION( ED_INSTEXT )
#else
unsigned int HB_ED_INSTEXT ( int nEdit, char *adres, long int linia )
#endif
@@ -659,7 +660,7 @@ unsigned int HB_ED_INSTEXT ( int nEdit, char *adres, long int linia )
**
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_PUSH )
CLIPPER_ACTION( ED_PUSH )
{
int i;
@@ -670,7 +671,7 @@ CLIPPER_ACTION( HB_ED_PUSH )
EStack[ i ] =ED;
}
CLIPPER_ACTION( HB_ED_POP )
CLIPPER_ACTION( ED_POP )
{
int i;
@@ -691,7 +692,7 @@ CLIPPER_ACTION( HB_ED_POP )
* to this editor.
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_CONFIG )
CLIPPER_ACTION( ED_CONFIG )
#else
CLIPPER HB_ED_CONFIG(int nEdit, int top, int left, int bottom, int right,
int nRow, int nCol)
@@ -868,7 +869,7 @@ CLIPPER HB_ED_CONFIG(int nEdit, int top, int left, int bottom, int right,
** Returns current text buffer
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_GETTEXT )
CLIPPER_ACTION( ED_GETTEXT )
#else
char *HB_ED_GETTEXT(int nEdit, int Case, int mietka )
#endif
@@ -945,7 +946,7 @@ char *HB_ED_GETTEXT(int nEdit, int Case, int mietka )
** Returns given line of text and positions caret at the beginning of next line
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_GETLINE )
CLIPPER_ACTION( ED_GETLINE )
#else
char *HB_ED_GETLINE(int nEdit, long int linia )
#endif
@@ -954,7 +955,8 @@ char *HB_ED_GETLINE(int nEdit, long int linia )
long int tmp;
char *bufor;
EDITOR *E;
int rdl, i, dl;
int rdl, dl;
long int i;
#ifdef mc51
long int linia;
@@ -968,7 +970,7 @@ char *HB_ED_GETLINE(int nEdit, long int linia )
l = 1;
tmp = E->first_line;
for(i = 1; i < (unsigned int) linia; i++)
for(i = 1; i < linia; i++)
{
j = Next ( E, tmp );
if ( j >= 0 )
@@ -1005,7 +1007,7 @@ char *HB_ED_GETLINE(int nEdit, long int linia )
** Returns current line pointed by caret position and advances it to the beginning of next line
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_GETNEXT )
CLIPPER_ACTION( ED_GETNEXT )
#else
char *HB_ED_GETNEXT(int nEdit)
#endif
@@ -1067,7 +1069,7 @@ static void KillText ( EDITOR *E )
** Stores new text into editor
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_SETTEXT )
CLIPPER_ACTION( ED_SETTEXT )
#else
CLIPPER HB_ED_SETTEXT(int nEdit, char *adres)
#endif
@@ -1095,12 +1097,12 @@ CLIPPER HB_ED_SETTEXT(int nEdit, char *adres)
** Reads a text from the file
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_READTEXT )
CLIPPER_ACTION( ED_READTEXT )
{
unsigned int nEdit, nFile, nSize, lSuccess=FALSE;
long int nSeek, nRead;
EDITOR *E;
BOOL lConv;
/* BOOL lConv; */
nEdit =_parni( 1 );
E =ETab[ nEdit ];
@@ -1111,7 +1113,7 @@ CLIPPER_ACTION( HB_ED_READTEXT )
nFile =_parni( 2 );
nSeek =_parnl( 3 );
nSize =_parni( 4 );
lConv =_parl( 5 );
/* lConv =_parl( 5 ); */
nRead =_fsSeek( nFile, nSeek, FS_SET );
if( nRead == nSeek )
@@ -1159,7 +1161,7 @@ CLIPPER_ACTION( HB_ED_READTEXT )
** Releases memory occupied by the editor
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_KILL )
CLIPPER_ACTION( ED_KILL )
#else
CLIPPER HB_ED_KILL(int nEdit)
#endif
@@ -1192,7 +1194,7 @@ CLIPPER HB_ED_KILL(int nEdit)
/* Sorry - I don't remember why it is here
*/
CLIPPER_ACTION( HB_ED_UNLOCK )
CLIPPER_ACTION( ED_UNLOCK )
{
}
@@ -1203,7 +1205,7 @@ CLIPPER_ACTION( HB_ED_UNLOCK )
* Incremental stabilisation was too slow
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_STABILIZE )
CLIPPER_ACTION( ED_STABILIZE )
#else
int HB_ED_STABILI( void )
#endif
@@ -1296,7 +1298,7 @@ int HB_ED_STABILI( void )
nTop =ED->top +nRow;
if( nLen )
{
if( ED->escape && ( EscPtr = strchr( adres, ED->escape ) ) )
if( ED->escape && ( EscPtr = strchr( adres, ED->escape ) ) != 0 )
{
i =(unsigned int)(EscPtr - adres);
nLeft =ED->left +i;
@@ -1452,7 +1454,7 @@ static void Down( EDITOR *E )
** Moves cursor to the next line of text
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_DOWN )
CLIPPER_ACTION( ED_DOWN )
#else
CLIPPER HB_ED_DOWN(void)
#endif
@@ -1525,7 +1527,7 @@ static void Up( void )
** Moves the cursor to the previous line
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_UP )
CLIPPER_ACTION( ED_UP )
#else
CLIPPER HB_ED_UP(void)
#endif
@@ -1541,7 +1543,7 @@ CLIPPER HB_ED_UP(void)
** Moves the cursor to the next page of text
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_PGDOWN )
CLIPPER_ACTION( ED_PGDOWN )
#else
CLIPPER HB_ED_PGDOWN(void)
#endif
@@ -1614,7 +1616,7 @@ CLIPPER HB_ED_PGDOWN(void)
** Moves the cursor to the previous page of text
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_PGUP )
CLIPPER_ACTION( ED_PGUP )
#else
CLIPPER HB_ED_PGUP(void)
#endif
@@ -1679,7 +1681,7 @@ CLIPPER HB_ED_PGUP(void)
** Move the cursor to the beginning of the text
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_TOP )
CLIPPER_ACTION( ED_TOP )
#else
CLIPPER HB_ED_TOP(void)
#endif
@@ -1714,7 +1716,7 @@ CLIPPER HB_ED_TOP(void)
** Move the cursor to the last line of text
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_BOTTOM )
CLIPPER_ACTION( ED_BOTTOM )
#else
CLIPPER HB_ED_BOTTOM(void)
#endif
@@ -1798,7 +1800,7 @@ static void GoTo(int line)
** Move the cursor to the given line using line number
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_GOTO )
CLIPPER_ACTION( ED_GOTO )
#else
CLIPPER HB_ED_GOTO(long int line)
#endif
@@ -1838,7 +1840,7 @@ static void Left(void)
** Move the cursor to the previous character
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_LEFT )
CLIPPER_ACTION( ED_LEFT )
#else
CLIPPER HB_ED_LEFT(void)
#endif
@@ -1875,7 +1877,7 @@ static void Right( EDITOR *E )
** Move the cursor to the next character
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_RIGHT )
CLIPPER_ACTION( ED_RIGHT )
#else
CLIPPER HB_ED_RIGHT(void)
#endif
@@ -1911,7 +1913,7 @@ static void Home( EDITOR *E )
** Move the cursor to the beginning of the line
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_HOME )
CLIPPER_ACTION( ED_HOME )
#else
CLIPPER HB_ED_HOME(void)
#endif
@@ -1960,7 +1962,7 @@ static void End( EDITOR *E )
** Move the cursor the the end of line (after the last non-space character)
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_END )
CLIPPER_ACTION( ED_END )
#else
CLIPPER HB_ED_END(void)
#endif
@@ -2090,7 +2092,7 @@ static void DelChar ( EDITOR *E )
** Delete the character at current cursor position
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_DELCHAR )
CLIPPER_ACTION( ED_DELCHAR )
#else
CLIPPER HB_ED_DELCHAR(void)
#endif
@@ -2187,7 +2189,7 @@ static void BackSpace( int INS )
/* find the first space in current line (the new line will
* be wrapped eventually at this position) */
if( ( w = strchr ( tmp, ' ') ) )
if( ( w = strchr ( tmp, ' ') ) != 0 )
ww = (int)(w - tmp);
else
ww = nLen+rdl;
@@ -2268,7 +2270,7 @@ static void BackSpace( int INS )
** Delete a character on the left side of the cursor
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_BSPACE )
CLIPPER_ACTION( ED_BSPACE )
#else
CLIPPER HB_ED_BSPACE(int INS)
#endif
@@ -2360,7 +2362,7 @@ static void NextWord(void)
** Move the cursor to the next word
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_NWORD )
CLIPPER_ACTION( ED_NWORD )
#else
CLIPPER HB_ED_NWORD(void)
#endif
@@ -2443,7 +2445,7 @@ static void PreviousWord(void)
** Move the cursor to the previous word
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_PWORD )
CLIPPER_ACTION( ED_PWORD )
#else
CLIPPER HB_ED_PWORD(void)
#endif
@@ -2676,7 +2678,7 @@ static void PutChar( int INS, int znak )
** Insert or replace the character into the text buffer
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_PUTCHAR )
CLIPPER_ACTION( ED_PUTCHAR )
#else
CLIPPER HB_ED_PUTCHAR(int INS, int znak)
#endif
@@ -2710,7 +2712,7 @@ static void Tab ( int INS )
/*
#ifdef mc51
CLIPPER_ACTION( HB_ED_TAB )
CLIPPER_ACTION( ED_TAB )
#else
CLIPPER HB_ED_TAB(int INS)
#endif
@@ -2729,7 +2731,7 @@ CLIPPER HB_ED_TAB(int INS)
** Delete the current line
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_DELLINE )
CLIPPER_ACTION( ED_DELLINE )
#else
CLIPPER HB_ED_DELLINE(void)
#endif
@@ -2786,7 +2788,7 @@ CLIPPER HB_ED_DELLINE(void)
** Delete the word on the right side of the cursor
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_DELWORD )
CLIPPER_ACTION( ED_DELWORD )
#else
CLIPPER HB_ED_DELWORD(void)
#endif
@@ -2836,7 +2838,11 @@ CLIPPER HB_ED_DELWORD(void)
{
if( ( GetLineLength( ED, ED->current_line, &rdl ) ) == 0 )
{
#ifdef mc51
HB_FUNC_EXEC( ED_DELLINE )
#else
HB_ED_DELLINE( );
#endif
Home( ED );
}
}
@@ -2941,7 +2947,7 @@ static void Return(int INS)
** Insert the CRLF characters
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_RETURN )
CLIPPER_ACTION( ED_RETURN )
#else
CLIPPER HB_ED_RETURN(int INS)
#endif
@@ -2958,7 +2964,7 @@ CLIPPER HB_ED_RETURN(int INS)
** Returns the current cursor row inside the editor's window
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_WINROW )
CLIPPER_ACTION( ED_WINROW )
#else
int HB_ED_WINROW(void)
#endif
@@ -2974,7 +2980,7 @@ int HB_ED_WINROW(void)
** Returns the line number where the cursor is positioned
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_ROW )
CLIPPER_ACTION( ED_ROW )
#else
int HB_ED_ROW(void)
#endif
@@ -2991,7 +2997,7 @@ int HB_ED_ROW(void)
** Return the current cursor column inside the editor's window
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_WINCOL )
CLIPPER_ACTION( ED_WINCOL )
#else
int HB_ED_WINCOL(void)
#endif
@@ -3007,7 +3013,7 @@ int HB_ED_WINCOL(void)
** Returns the current cursor position inside the line
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_COL )
CLIPPER_ACTION( ED_COL )
#else
int HB_ED_COL(void)
#endif
@@ -3024,7 +3030,7 @@ int HB_ED_COL(void)
** Returns the total number of lines
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_MAXLINE )
CLIPPER_ACTION( ED_MAXLINE )
#else
long int HB_ED_MAXLINE(void)
#endif
@@ -3040,7 +3046,7 @@ long int HB_ED_MAXLINE(void)
** Counts the total number of lines in passed editor
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_LCOUNT )
CLIPPER_ACTION( ED_LCOUNT )
#else
long int HB_ED_LCOUNT(int nEdit)
#endif
@@ -3063,7 +3069,7 @@ long int HB_ED_LCOUNT(int nEdit)
** Returns if the editor is correctly displayed
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_STABLE )
CLIPPER_ACTION( ED_STABLE )
#else
int HB_ED_STABLE(void)
#endif
@@ -3080,7 +3086,7 @@ int HB_ED_STABLE(void)
** Returns the number of bytes stored in the text buffer
*/
#ifdef mc51
CLIPPER_ACTION( HB_ED_LENGTH )
CLIPPER_ACTION( ED_LENGTH )
#else
long int HB_ED_LENGTH(void)
#endif

View File

@@ -1,41 +1,42 @@
/*
* $Id$
*/
#define EDIT_EDIT .T.
#define EDIT_VIEW .F.
PROCEDURE MAIN( cFile )
LOCAL cText
LOCAL lMode:=EDIT_EDIT
PROCEDURE Main( cFile )
LOCAL cText
LOCAL lMode := EDIT_EDIT
IF( cFile == NIL )
cFile ="license.txt"
IF( !FILE(cFile) )
cFile ="../../license.txt"
ENDIF
lMode =EDIT_VIEW
ENDIF
cText =MEMOREAD( cFile )
cText =MEMOEDITOR( cText, 0,0, MAXROW(), MAXCOL(), lMode )
MEMOWRIT( "OUTPUT.TXT", cText )
IF cFile == NIL
cFile := "license.txt"
IF !File( cFile )
cFile := "../../license.txt"
ENDIF
lMode := EDIT_VIEW
ENDIF
cText := MemoRead( cFile )
cText := MemoEditor( cText, 0, 0, MaxRow(), MaxCol(), lMode )
MemoWrit( "output.txt", cText )
RETURN
RETURN
STATIC FUNCTION MEMOEDITOR( cText, nTop, nLeft, nBottom, nRight, lMode )
LOCAL oED
LOCAL oED
/* NOTE: In current design of editor it doesn't reallocate the memory
buffer used to hold the text
*/
oED :=EditorNew( nTop, nLeft, nBottom, nRight, 254, , , , LEN(cText)*2, 168 )
IF( oED != NIL )
EditorSetText( oED, cText )
EditorEdit( oED, lMode, .T. )
cText :=EditorGetText( oED )
EditorKill( oED )
ELSE
? "Editor not created"
ENDIF
/* NOTE: In current design of editor it doesn't reallocate the memory
buffer used to hold the text
*/
oED := EditorNew( nTop, nLeft, nBottom, nRight, 254, , , , Len( cText ) * 2, 168 )
IF oED != NIL
EditorSetText( oED, cText )
EditorEdit( oED, lMode, .T. )
cText := EditorGetText( oED )
EditorKill( oED )
ELSE
? "Editor not created"
ENDIF
RETURN( cText )
RETURN cText

View File

@@ -308,7 +308,7 @@ void hb_compOutErr( HB_COMP_DECL, const char * szMessage )
HB_COMP_PARAM->outErrFunc( HB_COMP_PARAM->cargo, szMessage );
else
{
#if defined( HOST_OS_UNIX_COMPATIBLE )
#if defined( OS_UNIX_COMPATIBLE )
fprintf( stderr, "%s", szMessage ); fflush( stderr );
#else
fprintf( stdout, "%s", szMessage ); fflush( stdout );

View File

@@ -26,6 +26,6 @@ ifneq ($(HB_PP_RULES),)
pptable.c : $(HB_PP_RULES)
$(CP) $(subst /,$(DIRSEP),$<) $@
else
pptable.c : ppgen$(EXE_EXT)
$(HB_PPGEN_PATH)/ppgen$(EXE_EXT) $(TOP)$(ROOT)include/hbstdgen.ch -opptable.c -q
pptable.c : hbppgen$(EXE_EXT)
$(HB_PPGEN_PATH)/hbppgen$(EXE_EXT) $(TOP)$(ROOT)include/hbstdgen.ch -opptable.c -q
endif

View File

@@ -319,7 +319,7 @@ int WINAPI WinMain( HINSTANCE hInstance, /* handle to current instance */
int iResult, i;
/* hack - we do not want to create real binaries */
int argc = 1;
char * argv[] = { "ppgen" };
char * argv[] = { "hbppgen" };
HB_SYMBOL_UNUSED( hInstance );
HB_SYMBOL_UNUSED( hPrevInstance );