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.
This commit is contained in:
Viktor Szakats
2012-05-04 10:59:39 +00:00
parent 995a4db464
commit f5390e31ff
15 changed files with 76 additions and 35 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 ), "," )

View File

@@ -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 {}

View File

@@ -3,4 +3,5 @@
#
-gh
*.hb
*.hbs

View File

@@ -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 ] )

View File

@@ -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

View File

@@ -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/*.*

View File

@@ -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 [<file[.prg|.hbs|.hrb]> [<parameters,...>]]" + hb_eol() )
"Syntax: hbrun [<file[.prg|.hb|.hbs|.hrb]> [<parameters,...>]]" + 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

View File

@@ -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

View File

@@ -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

View File

@@ -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*.*"

View File

@@ -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=<d:dll>" , I_( "<d> is the name of the dependency. Add <dll> to the import library source list." ) },;
{ "-depimplibd=<d:lib>" , I_( "<d> is the name of the dependency. Set generated import library name to <lib>" ) },;
NIL,;
{ "-plugin=<.prg|.hbs|.hrb>", I_( "add plugin" ) },;
{ "-plugin=<filename>" , I_( "add plugin. <filename> can be: .prg, .hb, .hbs, .hrb" ) },;
{ "-pi=<filename>" , I_( "pass input file to plugins" ) },;
{ "-pflag=<f>" , 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.