2018-09-14 15:36 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* include/harbour.hbx
  * include/hbchksum.h
  * src/harbour.def
  * src/rtl/hbmd5.c
    + added new C function
         void hb_hmac_md5( const void * key, HB_SIZE nKeyLen,
                           const void * message, HB_SIZE nMsgLen,
                           char * digest );
    + added new PRG function
         HB_HMAC_MD5( <cMessage>, <cKey> ) -> <cMAC>
    ; HMAC MD5 is used in some authentication methods i.e. CRAM-MD5
      authentication in SMTP protocol

  * src/rtl/gttrm/gttrm.c
    + enable extended XTERM colors automatically when xterm-16color,
      xterm-256color, xterm+256color, xterm-88color, rxvt-16color,
      rxvt-256color, rxvt-98color or putty terminal is detected
    + added support for HB_GTI_SCREENDEPTH

  * contrib/gtqtc/gtqtc1.cpp
    + set clipboard data also into selection buffer on platforms which
      support it
    + when main clipboard buffer is empty retrieve clipboard data from
      selection buffer and if it's empty too from find buffer

  * include/harbour.hbx
  * src/harbour.def
  * src/vm/memvars.c
    + added new PRG function
         __mvGetDef( <cMemvar> [, <xDefault> ] ) -> <xValue>
      it works in similar way to __mvGet() but if <cMemvar> does
      not exist then it returns <xDefault> or NIL instead of RTE

  * contrib/hbwin/hbwin.hbx
    + added missing declarations for win_osIs10() and win_osIs81()

  * contrib/hbssl/ssl.c
    ! fixed compilation with OpenSSL < 0.9.8k

  * contrib/sddodbc/core.c
    * pacified warning

  * contrib/xhb/hbxml.c
  * contrib/xhb/hbxml.h
    ! fixed CDATA terminator, it should be "]]>" instead of " ]]>"
    + added support for HBXML_STYLE_NONEWLINE flag

  * src/3rd/pcre/Makefile
    ! typo wince -> wce

  * src/main/Makefile
    * use harbour.rc only in MS-Windows builds - it fixes OS2 OpenWatcom
      builds

  * config/global.mk
    ! in DOS builds check if the 'uname' exists before running it

  * include/hbapigt.h
  * include/hbgtcore.h
  * src/rtl/hbgtcore.c
  * src/rtl/inkey.c
  * src/rtl/inkeyapi.c
  * contrib/xhb/xhbfunc.c
    + added 3-rd parameter to hb_inkeySetText() function. When this parameter
      is true then ';' is not translated to Chr( 13 ) but DOS and UNIX EOLs
      are translated to Chr( 13 )
    + added logical parameter to HB_GTI_CLIPBOARDPASTE which allows to set
      text without ';' translation but with platform independent EOLs

  * src/rtl/memoedit.prg
  * utils/hbmk2/hbmk2.prg
  * contrib/hbnetio/utils/hbnetio/_console.prg
  * extras/dbu/dbu52.patch
  * extras/dbu/dbu53.patch
    * use hb_gtInfo( HB_GTI_CLIPBOARDPASTE, .T. ) instead of
      hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) for pasting data from clipboard
      with platform independent EOLs and ';' characters
This commit is contained in:
Przemysław Czerpak
2018-09-14 15:36:21 +02:00
parent de1d478d2c
commit 8230fcc258
27 changed files with 311 additions and 51 deletions

View File

@@ -7,6 +7,85 @@
Entries may not always be in chronological/commit order. Entries may not always be in chronological/commit order.
See license at the end of file. */ See license at the end of file. */
2018-09-14 15:36 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/harbour.hbx
* include/hbchksum.h
* src/harbour.def
* src/rtl/hbmd5.c
+ added new C function
void hb_hmac_md5( const void * key, HB_SIZE nKeyLen,
const void * message, HB_SIZE nMsgLen,
char * digest );
+ added new PRG function
HB_HMAC_MD5( <cMessage>, <cKey> ) -> <cMAC>
; HMAC MD5 is used in some authentication methods i.e. CRAM-MD5
authentication in SMTP protocol
* src/rtl/gttrm/gttrm.c
+ enable extended XTERM colors automatically when xterm-16color,
xterm-256color, xterm+256color, xterm-88color, rxvt-16color,
rxvt-256color, rxvt-98color or putty terminal is detected
+ added support for HB_GTI_SCREENDEPTH
* contrib/gtqtc/gtqtc1.cpp
+ set clipboard data also into selection buffer on platforms which
support it
+ when main clipboard buffer is empty retrieve clipboard data from
selection buffer and if it's empty too from find buffer
* include/harbour.hbx
* src/harbour.def
* src/vm/memvars.c
+ added new PRG function
__mvGetDef( <cMemvar> [, <xDefault> ] ) -> <xValue>
it works in similar way to __mvGet() but if <cMemvar> does
not exist then it returns <xDefault> or NIL instead of RTE
* contrib/hbwin/hbwin.hbx
+ added missing declarations for win_osIs10() and win_osIs81()
* contrib/hbssl/ssl.c
! fixed compilation with OpenSSL < 0.9.8k
* contrib/sddodbc/core.c
* pacified warning
* contrib/xhb/hbxml.c
* contrib/xhb/hbxml.h
! fixed CDATA terminator, it should be "]]>" instead of " ]]>"
+ added support for HBXML_STYLE_NONEWLINE flag
* src/3rd/pcre/Makefile
! typo wince -> wce
* src/main/Makefile
* use harbour.rc only in MS-Windows builds - it fixes OS2 OpenWatcom
builds
* config/global.mk
! in DOS builds check if the 'uname' exists before running it
* include/hbapigt.h
* include/hbgtcore.h
* src/rtl/hbgtcore.c
* src/rtl/inkey.c
* src/rtl/inkeyapi.c
* contrib/xhb/xhbfunc.c
+ added 3-rd parameter to hb_inkeySetText() function. When this parameter
is true then ';' is not translated to Chr( 13 ) but DOS and UNIX EOLs
are translated to Chr( 13 )
+ added logical parameter to HB_GTI_CLIPBOARDPASTE which allows to set
text without ';' translation but with platform independent EOLs
* src/rtl/memoedit.prg
* utils/hbmk2/hbmk2.prg
* contrib/hbnetio/utils/hbnetio/_console.prg
* extras/dbu/dbu52.patch
* extras/dbu/dbu53.patch
* use hb_gtInfo( HB_GTI_CLIPBOARDPASTE, .T. ) instead of
hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) for pasting data from clipboard
with platform independent EOLs and ';' characters
2018-09-02 23:07 UTC+0200 Aleksander Czajczynski (hb fki.pl) 2018-09-02 23:07 UTC+0200 Aleksander Czajczynski (hb fki.pl)
* include/hbsetup.h * include/hbsetup.h
* changed to recognize ARM64 platform with modern GCC builds * changed to recognize ARM64 platform with modern GCC builds

