From 4f0a3898f4fa26a537f25df265090641b7d10cb6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 5 Aug 2008 06:51:07 +0000 Subject: [PATCH] 2008-08-05 08:50 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * harbour-ce-spec * harbour-w32-spec * harbour.spec * common.mak * make_b32.mak * make_gcc.mak * make_vc.mak * make_vcce.mak * make_tgz.sh * debian/rules - doc/man/hbdot.1 * doc/man/hbrun.1 - utils/hbdot * utils/hbrun/Makefile * utils/hbrun/hbrun.prg - utils/hbrun/external.prg * Replaced hbrun functionality with hbdot's. - Removed separate hbdot tool. * contrib/hbsqlit3/sqlite3/sqlite3.c * contrib/hbsqlit3/make_vc.bat ! Fixed bug in foreign code (sqlite3.c) to compile in MSVC C++ mode. (HANDLE -> HMODULE) * C++ mode is no longer forced in non-GNU MSVC builds, this way also avoiding a screen warning. * contrib/examples/dbu/bld_b32.bat * contrib/examples/dbu/bld_vc.bat ! Fixed to call 'patch' with '-N' so that it doesn't ask to reverse patches when run multiple times. + utils/hbdoc/bld_b32.bat + utils/hbdoc/bld_vc.bat + Added non-GNU make batch files to build hbmake. ; This is a step towards detaching hbdoc from core. * utils/hbdoc/hbdocdef.ch ! Fixed equality operators to be SET EXACT independent. ; Minor formatting. --- harbour/ChangeLog | 41 +++ harbour/common.mak | 10 - harbour/contrib/examples/dbu/bld_b32.bat | 2 +- harbour/contrib/examples/dbu/bld_vc.bat | 2 +- harbour/contrib/hbsqlit3/make_vc.bat | 3 - harbour/contrib/hbsqlit3/sqlite3/sqlite3.c | 7 +- harbour/debian/rules | 2 +- harbour/doc/man/hbdot.1 | 34 --- harbour/doc/man/hbrun.1 | 28 +- harbour/harbour-ce-spec | 2 +- harbour/harbour-w32-spec | 2 +- harbour/harbour.spec | 7 +- harbour/make_b32.mak | 13 - harbour/make_gcc.mak | 4 - harbour/make_tgz.sh | 2 +- harbour/make_vc.mak | 27 -- harbour/make_vcce.mak | 27 -- harbour/utils/hbdoc/bld_b32.bat | 65 +++++ harbour/utils/hbdoc/bld_vc.bat | 26 ++ harbour/utils/hbdoc/hbdocdef.ch | 12 +- harbour/utils/hbdot/Makefile | 40 --- harbour/utils/hbdot/hbdot.prg | 306 --------------------- harbour/utils/hbrun/Makefile | 1 - harbour/utils/hbrun/external.prg | 54 ---- harbour/utils/hbrun/hbrun.prg | 297 ++++++++++++++++---- 25 files changed, 415 insertions(+), 599 deletions(-) delete mode 100644 harbour/doc/man/hbdot.1 create mode 100644 harbour/utils/hbdoc/bld_b32.bat create mode 100644 harbour/utils/hbdoc/bld_vc.bat delete mode 100644 harbour/utils/hbdot/Makefile delete mode 100644 harbour/utils/hbdot/hbdot.prg delete mode 100644 harbour/utils/hbrun/external.prg diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 974b411a05..fac3156dd5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,47 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-08-05 08:50 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * harbour-ce-spec + * harbour-w32-spec + * harbour.spec + * common.mak + * make_b32.mak + * make_gcc.mak + * make_vc.mak + * make_vcce.mak + * make_tgz.sh + * debian/rules + - doc/man/hbdot.1 + * doc/man/hbrun.1 + - utils/hbdot + * utils/hbrun/Makefile + * utils/hbrun/hbrun.prg + - utils/hbrun/external.prg + * Replaced hbrun functionality with hbdot's. + - Removed separate hbdot tool. + + * contrib/hbsqlit3/sqlite3/sqlite3.c + * contrib/hbsqlit3/make_vc.bat + ! Fixed bug in foreign code (sqlite3.c) to compile in + MSVC C++ mode. (HANDLE -> HMODULE) + * C++ mode is no longer forced in non-GNU MSVC builds, + this way also avoiding a screen warning. + + * contrib/examples/dbu/bld_b32.bat + * contrib/examples/dbu/bld_vc.bat + ! Fixed to call 'patch' with '-N' so that it doesn't + ask to reverse patches when run multiple times. + + + utils/hbdoc/bld_b32.bat + + utils/hbdoc/bld_vc.bat + + Added non-GNU make batch files to build hbmake. + ; This is a step towards detaching hbdoc from core. + + * utils/hbdoc/hbdocdef.ch + ! Fixed equality operators to be SET EXACT independent. + ; Minor formatting. + 2008-08-05 02:43 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/utils/hbdot/hbdot.prg * removed holder class for HRB modules - it's not longer necessary diff --git a/harbour/common.mak b/harbour/common.mak index c6cfb094d1..b3e3abf87d 100644 --- a/harbour/common.mak +++ b/harbour/common.mak @@ -141,7 +141,6 @@ GTSLN_DIR = source\rtl\gtsln GTXWC_DIR = source\rtl\gtxwc HBRUN_DIR = utils\hbrun -HBDOT_DIR = utils\hbdot HBTEST_DIR = utils\hbtest HBDOC_DIR = utils\hbdoc HBMAKE_DIR = utils\hbmake @@ -186,7 +185,6 @@ $(GTXWC_DIR)\ ALL_EXE_SRC_DIRS_TMP=\ $(HBRUN_DIR);\ -$(HBDOT_DIR);\ $(HBTEST_DIR);\ $(HBDOC_DIR);\ $(HBMAKE_DIR)\ @@ -246,7 +244,6 @@ HARBOUR_EXE = $(BIN_DIR)\harbour$(EXEEXT) # to generate pptable.c HBPP_EXE = $(BIN_DIR)\hbpp$(EXEEXT) HBRUN_EXE = $(BIN_DIR)\hbrun$(EXEEXT) -HBDOT_EXE = $(BIN_DIR)\hbdot$(EXEEXT) HBTEST_EXE = $(BIN_DIR)\hbtest$(EXEEXT) HBDOC_EXE = $(BIN_DIR)\hbdoc$(EXEEXT) HBMAKE_EXE = $(BIN_DIR)\hbmake$(EXEEXT) @@ -1036,12 +1033,6 @@ HBPP_EXE_OBJS = \ HBRUN_EXE_OBJS = \ $(OBJ_DIR)\hbrun$(OBJEXT) \ - $(OBJ_DIR)\external$(OBJEXT) \ - -#********************************************************** - -HBDOT_EXE_OBJS = \ - $(OBJ_DIR)\hbdot$(OBJEXT) \ #********************************************************** @@ -1190,7 +1181,6 @@ HB_BUILD_TARGETS = \ $(HB_GT_LIBS) \ \ $(HBRUN_EXE) \ - $(HBDOT_EXE) \ $(HBTEST_EXE) \ $(HBDOC_EXE) \ $(HBMAKE_EXE) \ diff --git a/harbour/contrib/examples/dbu/bld_b32.bat b/harbour/contrib/examples/dbu/bld_b32.bat index 4840457a6a..77eba16b84 100644 --- a/harbour/contrib/examples/dbu/bld_b32.bat +++ b/harbour/contrib/examples/dbu/bld_b32.bat @@ -19,7 +19,7 @@ goto EXIT :DIR_OK_LOCAL -if exist hb_dbu.dif patch -i hb_dbu.dif +if exist hb_dbu.dif patch -N -i hb_dbu.dif :DIR_OK diff --git a/harbour/contrib/examples/dbu/bld_vc.bat b/harbour/contrib/examples/dbu/bld_vc.bat index a01c79582b..4233049919 100644 --- a/harbour/contrib/examples/dbu/bld_vc.bat +++ b/harbour/contrib/examples/dbu/bld_vc.bat @@ -19,7 +19,7 @@ goto EXIT :DIR_OK_LOCAL -if exist hb_dbu.dif patch -i hb_dbu.dif +if exist hb_dbu.dif patch -N -i hb_dbu.dif :DIR_OK diff --git a/harbour/contrib/hbsqlit3/make_vc.bat b/harbour/contrib/hbsqlit3/make_vc.bat index ba231dbc05..4ceb9b9261 100644 --- a/harbour/contrib/hbsqlit3/make_vc.bat +++ b/harbour/contrib/hbsqlit3/make_vc.bat @@ -3,7 +3,4 @@ rem rem $Id$ rem -rem ; sqlite won't compile in C++ mode. -set CFLAGS=-TC - call ..\mtpl_vc.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/harbour/contrib/hbsqlit3/sqlite3/sqlite3.c b/harbour/contrib/hbsqlit3/sqlite3/sqlite3.c index bf0307c907..03bd6e2ab4 100644 --- a/harbour/contrib/hbsqlit3/sqlite3/sqlite3.c +++ b/harbour/contrib/hbsqlit3/sqlite3/sqlite3.c @@ -23308,16 +23308,16 @@ void *winDlSym(sqlite3_vfs *pVfs, void *pHandle, const char *zSymbol){ (void) pVfs; #if OS_WINCE /* The GetProcAddressA() routine is only available on wince. */ - return GetProcAddressA((HANDLE)pHandle, zSymbol); + return GetProcAddressA((HMODULE)pHandle, zSymbol); #else /* All other windows platforms expect GetProcAddress() to take ** an Ansi string regardless of the _UNICODE setting */ - return GetProcAddress((HANDLE)pHandle, zSymbol); + return GetProcAddress((HMODULE)pHandle, zSymbol); #endif } void winDlClose(sqlite3_vfs *pVfs, void *pHandle){ (void) pVfs; - FreeLibrary((HANDLE)pHandle); + FreeLibrary((HMODULE)pHandle); } #else /* if SQLITE_OMIT_LOAD_EXTENSION is defined: */ #define winDlOpen 0 @@ -87153,3 +87153,4 @@ SQLITE_PRIVATE void sqlite3Fts3SimpleTokenizerModule( #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ /************** End of fts3_tokenizer1.c *************************************/ + diff --git a/harbour/debian/rules b/harbour/debian/rules index 14915fe14b..da23d0aa44 100755 --- a/harbour/debian/rules +++ b/harbour/debian/rules @@ -72,7 +72,7 @@ binary-arch: build install dh_installdocs dh_installexamples # dh_install - dh_installman doc/man/harbour.1 doc/man/hbdoc.1 doc/man/hbmake.1 doc/man/hbpp.1 doc/man/hbrun.1 doc/man/hbdot.1 doc/man/hbtest.1 + dh_installman doc/man/harbour.1 doc/man/hbdoc.1 doc/man/hbmake.1 doc/man/hbpp.1 doc/man/hbrun.1 doc/man/hbtest.1 dh_link dh_strip dh_compress diff --git a/harbour/doc/man/hbdot.1 b/harbour/doc/man/hbdot.1 deleted file mode 100644 index 4da8ea52c5..0000000000 --- a/harbour/doc/man/hbdot.1 +++ /dev/null @@ -1,34 +0,0 @@ -.TH HBDOT 1 - -.SH NAME -hbdot \- "DOt Prompt" Console for the Harbour Language - -.SH SYNOPSIS -\fBhbdot\fP \fB[\fP \fB[]]\fP - -.SH DESCRIPTION -\fBhbdot\fP is "DOt Prompt" console for the Harbour Language. -It can work as interpreter when run without parameters -or can execute xBase/Clipper source code in .prg file or compiled -Harbour Portable Objects (.hrb) given as first parameter. -Type of file is recognized by extension used with \fB\fP -parameter. If not given then .hrb is used. - -.PP -\fBhbdot\fP can be also used to execute .prg files as scripts -It's enough to add in the first line of .prg file: -.PP -\fB#!/usr/bin/hbdot\fP -.PP -and set executable attribute. - -.SH OPTIONS -.IP "\fB-h, -?, --help\fP" 10 -When given as first parameter display help -.PP -This program has no other options. \fB\fP are passed to -startup function in executed code coming from \fB\fP. - -.SH AUTHOR - -Przemyslaw Czerpak, The Harbour Project (http://www.harbour-project.org) diff --git a/harbour/doc/man/hbrun.1 b/harbour/doc/man/hbrun.1 index 44ca6b6903..8c11bfc5d9 100644 --- a/harbour/doc/man/hbrun.1 +++ b/harbour/doc/man/hbrun.1 @@ -1,17 +1,19 @@ .TH HBRUN 1 .SH NAME -hbrun \- Harbour Project Runner +hbrun \- "DOt Prompt" Console / runner for the Harbour Language .SH SYNOPSIS -\fBhbrun\fP \fB\fP \fB[]\fP +\fBhbrun\fP \fB[\fP \fB[]]\fP .SH DESCRIPTION -\fBhbrun\fP is the Harbour Project runner which can execute -xBase/Clipper source code in .prg files or compiled Harbour -Portable Objects - .hrb files. Type of file is recognized by -extension used with \fB\fP parameter. If not given -then .hrb is used. +\fBhbrun\fP is "DOt Prompt" console for the Harbour Language. +It can work as interpreter when run without parameters +or can execute xBase/Clipper source code in .prg file or compiled +Harbour Portable Objects (.hrb) given as first parameter. +Type of file is recognized by extension used with \fB\fP +parameter. If not given then .hrb is used. + .PP \fBhbrun\fP can be also used to execute .prg files as scripts It's enough to add in the first line of .prg file: @@ -21,12 +23,12 @@ It's enough to add in the first line of .prg file: and set executable attribute. .SH OPTIONS -This program has no options. \fB\fP are passed to -startup function in executed code. +.IP "\fB-h, -?, --help\fP" 10 +When given as first parameter display help +.PP +This program has no other options. \fB\fP are passed to +startup function in executed code coming from \fB\fP. .SH AUTHOR -Author of hbrun: The Harbour Project (http://www.harbour-project.org) - -This manual page was written by Luis Mayoral , -for the Debian GNU/Linux system (but may be used by others). +Przemyslaw Czerpak, The Harbour Project (http://www.harbour-project.org) diff --git a/harbour/harbour-ce-spec b/harbour/harbour-ce-spec index 9fa7ee09cf..0be72f4b64 100644 --- a/harbour/harbour-ce-spec +++ b/harbour/harbour-ce-spec @@ -173,7 +173,7 @@ make -r -i install ${CCPREFIX}strip --strip-debug $HB_LIB_INSTALL/* # remove unused files -rm -fR ${HB_BIN_INSTALL}/{harbour,hbpp,hbdoc,hbdot,hbmake,hbrun,hbtest}.exe +rm -fR ${HB_BIN_INSTALL}/{harbour,hbpp,hbdoc,hbmake,hbrun,hbtest}.exe # Create a README file for people using this RPM. cat > doc/%{readme} < doc/%{readme} < + added hbdot - removed PP package diff --git a/harbour/make_b32.mak b/harbour/make_b32.mak index f90d8aa7b6..d916780d59 100644 --- a/harbour/make_b32.mak +++ b/harbour/make_b32.mak @@ -481,19 +481,6 @@ $(**: = ^ $(STANDARD_STATIC_HBLIBS) ! #********************************************************** -# HBDOT build rule -#********************************************************** -$(HBDOT_EXE) :: BasicLibs BasicExes StdLibs -$(HBDOT_EXE) :: $(HBDOT_EXE_OBJS) - IF EXIST "$(HBDOT_EXE)" $(DEL) "$(HBDOT_EXE)" > NUL - $(CC) @&&! -$(CFLAGS) --e$(HBDOT_EXE) -$(**: = ^ -) -$(STANDARD_STATIC_HBLIBS) -! -#********************************************************** # HBTEST build rule #********************************************************** $(HBTEST_EXE) :: BasicLibs BasicExes StdLibs diff --git a/harbour/make_gcc.mak b/harbour/make_gcc.mak index 68980548d3..d5d53670ce 100644 --- a/harbour/make_gcc.mak +++ b/harbour/make_gcc.mak @@ -417,10 +417,6 @@ $(HBRUN_EXE) :: $(StdLibs) $(HBRUN_EXE) :: $(HBRUN_EXE_OBJS) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) #********************************************************** -$(HBDOT_EXE) :: $(StdLibs) -$(HBDOT_EXE) :: $(HBDOT_EXE_OBJS) - $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -#********************************************************** $(HBTEST_EXE) :: $(StdLibs) $(HBTEST_EXE) :: $(HBTEST_EXE_OBJS) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) diff --git a/harbour/make_tgz.sh b/harbour/make_tgz.sh index dadadfb453..abbd0be22b 100755 --- a/harbour/make_tgz.sh +++ b/harbour/make_tgz.sh @@ -276,7 +276,7 @@ then export L_USR="-L${HB_LIB_INSTALL} -l${name} ${ADD_LIBS} ${L_USR}" export PRG_USR="\"-D_DEFAULT_INC_DIR='${_DEFAULT_INC_DIR}'\" ${PRG_USR}" - for utl in hbmake hbrun hbdot hbdoc hbtest + for utl in hbmake hbrun hbdoc hbtest do (cd "utils/${utl}" rm -fR "./${HB_ARCHITECTURE}/${HB_COMPILER}" diff --git a/harbour/make_vc.mak b/harbour/make_vc.mak index 6ab2cb2678..b7c54789b8 100644 --- a/harbour/make_vc.mak +++ b/harbour/make_vc.mak @@ -263,9 +263,6 @@ LDFLAGSDLL = /DEBUG $(LDFLAGSDLL) {$(HBRUN_DIR)}.c{$(OBJ_DIR)}$(OBJEXT):: $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $< #******************************************************* -{$(HBDOT_DIR)}.c{$(OBJ_DIR)}$(OBJEXT):: - $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $< -#******************************************************* {$(HBTEST_DIR)}.c{$(OBJ_DIR)}$(OBJEXT):: $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $< #******************************************************* @@ -387,10 +384,6 @@ LDFLAGSDLL = /DEBUG $(LDFLAGSDLL) $(HB) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $< $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $(OBJ_DIR)\$(*B).c #******************************************************* -{$(HBDOT_DIR)}.prg{$(OBJ_DIR)}$(OBJEXT): - $(HB) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $< - $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $(OBJ_DIR)\$(*B).c -#******************************************************* {$(HBTEST_DIR)}.prg{$(OBJ_DIR)}$(OBJEXT): $(HB) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $< $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $(OBJ_DIR)\$(*B).c @@ -499,9 +492,6 @@ LDFLAGSDLL = /DEBUG $(LDFLAGSDLL) {$(HBRUN_DIR)}.c{$(DLL_OBJ_DIR)}$(OBJEXT):: $(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $< #******************************************************* -{$(HBDOT_DIR)}.c{$(DLL_OBJ_DIR)}$(OBJEXT):: - $(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $< -#******************************************************* {$(HBTEST_DIR)}.c{$(DLL_OBJ_DIR)}$(OBJEXT):: $(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $< #******************************************************* @@ -628,10 +618,6 @@ LDFLAGSDLL = /DEBUG $(LDFLAGSDLL) $(HB) $(HARBOURFLAGS) -o$(DLL_OBJ_DIR)\ $< $(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $(DLL_OBJ_DIR)\$(*B).c #******************************************************* -{$(HBDOT_DIR)}.prg{$(DLL_OBJ_DIR)}$(OBJEXT): - $(HB) $(HARBOURFLAGS) -o$(DLL_OBJ_DIR)\ $< - $(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $(DLL_OBJ_DIR)\$(*B).c -#******************************************************* {$(HBTEST_DIR)}.prg{$(DLL_OBJ_DIR)}$(OBJEXT): $(HB) $(HARBOURFLAGS) -o$(DLL_OBJ_DIR)\ $< $(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $(DLL_OBJ_DIR)\$(*B).c @@ -790,19 +776,6 @@ $(STANDARD_STATIC_HBLIBS) user32.lib winspool.lib wsock32.lib advapi32.lib <<$(HB_KEEPSTATE) #********************************************************** -# HBDOT build rule -#********************************************************** -$(HBDOT_EXE) : $(HBDOT_EXE_OBJS) - IF EXIST "$(HBDOT_EXE)" $(DEL) "$(HBDOT_EXE)" > nul - $(LINKER) @<< -$(LDFLAGS) -/OUT:$(HBDOT_EXE) -$(**: = ^ -) -$(STANDARD_STATIC_HBLIBS) -user32.lib winspool.lib wsock32.lib advapi32.lib -<<$(HB_KEEPSTATE) -#********************************************************** # HBTEST build rule #********************************************************** $(HBTEST_EXE) : $(HBTEST_EXE_OBJS) diff --git a/harbour/make_vcce.mak b/harbour/make_vcce.mak index e02e3be1ab..a82d674d3b 100644 --- a/harbour/make_vcce.mak +++ b/harbour/make_vcce.mak @@ -289,9 +289,6 @@ LDFLAGSDLL = /DEBUG $(LDFLAGSDLL) {$(HBRUN_DIR)}.c{$(OBJ_DIR)}$(OBJEXT):: $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $< #******************************************************* -{$(HBDOT_DIR)}.c{$(OBJ_DIR)}$(OBJEXT):: - $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $< -#******************************************************* {$(HBTEST_DIR)}.c{$(OBJ_DIR)}$(OBJEXT):: $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $< #******************************************************* @@ -413,10 +410,6 @@ LDFLAGSDLL = /DEBUG $(LDFLAGSDLL) $(HB) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $< $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $(OBJ_DIR)\$(*B).c #******************************************************* -{$(HBDOT_DIR)}.prg{$(OBJ_DIR)}$(OBJEXT): - $(HB) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $< - $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $(OBJ_DIR)\$(*B).c -#******************************************************* {$(HBTEST_DIR)}.prg{$(OBJ_DIR)}$(OBJEXT): $(HB) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $< $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $(OBJ_DIR)\$(*B).c @@ -525,9 +518,6 @@ LDFLAGSDLL = /DEBUG $(LDFLAGSDLL) {$(HBRUN_DIR)}.c{$(DLL_OBJ_DIR)}$(OBJEXT):: $(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $< #******************************************************* -{$(HBDOT_DIR)}.c{$(DLL_OBJ_DIR)}$(OBJEXT):: - $(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $< -#******************************************************* {$(HBTEST_DIR)}.c{$(DLL_OBJ_DIR)}$(OBJEXT):: $(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $< #******************************************************* @@ -654,10 +644,6 @@ LDFLAGSDLL = /DEBUG $(LDFLAGSDLL) $(HB) $(HARBOURFLAGS) -o$(DLL_OBJ_DIR)\ $< $(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $(DLL_OBJ_DIR)\$(*B).c #******************************************************* -{$(HBDOT_DIR)}.prg{$(DLL_OBJ_DIR)}$(OBJEXT): - $(HB) $(HARBOURFLAGS) -o$(DLL_OBJ_DIR)\ $< - $(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $(DLL_OBJ_DIR)\$(*B).c -#******************************************************* {$(HBTEST_DIR)}.prg{$(DLL_OBJ_DIR)}$(OBJEXT): $(HB) $(HARBOURFLAGS) -o$(DLL_OBJ_DIR)\ $< $(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $(DLL_OBJ_DIR)\$(*B).c @@ -818,19 +804,6 @@ $(STANDARD_STATIC_HBLIBS) coredll.lib corelibc.lib winsock.lib ws2.lib <<$(HB_KEEPSTATE) #********************************************************** -# HBDOT build rule -#********************************************************** -$(HBDOT_EXE) : $(HBDOT_EXE_OBJS) - IF EXIST "$(HBDOT_EXE)" $(DEL) "$(HBDOT_EXE)" > nul - $(LINKER) @<< -$(LDFLAGS) -/OUT:$(HBDOT_EXE) -$(**: = ^ -) -$(STANDARD_STATIC_HBLIBS) -coredll.lib corelibc.lib winsock.lib ws2.lib -<<$(HB_KEEPSTATE) -#********************************************************** # HBTEST build rule #********************************************************** $(HBTEST_EXE) : $(HBTEST_EXE_OBJS) diff --git a/harbour/utils/hbdoc/bld_b32.bat b/harbour/utils/hbdoc/bld_b32.bat new file mode 100644 index 0000000000..3bc34d484b --- /dev/null +++ b/harbour/utils/hbdoc/bld_b32.bat @@ -0,0 +1,65 @@ +@echo off +rem +rem $Id$ +rem + +..\..\bin\harbour /n hbdoc /i..\..\include +..\..\bin\harbour /n fclass1 /i..\..\include +..\..\bin\harbour /n ffile1 /i..\..\include +..\..\bin\harbour /n ft_funcs /i..\..\include +..\..\bin\harbour /n genasc /i..\..\include +..\..\bin\harbour /n genchm /i..\..\include +..\..\bin\harbour /n genhpc /i..\..\include +..\..\bin\harbour /n genhtm /i..\..\include +..\..\bin\harbour /n genng /i..\..\include +..\..\bin\harbour /n genos2 /i..\..\include +..\..\bin\harbour /n genpdf1 /i..\..\include +..\..\bin\harbour /n genrtf /i..\..\include +..\..\bin\harbour /n gentrf /i..\..\include +..\..\bin\harbour /n html /i..\..\include +..\..\bin\harbour /n ng /i..\..\include +..\..\bin\harbour /n os2 /i..\..\include +..\..\bin\harbour /n rtf /i..\..\include +..\..\bin\harbour /n teeasc /i..\..\include +..\..\bin\harbour /n troff /i..\..\include + +echo -O2 -I..\..\include -L..\..\lib > build.tmp + +echo -ehbdoc.exe >> build.tmp + +echo hbdoc.c >> build.tmp +echo fclass1.c >> build.tmp +echo ffile1.c >> build.tmp +echo ft_funcs.c >> build.tmp +echo genasc.c >> build.tmp +echo genchm.c >> build.tmp +echo genhpc.c >> build.tmp +echo genhtm.c >> build.tmp +echo genng.c >> build.tmp +echo genos2.c >> build.tmp +echo genpdf1.c >> build.tmp +echo genrtf.c >> build.tmp +echo gentrf.c >> build.tmp +echo html.c >> build.tmp +echo ng.c >> build.tmp +echo os2.c >> build.tmp +echo rtf.c >> build.tmp +echo teeasc.c >> build.tmp +echo troff.c >> build.tmp + +echo hbdebug.lib >> build.tmp +echo hbvm.lib >> build.tmp +echo hbrtl.lib >> build.tmp +echo gtwin.lib >> build.tmp +echo hblang.lib >> build.tmp +echo hbrdd.lib >> build.tmp +echo hbmacro.lib >> build.tmp +echo hbpp.lib >> build.tmp +echo rddntx.lib >> build.tmp +echo rddcdx.lib >> build.tmp +echo rddfpt.lib >> build.tmp +echo hbsix.lib >> build.tmp +echo hbcommon.lib >> build.tmp + +bcc32 @build.tmp +del build.tmp diff --git a/harbour/utils/hbdoc/bld_vc.bat b/harbour/utils/hbdoc/bld_vc.bat new file mode 100644 index 0000000000..510c7d1ab6 --- /dev/null +++ b/harbour/utils/hbdoc/bld_vc.bat @@ -0,0 +1,26 @@ +@echo off +rem +rem $Id$ +rem + +..\..\bin\harbour /n hbdoc /i..\..\include +..\..\bin\harbour /n fclass1 /i..\..\include +..\..\bin\harbour /n ffile1 /i..\..\include +..\..\bin\harbour /n ft_funcs /i..\..\include +..\..\bin\harbour /n genasc /i..\..\include +..\..\bin\harbour /n genchm /i..\..\include +..\..\bin\harbour /n genhpc /i..\..\include +..\..\bin\harbour /n genhtm /i..\..\include +..\..\bin\harbour /n genng /i..\..\include +..\..\bin\harbour /n genos2 /i..\..\include +..\..\bin\harbour /n genpdf1 /i..\..\include +..\..\bin\harbour /n genrtf /i..\..\include +..\..\bin\harbour /n gentrf /i..\..\include +..\..\bin\harbour /n html /i..\..\include +..\..\bin\harbour /n ng /i..\..\include +..\..\bin\harbour /n os2 /i..\..\include +..\..\bin\harbour /n rtf /i..\..\include +..\..\bin\harbour /n teeasc /i..\..\include +..\..\bin\harbour /n troff /i..\..\include + +cl -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -TP -W3 -I..\..\include hbdoc.c fclass1.c ffile1.c ft_funcs.c genasc.c genchm.c genhpc.c genhtm.c genng.c genos2.c genpdf1.c genrtf.c gentrf.c html.c ng.c os2.c rtf.c teeasc.c troff.c /link /subsystem:CONSOLE /LIBPATH:..\..\lib hbcpage.lib hbdebug.lib hbvm.lib hbrtl.lib gtwin.lib hblang.lib hbrdd.lib hbmacro.lib hbpp.lib rddntx.lib rddcdx.lib rddfpt.lib hbsix.lib hbcommon.lib hbpcre.lib hbzlib.lib user32.lib winspool.lib diff --git a/harbour/utils/hbdoc/hbdocdef.ch b/harbour/utils/hbdoc/hbdocdef.ch index bfc7a2e466..e08f469534 100644 --- a/harbour/utils/hbdoc/hbdocdef.ch +++ b/harbour/utils/hbdoc/hbdocdef.ch @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * Header file common definition of HBDOc + * Header file common definition of hbdoc * * Copyright 2000 Luiz Rafael Culik * www - http://www.harbour-project.org @@ -49,6 +49,7 @@ * If you do not wish that, delete this exception notice. * */ + #ifndef _HBDOCDEF_CH_ #define _HBDOCDEF_CH_ @@ -90,10 +91,13 @@ #xcommand IF IS => if valtype() = -#xcommand IF IS NOT => if valtype() != +#xcommand IF IS NOT => if !( valtype() == ) #xcommand IF IS IN => if !(len( ) \< ) #xcommand IF IS NOT IN => if len( ) \< -#xtranslate ( IS ) => ( valtype() = ) -#xtranslate ( IS NOT ) => ( valtype() != ) + +#xtranslate ( IS ) => ( valtype() == ) +#xtranslate ( IS NOT ) => ( !( valtype() == ) ) + #define pBUFFER_LENGTH 4096 + #endif diff --git a/harbour/utils/hbdot/Makefile b/harbour/utils/hbdot/Makefile deleted file mode 100644 index dd1866398e..0000000000 --- a/harbour/utils/hbdot/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -# -# $Id$ -# - -ifeq ($(HB_MAIN),) -HB_MAIN = std -endif - -ROOT = ../../ - -PRG_SOURCES=\ - hbdot.prg \ - -PRG_MAIN=hbdot.prg - -LIBS=\ - hbdebug \ - hbvm \ - hbrtl \ - hblang \ - hbcpage \ - hbrdd \ - hbrtl \ - hbvm \ - hbmacro \ - hbpp \ - hbcplr \ - hbcommon \ - -ifeq ($(findstring -DHB_PCRE_REGEX, $(C_USR)),) -ifeq ($(findstring -DHB_POSIX_REGEX, $(C_USR)),) -LIBS += hbpcre -endif -endif - -ifeq ($(findstring -DHB_EXT_ZLIB, $(C_USR)),) -LIBS += hbzlib -endif - -include $(TOP)$(ROOT)config/bin.cf diff --git a/harbour/utils/hbdot/hbdot.prg b/harbour/utils/hbdot/hbdot.prg deleted file mode 100644 index f7cefc7734..0000000000 --- a/harbour/utils/hbdot/hbdot.prg +++ /dev/null @@ -1,306 +0,0 @@ -/* - * $Id$ - */ - -/* - * Harbour Project source code: - * "DOt Prompt" Console for the Harbour Language - * - * Copyright 2007 Przemyslaw Czerpak - * www - http://www.harbour-project.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). - * - * As a special exception, the Harbour Project gives permission for - * additional uses of the text contained in its release of Harbour. - * - * The exception is that, if you link the Harbour libraries with other - * files to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the Harbour library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the Harbour - * Project under the name Harbour. If you copy code from other - * Harbour Project or Free Software Foundation releases into a copy of - * Harbour, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for Harbour, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - * - */ - -#include "inkey.ch" -#include "setcurs.ch" -#include "hbextern.ch" - -#define HB_HISTORY_LEN 32 -#define HB_LINE_LEN 256 -#define HB_PROMPT "." - -STATIC s_nRow := 2, s_nCol := 0 -STATIC s_aIncDir := {} - -/* ********************************************************************** */ - -PROCEDURE _APPMAIN( cFile, ... ) - LOCAL GetList - LOCAL cLine, cCommand, cPath, cExt - LOCAL nMaxRow, nMaxCol - LOCAL aHistory, nHistIndex - LOCAL bKeyUP, bKeyDown, bKeyIns - -#ifdef _DEFAULT_INC_DIR - AADD( s_aIncDir, "-I" + _DEFAULT_INC_DIR ) -#endif - cPath := getenv( "HB_INC_INSTALL" ) - IF !EMPTY( cPath ) - AADD( s_aIncDir, "-I" + cPath ) - ENDIF -#ifdef __PLATFORM__UNIX - AADD( s_aIncDir, "-I/usr/include/harbour" ) - AADD( s_aIncDir, "-I/usr/local/include/harbour" ) -#endif - - IF PCount() > 0 - SWITCH lower( cFile ) - CASE "-?" - CASE "-h" - CASE "--help" - CASE "/?" - CASE "/h" - HB_DotUsage() - EXIT - OTHERWISE - hb_FNameSplit( cFile, NIL, NIL, @cExt ) - IF Lower( cExt ) == ".prg" - cFile := HB_COMPILEBUF( HB_ARGV( 0 ), "-n", "-w", "-es2", "-q0", ; - s_aIncDir, cFile ) - IF cFile == NIL - ERRORLEVEL( 1 ) - ELSE - __hrbRun( cFile, ... ) - ENDIF - ELSE - __hrbRun( cFile, ... ) - ENDIF - ENDSWITCH - ELSE - - CLEAR SCREEN - SET SCOREBOARD OFF - GetList := {} - cCommand := "" - aHistory := { padr( "quit", HB_LINE_LEN ) } - nHistIndex := 2 - - DO WHILE .T. - - IF cLine == NIL - cLine := Space( HB_LINE_LEN ) - ENDIF - - HB_DotInfo( cCommand ) - - nMaxRow := MaxRow() - nMaxCol := MaxCol() - @ nMaxRow, 0 SAY HB_PROMPT - @ nMaxRow, Col() GET cLine ; - PICTURE "@KS" + LTrim( Str( nMaxCol - Col() + 1 ) ) - - SetCursor( IIF( ReadInsert(), SC_INSERT, SC_NORMAL ) ) - - bKeyIns := SetKey( K_INS, ; - {|| SetCursor( IIF( ReadInsert( !ReadInsert() ), ; - SC_NORMAL, SC_INSERT ) ) } ) - bKeyUp := SetKey( K_UP, ; - {|| IIF( nHistIndex > 1, ; - cLine := aHistory[ --nHistIndex ], ) } ) - bKeyDown := SetKey( K_DOWN, ; - {|| cLine := IIF( nHistIndex < LEN( aHistory ), ; - aHistory[ ++nHistIndex ], ; - ( nHistIndex := LEN( aHistory ) + 1, Space( HB_LINE_LEN ) ) ) } ) - - READ - - SetKey( K_DOWN, bKeyDown ) - SetKey( K_UP, bKeyUp ) - SetKey( K_INS, bKeyIns ) - - IF LastKey() == K_ESC .OR. EMPTY( cLine ) - cLine := NIL - IF nMaxRow != MaxRow() .OR. nMaxCol != MaxCol() - @ nMaxRow, 0 CLEAR - ENDIF - LOOP - ENDIF - - IF EMPTY( aHistory ) .OR. ! ATAIL( aHistory ) == cLine - IF LEN( aHistory ) < HB_HISTORY_LEN - AADD( aHistory, cLine ) - ELSE - ADEL( aHistory, 1 ) - aHistory[ LEN( aHistory ) ] := cLine - ENDIF - ENDIF - nHistIndex := LEN( aHistory ) + 1 - - cCommand := AllTrim( cLine, " " ) - cLine := NIL - @ nMaxRow, 0 CLEAR - HB_DotInfo( cCommand ) - - HB_DotExec( cCommand ) - - IF s_nRow >= MaxRow() - Scroll( 2, 0, MaxRow(), MaxCol(), 1 ) - s_nRow := MaxRow() - 1 - ENDIF - - ENDDO - ENDIF - -RETURN - -/* ********************************************************************** */ - -STATIC PROCEDURE HB_DotUsage() - - OutStd( 'Harbour "DOt Prompt" Console' + HB_OSNewLine() +; - 'Copyright 1999-2008, Przemyslaw Czerpak' + HB_OSNewLine() + ; - 'http://www.harbour-project.org' + HB_OSNewLine() +; - HB_OSNewLine() +; - 'Syntax: hbdot [ []]' + HB_OSNewLine() + ; - HB_OSNewLine() +; - "Note: Linked with " + Version() + HB_OSNewLine() ) - -RETURN - -/* ********************************************************************** */ - -STATIC PROCEDURE HB_DotInfo( cCommand ) - - LOCAL r := Row(), c := Col() - - IF cCommand != NIL - DispOutAt( 0, 0, "PP: " ) - DispOutAt( 0, 4, PadR( cCommand, MaxCol() - 3 ), "N/R" ) - ENDIF - IF Used() - DispOutAt( 1, 0, ; - PadR( "RDD: " + PadR( RddName(), 6 ) + ; - " | Area:" + Str( Select(), 3 ) + ; - " | Dbf: " + PadR( Alias(), 10 ) + ; - " | Index: " + PadR( OrdName( IndexOrd() ), 8 ) + ; - " | # " + Str( RecNo(), 7 ) + "/" + Str( RecCount(), 7 ), ; - MaxCol() + 1 ), "N/BG" ) - ELSE - DispOutAt( 1, 0, ; - PadR( "RDD: " + Space( 6 ) + ; - " | Area:" + Space( 3 ) + ; - " | Dbf: " + Space( 10 ) + ; - " | Index: " + Space( 8 ) + ; - " | # " + Space( 7 ) + "/" + Space( 7 ), ; - MaxCol() + 1 ), "N/BG" ) - ENDIF - SetPos( r, c ) - -RETURN - -/* ********************************************************************** */ - -STATIC PROCEDURE HB_DotErr( oErr, cCommand ) - - LOCAL xArg, cMessage - - cMessage := "Sorry, could not execute:;;" + cCommand + ";;" - IF oErr:ClassName == "ERROR" - cMessage += oErr:Description - IF ValType( oErr:Args ) == 'A' .AND. Len( oErr:Args ) > 0 - cMessage += ";Arguments:" - FOR EACH xArg IN oErr:Args - cMessage += ";" + HB_CStr( xArg ) - NEXT - ENDIF - ELSEIF ValType( oErr ) == 'C' - cMessage += oErr - ENDIF - cMessage += ";;" + ProcName( 2 ) + '(' + LTrim( Str( ProcLine( 2 ) ) ) + ')' - - Alert( cMessage ) - - BREAK( oErr ) - -/* ********************************************************************** */ - -STATIC PROCEDURE HB_DotExec( cCommand ) - LOCAL pHRB, cHRB, cFunc, bBlock, cEol - - cEol := hb_osNewLine() - cFunc := "STATIC FUNC __HBDOT()" + cEol + ; - "RETURN {||" + cEol + ; - " " + cCommand + cEol + ; - " RETURN __MVSETBASE()" + cEol + ; - "}" + cEol - - BEGIN SEQUENCE WITH {|oErr| HB_DotErr( oErr, cCommand ) } - - cHRB := HB_COMPILEFROMBUF( cFunc, HB_ARGV( 0 ), "-n", "-q2", s_aIncDir ) - IF cHRB == NIL - EVAL( ErrorBlock(), "Syntax error." ) - ELSE - pHRB := __hrbLoad( cHRB ) - IF pHrb != NIL - bBlock := __hrbDo( pHRB ) - DevPos( s_nRow, s_nCol ) - Eval( bBlock ) - s_nRow := Row() - s_nCol := Col() - IF s_nRow < 2 - s_nRow := 2 - ENDIF - ENDIF - ENDIF - - ENDSEQUENCE - - __MVSETBASE() - -RETURN - -/* ********************************************************************** */ - -/* request for full screen GT driver */ -#if defined( __PLATFORM__WINCE ) -REQUEST HB_GT_WVT_DEFAULT -#elif defined( __PLATFORM__WINDOWS ) -REQUEST HB_GT_WIN_DEFAULT -#elif defined( __PLATFORM__UNIX ) -REQUEST HB_GT_TRM_DEFAULT -#elif defined( __PLATFORM__DOS ) -REQUEST HB_GT_DOS_DEFAULT -#elif defined( __PLATFORM__OS2 ) -REQUEST HB_GT_OS2_DEFAULT -#endif - -/* ********************************************************************** */ diff --git a/harbour/utils/hbrun/Makefile b/harbour/utils/hbrun/Makefile index 2056880e99..6338079576 100644 --- a/harbour/utils/hbrun/Makefile +++ b/harbour/utils/hbrun/Makefile @@ -10,7 +10,6 @@ ROOT = ../../ PRG_SOURCES=\ hbrun.prg \ - external.prg \ PRG_MAIN=hbrun.prg diff --git a/harbour/utils/hbrun/external.prg b/harbour/utils/hbrun/external.prg deleted file mode 100644 index 2887fffacc..0000000000 --- a/harbour/utils/hbrun/external.prg +++ /dev/null @@ -1,54 +0,0 @@ -/* - * $Id$ - */ - -/* - * Harbour Project source code: - * The declarations for the functions/procedures not part of Harbour. - * - * Copyright 1999 Ryszard Glab - * www - http://www.harbour-project.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). - * - * As a special exception, the Harbour Project gives permission for - * additional uses of the text contained in its release of Harbour. - * - * The exception is that, if you link the Harbour libraries with other - * files to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the Harbour library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the Harbour - * Project under the name Harbour. If you copy code from other - * Harbour Project or Free Software Foundation releases into a copy of - * Harbour, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for Harbour, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - * - */ - -/* Fill it as needed */ - diff --git a/harbour/utils/hbrun/hbrun.prg b/harbour/utils/hbrun/hbrun.prg index 9dc99be86d..7e49825eed 100644 --- a/harbour/utils/hbrun/hbrun.prg +++ b/harbour/utils/hbrun/hbrun.prg @@ -4,13 +4,10 @@ /* * Harbour Project source code: - * Standalone Harbour Portable Object file runner - * - * Copyright 1999 Ryszard Glab - * www - http://www.harbour-project.org + * "DOt Prompt" Console and .prg/.hrb runner for the Harbour Language * * Copyright 2007 Przemyslaw Czerpak - * added support for dynamic compilation and execution of .prg files + * www - http://www.harbour-project.org * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,61 +50,257 @@ * */ -/* - * Please remember that in *nixes if you copy compiled version - * of this program to /usr/bin directory then you can add to your - * .prg files as first line: - * #!/usr/bin/hbrun - * and then after setting executable attribute you can directly execute - * your .prg files - * If you are using Linux then you can also chose default gt driver by - * adding to above line: //gt - * F.e. - * #!/usr/bin/hbrun //gtstd - */ - +#include "inkey.ch" +#include "setcurs.ch" #include "hbextern.ch" -/* NOTE: Undocumented CA-Clipper _APPMAIN is used instead of Main to avoid - collision with user function in HRB file with that name. [ckedem] -*/ -FUNCTION _APPMAIN( cHRBFile, ... ) - LOCAL xRetVal, cPath, cName, cExt, cDrive, aIncDir +#define HB_HISTORY_LEN 32 +#define HB_LINE_LEN 256 +#define HB_PROMPT "." - IF Empty( cHRBFile ) - OutStd( "Harbour Runner" + HB_OSNewLine() +; - "Copyright 1999-2008, http://www.harbour-project.org" + HB_OSNewLine() +; - HB_OSNewLine() +; - "Syntax: hbrun [parameters]" + HB_OSNewLine() + ; - HB_OSNewLine() +; - "Note: Linked with " + Version() + HB_OSNewLine() ) - ERRORLEVEL( 1 ) - ELSE - HB_FNAMESPLIT( cHRBFile, @cPath, @cName, @cExt, @cDrive ) +STATIC s_nRow := 2, s_nCol := 0 +STATIC s_aIncDir := {} + +/* ********************************************************************** */ + +PROCEDURE _APPMAIN( cFile, ... ) + LOCAL GetList + LOCAL cLine, cCommand, cPath, cExt + LOCAL nMaxRow, nMaxCol + LOCAL aHistory, nHistIndex + LOCAL bKeyUP, bKeyDown, bKeyIns - IF LOWER( cExt ) == ".prg" - aIncDir := {} #ifdef _DEFAULT_INC_DIR - AADD( aIncDir, "-I" + _DEFAULT_INC_DIR ) + AADD( s_aIncDir, "-I" + _DEFAULT_INC_DIR ) #endif - cPath := getenv( "HB_INC_INSTALL" ) - IF !EMPTY( cPath ) - AADD( aIncDir, "-I" + cPath ) - ENDIF + cPath := getenv( "HB_INC_INSTALL" ) + IF !EMPTY( cPath ) + AADD( s_aIncDir, "-I" + cPath ) + ENDIF #ifdef __PLATFORM__UNIX - AADD( aIncDir, "-I/usr/include/harbour" ) - AADD( aIncDir, "-I/usr/local/include/harbour" ) + AADD( s_aIncDir, "-I/usr/include/harbour" ) + AADD( s_aIncDir, "-I/usr/local/include/harbour" ) #endif - cHRBFile := HB_COMPILEBUF( HB_ARGV( 0 ), "-n", "-w", "-es2", "-q0", ; - aIncDir, cHRBFile ) - IF cHRBFile == NIL - ERRORLEVEL( 1 ) - ELSE - xRetVal := __hrbRun( cHRBFile, ... ) + + IF PCount() > 0 + SWITCH lower( cFile ) + CASE "-?" + CASE "-h" + CASE "--help" + CASE "/?" + CASE "/h" + HB_DotUsage() + EXIT + OTHERWISE + hb_FNameSplit( cFile, NIL, NIL, @cExt ) + IF Lower( cExt ) == ".prg" + cFile := HB_COMPILEBUF( HB_ARGV( 0 ), "-n", "-w", "-es2", "-q0", ; + s_aIncDir, cFile ) + IF cFile == NIL + ERRORLEVEL( 1 ) + ELSE + __hrbRun( cFile, ... ) + ENDIF + ELSE + __hrbRun( cFile, ... ) + ENDIF + ENDSWITCH + ELSE + + CLEAR SCREEN + SET SCOREBOARD OFF + GetList := {} + cCommand := "" + aHistory := { padr( "quit", HB_LINE_LEN ) } + nHistIndex := 2 + + DO WHILE .T. + + IF cLine == NIL + cLine := Space( HB_LINE_LEN ) ENDIF - ELSE - xRetVal := __hrbRun( cHRBFile, ... ) - ENDIF + + HB_DotInfo( cCommand ) + + nMaxRow := MaxRow() + nMaxCol := MaxCol() + @ nMaxRow, 0 SAY HB_PROMPT + @ nMaxRow, Col() GET cLine ; + PICTURE "@KS" + LTrim( Str( nMaxCol - Col() + 1 ) ) + + SetCursor( IIF( ReadInsert(), SC_INSERT, SC_NORMAL ) ) + + bKeyIns := SetKey( K_INS, ; + {|| SetCursor( IIF( ReadInsert( !ReadInsert() ), ; + SC_NORMAL, SC_INSERT ) ) } ) + bKeyUp := SetKey( K_UP, ; + {|| IIF( nHistIndex > 1, ; + cLine := aHistory[ --nHistIndex ], ) } ) + bKeyDown := SetKey( K_DOWN, ; + {|| cLine := IIF( nHistIndex < LEN( aHistory ), ; + aHistory[ ++nHistIndex ], ; + ( nHistIndex := LEN( aHistory ) + 1, Space( HB_LINE_LEN ) ) ) } ) + + READ + + SetKey( K_DOWN, bKeyDown ) + SetKey( K_UP, bKeyUp ) + SetKey( K_INS, bKeyIns ) + + IF LastKey() == K_ESC .OR. EMPTY( cLine ) + cLine := NIL + IF nMaxRow != MaxRow() .OR. nMaxCol != MaxCol() + @ nMaxRow, 0 CLEAR + ENDIF + LOOP + ENDIF + + IF EMPTY( aHistory ) .OR. ! ATAIL( aHistory ) == cLine + IF LEN( aHistory ) < HB_HISTORY_LEN + AADD( aHistory, cLine ) + ELSE + ADEL( aHistory, 1 ) + aHistory[ LEN( aHistory ) ] := cLine + ENDIF + ENDIF + nHistIndex := LEN( aHistory ) + 1 + + cCommand := AllTrim( cLine, " " ) + cLine := NIL + @ nMaxRow, 0 CLEAR + HB_DotInfo( cCommand ) + + HB_DotExec( cCommand ) + + IF s_nRow >= MaxRow() + Scroll( 2, 0, MaxRow(), MaxCol(), 1 ) + s_nRow := MaxRow() - 1 + ENDIF + + ENDDO ENDIF - RETURN xRetVal +RETURN + +/* ********************************************************************** */ + +STATIC PROCEDURE HB_DotUsage() + + OutStd( 'Harbour "DOt Prompt" Console / runner' + HB_OSNewLine() +; + 'Copyright 1999-2008, Przemyslaw Czerpak' + HB_OSNewLine() + ; + 'http://www.harbour-project.org' + HB_OSNewLine() +; + HB_OSNewLine() +; + 'Syntax: hbrun [ []]' + HB_OSNewLine() + ; + HB_OSNewLine() +; + "Note: Linked with " + Version() + HB_OSNewLine() ) + +RETURN + +/* ********************************************************************** */ + +STATIC PROCEDURE HB_DotInfo( cCommand ) + + LOCAL r := Row(), c := Col() + + IF cCommand != NIL + DispOutAt( 0, 0, "PP: " ) + DispOutAt( 0, 4, PadR( cCommand, MaxCol() - 3 ), "N/R" ) + ENDIF + IF Used() + DispOutAt( 1, 0, ; + PadR( "RDD: " + PadR( RddName(), 6 ) + ; + " | Area:" + Str( Select(), 3 ) + ; + " | Dbf: " + PadR( Alias(), 10 ) + ; + " | Index: " + PadR( OrdName( IndexOrd() ), 8 ) + ; + " | # " + Str( RecNo(), 7 ) + "/" + Str( RecCount(), 7 ), ; + MaxCol() + 1 ), "N/BG" ) + ELSE + DispOutAt( 1, 0, ; + PadR( "RDD: " + Space( 6 ) + ; + " | Area:" + Space( 3 ) + ; + " | Dbf: " + Space( 10 ) + ; + " | Index: " + Space( 8 ) + ; + " | # " + Space( 7 ) + "/" + Space( 7 ), ; + MaxCol() + 1 ), "N/BG" ) + ENDIF + SetPos( r, c ) + +RETURN + +/* ********************************************************************** */ + +STATIC PROCEDURE HB_DotErr( oErr, cCommand ) + + LOCAL xArg, cMessage + + cMessage := "Sorry, could not execute:;;" + cCommand + ";;" + IF oErr:ClassName == "ERROR" + cMessage += oErr:Description + IF ValType( oErr:Args ) == 'A' .AND. Len( oErr:Args ) > 0 + cMessage += ";Arguments:" + FOR EACH xArg IN oErr:Args + cMessage += ";" + HB_CStr( xArg ) + NEXT + ENDIF + ELSEIF ValType( oErr ) == 'C' + cMessage += oErr + ENDIF + cMessage += ";;" + ProcName( 2 ) + '(' + LTrim( Str( ProcLine( 2 ) ) ) + ')' + + Alert( cMessage ) + + BREAK( oErr ) + +/* ********************************************************************** */ + +STATIC PROCEDURE HB_DotExec( cCommand ) + LOCAL pHRB, cHRB, cFunc, bBlock, cEol + + cEol := hb_osNewLine() + cFunc := "STATIC FUNC __HBDOT()" + cEol + ; + "RETURN {||" + cEol + ; + " " + cCommand + cEol + ; + " RETURN __MVSETBASE()" + cEol + ; + "}" + cEol + + BEGIN SEQUENCE WITH {|oErr| HB_DotErr( oErr, cCommand ) } + + cHRB := HB_COMPILEFROMBUF( cFunc, HB_ARGV( 0 ), "-n", "-q2", s_aIncDir ) + IF cHRB == NIL + EVAL( ErrorBlock(), "Syntax error." ) + ELSE + pHRB := __hrbLoad( cHRB ) + IF pHrb != NIL + bBlock := __hrbDo( pHRB ) + DevPos( s_nRow, s_nCol ) + Eval( bBlock ) + s_nRow := Row() + s_nCol := Col() + IF s_nRow < 2 + s_nRow := 2 + ENDIF + ENDIF + ENDIF + + ENDSEQUENCE + + __MVSETBASE() + +RETURN + +/* ********************************************************************** */ + +/* request for full screen GT driver */ +#if defined( __PLATFORM__WINCE ) +REQUEST HB_GT_WVT_DEFAULT +#elif defined( __PLATFORM__WINDOWS ) +REQUEST HB_GT_WIN_DEFAULT +#elif defined( __PLATFORM__UNIX ) +REQUEST HB_GT_TRM_DEFAULT +#elif defined( __PLATFORM__DOS ) +REQUEST HB_GT_DOS_DEFAULT +#elif defined( __PLATFORM__OS2 ) +REQUEST HB_GT_OS2_DEFAULT +#endif + +/* ********************************************************************** */