From 7e446e2d023e59fa00d4f44a1049b3b547fecee8 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 10 Jun 2012 12:13:08 +0000 Subject: [PATCH] 2012-06-10 14:11 UTC+0200 Viktor Szakats (harbour syenar.net) * src/rtl/cdpdet.prg ! *nix specific CP autodetection code missed to call a local conversion subfunction. * src/rtl/gtfunc.c * HB_SETDISPCP(), HB_SETTERMCP(), HB_SETKEYCP() will now not RTE when passed NIL as 1st paramater. This makes it smoother to fall-back on purposedly invalid values, f.e. return values of new HB_CDPOS() and HB_CDPTERM() in case of failure. * contrib/hblzf/tests/test2.prg + replaced in-source hbmk2 cmdline instructions with #require directive * contrib/gtwvg/tests/wvgactivex.prg ! fixed reference to non-existing batch file * doc/en/file.txt * doc/gmake.txt * doc/windll.txt * examples/gtwvw/docs/gtwvw.txt * examples/gtwvw/docs/whatsnew.txt * examples/gtwvw/tests/drawimg.prg * examples/guestbk/guestbk.txt * examples/hscript/readme.txt - deleted references to non-existing/obsolete batch files --- harbour/ChangeLog | 29 ++++++++++++++++++++++ harbour/contrib/gtwvg/tests/wvgactivex.prg | 2 +- harbour/contrib/hblzf/tests/test2.prg | 5 ++-- harbour/doc/en/file.txt | 6 ++--- harbour/doc/gmake.txt | 28 ++------------------- harbour/doc/windll.txt | 5 ---- harbour/examples/gtwvw/docs/gtwvw.txt | 2 +- harbour/examples/gtwvw/docs/whatsnew.txt | 1 - harbour/examples/gtwvw/tests/drawimg.prg | 1 - harbour/examples/guestbk/guestbk.txt | 10 ++++---- harbour/examples/hscript/readme.txt | 2 +- harbour/src/rtl/cdpdet.prg | 2 ++ harbour/src/rtl/gtfunc.c | 6 ++--- 13 files changed, 49 insertions(+), 50 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a21ffd6ce4..63211addda 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,35 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-10 14:11 UTC+0200 Viktor Szakats (harbour syenar.net) + * src/rtl/cdpdet.prg + ! *nix specific CP autodetection code missed to call + a local conversion subfunction. + + * src/rtl/gtfunc.c + * HB_SETDISPCP(), HB_SETTERMCP(), HB_SETKEYCP() will + now not RTE when passed NIL as 1st paramater. This + makes it smoother to fall-back on purposedly invalid + values, f.e. return values of new HB_CDPOS() and + HB_CDPTERM() in case of failure. + + * contrib/hblzf/tests/test2.prg + + replaced in-source hbmk2 cmdline instructions with + #require directive + + * contrib/gtwvg/tests/wvgactivex.prg + ! fixed reference to non-existing batch file + + * doc/en/file.txt + * doc/gmake.txt + * doc/windll.txt + * examples/gtwvw/docs/gtwvw.txt + * examples/gtwvw/docs/whatsnew.txt + * examples/gtwvw/tests/drawimg.prg + * examples/guestbk/guestbk.txt + * examples/hscript/readme.txt + - deleted references to non-existing/obsolete batch files + 2012-06-10 01:26 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbmlzo/hbmlzo.hbc ! fixed commented lib reference rendering the .hbc file unusable diff --git a/harbour/contrib/gtwvg/tests/wvgactivex.prg b/harbour/contrib/gtwvg/tests/wvgactivex.prg index 1d5c7a17f6..d3c3baca73 100644 --- a/harbour/contrib/gtwvg/tests/wvgactivex.prg +++ b/harbour/contrib/gtwvg/tests/wvgactivex.prg @@ -134,7 +134,7 @@ FUNCTION ExecuteActiveX( nActiveX, xParam ) oXbp:killInputFocus := { |x,y,oSLE| x:=x,y:=y, oSLE:getData(), oPanel:caption := "cVarB =" + cVarB } // Read file into LOCAL variable - cText := MemoRead( 'hbmk_b32.bat' ) + cText := MemoRead( "hbmk.hbm" ) // Create MLE, specify position using :create() and // assign data code block accessing LOCAL variable oMLE := WvgMLE():new( oStatic2 ) diff --git a/harbour/contrib/hblzf/tests/test2.prg b/harbour/contrib/hblzf/tests/test2.prg index 54883b7633..e84502d44a 100644 --- a/harbour/contrib/hblzf/tests/test2.prg +++ b/harbour/contrib/hblzf/tests/test2.prg @@ -2,7 +2,8 @@ * $Id$ */ -/* hbmk2 testz.prg -lhbbz2 -lbz2 -lhblzf -llzf -es2 -w3 */ +#require "hbbz2" +#require "hblzf" #include "simpleio.ch" @@ -39,7 +40,7 @@ STATIC PROCEDURE MakeTest( ... ) nBegin := hb_secondsCPU() cRes := Eval( e:__enumValue(), iif( lCmp, hb_pValue( 3 ), e2 ), NIL, @nResult ) nEnd := hb_secondsCPU() - IF lCmp + IF lCmp e2 := cRes ENDIF cFmt := hb_strFormat( ; diff --git a/harbour/doc/en/file.txt b/harbour/doc/en/file.txt index 47e70947ad..90cb2c05f3 100644 --- a/harbour/doc/en/file.txt +++ b/harbour/doc/en/file.txt @@ -714,8 +714,7 @@ * The file must be considered closed by the operating system before it * may be deleted. * $EXAMPLES$ - * ERASE C:\autoexec.bat - * ERASE C:/temp/read.txt + * ERASE C:\temp\read.txt * $STATUS$ * R * $COMPLIANCE$ @@ -749,8 +748,7 @@ * The file must be considered closed by the operating system before it * may be deleted. * $EXAMPLES$ - * ERASE C:\autoexec.bat - * ERASE C:/temp/read.txt + * ERASE C:\temp\read.txt * $STATUS$ * R * $COMPLIANCE$ diff --git a/harbour/doc/gmake.txt b/harbour/doc/gmake.txt index ec3f1805e3..aa7b15c881 100644 --- a/harbour/doc/gmake.txt +++ b/harbour/doc/gmake.txt @@ -142,13 +142,11 @@ For gcc on Win95/WinNT with the Cygwin library: wildcard command line arguments (this is checked at run-time!) HB_PLATFORM win HB_COMPILER gcc - HB_GT_LIB gtwin CYGWIN noglob For gcc on Win95/WinNT with the MinGW library: HB_PLATFORM win HB_COMPILER mingw - HB_GT_LIB gtwin For MSVC on Win95/WinNT: Notes: gnu make is case sensitive! If your editor converts @@ -157,40 +155,23 @@ For MSVC on Win95/WinNT: If you have MAKE_MODE in your dos environment, make sure it is not set to unix - For best results, in your copy of make_gnu.bat, also set: + For best results, also set: HB_PLATFORM win HB_COMPILER msvc - HB_GT_LIB gtwin For GCC on BSD: HB_PLATFORM bsd HB_COMPILER gcc - HB_GT_LIB gtstd Notes: 1) You have to have bison and gmake installed in order to build Harbour for BSD. The file doc/howtobsd.txt gives an overview of what is required. - 2) If you have an ncurses library or a slang library, you may - want to try one of the following two values for HB_GT_LIB: - gtcrs - gtsln - In which case you'll also need to export HB_SCREEN_LIB with - the name of the appropriate screen library, if it doesn't - match the default value in config/bsd/gcc.mk For GCC on Linux: HB_PLATFORM linux HB_COMPILER gcc - HB_GT_LIB gtstd Notes: - 1) If you have an ncurses library or a slang library, you may - want to try one of the following two values for HB_GT_LIB: - gtcrs - gtsln - In which case you'll also need to export HB_SCREEN_LIB with - the name of the appropriate screen library, if it doesn't - match the default value in config/linux/gcc.mk. - 2) If you want to take advantage of compiler cache programs + 1) If you want to take advantage of compiler cache programs (such as http://ccaache.samba.org), you may set environment variable HB_CCACHE with the value containing the name of program. @@ -199,26 +180,21 @@ For GCC on OS/2 for VIO mode: you must also point LIBRARY_PATH to the EMX library directory. HB_PLATFORM os2 HB_COMPILER gcc - HB_GT_LIB gtos2 For Borland C++ 5.5 HB_PLATFORM win HB_COMPILER bcc - HB_GT_LIB gtwin For Borland C++ 3.x HB_PLATFORM dos - HB_GT_LIB gtdos For DJGPP (GCC port for DOS) HB_PLATFORM dos HB_COMPILER djgpp - HB_GT_LIB gtdos For Watcom C/C++ 10.x (default Makefile creates DOS4G extender executables) HB_PLATFORM dos HB_COMPILER watcom - HB_GT_LIB gtdos Note: It is possible that you will have to increase the space reserved for DOS environment variables in order to successfuly run make utility (Add for example: diff --git a/harbour/doc/windll.txt b/harbour/doc/windll.txt index ba8905c7fc..97f7283624 100644 --- a/harbour/doc/windll.txt +++ b/harbour/doc/windll.txt @@ -29,10 +29,6 @@ Harbour supports Windows DLLs in 3 ways. For the Borland C platform, use that library and import32.lib and cw32.lib from Borland, and you are ready to go. - See contrib\delphi\hbdll for an example of a Delphi program that can - use all of Harbour's functionality by accessing a self-contained DLL. - bld_sdll.bat is used there to create the DLL. - 2) PCode EXEs using a Harbour.dll @@ -90,4 +86,3 @@ Please notice that there are three different Windows DLL entry points: If you are looking to build a Harbour.dll, then you must use maindllh.c - diff --git a/harbour/examples/gtwvw/docs/gtwvw.txt b/harbour/examples/gtwvw/docs/gtwvw.txt index 547e839bdc..89a867a333 100644 --- a/harbour/examples/gtwvw/docs/gtwvw.txt +++ b/harbour/examples/gtwvw/docs/gtwvw.txt @@ -196,7 +196,7 @@ All those commands/functions behave the same way as in other GTs. Unlike other GTs, however, GTWVW supports multi-windows. GTWVW has been tested using BCC32 only. To use GTWVW, build GTWVW.LIB using -make_b32.bat, then link it to your application as your GT. (Currently +hbmk2, then link it to your application as your GT. (Currently GTWVW cannot coexist with GTWVT in a MULTIGT environment.) Some special characteristics of GTWVW: diff --git a/harbour/examples/gtwvw/docs/whatsnew.txt b/harbour/examples/gtwvw/docs/whatsnew.txt index 4b588f5746..79156e87cc 100644 --- a/harbour/examples/gtwvw/docs/whatsnew.txt +++ b/harbour/examples/gtwvw/docs/whatsnew.txt @@ -113,7 +113,6 @@ + contrib/gtwvw/samples/drawimg.prg + contrib/gtwvw/samples/wutil.prg + contrib/gtwvw/samples/wutil.ch - + contrib/gtwvw/samples/drawimg.bat * A sample about this new feature. Notes on WVW_DRAWIMAGE() diff --git a/harbour/examples/gtwvw/tests/drawimg.prg b/harbour/examples/gtwvw/tests/drawimg.prg index 462eb32033..fb167f4530 100644 --- a/harbour/examples/gtwvw/tests/drawimg.prg +++ b/harbour/examples/gtwvw/tests/drawimg.prg @@ -4,7 +4,6 @@ /* compile and link this file together with wutil.prg - (use drawimg.bat to build) This is a sample of how to display an image file (.bmp,.gif,.jpg) in four ways: diff --git a/harbour/examples/guestbk/guestbk.txt b/harbour/examples/guestbk/guestbk.txt index 6098d458bb..ebd3a0592e 100644 --- a/harbour/examples/guestbk/guestbk.txt +++ b/harbour/examples/guestbk/guestbk.txt @@ -4,12 +4,12 @@ Felipe Coury How to create and test the Harbour Guestbook -You'll find bldguest.bat, guestbk.prg, guestbk.htm and -guestbk.htm files. To build the executable, review -guestbk.prg and check the directories for locating -guestbk.ini and guestbk.htm correctly. +You'll find guestbk.prg and guestbk.htm files. +To build the executable, review guestbk.prg and +check the directories for locating guestbk.ini +and guestbk.htm correctly. -With that done, build it using bldguest.bat. Put the +With that done, build it using hbmk2. Put the resulting .exe, the .exe and .htm files on a script- enabled directory and call guestbk.exe via WebBrowser. diff --git a/harbour/examples/hscript/readme.txt b/harbour/examples/hscript/readme.txt index 1bf3307baa..2953a48e58 100644 --- a/harbour/examples/hscript/readme.txt +++ b/harbour/examples/hscript/readme.txt @@ -17,7 +17,7 @@ Inside this .zip file you will find HarbourScript package. This should be unzipped to /tests/working/hscript directory in order to work w/o any changes. -To make the HarbourScript Translator, hscript.exe, use makehs.bat. +To make the HarbourScript Translator, hscript.exe, use hbmk2. If you are going to test offline, there's no need to make it, it will be done automatically for you (Batch Power). To test it, you'll have the following options: diff --git a/harbour/src/rtl/cdpdet.prg b/harbour/src/rtl/cdpdet.prg index e73af667d4..618a022b47 100644 --- a/harbour/src/rtl/cdpdet.prg +++ b/harbour/src/rtl/cdpdet.prg @@ -63,6 +63,7 @@ FUNCTION hb_cdpTerm() ELSE __UnixParseLangCP( GetEnv( "LC_CTYPE" ), @cCP, @cLang ) ENDIF + cCP := __CPUnixToCPStd( cCP ) #elif defined( __PLATFORM__DOS ) /* TODO */ #elif defined( __PLATFORM__OS2 ) @@ -88,6 +89,7 @@ FUNCTION hb_cdpOS() ELSE __UnixParseLangCP( GetEnv( "LC_CTYPE" ), @cCP, @cLang ) ENDIF + cCP := __CPUnixToCPStd( cCP ) #elif defined( __PLATFORM__DOS ) /* TODO */ #elif defined( __PLATFORM__OS2 ) diff --git a/harbour/src/rtl/gtfunc.c b/harbour/src/rtl/gtfunc.c index 81825e4d90..661d0b6d28 100644 --- a/harbour/src/rtl/gtfunc.c +++ b/harbour/src/rtl/gtfunc.c @@ -63,7 +63,7 @@ HB_FUNC( HB_SETDISPCP ) else hb_gtSetDispCP( hb_parc( 1 ), hb_parc( 2 ), hb_parl( 3 ) ); } - else + else if( !( hb_pcount() >= 1 && HB_ISNIL( 1 ) ) ) hb_errRT_BASE_SubstR( EG_ARG, 1089, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } @@ -71,7 +71,7 @@ HB_FUNC( HB_SETKEYCP ) { if( HB_ISCHAR( 1 ) ) hb_gtSetKeyCP( hb_parc( 1 ), hb_parc( 2 ) ); - else + else if( !( hb_pcount() >= 1 && HB_ISNIL( 1 ) ) ) hb_errRT_BASE_SubstR( EG_ARG, 1089, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } @@ -90,7 +90,7 @@ HB_FUNC( HB_SETTERMCP ) hb_gtSetKeyCP( hb_parc( 1 ), hb_parc( 2 ) ); } } - else + else if( !( hb_pcount() >= 1 && HB_ISNIL( 1 ) ) ) hb_errRT_BASE_SubstR( EG_ARG, 1089, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); }