diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6780f44aa3..536d551c42 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,53 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-13 15:10 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * include/hbsetup.ch + * Disabled HB_LEGACY_LEVEL2 by default. + * HB_LEGACY_OFF now controls HB_LEGACY_LEVEL3 (was HB_LEGACY_LEVEL2). + + Added HB_LEGACY_LEVEL4 + ; SVN users notice: This may make your C code INCOMPATIBLE with + this version, please review required changes (documented in older + ChangeLog entries) and update your code. Look for HB_LEGACY_LEVEL2 + and INCOMPATIBLE keywords. + + * contrib/hbnetio/utils/netiosrv.prg + + contrib/hbnetio/utils/modules.hbp + + contrib/hbnetio/utils/modules + + contrib/hbnetio/utils/modules/test.prg + + Added simple command line to server. + + Added list of possible feature as TODO. Most of these will + need backend support from hbnetio lib. + + Added detailed help screen. + + Added --version option support. + + Added support for -rpc=file.hrb option. Although for some + reason (most likely my omission) it doesn't work yet. + + -DHB_EXTERN will now enable inclusion of all core functions. + + Added build file for .hrb modules. + + Added little test module. + + Added SETCANCEL( .F. ) to avoid irregular shutdown with Ctrl+C. + + * src/rtl/memoedit.prg + ! Deleted hack which explicitly set lastkey to CTRL_END/W + when exiting with changes saved. The comment said that + it was added to make DBU happy, but it doesn't seem to be + necessary anymore, at least I couldn't spot any problem + without it. Pls check it. + ! Fixed MEMOEDIT() not recognizing K_ESC as exit key when + custom function is used. + This fixes DBU not recognizing K_ESC as a way to exit + memo editing. Please review, I'm not MEMOEDIT() user + and this was such an obvious omission that I wonder + if there was some real reason for it. Anyhow it was + wrong before. + + * contrib/hbfimage/fi_wrp.c + * contrib/hbclipsm/num.c + * contrib/hbclipsm/numfloor.c + * contrib/hbclipsm/status.c + * contrib/hbclipsm/numceil.c + * Formatting. + 2010-01-13 13:07 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rdd/hbsix/sxcompat.prg ! fixed bug reported by Stupar: OrdSetFocus() used instead of OrdNumber() @@ -52,6 +99,7 @@ ! fixed GPF in FILEDRIVE() function on platforms which do not support drive letters or when path does not contain drive. % small optimization in FILEPATH(), FILEBASE(), FILEEXT(), FILEDRIVE() + [TOMERGE 2.0] 2010-01-11 18:12 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/generator/hbqtgen.prg @@ -61,9 +109,9 @@ * contrib/hbqt/qtnetwork/* + Implemented Linguistic Translation Mechanism base call. The next step is to feed translations into Qt's engine. - This means any string sent to QWidgets will be translated + This means any string sent to QWidgets will be translated through the language set with hbqt_SetCodecForTr( cCodec ). - The translated string is in the context of the widget it + The translated string is in the context of the widget it is being applied to. TODO: Feed the translations from outer source. @@ -150,6 +198,7 @@ * contrib/hbssl/pem.c ! Wrapped hb_vmEvalBlockV() calls between hb_vmRequestReender() and hb_vmRequestRestore() call pairs. + [TOMERGE 2.0] 2010-01-12 15:21 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/examples/gtwvw/gtwvw.c diff --git a/harbour/contrib/hbclipsm/num.c b/harbour/contrib/hbclipsm/num.c index c4612ef94c..ba0c092995 100644 --- a/harbour/contrib/hbclipsm/num.c +++ b/harbour/contrib/hbclipsm/num.c @@ -72,9 +72,7 @@ HB_FUNC( DTOR ) HB_FUNC( NUMASLOG10 ) { if( HB_ISNUM( 1 ) ) - { hb_retnd( log10( hb_parnd(1) ) ); - } } /* NumGetDecimals( ) --> nDecimals @@ -85,9 +83,7 @@ HB_FUNC( NUMGETDECIMALS ) int iDec = 0; if( HB_ISNUM( 1 ) ) - { hb_itemGetNLen( hb_param( 1, HB_IT_NUMERIC ), NULL, &iDec ); - } hb_retnl( iDec ); } diff --git a/harbour/contrib/hbclipsm/numceil.c b/harbour/contrib/hbclipsm/numceil.c index dfd3b31366..3562d7070d 100644 --- a/harbour/contrib/hbclipsm/numceil.c +++ b/harbour/contrib/hbclipsm/numceil.c @@ -59,5 +59,5 @@ */ HB_FUNC( CEILING ) { - hb_retnl( (long) ceil( hb_parnd( 1 ) ) ); + hb_retnl( ( long ) ceil( hb_parnd( 1 ) ) ); } diff --git a/harbour/contrib/hbclipsm/numfloor.c b/harbour/contrib/hbclipsm/numfloor.c index f18abffa10..7beb078f59 100644 --- a/harbour/contrib/hbclipsm/numfloor.c +++ b/harbour/contrib/hbclipsm/numfloor.c @@ -59,5 +59,5 @@ */ HB_FUNC( FLOOR ) { - hb_retnl( (long) floor( hb_parnd( 1 ) ) ); + hb_retnl( ( long ) floor( hb_parnd( 1 ) ) ); } diff --git a/harbour/contrib/hbclipsm/status.c b/harbour/contrib/hbclipsm/status.c index 9250c2d881..fa9be97d7a 100644 --- a/harbour/contrib/hbclipsm/status.c +++ b/harbour/contrib/hbclipsm/status.c @@ -83,7 +83,7 @@ HB_FUNC( STATUSUPDATE ) if( pArray ) { - const char * szDisplay = "|/-\\"; + const char * szDisplay = "|/-\\"; long lCurrent = hb_arrayGetNL( pArray, ST_CURRENT ); char * szOldColor[ HB_CLRSTR_LEN ]; PHB_ITEM pCurrent = hb_itemNew( NULL ); diff --git a/harbour/contrib/hbfimage/fi_wrp.c b/harbour/contrib/hbfimage/fi_wrp.c index 5f375f0ee6..ae1add3b6a 100644 --- a/harbour/contrib/hbfimage/fi_wrp.c +++ b/harbour/contrib/hbfimage/fi_wrp.c @@ -855,8 +855,8 @@ HB_FUNC( FI_GETIMAGETYPE ) /* DLL_API BOOL DLL_CALLCONV FreeImage_IsLittleEndian(void); */ HB_FUNC( FI_ISLITTLEENDIAN ) { - /* run function & return value */ - hb_retl( FreeImage_IsLittleEndian() ); + /* run function & return value */ + hb_retl( FreeImage_IsLittleEndian() ); } /* -------------------------------------------------------------------------- */ diff --git a/harbour/contrib/hbnetio/utils/modules.hbp b/harbour/contrib/hbnetio/utils/modules.hbp new file mode 100644 index 0000000000..116c4cd0d5 --- /dev/null +++ b/harbour/contrib/hbnetio/utils/modules.hbp @@ -0,0 +1,6 @@ +# +# $Id$ +# + +-gh +modules/*.prg diff --git a/harbour/contrib/hbnetio/utils/modules/test.prg b/harbour/contrib/hbnetio/utils/modules/test.prg new file mode 100644 index 0000000000..6fdd5f011b --- /dev/null +++ b/harbour/contrib/hbnetio/utils/modules/test.prg @@ -0,0 +1,9 @@ +/* + * $Id$ + */ + +FUNCTION HBNETIOSRV_RPCMAIN( sFunc, ... ) + + OutStd( "DO", sFunc:name, "WITH", ..., hb_osNewLine() ) + + RETURN sFunc:exec( ... ) diff --git a/harbour/contrib/hbnetio/utils/netiosrv.prg b/harbour/contrib/hbnetio/utils/netiosrv.prg index 4b01c8580e..f25ce2871f 100644 --- a/harbour/contrib/hbnetio/utils/netiosrv.prg +++ b/harbour/contrib/hbnetio/utils/netiosrv.prg @@ -12,11 +12,28 @@ * */ +/* + * The following parts are Copyright of the individual authors. + * www - http://www.harbour-project.org + * + * Copyright 2010 Viktor Szakats (harbour.01 syenar.hu) + * ... + * + * See COPYING for licensing terms. + * + */ + +#include "hbhrb.ch" + /* netio_mtserver() needs MT HVM version */ REQUEST HB_MT +#define _RPC_FILTER "HBNETIOSRV_RPCMAIN" + /* enable this if you need all core functions in RPC support */ -//REQUEST __HB_EXTERN__ +#ifdef HB_EXTERN + REQUEST __HB_EXTERN__ +#endif PROCEDURE Main( ... ) LOCAL pListenSocket @@ -26,8 +43,12 @@ PROCEDURE Main( ... ) LOCAL ifaddr := "0.0.0.0" LOCAL rootdir := hb_dirBase() LOCAL rpc := .F. + LOCAL rpc_filename := NIL + LOCAL rpc_hrb := NIL LOCAL passwd := NIL + LOCAL cCommand + HB_Logo() FOR EACH cParam IN hb_AParams() @@ -40,8 +61,18 @@ PROCEDURE Main( ... ) rootdir := SubStr( cParam, 10 ) CASE Lower( Left( cParam, 6 ) ) == "-pass=" passwd := SubStr( cParam, 7 ) + CASE Lower( Left( cParam, 5 ) ) == "-rpc=" + rpc_filename := SubStr( cParam, 6 ) + rpc_hrb := hb_hrbLoad( rpc_filename ) + rpc := ! Empty( rpc_hrb ) .AND. ! Empty( hb_hrbGetFunSym( rpc_hrb, _RPC_FILTER ) ) + IF ! rpc + rpc_filename := NIL + rpc_hrb := NIL + ENDIF CASE Lower( cParam ) == "-rpc" rpc := .T. + CASE Lower( cParam ) == "--version" + RETURN CASE Lower( cParam ) == "-help" .OR. ; Lower( cParam ) == "--help" HB_Usage() @@ -51,7 +82,9 @@ PROCEDURE Main( ... ) ENDCASE NEXT - pListenSocket := netio_mtserver( port, ifaddr, rootdir, rpc, passwd ) + SetCancel( .F. ) + + pListenSocket := netio_mtserver( port, ifaddr, rootdir, iif( Empty( rpc_hrb ), rpc, hb_hrbGetFunSym( rpc_hrb, _RPC_FILTER ) ), passwd ) IF Empty( pListenSocket ) OutStd( "Cannot start server." + hb_osNewLine() ) ELSE @@ -59,13 +92,50 @@ PROCEDURE Main( ... ) OutStd( "Root filesystem: " + rootdir + hb_osNewLine() ) OutStd( "RPC support: " + iif( rpc, "enabled", "disabled" ) + hb_osNewLine() ) OutStd( "Encryption: " + iif( passwd != NIL, "enabled", "disabled" ) + hb_osNewLine() ) + IF ! Empty( rpc_hrb ) + OutStd( "RPC filter module: " + rpc_filename + hb_osNewLine() ) + ENDIF OutStd( hb_osNewLine() ) - OutStd( "Press any key to stop NETIO server." + hb_osNewLine() ) - Inkey( 0 ) + OutStd( "hbnetiosrv command prompt:", hb_osNewLine() ) + + /* Command prompt */ + DO WHILE .T. + + OutStd( "hbnetiosrv$ " ) + ACCEPT TO cCommand + OutStd( hb_osNewLine() ) + + /* TODO: - on the fly change of RPC filter modules + - listing active connections + - listing open files + - listing active locks + - activity meters (transferred bytes, bandwidth, etc) + - showing number of connections + - showing number of open files + - listing transferred bytes + - gracefully shutting down server by waiting for connections to close and not accept new ones + - pausing server + + - Command history with up/down + - More powerful cmdline editor + - cut/paste support */ + + DO CASE + CASE Lower( cCommand ) == "exit" + EXIT + CASE Lower( cCommand ) == "help" + OutStd( "EXIT - Stop server and exit", hb_osNewLine() ) + CASE ! Empty( cCommand ) + OutStd( "Error: Unknown command.", hb_osNewLine() ) + ENDCASE + ENDDO netio_serverstop( pListenSocket ) pListenSocket := NIL + + OutStd( hb_osNewLine() ) + OutStd( "Server stopped.", hb_osNewLine() ) ENDIF RETURN @@ -81,7 +151,22 @@ STATIC PROCEDURE HB_Logo() STATIC PROCEDURE HB_Usage() - OutStd( "Syntax: netiosrv [-port=] [-iface=] [-rootdir=] [-rpc] [-pass=]" + hb_osNewLine() ) + OutStd( "Syntax:" , hb_osNewLine() ) + OutStd( hb_osNewLine() ) + OutStd( " netiosrv [options]" , hb_osNewLine() ) + OutStd( hb_osNewLine() ) + OutStd( "Options:" , hb_osNewLine() ) + OutStd( hb_osNewLine() ) + OutStd( " -port= accept incoming connections on IP port " , hb_osNewLine() ) + OutStd( " -iface= accept incoming connections on IPv4 interface " , hb_osNewLine() ) + OutStd( " -rootdir= use as root directory for served file system" , hb_osNewLine() ) + OutStd( " -rpc accept RPC requests" , hb_osNewLine() ) + OutStd( " -rpc= set RPC processor .hrb module to " , hb_osNewLine() ) + OutStd( hb_StrFormat( " file.hrb needs to have an entry function named %1$s()", _RPC_FILTER ), hb_osNewLine() ) + OutStd( " -pass= set server password" , hb_osNewLine() ) + OutStd( hb_osNewLine() ) + OutStd( " --version display version header only" , hb_osNewLine() ) + OutStd( " -help|--help this help" , hb_osNewLine() ) RETURN diff --git a/harbour/include/hbsetup.ch b/harbour/include/hbsetup.ch index 6c0ede4743..ef942fc524 100644 --- a/harbour/include/hbsetup.ch +++ b/harbour/include/hbsetup.ch @@ -79,10 +79,10 @@ * NOTE: C code using legacy Clipper (.api) headers is unaffected. */ #ifndef HB_LEGACY_OFF -#define HB_LEGACY_LEVEL2 +#define HB_LEGACY_LEVEL3 #endif /* Future level of legacy cleanup */ -#define HB_LEGACY_LEVEL3 +#define HB_LEGACY_LEVEL4 #endif /* HB_SETUP_CH_ */ diff --git a/harbour/src/rtl/memoedit.prg b/harbour/src/rtl/memoedit.prg index 426ebf12d9..5ad9dd998a 100644 --- a/harbour/src/rtl/memoedit.prg +++ b/harbour/src/rtl/memoedit.prg @@ -199,9 +199,13 @@ METHOD HandleUserKey( nKey, nUserKey ) CLASS HBMemoEditor // HBEditor is not able to handle keys with a value higher than 256, but I have to tell him // that user wants to save text - IF ( nKey <= 256 .OR. nKey == K_ALT_W ) + DO CASE + CASE nKey == K_ESC + ::lSaved := .F. + ::lExitEdit := .T. + CASE nKey <= 256 .OR. nKey == K_ALT_W ::super:Edit( nKey ) - ENDIF + ENDCASE // TOFIX: Not CA-Cl*pper compatible, see teditor.prg CASE ( nUserKey >= 1 .AND. nUserKey <= 31 ) .OR. nUserKey == K_ALT_W @@ -308,8 +312,6 @@ FUNCTION MemoEdit( cString,; oEd:Edit() IF oEd:Changed() cString := oEd:GetText() - // dbu tests for LastKey() == K_CTRL_END, so I try to make it happy - HB_SetLastKey( K_CTRL_END ) ENDIF SetCursor( nOldCursor ) ENDIF