View File

@@ -367,11 +367,13 @@ ifeq ($(HB_HOST_PLAT),)
_DETPLAT_STR := $(OS) _DETPLAT_STR := $(OS)
include $(TOP)$(ROOT)config/detplat.mk include $(TOP)$(ROOT)config/detplat.mk
ifeq ($(HB_HOST_PLAT),) ifeq ($(HB_HOST_PLAT),)
ifneq ($(call find_in_path,uname),)
_DETPLAT_STR := $(shell uname -s) _DETPLAT_STR := $(shell uname -s)
include $(TOP)$(ROOT)config/detplat.mk include $(TOP)$(ROOT)config/detplat.mk
endif endif
endif endif
endif endif
endif
_DETPLAT_STR := _DETPLAT_STR :=
endif endif
endif endif

View File

@@ -2035,11 +2035,19 @@ static HB_BOOL hb_gt_qtc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
case HB_GTI_CLIPBOARDDATA: case HB_GTI_CLIPBOARDDATA:
{ {
QString qStr = QApplication::clipboard()->text(); QString qStr = QApplication::clipboard()->text();
if( qStr.isEmpty() && QApplication::clipboard()->supportsSelection() )
{
qStr = QApplication::clipboard()->text( QClipboard::Selection );
if( qStr.isEmpty() && QApplication::clipboard()->supportsFindBuffer() )
qStr = QApplication::clipboard()->text( QClipboard::FindBuffer );
}
pInfo->pResult = hb_gt_qtc_itemPutQString( pInfo->pResult, &qStr ); pInfo->pResult = hb_gt_qtc_itemPutQString( pInfo->pResult, &qStr );
if( pInfo->pNewVal && HB_IS_STRING( pInfo->pNewVal ) ) if( pInfo->pNewVal && HB_IS_STRING( pInfo->pNewVal ) )
{ {
hb_gt_qtc_itemGetQString( pInfo->pNewVal, &qStr ); hb_gt_qtc_itemGetQString( pInfo->pNewVal, &qStr );
QApplication::clipboard()->setText( qStr ); QApplication::clipboard()->setText( qStr );
if( QApplication::clipboard()->supportsSelection() )
QApplication::clipboard()->setText( qStr, QClipboard::Selection );
} }
break; break;
} }
@@ -2826,6 +2834,8 @@ void QTConsole::copySelection( void )
} }
QApplication::clipboard()->setText( qStr ); QApplication::clipboard()->setText( qStr );
if( QApplication::clipboard()->supportsSelection() )
QApplication::clipboard()->setText( qStr, QClipboard::Selection );
} }
void QTConsole::repaintChars( const QRect & rx ) void QTConsole::repaintChars( const QRect & rx )

View File

@@ -103,7 +103,7 @@ PROCEDURE hbnetiocon_cmdUI( cIP, nPort, cPassword )
aHistory[ ++nHistIndex ], ; aHistory[ ++nHistIndex ], ;
( nHistIndex := Len( aHistory ) + 1, "" ) ), Len( cCommand ) ), ; ( nHistIndex := Len( aHistory ) + 1, "" ) ), Len( cCommand ) ), ;
ManageCursor( cCommand ) } ) ManageCursor( cCommand ) } )
bKeyPaste := SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) } ) bKeyPaste := SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE, .T. ) } )
bKeyTab := SetKey( K_TAB, {|| CompleteCmd( @cCommand, hCommands ) } ) bKeyTab := SetKey( K_TAB, {|| CompleteCmd( @cCommand, hCommands ) } )
@@ -251,7 +251,7 @@ STATIC FUNCTION hbnetiocon_GetHidden()
ATail( GetList ):display() ATail( GetList ):display()
SetCursor( iif( ReadInsert(), SC_INSERT, SC_NORMAL ) ) SetCursor( iif( ReadInsert(), SC_INSERT, SC_NORMAL ) )
bKeyPaste := SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) } ) bKeyPaste := SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE, .T. ) } )
READ READ

View File

