diff --git a/harbour/COPYING b/harbour/COPYING index 27a1b2b697..23ecb12f59 100644 --- a/harbour/COPYING +++ b/harbour/COPYING @@ -2,7 +2,7 @@ THE HARBOUR PROJECT COMPILER LICENSE ==================================== Note: This license applies to most of the files in the src/compiler - and utils/hbmk2 directories and certain .hbs Harbour scripts. + and utils/hbmk2 directories and certain .hb/.hbs Harbour scripts. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e6654f8cd2..3a059bd282 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,28 @@ The license applies to all entries newer than 2009-04-28. */ +2012-05-04 12:57 UTC+0200 Viktor Szakats (harbour syenar.net) + * utils/hbmk2/hbmk2.prg + * .hb? input make files are now considered with UTF8 encoding. + + enabled full UTF8 CP on *nix systems. EXPERIMENTAL. + + * debian/copyright + * package/winuni/mpkg_win_uni.nsi + * utils/hbmk2/hbmk2.prg + * contrib/hbpost.hbm + * contrib/hbnetio/utils/hbnetio/modules.hbp + * contrib/hbnetio/utils/hbnetio/netiosrv.prg + * contrib/hbqt/hbqt_common.hbm + * contrib/hbide/ideedit.prg + * contrib/hbide/idemisc.prg + * contrib/hbide/idesaveload.prg + * contrib/hbrun/hbrun.prg + * contrib/hbrun/plugins.prg + * config/postinst.hbs + * COPYING + + added support for .hb extension for Harbour scripts. + I plan to make a full switch to .hb from .hbs. + 2012-05-04 09:31 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbtip/sessid.prg * contrib/hbtip/encqp.prg diff --git a/harbour/config/postinst.hbs b/harbour/config/postinst.hbs index 13b43c7d56..946c5a10ce 100644 --- a/harbour/config/postinst.hbs +++ b/harbour/config/postinst.hbs @@ -80,7 +80,7 @@ PROCEDURE Main( ... ) IF ! Empty( GetEnvC( "HB_INSTALL_BIN" ) ) .AND. ; ! GetEnvC( "HB_BUILD_PARTS" ) == "lib" - OutStd( "! Copying Harbour script (.hbs) files..." + hb_eol() ) + OutStd( "! Copying Harbour script files..." + hb_eol() ) /* public Harbour scripts */ FOR EACH tmp IN { "bin/hb3rdpat.hbs" } @@ -328,7 +328,7 @@ PROCEDURE Main( ... ) mk_extern_core() ENDIF - OutStd( "! postinst.hbs finished" + ; + OutStd( "! postinst script finished" + ; iif( nErrorLevel == 0, "", " with with errorlevel=" + hb_ntos( nErrorLevel ) ) + hb_eol() ) ErrorLevel( nErrorLevel ) diff --git a/harbour/contrib/hbide/ideedit.prg b/harbour/contrib/hbide/ideedit.prg index c59d894b25..870961b4c1 100644 --- a/harbour/contrib/hbide/ideedit.prg +++ b/harbour/contrib/hbide/ideedit.prg @@ -2207,7 +2207,7 @@ METHOD IdeEdit:handlePreviousWord( lUpdatePrevWord ) nL := len( cWord ) + nSpace nB := qCursor:position() - nL - IF lower( ::oEditor:cExt ) $ ".prg,.hbs" .AND. ! ::oINI:lSupressHbKWordsToUpper + IF lower( ::oEditor:cExt ) $ ".prg,.hb,.hbs" .AND. ! ::oINI:lSupressHbKWordsToUpper qCursor:beginEditBlock() qCursor:setPosition( nB ) qCursor:movePosition( QTextCursor_NextCharacter, QTextCursor_KeepAnchor, nL ) diff --git a/harbour/contrib/hbide/idemisc.prg b/harbour/contrib/hbide/idemisc.prg index bbff730adc..80c95d1551 100644 --- a/harbour/contrib/hbide/idemisc.prg +++ b/harbour/contrib/hbide/idemisc.prg @@ -572,7 +572,7 @@ FUNCTION hbide_isValidSource( cSourceFile ) hb_fNameSplit( cSourceFile, , , @cExt ) - RETURN ( lower( cExt ) $ ".c,.cpp,.prg,.res,.rc,.hbs" ) + RETURN ( lower( cExt ) $ ".c,.cpp,.prg,.res,.rc,.hb,.hbs" ) /*----------------------------------------------------------------------*/ @@ -1998,7 +1998,7 @@ FUNCTION app_image( cName ) FUNCTION hbide_isCompilerSource( cSource, cIncList ) LOCAL cExt, aExt - DEFAULT cIncList TO ".c,.cpp,.prg,.hbs,.rc,.res,.hbm,.hbc,.qrc,.ui,.hbp" + DEFAULT cIncList TO ".c,.cpp,.prg,.hb,.hbs,.rc,.res,.hbm,.hbc,.qrc,.ui,.hbp" cIncList := lower( cIncList ) aExt := hb_aTokens( lower( cIncList ), "," ) diff --git a/harbour/contrib/hbide/idesaveload.prg b/harbour/contrib/hbide/idesaveload.prg index 7ad9e5e183..0da354ee78 100644 --- a/harbour/contrib/hbide/idesaveload.prg +++ b/harbour/contrib/hbide/idesaveload.prg @@ -121,7 +121,7 @@ CLASS IdeINI INHERIT IdeObject DATA cCurrentReplace INIT "" DATA cCurrentView INIT "" // - DATA cTextFileExtensions INIT ".c,.cpp,.prg,.h,.ch,.txt,.log,.ini,.env,.ppo,.qtp,.hbs," + ; + DATA cTextFileExtensions INIT ".c,.cpp,.prg,.h,.ch,.txt,.log,.ini,.env,.ppo,.qtp,.hb,.hbs," + ; ".cc,.hbc,.hbp,.hbm,.xml,.bat,.sh,.rc,.ui,.uic,.bak,.fmg,.qth,.qrc" DATA aProjFiles INIT {} DATA aFiles INIT {} diff --git a/harbour/contrib/hbnetio/utils/hbnetio/modules.hbp b/harbour/contrib/hbnetio/utils/hbnetio/modules.hbp index 62c77fc939..b304a709b7 100644 --- a/harbour/contrib/hbnetio/utils/hbnetio/modules.hbp +++ b/harbour/contrib/hbnetio/utils/hbnetio/modules.hbp @@ -3,4 +3,5 @@ # -gh +*.hb *.hbs diff --git a/harbour/contrib/hbnetio/utils/hbnetio/netiosrv.prg b/harbour/contrib/hbnetio/utils/hbnetio/netiosrv.prg index 5cdfbe4894..e3a5e55c3e 100644 --- a/harbour/contrib/hbnetio/utils/hbnetio/netiosrv.prg +++ b/harbour/contrib/hbnetio/utils/hbnetio/netiosrv.prg @@ -170,6 +170,7 @@ PROCEDURE netiosrv_Main( lUI, ... ) cExt := Lower( cExt ) SWITCH cExt CASE ".prg" + CASE ".hb" CASE ".hbs" CASE ".hrb" EXIT @@ -178,6 +179,7 @@ PROCEDURE netiosrv_Main( lUI, ... ) ENDSWITCH SWITCH cExt CASE ".prg" + CASE ".hb" CASE ".hbs" cFile := hb_compileBuf( hb_argv( 0 ), "-n2", "-w", "-es2", "-q0",; "-D" + "__HBSCRIPT__HBNETIOSRV", netiosrv[ _NETIOSRV_cRPCFFileName ] ) diff --git a/harbour/contrib/hbpost.hbm b/harbour/contrib/hbpost.hbm index 845d3ce1d7..2c780d9f75 100644 --- a/harbour/contrib/hbpost.hbm +++ b/harbour/contrib/hbpost.hbm @@ -80,6 +80,7 @@ # copy contrib-specific public files -instfile=contrib:${_HB_CONTRIB_SUBDIR}/*.hbc +-instfile=contrib:${_HB_CONTRIB_SUBDIR}/*.hb -instfile=contrib:${_HB_CONTRIB_SUBDIR}/*.hbs -instfile=contrib:${_HB_CONTRIB_SUBDIR}/*.hbx -instfile=contrib:${_HB_CONTRIB_SUBDIR}/*.ch diff --git a/harbour/contrib/hbqt/hbqt_common.hbm b/harbour/contrib/hbqt/hbqt_common.hbm index 0e933d0a65..f373e9d02c 100644 --- a/harbour/contrib/hbqt/hbqt_common.hbm +++ b/harbour/contrib/hbqt/hbqt_common.hbm @@ -36,6 +36,7 @@ {beos}-depincpath=qt:/boot/common/include -instfile=contrib_qt:*.hbc +-instfile=contrib_qt:*.hb -instfile=contrib_qt:*.hbs -instfile=contrib_qt:*.txt -instfile=contrib_qt_tests:tests/*.* diff --git a/harbour/contrib/hbrun/hbrun.prg b/harbour/contrib/hbrun/hbrun.prg index 5f8c84256b..894d13886d 100644 --- a/harbour/contrib/hbrun/hbrun.prg +++ b/harbour/contrib/hbrun/hbrun.prg @@ -145,6 +145,7 @@ PROCEDURE _APPMAIN( cFile, ... ) cExt := Lower( cExt ) SWITCH cExt CASE ".prg" + CASE ".hb" CASE ".hbs" CASE ".hrb" CASE ".dbf" @@ -157,6 +158,7 @@ PROCEDURE _APPMAIN( cFile, ... ) hbrun_Prompt( hb_AParams(), "USE " + cFile + " SHARED" ) EXIT CASE ".prg" + CASE ".hb" CASE ".hbs" IF Empty( GetEnv( "HBRUN_NOHEAD" ) ) hHeaders := __hbrun_CoreHeaderFiles() /* add core header files */ @@ -248,6 +250,7 @@ STATIC FUNCTION plugins_load( hPlugins, aParams ) plugin[ _PLUGIN_hHRB ] := NIL SWITCH Lower( hb_FNameExt( cFile:__enumKey() ) ) + CASE ".hb" CASE ".hbs" CASE ".prg" cFile := hb_compileFromBuf( cFile, __hbrun_CoreHeaderFiles(), hb_ProgName(), "-n2", "-w", "-es2", "-q0" ) @@ -510,7 +513,7 @@ STATIC PROCEDURE hbrun_Usage() "Copyright (c) 1999-2012, Przemyslaw Czerpak, Viktor Szakats" + hb_eol() + ; "http://harbour-project.org/" + hb_eol() +; hb_eol() +; - "Syntax: hbrun [ []]" + hb_eol() ) + "Syntax: hbrun [ []]" + hb_eol() ) RETURN @@ -711,7 +714,7 @@ STATIC FUNCTION hbrun_FindInPath( cFileName ) LOCAL aExt hb_FNameSplit( cFileName, @cDir, @cName, @cExt ) - aExt := iif( Empty( cExt ), { ".hbs", ".hrb" }, { cExt } ) + aExt := iif( Empty( cExt ), { ".hb", ".hbs", ".hrb" }, { cExt } ) FOR EACH cExt IN aExt /* Check original filename (in supplied path or current dir) */ @@ -764,13 +767,14 @@ STATIC FUNCTION win_reg_app( lRegister, lAllUser, cAppPath ) LOCAL tmp LOCAL aEntries := {; - cHive + '\' , "" ,; - cHive + '\.hbs\' , "HBSFile" ,; - cHive + '\HBSFile\' , "Harbour Script File" ,; - cHive + '\HBSFile\DefaultIcon\' , cAppPath + ",-1" ,; - cHive + '\HBSFile\Shell\' , "Run" ,; - cHive + '\HBSFile\Shell\Run\' , "" ,; - cHive + '\HBSFile\Shell\Run\Command\', cAppPath + ' "%1"' } + cHive + '\' , "" ,; + cHive + '\.hb\' , "HarbourScript" ,; + cHive + '\.hbs\' , "HarbourScript" ,; + cHive + '\HarbourScript\' , "Harbour Script File" ,; + cHive + '\HarbourScript\DefaultIcon\' , cAppPath + ",-1" ,; + cHive + '\HarbourScript\Shell\' , "Run" ,; + cHive + '\HarbourScript\Shell\Run\' , "" ,; + cHive + '\HarbourScript\Shell\Run\Command\', cAppPath + ' "%1"' } IF lRegister FOR tmp := 1 TO Len( aEntries ) STEP 2 diff --git a/harbour/contrib/hbrun/plugins.prg b/harbour/contrib/hbrun/plugins.prg index 0e60ee1683..32bd3175d0 100644 --- a/harbour/contrib/hbrun/plugins.prg +++ b/harbour/contrib/hbrun/plugins.prg @@ -61,6 +61,9 @@ FUNCTION __hbrun_plugins() ADD PLUGIN TO hPlugins FILE "netiomgm.prg" + FOR EACH file IN Directory( hb_DirBase() + "*.hb" ) + hPlugins[ hb_DirBase() + file[ F_NAME ] ] := MemoRead( hb_DirBase() + file[ F_NAME ] ) + NEXT FOR EACH file IN Directory( hb_DirBase() + "*.hbs" ) hPlugins[ hb_DirBase() + file[ F_NAME ] ] := MemoRead( hb_DirBase() + file[ F_NAME ] ) NEXT diff --git a/harbour/debian/copyright b/harbour/debian/copyright index 27a1b2b697..23ecb12f59 100644 --- a/harbour/debian/copyright +++ b/harbour/debian/copyright @@ -2,7 +2,7 @@ THE HARBOUR PROJECT COMPILER LICENSE ==================================== Note: This license applies to most of the files in the src/compiler - and utils/hbmk2 directories and certain .hbs Harbour scripts. + and utils/hbmk2 directories and certain .hb/.hbs Harbour scripts. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/harbour/package/winuni/mpkg_win_uni.nsi b/harbour/package/winuni/mpkg_win_uni.nsi index f989b7c183..70bce40d5c 100644 --- a/harbour/package/winuni/mpkg_win_uni.nsi +++ b/harbour/package/winuni/mpkg_win_uni.nsi @@ -101,7 +101,8 @@ Section "Main components" hb_main File "$%HB_ABSROOT%bin\hbpp.exe" File "$%HB_ABSROOT%bin\hbrun.exe" File "$%HB_ABSROOT%bin\hbtest.exe" - File "$%HB_ABSROOT%bin\*.hbs" + File /nonfatal "$%HB_ABSROOT%bin\*.hb" + File /nonfatal "$%HB_ABSROOT%bin\*.hbs" File /nonfatal "$%HB_ABSROOT%bin\hbmk.hbc" File "$%HB_ABSROOT%bin\upx*.*" diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index dae5c30368..34f98bead2 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -565,7 +565,8 @@ PROCEDURE _APPMAIN( ... ) IF PCount() >= 1 tmp := Lower( hb_FNameExt( hb_PValue( 1 ) ) ) - IF tmp == ".hbs" .OR. ; + IF tmp == ".hb" .OR. ; + tmp == ".hbs" .OR. ; tmp == ".hrb" hbmk2_hbrun_minimal( ... ) QUIT @@ -3084,7 +3085,8 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) ENDIF CASE hb_FNameExt( cParamL ) == ".prg" .OR. ; - hb_FNameExt( cParamL ) == ".hbs" + hb_FNameExt( cParamL ) == ".hbs" .OR. ; + hb_FNameExt( cParamL ) == ".hb" FOR EACH cParam IN FN_Expand( PathMakeAbsolute( PathSepToSelf( cParam ), aParam[ _PAR_cFileName ] ), Empty( aParam[ _PAR_cFileName ] ) ) AAdd( hbmk[ _HBMK_aPRG ], cParam ) @@ -5446,7 +5448,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) /* Do entry function detection on platform required and supported */ IF ! hbmk[ _HBMK_lDONTEXEC ] .AND. ! lStopAfterCComp .AND. l_cMAIN == NIL - tmp := iif( HBMK_IS_IN( Lower( hb_FNameExt( hbmk[ _HBMK_cFIRST ] ) ), ".prg|.hbs|.clp" ) .OR. Empty( hb_FNameExt( hbmk[ _HBMK_cFIRST ] ) ), FNameDirExtSet( hbmk[ _HBMK_cFIRST ], hbmk[ _HBMK_cWorkDir ], ".c" ), hbmk[ _HBMK_cFIRST ] ) + tmp := iif( HBMK_IS_IN( Lower( hb_FNameExt( hbmk[ _HBMK_cFIRST ] ) ), ".prg|.hb|.hbs|.clp" ) .OR. Empty( hb_FNameExt( hbmk[ _HBMK_cFIRST ] ) ), FNameDirExtSet( hbmk[ _HBMK_cFIRST ], hbmk[ _HBMK_cWorkDir ], ".c" ), hbmk[ _HBMK_cFIRST ] ) IF ! Empty( tmp := getFirstFunc( hbmk, tmp ) ) l_cMAIN := tmp ENDIF @@ -7272,8 +7274,7 @@ STATIC FUNCTION hbmk_MemoRead( cFileName ) cFile := SubStr( cFile, Len( hbmk_UTF8_BOM() ) + 1 ) ENDIF - RETURN cFile -/* RETURN hb_UTF8ToStr( cFile ) */ + RETURN hb_UTF8ToStr( cFile ) STATIC FUNCTION hbmk2_hb_compile( hbmk, ... ) LOCAL cSaveCP @@ -8503,9 +8504,10 @@ STATIC PROCEDURE PlugIn_Load( hbmk, cFileName ) IF ! Empty( cFile ) lOK := .F. - /* Optimization: Don't try to load it as .hrb if the extension is .prg or .hbs (Harbour script) */ + /* Optimization: Don't try to load it as .hrb if the extension is .prg, .hb or .hbs (Harbour script) */ IF !( Lower( cExt ) == ".prg" ) .AND. ; - !( Lower( cExt ) == ".hbs" ) + !( Lower( cExt ) == ".hbs" ) .AND. ; + !( Lower( cExt ) == ".hb" ) BEGIN SEQUENCE WITH {| oError | Break( oError ) } hrb := hb_hrbLoad( HB_HRB_BIND_FORCELOCAL, cFile ) cType := I_( "(compiled)" ) @@ -11931,6 +11933,7 @@ PROCEDURE hbmk2_hbrun_minimal( cFile, ... ) IF ! Empty( cFile := FindInPath( cFile ) ) SWITCH Lower( hb_FNameExt( cFile ) ) + CASE ".hb" CASE ".hbs" cFile := hb_compileBuf( hbmk_CoreHeaderFilesMinimal(), hb_ProgName(), "-n2", "-w", "-es2", "-q0", ; "-I" + hb_FNameDir( cFile ), "-D" + "__HBSCRIPT__HBRUN", cFile ) @@ -12418,15 +12421,18 @@ STATIC PROCEDURE SetUILang( hbmk ) ENDIF /* Setup input CP of the translation */ - hb_cdpSelect( Upper( SubStr( I_( "cdp=EN" ), Len( "cdp=" ) + 1 ) ) ) - - /* Setup output CP, separate for Windows/DOS/OS2 and *nix systems */ - /* NOTE: Intentionally doing runtime branching to include both strings in translation files. */ - tmp := Upper( SubStr( iif( hb_Version( HB_VERSION_UNIX_COMPAT ), I_( "nix=EN" ), I_( "wdo=EN" ) ), Len( "xxx=" ) + 1 ) ) - IF tmp == "UTF8" .OR. tmp == "UTF-8" - hb_SetDispCP( "UTF8" ) + IF hb_Version( HB_VERSION_UNIX_COMPAT ) /* NOTE: Intentionally doing runtime branching to include all translatable strings in translation files. */ + hb_cdpSelect( "UTF8EX" ) ELSE - hb_SetDispCP( tmp ) + hb_cdpSelect( Upper( SubStr( I_( "cdp=EN" ), Len( "cdp=" ) + 1 ) ) ) + + /* Setup output CP, separate for Windows/DOS/OS2 and *nix systems */ + tmp := Upper( SubStr( iif( hb_Version( HB_VERSION_UNIX_COMPAT ), I_( "nix=EN" ), I_( "wdo=EN" ) ), Len( "xxx=" ) + 1 ) ) + IF tmp == "UTF8" .OR. tmp == "UTF-8" + hb_SetDispCP( "UTF8" ) + ELSEIF ! Empty( tmp ) + hb_SetDispCP( tmp ) + ENDIF ENDIF RETURN @@ -12590,7 +12596,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lLong ) { "-depimplibs=" , I_( " is the name of the dependency. Add to the import library source list." ) },; { "-depimplibd=" , I_( " is the name of the dependency. Set generated import library name to " ) },; NIL,; - { "-plugin=<.prg|.hbs|.hrb>", I_( "add plugin" ) },; + { "-plugin=" , I_( "add plugin. can be: .prg, .hb, .hbs, .hrb" ) },; { "-pi=" , I_( "pass input file to plugins" ) },; { "-pflag=" , I_( "pass flag to plugins" ) },; NIL,; @@ -12649,7 +12655,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lLong ) I_( 'Options accepting macros also support command substitution. Enclose command inside ``, and, if the command contains space, also enclose in double quotes. F.e. "-cflag=`wx-config --cflags`", or ldflags={unix&gcc}"`wx-config --libs`".' ),; I_( "Defaults and feature support vary by platform/compiler." ) ,; hb_StrFormat( I_( "Options can also be specified in environment variable %1$s" ), _HBMK_ENV_NAME ),; - I_( ".hbs or .hrb file passed as first parameter will be run as Harbour script. (EXPERIMENTAL)" ) } + I_( ".hb, .hbs or .hrb file passed as first parameter will be run as Harbour script. (EXPERIMENTAL)" ) } DEFAULT lLong TO .F.