From dc66765645cee370ec0bd2655d7fb0b6e2687e53 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 May 2010 13:22:44 +0000 Subject: [PATCH] 2010-05-27 15:21 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/xhb/xhbfunc.c + Added XHB_NETNAME(), XHB_MEMOWRIT() * contrib/xhb/hbcompat.ch ! Fixed MEMOWRIT() translation. Someone pls test it with real xhb. * contrib/xhb/hbcompat.ch * contrib/xhb/xhb.ch ! Moved xhb_*() function dependent translations to xhb.ch. (since the promise is that hbcompat.ch translations don't need xhb lib) --- harbour/ChangeLog | 15 +++++++ harbour/contrib/xhb/hbcompat.ch | 79 +++++++++++++++------------------ harbour/contrib/xhb/xhb.ch | 5 +++ harbour/contrib/xhb/xhbfunc.c | 22 +++++++++ 4 files changed, 79 insertions(+), 42 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3b065223af..bdff13b265 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,20 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-05-27 15:21 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/xhb/xhbfunc.c + + Added XHB_NETNAME(), XHB_MEMOWRIT() + + * contrib/xhb/hbcompat.ch + ! Fixed MEMOWRIT() translation. Someone pls test it with + real xhb. + + * contrib/xhb/hbcompat.ch + * contrib/xhb/xhb.ch + ! Moved xhb_*() function dependent translations to xhb.ch. + (since the promise is that hbcompat.ch translations don't + need xhb lib) + 2010-05-27 14:54 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/xhb/hbcompat.ch * Grouped together all translations which cannot be @@ -88,6 +102,7 @@ ; NOTE: This method, as is now, has some advantages: - doesn't require modification of app source code. - doesn't require knowledge about hbcompat.ch. + - works in macros and disadvantages: - is slightly slower [DONE] - will pull unnecessary code parts into the executable [DONE] diff --git a/harbour/contrib/xhb/hbcompat.ch b/harbour/contrib/xhb/hbcompat.ch index e309959221..cb9b58ace5 100644 --- a/harbour/contrib/xhb/hbcompat.ch +++ b/harbour/contrib/xhb/hbcompat.ch @@ -276,12 +276,7 @@ #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( ) + #xtranslate MemoWrit(,,) => iif( hb_isLogical() .AND. ! , hb_MemoWrit(,), MemoWrit(,) ) /* TEXT INTO */ #xcommand TEXT INTO => #pragma __text|+=%s+HB_OSNEWLINE();:="" @@ -328,50 +323,50 @@ /* 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 ) ) - #xtranslate gtPasteClipBoard() => hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) - #xtranslate gtProcessMessages() => NextKey() - #xtranslate gfxPrimitive([]) => hb_gfxPrimitive() - #xtranslate gfxText([]) => hb_gfxText() + #xtranslate gtSetClipboard() => hb_gtInfo( HB_GTI_CLIPBOARDDATA, ) + #xtranslate gtGetClipboard() => hb_gtInfo( HB_GTI_CLIPBOARDDATA ) + #xtranslate gtGetClipBoardSize() => Len( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) ) + #xtranslate gtPasteClipBoard() => hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) + #xtranslate gtProcessMessages() => NextKey() + #xtranslate gfxPrimitive([]) => hb_gfxPrimitive() + #xtranslate gfxText([]) => hb_gfxText() - #xtranslate hb_openProcess([]) => hb_processOpen() - #xtranslate hb_closeProcess([]) => hb_processClose() + #xtranslate hb_openProcess([]) => hb_processOpen() + #xtranslate hb_closeProcess([]) => hb_processClose() - #xtranslate hb_isregexstring([]) => hb_isregex() - #xtranslate pvalue([]) => hb_pvalue() - #xtranslate methodName([]) => hb_methodName() - #xtranslate libLoad([]) => hb_libLoad() - #xtranslate libFree([]) => hb_libFree() - #xtranslate hb_checksum([]) => hb_adler32() - #xtranslate setLastKey([]) => hb_setLastKey() - #xtranslate CStr([]) => hb_CStr() - #xtranslate ValToPrgExp([]) => hb_valToExp() - #xtranslate IsDirectory() => hb_dirExists() - #xtranslate SecondsSleep([]) => hb_idleSleep() - #xtranslate FileSize() => hb_FSize() - #xtranslate WildMatch([]) => hb_WildMatch() - #xtranslate hb_DeserialNext() => hb_Deserialize() - #xtranslate hb_funcptr() => __dynsn2sym() + #xtranslate hb_isregexstring([]) => hb_isregex() + #xtranslate pvalue([]) => hb_pvalue() + #xtranslate methodName([]) => hb_methodName() + #xtranslate libLoad([]) => hb_libLoad() + #xtranslate libFree([]) => hb_libFree() + #xtranslate hb_checksum([]) => hb_adler32() + #xtranslate setLastKey([]) => hb_setLastKey() + #xtranslate CStr([]) => hb_CStr() + #xtranslate ValToPrgExp([]) => hb_valToExp() + #xtranslate IsDirectory() => hb_dirExists() + #xtranslate SecondsSleep([]) => hb_idleSleep() + #xtranslate FileSize() => hb_FSize() + #xtranslate WildMatch([]) => hb_WildMatch() + #xtranslate hb_DeserialNext() => hb_Deserialize() + #xtranslate hb_funcptr() => __dynsn2sym() - #xtranslate HexToNum([]) => hb_HexToNum() - #xtranslate NumToHex([]) => hb_NumToHex() - #xtranslate HexToStr([]) => hb_HexToStr() - #xtranslate StrToHex([]) => hb_StrToHex() + #xtranslate HexToNum([]) => hb_HexToNum() + #xtranslate NumToHex([]) => hb_NumToHex() + #xtranslate HexToStr([]) => hb_HexToStr() + #xtranslate StrToHex([]) => hb_StrToHex() - #xtranslate ISPOINTER( ) => hb_ISPOINTER( ) + #xtranslate ISPOINTER( ) => hb_ISPOINTER( ) - #xtranslate hb_SetIniComment([]) => hb_IniSetComment() - #xtranslate hb_ReadIni([]) => hb_IniRead() - #xtranslate hb_WriteIni([]) => hb_IniWrite() + #xtranslate hb_SetIniComment([]) => hb_IniSetComment() + #xtranslate hb_ReadIni([]) => hb_IniRead() + #xtranslate hb_WriteIni([]) => hb_IniWrite() - #xtranslate DisableWaitLocks([]) => hb_DisableWaitLocks() + #xtranslate DisableWaitLocks([]) => hb_DisableWaitLocks() - #xtranslate HBCONSOLELOCK() => hb_gtLock() - #xtranslate HBCONSOLEUNLOCK() => hb_gtUnLock() + #xtranslate HBCONSOLELOCK() => hb_gtLock() + #xtranslate HBCONSOLEUNLOCK() => hb_gtUnLock() - #xtranslate hb_CMDARGARGV([]) => hb_ARGV() + #xtranslate hb_CMDARGARGV([]) => hb_ARGV() #xtranslate RAScan([]) => hb_RAScan() diff --git a/harbour/contrib/xhb/xhb.ch b/harbour/contrib/xhb/xhb.ch index a7c80588f6..4aceb762c0 100644 --- a/harbour/contrib/xhb/xhb.ch +++ b/harbour/contrib/xhb/xhb.ch @@ -64,6 +64,11 @@ #xtranslate __Keyboard([]) => xhb__Keyboard() #xtranslate __CopyFile([]) => xhb_CopyFile() + /* _SET_TRACE* / TraceLog() */ + #xtranslate Set(_SET_TRACE [,]) => xhb_setTrace( ) + #xtranslate Set(_SET_TRACEFILE [,]) => xhb_setTraceFile( ) + #xtranslate Set(_SET_TRACESTACK [,]) => xhb_setTraceStack( ) + #endif #endif /* __HARBOUR__ */ diff --git a/harbour/contrib/xhb/xhbfunc.c b/harbour/contrib/xhb/xhbfunc.c index 61fd504dd3..006888760d 100644 --- a/harbour/contrib/xhb/xhbfunc.c +++ b/harbour/contrib/xhb/xhbfunc.c @@ -298,6 +298,28 @@ HB_FUNC( HB_EXEC ) hb_errRT_BASE_SubstR( EG_ARG, 1099, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } +HB_FUNC_EXTERN( HB_USERNAME ); +HB_FUNC_EXTERN( NETNAME ); + +HB_FUNC( XHB_NETNAME ) +{ + if( ISNUM( 1 ) && hb_parni( 1 ) == 1 ) + HB_FUNC_EXEC( HB_USERNAME ) + else + HB_FUNC_EXEC( NETNAME ) +} + +HB_FUNC_EXTERN( HB_MEMOWRIT ); +HB_FUNC_EXTERN( MEMOWRIT ); + +HB_FUNC( XHB_MEMOWRIT ) +{ + if( ISLOG( 3 ) && ! hb_parl( 3 ) ) + HB_FUNC_EXEC( HB_MEMOWRIT ) + else + HB_FUNC_EXEC( MEMOWRIT ) +} + HB_FUNC_EXTERN( HB_PVALUE ) ; HB_FUNC( PVALUE ) { HB_FUNC_EXEC( HB_PVALUE ); } HB_FUNC_EXTERN( HB_METHODNAME ) ; HB_FUNC( METHODNAME ) { HB_FUNC_EXEC( HB_METHODNAME ); } HB_FUNC_EXTERN( HB_LIBLOAD ) ; HB_FUNC( LIBLOAD ) { HB_FUNC_EXEC( HB_LIBLOAD ); }