@@ -1200,10 +1200,12 @@ HB_FUNC( SSL_SET_TLSEXT_HOST_NAME )
{ {
if( hb_SSL_is( 1 ) ) if( hb_SSL_is( 1 ) )
{ {
#if defined( SSL_set_tlsext_host_name ) || OPENSSL_VERSION_NUMBER >= 0x00908060L
SSL * ssl = hb_SSL_par( 1 ); SSL * ssl = hb_SSL_par( 1 );
if( ssl ) if( ssl )
SSL_set_tlsext_host_name( ssl, hb_parc( 2 ) ); SSL_set_tlsext_host_name( ssl, hb_parc( 2 ) );
#endif
} }
else else
hb_errRT_BASE( EG_ARG, 2010, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); hb_errRT_BASE( EG_ARG, 2010, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );

View File

@@ -348,11 +348,13 @@ DYNAMIC win_oleCreateObject
DYNAMIC win_oleError DYNAMIC win_oleError
DYNAMIC win_oleErrorText DYNAMIC win_oleErrorText
DYNAMIC win_oleGetActiveObject DYNAMIC win_oleGetActiveObject
DYNAMIC win_osIs10
DYNAMIC win_osIs2000 DYNAMIC win_osIs2000
DYNAMIC win_osIs2000OrUpper DYNAMIC win_osIs2000OrUpper
DYNAMIC win_osIs2003 DYNAMIC win_osIs2003
DYNAMIC win_osIs7 DYNAMIC win_osIs7
DYNAMIC win_osIs8 DYNAMIC win_osIs8
DYNAMIC win_osIs81
DYNAMIC win_osIs95 DYNAMIC win_osIs95
DYNAMIC win_osIs98 DYNAMIC win_osIs98
DYNAMIC win_osIs9x DYNAMIC win_osIs9x

View File

@@ -698,8 +698,7 @@ static HB_ERRCODE odbcGoTo( SQLBASEAREAP pArea, HB_ULONG ulRecNo )
/* No pArea->pSDDData for DBCreate() area... /* No pArea->pSDDData for DBCreate() area...
* though pArea->fFetched == HB_TRUE for them * though pArea->fFetched == HB_TRUE for them
*/ */
if( pArea->pSDDData ) hStmt = pArea->pSDDData ? ( ( SDDDATA * ) pArea->pSDDData )->hStmt : NULL;
hStmt = ( ( SDDDATA * ) pArea->pSDDData )->hStmt;
while( ulRecNo > pArea->ulRecCount && ! pArea->fFetched ) while( ulRecNo > pArea->ulRecCount && ! pArea->fFetched )
{ {

View File

@@ -1623,6 +1623,9 @@ static MXML_STATUS mxml_node_write( MXML_OUTPUT * out, PHB_ITEM pNode, int style
pChild = hb_itemNew( NULL ); pChild = hb_itemNew( NULL );
pItem = hb_itemNew( NULL ); pItem = hb_itemNew( NULL );
if( style & MXML_STYLE_NONEWLINE )
style &= ~MXML_STYLE_INDENT;
if( style & MXML_STYLE_INDENT ) if( style & MXML_STYLE_INDENT )
{ {
hb_objSendMsg( pNode, "DEPTH", 0 ); hb_objSendMsg( pNode, "DEPTH", 0 );
@@ -1653,6 +1656,7 @@ static MXML_STATUS mxml_node_write( MXML_OUTPUT * out, PHB_ITEM pNode, int style
if( HB_IS_NIL( pItem ) && HB_IS_NIL( pChild ) ) if( HB_IS_NIL( pItem ) && HB_IS_NIL( pChild ) )
{ {
mxml_output_string_len( out, "/>", 2 ); mxml_output_string_len( out, "/>", 2 );
if( ! ( style & MXML_STYLE_NONEWLINE ) )
mxml_output_string( out, hb_conNewLine() ); mxml_output_string( out, hb_conNewLine() );
} }
else else
@@ -1664,6 +1668,7 @@ static MXML_STATUS mxml_node_write( MXML_OUTPUT * out, PHB_ITEM pNode, int style
if( ! HB_IS_NIL( pChild ) ) if( ! HB_IS_NIL( pChild ) )
{ {
mustIndent = 1; mustIndent = 1;
if( ! ( style & MXML_STYLE_NONEWLINE ) )
mxml_output_string( out, hb_conNewLine() ); mxml_output_string( out, hb_conNewLine() );
while( ! HB_IS_NIL( pChild ) ) while( ! HB_IS_NIL( pChild ) )
@@ -1693,6 +1698,7 @@ static MXML_STATUS mxml_node_write( MXML_OUTPUT * out, PHB_ITEM pNode, int style
hb_objSendMsg( pNode, "CNAME", 0 ); hb_objSendMsg( pNode, "CNAME", 0 );
mxml_output_string_len( out, hb_parc( -1 ), hb_parclen( -1 ) ); mxml_output_string_len( out, hb_parc( -1 ), hb_parclen( -1 ) );
mxml_output_char( out, '>' ); mxml_output_char( out, '>' );
if( ! ( style & MXML_STYLE_NONEWLINE ) )
mxml_output_string( out, hb_conNewLine() ); mxml_output_string( out, hb_conNewLine() );
} }
break; break;
@@ -1702,6 +1708,7 @@ static MXML_STATUS mxml_node_write( MXML_OUTPUT * out, PHB_ITEM pNode, int style
hb_objSendMsg( pNode, "CDATA", 0 ); hb_objSendMsg( pNode, "CDATA", 0 );
mxml_output_string_len( out, hb_parc( -1 ), hb_parclen( -1 ) ); mxml_output_string_len( out, hb_parc( -1 ), hb_parclen( -1 ) );
mxml_output_string_len( out, " -->", 4 ); mxml_output_string_len( out, " -->", 4 );
if( ! ( style & MXML_STYLE_NONEWLINE ) )
mxml_output_string( out, hb_conNewLine() ); mxml_output_string( out, hb_conNewLine() );
break; break;
@@ -1709,7 +1716,8 @@ static MXML_STATUS mxml_node_write( MXML_OUTPUT * out, PHB_ITEM pNode, int style
mxml_output_string_len( out, "<![CDATA[ ", 9 ); mxml_output_string_len( out, "<![CDATA[ ", 9 );
hb_objSendMsg( pNode, "CDATA", 0 ); hb_objSendMsg( pNode, "CDATA", 0 );
mxml_output_string_len( out, hb_parc( -1 ), hb_parclen( -1 ) ); mxml_output_string_len( out, hb_parc( -1 ), hb_parclen( -1 ) );
mxml_output_string_len( out, " ]]>", 4 ); mxml_output_string_len( out, "]]>", 3 );
if( ! ( style & MXML_STYLE_NONEWLINE ) )
mxml_output_string( out, hb_conNewLine() ); mxml_output_string( out, hb_conNewLine() );
break; break;
@@ -1719,6 +1727,7 @@ static MXML_STATUS mxml_node_write( MXML_OUTPUT * out, PHB_ITEM pNode, int style
mxml_output_string_escape( out, hb_parcx( -1 ) ); mxml_output_string_escape( out, hb_parcx( -1 ) );
else else
mxml_output_string_len( out, hb_parcx( -1 ), hb_parclen( -1 ) ); mxml_output_string_len( out, hb_parcx( -1 ), hb_parclen( -1 ) );
if( ! ( style & MXML_STYLE_NONEWLINE ) )
mxml_output_string( out, hb_conNewLine() ); mxml_output_string( out, hb_conNewLine() );
break; break;
@@ -1735,6 +1744,7 @@ static MXML_STATUS mxml_node_write( MXML_OUTPUT * out, PHB_ITEM pNode, int style
mxml_output_string_len( out, hb_parcx( -1 ), hb_parclen( -1 ) ); mxml_output_string_len( out, hb_parcx( -1 ), hb_parclen( -1 ) );
} }
mxml_output_char( out, '>' ); mxml_output_char( out, '>' );
if( ! ( style & MXML_STYLE_NONEWLINE ) )
mxml_output_string( out, hb_conNewLine() ); mxml_output_string( out, hb_conNewLine() );
break; break;
@@ -1750,6 +1760,7 @@ static MXML_STATUS mxml_node_write( MXML_OUTPUT * out, PHB_ITEM pNode, int style
mxml_output_string_len( out, hb_parcx( -1 ), hb_parclen( -1 ) ); mxml_output_string_len( out, hb_parcx( -1 ), hb_parclen( -1 ) );
} }
mxml_output_string_len( out, "?>", 2 ); mxml_output_string_len( out, "?>", 2 );
if( ! ( style & MXML_STYLE_NONEWLINE ) )
mxml_output_string( out, hb_conNewLine() ); mxml_output_string( out, hb_conNewLine() );
break; break;
@@ -1763,6 +1774,7 @@ static MXML_STATUS mxml_node_write( MXML_OUTPUT * out, PHB_ITEM pNode, int style
hb_objSendMsg( pChild, "ONEXT", 0 ); hb_objSendMsg( pChild, "ONEXT", 0 );
hb_itemMove( pChild, hb_param( -1, HB_IT_ANY ) ); hb_itemMove( pChild, hb_param( -1, HB_IT_ANY ) );
} }
if( ! ( style & MXML_STYLE_NONEWLINE ) )
mxml_output_string( out, hb_conNewLine() ); mxml_output_string( out, hb_conNewLine() );
break; break;
} }

View File

@@ -84,6 +84,7 @@
#define MXML_STYLE_TAB 0x0002 #define MXML_STYLE_TAB 0x0002
#define MXML_STYLE_THREESPACES 0x0004 #define MXML_STYLE_THREESPACES 0x0004
#define MXML_STYLE_NOESCAPE 0x0008 #define MXML_STYLE_NOESCAPE 0x0008
#define MXML_STYLE_NONEWLINE 0x0010
/* Status values */ /* Status values */

View File

@@ -117,7 +117,7 @@ HB_FUNC( XHB__KEYBOARD )
} }
else if( HB_ISCHAR( 1 ) ) else if( HB_ISCHAR( 1 ) )
{ {
hb_inkeySetText( hb_parc( 1 ), hb_parclen( 1 ) ); hb_inkeySetText( hb_parc( 1 ), hb_parclen( 1 ), HB_FALSE );
} }
else if( HB_ISARRAY( 1 ) ) else if( HB_ISARRAY( 1 ) )
{ {
@@ -135,7 +135,7 @@ HB_FUNC( XHB__KEYBOARD )
} }
else if( HB_IS_STRING( pItem ) ) else if( HB_IS_STRING( pItem ) )
{ {
hb_inkeySetText( ( const char * ) hb_itemGetCPtr( pItem ), hb_itemGetCLen( pItem ) ); hb_inkeySetText( hb_itemGetCPtr( pItem ), hb_itemGetCLen( pItem ), HB_FALSE );
} }
} }
} }

View File

@@ -23,7 +23,7 @@ diff -u dbu52ori/dbu.prg dbu52pat/dbu.prg
+ hb_cdpSelect( "UTF8EX" ) + hb_cdpSelect( "UTF8EX" )
+ hb_gtInfo( HB_GTI_BOXCP, "UTF8EX" ) + hb_gtInfo( HB_GTI_BOXCP, "UTF8EX" )
+ ENDIF + ENDIF
+ SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) } ) + SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE, .T. ) } )
IF (ISCOLOR() .OR. "/C" $ UPPER(param2)) .AND. .NOT. "/M" $ UPPER(param2) IF (ISCOLOR() .OR. "/C" $ UPPER(param2)) .AND. .NOT. "/M" $ UPPER(param2)
* make it pretty * make it pretty

