diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2a7101986c..4df7834259 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,22 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-14 13:30 UTC+0200 Viktor Szakats (harbour syenar.net) + + contrib/hbrun/p_ext.hb + + utils/hbmk2/p_ext.hb + - contrib/hbrun/extdynpl.hb + - utils/hbmk2/p_extdyn.hb + * contrib/hbqt/hbmk2_qt.hb + * contrib/hbrun/hbrun.prg + * contrib/hbrun/plugins.prg + * contrib/make.hb + * utils/hbmk2/hbmk2.prg + * cleanups, syncing between hbrun and hbmk2 runner mode. + __HBSCRIPT__* predefined macros renamed, public hbshell + (was hbrun) APIs renamed. INCOMPATIBLE but its doubtful + anybody used these. + - deleted just added public APIs to load/unload extensions + 2012-06-14 12:12 UTC+0200 Viktor Szakats (harbour syenar.net) * utils/hbmk2/hbmk2.prg ! bah, leftover test line deleted diff --git a/harbour/contrib/hbqt/hbmk2_qt.hb b/harbour/contrib/hbqt/hbmk2_qt.hb index 91a3e2a294..5056964a2b 100644 --- a/harbour/contrib/hbqt/hbmk2_qt.hb +++ b/harbour/contrib/hbqt/hbmk2_qt.hb @@ -35,7 +35,7 @@ #define I_( x ) hb_i18n_gettext( x ) -#if defined( __HBSCRIPT__HBMK ) +#if defined( __HBSCRIPT__HBMK_PLUGIN ) FUNCTION hbmk_plugin_qt( hbmk ) LOCAL cRetVal := "" @@ -1456,7 +1456,7 @@ METHOD HbQtSource:build() IF ::cQtVer > "0x040500" AAdd( aLine, "#if QT_VERSION >= " + ::cQtVer ) ENDIF - + IF ::cQtVer > "0x040500" AAdd( aLine, "#endif" ) ENDIF @@ -2400,7 +2400,7 @@ METHOD HbQtSource:parseProto( cProto, fBody_ ) ENDIF oArg:cDoc := "c" + oMtd:cDocNM // oArg:cCast - W R O N G oArg:cTypeHB := "C" - + CASE oArg:lFar cRef := oArg:cCast oArg:cBody := "hbqt_par_" + oArg:cCast + "( " + cHBIdx + " )" @@ -2822,7 +2822,7 @@ METHOD HbqtArgument:new( cTxt, cQtObject, enum_, lConstL, lIsRetArg ) STATIC FUNCTION hbqtgen_Get_Command_1( cWgt, cCmn ) RETURN 'hb_itemReturnRelease( hbqt_bindGetHbObject( NULL, ' + 'new ' + cWgt + '( *( ' + cCmn + ' ) )' + ', "' + 'HB_' + Upper( cWgt ) + '", hbqt_del_' + cWgt + ', ' + qth_get_bits( cWgt, .t. ) + ' ) )' - + /*----------------------------------------------------------------------*/ STATIC FUNCTION hbqtgen_Get_Command( cWgt, cCmn, lNew, isRetDetached ) @@ -2839,7 +2839,7 @@ STATIC FUNCTION hbqtgen_Get_Command( cWgt, cCmn, lNew, isRetDetached ) ELSE RETURN 'hb_itemReturnRelease( hbqt_bindGetHbObject( NULL, ' + cCmn + ', "' + 'HB_' + Upper( cWgt ) + '", hbqt_del_' + cWgt + ', ' + qth_get_bits( cWgt, isRetDetached ) + ' ) )' ENDIF - + RETURN "" /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbrun/hbrun.prg b/harbour/contrib/hbrun/hbrun.prg index a325adbbda..5ffd59fa71 100644 --- a/harbour/contrib/hbrun/hbrun.prg +++ b/harbour/contrib/hbrun/hbrun.prg @@ -187,7 +187,7 @@ PROCEDURE _APPMAIN( cFile, ... ) LoadExtDynamicFromSource( aDynamic, cFile ) cFile := hb_compileBuf( hHeaders, hb_ProgName(), "-n2", "-w", "-es2", "-q0", ; - "-I" + hb_FNameDir( cFile ), "-D" + "__HBSCRIPT__HBRUN", cFile ) + "-I" + hb_FNameDir( cFile ), "-D" + "__HBSCRIPT__HBSHELL", cFile ) IF cFile == NIL ErrorLevel( 1 ) EXIT @@ -210,12 +210,11 @@ PROCEDURE _APPMAIN( cFile, ... ) RETURN -/* Public hbrun API */ -FUNCTION hbrun_DirBase() +/* Public hbshell API */ +FUNCTION hbshell_DirBase() RETURN s_cDirBase -/* Public hbrun API */ -FUNCTION hbrun_ProgName() +FUNCTION hbshell_ProgName() RETURN s_cProgName INIT PROCEDURE ClipInit() diff --git a/harbour/contrib/hbrun/extdynpl.hb b/harbour/contrib/hbrun/p_ext.hb similarity index 100% rename from harbour/contrib/hbrun/extdynpl.hb rename to harbour/contrib/hbrun/p_ext.hb diff --git a/harbour/contrib/hbrun/plugins.prg b/harbour/contrib/hbrun/plugins.prg index 34578bcef2..8b52bfab89 100644 --- a/harbour/contrib/hbrun/plugins.prg +++ b/harbour/contrib/hbrun/plugins.prg @@ -62,7 +62,7 @@ FUNCTION __hbrun_plugins() LOCAL file ADD PLUGIN TO hPlugins FILE "netiomgm.hb" - ADD PLUGIN TO hPlugins FILE "extdynpl.hb" + ADD PLUGIN TO hPlugins FILE "p_ext.hb" cDir := __hbrun_ConfigDir() diff --git a/harbour/contrib/make.hb b/harbour/contrib/make.hb index 2388a856d9..a4e8a76e3b 100755 --- a/harbour/contrib/make.hb +++ b/harbour/contrib/make.hb @@ -80,8 +80,8 @@ PROCEDURE Main( ... ) s_cRoot := "../" ENDIF - #if defined( __HBSCRIPT__HBRUN ) - s_cBinDir := hbrun_DirBase() + #if defined( __HBSCRIPT__HBSHELL ) + s_cBinDir := hbshell_DirBase() #else s_cBinDir := hb_DirBase() #endif diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 615948d087..87da14cb62 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -249,7 +249,8 @@ REQUEST hbmk_KEYW #define _HBMK_HAS_TPL "HBMK_HAS_%1$s" #define _HBMK_HAS_TPL_LOCAL "HBMK_HAS_%1$s_LOCAL" #define _HBMK_DIR_TPL "HBMK_DIR_%1$s" -#define _HBMK_SCRIPT "__HBSCRIPT__HBMK" +#define _HBMK_PLUGIN "__HBSCRIPT__HBMK_PLUGIN" +#define _HBMK_SHELL "__HBSCRIPT__HBSHELL" #define _HBMK_IMPLIB_EXE_POST "_exe" #define _HBMK_IMPLIB_DLL_POST "_dll" @@ -517,7 +518,7 @@ REQUEST hbmk_KEYW #define PathMakeAbsolute( cPathR, cPathA ) hb_PathJoin( cPathA, cPathR ) -/* Request for runner and interactive shell */ +/* Request for runner and shell */ REQUEST __HB_EXTERN__ /* Request some functions for plugins */ @@ -8634,7 +8635,7 @@ STATIC PROCEDURE PlugIn_Load( hbmk, cFileName ) ENDIF IF ! lOK .AND. !( Lower( cExt ) == ".hrb" ) /* Optimization: Don't try to load it as .prg if the extension is .hrb */ cType := I_( "(source)" ) - cFile := hb_compileFromBuf( cFile, "-n2", "-w3", "-es2", "-q0", "-i" + hbmk[ _HBMK_cHB_INSTALL_INC ], "-D" + _HBMK_SCRIPT ) + cFile := hb_compileFromBuf( cFile, "-n2", "-w3", "-es2", "-q0", "-i" + hbmk[ _HBMK_cHB_INSTALL_INC ], "-D" + _HBMK_PLUGIN ) IF ! Empty( cFile ) hrb := hb_hrbLoad( HB_HRB_BIND_FORCELOCAL, cFile ) ENDIF @@ -12274,26 +12275,26 @@ STATIC PROCEDURE __hbrun_minimal( cFile, ... ) NEXT cFile := hb_compileBuf( hbmk_CoreHeaderFiles(), hb_ProgName(), "-n2", "-w", "-es2", "-q0", ; - hb_ArrayToParams( aINCPATH ), "-D" + "__HBSCRIPT__HBRUN", cFile ) + hb_ArrayToParams( aINCPATH ), "-D" + _HBMK_SHELL, cFile ) IF cFile == NIL ErrorLevel( 1 ) EXIT ENDIF CASE ".hrb" - __hbrun_extensions_dynamic_init( aDynamic ) + __hbrun_extensions_init( aDynamic ) s_cDirBase_hbrun := hb_DirBase() s_cProgName_hbrun := hb_ProgName() hb_argShift( .T. ) hb_hrbRun( cFile, ... ) EXIT CASE ".dbf" - __hbrun_extensions_dynamic_init( aDynamic ) + __hbrun_extensions_init( aDynamic ) __hbrun_shell( hb_AParams(), "USE " + cFile + " SHARED" ) EXIT ENDSWITCH ELSE - __hbrun_extensions_dynamic_init( aDynamic ) + __hbrun_extensions_init( aDynamic ) __hbrun_shell( hb_AParams() ) ENDIF @@ -12385,12 +12386,12 @@ STATIC PROCEDURE __hbrun_LoadExtDynamicFromSource( aDynamic, cFileName ) RETURN -STATIC PROCEDURE __hbrun_extensions_dynamic_init( aDynamic ) +STATIC PROCEDURE __hbrun_extensions_init( aDynamic ) LOCAL cName IF ! Empty( aDynamic ) FOR EACH cName IN aDynamic - __hbrun_extensions_dynamic_load( cName ) + __hbrun_extensions_load( cName ) NEXT ENDIF @@ -12400,7 +12401,7 @@ STATIC PROCEDURE __hbrun_extensions_dynamic_init( aDynamic ) /* TOFIX: Load components from detected Harbour dir layout */ /* TODO: Load .hbc file (handle -stop command in it) and extend header search path accordingly */ -FUNCTION __hbrun_extensions_dynamic_load( cName ) +FUNCTION __hbrun_extensions_load( cName ) LOCAL cFileName LOCAL hLib @@ -12424,7 +12425,7 @@ FUNCTION __hbrun_extensions_dynamic_load( cName ) RETURN .F. -FUNCTION __hbrun_extensions_dynamic_unload( cName ) +FUNCTION __hbrun_extensions_unload( cName ) IF cName $ s_hLibExtDyn .AND. s_hLibExtDyn[ cName ] != NIL hb_HDel( s_hLibExtDyn, cName ) @@ -12456,7 +12457,7 @@ FUNCTION __hbrun_plugins() LOCAL cExt LOCAL file - ADD PLUGIN TO hPlugins FILE "p_extdyn.hb" + ADD PLUGIN TO hPlugins FILE "p_ext.hb" cDir := __hbrun_ConfigDir() @@ -12577,7 +12578,7 @@ STATIC PROCEDURE __hbrun_plugins_unload( plugins ) #include "inkey.ch" #include "setcurs.ch" -/* TODO: rewrite the full-screen prompt to be a simple stdout/stdin shell */ +/* TODO: rewrite the full-screen shell to be a simple stdout/stdin shell */ STATIC PROCEDURE __hbrun_shell( aParams, cCommand ) LOCAL GetList LOCAL cLine @@ -12590,7 +12591,7 @@ STATIC PROCEDURE __hbrun_shell( aParams, cCommand ) LOCAL cDomain := "" LOCAL tmp - hbrun_gtInteractive() + hbshell_gtInteractive() IF ! hb_gtInfo( HB_GTI_ISSCREENPOS ) OutErr( hb_StrFormat( I_( "hbrun: Error: Interactive session not possible with %1$s terminal driver" ), hb_gtVersion( 0 ) ) + _OUT_EOL ) @@ -12916,7 +12917,7 @@ DYNAMIC win_regWrite DYNAMIC win_regDelete STATIC FUNCTION __hbrun_win_reg_self( lRegister, lAllUser ) - IF ! __hbrun_extensions_dynamic_load( "hbwin" ) + IF ! __hbrun_extensions_load( "hbwin" ) RETURN .F. ENDIF IF ! hb_IsFunction( "win_regWrite" ) .OR. ; @@ -12960,28 +12961,18 @@ STATIC FUNCTION __hbrun_win_reg_app( lRegister, lAllUser, cAppPath ) modules, which could be queried and loaded. shell could support #require as well. */ -/* Public hbrun API */ -FUNCTION hbrun_load( cName ) - RETURN __hbrun_extensions_dynamic_load( cName ) - -/* Public hbrun API */ -FUNCTION hbrun_unload( cName ) - RETURN __hbrun_extensions_dynamic_unload( cName ) - -/* Public hbrun API */ -FUNCTION hbrun_DirBase() +/* Public hbshell API */ +FUNCTION hbshell_DirBase() RETURN s_cDirBase_hbrun -/* Public hbrun API */ -FUNCTION hbrun_ProgName() +FUNCTION hbshell_ProgName() RETURN s_cProgName_hbrun -/* Public hbrun API */ -PROCEDURE hbrun_gtInteractive() - hb_gtSelect( hb_gtCreate( hbrun_gtDefault() ) ) - RETURN +FUNCTION hbshell_gtInteractive() + hb_gtSelect( hb_gtCreate( __hbrun_gtDefault() ) ) + RETURN NIL -STATIC FUNCTION hbrun_gtDefault() +STATIC FUNCTION __hbrun_gtDefault() #if defined( __PLATFORM__WINCE ) RETURN "GTWVT" #elif defined( __PLATFORM__WINDOWS ) diff --git a/harbour/utils/hbmk2/p_extdyn.hb b/harbour/utils/hbmk2/p_ext.hb similarity index 100% rename from harbour/utils/hbmk2/p_extdyn.hb rename to harbour/utils/hbmk2/p_ext.hb