diff --git a/harbour/ChangeLog.txt b/harbour/ChangeLog.txt index a19dcd15cb..74d86e391c 100644 --- a/harbour/ChangeLog.txt +++ b/harbour/ChangeLog.txt @@ -10,6 +10,124 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-02-27 18:30 UTC+0100 Viktor Szakats (harbour syenar.net) + * utils/hbmk2/hbmk2.prg + ! fixed hbmk_FNameEscape() plugin API's legacy fallback + after latest patch (still untested) + ! avoid potential RTE in hbmk_PathFromWorkdirToCWD() + plugin API + ! rtlink/blinker/exospace linker script processing will + now add directories of library input files as libpaths + (as opposed to passing them as part of the libname) + ! fixed rtlink/blinker/exospace linker script processing + to convert dirseps to native ones in output + ! fixed rtlink/blinker/exospace linker script processing + to strip extension from library name and output name + (only if it's '.exe') + ! fixed to verify non-portable output extensions in more + reliable way + + * contrib/hbmisc/hb_f.c + * contrib/hbmisc/fcomma.prg + * contrib/hbmisc/hbmisc.hbx + * contrib/hbmisc/tests/hb_f.prg + * contrib/hbmisc/tests/numtxtru.prg + * contrib/hbmisc/tests/rtfclass.prg + * contrib/hbnf/fttext.c + * contrib/hbnf/tests/fttext.prg + * use constants instead of literals + ! fixed buffer over- and underrun in HB_FSELECT() + % HB_FUSE() optimized + ! fixed long time core/hbmisc function name + collision by renaming HB_FEof() inside hbmisc + to hb_FAtEof(). hbmisc code and tests changed + to use the new one. A parallel hb_FEof() in + hbmisc remains until HB_LEGACY_LEVEL4. + [INCOMPATIBLE] Update your hbmisc HB_FEOF() + call according to above, or even better change + HB_F*() calls to original FT_F*() API in hbnf. + It's the original version of this code, what + was cloned in a dumbed down version into hbmisc + when hbnf didn't exist in Harbour yet. + + * contrib/hbamf/tests/encode.prg + + updated to use hbtest instead of similar + local solution + + * contrib/hbfimage/tests/fitest.prg + % use core functions instead of local clones + ! minor output fix + + * tests/mousetst.prg + * obfuscate e-mail address in this public sample + + * website/samples/mousetst.prg.html + * website/samples/testhtml.prg.html + * website/samples/tstmacro.prg.html + * synced with code changes + + * */tests/* + * dropped 'tst'/'ts'/'test' from most + filenames inside 'tests' subdirs. 8 chars will + allow for more descriptive names than 4-5. + + do not explicitly include the original source + filename (use __FILE__ or similar) + ; List of changes, in /contrib: + /hbmisc/tests/testbbab.prg -> bubbleb.prg + /hbmisc/tests/testcall.prg -> calldll.prg + /hbmisc/tests/testhbf.prg -> hb_f.prg + /hbmisc/tests/tsstrfmt.prg -> strfmt.prg + /hbmisc/tests/twirl.prg -> twirler.prg + /hbmisc/tests/udpdstst.prg -> udpds.prg + /hbxpp/tests/testdll.prg -> dllcall.prg + /xhb/tests/testcp.prg -> copyfile.prg + /hbwin/tests/testax.prg -> activex.prg + /hbwin/tests/testcom1.prg -> serial1.prg + /hbwin/tests/testcom2.prg -> serial2.prg + /hbwin/tests/testcopy.prg -> shfileop.prg + /hbwin/tests/testdir.prg -> sysdir.prg + /hbwin/tests/testevnt.prg -> eventlog.prg + /hbwin/tests/testgdi.prg -> prngdi.prg + /hbwin/tests/testmapi.prg -> mapimail.prg + /hbwin/tests/testole.prg -> ole.prg + /hbwin/tests/testprn.prg -> prn1.prg + /hbwin/tests/testprn2.prg -> prn2.prg + /hbwin/tests/testprn3.prg -> prn3.prg + /hbwin/tests/testprn4.prg -> prn4.prg + /hbwin/tests/testreg.prg -> registry.prg + /hbwin/tests/testrpc.prg -> uuid.prg + /hbwin/tests/testsim.prg -> simwce.prg + /hbwin/tests/testsvc.prg -> service.prg + /hbwin/tests/testwmtx.prg -> mutexwin.prg + /hbzebra/tests/testcair.prg -> cairo.prg + /hbzebra/tests/testhpdf.prg -> harupdf.prg + /hbzebra/tests/testwin.prg -> wingdi.prg + /rddads/tests/testmg.prg -> manage.prg + /hbodbc/tests/odbcdemo.prg -> todbc.prg + /hbodbc/tests/testodbc.prg -> odbc.prg + /hbsqlit3/tests/hdbctest.prg -> hdbc.prg + /hbsqlit3/tests/sl3_test.prg -> demo.prg + /hbunix/tests/testdmn.prg -> daemon.prg + /hbunix/tests/testpid.prg -> getpid.prg + /hbgd/tests/bartest.prg -> barcode.prg + /hbgd/tests/barms.prg -> barcode2.prg + /hbgd/tests/gdtest.prg -> gdapi.prg + /hbgd/tests/gdtestcl.prg -> gdclass.prg + /hbgd/tests/testdpi.prg -> fontdpi.prg + /hbgd/tests/test_out.prg -> cgi.prg + /hbtip/tests/test01.prg -> httpcli.prg + /hbtip/tests/tipmime.prg -> mimetype.prg + /hbtip/tests/tiptest.prg -> tipwget.prg + /hbtip/tests/tiptime.prg -> timestmp.prg + /hbamf/tests/tstendin.prg -> test.prg + /hbfimage/tests/fitest.prg -> test.prg + /hbtpathy/tests/testtp.prg -> test.prg + /hbgs/tests/testgs.prg -> test.prg + + * contrib/hbmxml/tests/testmxml.prg + * contrib/rddads/tests/datad.prg + * minor + 2013-02-26 23:53 UTC+0100 Viktor Szakats (harbour syenar.net) * utils/hbmk2/hbmk2.prg + disable VM internals (__dbg*() API) on hbmk2/hbrun diff --git a/harbour/contrib/hbamf/tests/test.prg b/harbour/contrib/hbamf/tests/test.prg new file mode 100644 index 0000000000..6625556959 --- /dev/null +++ b/harbour/contrib/hbamf/tests/test.prg @@ -0,0 +1,44 @@ +/* + * $Id$ + */ + +#require "hbamf" +#require "hbtest" + +REQUEST HB_CODEPAGE_UTF8EX + +PROCEDURE Main() + + hb_cdpSelect( "UTF8EX" ) + + HBTEST _enc( {} ) IS "09 01 01" + HBTEST _enc( "a" ) IS "06 03 61" + HBTEST _enc( "ą" ) IS "06 05 C4 85" + HBTEST _enc( 1 ) IS "04 01" + HBTEST _enc( 1000 ) IS "04 87 68" + HBTEST _enc( 1000000 ) IS "04 BD 84 40" + HBTEST _enc( 268435455 ) IS "04 BF FF FF FF" + HBTEST _enc( 268435456 ) IS "05 41 B0 00 00 00 00 00 00" + HBTEST _enc( 268435456000 ) IS "05 42 4F 40 00 00 00 00 00" + HBTEST _enc( -1 ) IS "04 FF FF FF FF" + HBTEST _enc( 9007199254740990 ) IS "05 43 3F FF FF FF FF FF FE" + HBTEST _enc( amf3_Decode( amf3_Encode( 9007199254740990 ) ) ) IS "05 43 3F FF FF FF FF FF FE" + HBTEST _enc( 9007199254740991 ) IS "05 43 3F FF FF FF FF FF FF" + HBTEST _enc( amf3_Decode( amf3_Encode( 9007199254740991 ) ) ) IS "05 43 3F FF FF FF FF FF FF" + HBTEST _enc( 9007199254740991.00 ) IS "05 43 3F FF FF FF FF FF FF" + HBTEST _enc( 6969.69 ) IS "05 40 BB 39 B0 A3 D7 0A 3D" + HBTEST _enc( NIL ) IS "01" + HBTEST _enc( .T. ) IS "03" + HBTEST _enc( .F. ) IS "02" + HBTEST _enc( { 1, -1 } ) IS "09 05 01 04 01 04 FF FF FF FF" + HBTEST _enc( { "ONE" => 0xcafe, "TWO" => 0xbabe } ) IS "09 01 07 4F 4E 45 04 83 95 7E 07 54 57 4F 04 82 F5 3E 01" + + RETURN + +STATIC FUNCTION _enc( a ) + RETURN hb_StrToHex( amf3_Encode( a ), " " ) + +#if 0 +STATIC FUNCTION _encsum( a ) /* for longer values */ + RETURN hb_NumToHex( hb_CRC( amf3_Encode( a ) ), 4 ) +#endif diff --git a/harbour/contrib/hbamf/tests/tstendin.prg b/harbour/contrib/hbamf/tests/tstendin.prg deleted file mode 100644 index 40d57f3fe0..0000000000 --- a/harbour/contrib/hbamf/tests/tstendin.prg +++ /dev/null @@ -1,46 +0,0 @@ -/* - * $Id$ - */ - -#require "hbamf" - -REQUEST HB_CODEPAGE_UTF8EX - -#command TEST [] => _TEST( ) - -PROCEDURE Main() - - hb_cdpSelect( "UTF8EX" ) - - TEST {}, "8352" - TEST "a", "F248" - TEST "ą", "96F0" - TEST 1, "AE79" - TEST 1000, "278B" - TEST 1000000, "A752" - TEST 268435455, "4907" - TEST 268435456, "E677" - TEST 268435456000, "4271" - TEST -1, "FE11" - TEST 9007199254740990, "0009" - TEST amf3_Decode( amf3_Encode( 9007199254740990 ) ), "0009" - TEST 9007199254740991, "8918" - TEST amf3_Decode( amf3_Encode( 9007199254740991 ) ), "8918" - TEST 9007199254740991.00, "8918" - TEST 6969.69, "10AF" - TEST NIL, "F1E1" - TEST .T., "E3C2" - TEST .F., "6AD3" - TEST { 1, -1 }, "0560" - TEST { "ONE" => 0xcafe, "TWO" => 0xbabe }, "CE93" - - RETURN - -STATIC PROCEDURE _TEST( a, cChkOK ) - - LOCAL x := amf3_Encode( a ) - LOCAL cChk := hb_StrToHex( I2Bin( hb_CRC( x ) ) ) - - ? PadL( hb_ValToExp( a ), 18 ), hb_StrToHex( x, " " ), "CHECKSUM", cChk, iif( ! Empty( cChkOK ) .AND. !( cChk == cChkOK ), "!TEST FAILED!, should be " + cChkOK, " " ) - - RETURN diff --git a/harbour/contrib/hbfimage/tests/fitest.prg b/harbour/contrib/hbfimage/tests/test.prg similarity index 74% rename from harbour/contrib/hbfimage/tests/fitest.prg rename to harbour/contrib/hbfimage/tests/test.prg index 3af201a64d..79b7a0b7bf 100644 --- a/harbour/contrib/hbfimage/tests/fitest.prg +++ b/harbour/contrib/hbfimage/tests/test.prg @@ -61,7 +61,7 @@ PROCEDURE Main() ? "Clone image" clone := fi_Clone( im ) - ? "Pointer :", ValToPrg( im ) + ? "Pointer :", hb_ValToExp( im ) ? "Image Type :", fi_GetImageType( im ) ? "Color Used :", fi_GetColorsUsed( im ) @@ -90,18 +90,18 @@ PROCEDURE Main() ? "Flip Vertical ? :", fi_FlipVertical( clone ) ? "Save JPG ? :", fi_Save( FIF_JPEG, clone, IMAGES_OUT + "vertical.jpg", JPEG_DEFAULT ) - ? "Rotate Classic :", ValToPrg( rotated := fi_RotateClassic( clone, 90 ) ) + ? "Rotate Classic :", hb_ValToExp( rotated := fi_RotateClassic( clone, 90 ) ) ? "Save JPG ? :", fi_Save( FIF_JPEG, rotated, IMAGES_OUT + "rotate.jpg", JPEG_DEFAULT ) centerx := fi_GetWidth( clone ) / 2 centery := fi_GetHeight( clone ) / 2 - ? "Rotate Ex :", ValToPrg( rotatedEx := fi_RotateEx( clone, 15, 0, 0, centerx, centery, .T. ) ) + ? "Rotate Ex :", hb_ValToExp( rotatedEx := fi_RotateEx( clone, 15, 0, 0, centerx, centery, .T. ) ) ? "Save JPG ? :", fi_Save( FIF_JPEG, rotatedEx, IMAGES_OUT + "rotateex.jpg", JPEG_DEFAULT ) width := fi_GetWidth( im ) height := fi_GetHeight( im ) - ? "Rescale :", ValToPrg( rescale := fi_Rescale( im, width / 2, height / 2, FILTER_BICUBIC ) ) + ? "Rescale :", hb_ValToExp( rescale := fi_Rescale( im, width / 2, height / 2, FILTER_BICUBIC ) ) ? "Save JPG ? :", fi_Save( FIF_JPEG, rescale, IMAGES_OUT + "rescale.jpg", JPEG_DEFAULT ) im2 := fi_Clone( im ) @@ -120,23 +120,23 @@ PROCEDURE Main() ? "Invert ? :", fi_Invert( im2 ) ? "Save JPG ? :", fi_Save( FIF_JPEG, im2, IMAGES_OUT + "invert.jpg", JPEG_DEFAULT ) - ? "Red Channel :", ValToPrg( im2 := fi_GetChannel( im, FICC_RED ) ) + ? "Red Channel :", hb_ValToExp( im2 := fi_GetChannel( im, FICC_RED ) ) ? "Save JPG ? :", fi_Save( FIF_JPEG, im2, IMAGES_OUT + "red.jpg", JPEG_DEFAULT ) - ? "Green Channel :", ValToPrg( im2 := fi_GetChannel( im, FICC_GREEN ) ) + ? "Green Channel :", hb_ValToExp( im2 := fi_GetChannel( im, FICC_GREEN ) ) ? "Save JPG ? :", fi_Save( FIF_JPEG, im2, IMAGES_OUT + "green.jpg", JPEG_DEFAULT ) - ? "Blue Channel :", ValToPrg( im2 := fi_GetChannel( im, FICC_BLUE ) ) + ? "Blue Channel :", hb_ValToExp( im2 := fi_GetChannel( im, FICC_BLUE ) ) ? "Save JPG ? :", fi_Save( FIF_JPEG, im2, IMAGES_OUT + "blue.jpg", JPEG_DEFAULT ) - ? "Copy :", ValToPrg( im2 := fi_Copy( im, 300, 100, 800, 200 ) ) + ? "Copy :", hb_ValToExp( im2 := fi_Copy( im, 300, 100, 800, 200 ) ) ? "Save JPG ? :", fi_Save( FIF_JPEG, im2, IMAGES_OUT + "copy.jpg", JPEG_DEFAULT ) im3 := fi_Clone( im ) ? "Paste ? :", fi_Paste( im3, im2, 10, 10, 70 ) ? "Save JPG ? :", fi_Save( FIF_JPEG, im3, IMAGES_OUT + "paste.jpg", JPEG_DEFAULT ) - ? "Allocate Bitmap :", ValToPrg( im3 := fi_AllocateT( FIT_BITMAP, 320, 200, 32 ) ) + ? "Allocate Bitmap :", hb_ValToExp( im3 := fi_AllocateT( FIT_BITMAP, 320, 200, 32 ) ) ? "Save JPG ? :", fi_Save( FIF_JPEG, im3, IMAGES_OUT + "allocate.jpg", JPEG_DEFAULT ) ? "Create ERROR :" @@ -148,27 +148,27 @@ PROCEDURE Main() ? hb_StrToHex( bkcolor ) #if 0 - ? ValToPrg( fi_GetInfoHeader( im ) ) + ? hb_ValToExp( fi_GetInfoHeader( im ) ) bmpinfoheader:Buffer( fi_GetInfoHeader( im ), .T. ) bmpinfoheader:Pointer( fi_GetInfoHeader( im ) ) - ? "Header :", ValToPrg( bmpinfoheader ) + ? "Header :", hb_ValToExp( bmpinfoheader ) ? bmpinfoheader:SayMembers( " ", .T., .T. ) bmpinfo:Pointer( fi_GetInfo( im ) ) bmpinfo := NIL // To fix warning - ? "Info :", ValToPrg( bmpinfo ) + ? "Info :", hb_ValToExp( bmpinfo ) ? bmpinfo:SayMembers( " ", .T., .T. ) ? "-----------------------------------------------------" ? ValType( bmpinfo:Devalue() ) - TraceLog( "bmpinfoheader", ValToPrg( bmpinfoheader ), ; + hb_traceLog( "bmpinfoheader", hb_ValToExp( bmpinfoheader ), ; infoheader:SayMembers(, .T. ), bmpinfoheader:Value(), bmpinfoheader:DeValue(), hb_DumpVar( bmpinfoheader:Array() ), hb_DumpVar( bmpinfoheader:acMembers ) ) - TraceLog( "line 179" ) + hb_traceLog( "line 179" ) iccprofile:Pointer( fi_GetICCProfile( im ) ) - TraceLog( "line 181" ) - ? "Header :", ValToPrg( iccprofile ) - TraceLog( "line 183" ) + hb_traceLog( "line 181" ) + ? "Header :", hb_ValToExp( iccprofile ) + hb_traceLog( "line 183" ) ? iccprofile:SayMembers( " ", .T., .T. ) bmpinfoheader:Reset() @@ -189,7 +189,7 @@ PROCEDURE Main() ? "Load JPEG from memory" im := fi_LoadFromMemory( FIF_JPEG, cStr, JPEG_DEFAULT ) - ? "Pointer :", ValToPrg( im ) + ? "Pointer :", hb_ValToExp( im ) ? "Image Type :", fi_GetImageType( im ) ? "Save PNG ? :", fi_Save( FIF_PNG, im, IMAGES_OUT + "sample2.png", PNG_DEFAULT ) ENDIF @@ -205,43 +205,11 @@ PROCEDURE Main() RETURN -PROCEDURE fi_Error( cFormat, cMessage ) +STATIC PROCEDURE fi_Error( cFormat, cMessage ) ? "ERROR!.." ? "Format : ", cFormat ? "Message: ", cMessage + ? RETURN - -PROCEDURE TraceLog( c ) - - HB_SYMBOL_UNUSED( c ) - - RETURN - -FUNCTION ValToPrg( xValue ) - - LOCAL cType := ValType( xValue ) - - DO CASE - CASE cType == "C" - - xValue := StrTran( xValue, Chr( 0 ), '" + Chr( 0 ) + "' ) - xValue := StrTran( xValue, Chr( 9 ), '" + Chr( 9 ) + "' ) - xValue := StrTran( xValue, Chr( 10 ), '" + Chr( 10 ) + "' ) - xValue := StrTran( xValue, Chr( 13 ), '" + Chr( 13 ) + "' ) - xValue := StrTran( xValue, Chr( 26 ), '" + Chr( 26 ) + "' ) - - RETURN '"' + xValue + '"' - - CASE cType == "N" ; RETURN hb_ntos( xValue ) - CASE cType == "D" ; RETURN 'hb_SToD("' + DToS( xValue ) + '")' - CASE cType == "L" ; RETURN iif( xValue, ".T.", ".F." ) - CASE cType == "O" ; RETURN xValue:className() + " Object" - CASE cType == "U" ; RETURN "NIL" - CASE cType == "B" ; RETURN '{||...}' - CASE cType == "A" ; RETURN '{.[' + hb_ntos( Len( xValue ) ) + '].}' - CASE cType == "M" ; RETURN 'M:"' + xValue + '"' - ENDCASE - - RETURN "" diff --git a/harbour/contrib/hbgd/tests/bartest.prg b/harbour/contrib/hbgd/tests/barcode.prg similarity index 100% rename from harbour/contrib/hbgd/tests/bartest.prg rename to harbour/contrib/hbgd/tests/barcode.prg diff --git a/harbour/contrib/hbgd/tests/barms.prg b/harbour/contrib/hbgd/tests/barcode2.prg similarity index 100% rename from harbour/contrib/hbgd/tests/barms.prg rename to harbour/contrib/hbgd/tests/barcode2.prg diff --git a/harbour/contrib/hbgd/tests/test_out.prg b/harbour/contrib/hbgd/tests/cgi.prg similarity index 100% rename from harbour/contrib/hbgd/tests/test_out.prg rename to harbour/contrib/hbgd/tests/cgi.prg diff --git a/harbour/contrib/hbgd/tests/testdpi.prg b/harbour/contrib/hbgd/tests/fontdpi.prg similarity index 100% rename from harbour/contrib/hbgd/tests/testdpi.prg rename to harbour/contrib/hbgd/tests/fontdpi.prg diff --git a/harbour/contrib/hbgd/tests/gdtest.prg b/harbour/contrib/hbgd/tests/gdapi.prg similarity index 100% rename from harbour/contrib/hbgd/tests/gdtest.prg rename to harbour/contrib/hbgd/tests/gdapi.prg diff --git a/harbour/contrib/hbgd/tests/gdtestcl.prg b/harbour/contrib/hbgd/tests/gdclass.prg similarity index 100% rename from harbour/contrib/hbgd/tests/gdtestcl.prg rename to harbour/contrib/hbgd/tests/gdclass.prg diff --git a/harbour/contrib/hbgs/tests/testgs.prg b/harbour/contrib/hbgs/tests/test.prg similarity index 100% rename from harbour/contrib/hbgs/tests/testgs.prg rename to harbour/contrib/hbgs/tests/test.prg diff --git a/harbour/contrib/hbmisc/fcomma.prg b/harbour/contrib/hbmisc/fcomma.prg index 4fa59cc2d9..76adb0310c 100644 --- a/harbour/contrib/hbmisc/fcomma.prg +++ b/harbour/contrib/hbmisc/fcomma.prg @@ -224,13 +224,13 @@ STATIC FUNCTION FCM_GOTO( nWA, nRecord ) aWData[ 2 ] := aWData[ 3 ] := .T. ELSEIF nRecord == 1 hb_FGoTop() - aWData[ 2 ] := aWData[ 3 ] := hb_FEof() + aWData[ 2 ] := aWData[ 3 ] := hb_FAtEof() ELSE hb_FSkip( 0 ) /* Clear the EOF flag inside hb_F* engin - it's not done automatically in hb_FGoBottom() :-( */ hb_FGoto( nRecord ) aWData[ 2 ] := hb_FRecNo() == 0 - aWData[ 3 ] := hb_FEof() + aWData[ 3 ] := hb_FAtEof() ENDIF RETURN HB_SUCCESS @@ -244,7 +244,7 @@ STATIC FUNCTION FCM_GOTOP( nWA ) hb_FSelect( aWData[ 1 ] ) hb_FGoTop() - aWData[ 2 ] := aWData[ 3 ] := hb_FEof() + aWData[ 2 ] := aWData[ 3 ] := hb_FAtEof() RETURN HB_SUCCESS @@ -281,11 +281,11 @@ STATIC FUNCTION FCM_SKIPRAW( nWA, nRecords ) IF nRecords < 0 .AND. hb_FRecNo() <= -nRecords hb_FGoTop() aWData[ 2 ] := .T. - aWData[ 3 ] := hb_FEof() + aWData[ 3 ] := hb_FAtEof() ELSEIF nRecords != 0 hb_FSkip( nRecords ) aWData[ 2 ] := .F. - aWData[ 3 ] := hb_FEof() + aWData[ 3 ] := hb_FAtEof() ENDIF ENDIF diff --git a/harbour/contrib/hbmisc/hb_f.c b/harbour/contrib/hbmisc/hb_f.c index fc02b3a0c1..8172bfaaef 100644 --- a/harbour/contrib/hbmisc/hb_f.c +++ b/harbour/contrib/hbmisc/hb_f.c @@ -83,18 +83,9 @@ HB_FUNC( HB_FUSE ) { PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); - PHB_ITEM arg1_it = hb_param( 1, HB_IT_STRING ); - PHB_ITEM arg2_it = hb_param( 2, HB_IT_NUMERIC ); - int open_flags; - - if( arg1_it ) + if( HB_ISCHAR( 1 ) ) { - if( arg2_it ) - open_flags = hb_parni( 2 ); - else - open_flags = 0; - - ft_text->handles[ ft_text->area ] = hb_fsOpen( hb_parc( 1 ), ( HB_USHORT ) open_flags ); + ft_text->handles[ ft_text->area ] = hb_fsOpen( hb_parc( 1 ), ( HB_USHORT ) hb_parnidef( 2, FO_READ ) ); ft_text->offset[ ft_text->area ] = 0; ft_text->recno[ ft_text->area ] = 1; ft_text->lastbyte[ ft_text->area ] = hb_fsSeekLarge( ft_text->handles[ ft_text->area ], 0, FS_END ); @@ -115,7 +106,6 @@ HB_FUNC( HB_FUSE ) } } - HB_FUNC( HB_FRECNO ) { PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); @@ -123,7 +113,6 @@ HB_FUNC( HB_FRECNO ) hb_retnl( ft_text->recno[ ft_text->area ] ); } - static long hb_hbfskip( PFT_TEXT ft_text, char * buffer, HB_SIZE bufsize, int recs ) { HB_FOFFSET read_pos; @@ -242,13 +231,17 @@ HB_FUNC( HB_FREADLN ) hb_xfree( buffer ); } -HB_FUNC( HB_FEOF ) +HB_FUNC( HB_FATEOF ) { PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); hb_retl( ft_text->isEof[ ft_text->area ] ); } +#if defined( HB_LEGACY_LEVEL4 ) +HB_FUNC_TRANSLATE( HB_FEOF, HB_FATEOF ) +#endif + HB_FUNC( HB_FGOTO ) { PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); @@ -365,10 +358,15 @@ HB_FUNC( HB_FSELECT ) hb_retni( ft_text->area + 1 ); if( HB_ISNUM( 1 ) ) - ft_text->area = hb_parni( 1 ) - 1; + { + int area = hb_parni( 1 ); + + if( area >= 1 && area <= TEXT_WORKAREAS ) + ft_text->area = area - 1; + } } -HB_FUNC( HB_FINFO ) /* used for debugging */ +HB_FUNC( HB_FINFO ) /* used for debugging */ { PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); @@ -378,7 +376,7 @@ HB_FUNC( HB_FINFO ) /* used for debugging */ hb_storvni( ft_text->recno[ ft_text->area ], -1, 3 ); hb_storvnint( ft_text->offset[ ft_text->area ], -1, 4 ); hb_storvnint( ft_text->lastbyte[ ft_text->area ], -1, 5 ); - hb_storvl( ft_text->isEof[ ft_text->area ], -1, 6 ); + hb_storvl( ft_text->isEof[ ft_text->area ], -1, 6 ); } /* ------------------------------------------------ diff --git a/harbour/contrib/hbmisc/hbmisc.hbx b/harbour/contrib/hbmisc/hbmisc.hbx index e52a9a4864..b185a413e7 100644 --- a/harbour/contrib/hbmisc/hbmisc.hbx +++ b/harbour/contrib/hbmisc/hbmisc.hbx @@ -96,7 +96,8 @@ DYNAMIC FileFindSize DYNAMIC FileFindTime DYNAMIC hbmisc_DaysInMonth DYNAMIC hb_DynaCall1 -DYNAMIC hb_FEof +DYNAMIC hb_FAtEof +DYNAMIC HB_FEof DYNAMIC hb_FGoBottom DYNAMIC hb_FGoto DYNAMIC hb_FGoTop diff --git a/harbour/contrib/hbmisc/tests/testbbab.prg b/harbour/contrib/hbmisc/tests/bubbleb.prg similarity index 100% rename from harbour/contrib/hbmisc/tests/testbbab.prg rename to harbour/contrib/hbmisc/tests/bubbleb.prg diff --git a/harbour/contrib/hbmisc/tests/testcall.prg b/harbour/contrib/hbmisc/tests/calldll.prg similarity index 100% rename from harbour/contrib/hbmisc/tests/testcall.prg rename to harbour/contrib/hbmisc/tests/calldll.prg diff --git a/harbour/contrib/hbmisc/tests/testhbf.prg b/harbour/contrib/hbmisc/tests/hb_f.prg similarity index 67% rename from harbour/contrib/hbmisc/tests/testhbf.prg rename to harbour/contrib/hbmisc/tests/hb_f.prg index 73543a57d4..373a5b2cd0 100644 --- a/harbour/contrib/hbmisc/tests/testhbf.prg +++ b/harbour/contrib/hbmisc/tests/hb_f.prg @@ -2,29 +2,16 @@ * $Id$ */ -/* -test program for hb_f*() -harbour clones for nanfor's ft_f*() -inplementation of : - * hb_FUse() - * hb_FSkip() - * hb_FEof() - * hb_FRecNo() - * hb_FReadLn() - * hb_FLastRec() - * hb_FGoto() - * hb_FGoTop() - * hb_FGoBottom() -*/ - #require "hbmisc" +#include "fileio.ch" + PROCEDURE Main() // open a text file here - IF hb_FUse( __FILE__, 0 ) > 1 + IF hb_FUse( __FILE__, FO_READ ) > 1 - DO WHILE ! hb_FEof() + DO WHILE ! hb_FAtEof() ? "line " + Str( hb_FRecNo(), 2 ) + " " + hb_FReadLn() hb_FSkip( 1 ) ENDDO @@ -53,7 +40,7 @@ STATIC PROCEDURE my_goto( n_go ) hb_FGoto( n_go ) ? - ? "after hb_FGoto(" + hb_ntos( n_go ) + ")" + ? "after hb_FGoto( " + hb_ntos( n_go ) + " )" ? "line " + hb_ntos( hb_FRecNo() ) + " is " + LTrim( hb_FReadLn() ) RETURN diff --git a/harbour/contrib/hbmisc/tests/numtxtru.prg b/harbour/contrib/hbmisc/tests/numtxtru.prg index feacc053ed..8c4b966428 100644 --- a/harbour/contrib/hbmisc/tests/numtxtru.prg +++ b/harbour/contrib/hbmisc/tests/numtxtru.prg @@ -4,6 +4,8 @@ #require "hbmisc" +#include "inkey.ch" + REQUEST HB_CODEPAGE_UTF8EX PROCEDURE Main() @@ -36,7 +38,7 @@ PROCEDURE Test( cLang ) ? nTemp ENDIF IF nTemp % 10000 == 0 - IF Inkey() == 27 + IF Inkey() == K_ESC EXIT ENDIF ENDIF diff --git a/harbour/contrib/hbmisc/tests/rtfclass.prg b/harbour/contrib/hbmisc/tests/rtfclass.prg index 2cd50d2f4e..a7557d849c 100644 --- a/harbour/contrib/hbmisc/tests/rtfclass.prg +++ b/harbour/contrib/hbmisc/tests/rtfclass.prg @@ -84,7 +84,7 @@ METHOD write( csource ) CLASS TRtf { "-u" , "\ulnone " } } /* turn underline off */ hb_FUse( csource ) // open source file - WHILE ! hb_FEof() // read the file line by line + WHILE ! hb_FAtEof() // read the file line by line cline := hb_FReadLn() + "\par" y := Len( cline ) FOR nchar := 1 TO y diff --git a/harbour/contrib/hbmisc/tests/tsstrfmt.prg b/harbour/contrib/hbmisc/tests/strfmt.prg similarity index 100% rename from harbour/contrib/hbmisc/tests/tsstrfmt.prg rename to harbour/contrib/hbmisc/tests/strfmt.prg diff --git a/harbour/contrib/hbmisc/tests/twirl.prg b/harbour/contrib/hbmisc/tests/twirler.prg similarity index 96% rename from harbour/contrib/hbmisc/tests/twirl.prg rename to harbour/contrib/hbmisc/tests/twirler.prg index 280fb3c47f..9647f8441f 100644 --- a/harbour/contrib/hbmisc/tests/twirl.prg +++ b/harbour/contrib/hbmisc/tests/twirler.prg @@ -2,7 +2,7 @@ * $Id$ */ -// Test program for new libmisc twirler class +// Test program for new hbmisc twirler class /* Harbour Project source code http://harbour-project.org/ Donated to the public domain on 2001-03-15 by David G. Holm diff --git a/harbour/contrib/hbmisc/tests/udpdstst.prg b/harbour/contrib/hbmisc/tests/udpds.prg similarity index 100% rename from harbour/contrib/hbmisc/tests/udpdstst.prg rename to harbour/contrib/hbmisc/tests/udpds.prg diff --git a/harbour/contrib/hbmxml/tests/testmxml.prg b/harbour/contrib/hbmxml/tests/testmxml.prg index 0f57e8724e..f03ebcbf56 100644 --- a/harbour/contrib/hbmxml/tests/testmxml.prg +++ b/harbour/contrib/hbmxml/tests/testmxml.prg @@ -51,7 +51,7 @@ PROCEDURE Main( cFileArg ) */ IF Empty( cFileArg ) - OutErr( "Usage: textmxml filename.xml" + hb_eol() ) + OutErr( hb_StrFormat( "Usage: %1$s filename.xml", hb_ProgName() ) + hb_eol() ) ErrorLevel( 1 ) QUIT ENDIF diff --git a/harbour/contrib/hbnf/fttext.c b/harbour/contrib/hbnf/fttext.c index e194dbaf93..8c870415ba 100644 --- a/harbour/contrib/hbnf/fttext.c +++ b/harbour/contrib/hbnf/fttext.c @@ -216,7 +216,7 @@ HB_FUNC( FT_FUSE ) int attr = hb_parnidef( 2, FO_READWRITE | FO_DENYNONE ); ft_text->handles[ ft_text->area ] = hb_fsOpen( hb_parc( 1 ), ( HB_USHORT ) attr ); - if( ft_text->handles[ ft_text->area ] <= 0 ) + if( ft_text->handles[ ft_text->area ] == FS_ERROR ) ft_text->error[ ft_text->area ] = hb_fsError(); ft_text->offset[ ft_text->area ] = 0; ft_text->recno[ ft_text->area ] = 1; @@ -442,7 +442,7 @@ static long _ft_skip( long iRecs ) /* read a chunk */ iBytesRead = - hb_fsRead( ft_text->handles[ ft_text->area ], cBuff, BUFFSIZE ); + hb_fsRead( ft_text->handles[ ft_text->area ], cBuff, BUFFSIZE ); if( ! iBytesRead ) { diff --git a/harbour/contrib/hbnf/tests/fttext.prg b/harbour/contrib/hbnf/tests/fttext.prg index 430e29dc7c..80eb803433 100644 --- a/harbour/contrib/hbnf/tests/fttext.prg +++ b/harbour/contrib/hbnf/tests/fttext.prg @@ -4,10 +4,12 @@ #require "hbnf" +#include "fileio.ch" + PROCEDURE Main() // open a text file here - IF ft_FUse( __FILE__, 0 ) > 1 + IF ft_FUse( __FILE__, FO_READ ) > 1 DO WHILE ! ft_FEof() ? "line " + Str( ft_FRecNo(), 2 ) + " " + ft_FReadLn() @@ -38,7 +40,7 @@ STATIC PROCEDURE my_goto( n_go ) ft_FGoto( n_go ) ? - ? "after ft_FGoto(" + hb_ntos( n_go ) + ")" + ? "after ft_FGoto( " + hb_ntos( n_go ) + " )" ? "line " + hb_ntos( ft_FRecNo() ) + " is " + LTrim( ft_FReadLn() ) RETURN diff --git a/harbour/contrib/hbodbc/tests/testodbc.prg b/harbour/contrib/hbodbc/tests/odbc.prg similarity index 100% rename from harbour/contrib/hbodbc/tests/testodbc.prg rename to harbour/contrib/hbodbc/tests/odbc.prg diff --git a/harbour/contrib/hbodbc/tests/odbcdemo.prg b/harbour/contrib/hbodbc/tests/todbc.prg similarity index 100% rename from harbour/contrib/hbodbc/tests/odbcdemo.prg rename to harbour/contrib/hbodbc/tests/todbc.prg diff --git a/harbour/contrib/hbsqlit3/tests/sl3_test.prg b/harbour/contrib/hbsqlit3/tests/demo.prg similarity index 100% rename from harbour/contrib/hbsqlit3/tests/sl3_test.prg rename to harbour/contrib/hbsqlit3/tests/demo.prg diff --git a/harbour/contrib/hbsqlit3/tests/hdbctest.prg b/harbour/contrib/hbsqlit3/tests/hdbc.prg similarity index 100% rename from harbour/contrib/hbsqlit3/tests/hdbctest.prg rename to harbour/contrib/hbsqlit3/tests/hdbc.prg diff --git a/harbour/contrib/hbtip/tests/test01.prg b/harbour/contrib/hbtip/tests/httpcli.prg similarity index 100% rename from harbour/contrib/hbtip/tests/test01.prg rename to harbour/contrib/hbtip/tests/httpcli.prg diff --git a/harbour/contrib/hbtip/tests/tipmime.prg b/harbour/contrib/hbtip/tests/mimetype.prg similarity index 86% rename from harbour/contrib/hbtip/tests/tipmime.prg rename to harbour/contrib/hbtip/tests/mimetype.prg index c5c1dc2ee9..f5a16d535e 100644 --- a/harbour/contrib/hbtip/tests/tipmime.prg +++ b/harbour/contrib/hbtip/tests/mimetype.prg @@ -7,9 +7,6 @@ * MIME type test * * This test tries to detect the mime type of a give file. - * - * Usage: - * tipmime filename ******************************************/ #require "hbtip" @@ -18,7 +15,7 @@ PROCEDURE Main( cFileName ) IF Empty( cFileName ) ? - ? "Usage: mimetest " + ? hb_StrFormat( "Usage: %1$s ", hb_ProgName() ) ? QUIT ENDIF diff --git a/harbour/contrib/hbtip/tests/tiptime.prg b/harbour/contrib/hbtip/tests/timestmp.prg similarity index 100% rename from harbour/contrib/hbtip/tests/tiptime.prg rename to harbour/contrib/hbtip/tests/timestmp.prg diff --git a/harbour/contrib/hbtip/tests/tiptest.prg b/harbour/contrib/hbtip/tests/tipwget.prg similarity index 98% rename from harbour/contrib/hbtip/tests/tiptest.prg rename to harbour/contrib/hbtip/tests/tipwget.prg index a3dd451d07..fb49f1fee1 100644 --- a/harbour/contrib/hbtip/tests/tiptest.prg +++ b/harbour/contrib/hbtip/tests/tipwget.prg @@ -7,8 +7,6 @@ * * Usage: This file is similar to a wget command * - * tiptest [filename] - * * Without the filename, tiptest will be in demo mode, * just demostrating it is working * @@ -61,7 +59,7 @@ PROCEDURE Main( cUrl, cFile ) @ 1, 6 SAY "X H A R B O U R - TIP (class based internet client protocol) test" IF Empty( cUrl ) - @ 4, 5 SAY "USAGE: tipTest [dumpToOrFromFileName]" + @ 4, 5 SAY hb_StrFormat( "USAGE: %1$s [dumpToOrFromFileName]", hb_ProgName() ) Terminate() ENDIF diff --git a/harbour/contrib/hbtpathy/tests/testtp.prg b/harbour/contrib/hbtpathy/tests/test.prg similarity index 90% rename from harbour/contrib/hbtpathy/tests/testtp.prg rename to harbour/contrib/hbtpathy/tests/test.prg index 118f151729..d175efac74 100644 --- a/harbour/contrib/hbtpathy/tests/testtp.prg +++ b/harbour/contrib/hbtpathy/tests/test.prg @@ -57,11 +57,11 @@ */ /* - instructions - hook up a loopback device to "com1" of your computer - run this program. It should echo Hi there bob. - If it gives you a file i/o error, try running as root. - also make sure that other programs (minicom?) can successfully talk to your - com port. + instructions - hook up a loopback device to "com1" of your computer + run this program. It should echo Hi there bob. + If it gives you a file i/o error, try running as root. + also make sure that other programs (minicom?) can successfully talk to your + com port. */ #require "hbtpathy" diff --git a/harbour/contrib/hbunix/tests/testdmn.prg b/harbour/contrib/hbunix/tests/daemon.prg similarity index 92% rename from harbour/contrib/hbunix/tests/testdmn.prg rename to harbour/contrib/hbunix/tests/daemon.prg index 62288b6dd0..ac0251d5f7 100644 --- a/harbour/contrib/hbunix/tests/testdmn.prg +++ b/harbour/contrib/hbunix/tests/daemon.prg @@ -18,7 +18,7 @@ PROCEDURE Main() LOCAL cLogFile, cLogText - cLogFile := hb_ps() + CurDir() + hb_ps() + "testdmn.txt" + cLogFile := hb_ps() + CurDir() + hb_ps() + hb_FNameExtSet( __FILE__, ".txt" ) ? hb_StrFormat( "Parent(%d) launching child... ", posix_getpid() ) diff --git a/harbour/contrib/hbunix/tests/testpid.prg b/harbour/contrib/hbunix/tests/getpid.prg similarity index 100% rename from harbour/contrib/hbunix/tests/testpid.prg rename to harbour/contrib/hbunix/tests/getpid.prg diff --git a/harbour/contrib/hbwin/tests/testax.prg b/harbour/contrib/hbwin/tests/activex.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testax.prg rename to harbour/contrib/hbwin/tests/activex.prg diff --git a/harbour/contrib/hbwin/tests/testevnt.prg b/harbour/contrib/hbwin/tests/eventlog.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testevnt.prg rename to harbour/contrib/hbwin/tests/eventlog.prg diff --git a/harbour/contrib/hbwin/tests/testmapi.prg b/harbour/contrib/hbwin/tests/mapimail.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testmapi.prg rename to harbour/contrib/hbwin/tests/mapimail.prg diff --git a/harbour/contrib/hbwin/tests/testwmtx.prg b/harbour/contrib/hbwin/tests/mutexwin.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testwmtx.prg rename to harbour/contrib/hbwin/tests/mutexwin.prg diff --git a/harbour/contrib/hbwin/tests/testole.prg b/harbour/contrib/hbwin/tests/ole.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testole.prg rename to harbour/contrib/hbwin/tests/ole.prg diff --git a/harbour/contrib/hbwin/tests/testprn.prg b/harbour/contrib/hbwin/tests/prn1.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testprn.prg rename to harbour/contrib/hbwin/tests/prn1.prg diff --git a/harbour/contrib/hbwin/tests/testprn2.prg b/harbour/contrib/hbwin/tests/prn2.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testprn2.prg rename to harbour/contrib/hbwin/tests/prn2.prg diff --git a/harbour/contrib/hbwin/tests/testprn3.prg b/harbour/contrib/hbwin/tests/prn3.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testprn3.prg rename to harbour/contrib/hbwin/tests/prn3.prg diff --git a/harbour/contrib/hbwin/tests/testprn4.prg b/harbour/contrib/hbwin/tests/prn4.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testprn4.prg rename to harbour/contrib/hbwin/tests/prn4.prg diff --git a/harbour/contrib/hbwin/tests/testgdi.prg b/harbour/contrib/hbwin/tests/prngdi.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testgdi.prg rename to harbour/contrib/hbwin/tests/prngdi.prg diff --git a/harbour/contrib/hbwin/tests/testreg.prg b/harbour/contrib/hbwin/tests/registry.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testreg.prg rename to harbour/contrib/hbwin/tests/registry.prg diff --git a/harbour/contrib/hbwin/tests/testcom1.prg b/harbour/contrib/hbwin/tests/serial1.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testcom1.prg rename to harbour/contrib/hbwin/tests/serial1.prg diff --git a/harbour/contrib/hbwin/tests/testcom2.prg b/harbour/contrib/hbwin/tests/serial2.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testcom2.prg rename to harbour/contrib/hbwin/tests/serial2.prg diff --git a/harbour/contrib/hbwin/tests/testsvc.prg b/harbour/contrib/hbwin/tests/service.prg similarity index 97% rename from harbour/contrib/hbwin/tests/testsvc.prg rename to harbour/contrib/hbwin/tests/service.prg index bb1bf2b156..9d9ce76a95 100644 --- a/harbour/contrib/hbwin/tests/testsvc.prg +++ b/harbour/contrib/hbwin/tests/service.prg @@ -110,7 +110,7 @@ PROCEDURE Main( cMode ) PROCEDURE SrvMain( cParam1, cParam2 ) LOCAL n := 0 - LOCAL fhnd := hb_FCreate( hb_DirBase() + "testsvc.out", FC_NORMAL, FO_DENYNONE + FO_WRITE ) + LOCAL fhnd := hb_FCreate( hb_FNameExtSet( hb_ProgName(), ".out" ), FC_NORMAL, FO_DENYNONE + FO_WRITE ) LOCAL cParam hb_default( @cParam1, "" ) diff --git a/harbour/contrib/hbwin/tests/testcopy.prg b/harbour/contrib/hbwin/tests/shfileop.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testcopy.prg rename to harbour/contrib/hbwin/tests/shfileop.prg diff --git a/harbour/contrib/hbwin/tests/testsim.prg b/harbour/contrib/hbwin/tests/simwce.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testsim.prg rename to harbour/contrib/hbwin/tests/simwce.prg diff --git a/harbour/contrib/hbwin/tests/testdir.prg b/harbour/contrib/hbwin/tests/sysdir.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testdir.prg rename to harbour/contrib/hbwin/tests/sysdir.prg diff --git a/harbour/contrib/hbwin/tests/testrpc.prg b/harbour/contrib/hbwin/tests/uuid.prg similarity index 100% rename from harbour/contrib/hbwin/tests/testrpc.prg rename to harbour/contrib/hbwin/tests/uuid.prg diff --git a/harbour/contrib/hbxpp/tests/testdll.prg b/harbour/contrib/hbxpp/tests/dllcall.prg similarity index 100% rename from harbour/contrib/hbxpp/tests/testdll.prg rename to harbour/contrib/hbxpp/tests/dllcall.prg diff --git a/harbour/contrib/hbzebra/tests/testcair.prg b/harbour/contrib/hbzebra/tests/cairo.prg similarity index 96% rename from harbour/contrib/hbzebra/tests/testcair.prg rename to harbour/contrib/hbzebra/tests/cairo.prg index 0ba559858b..468a81b776 100644 --- a/harbour/contrib/hbzebra/tests/testcair.prg +++ b/harbour/contrib/hbzebra/tests/cairo.prg @@ -9,7 +9,7 @@ PROCEDURE Main() LOCAL hCairo, hSurface - hSurface := cairo_pdf_surface_create( "testcair.pdf", 567, 794 ) // A4 + hSurface := cairo_pdf_surface_create( hb_FNameExtSet( __FILE__, ".pdf" ), 567, 794 ) // A4 hCairo := cairo_create( hSurface ) cairo_set_source_rgb( hCairo, 1.0, 1.0, 1.0 ) @@ -44,7 +44,7 @@ PROCEDURE Main() DrawBarcode( hCairo, 540, 1, "DATAMATRIX", "Hello, World of Harbour!!! It's 2D barcode DataMatrix :)" ) DrawBarcode( hCairo, 580, 1, "QRCODE", "http://harbour-project.org/" ) cairo_destroy( hCairo ) - cairo_surface_write_to_png( hSurface, "testcair.png" ) + cairo_surface_write_to_png( hSurface, hb_FNameExtSet( __FILE__, ".png" ) ) cairo_surface_destroy( hSurface ) RETURN diff --git a/harbour/contrib/hbzebra/tests/testhpdf.prg b/harbour/contrib/hbzebra/tests/harupdf.prg similarity index 97% rename from harbour/contrib/hbzebra/tests/testhpdf.prg rename to harbour/contrib/hbzebra/tests/harupdf.prg index 6463e368eb..b2d10d85ea 100644 --- a/harbour/contrib/hbzebra/tests/testhpdf.prg +++ b/harbour/contrib/hbzebra/tests/harupdf.prg @@ -49,8 +49,8 @@ PROCEDURE Main() DrawBarcode( page, 540, 1, "DATAMATRIX", "Hello, World of Harbour!!! It's 2D barcode DataMatrix :)" ) DrawBarcode( page, 580, 1, "QRCODE", "http://harbour-project.org/" ) - FErase( "testhpdf.pdf" ) - ? HPDF_SaveToFile( pdf, "testhpdf.pdf" ) + FErase( hb_FNameExtSet( __FILE__, ".pdf" ) ) + ? HPDF_SaveToFile( pdf, hb_FNameExtSet( __FILE__, ".pdf" ) ) RETURN diff --git a/harbour/contrib/hbzebra/tests/testwin.prg b/harbour/contrib/hbzebra/tests/wingdi.prg similarity index 100% rename from harbour/contrib/hbzebra/tests/testwin.prg rename to harbour/contrib/hbzebra/tests/wingdi.prg diff --git a/harbour/contrib/rddads/tests/datad.prg b/harbour/contrib/rddads/tests/datad.prg index e89f8d80a8..dc06630deb 100644 --- a/harbour/contrib/rddads/tests/datad.prg +++ b/harbour/contrib/rddads/tests/datad.prg @@ -2,9 +2,7 @@ * $Id$ */ -/* - Demo of ADS Connection handling and Data Dictionaries -*/ +/* Demo of ADS Connection handling and Data Dictionaries */ #require "rddads" diff --git a/harbour/contrib/rddads/tests/testmg.prg b/harbour/contrib/rddads/tests/manage.prg similarity index 100% rename from harbour/contrib/rddads/tests/testmg.prg rename to harbour/contrib/rddads/tests/manage.prg diff --git a/harbour/contrib/xhb/tests/testcp.prg b/harbour/contrib/xhb/tests/copyfile.prg similarity index 100% rename from harbour/contrib/xhb/tests/testcp.prg rename to harbour/contrib/xhb/tests/copyfile.prg diff --git a/harbour/tests/mousetst.prg b/harbour/tests/mousetst.prg index a53a45798a..8446abbb2c 100644 --- a/harbour/tests/mousetst.prg +++ b/harbour/tests/mousetst.prg @@ -3,7 +3,7 @@ */ /* - * Copyright 2000 Alejandro de Garate + * Copyright 2000 Alejandro de Garate * * Test mouse for Harbour */ diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index c9315af212..733482d013 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -45,7 +45,7 @@ * - gcc and *nix configuration elements * - bash script with similar purpose for gcc family * - entry point override method and detection code for gcc - * - rtlink/blinker link script parsers + * - RTLink/Blinker/ExoSpace link script parsers * - original POTMerge(), LoadPOTFilesAsHash(), GenHBL() and AutoTrans() * - optimized header time scan algorithm * - shell core runner logic @@ -1357,6 +1357,7 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit LOCAL cOpt_Sign LOCAL cOpt_SignID LOCAL cOpt_SignPass + LOCAL aParamPROGNAME LOCAL cCommand LOCAL aCommand @@ -2385,7 +2386,7 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit cParam := hb_FNameExtSet( cParam, ".hbm" ) ENDIF IF !( Lower( hb_FNameExt( cParam ) ) == ".hbm" ) .AND. lAcceptLDClipper - rtlnk_process( hbmk, MemoRead( hb_DirSepToOS( cParam ) ), @hbmk[ _HBMK_cPROGNAME ], @hbmk[ _HBMK_aOBJUSER ], @hbmk[ _HBMK_aLIBUSER ] ) + rtlnk_process( hbmk, MemoRead( hb_DirSepToOS( cParam ) ), @hbmk[ _HBMK_cPROGNAME ], @hbmk[ _HBMK_aOBJUSER ], @hbmk[ _HBMK_aLIBUSER ], @hbmk[ _HBMK_aLIBPATH ] ) IF ! Empty( hbmk[ _HBMK_aOBJUSER ] ) hb_default( @hbmk[ _HBMK_cFIRST ], hbmk[ _HBMK_aOBJUSER ][ 1 ] ) ENDIF @@ -2901,12 +2902,6 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit IF ! Empty( tmp ) tmp := hb_DirSepToOS( tmp ) hb_FNameSplit( tmp, @cDir, @cName, @cExt ) - tmp1 := hbmk_TARGETTYPE( hbmk ) - IF ( Lower( cExt ) == ".exe" .AND. tmp1 == "hbexe" ) .OR. ; - ( Lower( cExt ) == ".dll" .AND. HBMK_IS_IN( tmp1, "hbdyn|hbdynvm" ) ) .OR. ; - ( HBMK_IS_IN( Lower( cExt ), ".lib|.a" ) .AND. HBMK_IS_IN( tmp1, "hblib|hbimplib" ) ) - _hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Non-portable option value: %1$s. Delete '%2$s' extension." ), ParamToString( aParam ), cExt ) ) - ENDIF DO CASE CASE Empty( cDir ) tmp := hb_PathNormalize( PathMakeAbsolute( tmp, aParam[ _PAR_cFileName ] ) ) @@ -2915,16 +2910,19 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit hbmk[ _HBMK_cPROGDIR ] := cDir ENDIF hbmk[ _HBMK_cPROGNAME ] := hb_FNameNameExt( tmp ) + aParamPROGNAME := AClone( aParam ) CASE ! Empty( cDir ) .AND. Empty( cName ) .AND. Empty( cExt ) hbmk[ _HBMK_cPROGDIR ] := hb_PathNormalize( PathMakeAbsolute( cDir, aParam[ _PAR_cFileName ] ) ) OTHERWISE /* ! Empty( cDir ) .AND. !( Empty( cName ) .AND. Empty( cExt ) ) */ hbmk[ _HBMK_cPROGDIR ] := hb_PathNormalize( PathMakeAbsolute( cDir, aParam[ _PAR_cFileName ] ) ) hbmk[ _HBMK_cPROGNAME ] := hb_FNameNameExt( tmp ) + aParamPROGNAME := AClone( aParam ) ENDCASE ENDIF ELSE hbmk[ _HBMK_cPROGDIR ] := NIL hbmk[ _HBMK_cPROGNAME ] := NIL + aParamPROGNAME := NIL ENDIF ENDIF @@ -3653,6 +3651,16 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit ENDIF ENDIF + IF hbmk[ _HBMK_cPROGNAME ] != NIL + cExt := hb_FNameExt( hbmk[ _HBMK_cPROGNAME ] ) + tmp1 := hbmk_TARGETTYPE( hbmk ) + IF ( Lower( cExt ) == ".exe" .AND. tmp1 == "hbexe" ) .OR. ; + ( Lower( cExt ) == ".dll" .AND. HBMK_IS_IN( tmp1, "hbdyn|hbdynvm" ) ) .OR. ; + ( HBMK_IS_IN( Lower( cExt ), ".lib|.a" ) .AND. HBMK_IS_IN( tmp1, "hblib|hbimplib" ) ) + _hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Non-portable output filename: %1$s. Delete '%2$s' extension." ), iif( aParamPROGNAME != NIL, ParamToString( aParamPROGNAME ), hbmk[ _HBMK_cPROGNAME ] ), cExt ) ) + ENDIF + ENDIF + /* Decide about output name */ IF ! hbmk[ _HBMK_lStopAfterInit ] .AND. ! hbmk[ _HBMK_lCreateImpLib ] @@ -9390,24 +9398,17 @@ FUNCTION hbmk_FNameEscape( ctx, cFileName ) LOCAL hbmk := ctx_to_hbmk( ctx ) - LOCAL nEscapeMode := hbmk[ _HBMK_nCmd_Esc ] - LOCAL nFNNotation := hbmk[ _HBMK_nCmd_FNF ] - + IF hbmk == NIL #ifdef HB_LEGACY_LEVEL4 - IF hbmk == NIL .AND. HB_ISSTRING( ctx ) .AND. PCount() == 3 /* legacy calling mode */ - - IF HB_ISSTRING( hb_AParams()[ 1 ] ) .AND. ; - HB_ISNUMERIC( hb_AParams()[ 2 ] ) .AND. ; - HB_ISNUMERIC( hb_AParams()[ 3 ] ) - - cFileName := hb_AParams()[ 1 ] - nEscapeMode := hb_AParams()[ 2 ] - nFNNotation := hb_AParams()[ 3 ] + /* legacy calling mode */ + IF HB_ISSTRING( ctx ) + RETURN FNameEscape( ctx, cFileName, iif( PCount() >= 3, hb_AParams()[ 3 ], NIL ) ) ENDIF - ENDIF #endif + RETURN NIL + ENDIF - RETURN FNameEscape( cFileName, nEscapeMode, nFNNotation ) + RETURN FNameEscape( cFileName, hbmk[ _HBMK_nCmd_Esc ], hbmk[ _HBMK_nCmd_FNF ] ) FUNCTION hbmk_OutStdRaw( ctx, ... ) @@ -9429,26 +9430,6 @@ FUNCTION hbmk_OutErrRaw( ctx, ... ) RETURN ( OutErr( ... ), OutErr( _OUT_EOL ) ) -FUNCTION hbmk_PathFromWorkdirToCWD( ctx ) - - LOCAL hbmk := ctx_to_hbmk( ctx ) - - IF hbmk != NIL - RETURN hb_DirSepAdd( hb_PathRelativize( hb_PathNormalize( PathMakeAbsolute( hbmk[ _HBMK_cWorkDir ], hb_cwd() ) ), hb_cwd(), .T. ) ) - ENDIF - - RETURN "" - -FUNCTION hbmk_Macro( ctx, cString ) - - LOCAL hbmk := ctx_to_hbmk( ctx ) - - IF hbmk != NIL .AND. HB_ISSTRING( cString ) - RETURN MacroProc( hbmk, cString ) - ENDIF - - RETURN "" - FUNCTION hbmk_OutStd( ctx, cText ) LOCAL hbmk := ctx_to_hbmk( ctx ) @@ -9469,6 +9450,26 @@ FUNCTION hbmk_OutErr( ctx, cText ) RETURN NIL +FUNCTION hbmk_PathFromWorkdirToCWD( ctx ) + + LOCAL hbmk := ctx_to_hbmk( ctx ) + + IF hbmk != NIL .AND. HB_ISSTRING( hbmk[ _HBMK_cWorkDir ] ) + RETURN hb_DirSepAdd( hb_PathRelativize( hb_PathNormalize( PathMakeAbsolute( hbmk[ _HBMK_cWorkDir ], hb_cwd() ) ), hb_cwd(), .T. ) ) + ENDIF + + RETURN "" + +FUNCTION hbmk_Macro( ctx, cString ) + + LOCAL hbmk := ctx_to_hbmk( ctx ) + + IF hbmk != NIL .AND. HB_ISSTRING( cString ) + RETURN MacroProc( hbmk, cString ) + ENDIF + + RETURN "" + FUNCTION hbmk_PathSepToTarget( ctx, cFileName ) LOCAL hbmk := ctx_to_hbmk( ctx ) @@ -10209,6 +10210,14 @@ STATIC FUNCTION FNameDirExtSet( cFileName, cDirNew, cExtNew ) RETURN hb_FNameMerge( cDir, cName, cExt ) +STATIC FUNCTION FNameDirName( cFileName ) + + LOCAL cDir, cName + + hb_FNameSplit( cFileName, @cDir, @cName ) + + RETURN hb_FNameMerge( cDir, cName ) + STATIC FUNCTION FN_Expand( cFileName, lCommandLine ) LOCAL aFileList @@ -11891,7 +11900,7 @@ STATIC FUNCTION rtlnk_read( cFileName, aPrevFiles ) ENDIF cFileName := hb_FNameMerge( cPath, cFile, ".lnk" ) - /* it is blinker extension, look for .lnk file in paths + /* it is Blinker extension, look for .lnk file in paths * specified by LIB envvar */ IF ! hb_FileExists( cFileName ) .AND. ; @@ -11935,8 +11944,8 @@ STATIC FUNCTION rtlnk_tokens( cLine ) RETURN hb_ATokens( StrTran( cLine, ",", " , " ) ) -STATIC FUNCTION rtlnk_process( hbmk, cCommands, cFileOut, aFileList, aLibList, ; - aPrevFiles ) +STATIC FUNCTION rtlnk_process( hbmk, cCommands, cFileOut, aFileList, ; + aLibList, aLibPath, aPrevFiles ) LOCAL cLine, cWord LOCAL nMode @@ -11954,7 +11963,10 @@ STATIC FUNCTION rtlnk_process( hbmk, cCommands, cFileOut, aFileList, aLibList, ; IF LEFTEQUAL( cWord, "#" ) EXIT ELSEIF nMode == RTLNK_MODE_OUT - cFileOut := cWord + cFileOut := hb_DirSepToOS( cWord ) + IF Lower( hb_FNameExt( cFileOut ) ) == ".exe" + cFileOut := FNameDirName( cFileOut ) + ENDIF nMode := RTLNK_MODE_FILENEXT ELSEIF nMode == RTLNK_MODE_FILE IF !( cWord == "," ) @@ -11965,7 +11977,10 @@ STATIC FUNCTION rtlnk_process( hbmk, cCommands, cFileOut, aFileList, aLibList, ; ENDIF ELSEIF nMode == RTLNK_MODE_LIB IF !( cWord == "," ) - AAdd( aLibList, hb_DirSepToOS( cWord ) ) + AAdd( aLibList, hb_FNameName( hb_DirSepToOS( cWord ) ) ) + IF ! Empty( hb_FNameDir( hb_DirSepToOS( cWord ) ) ) + AAddNew( aLibPath, hb_FNameDir( hb_DirSepToOS( cWord ) ) ) + ENDIF nMode := RTLNK_MODE_LIBNEXT ENDIF ELSEIF nMode == RTLNK_MODE_SKIP @@ -11987,7 +12002,7 @@ STATIC FUNCTION rtlnk_process( hbmk, cCommands, cFileOut, aFileList, aLibList, ; _hbmk_OutErr( hbmk, hb_StrFormat( I_( "Error: Cannot open file: %1$s" ), cWord ) ) RETURN .F. ENDIF - IF ! rtlnk_process( hbmk, cCommands, @cFileOut, @aFileList, @aLibList, aPrevFiles ) + IF ! rtlnk_process( hbmk, cCommands, @cFileOut, @aFileList, @aLibList, @aLibPath, aPrevFiles ) RETURN .F. ENDIF ELSE @@ -12004,9 +12019,9 @@ STATIC FUNCTION rtlnk_process( hbmk, cCommands, cFileOut, aFileList, aLibList, ; LEFTEQUAL( "REFER", cWord ) .OR. ; LEFTEQUAL( "INTO", cWord ) nMode := RTLNK_MODE_SKIP - /* blinker extension */ + /* Blinker extension */ ELSEIF LEFTEQUAL( "BLINKER", cWord ) - /* skip blinker commands */ + /* skip Blinker commands */ EXIT ELSEIF LEFTEQUAL( "ECHO", cWord ) _hbmk_OutStd( hbmk, hb_StrFormat( I_( "Blinker ECHO: %1$s" ), SubStr( cLine, 6 ) ) ) @@ -12017,7 +12032,7 @@ STATIC FUNCTION rtlnk_process( hbmk, cCommands, cFileOut, aFileList, aLibList, ; ELSEIF LEFTEQUAL( "NOBELL", cWord ) hbmk[ _HBMK_lBEEP ] := .F. EXIT - ELSE /* TODO: add other blinker commands */ + ELSE /* TODO: add other Blinker commands */ ENDIF ENDIF ENDIF @@ -16006,8 +16021,8 @@ STATIC PROCEDURE ShowHelp( hbmk, lFull, lLong ) LOCAL aLst_ExampleLib := { ; NIL, ; - { I_( "To build library 'mylib' from sources" ) , hb_StrFormat( I_( "%1$s mylibsrc.prg -omylib -hblib" ), _SELF_NAME_ ) }, ; - { I_( "To build library 'mylib' from sources using incremental mode" ) , hb_StrFormat( I_( "%1$s mylibsrc.prg -omylib -hblib -inc" ), _SELF_NAME_ ) } } + { I_( "To build library 'mylib' from sources" ) , hb_StrFormat( I_( "%1$s -hblib mylibsrc.prg -omylib" ), _SELF_NAME_ ) }, ; + { I_( "To build library 'mylib' from sources using incremental mode" ) , hb_StrFormat( I_( "%1$s -hblib mylibsrc.prg -omylib -inc" ), _SELF_NAME_ ) } } // ; diff --git a/harbour/website/samples/mousetst.prg.html b/harbour/website/samples/mousetst.prg.html index b4cf869a1c..70dccfe086 100644 --- a/harbour/website/samples/mousetst.prg.html +++ b/harbour/website/samples/mousetst.prg.html @@ -38,14 +38,14 @@ PROCEDURE Main() @ MaxRow() - 1, 2 SAY "Y:" @ MaxRow() - 1, 10 SAY "X:" - @ nR, 2 SAY "Mouse Type : " + @ nR, 2 SAY "Mouse Type :" @ nR, 18 SAY "Mouse System" @ MaxRow() - 2, 68 TO MaxRow(), MaxCol() DOUBLE @ MaxRow() - 1, 70 SAY "Exit" - @ 10, 2 SAY " -- Checkings -- " + @ 10, 2 SAY " -- Checkings --" @ 11, 2 SAY "Window Boundaries :" @ 12, 2 SAY "Press/Release But.:" @ 13, 2 SAY "Double Click Left :" @@ -55,7 +55,7 @@ PROCEDURE Main() TEST2( nR, nC ) - @ 24, 0 SAY "" + SetPos( MaxRow(), 0 ) SET CURSOR ON ? @@ -112,7 +112,6 @@ PROCEDURE TEST1() ENDIF ENDDO - @ MaxRow() - 3, 25 SAY "Move the cursor until the LEFT side " DO WHILE ( nKey := Inkey( 0, INKEY_ALL ) ) != K_TAB @@ -125,7 +124,6 @@ PROCEDURE TEST1() ENDIF ENDDO - @ MaxRow() - 3, 25 SAY "Move the cursor until the RIGHT side " DO WHILE ( nKey := Inkey( 0, INKEY_ALL ) ) != K_TAB @@ -149,17 +147,18 @@ PROCEDURE TEST2( nR, nC ) LOCAL cSkip := "", nKey, nPress := 0 - @ nR + 0, nC SAY "+---------|---------+" - @ nR + 1, nC SAY "| +===+ +===+ +===+ |" - @ nR + 2, nC SAY "| | | | | | | |" - @ nR + 3, nC SAY "| | | | | | | |" - @ nR + 4, nC SAY "| +===+ +===+ +===+ |" - @ nR + 6, nC SAY "| Up Up Up |" - @ nR + 7, nC SAY "| |" - @ nR + 8, nC SAY "| |" - @ nR + 9, nC SAY "| Harbour |" - @ nR + 10, nC SAY "| mouse |" - @ nR + 11, nC SAY "+-------------------+" + @ nR + 0, nC SAY "+---------|---------+" + @ nR + 1, nC SAY "| +===+ +===+ +===+ |" + @ nR + 2, nC SAY "| | | | | | | |" + @ nR + 3, nC SAY "| | | | | | | |" + @ nR + 4, nC SAY "| +===+ +===+ +===+ |" + @ nR + 5, nC SAY "| |" + @ nR + 6, nC SAY "| Up Up Up |" + @ nR + 7, nC SAY "| |" + @ nR + 8, nC SAY "| |" + @ nR + 9, nC SAY "| Harbour |" + @ nR + 10, nC SAY "| mouse |" + @ nR + 11, nC SAY "+-------------------+" Set( _SET_EVENTMASK, INKEY_ALL ) @@ -232,7 +231,7 @@ PROCEDURE TEST2( nR, nC ) @ 14, 22 SAY "Pass" OTHERWISE - @ MaxRow(), 20 SAY "A keyboard key was pressed: " + @ MaxRow(), 20 SAY "A keyboard key was pressed:" @ MaxRow(), 48 SAY nKey #ifdef __HARBOUR__ @ MaxRow(), 58 SAY hb_keyChar( nKey ) diff --git a/harbour/website/samples/testhtml.prg.html b/harbour/website/samples/testhtml.prg.html index d92bb32a7f..7779f86959 100644 --- a/harbour/website/samples/testhtml.prg.html +++ b/harbour/website/samples/testhtml.prg.html @@ -87,8 +87,7 @@ METHOD SetTitle( cTitle ) CLASS THTML METHOD AddLink( cLinkTo, cLinkName ) CLASS THTML - ::cBody := ::cBody + ; - "" + cLinkName + "" + ::cBody += "" + cLinkName + "" RETURN Self @@ -98,16 +97,15 @@ METHOD AddHead( cDescr ) CLASS THTML // ::cBody += ... // ??? - ::cBody := ::cBody + ; - "

" + cDescr + "

" + ::cBody += "

" + cDescr + "

" RETURN NIL METHOD AddPara( cPara, cAlign ) CLASS THTML - cAlign := iif( cAlign == NIL, "Left", cAlign ) // Added Patrick Mast 2000-06-17 + hb_default( @cAlign, "Left" ) - ::cBody := ::cBody + ; + ::cBody += ; "

" + hb_eol() + ; cPara + hb_eol() + ; "

" @@ -116,7 +114,7 @@ METHOD AddPara( cPara, cAlign ) CLASS THTML METHOD Generate() CLASS THTML - ::cContent := ; + ::cContent := ; "" + hb_eol() + ; "" + ::cTitle + "" + hb_eol() + ; "