View File

@@ -24,7 +24,7 @@ diff -u dbu53ori/dbu.prg dbu53pat/dbu.prg
+ hb_cdpSelect( "UTF8EX" ) + hb_cdpSelect( "UTF8EX" )
+ hb_gtInfo( HB_GTI_BOXCP, "UTF8EX" ) + hb_gtInfo( HB_GTI_BOXCP, "UTF8EX" )
+ ENDIF + ENDIF
+ SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) } ) + SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE, .T. ) } )
+ +
IF (ISCOLOR() .OR. "/C" $ UPPER(param2)) .AND. .NOT. "/M" $ UPPER(param2) IF (ISCOLOR() .OR. "/C" $ UPPER(param2)) .AND. .NOT. "/M" $ UPPER(param2)
// make it pretty // make it pretty

View File

@@ -527,6 +527,7 @@ DYNAMIC hb_HHasKey
DYNAMIC hb_HKeepOrder DYNAMIC hb_HKeepOrder
DYNAMIC hb_HKeyAt DYNAMIC hb_HKeyAt
DYNAMIC hb_HKeys DYNAMIC hb_HKeys
DYNAMIC hb_HMAC_MD5
DYNAMIC hb_HMAC_SHA1 DYNAMIC hb_HMAC_SHA1
DYNAMIC hb_HMAC_SHA224 DYNAMIC hb_HMAC_SHA224
DYNAMIC hb_HMAC_SHA256 DYNAMIC hb_HMAC_SHA256
@@ -1526,6 +1527,7 @@ DYNAMIC __mvClear
DYNAMIC __mvDbgInfo DYNAMIC __mvDbgInfo
DYNAMIC __mvExist DYNAMIC __mvExist
DYNAMIC __mvGet DYNAMIC __mvGet
DYNAMIC __mvGetDef
DYNAMIC __mvPrivate DYNAMIC __mvPrivate
DYNAMIC __mvPublic DYNAMIC __mvPublic
DYNAMIC __mvPut DYNAMIC __mvPut

View File

@@ -289,7 +289,7 @@ extern HB_EXPORT int hb_inkeyLast( int iEvenMask ); /* Return the value
extern HB_EXPORT int hb_inkeyNext( int iEvenMask ); /* Return the next key without extracting it */ extern HB_EXPORT int hb_inkeyNext( int iEvenMask ); /* Return the next key without extracting it */
extern HB_EXPORT void hb_inkeyPoll( void ); /* Poll the console keyboard to stuff the Harbour buffer */ extern HB_EXPORT void hb_inkeyPoll( void ); /* Poll the console keyboard to stuff the Harbour buffer */
extern HB_EXPORT void hb_inkeyReset( void ); /* Reset the Harbour keyboard buffer */ extern HB_EXPORT void hb_inkeyReset( void ); /* Reset the Harbour keyboard buffer */
extern HB_EXPORT void hb_inkeySetText( const char * szText, HB_SIZE nLen ); /* Set text into inkey buffer */ extern HB_EXPORT void hb_inkeySetText( const char * szText, HB_SIZE nLen, HB_BOOL fEol ); /* Set text into inkey buffer */
extern HB_EXPORT int hb_inkeySetLast( int iKey ); /* Set new LastKey() value, return previous one */ extern HB_EXPORT int hb_inkeySetLast( int iKey ); /* Set new LastKey() value, return previous one */
extern HB_EXPORT void hb_inkeyExit( void ); /* reset inkey pool to default state and free any allocated resources */ extern HB_EXPORT void hb_inkeyExit( void ); /* reset inkey pool to default state and free any allocated resources */

View File

