From 140943da2e557dc7928a0f729efc41614bf753fa Mon Sep 17 00:00:00 2001 From: "David G. Holm" Date: Wed, 9 Jun 1999 18:06:06 +0000 Subject: [PATCH] See ChangeLog entry 19990609-12:55 EDT David G. Holm --- harbour/ChangeLog | 62 ++++++++++++++++++++ harbour/source/rtl/files.c | 3 + harbour/source/tools/asciisum.c | 6 +- harbour/source/tools/ascpos.c | 6 +- harbour/source/tools/atdiff.c | 6 +- harbour/source/tools/chareven.c | 6 +- harbour/source/tools/charmix.c | 6 +- harbour/source/tools/charodd.c | 6 +- harbour/source/tools/chrcount.c | 7 ++- harbour/source/tools/chrfirst.c | 6 +- harbour/source/tools/chrtotal.c | 6 +- harbour/source/tools/hb_f.c | 25 ++++---- harbour/source/tools/strcount.c | 6 +- harbour/source/tools/strcspn.c | 6 +- harbour/source/tools/strdiff.c | 6 +- harbour/source/tools/strexpan.c | 6 +- harbour/source/tools/strleft.c | 6 +- harbour/source/tools/strpbrk.c | 6 +- harbour/source/tools/strright.c | 6 +- harbour/tests/working/spawn2.prg | 1 + harbour/tests/working/test_all.prg | 93 +++++++++++++++--------------- 21 files changed, 190 insertions(+), 91 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d0bc2f4563..1aa0b495ae 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,65 @@ +19990609-12:55 EDT David G. Holm + * source/rtl/files.c + - Set _fmode to O_BINARY before using creat(), + then restore to previous value afterwards + * source/tools/asciisum.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/ascpos.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/atdiff.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/chareven.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/charmix.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/charodd.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/chrcount.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/chrfirst.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/chrtotal.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/hb_f.c + - HARBOUR function names must be in upper case + * source/tools/strcount.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/strcspn.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/strdiff.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/strexpan.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/strleft.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/strpbrk.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * source/tools/strright.c + - HARBOUR function names must be in upper case + - HARBOUR functions must have a void argument list + * tests/working/spawn2.prg + - Added //NOTEST + * tests/working/test_all.prg + - Made compiler independent + - Added restart capability + - Renamed created batch file to TESTALL.BAT, so that it can be run + without having to include the .BAT extenstion. + 19990609-11:25 EDT David G. Holm * source/rtl/set.c - Removed "+ 1" in setting y_stop to default stop point, because it diff --git a/harbour/source/rtl/files.c b/harbour/source/rtl/files.c index f7185dfb60..83791b17cf 100644 --- a/harbour/source/rtl/files.c +++ b/harbour/source/rtl/files.c @@ -207,7 +207,10 @@ int _fsOpen( char * name, int flags ) int _fsCreate( char * name, int flags ) { #if defined(HAVE_POSIX_IO) + int old_fmode = _fmode; + _fmode = O_BINARY; return creat(name,convert_create_flags(flags)); + _fmode = old_fmode; #else return 0; #endif diff --git a/harbour/source/tools/asciisum.c b/harbour/source/tools/asciisum.c index 6b86580918..fcdcf3bb17 100644 --- a/harbour/source/tools/asciisum.c +++ b/harbour/source/tools/asciisum.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.2 1999/06/09 18:06:03 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.1 1999/06/02 06:49:38 ajahja * Adding GT Library * @@ -45,8 +48,7 @@ #include -HARBOUR -GT_asciisum() +HARBOUR GT_ASCIISUM( void ) { char *str; int len, i; diff --git a/harbour/source/tools/ascpos.c b/harbour/source/tools/ascpos.c index 79be33058d..fb40e87cf6 100644 --- a/harbour/source/tools/ascpos.c +++ b/harbour/source/tools/ascpos.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.2 1999/06/09 18:06:03 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.1 1999/06/02 06:21:33 ajahja * Adding GT Library * @@ -57,8 +60,7 @@ #include -HARBOUR -gt_ascpos() +HARBOUR GT_ASCPOS( void ) { char *s; int p; diff --git a/harbour/source/tools/atdiff.c b/harbour/source/tools/atdiff.c index ab40951994..361c93dfaf 100644 --- a/harbour/source/tools/atdiff.c +++ b/harbour/source/tools/atdiff.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.2 1999/06/09 18:06:03 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.1 1999/06/02 06:18:45 ajahja * Adding GT Library * @@ -55,8 +58,7 @@ #include -HARBOUR -gt_atdiff() +HARBOUR GT_ATDIFF( void ) { char *s1, *s2; int pos, len; diff --git a/harbour/source/tools/chareven.c b/harbour/source/tools/chareven.c index 9e4565a458..8e20a33225 100644 --- a/harbour/source/tools/chareven.c +++ b/harbour/source/tools/chareven.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.3 1999/06/09 18:06:03 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.2 1999/06/02 19:53:28 dholm * See ChangeLog entry 19990602-14:50 EDT David G. Holm * @@ -54,8 +57,7 @@ #include -HARBOUR -gt_charEven() +HARBOUR GT_CHAREVEN( void ) { char *s1, *s2; int len, i; diff --git a/harbour/source/tools/charmix.c b/harbour/source/tools/charmix.c index 7dbb3aeab6..890f4d2cde 100644 --- a/harbour/source/tools/charmix.c +++ b/harbour/source/tools/charmix.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.3 1999/06/09 18:06:04 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.2 1999/06/02 19:53:28 dholm * See ChangeLog entry 19990602-14:50 EDT David G. Holm * @@ -58,8 +61,7 @@ #include -HARBOUR -gt_charMix() +HARBOUR GT_CHARMIX( void ) { char *s1, *s2, *s3; int l1, l2, i, pos; diff --git a/harbour/source/tools/charodd.c b/harbour/source/tools/charodd.c index 6321124f92..64b98c400a 100644 --- a/harbour/source/tools/charodd.c +++ b/harbour/source/tools/charodd.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.3 1999/06/09 18:06:04 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.2 1999/06/02 19:53:28 dholm * See ChangeLog entry 19990602-14:50 EDT David G. Holm * @@ -54,8 +57,7 @@ #include -HARBOUR -GT_charOdd() +HARBOUR GT_CHARODD( void ) { char *s1, *s2; int len, i; diff --git a/harbour/source/tools/chrcount.c b/harbour/source/tools/chrcount.c index 9f8e3c25d5..99d1f97ac0 100644 --- a/harbour/source/tools/chrcount.c +++ b/harbour/source/tools/chrcount.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.2 1999/06/09 18:06:04 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.1 1999/06/02 06:49:38 ajahja * Adding GT Library * @@ -52,9 +55,7 @@ #include -HARBOUR - -gt_chrcount() +HARBOUR GT_CHRCOUNT( void ) { char *s1, *s2; int count, pos2, len; diff --git a/harbour/source/tools/chrfirst.c b/harbour/source/tools/chrfirst.c index 92c567dc01..f1dad603cf 100644 --- a/harbour/source/tools/chrfirst.c +++ b/harbour/source/tools/chrfirst.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.2 1999/06/09 18:06:04 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.1 1999/06/02 06:49:38 ajahja * Adding GT Library * @@ -51,8 +54,7 @@ #include -HARBOUR -GT_ChrFirst() +HARBOUR GT_CHRFIRST( void ) { char *string; char *cset; diff --git a/harbour/source/tools/chrtotal.c b/harbour/source/tools/chrtotal.c index 656cb3411f..0ee03410c4 100644 --- a/harbour/source/tools/chrtotal.c +++ b/harbour/source/tools/chrtotal.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.2 1999/06/09 18:06:04 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.1 1999/06/02 06:49:39 ajahja * Adding GT Library * @@ -56,8 +59,7 @@ #include -HARBOUR -gt_chrtotal() +HARBOUR GT_CHRTOTAL( void ) { char *s1, *s2; int count, p1, p2, l2, l1; diff --git a/harbour/source/tools/hb_f.c b/harbour/source/tools/hb_f.c index b7f1731c20..5d02eabebb 100644 --- a/harbour/source/tools/hb_f.c +++ b/harbour/source/tools/hb_f.c @@ -1,5 +1,6 @@ - /* + * $Id$ + nanforum ft_f*() clones * hb_fuse * hb_frecno @@ -35,7 +36,7 @@ static long last_off[10]; static long lastbyte[10]; static int isEof[10]; -HARBOUR hb_fuse( void ) +HARBOUR HB_FUSE( void ) { @@ -74,14 +75,14 @@ HARBOUR hb_fuse( void ) } -HARBOUR hb_frecno( void ) +HARBOUR HB_FRECNO( void ) { _retnl( recno[area] ); } -HARBOUR hb_fskip( void ) +HARBOUR HB_FSKIP( void ) { @@ -166,7 +167,7 @@ long _hbfskip( int recs ) return ( recno[area] ); } -HARBOUR hb_freadln( void ) +HARBOUR HB_FREADLN( void ) { @@ -187,7 +188,7 @@ HARBOUR hb_freadln( void ) } -HARBOUR hb_feof( void ) +HARBOUR HB_FEOF( void ) { @@ -195,7 +196,7 @@ HARBOUR hb_feof( void ) } -HARBOUR hb_fgoto ( void ) +HARBOUR HB_FGOTO( void ) { @@ -223,7 +224,7 @@ HARBOUR hb_fgoto ( void ) } } -HARBOUR hb_fgobottom() +HARBOUR HB_FGOBOTTOM() { @@ -262,7 +263,7 @@ HARBOUR hb_fgobottom() } } -HARBOUR hb_fgotop( void ) +HARBOUR HB_FGOTOP( void ) { offset[area] = 0L; @@ -270,7 +271,7 @@ HARBOUR hb_fgotop( void ) } -HARBOUR hb_flastrec( void ) +HARBOUR HB_FLASTREC( void ) { long old_rec; @@ -279,7 +280,7 @@ HARBOUR hb_flastrec( void ) old_rec = recno[area]; old_offset = offset[area]; - hb_fgobottom(); + HB_FGOBOTTOM(); _retnl( last_rec[area] ); recno[area] = old_rec; @@ -288,7 +289,7 @@ HARBOUR hb_flastrec( void ) } -HARBOUR hb_fselect( void ) +HARBOUR HB_FSELECT( void ) { diff --git a/harbour/source/tools/strcount.c b/harbour/source/tools/strcount.c index e7f1b3ec33..8c1bd680d3 100644 --- a/harbour/source/tools/strcount.c +++ b/harbour/source/tools/strcount.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.2 1999/06/09 18:06:05 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.1 1999/06/02 06:49:39 ajahja * Adding GT Library * @@ -56,8 +59,7 @@ #include -HARBOUR -gt_strcount() +HARBOUR GT_STRCOUNT( void ) { char *s1, *s2; int count, p1, p2, l1, l2; diff --git a/harbour/source/tools/strcspn.c b/harbour/source/tools/strcspn.c index 3382f7ad8f..509680bf3c 100644 --- a/harbour/source/tools/strcspn.c +++ b/harbour/source/tools/strcspn.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.2 1999/06/09 18:06:05 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.1 1999/06/02 06:49:39 ajahja * Adding GT Library * @@ -51,8 +54,7 @@ #include -HARBOUR -gt_strcspn() +HARBOUR GT_STRCSPN( void ) { char *string; char *cset; diff --git a/harbour/source/tools/strdiff.c b/harbour/source/tools/strdiff.c index c63c9d9560..89080b7b82 100644 --- a/harbour/source/tools/strdiff.c +++ b/harbour/source/tools/strdiff.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.2 1999/06/09 18:06:05 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.1 1999/06/02 06:49:39 ajahja * Adding GT Library * @@ -55,8 +58,7 @@ #include -HARBOUR -GT_strdiff() +HARBOUR GT_STRDIFF( void ) { char *s1, *s2; int pos, len; diff --git a/harbour/source/tools/strexpan.c b/harbour/source/tools/strexpan.c index c3fec16f6e..d590ffc15c 100644 --- a/harbour/source/tools/strexpan.c +++ b/harbour/source/tools/strexpan.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.3 1999/06/09 18:06:05 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.2 1999/06/02 19:53:28 dholm * See ChangeLog entry 19990602-14:50 EDT David G. Holm * @@ -59,8 +62,7 @@ #include -HARBOUR -gt_strexpand() +HARBOUR GT_STREXPAND( void ) { char *in, *out; int nIns = 1; diff --git a/harbour/source/tools/strleft.c b/harbour/source/tools/strleft.c index 69eef4bac5..dee060b89a 100644 --- a/harbour/source/tools/strleft.c +++ b/harbour/source/tools/strleft.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.2 1999/06/09 18:06:05 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.1 1999/06/02 06:49:40 ajahja * Adding GT Library * @@ -57,8 +60,7 @@ #include -HARBOUR -GT_StrLeft() +HARBOUR GT_STRLEFT( void ) { char *string; char *cset; diff --git a/harbour/source/tools/strpbrk.c b/harbour/source/tools/strpbrk.c index 15dc3310e4..b10da6f625 100644 --- a/harbour/source/tools/strpbrk.c +++ b/harbour/source/tools/strpbrk.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.2 1999/06/09 18:06:06 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.1 1999/06/02 06:49:40 ajahja * Adding GT Library * @@ -53,8 +56,7 @@ #include -HARBOUR -GT_strpbrk() +HARBOUR GT_STRPBRK( void ) { char *string; char *cset; diff --git a/harbour/source/tools/strright.c b/harbour/source/tools/strright.c index b73ece265f..8afe9fc56e 100644 --- a/harbour/source/tools/strright.c +++ b/harbour/source/tools/strright.c @@ -16,6 +16,9 @@ * --------------------- * * $Log$ + * Revision 1.2 1999/06/09 18:06:06 dholm + * See ChangeLog entry 19990609-12:55 EDT David G. Holm + * * Revision 1.1 1999/06/02 06:49:40 ajahja * Adding GT Library * @@ -57,8 +60,7 @@ #include -HARBOUR -GT_StrRight() +HARBOUR GT_STRRIGHT( void ) { char *string; char *cset; diff --git a/harbour/tests/working/spawn2.prg b/harbour/tests/working/spawn2.prg index f3c89bdef9..948a6af15f 100644 --- a/harbour/tests/working/spawn2.prg +++ b/harbour/tests/working/spawn2.prg @@ -1,3 +1,4 @@ +//NOTEST // // Spawn2 called from Spawn // diff --git a/harbour/tests/working/test_all.prg b/harbour/tests/working/test_all.prg index 8c38019aa9..8e84024d57 100644 --- a/harbour/tests/working/test_all.prg +++ b/harbour/tests/working/test_all.prg @@ -1,64 +1,65 @@ //NOTEST // AutoMatic Test Bank -// Patrick Mast -// For 32 bits Borland Compiler. - -// Sorry, only clipper compile (I want this thing Compiled in Harbour!, So give me Directory() Please...) +// Patrick Mast and David G. Holm +// Compiler independent, but not platform independent (creates a DOS style batch file). +// Specify the hbxxx batch file name to use to build with on the command line. +// Defaults to HB32. +// The TESTALL.BAT batch file has restart capability. For example, if there is an error +// in testgt.prg, find and fix the problem, then restart by running "TESTALL TESTGT". Function Main( cOption ) -LOCAL aDir,f,o,cRead +LOCAL aDir,f,n,o,p,cRead -aDir:=Directory("*.PRG") + aDir:=Directory("*.PRG") + o=fCreate("TestAll.Bat") + IF Empty( cOption ) + cOption:="HB32" + ELSEIF Upper( cOption ) == "HRB" + fWrite(o,"del test_all.out"+chr(13)+chr(10)) + ENDIF -o=fCreate("Test_All.Bat") -IF !Empty( cOption ) .and. Upper( cOption ) == "HRB" - fWrite(o,"del test_all.out"+chr(13)+chr(10)) -ENDIF + fWrite(o,"if not .%1==. goto %1" + Chr(13) + Chr(10)) -FOR f=1 TO Len(aDir) - IF TestIt(aDir[f][1]) - IF !Empty( cOption ) .and. Upper( cOption ) == "HRB" - fWrite(o,; - "..\..\bin\harbour "+aDir[f][1]+" /n /gHRB /i..\..\include >> test_all.out"+Chr(13)+Chr(10)+; - "if errorlevel 1 goto end"+Chr(13)+Chr(10)+; - "runner "+Left(aDir[f][1],Len(aDir[f][1])-4)+".hrb >> test_all.out"+Chr(13)+Chr(10) ) - ELSE - fWrite(o,; - "..\..\bin\harbour "+aDir[f][1]+" /n /i..\..\include"+Chr(13)+Chr(10)+; - "if errorlevel 1 goto end"+Chr(13)+Chr(10)+; - "echo -O2 -e"+Left(aDir[f][1],Len(aDir[f][1])-4)+".EXE -I..\..\include ..\..\source\vm\hvm.c "+Left(aDir[f][1],Len(aDir[f][1])-4)+".C > b32.bc"+Chr(13)+Chr(10)+; - "echo ..\..\libs\b32\harbour.lib ..\..\libs\b32\terminal.lib >> b32.bc"+Chr(13)+Chr(10)+; - "bcc32 @b32.bc"+Chr(13)+Chr(10)+; - "if errorlevel 1 goto end"+Chr(13)+Chr(10)+; - "del b32.bc"+Chr(13)+Chr(10)+Chr(13)+Chr(10)) - ENDIF - ENDIF -NEXT + FOR f=1 TO Len(aDir) + IF TestIt(aDir[f][1]) + p = At(".PRG",Upper(aDir[f][1])) + IF p > 1 + n := Left(aDir[f][1],p-1) + fWrite(o,":" + n + Chr(13) + Chr(10)) + IF !Empty( cOption ) .and. Upper( cOption ) == "HRB" + fWrite(o,; + "..\..\bin\harbour "+aDir[f][1]+" /n /gHRB /i..\..\include >> test_all.out"+Chr(13)+Chr(10)+; + "if errorlevel 1 goto end"+Chr(13)+Chr(10)+; + "runner "+Left(aDir[f][1],Len(aDir[f][1])-4)+".hrb >> test_all.out"+Chr(13)+Chr(10) ) + ELSE + fWrite(o,"call " + cOption + " " + n + Chr(13) + Chr(10); + + "if errorlevel 1 goto end" + Chr(13) + Chr(10) + Chr(13) + Chr(10)) + ENDIF + ENDIF + ENDIF + NEXT -fWrite(o,":END"+Chr(13)+Chr(10)) -fWrite(o,"del b32.c"+Chr(13)+Chr(10)) -fClose(o) + fWrite(o,":END"+Chr(13)+Chr(10)) + fClose(o) RETURN NIL - - Function TestIt(cFile) LOCAL nH1,lRetu,nH2 -nH1=fOpen(cFile) -lRetu:=Upper(fReadStr(nH1,8))<>"//NOTEST" -fClose(nH1) + nH1=fOpen(cFile) + lRetu:=Upper(fReadStr(nH1,8))<>"//NOTEST" + fClose(nH1) -IF !lRetu - IF !File("NotTestd.txt") - nH2=fCreate("NotTestd.txt") - ELSE - nH2=fOpen("NotTestd.txt",1) + IF !lRetu + IF !HB_File("NotTestd.txt") + nH2=fCreate("NotTestd.txt") + ELSE + nH2=fOpen("NotTestd.txt",1) + ENDIF + fSeek(nH2,0,2) + fWrite(nH2,DtoC(Date())+" "+Time()+" "+cFile+Chr(13)+Chr(10)) + fClose(nH2) ENDIF - fSeek(nH2,0,2) - fWrite(nH2,DtoC(Date())+" "+Time()+" "+cFile+Chr(13)+Chr(10)) - fClose(nH2) -ENDIF RETURN lRetu