diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 198e3aa7ff..017dbde811 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,65 @@ +20000307-16:36 GMT+1 Victor Szakats + * bin/bld*.* + - "-5" options removed (again). + * Now none of them remove the .c file. + ! Borland make files fixed. Changed the order of options. + * Borland batch files synchronized with bld_tpl.* + ; Tested BCC16 and BCC32. + * source/rtl/gt/* + source/rtl/gtapi.c + ! hb_gt_ReadKey() made common for all GT types. OS specific branch removed. + + TOFIXes added to gtwin.c for all the places where the API calling + rules are violated, so that the upper level API is called from a + lower one. + * source/rtl/console.c + ! SETCURSOR(), RESTSCREEN() fixed when called with more parameter then + required. + % Minor optimization. + % Got rid of a few non-GTAPI branches. + % s_iDevRow and s_iDevCol removed. + !! WARNING !! Non-GT mode has not been tested. Also some more tests + would be good for the GT mode. + + TOFIXes added for all places where the API calling rules are violated, + so that an API level is skipped and the low-level API is directly + called. + * source/rtl/mouseapi.c + - Removed one TODO + * One ULONG changed back to USHORT and a cast added. + - tests/strip + + tests/stripem.prg + tests/Makefile + * Renamed to avoid conflict with the GNU STRIP.EXE. + * source/runner/stdalone/hbrun.prg + + Year updated. + * tests/regress/* + makefile.bc + makefile.vc + + "-" switch char added. + + Header added + + -?, /? options and help screen added. + ! Typos fixed. + * Renamed to HBTEST + - tests/regress/* moved to + + utils/hbtest/* + tests/Makefile + utils/Makefile + makefile.bc + makefile.vc + * Regression Test Suit moved to another directory. It's a better place + since it was a bit problematic to handle a subdir from the tests dir + in the GNU-make system. (it got only build when install was specified + or only after all the small tests programs were built) + * Makefile + * utils moved before tests + - make_b40.bat + make_b32.bat + - Removed this version specific batch file. + The -O2 option was removed for BCC40 due to PP bugs back then, ? and ?? + was not PP-ed properly. Anyone could test this now ? + If it still doesn't work I will add a warning to MAKE_B32.BAT about that. + * makefile.bc + * B40 option renamed to BCC_NOOPTIM to be more generic. + 20000307-09:20 EST Paul Tucker * makefile.vc * create unistd.h moved to first target diff --git a/harbour/Makefile b/harbour/Makefile index 64ee43ca7e..9e98bc9f49 100644 --- a/harbour/Makefile +++ b/harbour/Makefile @@ -8,8 +8,8 @@ DIRS=\ include \ source \ obj \ - tests \ utils \ + tests \ # samples \ include $(ROOT)config/dir.cf diff --git a/harbour/bin/bld_b16.bat b/harbour/bin/bld_b16.bat index 3a6a93db13..aeef932a7e 100644 --- a/harbour/bin/bld_b16.bat +++ b/harbour/bin/bld_b16.bat @@ -4,19 +4,19 @@ rem $Id$ rem ..\bin\harbour %1 %2 %3 /n /i..\include -echo -O2 -I..\include -mh -L..\lib\b16 > build.tmp -echo %1.c >> build.tmp -echo common.lib >> build.tmp +echo -O2 -mh -I..\include -L..\lib\b16 > build.tmp +echo -e%1.exe %1.c >> build.tmp +echo tools.lib >> build.tmp +echo debug.lib >> build.tmp echo vm.lib >> build.tmp echo rtl.lib >> build.tmp echo rdd.lib >> build.tmp echo macro.lib >> build.tmp -echo debug.lib >> build.tmp -echo tools.lib >> build.tmp echo pp.lib >> build.tmp echo dbfntx.lib >> build.tmp echo dbfcdx.lib >> build.tmp +echo common.lib >> build.tmp bcc @build.tmp del build.tmp -del %1.c +rem del %1.c diff --git a/harbour/bin/bld_b32.bat b/harbour/bin/bld_b32.bat index 9dfa9ad8e5..019698fccc 100644 --- a/harbour/bin/bld_b32.bat +++ b/harbour/bin/bld_b32.bat @@ -4,5 +4,6 @@ rem $Id$ rem ..\bin\harbour %1 %2 %3 /n /i..\include -bcc32 %1.c -e%1.exe -5 -O2 -I..\include -L..\lib\b32 common.lib vm.lib rtl.lib rdd.lib macro.lib debug.lib tools.lib pp.lib dbfntx.lib dbfcdx.lib +bcc32 -O2 -I..\include -L..\lib\b32 -e%1.exe %1.c tools.lib debug.lib vm.lib rtl.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib rem del %1.c + diff --git a/harbour/bin/bld_b32o.bat b/harbour/bin/bld_b32o.bat index e5d87e9be1..48419ecb8b 100644 --- a/harbour/bin/bld_b32o.bat +++ b/harbour/bin/bld_b32o.bat @@ -3,7 +3,9 @@ rem rem $Id$ rem +rem NOTE: Experimental + ..\bin\harbour %1 %2 %3 /n /i..\include /gf -tlink32 -L..\lib\b32 c0x32.obj %1.obj hvm.obj,%1.exe,, common.lib vm.lib rtl.lib rdd.lib macro.lib debug.lib tools.lib pp.lib dbfntx.lib dbfcdx.lib import32.lib cw32mt.lib +tlink32 -L..\lib\b32 c0x32.obj %1.obj hvm.obj,%1.exe,, import32.lib cw32mt.lib tools.lib debug.lib vm.lib rtl.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib del %1.obj diff --git a/harbour/bin/bld_b32w.bat b/harbour/bin/bld_b32w.bat index 173811f19a..725c85b441 100644 --- a/harbour/bin/bld_b32w.bat +++ b/harbour/bin/bld_b32w.bat @@ -4,5 +4,6 @@ rem $Id$ rem ..\bin\harbour %1 %2 %3 /n /i..\include -bcc32 %1.c -e%1.exe -O2 -I..\include -L..\lib\b32 -5 -tW common.lib vm.lib rtl.lib rdd.lib macro.lib debug.lib tools.lib pp.lib dbfntx.lib dbfcdx.lib +bcc32 -O2 -tW -I..\include -L..\lib\b32 -e%1.exe %1.c tools.lib debug.lib vm.lib rtl.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib rem del %1.c + diff --git a/harbour/bin/bld_tpl.bat b/harbour/bin/bld_tpl.bat index 8586fd3b94..a06b859814 100644 --- a/harbour/bin/bld_tpl.bat +++ b/harbour/bin/bld_tpl.bat @@ -79,7 +79,7 @@ rem set HB_COMPILER= if not "%HB_ARCHITECTURE%" == "dos" goto A_W32 - if "%HB_COMPILER%" == "bcc16" bcc -O2 -mh -I..\include %1.c -L..\lib tools.lib debug.lib vm.lib rtl.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib + if "%HB_COMPILER%" == "bcc16" bcc -O2 -mh -I..\include -L..\lib %1.c tools.lib debug.lib vm.lib rtl.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib if "%HB_COMPILER%" == "djgpp" gcc %1.c -o%1.exe -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -lrdd -lrtl -lvm -lmacro -lpp -ldbfnt -ldbfcd -lcommon goto END @@ -87,7 +87,7 @@ rem set HB_COMPILER= if not "%HB_ARCHITECTURE%" == "w32" goto A_OS2 - if "%HB_COMPILER%" == "bcc32" bcc32 -O2 -I..\include %1.c -L..\lib tools.lib debug.lib vm.lib rtl.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib + if "%HB_COMPILER%" == "bcc32" bcc32 -O2 -I..\include -L..\lib %1.c tools.lib debug.lib vm.lib rtl.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib if "%HB_COMPILER%" == "gcc" gcc %1.c -o%1.exe -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon if "%HB_COMPILER%" == "mingw32" gcc %1.c -o%1.exe -mno-cygwin -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon if "%HB_COMPILER%" == "msvc" cl -Fd..\bin\harbour -w -Zi -TP -GZ -GA -I..\include %1.c /link /subsystem:CONSOLE ..\lib\tools.lib ..\lib\debug.lib ..\lib\vm.lib ..\lib\rtl.lib ..\lib\rdd.lib ..\lib\macro.lib ..\lib\pp.lib ..\lib\dbfntx.lib ..\lib\dbfcdx.lib ..\lib\common.lib diff --git a/harbour/bin/bld_tpl.cmd b/harbour/bin/bld_tpl.cmd index a9f9c639ab..dd41336192 100644 --- a/harbour/bin/bld_tpl.cmd +++ b/harbour/bin/bld_tpl.cmd @@ -79,7 +79,7 @@ rem set HB_COMPILER= if not "%HB_ARCHITECTURE%" == "dos" goto A_W32 - if "%HB_COMPILER%" == "bcc16" bcc -O2 -mh -I..\include %1.c -L..\lib tools.lib debug.lib vm.lib rtl.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib + if "%HB_COMPILER%" == "bcc16" bcc -O2 -mh -I..\include -L..\lib %1.c tools.lib debug.lib vm.lib rtl.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib if "%HB_COMPILER%" == "djgpp" gcc %1.c -o%1.exe -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -lrdd -lrtl -lvm -lmacro -lpp -ldbfnt -ldbfcd -lcommon goto END @@ -87,7 +87,7 @@ rem set HB_COMPILER= if not "%HB_ARCHITECTURE%" == "w32" goto A_OS2 - if "%HB_COMPILER%" == "bcc32" bcc32 -O2 -I..\include %1.c -L..\lib tools.lib debug.lib vm.lib rtl.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib + if "%HB_COMPILER%" == "bcc32" bcc32 -O2 -I..\include -L..\lib %1.c tools.lib debug.lib vm.lib rtl.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib if "%HB_COMPILER%" == "gcc" gcc %1.c -o%1.exe -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon if "%HB_COMPILER%" == "mingw32" gcc %1.c -o%1.exe -mno-cygwin -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon if "%HB_COMPILER%" == "msvc" cl -Fd..\bin\harbour -w -Zi -TP -GZ -GA -I..\include %1.c /link /subsystem:CONSOLE ..\lib\tools.lib ..\lib\debug.lib ..\lib\vm.lib ..\lib\rtl.lib ..\lib\rdd.lib ..\lib\macro.lib ..\lib\pp.lib ..\lib\dbfntx.lib ..\lib\dbfcdx.lib ..\lib\common.lib diff --git a/harbour/bin/bld_vc.bat b/harbour/bin/bld_vc.bat index 9b204ce0b8..88cb3c27fe 100644 --- a/harbour/bin/bld_vc.bat +++ b/harbour/bin/bld_vc.bat @@ -5,4 +5,5 @@ rem ..\bin\harbour %1 %2 %3 /n /i..\include cl -Fd..\bin\harbour -w -Zi -TP -GZ -GA -I..\include %1.c /link /subsystem:CONSOLE ..\lib\vc\rtl.lib ..\lib\vc\common.lib ..\lib\vc\tools.lib ..\lib\vc\rdd.lib ..\lib\vc\nulsys.lib ..\lib\vc\dbfntx.lib ..\lib\vc\dbfcdx.lib ..\lib\vc\debug.lib ..\lib\vc\macro.lib ..\lib\vc\vm.lib -del %1.c +rem del %1.c + diff --git a/harbour/make_b40.bat b/harbour/make_b40.bat deleted file mode 100644 index 488a940294..0000000000 --- a/harbour/make_b40.bat +++ /dev/null @@ -1,25 +0,0 @@ -@echo off -rem -rem $Id$ -rem - -if "%1" == "clean" goto CLEAN -if "%1" == "CLEAN" goto CLEAN - -:BUILD - - make -fmakefile.bc -DB40 %1 %2 %3 > make_b40.log - if errorlevel 1 notepad make_b40.log - goto EXIT - -:CLEAN - - echo Y | del bin\*.exe > nul - echo Y | del bin\*.tds > nul - echo Y | del obj\b32\*.* > nul - echo Y | del lib\b32\*.* > nul - echo Y | del make_b40.log > nul - goto EXIT - -:EXIT - diff --git a/harbour/makefile.bc b/harbour/makefile.bc index 3b838e59a2..d9a99c7a8c 100644 --- a/harbour/makefile.bc +++ b/harbour/makefile.bc @@ -28,7 +28,7 @@ TASM_EXE = tasm32 OBJ_DIR = obj\b32 LIB_DIR = lib\b32 -!if !$d(B40) +!if !$d(BCC_NOOPTIM) BCC_OPT = $(BCC_OPT) -O2 !endif @@ -46,7 +46,7 @@ RDD_DIR = source\rdd RUNNER_DIR = source\runner DEBUG_DIR = source\debug BIN_DIR = bin -REGRESS_DIR = tests\regress +HBTEST_DIR = utils\hbtest HBDOC_DIR = utils\hbdoc COMMON_LIB = $(LIB_DIR)\common.lib @@ -261,8 +261,8 @@ DEBUG_LIB_OBJS = $(OBJ_DIR)\dbgmenu.obj \ $(OBJ_DIR)\debugger.obj \ $(OBJ_DIR)\tbrwtext.obj -REGRESS_EXE = $(BIN_DIR)\rt_main.exe -REGRESS_EXE_OBJS = $(OBJ_DIR)\rt_main.obj \ +HBTEST_EXE = $(BIN_DIR)\hbtest.exe +HBTEST_EXE_OBJS = $(OBJ_DIR)\hbtest.obj \ $(OBJ_DIR)\rt_hvm.obj \ $(OBJ_DIR)\rt_math.obj \ $(OBJ_DIR)\rt_date.obj \ @@ -297,7 +297,7 @@ PROJECT: $(COMMON_LIB) \ $(RUNNER_LIB) \ $(RUNNER_EXE) \ $(DEBUG_LIB) \ - $(REGRESS_EXE) \ + $(HBTEST_EXE) \ $(HBDOC_EXE) # @@ -1317,14 +1317,14 @@ $(OBJ_DIR)\tbrwtext.obj : $(OBJ_DIR)\tbrwtext.c tlib $(DEBUG_LIB) -+$@,, # -# rt_main.exe +# hbtest.exe # -$(REGRESS_EXE) : $(REGRESS_EXE_OBJS) +$(HBTEST_EXE) : $(HBTEST_EXE_OBJS) echo $(BCC_OPT) > make.tmp - echo -e$(BIN_DIR)\rt_main.exe >> make.tmp + echo -e$(BIN_DIR)\hbtest.exe >> make.tmp echo -I$(INCLUDE_DIR) >> make.tmp - echo $(OBJ_DIR)\rt_main.obj >> make.tmp + echo $(OBJ_DIR)\hbtest.obj >> make.tmp echo $(OBJ_DIR)\rt_hvm.obj >> make.tmp echo $(OBJ_DIR)\rt_math.obj >> make.tmp echo $(OBJ_DIR)\rt_date.obj >> make.tmp @@ -1345,55 +1345,55 @@ $(REGRESS_EXE) : $(REGRESS_EXE_OBJS) $(BCC_EXE) @make.tmp del make.tmp -$(OBJ_DIR)\rt_main.c : $(REGRESS_DIR)\rt_main.prg +$(OBJ_DIR)\hbtest.c : $(HBTEST_DIR)\hbtest.prg $(HARBOUR_EXE) $** -i$(INCLUDE_DIR) -n $(HARBOUR_OPT) -o$@ -$(OBJ_DIR)\rt_main.obj : $(OBJ_DIR)\rt_main.c +$(OBJ_DIR)\hbtest.obj : $(OBJ_DIR)\hbtest.c $(BCC_EXE) $(BCC_OPT) -c -I$(INCLUDE_DIR) -o$@ $** -$(OBJ_DIR)\rt_hvm.c : $(REGRESS_DIR)\rt_hvm.prg +$(OBJ_DIR)\rt_hvm.c : $(HBTEST_DIR)\rt_hvm.prg $(HARBOUR_EXE) $** -i$(INCLUDE_DIR) -n $(HARBOUR_OPT) -o$@ $(OBJ_DIR)\rt_hvm.obj : $(OBJ_DIR)\rt_hvm.c $(BCC_EXE) $(BCC_OPT) -c -I$(INCLUDE_DIR) -o$@ $** -$(OBJ_DIR)\rt_math.c : $(REGRESS_DIR)\rt_math.prg +$(OBJ_DIR)\rt_math.c : $(HBTEST_DIR)\rt_math.prg $(HARBOUR_EXE) $** -i$(INCLUDE_DIR) -n $(HARBOUR_OPT) -o$@ $(OBJ_DIR)\rt_math.obj : $(OBJ_DIR)\rt_math.c $(BCC_EXE) $(BCC_OPT) -c -I$(INCLUDE_DIR) -o$@ $** -$(OBJ_DIR)\rt_date.c : $(REGRESS_DIR)\rt_date.prg +$(OBJ_DIR)\rt_date.c : $(HBTEST_DIR)\rt_date.prg $(HARBOUR_EXE) $** -i$(INCLUDE_DIR) -n $(HARBOUR_OPT) -o$@ $(OBJ_DIR)\rt_date.obj : $(OBJ_DIR)\rt_date.c $(BCC_EXE) $(BCC_OPT) -c -I$(INCLUDE_DIR) -o$@ $** -$(OBJ_DIR)\rt_str.c : $(REGRESS_DIR)\rt_str.prg +$(OBJ_DIR)\rt_str.c : $(HBTEST_DIR)\rt_str.prg $(HARBOUR_EXE) $** -i$(INCLUDE_DIR) -n $(HARBOUR_OPT) -o$@ $(OBJ_DIR)\rt_str.obj : $(OBJ_DIR)\rt_str.c $(BCC_EXE) $(BCC_OPT) -c -I$(INCLUDE_DIR) -o$@ $** -$(OBJ_DIR)\rt_trans.c : $(REGRESS_DIR)\rt_trans.prg +$(OBJ_DIR)\rt_trans.c : $(HBTEST_DIR)\rt_trans.prg $(HARBOUR_EXE) $** -i$(INCLUDE_DIR) -n $(HARBOUR_OPT) -o$@ $(OBJ_DIR)\rt_trans.obj : $(OBJ_DIR)\rt_trans.c $(BCC_EXE) $(BCC_OPT) -c -I$(INCLUDE_DIR) -o$@ $** -$(OBJ_DIR)\rt_array.c : $(REGRESS_DIR)\rt_array.prg +$(OBJ_DIR)\rt_array.c : $(HBTEST_DIR)\rt_array.prg $(HARBOUR_EXE) $** -i$(INCLUDE_DIR) -n $(HARBOUR_OPT) -o$@ $(OBJ_DIR)\rt_array.obj : $(OBJ_DIR)\rt_array.c $(BCC_EXE) $(BCC_OPT) -c -I$(INCLUDE_DIR) -o$@ $** -$(OBJ_DIR)\rt_file.c : $(REGRESS_DIR)\rt_file.prg +$(OBJ_DIR)\rt_file.c : $(HBTEST_DIR)\rt_file.prg $(HARBOUR_EXE) $** -i$(INCLUDE_DIR) -n $(HARBOUR_OPT) -o$@ $(OBJ_DIR)\rt_file.obj : $(OBJ_DIR)\rt_file.c $(BCC_EXE) $(BCC_OPT) -c -I$(INCLUDE_DIR) -o$@ $** -$(OBJ_DIR)\rt_misc.c : $(REGRESS_DIR)\rt_misc.prg +$(OBJ_DIR)\rt_misc.c : $(HBTEST_DIR)\rt_misc.prg $(HARBOUR_EXE) $** -i$(INCLUDE_DIR) -n $(HARBOUR_OPT) -o$@ $(OBJ_DIR)\rt_misc.obj : $(OBJ_DIR)\rt_misc.c diff --git a/harbour/makefile.vc b/harbour/makefile.vc index 291fd755ad..48ba4ed3a2 100644 --- a/harbour/makefile.vc +++ b/harbour/makefile.vc @@ -31,7 +31,7 @@ OBJ_DIR=obj\vc RUNNER_DIR=source\runner COMMON_DIR=source\common MACRO_DIR=source\macro -REGRESS_DIR=tests\regress +HBTEST_DIR=utils\hbtest HBDOC_DIR=utils\hbdoc # @@ -63,7 +63,7 @@ HARBOUR_EXE=$(BIN_DIR)\harbour.exe PP_EXE=$(BIN_DIR)\hbpp.exe RUNNER_EXE=$(BIN_DIR)\hbrun.exe RUNNER_DLL=$(BIN_DIR)\runjava.dll -REGRESS_EXE=$(BIN_DIR)\rt_main.exe +HBTEST_EXE=$(BIN_DIR)\hbtest.exe HBDOC_EXE=$(BIN_DIR)\hbdoc.exe HARBOURFLAGS=-iinclude -n -q0 -w -es2 -gc0 UNISTD=include\unistd.h @@ -329,9 +329,9 @@ all: $(UNISTD) \ $(LIBLIST) \ $(PP_EXE) \ $(RUNNER_EXE) \ - $(REGRESS_EXE) \ - $(HBDOC_EXE) -# $(RUNNER_DLL) + $(HBTEST_EXE) \ + $(HBDOC_EXE) \ +# $(RUNNER_DLL) $(UNISTD): command /c echo. >include\unistd.h @@ -360,27 +360,27 @@ $(RUNNER_EXE) : \ # -del $(BIN_DIR)\runjava.exp # -del $(BIN_DIR)\runjava.lib -$(REGRESS_EXE) : \ - $(REGRESS_DIR)\rt_main.prg \ - $(REGRESS_DIR)\rt_array.prg \ - $(REGRESS_DIR)\rt_date.prg \ - $(REGRESS_DIR)\rt_file.prg \ - $(REGRESS_DIR)\rt_hvm.prg \ - $(REGRESS_DIR)\rt_math.prg \ - $(REGRESS_DIR)\rt_misc.prg \ - $(REGRESS_DIR)\rt_str.prg \ - $(REGRESS_DIR)\rt_trans.prg - $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(REGRESS_DIR)\rt_main.prg - $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(REGRESS_DIR)\rt_array.prg - $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(REGRESS_DIR)\rt_date.prg - $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(REGRESS_DIR)\rt_file.prg - $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(REGRESS_DIR)\rt_hvm.prg - $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(REGRESS_DIR)\rt_math.prg - $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(REGRESS_DIR)\rt_misc.prg - $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(REGRESS_DIR)\rt_str.prg - $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(REGRESS_DIR)\rt_trans.prg - $(CC) -TP $(CFLAGS) $(OBJ_DIR)\rt_main.c $(OBJ_DIR)\rt_array.c $(OBJ_DIR)\rt_date.c $(OBJ_DIR)\rt_file.c $(OBJ_DIR)\rt_hvm.c $(OBJ_DIR)\rt_math.c $(OBJ_DIR)\rt_misc.c $(OBJ_DIR)\rt_str.c $(OBJ_DIR)\rt_trans.c -o $(REGRESS_EXE) /link $(LIBS) - -del rt_main.obj +$(HBTEST_EXE) : \ + $(HBTEST_DIR)\hbtest.prg \ + $(HBTEST_DIR)\rt_array.prg \ + $(HBTEST_DIR)\rt_date.prg \ + $(HBTEST_DIR)\rt_file.prg \ + $(HBTEST_DIR)\rt_hvm.prg \ + $(HBTEST_DIR)\rt_math.prg \ + $(HBTEST_DIR)\rt_misc.prg \ + $(HBTEST_DIR)\rt_str.prg \ + $(HBTEST_DIR)\rt_trans.prg + $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(HBTEST_DIR)\hbtest.prg + $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(HBTEST_DIR)\rt_array.prg + $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(HBTEST_DIR)\rt_date.prg + $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(HBTEST_DIR)\rt_file.prg + $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(HBTEST_DIR)\rt_hvm.prg + $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(HBTEST_DIR)\rt_math.prg + $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(HBTEST_DIR)\rt_misc.prg + $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(HBTEST_DIR)\rt_str.prg + $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $(HBTEST_DIR)\rt_trans.prg + $(CC) -TP $(CFLAGS) $(OBJ_DIR)\hbtest.c $(OBJ_DIR)\rt_array.c $(OBJ_DIR)\rt_date.c $(OBJ_DIR)\rt_file.c $(OBJ_DIR)\rt_hvm.c $(OBJ_DIR)\rt_math.c $(OBJ_DIR)\rt_misc.c $(OBJ_DIR)\rt_str.c $(OBJ_DIR)\rt_trans.c -o $(HBTEST_EXE) /link $(LIBS) + -del hbtest.obj -del rt_array.obj -del rt_date.obj -del rt_file.obj diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index 8286f11486..9ba6b15305 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -99,8 +99,6 @@ #endif static BOOL s_bInit = FALSE; -static SHORT s_iDevRow; -static SHORT s_iDevCol; static USHORT s_uiPRow; static USHORT s_uiPCol; static char s_szCrLf[ CRLF_BUFFER_LEN ]; @@ -146,7 +144,6 @@ void hb_consoleInitialize( void ) hb_mouseInit(); hb_gtInit(); - hb_gtGetPos( &s_iDevRow, &s_iDevCol ); hb_gtSetCursor( SC_NORMAL ); s_bInit = TRUE; @@ -181,13 +178,19 @@ HARBOUR HB_HB_OSNEWLINE( void ) } #ifndef HARBOUR_USE_GTAPI -static void adjust_pos( char * pStr, ULONG ulLen, SHORT * row, SHORT * col ) +static void adjust_pos( char * pStr, ULONG ulLen ) { - USHORT max_row = hb_gtMaxRow(); - USHORT max_col = hb_gtMaxCol(); + USHORT max_row; + USHORT max_col; + SHORT row; + SHORT col; ULONG ulCount; - HB_TRACE(HB_TR_DEBUG, ("adjust_pos(%s, %lu, %p, %p)", pStr, ulLen, row, col)); + HB_TRACE(HB_TR_DEBUG, ("adjust_pos(%s, %lu)", pStr, ulLen )); + + max_row = hb_gtMaxRow(); + max_col = hb_gtMaxCol(); + hb_gtGetPos( &row, &col ); for( ulCount = 0; ulCount < ulLen; ulCount++ ) { @@ -197,31 +200,38 @@ static void adjust_pos( char * pStr, ULONG ulLen, SHORT * row, SHORT * col ) break; case HB_CHAR_BS: - if( *col ) ( *col )--; + if( col ) + col--; else { - *col = max_col; - if( *row ) ( *row )--; + col = max_col; + if( row ) + row--; } break; case HB_CHAR_LF: - if( *row < max_row ) ( *row )++; + if( row < max_row ) + row++; break; case HB_CHAR_CR: - *col = 0; + col = 0; break; default: - if( *col < max_col ) ( *col )++; + if( col < max_col ) + col++; else { - *col = 0; - if( *row < max_row ) ( *row )++; + col = 0; + if( row < max_row ) + row++; } } } + + hb_gtSetPos( row, col ); } #endif @@ -269,13 +279,10 @@ void hb_outstd( char * pStr, ULONG ulLen ) #ifndef __CYGWIN__ if( isatty( s_iFilenoStdout ) ) #endif - { - s_iDevRow = hb_gt_Row(); - s_iDevCol = hb_gt_Col(); - hb_gtSetPos( s_iDevRow, s_iDevCol ); - } + /* TOFIX: Violation of API calling rules! */ + hb_gtSetPos( hb_gt_Row(), hb_gt_Col() ); #else - adjust_pos( pStr, ulLen, &s_iDevRow, &s_iDevCol ); + adjust_pos( pStr, ulLen ); #endif hb_gtPostExt(); } @@ -304,13 +311,10 @@ void hb_outerr( char * pStr, ULONG ulLen ) #ifndef __CYGWIN__ if( isatty( s_iFilenoStdout ) ) #endif - { - s_iDevRow = hb_gt_Row(); - s_iDevCol = hb_gt_Col(); - hb_gtSetPos( s_iDevRow, s_iDevCol ); - } + /* TOFIX: Violation of API calling rules! */ + hb_gtSetPos( hb_gt_Row(), hb_gt_Col() ); #else - adjust_pos( pStr, ulLen, &s_iDevRow, &s_iDevCol ); + adjust_pos( pStr, ulLen ); #endif hb_gtPostExt(); } @@ -325,12 +329,11 @@ static void hb_altout( char * pStr, ULONG ulLen ) { #ifdef HARBOUR_USE_GTAPI hb_gtWriteCon( ( BYTE * ) pStr, ulLen ); - hb_gtGetPos( &s_iDevRow, &s_iDevCol ); #else USHORT user_ferror = hb_fsError(); /* Save current user file error code */ hb_fsWriteLarge( s_iFilenoStdout, ( BYTE * ) pStr, ulLen ); hb_fsSetError( user_ferror ); /* Restore last user file error code */ - adjust_pos( pStr, ulLen, &s_iDevRow, &s_iDevCol ); + adjust_pos( pStr, ulLen ); #endif } @@ -377,13 +380,13 @@ static void hb_devout( char * pStr, ULONG ulLen ) { #ifdef HARBOUR_USE_GTAPI /* Otherwise, display to console */ - hb_gtWriteAt( s_iDevRow, s_iDevCol, ( BYTE * ) pStr, ulLen ); - hb_gtGetPos( &s_iDevRow, &s_iDevCol ); + /* TOFIX: Violation of API calling rules! */ + hb_gtWriteAt( hb_gt_Row(), hb_gt_Col(), ( BYTE * ) pStr, ulLen ); #else USHORT user_ferror = hb_fsError(); /* Save current user file error code */ hb_fsWriteLarge( s_iFilenoStdout, ( BYTE * ) pStr, ulLen ); hb_fsSetError( user_ferror ); /* Restore last user file error code */ - adjust_pos( pStr, ulLen, &s_iDevRow, &s_iDevCol ); + adjust_pos( pStr, ulLen ); #endif } } @@ -391,20 +394,18 @@ static void hb_devout( char * pStr, ULONG ulLen ) /* Output an item to the screen */ static void hb_dispout( char * pStr, ULONG ulLen ) { - USHORT user_ferror; - HB_TRACE(HB_TR_DEBUG, ("hb_dispout(%s, %lu)", pStr, ulLen)); #ifdef HARBOUR_USE_GTAPI - /* Display to console */ - hb_gtWriteAt( s_iDevRow, s_iDevCol, ( BYTE * ) pStr, ulLen ); - hb_gtGetPos( &s_iDevRow, &s_iDevCol ); - HB_SYMBOL_UNUSED( user_ferror ); + /* TOFIX: Violation of API calling rules! */ + hb_gtWriteAt( hb_gt_Row(), hb_gt_Col(), ( BYTE * ) pStr, ulLen ); #else - user_ferror = hb_fsError(); /* Save current user file error code */ - hb_fsWriteLarge( s_iFilenoStdout, ( BYTE * ) pStr, ulLen ); - hb_fsSetError( user_ferror ); /* Restore last user file error code */ - adjust_pos( pStr, ulLen, &s_iDevRow, &s_iDevCol ); + { + USHORT user_ferror = hb_fsError(); /* Save current user file error code */ + hb_fsWriteLarge( s_iFilenoStdout, ( BYTE * ) pStr, ulLen ); + hb_fsSetError( user_ferror ); /* Restore last user file error code */ + adjust_pos( pStr, ulLen ); + } #endif } @@ -412,29 +413,35 @@ void hb_setpos( SHORT row, SHORT col ) { HB_TRACE(HB_TR_DEBUG, ("hb_setpos(%hd, %hd)", row, col)); -#ifdef HARBOUR_USE_GTAPI - hb_gtSetPos( row, col ); -#else +#ifndef HARBOUR_USE_GTAPI { SHORT iCount; + /* TOFIX: Violation of API calling rules! */ + SHORT iDevRow = hb_gt_Row(); + SHORT iDevCol = hb_gt_Col(); - if( row < s_iDevRow || col < s_iDevCol ) + if( row < iDevRow || col < iDevCol ) { fputs( s_szCrLf, stdout ); - s_iDevCol = 0; - s_iDevRow++; + iDevCol = 0; + iDevRow++; } - else if( row > s_iDevRow ) s_iDevCol = 0; - for( iCount = s_iDevRow; iCount < row; iCount++ ) + else if( row > iDevRow ) + iDevCol = 0; + + for( iCount = iDevRow; iCount < row; iCount++ ) fputs( s_szCrLf, stdout ); - for( iCount = s_iDevCol; iCount < col; iCount++ ) + for( iCount = iDevCol; iCount < col; iCount++ ) fputc( ' ', stdout ); + fflush( stdout ); + + row = iDevRow; + col = iDevCol; } #endif - s_iDevRow = row; - s_iDevCol = col; + hb_gtSetPos( row, col ); } void hb_devpos( SHORT row, SHORT col ) @@ -644,7 +651,7 @@ HARBOUR HB_SETPRC( void ) /* Sets the current printer row and column positions * } } -HARBOUR HB_SCROLL( void ) /* Scrolls a screen region (requires the GT API) */ +HARBOUR HB_SCROLL( void ) /* Scrolls a screen region */ { USHORT top, left, bottom, right; @@ -672,21 +679,7 @@ HARBOUR HB_SCROLL( void ) /* Scrolls a screen region (requires the GT API) */ else if( i_right > iMC ) right = iMC; else right = i_right; -#ifdef HARBOUR_USE_GTAPI hb_gtScroll( top, left, bottom, right, v_scroll, h_scroll ); -#else - if( top == 0 && bottom == iMR - && left == 0 && right == iMC - && v_scroll == 0 && h_scroll == 0 ) - { - USHORT uiCount; - s_iDevRow = iMR; - for( uiCount = 0; uiCount < s_iDevRow ; uiCount++ ) - fputs( s_szCrLf, stdout ); - fflush( stdout ); - s_iDevRow = s_iDevCol = 0; - } -#endif } HARBOUR HB_MAXROW( void ) /* Return the maximum screen row number (zero origin) */ @@ -701,18 +694,22 @@ HARBOUR HB_MAXCOL( void ) /* Return the maximum screen column number (zero origi HARBOUR HB_ROW( void ) /* Return the current screen row position (zero origin) */ { -#ifdef HARBOUR_USE_GTAPI - hb_gtGetPos( &s_iDevRow, &s_iDevCol ); -#endif - hb_retni( s_iDevRow ); + USHORT uiRow; + USHORT uiCol; + + hb_gtGetPos( &uiRow, &uiCol ); + + hb_retni( uiRow ); } HARBOUR HB_COL( void ) /* Return the current screen column position (zero origin) */ { -#ifdef HARBOUR_USE_GTAPI - hb_gtGetPos( &s_iDevRow, &s_iDevCol ); -#endif - hb_retni( s_iDevCol ); + USHORT uiRow; + USHORT uiCol; + + hb_gtGetPos( &uiRow, &uiCol ); + + hb_retni( uiCol ); } HARBOUR HB_DISPBOX( void ) @@ -922,7 +919,7 @@ HARBOUR HB_SAVESCREEN( void ) HARBOUR HB_RESTSCREEN( void ) { - if( hb_pcount() == 5 ) + if( hb_pcount() >= 5 ) { USHORT uiX; USHORT uiCoords[ 4 ]; @@ -956,10 +953,7 @@ USHORT hb_setCursor( BOOL bSetCursor, USHORT usNewCursor ) HARBOUR HB_SETCURSOR( void ) { - if( hb_pcount() == 1 && ISNUM( 1 ) ) - hb_retni( hb_setCursor( TRUE, hb_parni( 1 ) ) ); - else - hb_retni( hb_setCursor( FALSE, 0 ) ); + hb_retni( hb_setCursor( ISNUM( 1 ), hb_parni( 1 ) ) ); } HARBOUR HB_SETBLINK( void ) @@ -979,18 +973,21 @@ HARBOUR HB_SETMODE( void ) ISNUM( 2 ) ? hb_parni( 2 ) : ( hb_gtMaxCol() + 1 ) ) == 0 ); } -HARBOUR HB___ACCEPT( void ) /* Internal Clipper function used in ACCEPT command */ - /* Basically the simplest Clipper function to */ - /* receive data. Parameter : cPrompt. Returns : cRet */ +/* Internal Clipper function used in ACCEPT command */ +/* Basically the simplest Clipper function to */ +/* receive data. Parameter : cPrompt. Returns : cRet */ + +HARBOUR HB___ACCEPT( void ) { int input; ULONG ulLen; - if( hb_pcount() >= 1 ) /* cPrompt passed */ + if( hb_pcount() >= 1 ) /* cPrompt passed */ HB_QOUT(); ulLen = 0; input = 0; + while( input != K_ENTER ) { /* Wait forever, for keyboard events only */ @@ -1021,7 +1018,9 @@ HARBOUR HB___ACCEPT( void ) /* Internal Clipper function used in ACCEPT command } } } + s_szAcceptResult[ ulLen ] = '\0'; + hb_retc( s_szAcceptResult ); } @@ -1030,10 +1029,6 @@ HARBOUR HB___ACCEPTSTR( void ) hb_retc( s_szAcceptResult ); } -/* --------------------------------------------------------- */ -/* Copyright (C) 1999-2000 Victor Szakats */ -/* --------------------------------------------------------- */ - HARBOUR HB_HB_COLORINDEX( void ) { if( ISCHAR( 1 ) && ISNUM( 2 ) ) diff --git a/harbour/source/rtl/gt/gt_tpl.c b/harbour/source/rtl/gt/gt_tpl.c index e74d171c8a..2bc80e937f 100644 --- a/harbour/source/rtl/gt/gt_tpl.c +++ b/harbour/source/rtl/gt/gt_tpl.c @@ -53,6 +53,15 @@ void hb_gt_Done( void ) /* TODO: */ } +int hb_gt_ReadKey( void ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_gt_ReadKey()")); + + /* TODO: */ + + return 0; +} + BOOL hb_gt_IsColor( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_IsColor()")); diff --git a/harbour/source/rtl/gt/gtdos.c b/harbour/source/rtl/gt/gtdos.c index d9391361f9..f568de5844 100644 --- a/harbour/source/rtl/gt/gtdos.c +++ b/harbour/source/rtl/gt/gtdos.c @@ -169,6 +169,15 @@ void hb_gt_Done( void ) #endif } +int hb_gt_ReadKey( void ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_gt_ReadKey()")); + + /* TODO: */ + + return 0; +} + BOOL hb_gt_IsColor( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_IsColor()")); diff --git a/harbour/source/rtl/gt/gtos2.c b/harbour/source/rtl/gt/gtos2.c index c73113ff4d..01561c903e 100644 --- a/harbour/source/rtl/gt/gtos2.c +++ b/harbour/source/rtl/gt/gtos2.c @@ -67,6 +67,15 @@ void hb_gt_Done( void ) /* TODO: */ } +int hb_gt_ReadKey( void ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_gt_ReadKey()")); + + /* TODO: */ + + return 0; +} + BOOL hb_gt_IsColor( void ) { /* Chen Kedem */ diff --git a/harbour/source/rtl/gt/gtsln.c b/harbour/source/rtl/gt/gtsln.c index d5553d8693..9cd8782ee3 100644 --- a/harbour/source/rtl/gt/gtsln.c +++ b/harbour/source/rtl/gt/gtsln.c @@ -61,6 +61,15 @@ void hb_gt_Done( void ) SLang_reset_tty(); } +int hb_gt_ReadKey( void ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_gt_ReadKey()")); + + /* TODO: */ + + return 0; +} + BOOL hb_gt_IsColor( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_IsColor()")); diff --git a/harbour/source/rtl/gt/gtstd.c b/harbour/source/rtl/gt/gtstd.c index 73d05fe4cd..6817fe04cc 100644 --- a/harbour/source/rtl/gt/gtstd.c +++ b/harbour/source/rtl/gt/gtstd.c @@ -67,6 +67,15 @@ void hb_gt_Done( void ) HB_TRACE(HB_TR_DEBUG, ("hb_gt_Done()")); } +int hb_gt_ReadKey( void ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_gt_ReadKey()")); + + /* TODO: */ + + return 0; +} + BOOL hb_gt_IsColor( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_IsColor()")); @@ -178,13 +187,21 @@ void hb_gt_Scroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, /* TODO: */ - HB_SYMBOL_UNUSED( uiTop ); - HB_SYMBOL_UNUSED( uiLeft ); - HB_SYMBOL_UNUSED( uiBottom ); - HB_SYMBOL_UNUSED( uiRight ); - HB_SYMBOL_UNUSED( byAttr ); - HB_SYMBOL_UNUSED( iRows ); - HB_SYMBOL_UNUSED( iCols ); + if( uiTop == 0 && + uiBottom == s_uiMaxRow && + uiLeft == 0 && + uiRight == s_uiMaxCol && + iRows == 0 && + iCols == 0 ) + { + for( ; uiBottom; uiBottom-- ) + fputs( s_szCrLf, stdout ); + + fflush( stdout ); + + s_iRow = 0; + s_iCol = 0; + } } void hb_gt_DispBegin( void ) @@ -235,10 +252,3 @@ void hb_gt_SetBlink( BOOL bBlink ) s_bBlink = bBlink; } -#if defined(OS_UNIX_COMPATIBLE) -int hb_gt_ReadKey( void ) -{ - return 0; -} -#endif - diff --git a/harbour/source/rtl/gt/gtwin.c b/harbour/source/rtl/gt/gtwin.c index f63c8b9794..21017801e0 100644 --- a/harbour/source/rtl/gt/gtwin.c +++ b/harbour/source/rtl/gt/gtwin.c @@ -193,6 +193,8 @@ void hb_gt_Done( void ) it with the current image before quitting. */ /* easy fix ;-) */ + + /* TOFIX: Violation of API calling rules! */ hb_gtDispBegin(); /* must use these versions ! */ hb_gtDispEnd(); } @@ -214,6 +216,15 @@ void hb_gt_Done( void ) SetConsoleCtrlHandler( hb_gt_CtrlHandler, FALSE ); } +int hb_gt_ReadKey( void ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_gt_ReadKey()")); + + /* TODO: */ + + return 0; +} + BOOL hb_gt_IsColor( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_IsColor()")); @@ -520,6 +531,8 @@ void hb_gt_DispBegin( void ) HB_TRACE(HB_TR_DEBUG, ("hb_gt_DispBegin()")); /* ptucker */ + + /* TOFIX: Violation of API calling rules! */ if( hb_gtDispCount() == 1 ) { COORD coDest = { 0, 0 }; @@ -570,6 +583,7 @@ void hb_gt_DispEnd( void ) /* ptucker */ + /* TOFIX: Violation of API calling rules! */ if( hb_gtDispCount() == 1 ) { s_HOutput = s_HInactive; @@ -697,6 +711,8 @@ void hb_gt_DebugScreen( BOOL bActivate ) } s_HOsave = s_HOutput; s_HOutput = s_HActive = s_HDOutput; + + /* TOFIX: Violation of API calling rules! */ hb_gtDispBegin(); hb_gtDispEnd(); } diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index 09c0fd0527..f5b74ec3e8 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -170,11 +170,7 @@ int hb_gtReadKey( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_gtReadKey()")); -#if defined(OS_UNIX_COMPATIBLE) return hb_gt_ReadKey(); -#else - return 0; -#endif } USHORT hb_gtBox( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE * pbyFrame ) diff --git a/harbour/source/rtl/mouseapi.c b/harbour/source/rtl/mouseapi.c index 465cc1e7f0..f0a7dc6a92 100644 --- a/harbour/source/rtl/mouseapi.c +++ b/harbour/source/rtl/mouseapi.c @@ -49,10 +49,6 @@ #include "hbapimou.h" #include "hbapigt.h" -/* TODO: This level should make sure that if there's no mouse present - the functions don't call the low level function, but return some - default values. [vszakats] */ - static BOOL s_bPresent; static BOOL s_bVisible; static USHORT s_uiDoubleClickSpeed; /* In milliseconds */ @@ -233,9 +229,13 @@ HARBOUR HB_MSAVESTATE( void ) int iTop, iLeft, iBottom, iRight; USHORT uiPos; - USHORT uiLen = sizeof( int ) * 2 + + USHORT uiLen = sizeof( int ) + + sizeof( int ) + sizeof( BOOL ) + - sizeof( int ) * 4; + sizeof( int ) + + sizeof( int ) + + sizeof( int ) + + sizeof( int ); BYTE * pBuffer = ( BYTE * ) hb_xgrab( uiLen ); @@ -256,18 +256,22 @@ HARBOUR HB_MSAVESTATE( void ) uiPos += sizeof( int ); *( pBuffer + uiPos ) = iRight; - hb_retclen( (char *) pBuffer, uiLen ); + hb_retclen( ( char * ) pBuffer, uiLen ); hb_xfree( pBuffer ); } HARBOUR HB_MRESTSTATE( void ) { - ULONG ulLen = sizeof( int ) * 2 + - sizeof( BOOL ) + - sizeof( int ) * 4; + USHORT uiLen = sizeof( int ) + + sizeof( int ) + + sizeof( BOOL ) + + sizeof( int ) + + sizeof( int ) + + sizeof( int ) + + sizeof( int ); - if( ISCHAR( 1 ) && hb_parclen( 1 ) == ulLen ) + if( ISCHAR( 1 ) && hb_parclen( 1 ) == ( ULONG ) uiLen ) { int iRow, iCol; int iTop, iLeft, iBottom, iRight; diff --git a/harbour/source/runner/stdalone/hbrun.prg b/harbour/source/runner/stdalone/hbrun.prg index 5776e5385c..40fc438f80 100644 --- a/harbour/source/runner/stdalone/hbrun.prg +++ b/harbour/source/runner/stdalone/hbrun.prg @@ -40,7 +40,7 @@ FUNCTION Main( cHRBFile, cPar1, cPar2, cPar3, cPar4, cPar5, cPar6, cPar7, cPar8, IF Empty( cHRBFile ) OutStd( "Harbour Runner" + HB_OSNewLine() +; - "Copyright 1999, http://www.harbour-project.org" + HB_OSNewLine() +; + "Copyright 1999-2000, http://www.harbour-project.org" + HB_OSNewLine() +; HB_OSNewLine() +; "Syntax: hbrun [parameters]" + HB_OSNewLine() +; HB_OSNewLine() +; diff --git a/harbour/tests/Makefile b/harbour/tests/Makefile index aeb6ccaadb..39807fc940 100644 --- a/harbour/tests/Makefile +++ b/harbour/tests/Makefile @@ -119,7 +119,7 @@ PRG_SOURCES=\ statfun.prg \ statics.prg \ strdelim.prg \ - strip.prg \ + stripem.prg \ t1.prg \ test.prg \ test_all.prg \ @@ -180,11 +180,6 @@ BAD_C_SOURCES=\ include $(TOP)$(ROOT)config/test.cf -DIRS=\ - regress \ - -include $(TOP)$(ROOT)config/dir.cf - else #PM defined = build specified file ifneq ($(findstring .prg,$(PM)),) diff --git a/harbour/tests/strip.prg b/harbour/tests/stripem.prg similarity index 100% rename from harbour/tests/strip.prg rename to harbour/tests/stripem.prg diff --git a/harbour/utils/Makefile b/harbour/utils/Makefile index ab272c25a5..5acde16121 100644 --- a/harbour/utils/Makefile +++ b/harbour/utils/Makefile @@ -6,5 +6,6 @@ ROOT = ../ DIRS=\ hbdoc \ + hbtest \ include $(ROOT)config/dir.cf diff --git a/harbour/tests/regress/Makefile b/harbour/utils/hbtest/Makefile similarity index 91% rename from harbour/tests/regress/Makefile rename to harbour/utils/hbtest/Makefile index 209474a4f0..cd305fe4ff 100644 --- a/harbour/tests/regress/Makefile +++ b/harbour/utils/hbtest/Makefile @@ -9,7 +9,7 @@ endif ROOT = ../../ PRG_SOURCES=\ - rt_main.prg \ + hbtest.prg \ rt_array.prg \ rt_date.prg \ rt_file.prg \ @@ -19,7 +19,7 @@ PRG_SOURCES=\ rt_str.prg \ rt_trans.prg \ -PRG_MAIN=rt_main.prg +PRG_MAIN=hbtest.prg LIBS=\ debug \ diff --git a/harbour/tests/regress/rt_main.prg b/harbour/utils/hbtest/hbtest.prg similarity index 84% rename from harbour/tests/regress/rt_main.prg rename to harbour/utils/hbtest/hbtest.prg index d8fc6fa1ca..3fd69ed17b 100644 --- a/harbour/tests/regress/rt_main.prg +++ b/harbour/utils/hbtest/hbtest.prg @@ -53,14 +53,17 @@ #include "error.ch" #include "fileio.ch" -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_vars.ch" +#ifndef __HARBOUR__ + #xtranslate HB_OSNewLine() => ( Chr( 13 ) + Chr( 10 ) ) +#endif + STATIC s_nPass STATIC s_nFail STATIC s_cFileName STATIC s_nFhnd -STATIC s_cNewLine STATIC s_nCount STATIC s_lShowAll STATIC s_lShortcut @@ -70,7 +73,8 @@ STATIC s_nEndTime FUNCTION Main( cPar1, cPar2 ) - /* Initialize test */ + OutStd( "Harbour Regression Test Suit" + HB_OSNewLine() +; + "Copyright 1999-2000, http://www.harbour-project.org" + HB_OSNewLine() ) IF cPar1 == NIL cPar1 := "" @@ -79,6 +83,23 @@ FUNCTION Main( cPar1, cPar2 ) cPar2 := "" ENDIF + IF "/?" $ Upper( cPar1 ) .OR. ; + "/H" $ Upper( cPar1 ) .OR. ; + "-?" $ Upper( cPar1 ) .OR. ; + "-H" $ Upper( cPar1 ) + + OutStd( HB_OSNewLine() +; + "Syntax: hbtest [options]" + HB_OSNewLine() +; + HB_OSNewLine() +; + "Options: /h, /? Display this help." + HB_OSNewLine() +; + " /all Display all tests, not only the failures." + HB_OSNewLine() +; + " /skip: Skip the listed test numbers." + HB_OSNewLine() ) + + RETURN NIL + ENDIF + + /* Initialize test */ + TEST_BEGIN( cPar1 + " " + cPar2 ) Main_HVM() @@ -128,14 +149,13 @@ STATIC FUNCTION TEST_BEGIN( cParam ) s_nStartTime := Seconds() -#ifdef __HARBOUR__ - s_cNewLine := HB_OSNewLine() -#else - s_cNewLine := Chr( 13 ) + Chr( 10 ) -#endif + s_lShowAll := "/ALL" $ Upper( cParam ) .OR. ; + "-ALL" $ Upper( cParam ) - s_lShowAll := "/ALL" $ Upper( cParam ) s_aSkipList := ListToNArray( CMDLGetValue( Upper( cParam ), "/SKIP:", "" ) ) + IF Empty( s_aSkipList ) + s_aSkipList := ListToNArray( CMDLGetValue( Upper( cParam ), "-SKIP:", "" ) ) + ENDIF /* Detect presence of shortcutting optimization */ @@ -177,20 +197,21 @@ STATIC FUNCTION TEST_BEGIN( cParam ) /* NOTE: The 0 parameter of Version() will force Harbour to include the compiler version in the version string. */ - FWrite( s_nFhnd, " Version: " + Version( 0 ) + s_cNewLine +; - " OS: " + OS() + s_cNewLine +; - " Date, Time: " + DToS( Date() ) + " " + Time() + s_cNewLine +; - " Output: " + s_cFileName + s_cNewLine +; - "Shortcut opt.: " + iif( s_lShortcut, "ON", "OFF" ) + s_cNewLine +; - " Switches: " + cParam + s_cNewLine +; - "===========================================================================" + s_cNewLine ) + FWrite( s_nFhnd, "---------------------------------------------------------------------------" + HB_OSNewLine() +; + " Version: " + Version( 0 ) + HB_OSNewLine() +; + " OS: " + OS() + HB_OSNewLine() +; + " Date, Time: " + DToS( Date() ) + " " + Time() + HB_OSNewLine() +; + " Output: " + s_cFileName + HB_OSNewLine() +; + "Shortcut opt.: " + iif( s_lShortcut, "ON", "OFF" ) + HB_OSNewLine() +; + " Switches: " + cParam + HB_OSNewLine() +; + "===========================================================================" + HB_OSNewLine() ) FWrite( s_nFhnd, PadR( "R", TEST_RESULT_COL1_WIDTH ) + " " +; - PadR( "Line", TEST_RESULT_COL2_WIDTH ) + " " +; + PadR( "No. Line", TEST_RESULT_COL2_WIDTH ) + " " +; PadR( "TestCall()", TEST_RESULT_COL3_WIDTH ) + " -> " +; PadR( "Result", TEST_RESULT_COL4_WIDTH ) + " | " +; - PadR( "Expected", TEST_RESULT_COL5_WIDTH ) + s_cNewLine +; - "---------------------------------------------------------------------------" + s_cNewLine ) + PadR( "Expected", TEST_RESULT_COL5_WIDTH ) + HB_OSNewLine() +; + "---------------------------------------------------------------------------" + HB_OSNewLine() ) /* NOTE: mxNotHere intentionally not declared */ PUBLIC mcLongerNameThen10Chars := "Long String Name!" @@ -301,13 +322,13 @@ FUNCTION TEST_CALL( cBlock, bBlock, xResultExpected ) ENDIF IF s_lShowAll .OR. lFailed .OR. lSkipped .OR. lPPError + FWrite( s_nFhnd, PadR( iif( lFailed, "!", iif( lSkipped, "S", " " ) ), TEST_RESULT_COL1_WIDTH ) + " " +; - PadR( ProcName( 1 ) + "(" + LTrim( Str( ProcLine( 1 ), 5 ) ) + ")", TEST_RESULT_COL2_WIDTH ) + " " +; + PadR( Str( s_nCount, 4 ) + " " + ProcName( 1 ) + "(" + LTrim( Str( ProcLine( 1 ), 5 ) ) + ")", TEST_RESULT_COL2_WIDTH ) + " " +; PadR( cBlock, TEST_RESULT_COL3_WIDTH ) + " -> " +; PadR( XToStr( xResult ), TEST_RESULT_COL4_WIDTH ) + " | " +; - PadR( XToStr( xResultExpected ), TEST_RESULT_COL5_WIDTH ) ) - - FWrite( s_nFhnd, s_cNewLine ) + PadR( XToStr( xResultExpected ), TEST_RESULT_COL5_WIDTH ) +; + HB_OSNewLine() ) ENDIF @@ -331,20 +352,20 @@ STATIC FUNCTION TEST_END() s_nEndTime := Seconds() - FWrite( s_nFhnd, "===========================================================================" + s_cNewLine +; - "Test calls passed: " + Str( s_nPass ) + s_cNewLine +; - "Test calls failed: " + Str( s_nFail ) + s_cNewLine +; - " ----------" + s_cNewLine +; + FWrite( s_nFhnd, "===========================================================================" + HB_OSNewLine() +; + "Test calls passed: " + Str( s_nPass ) + HB_OSNewLine() +; + "Test calls failed: " + Str( s_nFail ) + HB_OSNewLine() +; + " ----------" + HB_OSNewLine() +; " Total: " + Str( s_nPass + s_nFail ) +; - " ( Time elapsed: " + LTrim( Str( s_nEndTime - s_nStartTime ) ) + " seconds )" + s_cNewLine +; - s_cNewLine ) + " ( Time elapsed: " + LTrim( Str( s_nEndTime - s_nStartTime ) ) + " seconds )" + HB_OSNewLine() +; + HB_OSNewLine() ) IF s_nFail != 0 IF "CLIPPER (R)" $ Upper( Version() ) - FWrite( s_nFhnd, "WARNING ! Failures detected using CA-Clipper." + s_cNewLine +; - "Please fix those expected results which are not bugs in CA-Clipper itself." + s_cNewLine ) + FWrite( s_nFhnd, "WARNING ! Failures detected using CA-Clipper." + HB_OSNewLine() +; + "Please fix those expected results which are not bugs in CA-Clipper itself." + HB_OSNewLine() ) ELSE - FWrite( s_nFhnd, "WARNING ! Failures detected" + s_cNewLine ) + FWrite( s_nFhnd, "WARNING ! Failures detected" + HB_OSNewLine() ) ENDIF ENDIF @@ -489,5 +510,6 @@ FUNCTION SToD( cDate ) #endif #endif -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_init.ch" + diff --git a/harbour/tests/regress/make_c5x.bat b/harbour/utils/hbtest/make_c5x.bat similarity index 71% rename from harbour/tests/regress/make_c5x.bat rename to harbour/utils/hbtest/make_c5x.bat index 6619781557..f97c57b744 100644 --- a/harbour/tests/regress/make_c5x.bat +++ b/harbour/utils/hbtest/make_c5x.bat @@ -3,7 +3,7 @@ rem rem $Id$ rem -clipper rt_main.prg /w /n +clipper hbtest.prg /w /n clipper rt_array.prg /w /n clipper rt_date.prg /w /n clipper rt_file.prg /w /n @@ -16,6 +16,6 @@ clipper rt_trans.prg /w /n if "%1"=="" set _=rtlink if not "%1"=="" set _=exospace -%_% out rt_main fi rt_main, rt_array, rt_date, rt_file, rt_hvm, rt_math, rt_misc, rt_str, rt_trans +%_% out hbtest fi hbtest, rt_array, rt_date, rt_file, rt_hvm, rt_math, rt_misc, rt_str, rt_trans del *.obj diff --git a/harbour/tests/regress/rt_array.prg b/harbour/utils/hbtest/rt_array.prg similarity index 99% rename from harbour/tests/regress/rt_array.prg rename to harbour/utils/hbtest/rt_array.prg index 4834f9f2f2..3291fdaed3 100644 --- a/harbour/tests/regress/rt_array.prg +++ b/harbour/utils/hbtest/rt_array.prg @@ -35,7 +35,7 @@ #include "rt_main.ch" -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_vars.ch" FUNCTION Main_ARRAY() @@ -360,5 +360,5 @@ STATIC FUNCTION TAStr( aArray ) RETURN cString -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_init.ch" diff --git a/harbour/tests/regress/rt_date.prg b/harbour/utils/hbtest/rt_date.prg similarity index 98% rename from harbour/tests/regress/rt_date.prg rename to harbour/utils/hbtest/rt_date.prg index dadb9d009a..724ef08e95 100644 --- a/harbour/tests/regress/rt_date.prg +++ b/harbour/utils/hbtest/rt_date.prg @@ -35,7 +35,7 @@ #include "rt_main.ch" -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_vars.ch" FUNCTION Main_DATE() @@ -176,5 +176,5 @@ FUNCTION Main_DATE() RETURN NIL -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_init.ch" diff --git a/harbour/tests/regress/rt_file.prg b/harbour/utils/hbtest/rt_file.prg similarity index 99% rename from harbour/tests/regress/rt_file.prg rename to harbour/utils/hbtest/rt_file.prg index 7bc94e2b27..5f390784cb 100644 --- a/harbour/tests/regress/rt_file.prg +++ b/harbour/utils/hbtest/rt_file.prg @@ -37,7 +37,7 @@ #include "fileio.ch" -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_vars.ch" /* NOTE: The order of the tests is relevant here, so don't @@ -186,5 +186,5 @@ FUNCTION Main_FILE() STATIC FUNCTION TESTFIER( xRetVal ) RETURN PadR( "E: " + LTrim( Str( FError() ) ), 9 ) + " R: " + XToStr( xRetVal ) -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_init.ch" diff --git a/harbour/tests/regress/rt_hvm.prg b/harbour/utils/hbtest/rt_hvm.prg similarity index 99% rename from harbour/tests/regress/rt_hvm.prg rename to harbour/utils/hbtest/rt_hvm.prg index 50416f6f27..bfb5c38695 100644 --- a/harbour/tests/regress/rt_hvm.prg +++ b/harbour/utils/hbtest/rt_hvm.prg @@ -35,7 +35,7 @@ #include "rt_main.ch" -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_vars.ch" FUNCTION Main_HVM() @@ -917,5 +917,5 @@ FUNCTION Main_HVM() RETURN NIL -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_init.ch" diff --git a/harbour/tests/regress/rt_init.ch b/harbour/utils/hbtest/rt_init.ch similarity index 100% rename from harbour/tests/regress/rt_init.ch rename to harbour/utils/hbtest/rt_init.ch diff --git a/harbour/tests/regress/rt_main.ch b/harbour/utils/hbtest/rt_main.ch similarity index 100% rename from harbour/tests/regress/rt_main.ch rename to harbour/utils/hbtest/rt_main.ch diff --git a/harbour/tests/regress/rt_math.prg b/harbour/utils/hbtest/rt_math.prg similarity index 99% rename from harbour/tests/regress/rt_math.prg rename to harbour/utils/hbtest/rt_math.prg index 403c39c68d..9fd4ab4c1b 100644 --- a/harbour/tests/regress/rt_math.prg +++ b/harbour/utils/hbtest/rt_math.prg @@ -35,7 +35,7 @@ #include "rt_main.ch" -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_vars.ch" FUNCTION Main_MATH() @@ -375,5 +375,5 @@ FUNCTION Main_MATH() RETURN NIL -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_init.ch" diff --git a/harbour/tests/regress/rt_misc.prg b/harbour/utils/hbtest/rt_misc.prg similarity index 99% rename from harbour/tests/regress/rt_misc.prg rename to harbour/utils/hbtest/rt_misc.prg index 74a97586a2..458be35a03 100644 --- a/harbour/tests/regress/rt_misc.prg +++ b/harbour/utils/hbtest/rt_misc.prg @@ -35,7 +35,7 @@ #include "rt_main.ch" -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_vars.ch" FUNCTION Main_MISC() @@ -777,5 +777,5 @@ STATIC FUNCTION TESTFNAME( cFull ) #endif -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_init.ch" diff --git a/harbour/tests/regress/rt_str.prg b/harbour/utils/hbtest/rt_str.prg similarity index 99% rename from harbour/tests/regress/rt_str.prg rename to harbour/utils/hbtest/rt_str.prg index b416b47a03..50c0a8a19f 100644 --- a/harbour/tests/regress/rt_str.prg +++ b/harbour/utils/hbtest/rt_str.prg @@ -35,7 +35,7 @@ #include "rt_main.ch" -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_vars.ch" FUNCTION Main_STR() @@ -1061,5 +1061,5 @@ FUNCTION Long_STRINGS() #endif -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_init.ch" diff --git a/harbour/tests/regress/rt_trans.prg b/harbour/utils/hbtest/rt_trans.prg similarity index 99% rename from harbour/tests/regress/rt_trans.prg rename to harbour/utils/hbtest/rt_trans.prg index 5590a72142..f13dba7cb9 100644 --- a/harbour/tests/regress/rt_trans.prg +++ b/harbour/utils/hbtest/rt_trans.prg @@ -35,7 +35,7 @@ #include "rt_main.ch" -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_vars.ch" FUNCTION Main_TRANS() @@ -460,5 +460,5 @@ FUNCTION Main_TRANS() RETURN NIL -/* Don't change the order or place of this #include. */ +/* Don't change the position of this #include. */ #include "rt_init.ch" diff --git a/harbour/tests/regress/rt_vars.ch b/harbour/utils/hbtest/rt_vars.ch similarity index 100% rename from harbour/tests/regress/rt_vars.ch rename to harbour/utils/hbtest/rt_vars.ch