@@ -55,5 +55,7 @@ extern HB_EXPORT HB_MAXUINT hb_crc( HB_MAXUINT crc, const void * buf, HB_SIZE le
extern HB_EXPORT HB_MAXUINT hb_crcct( HB_MAXUINT crc, const void * buf, HB_SIZE len, HB_MAXUINT poly ); extern HB_EXPORT HB_MAXUINT hb_crcct( HB_MAXUINT crc, const void * buf, HB_SIZE len, HB_MAXUINT poly );
extern HB_EXPORT void hb_md5( const void * data, HB_SIZE datalen, char * digest ); extern HB_EXPORT void hb_md5( const void * data, HB_SIZE datalen, char * digest );
extern HB_EXPORT HB_BOOL hb_md5file( const char * pszFileName, char * digest ); extern HB_EXPORT HB_BOOL hb_md5file( const char * pszFileName, char * digest );
extern HB_EXPORT void hb_hmac_md5( const void * key, HB_SIZE nKeyLen,
const void * message, HB_SIZE nMsgLen, char * digest );
HB_EXTERN_END HB_EXTERN_END

View File

@@ -205,7 +205,7 @@ typedef struct
int (* InkeyLast) ( HB_GT_PTR, int iEventMask ); int (* InkeyLast) ( HB_GT_PTR, int iEventMask );
int (* InkeyNext) ( HB_GT_PTR, int iEventMask ); int (* InkeyNext) ( HB_GT_PTR, int iEventMask );
void (* InkeyPoll) ( HB_GT_PTR ); void (* InkeyPoll) ( HB_GT_PTR );
void (* InkeySetText) ( HB_GT_PTR, const char * szText, HB_SIZE nLen ); void (* InkeySetText) ( HB_GT_PTR, const char * szText, HB_SIZE nLen, HB_BOOL fEol );
int (* InkeySetLast) ( HB_GT_PTR, int iKey ); int (* InkeySetLast) ( HB_GT_PTR, int iKey );
void (* InkeyReset) ( HB_GT_PTR ); void (* InkeyReset) ( HB_GT_PTR );
void (* InkeyExit) ( HB_GT_PTR ); void (* InkeyExit) ( HB_GT_PTR );
@@ -463,7 +463,7 @@ extern HB_EXPORT void hb_gt_gcMark( void );
#define HB_GTSELF_INKEYLAST(g,m) (g)->pFuncTable->InkeyLast(g,m) #define HB_GTSELF_INKEYLAST(g,m) (g)->pFuncTable->InkeyLast(g,m)
#define HB_GTSELF_INKEYNEXT(g,m) (g)->pFuncTable->InkeyNext(g,m) #define HB_GTSELF_INKEYNEXT(g,m) (g)->pFuncTable->InkeyNext(g,m)
#define HB_GTSELF_INKEYPOLL(g) (g)->pFuncTable->InkeyPoll(g) #define HB_GTSELF_INKEYPOLL(g) (g)->pFuncTable->InkeyPoll(g)
#define HB_GTSELF_INKEYSETTEXT(g,s,l) (g)->pFuncTable->InkeySetText(g,s,l) #define HB_GTSELF_INKEYSETTEXT(g,s,l,e) (g)->pFuncTable->InkeySetText(g,s,l,e)
#define HB_GTSELF_INKEYSETLAST(g,k) (g)->pFuncTable->InkeySetLast(g,k) #define HB_GTSELF_INKEYSETLAST(g,k) (g)->pFuncTable->InkeySetLast(g,k)
#define HB_GTSELF_INKEYRESET(g) (g)->pFuncTable->InkeyReset(g) #define HB_GTSELF_INKEYRESET(g) (g)->pFuncTable->InkeyReset(g)
#define HB_GTSELF_INKEYEXIT(g) (g)->pFuncTable->InkeyExit(g) #define HB_GTSELF_INKEYEXIT(g) (g)->pFuncTable->InkeyExit(g)
@@ -593,7 +593,7 @@ extern HB_EXPORT void hb_gt_gcMark( void );
#define HB_GTSUPER_INKEYLAST(g,m) (HB_GTSUPERTABLE(g))->InkeyLast(g,m) #define HB_GTSUPER_INKEYLAST(g,m) (HB_GTSUPERTABLE(g))->InkeyLast(g,m)
#define HB_GTSUPER_INKEYNEXT(g,m) (HB_GTSUPERTABLE(g))->InkeyNext(g,m) #define HB_GTSUPER_INKEYNEXT(g,m) (HB_GTSUPERTABLE(g))->InkeyNext(g,m)
#define HB_GTSUPER_INKEYPOLL(g) (HB_GTSUPERTABLE(g))->InkeyPoll(g) #define HB_GTSUPER_INKEYPOLL(g) (HB_GTSUPERTABLE(g))->InkeyPoll(g)
#define HB_GTSUPER_INKEYSETTEXT(g,s,l) (HB_GTSUPERTABLE(g))->InkeySetText(g,s,l) #define HB_GTSUPER_INKEYSETTEXT(g,s,l,e) (HB_GTSUPERTABLE(g))->InkeySetText(g,s,l,e)
#define HB_GTSUPER_INKEYSETLAST(g,k) (HB_GTSUPERTABLE(g))->InkeySetLast(g,k) #define HB_GTSUPER_INKEYSETLAST(g,k) (HB_GTSUPERTABLE(g))->InkeySetLast(g,k)
#define HB_GTSUPER_INKEYRESET(g) (HB_GTSUPERTABLE(g))->InkeyReset(g) #define HB_GTSUPER_INKEYRESET(g) (HB_GTSUPERTABLE(g))->InkeyReset(g)
#define HB_GTSUPER_INKEYEXIT(g) (HB_GTSUPERTABLE(g))->InkeyExit(g) #define HB_GTSUPER_INKEYEXIT(g) (HB_GTSUPERTABLE(g))->InkeyExit(g)

View File

@@ -35,7 +35,7 @@ ifneq ($(HB_HAS_PCRE_LOCAL),)
# only needed for win/wce, for other platforms this is noop # only needed for win/wce, for other platforms this is noop
HB_CFLAGS_STA := -DPCRE_STATIC HB_CFLAGS_STA := -DPCRE_STATIC
ifeq ($(filter $(HB_PLATFORM),win wince dos vxworks),) ifeq ($(filter $(HB_PLATFORM),win wce dos vxworks),)
HB_CFLAGS += -DHAVE_STDINT_H HB_CFLAGS += -DHAVE_STDINT_H
else else
ifeq ($(HB_PLATFORM),sunos) ifeq ($(HB_PLATFORM),sunos)

View File

@@ -623,6 +623,7 @@ HB_FUN_HB_HHASKEY
HB_FUN_HB_HKEEPORDER HB_FUN_HB_HKEEPORDER
HB_FUN_HB_HKEYAT HB_FUN_HB_HKEYAT
HB_FUN_HB_HKEYS HB_FUN_HB_HKEYS
HB_FUN_HB_HMAC_MD5
HB_FUN_HB_HMAC_SHA1 HB_FUN_HB_HMAC_SHA1
HB_FUN_HB_HMAC_SHA224 HB_FUN_HB_HMAC_SHA224
HB_FUN_HB_HMAC_SHA256 HB_FUN_HB_HMAC_SHA256
@@ -1843,6 +1844,7 @@ HB_FUN___MVCLEAR
HB_FUN___MVDBGINFO HB_FUN___MVDBGINFO
HB_FUN___MVEXIST HB_FUN___MVEXIST
HB_FUN___MVGET HB_FUN___MVGET
HB_FUN___MVGETDEF
HB_FUN___MVPRIVATE HB_FUN___MVPRIVATE
HB_FUN___MVPUBLIC HB_FUN___MVPUBLIC
HB_FUN___MVPUT HB_FUN___MVPUT
@@ -2723,6 +2725,7 @@ hb_hashTableFind
hb_hashTableKill hb_hashTableKill
hb_hashTableResize hb_hashTableResize
hb_hashTableSize hb_hashTableSize
hb_hmac_md5
hb_idleReset hb_idleReset
hb_idleSleep hb_idleSleep
hb_idleState hb_idleState

View File

@@ -4,7 +4,9 @@ C_SOURCES := \
C_MAIN := harbour.c C_MAIN := harbour.c
ifneq ($(filter $(HB_PLATFORM),win wce),)
RC_SOURCES := harbour.rc RC_SOURCES := harbour.rc
endif
LIBS := \ LIBS := \
hbcplr \ hbcplr \

View File

@@ -128,6 +128,7 @@ static HB_GT_FUNCS SuperTable;
#define TERM_CYGWIN 5 #define TERM_CYGWIN 5
#define TERM_PUTTY 16 #define TERM_PUTTY 16
#define HB_GTTRM_CLRNDF -1
#define HB_GTTRM_CLRSTD 0 #define HB_GTTRM_CLRSTD 0
#define HB_GTTRM_CLRX16 1 #define HB_GTTRM_CLRX16 1
#define HB_GTTRM_CLR256 2 #define HB_GTTRM_CLR256 2
@@ -3165,7 +3166,7 @@ static void hb_gt_trm_SetTerm( PHB_GTTRM pTerm )
pTerm->mouse_type = MOUSE_NONE; pTerm->mouse_type = MOUSE_NONE;
pTerm->esc_delay = ESC_DELAY; pTerm->esc_delay = ESC_DELAY;
pTerm->iAttrMask = ~HB_GTTRM_ATTR_BOX; pTerm->iAttrMask = ~HB_GTTRM_ATTR_BOX;
pTerm->iExtColor = HB_GTTRM_CLRSTD; pTerm->iExtColor = HB_GTTRM_CLRNDF;
pTerm->terminal_ext = 0; pTerm->terminal_ext = 0;
pTerm->fAM = HB_FALSE; pTerm->fAM = HB_FALSE;
@@ -3220,12 +3221,13 @@ static void hb_gt_trm_SetTerm( PHB_GTTRM pTerm )
if( szTerm == NULL || *szTerm == '\0' ) if( szTerm == NULL || *szTerm == '\0' )
szTerm = "ansi"; szTerm = "ansi";
} }
if( strncmp( szTerm, "putty", 5 ) == 0 )
pTerm->terminal_ext |= TERM_PUTTY;
} }
if( ( pTerm->terminal_ext & TERM_PUTTY ) || if( ( pTerm->terminal_ext & TERM_PUTTY ) ||
strstr( szTerm, "xterm" ) != NULL || strncmp( szTerm, "xterm", 5 ) == 0 ||
strncmp( szTerm, "rxvt", 4 ) == 0 || strncmp( szTerm, "rxvt", 4 ) == 0 ||
strcmp( szTerm, "putty" ) == 0 ||
strncmp( szTerm, "screen", 6 ) == 0 ) strncmp( szTerm, "screen", 6 ) == 0 )
{ {
pTerm->Init = hb_gt_trm_AnsiInit; pTerm->Init = hb_gt_trm_AnsiInit;
@@ -3241,6 +3243,22 @@ static void hb_gt_trm_SetTerm( PHB_GTTRM pTerm )
pTerm->Bell = hb_gt_trm_AnsiBell; pTerm->Bell = hb_gt_trm_AnsiBell;
pTerm->szAcsc = szAcsc; pTerm->szAcsc = szAcsc;
pTerm->terminal_type = TERM_XTERM; pTerm->terminal_type = TERM_XTERM;
if( pTerm->iExtColor == HB_GTTRM_CLRNDF )
{
if( pTerm->terminal_ext & TERM_PUTTY )
pTerm->iExtColor = HB_GTTRM_CLR256;
else if( strncmp( szTerm, "xterm", 5 ) == 0 ||
strncmp( szTerm, "rxvt", 4 ) == 0 )
{
if( strstr( szTerm, "+256color" ) != NULL ||
strstr( szTerm, "-256color" ) != NULL )
pTerm->iExtColor = HB_GTTRM_CLR256;
else if( strstr( szTerm, "-88color" ) != NULL )
pTerm->iExtColor = HB_GTTRM_CLRRGB;
else if( strstr( szTerm, "-16color" ) != NULL )
pTerm->iExtColor = HB_GTTRM_CLRAIX;
}
}
} }
else if( strncmp( szTerm, "linux", 5 ) == 0 || else if( strncmp( szTerm, "linux", 5 ) == 0 ||
strcmp( szTerm, "cygwin" ) == 0 || strcmp( szTerm, "cygwin" ) == 0 ||
@@ -3300,7 +3318,8 @@ static void hb_gt_trm_SetTerm( PHB_GTTRM pTerm )
pTerm->szAcsc = szExtAcsc; pTerm->szAcsc = szExtAcsc;
pTerm->terminal_type = TERM_ANSI; pTerm->terminal_type = TERM_ANSI;
} }
if( pTerm->iExtColor == HB_GTTRM_CLRNDF )
pTerm->iExtColor = HB_GTTRM_CLRSTD;
pTerm->fStdinTTY = hb_fsIsDevice( pTerm->hFilenoStdin ); pTerm->fStdinTTY = hb_fsIsDevice( pTerm->hFilenoStdin );
pTerm->fStdoutTTY = hb_fsIsDevice( pTerm->hFilenoStdout ); pTerm->fStdoutTTY = hb_fsIsDevice( pTerm->hFilenoStdout );
pTerm->fStderrTTY = hb_fsIsDevice( pTerm->hFilenoStderr ); pTerm->fStderrTTY = hb_fsIsDevice( pTerm->hFilenoStderr );
@@ -4002,6 +4021,29 @@ static HB_BOOL hb_gt_trm_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
} }
break; break;
case HB_GTI_SCREENDEPTH:
switch( pTerm->iExtColor )
{
case HB_GTTRM_CLRRGB:
iVal = 8;
break;
case HB_GTTRM_CLR256:
iVal = 6;
break;
case HB_GTTRM_CLRX16:
case HB_GTTRM_CLRAIX:
iVal = 4;
break;
case HB_GTTRM_CLRSTD:
iVal = ( pTerm->terminal_type == TERM_LINUX ||
( pTerm->terminal_ext & TERM_PUTTY ) ) ? 8 : 3;
break;
default:
iVal = 3;
break;
}
pInfo->pResult = hb_itemPutNI( pInfo->pResult, iVal );
break;
case HB_GTI_PALETTE: case HB_GTI_PALETTE:
if( hb_itemType( pInfo->pNewVal ) & HB_IT_NUMERIC ) if( hb_itemType( pInfo->pNewVal ) & HB_IT_NUMERIC )

