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)
This commit is contained in:
Viktor Szakats
2010-05-27 12:55:18 +00:00
parent 4c69eac13f
commit d0dd7543b0
4 changed files with 75 additions and 63 deletions

View File

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

View File

@@ -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(<n>) => iif( hb_isNumeric( <n> ) .AND. <n> == 1, hb_UserName(), NetName() )
#xtranslate MaxRow(.T.) => hb_gtInfo( HB_GTI_VIEWPORTHEIGHT )
#xtranslate MaxCol(.T.) => hb_gtInfo( HB_GTI_VIEWPORTWIDTH )
#xtranslate Str(<x>,[<y>],[<y>],<z>) => iif(<z>, hb_NToS(<x>), Str(<x>))
#xtranslate AScan(<a>,<b>,[<c>],[<d>],<e>) => hb_AScan(<a>,<b>,<c>,<d>,<e>)
#xtranslate AIns(<a>,<n>,[<x,...>]) => hb_AIns(<a>,<n>,<x>)
#xtranslate ADel(<a>,<n>,<l>) => hb_ADel(<a>,<n>,<l>)
#xtranslate At(<a>,<b>,[<x,...>]) => hb_At(<a>,<b>,<x>)
#xtranslate GetEnv([<x,...>]) => hb_GetEnv(<x>)
#xtranslate SetKey([<x,...>]) => hb_SetKey(<x>)
#xtranslate MemoWrit(<x>,<y>,<z>) => iif( hb_isLogical(<z>) .AND. <z>, MemoWrit(<x>,<y>), hb_MemoWrit(<x>,<y>) )
/* _SET_TRACE* / TraceLog() */
#xtranslate Set(_SET_TRACE [,<x,...>]) => xhb_setTrace( <x> )
#xtranslate Set(_SET_TRACEFILE [,<x,...>]) => xhb_setTraceFile( <x> )
#xtranslate Set(_SET_TRACESTACK [,<x,...>]) => xhb_setTraceStack( <x> )
/* TEXT INTO <varname> */
#xcommand TEXT INTO <v> => #pragma __text|<v>+=%s+HB_OSNEWLINE();<v>:=""
/* SWITCH ... ; case ... ; DEFAULT ; ... ; END */
#xcommand DEFAULT => OTHERWISE
/* FOR EACH hb_enumIndex() */
#xtranslate hb_enumIndex(<!v!>) => <v>:__enumIndex()
/* TRY / CATCH / FINALLY / END */
#xcommand TRY => BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
#xcommand CATCH [<!oErr!>] => RECOVER [USING <oErr>] <-oErr->
#xcommand FINALLY => ALWAYS
/* EXTENDED CODEBLOCKs */
#xtranslate \<|[<x,...>]| => {|<x>|
#xcommand > [<*x*>] => } <x>
/* xHarbour operators: IN, HAS, LIKE, >>, <<, |, &, ^^ */
#translate ( <exp1> IN <exp2> ) => ( (<exp1>) $ (<exp2>) )
#translate ( <exp1> HAS <exp2> ) => ( HB_REGEXHAS( (<exp2>), (<exp1>) ) )
#translate ( <exp1> LIKE <exp2> ) => ( HB_REGEXLIKE( (<exp2>), (<exp1>) ) )
#translate ( <exp1> \<\< <exp2> ) => ( HB_BITSHIFT( (<exp1>), (<exp2>) ) )
#translate ( <exp1> >> <exp2> ) => ( HB_BITSHIFT( (<exp1>), -(<exp2>) ) )
/* 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 ( <exp1> | <exp2> ) => ( HB_BITOR( (<exp1>), (<exp2>) ) )
#translate ( <exp1> & <exp2> ) => ( HB_BITAND( (<exp1>), (<exp2>) ) )
#translate ( <exp1> ^^ <exp2> ) => ( HB_BITXOR( (<exp1>), (<exp2>) ) )
#endif
#command @ <row>, <col> PROMPT <prompt> [ MESSAGE <msg> ] [ COLOR <color> ] => ;
__AtPrompt( <row>, <col>, <prompt>, <msg>, <color> )
#command SET TRIMFILENAME <x:ON,OFF,&> => Set( _SET_TRIMFILENAME, <(x)> )
#command SET TIME FORMAT [TO] <f> => Set( _SET_TIMEFORMAT, <f> )
#define HB_GTI_CLIPBOARDPAST HB_GTI_CLIPBOARDPASTE
/* These also have wrapper function in xhb lib */
#xtranslate gtSetClipboard(<x>) => hb_gtInfo( HB_GTI_CLIPBOARDDATA, <x> )
#xtranslate gtGetClipboard() => hb_gtInfo( HB_GTI_CLIPBOARDDATA )
#xtranslate gtGetClipBoardSize() => Len( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) )
@@ -270,8 +335,6 @@
#xtranslate gtProcessMessages() => NextKey()
#xtranslate gfxPrimitive([<x,...>]) => hb_gfxPrimitive(<x>)
#xtranslate gfxText([<x,...>]) => hb_gfxText(<x>)
#xtranslate MaxRow(.T.) => hb_gtInfo( HB_GTI_VIEWPORTHEIGHT )
#xtranslate MaxCol(.T.) => hb_gtInfo( HB_GTI_VIEWPORTWIDTH )
#xtranslate hb_openProcess([<x,...>]) => hb_processOpen(<x>)
#xtranslate hb_closeProcess([<x,...>]) => hb_processClose(<x>)
@@ -287,7 +350,6 @@
#xtranslate ValToPrgExp([<x,...>]) => hb_valToExp(<x>)
#xtranslate IsDirectory(<x>) => hb_dirExists(<x>)
#xtranslate SecondsSleep([<x,...>]) => hb_idleSleep(<x>)
#xtranslate NetName(<n>) => iif( hb_isNumeric( <n> ) .AND. <n> == 1, hb_UserName(), NetName() )
#xtranslate FileSize(<x>) => hb_FSize(<x>)
#xtranslate WildMatch([<x,...>]) => hb_WildMatch(<x>)
#xtranslate hb_DeserialNext(<x>) => hb_Deserialize(<x>)
@@ -309,14 +371,9 @@
#xtranslate HBCONSOLELOCK() => hb_gtLock()
#xtranslate HBCONSOLEUNLOCK() => hb_gtUnLock()
#xtranslate Str(<x>,[<y>],[<y>],<z>) => iif(<z>, hb_NToS(<x>), Str(<x>))
#xtranslate hb_CMDARGARGV([<x,...>]) => hb_ARGV(<x>)
#xtranslate AScan(<a>,<b>,[<c>],[<d>],<e>) => hb_AScan(<a>,<b>,<c>,<d>,<e>)
#xtranslate RAScan([<x,...>]) => hb_RAScan(<x>)
#xtranslate AIns(<a>,<n>,[<x,...>]) => hb_AIns(<a>,<n>,<x>)
#xtranslate ADel(<a>,<n>,<l>) => hb_ADel(<a>,<n>,<l>)
#xtranslate At(<a>,<b>,[<x,...>]) => hb_At(<a>,<b>,<x>)
#xtranslate DateTime() => hb_DateTime()
#xtranslate Hour([<x>]) => hb_Hour(<x>)
@@ -326,19 +383,10 @@
#xtranslate TToC([<x,...>]) => hb_TToC(<x>)
#xtranslate CToT([<x,...>]) => hb_CToT(<x>)
#xtranslate GetEnv([<x,...>]) => hb_GetEnv(<x>)
#xtranslate SetKey([<x,...>]) => hb_SetKey(<x>)
#xtranslate MemoWrit(<x>,<y>,<z>) => iif( hb_isLogical(<z>) .AND. <z>, MemoWrit(<x>,<y>), hb_MemoWrit(<x>,<y>) )
#xtranslate i18n(<x>) => hb_i18n_gettext(<x>)
#xtranslate hb_SetCodepage([<x,...>]) => hb_cdpSelect( <x> )
/* _SET_TRACE* / TraceLog() */
#xtranslate Set(_SET_TRACE [,<x,...>]) => xhb_setTrace( <x> )
#xtranslate Set(_SET_TRACEFILE [,<x,...>]) => xhb_setTraceFile( <x> )
#xtranslate Set(_SET_TRACESTACK [,<x,...>]) => xhb_setTraceStack( <x> )
/* MT functions */
#xtranslate hb_MultiThread() => hb_mtvm()
#xtranslate GetCurrentThread() => hb_threadSelf()
@@ -477,50 +525,6 @@
/* THROW => generate error */
#xtranslate THROW(<oErr>) => (Eval(ErrorBlock(), <oErr>), Break(<oErr>))
/* TEXT INTO <varname> */
#xcommand TEXT INTO <v> => #pragma __text|<v>+=%s+HB_OSNEWLINE();<v>:=""
/* SWITCH ... ; case ... ; DEFAULT ; ... ; END */
#xcommand DEFAULT => OTHERWISE
/* FOR EACH hb_enumIndex() */
#xtranslate hb_enumIndex(<!v!>) => <v>:__enumIndex()
/* TRY / CATCH / FINALLY / END */
#xcommand TRY => BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
#xcommand CATCH [<!oErr!>] => RECOVER [USING <oErr>] <-oErr->
#xcommand FINALLY => ALWAYS
/* EXTENDED CODEBLOCKs */
#xtranslate \<|[<x,...>]| => {|<x>|
#xcommand > [<*x*>] => } <x>
/* xHarbour operators: IN, HAS, LIKE, >>, <<, |, &, ^^ */
#translate ( <exp1> IN <exp2> ) => ( (<exp1>) $ (<exp2>) )
#translate ( <exp1> HAS <exp2> ) => ( HB_REGEXHAS( (<exp2>), (<exp1>) ) )
#translate ( <exp1> LIKE <exp2> ) => ( HB_REGEXLIKE( (<exp2>), (<exp1>) ) )
#translate ( <exp1> \<\< <exp2> ) => ( HB_BITSHIFT( (<exp1>), (<exp2>) ) )
#translate ( <exp1> >> <exp2> ) => ( HB_BITSHIFT( (<exp1>), -(<exp2>) ) )
/* 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 ( <exp1> | <exp2> ) => ( HB_BITOR( (<exp1>), (<exp2>) ) )
#translate ( <exp1> & <exp2> ) => ( HB_BITAND( (<exp1>), (<exp2>) ) )
#translate ( <exp1> ^^ <exp2> ) => ( HB_BITXOR( (<exp1>), (<exp2>) ) )
#endif
#command @ <row>, <col> PROMPT <prompt> [ MESSAGE <msg> ] [ COLOR <color> ] => ;
__AtPrompt( <row>, <col>, <prompt>, <msg>, <color> )
#command SET TRIMFILENAME <x:ON,OFF,&> => Set( _SET_TRIMFILENAME, <(x)> )
#command SET TIME FORMAT [TO] <f> => Set( _SET_TIMEFORMAT, <f> )
#define HB_GTI_CLIPBOARDPAST HB_GTI_CLIPBOARDPASTE
#endif
#endif /* __HARBOUR__ */

View File

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

View File

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