diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6757beab31..3b065223af 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-05-27 14:54 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/xhb/hbcompat.ch + * Grouped together all translations which cannot be + replaced using wrapper technique. + + * contrib/xhb/xhbgt.c + * contrib/xhb/xhbfunc.c + ! Deleted two wrappers which cannot be wrappers. + (dirty extensions) + 2010-05-27 14:42 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/xhb/Makefile - contrib/xhb/hbcompat.prg diff --git a/harbour/contrib/xhb/hbcompat.ch b/harbour/contrib/xhb/hbcompat.ch index 855bdbd74a..e309959221 100644 --- a/harbour/contrib/xhb/hbcompat.ch +++ b/harbour/contrib/xhb/hbcompat.ch @@ -263,6 +263,71 @@ #define GTI_CLIENT 2 /* Maximum possible client size of a window */ #define GTI_MAX 3 /* Maximum possible window size (in Windows) */ + #xtranslate NetName() => iif( hb_isNumeric( ) .AND. == 1, hb_UserName(), NetName() ) + #xtranslate MaxRow(.T.) => hb_gtInfo( HB_GTI_VIEWPORTHEIGHT ) + #xtranslate MaxCol(.T.) => hb_gtInfo( HB_GTI_VIEWPORTWIDTH ) + + #xtranslate Str(,[],[],) => iif(, hb_NToS(), Str()) + + #xtranslate AScan(,,[],[],) => hb_AScan(,,,,) + #xtranslate AIns(,,[]) => hb_AIns(,,) + #xtranslate ADel(,,) => hb_ADel(,,) + #xtranslate At(,,[]) => hb_At(,,) + + #xtranslate GetEnv([]) => hb_GetEnv() + #xtranslate SetKey([]) => hb_SetKey() + #xtranslate MemoWrit(,,) => iif( hb_isLogical() .AND. , MemoWrit(,), hb_MemoWrit(,) ) + + /* _SET_TRACE* / TraceLog() */ + #xtranslate Set(_SET_TRACE [,]) => xhb_setTrace( ) + #xtranslate Set(_SET_TRACEFILE [,]) => xhb_setTraceFile( ) + #xtranslate Set(_SET_TRACESTACK [,]) => xhb_setTraceStack( ) + + /* TEXT INTO */ + #xcommand TEXT INTO => #pragma __text|+=%s+HB_OSNEWLINE();:="" + + /* SWITCH ... ; case ... ; DEFAULT ; ... ; END */ + #xcommand DEFAULT => OTHERWISE + + /* FOR EACH hb_enumIndex() */ + #xtranslate hb_enumIndex() => :__enumIndex() + + /* TRY / CATCH / FINALLY / END */ + #xcommand TRY => BEGIN SEQUENCE WITH {|oErr| Break( oErr )} + #xcommand CATCH [] => RECOVER [USING ] <-oErr-> + #xcommand FINALLY => ALWAYS + + /* EXTENDED CODEBLOCKs */ + #xtranslate \<|[]| => {|| + #xcommand > [<*x*>] => } + + /* xHarbour operators: IN, HAS, LIKE, >>, <<, |, &, ^^ */ + #translate ( IN ) => ( () $ () ) + #translate ( HAS ) => ( HB_REGEXHAS( (), () ) ) + #translate ( LIKE ) => ( HB_REGEXLIKE( (), () ) ) + #translate ( \<\< ) => ( HB_BITSHIFT( (), () ) ) + #translate ( >> ) => ( HB_BITSHIFT( (), -() ) ) + /* NOTE: These macros can break some valid Harbour/Clipper constructs, + so they are disabled by default. Enable them with care, or + even better to switch to use HB_BIT*() functions directly. + They are optimized by Harbour compiler the same way (and even + more) as these C-like operators, without any bad side-effects. */ + #if defined( XHB_BITOP ) + #translate ( | ) => ( HB_BITOR( (), () ) ) + #translate ( & ) => ( HB_BITAND( (), () ) ) + #translate ( ^^ ) => ( HB_BITXOR( (), () ) ) + #endif + + #command @ , PROMPT [ MESSAGE ] [ COLOR ] => ; + __AtPrompt( , , , , ) + + #command SET TRIMFILENAME => Set( _SET_TRIMFILENAME, <(x)> ) + #command SET TIME FORMAT [TO] => Set( _SET_TIMEFORMAT, ) + + #define HB_GTI_CLIPBOARDPAST HB_GTI_CLIPBOARDPASTE + + /* These also have wrapper function in xhb lib */ + #xtranslate gtSetClipboard() => hb_gtInfo( HB_GTI_CLIPBOARDDATA, ) #xtranslate gtGetClipboard() => hb_gtInfo( HB_GTI_CLIPBOARDDATA ) #xtranslate gtGetClipBoardSize() => Len( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) ) @@ -270,8 +335,6 @@ #xtranslate gtProcessMessages() => NextKey() #xtranslate gfxPrimitive([]) => hb_gfxPrimitive() #xtranslate gfxText([]) => hb_gfxText() - #xtranslate MaxRow(.T.) => hb_gtInfo( HB_GTI_VIEWPORTHEIGHT ) - #xtranslate MaxCol(.T.) => hb_gtInfo( HB_GTI_VIEWPORTWIDTH ) #xtranslate hb_openProcess([]) => hb_processOpen() #xtranslate hb_closeProcess([]) => hb_processClose() @@ -287,7 +350,6 @@ #xtranslate ValToPrgExp([]) => hb_valToExp() #xtranslate IsDirectory() => hb_dirExists() #xtranslate SecondsSleep([]) => hb_idleSleep() - #xtranslate NetName() => iif( hb_isNumeric( ) .AND. == 1, hb_UserName(), NetName() ) #xtranslate FileSize() => hb_FSize() #xtranslate WildMatch([]) => hb_WildMatch() #xtranslate hb_DeserialNext() => hb_Deserialize() @@ -309,14 +371,9 @@ #xtranslate HBCONSOLELOCK() => hb_gtLock() #xtranslate HBCONSOLEUNLOCK() => hb_gtUnLock() - #xtranslate Str(,[],[],) => iif(, hb_NToS(), Str()) #xtranslate hb_CMDARGARGV([]) => hb_ARGV() - #xtranslate AScan(,,[],[],) => hb_AScan(,,,,) #xtranslate RAScan([]) => hb_RAScan() - #xtranslate AIns(,,[]) => hb_AIns(,,) - #xtranslate ADel(,,) => hb_ADel(,,) - #xtranslate At(,,[]) => hb_At(,,) #xtranslate DateTime() => hb_DateTime() #xtranslate Hour([]) => hb_Hour() @@ -326,19 +383,10 @@ #xtranslate TToC([]) => hb_TToC() #xtranslate CToT([]) => hb_CToT() - #xtranslate GetEnv([]) => hb_GetEnv() - #xtranslate SetKey([]) => hb_SetKey() - #xtranslate MemoWrit(,,) => iif( hb_isLogical() .AND. , MemoWrit(,), hb_MemoWrit(,) ) - #xtranslate i18n() => hb_i18n_gettext() #xtranslate hb_SetCodepage([]) => hb_cdpSelect( ) - /* _SET_TRACE* / TraceLog() */ - #xtranslate Set(_SET_TRACE [,]) => xhb_setTrace( ) - #xtranslate Set(_SET_TRACEFILE [,]) => xhb_setTraceFile( ) - #xtranslate Set(_SET_TRACESTACK [,]) => xhb_setTraceStack( ) - /* MT functions */ #xtranslate hb_MultiThread() => hb_mtvm() #xtranslate GetCurrentThread() => hb_threadSelf() @@ -477,50 +525,6 @@ /* THROW => generate error */ #xtranslate THROW() => (Eval(ErrorBlock(), ), Break()) - /* TEXT INTO */ - #xcommand TEXT INTO => #pragma __text|+=%s+HB_OSNEWLINE();:="" - - /* SWITCH ... ; case ... ; DEFAULT ; ... ; END */ - #xcommand DEFAULT => OTHERWISE - - /* FOR EACH hb_enumIndex() */ - #xtranslate hb_enumIndex() => :__enumIndex() - - /* TRY / CATCH / FINALLY / END */ - #xcommand TRY => BEGIN SEQUENCE WITH {|oErr| Break( oErr )} - #xcommand CATCH [] => RECOVER [USING ] <-oErr-> - #xcommand FINALLY => ALWAYS - - /* EXTENDED CODEBLOCKs */ - #xtranslate \<|[]| => {|| - #xcommand > [<*x*>] => } - - - /* xHarbour operators: IN, HAS, LIKE, >>, <<, |, &, ^^ */ - #translate ( IN ) => ( () $ () ) - #translate ( HAS ) => ( HB_REGEXHAS( (), () ) ) - #translate ( LIKE ) => ( HB_REGEXLIKE( (), () ) ) - #translate ( \<\< ) => ( HB_BITSHIFT( (), () ) ) - #translate ( >> ) => ( HB_BITSHIFT( (), -() ) ) - /* NOTE: These macros can break some valid Harbour/Clipper constructs, - so they are disabled by default. Enable them with care, or - even better to switch to use HB_BIT*() functions directly. - They are optimized by Harbour compiler the same way (and even - more) as these C-like operators, without any bad side-effects. */ - #if defined( XHB_BITOP ) - #translate ( | ) => ( HB_BITOR( (), () ) ) - #translate ( & ) => ( HB_BITAND( (), () ) ) - #translate ( ^^ ) => ( HB_BITXOR( (), () ) ) - #endif - - #command @ , PROMPT [ MESSAGE ] [ COLOR ] => ; - __AtPrompt( , , , , ) - - #command SET TRIMFILENAME => Set( _SET_TRIMFILENAME, <(x)> ) - #command SET TIME FORMAT [TO] => Set( _SET_TIMEFORMAT, ) - - #define HB_GTI_CLIPBOARDPAST HB_GTI_CLIPBOARDPASTE - #endif #endif /* __HARBOUR__ */ diff --git a/harbour/contrib/xhb/xhbfunc.c b/harbour/contrib/xhb/xhbfunc.c index 8b4962fbaf..61fd504dd3 100644 --- a/harbour/contrib/xhb/xhbfunc.c +++ b/harbour/contrib/xhb/xhbfunc.c @@ -310,5 +310,4 @@ HB_FUNC_EXTERN( HB_NUMTOHEX ) ; HB_FUNC( NUMTOHEX ) { HB_FUNC_EXTERN( HB_HEXTOSTR ) ; HB_FUNC( HEXTOSTR ) { HB_FUNC_EXEC( HB_HEXTOSTR ); } HB_FUNC_EXTERN( HB_STRTOHEX ) ; HB_FUNC( STRTOHEX ) { HB_FUNC_EXEC( HB_STRTOHEX ); } HB_FUNC_EXTERN( HB_ISPOINTER ) ; HB_FUNC( ISPOINTER ) { HB_FUNC_EXEC( HB_ISPOINTER ); } -HB_FUNC_EXTERN( HB_GETENV ) ; HB_FUNC( GETENV ) { HB_FUNC_EXEC( HB_GETENV ); } HB_FUNC_EXTERN( HB_CDPSELECT ) ; HB_FUNC( HB_SETCODEPAGE ) { HB_FUNC_EXEC( HB_CDPSELECT ); } diff --git a/harbour/contrib/xhb/xhbgt.c b/harbour/contrib/xhb/xhbgt.c index 3c73e3de09..3417358ce4 100644 --- a/harbour/contrib/xhb/xhbgt.c +++ b/harbour/contrib/xhb/xhbgt.c @@ -58,4 +58,3 @@ HB_FUNC_EXTERN( HB_GFXTEXT ) ; HB_FUNC( GFXTEXT ) { HB_FUNC_EXTERN( HB_GTLOCK ) ; HB_FUNC( HBCONSOLELOCK ) { HB_FUNC_EXEC( HB_GTLOCK ); } HB_FUNC_EXTERN( HB_GTUNLOCK ) ; HB_FUNC( HBCONSOLEUNLOCK ) { HB_FUNC_EXEC( HB_GTUNLOCK ); } HB_FUNC_EXTERN( HB_SETLASTKEY ) ; HB_FUNC( SETLASTKEY ) { HB_FUNC_EXEC( HB_SETLASTKEY ); } -HB_FUNC_EXTERN( HB_SETKEY ) ; HB_FUNC( SETKEY ) { HB_FUNC_EXEC( HB_SETKEY ); }