View File

@@ -1961,7 +1961,8 @@ static HB_BOOL hb_gt_def_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
case HB_GTI_CLIPBOARDPASTE: case HB_GTI_CLIPBOARDPASTE:
if( HB_GTSELF_INFO( pGT, HB_GTI_CLIPBOARDDATA, pInfo ) ) if( HB_GTSELF_INFO( pGT, HB_GTI_CLIPBOARDDATA, pInfo ) )
HB_GTSELF_INKEYSETTEXT( pGT, hb_itemGetCPtr( pInfo->pResult ), HB_GTSELF_INKEYSETTEXT( pGT, hb_itemGetCPtr( pInfo->pResult ),
hb_itemGetCLen( pInfo->pResult ) ); hb_itemGetCLen( pInfo->pResult ),
hb_itemGetL( pInfo->pNewVal ) );
break; break;
case HB_GTI_NOTIFIERBLOCK: case HB_GTI_NOTIFIERBLOCK:
@@ -3031,9 +3032,9 @@ static int hb_gt_def_InkeySetLast( PHB_GT pGT, int iKey )
} }
/* Set text into inkey buffer */ /* Set text into inkey buffer */
static void hb_gt_def_InkeySetText( PHB_GT pGT, const char * szText, HB_SIZE nLen ) static void hb_gt_def_InkeySetText( PHB_GT pGT, const char * szText, HB_SIZE nLen, HB_BOOL fEol )
{ {
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeySetText(%p,%s,%" HB_PFS "u)", ( void * ) pGT, szText, nLen ) ); HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeySetText(%p,%s,%" HB_PFS "u, %d)", ( void * ) pGT, szText, nLen, fEol ) );
if( pGT->StrBuffer ) if( pGT->StrBuffer )
{ {
@@ -3045,13 +3046,29 @@ static void hb_gt_def_InkeySetText( PHB_GT pGT, const char * szText, HB_SIZE nLe
{ {
PHB_CODEPAGE cdp = hb_vmCDP(); PHB_CODEPAGE cdp = hb_vmCDP();
HB_SIZE nIndex = 0; HB_SIZE nIndex = 0;
HB_WCHAR wc; HB_WCHAR wc, prev = 0;
pGT->StrBufferSize = pGT->StrBufferPos = 0; pGT->StrBufferSize = pGT->StrBufferPos = 0;
pGT->StrBuffer = ( HB_WCHAR * ) hb_xgrab( nLen * sizeof( HB_WCHAR ) ); pGT->StrBuffer = ( HB_WCHAR * ) hb_xgrab( nLen * sizeof( HB_WCHAR ) );
while( HB_CDPCHAR_GET( cdp, szText, nLen, &nIndex, &wc ) ) while( HB_CDPCHAR_GET( cdp, szText, nLen, &nIndex, &wc ) )
pGT->StrBuffer[ pGT->StrBufferSize++ ] = wc == ';' ? HB_CHAR_CR : wc; {
if( fEol )
{
if( wc == HB_CHAR_LF )
{
if( prev == HB_CHAR_CR )
{
prev = 0;
continue;
}
else
wc = HB_CHAR_CR;
}
}
else if( wc == ';' )
wc = HB_CHAR_CR;
pGT->StrBuffer[ pGT->StrBufferSize++ ] = prev = wc;
}
if( pGT->StrBufferSize == 0 ) if( pGT->StrBufferSize == 0 )
{ {
hb_xfree( pGT->StrBuffer ); hb_xfree( pGT->StrBuffer );

View File

@@ -6,7 +6,7 @@
* Copyright 2004 Dmitry V. Korzhov <dk@april26.spb.ru> * Copyright 2004 Dmitry V. Korzhov <dk@april26.spb.ru>
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl> * Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
* updated for current Harbour code, other then x86@32 machines, * updated for current Harbour code, other then x86@32 machines,
* files and buffers longer then 2^32 and some fixes * files and buffers longer then 2^32 and some fixes, HMAC-MD5
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -107,6 +107,10 @@ typedef struct
/* Defines for file ops */ /* Defines for file ops */
#define MAX_FBUF 0x20000 /* file read buffer size, MUST be 64*n */ #define MAX_FBUF 0x20000 /* file read buffer size, MUST be 64*n */
/* Defines for HMAC_MD5 */
#define IPAD 0x36
#define OPAD 0x5C
/* Static data */ /* Static data */
static const HB_U32 T[ 64 ] = { static const HB_U32 T[ 64 ] = {
0xD76AA478, 0xE8C7B756, 0x242070DB, 0xC1BDCEEE, 0xD76AA478, 0xE8C7B756, 0x242070DB, 0xC1BDCEEE,
@@ -233,14 +237,7 @@ static void hb_md5val( HB_U32 accum[], char * md5val )
} }
} }
/* static void hb_md5_count( const void * data, HB_SIZE nLen, char * digest, const void * init_block )
Parameters:
data - input byte stream
datalen - input stream length
digest - raw (unformatted) MD5 digest buffer
(at least 16 bytes long)
*/
void hb_md5( const void * data, HB_SIZE nLen, char * digest )
{ {
const unsigned char * ucdata = ( const unsigned char * ) data; const unsigned char * ucdata = ( const unsigned char * ) data;
HB_UCHAR buf[ 128 ]; HB_UCHAR buf[ 128 ];
@@ -249,6 +246,11 @@ void hb_md5( const void * data, HB_SIZE nLen, char * digest )
/* perform startup procedures */ /* perform startup procedures */
hb_md5accinit( md5.accum ); hb_md5accinit( md5.accum );
if( init_block )
{
memcpy( md5.buf, init_block, 64 );
hb_md5go( &md5 );
}
/* count full 512-bit blocks in data*/ /* count full 512-bit blocks in data*/
n = nLen >> 6; n = nLen >> 6;
/* process full blocks */ /* process full blocks */
@@ -257,6 +259,8 @@ void hb_md5( const void * data, HB_SIZE nLen, char * digest )
memcpy( md5.buf, ucdata, 64 ); memcpy( md5.buf, ucdata, 64 );
hb_md5go( &md5 ); hb_md5go( &md5 );
} }
if( init_block )
nLen += 64;
/* prepare additional block(s) */ /* prepare additional block(s) */
memset( buf, 0, sizeof( buf ) ); memset( buf, 0, sizeof( buf ) );
n = nLen & 63; n = nLen & 63;
@@ -284,6 +288,41 @@ void hb_md5( const void * data, HB_SIZE nLen, char * digest )
hb_md5val( md5.accum, digest ); hb_md5val( md5.accum, digest );
} }
/*
Parameters:
data - input byte stream
datalen - input stream length
digest - raw (unformatted) MD5 digest buffer
(at least 16 bytes long)
*/
void hb_md5( const void * data, HB_SIZE nLen, char * digest )
{
hb_md5_count( data, nLen, digest, NULL );
}
void hb_hmac_md5( const void * key, HB_SIZE nKeyLen,
const void * message, HB_SIZE nMsgLen, char * digest )
{
char init_block[ 64 ];
int i;
memset( init_block, 0, sizeof( init_block ) );
if( nKeyLen <= sizeof( init_block ) )
memcpy( init_block, key, nKeyLen );
else
hb_md5( key, nKeyLen, init_block );
for( i = 0; i < ( int ) sizeof( init_block ); ++i )
init_block[ i ] ^= IPAD;
hb_md5_count( message, nMsgLen, digest, init_block );
for( i = 0; i < ( int ) sizeof( init_block ); ++i )
init_block[ i ] ^= IPAD ^ OPAD;
hb_md5_count( digest, 16, digest, init_block );
}
/* /*
Parameters: Parameters:
pFile - file handle pFile - file handle
@@ -378,6 +417,14 @@ HB_FUNC( HB_MD5 ) /* Considered insecure. Use SHA256 or higher instead. */
} }
else else
hb_retclen( dststr, HB_SIZEOFARRAY( dststr ) ); hb_retclen( dststr, HB_SIZEOFARRAY( dststr ) );
if( ! hb_parl( 2 ) )
{
char digest[ ( sizeof( dststr ) * 2 ) + 1 ];
hb_strtohex( dststr, sizeof( dststr ), digest );
hb_retclen( digest, HB_SIZEOFARRAY( digest ) - 1 );
}
else
hb_retclen( dststr, HB_SIZEOFARRAY( dststr ) );
} }
else else
hb_retc_null(); /* return empty string on wrong call */ hb_retc_null(); /* return empty string on wrong call */
@@ -402,3 +449,20 @@ HB_FUNC( HB_MD5FILE ) /* Considered insecure. Use SHA256 or higher instead. */
else else
hb_retc_null(); /* return empty string on wrong call */ hb_retc_null(); /* return empty string on wrong call */
} }
HB_FUNC( HB_HMAC_MD5 )
{
char dststr[ 16 ];
hb_hmac_md5( hb_parcx( 2 ), hb_parclen( 2 ),
hb_parcx( 1 ), hb_parclen( 1 ), dststr );
if( ! hb_parl( 3 ) )
{
char digest[ ( sizeof( dststr ) * 2 ) + 1 ];
hb_strtohex( dststr, sizeof( dststr ), digest );
hb_retclen( digest, HB_SIZEOFARRAY( digest ) - 1 );
}
else
hb_retclen( dststr, HB_SIZEOFARRAY( dststr ) );
}

View File

@@ -102,7 +102,7 @@ HB_FUNC( __KEYBOARD )
hb_inkeyReset(); hb_inkeyReset();
if( HB_ISCHAR( 1 ) ) if( HB_ISCHAR( 1 ) )
hb_inkeySetText( hb_parc( 1 ), hb_parclen( 1 ) ); hb_inkeySetText( hb_parc( 1 ), hb_parclen( 1 ), HB_FALSE );
} }
HB_FUNC( HB_KEYCLEAR ) HB_FUNC( HB_KEYCLEAR )

View File

@@ -313,16 +313,16 @@ int hb_inkeySetLast( int iKey )
return iLast; return iLast;
} }
void hb_inkeySetText( const char * szText, HB_SIZE nLen ) void hb_inkeySetText( const char * szText, HB_SIZE nLen, HB_BOOL fEol )
{ {
PHB_GT pGT; PHB_GT pGT;
HB_TRACE( HB_TR_DEBUG, ( "hb_inkeySetText(%s,%" HB_PFS "u)", szText, nLen ) ); HB_TRACE( HB_TR_DEBUG, ( "hb_inkeySetText(%s,%" HB_PFS "u, %d)", szText, nLen, fEol ) );
pGT = hb_gt_Base(); pGT = hb_gt_Base();
if( pGT ) if( pGT )
{ {
HB_GTSELF_INKEYSETTEXT( pGT, szText, nLen ); HB_GTSELF_INKEYSETTEXT( pGT, szText, nLen, fEol );
hb_gt_BaseFree( pGT ); hb_gt_BaseFree( pGT );
} }
} }

View File

@@ -254,7 +254,7 @@ METHOD HandleUserKey( nKey, nUdfReturn ) CLASS HBMemoEditor
#ifndef HB_CLP_STRICT #ifndef HB_CLP_STRICT
CASE ME_PASTE /* Xbase++ compatibility */ CASE ME_PASTE /* Xbase++ compatibility */
hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) hb_gtInfo( HB_GTI_CLIPBOARDPASTE, .T. )
EXIT EXIT
#endif #endif

View File

@@ -1293,6 +1293,27 @@ HB_FUNC( __MVGET )
} }
} }
HB_FUNC( __MVGETDEF )
{
PHB_ITEM pName = hb_param( 1, HB_IT_STRING );
if( pName )
{
HB_STACK_TLS_PRELOAD
PHB_ITEM pMemvar;
PHB_DYNS pDynVar = hb_memvarFindSymbol( pName->item.asString.value,
pName->item.asString.length );
if( pDynVar && ( pMemvar = hb_dynsymGetMemvar( pDynVar ) ) != NULL )
hb_itemReturn( HB_IS_BYREF( pMemvar ) ? hb_itemUnRef( pMemvar ) :
pMemvar );
else if( hb_pcount() >= 2 )
hb_itemReturn( hb_param( 2, HB_IT_ANY ) );
}
else
hb_errRT_BASE_SubstR( EG_ARG, 3009, NULL, NULL, HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( __MVPUT ) HB_FUNC( __MVPUT )
{ {
PHB_ITEM pName = hb_param( 1, HB_IT_STRING ); PHB_ITEM pName = hb_param( 1, HB_IT_STRING );

View File

@@ -14510,7 +14510,7 @@ STATIC PROCEDURE __hbshell_prompt( aParams, aCommand )
hb_gtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_ROWS ) hb_gtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_ROWS )
SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) } ) SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE, .T. ) } )
Set( _SET_EVENTMASK, hb_bitOr( INKEY_KEYBOARD, HB_INKEY_GTEVENT ) ) Set( _SET_EVENTMASK, hb_bitOr( INKEY_KEYBOARD, HB_INKEY_GTEVENT ) )
@@ -14652,7 +14652,7 @@ STATIC FUNCTION __hbshell_GetHidden()
ATail( GetList ):display() ATail( GetList ):display()
SetCursor( iif( ReadInsert(), SC_INSERT, SC_NORMAL ) ) SetCursor( iif( ReadInsert(), SC_INSERT, SC_NORMAL ) )
bKeyPaste := SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) } ) bKeyPaste := SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE, .T. ) } )
ReadModal( GetList ) ReadModal( GetList )