diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index e551a3f358..7ef8e91d0b 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -342,13 +342,13 @@ extern void HB_EXPORT hb_reta( ULONG ulLen ); /* returns an array with a spec #endif -extern void HB_EXPORT hb_storc( char * szText, int iParam, ... ); /* stores a szString on a variable by reference */ -extern void HB_EXPORT hb_storclen( char * szText, ULONG ulLength, int iParam, ... ); /* stores a fixed length string on a variable by reference */ -extern void HB_EXPORT hb_stords( char * szDate, int iParam, ... ); /* szDate must have yyyymmdd format */ -extern void HB_EXPORT hb_storl( int iLogical, int iParam, ... ); /* stores a logical integer on a variable by reference */ -extern void HB_EXPORT hb_storni( int iValue, int iParam, ... ); /* stores an integer on a variable by reference */ -extern void HB_EXPORT hb_stornl( long lValue, int iParam, ... ); /* stores a long on a variable by reference */ -extern void HB_EXPORT hb_stornd( double dValue, int iParam, ... ); /* stores a double on a variable by reference */ +extern int HB_EXPORT hb_storc( char * szText, int iParam, ... ); /* stores a szString on a variable by reference */ +extern int HB_EXPORT hb_storclen( char * szText, ULONG ulLength, int iParam, ... ); /* stores a fixed length string on a variable by reference */ +extern int HB_EXPORT hb_stords( char * szDate, int iParam, ... ); /* szDate must have yyyymmdd format */ +extern int HB_EXPORT hb_storl( int iLogical, int iParam, ... ); /* stores a logical integer on a variable by reference */ +extern int HB_EXPORT hb_storni( int iValue, int iParam, ... ); /* stores an integer on a variable by reference */ +extern int HB_EXPORT hb_stornl( long lValue, int iParam, ... ); /* stores a long on a variable by reference */ +extern int HB_EXPORT hb_stornd( double dValue, int iParam, ... ); /* stores a double on a variable by reference */ extern void HB_EXPORT hb_xinit( void ); /* Initialize fixed memory subsystem */ extern void HB_EXPORT hb_xexit( void ); /* Deinitialize fixed memory subsystem */ @@ -608,4 +608,3 @@ extern char * hb_getenv( const char * name ); #endif #endif /* HB_APIEXT_H_ */ - diff --git a/harbour/include/hbtypes.h b/harbour/include/hbtypes.h index 5342502cb4..51b54c8c5d 100644 --- a/harbour/include/hbtypes.h +++ b/harbour/include/hbtypes.h @@ -105,20 +105,20 @@ typedef int ( * HB_PARL2)( int iParam, ULONG ulArrayIndex ); typedef double ( * HB_PARND2)( int iParam, ULONG ulArrayIndex ); typedef int ( * HB_PARNI2)( int iParam, ULONG ulArrayIndex ); typedef long ( * HB_PARNL2)( int iParam, ULONG ulArrayIndex ); -typedef void ( * HB_STORC)( char * szText, int iParam ); -typedef void ( * HB_STORCLEN)( char * szText, ULONG ulLength, int iParam); -typedef void ( * HB_STORDS)( char * szDate, int iParam) ; -typedef void ( * HB_STORL)( int iLogical, int iParam ); -typedef void ( * HB_STORNI)( int iValue, int iParam ); -typedef void ( * HB_STORNL)( long lValue, int iParam ); -typedef void ( * HB_STORND)( double dValue, int iParam ); -typedef void ( * HB_STORC2)( char * szText, int iParam , ULONG ulArrayIndex); -typedef void ( * HB_STORCLEN2)( char * szText, ULONG ulLength, int iParam , ULONG ulArrayIndex); -typedef void ( * HB_STORDS2)( char * szDate, int iParam , ULONG ulArrayIndex) ; -typedef void ( * HB_STORL2)( int iLogical, int iParam , ULONG ulArrayIndex); -typedef void ( * HB_STORNI2)( int iValue, int iParam , ULONG ulArrayIndex); -typedef void ( * HB_STORNL2)( long lValue, int iParam , ULONG ulArrayIndex); -typedef void ( * HB_STORND2)( double dValue, int iParam , ULONG ulArrayIndex); +typedef int ( * HB_STORC)( char * szText, int iParam ); +typedef int ( * HB_STORCLEN)( char * szText, ULONG ulLength, int iParam); +typedef int ( * HB_STORDS)( char * szDate, int iParam) ; +typedef int ( * HB_STORL)( int iLogical, int iParam ); +typedef int ( * HB_STORNI)( int iValue, int iParam ); +typedef int ( * HB_STORNL)( long lValue, int iParam ); +typedef int ( * HB_STORND)( double dValue, int iParam ); +typedef int ( * HB_STORC2)( char * szText, int iParam , ULONG ulArrayIndex); +typedef int ( * HB_STORCLEN2)( char * szText, ULONG ulLength, int iParam , ULONG ulArrayIndex); +typedef int ( * HB_STORDS2)( char * szDate, int iParam , ULONG ulArrayIndex) ; +typedef int ( * HB_STORL2)( int iLogical, int iParam , ULONG ulArrayIndex); +typedef int ( * HB_STORNI2)( int iValue, int iParam , ULONG ulArrayIndex); +typedef int ( * HB_STORNL2)( long lValue, int iParam , ULONG ulArrayIndex); +typedef int ( * HB_STORND2)( double dValue, int iParam , ULONG ulArrayIndex); typedef BOOL ( * HB_ARRAYNEW)( PHB_ITEM pItem, ULONG ulLen ); typedef ULONG ( * HB_ARRAYLEN)( PHB_ITEM pArray ); typedef BOOL ( * HB_ARRAYISOBJECT)( PHB_ITEM pArray ); diff --git a/harbour/source/vm/extend.c b/harbour/source/vm/extend.c index 6ad2ecd33a..d1e77787fb 100644 --- a/harbour/source/vm/extend.c +++ b/harbour/source/vm/extend.c @@ -611,7 +611,7 @@ void HB_EXPORT hb_retnllen( long lNumber, int iWidth ) hb_itemPutNLLen( &hb_stack.Return, lNumber, iWidth ); } -void HB_EXPORT hb_storc( char * szText, int iParam, ... ) +int HB_EXPORT hb_storc( char * szText, int iParam, ... ) { HB_TRACE(HB_TR_DEBUG, ("hb_storc(%s, %d, ...)", szText, iParam)); @@ -631,13 +631,21 @@ void HB_EXPORT hb_storc( char * szText, int iParam, ... ) hb_arraySet( pItem, va_arg( va, ULONG ), pItemNew ); va_end( va ); hb_itemRelease( pItemNew ); + return 1; } else if( bByRef || iParam == -1 ) + { hb_itemPutC( pItem, szText ); + return 1; + } + + return 0; } + + return 0; } -void HB_EXPORT hb_storclen( char * szText, ULONG ulLen, int iParam, ... ) +int HB_EXPORT hb_storclen( char * szText, ULONG ulLen, int iParam, ... ) { HB_TRACE(HB_TR_DEBUG, ("hb_storclen(%s, %lu, %d, ...)", szText, ulLen, iParam)); @@ -657,15 +665,23 @@ void HB_EXPORT hb_storclen( char * szText, ULONG ulLen, int iParam, ... ) hb_arraySet( pItem, va_arg( va, ULONG ), pItemNew ); va_end( va ); hb_itemRelease( pItemNew ); + return 1; } else if( bByRef || iParam == -1 ) + { hb_itemPutCL( pItem, szText, ulLen ); + return 1; + } + + return 0; } + + return 0; } /* szDate must have YYYYMMDD format */ -void HB_EXPORT hb_stords( char * szDate, int iParam, ... ) +int HB_EXPORT hb_stords( char * szDate, int iParam, ... ) { HB_TRACE(HB_TR_DEBUG, ("hb_stords(%s, %d, ...)", szDate, iParam)); @@ -685,13 +701,21 @@ void HB_EXPORT hb_stords( char * szDate, int iParam, ... ) hb_arraySet( pItem, va_arg( va, ULONG ), pItemNew ); va_end( va ); hb_itemRelease( pItemNew ); + return 1; } else if( bByRef || iParam == -1 ) + { hb_itemPutDS( pItem, szDate ); + return 1; + } + + return 0; } + + return 0; } -void HB_EXPORT hb_storl( int iLogical, int iParam, ... ) +int HB_EXPORT hb_storl( int iLogical, int iParam, ... ) { HB_TRACE(HB_TR_DEBUG, ("hb_storl(%d, %d, ...)", iLogical, iParam)); @@ -711,13 +735,21 @@ void HB_EXPORT hb_storl( int iLogical, int iParam, ... ) hb_arraySet( pItem, va_arg( va, ULONG ), pItemNew ); va_end( va ); hb_itemRelease( pItemNew ); + return 1; } else if( bByRef || iParam == -1 ) + { hb_itemPutL( pItem, iLogical ? TRUE : FALSE ); + return 1; + } + + return 0; } + + return 0; } -void HB_EXPORT hb_storni( int iValue, int iParam, ... ) +int HB_EXPORT hb_storni( int iValue, int iParam, ... ) { HB_TRACE(HB_TR_DEBUG, ("hb_storni(%d, %d, ...)", iValue, iParam)); @@ -737,13 +769,21 @@ void HB_EXPORT hb_storni( int iValue, int iParam, ... ) hb_arraySet( pItem, va_arg( va, ULONG ), pItemNew ); va_end( va ); hb_itemRelease( pItemNew ); + return 1; } else if( bByRef || iParam == -1 ) + { hb_itemPutNI( pItem, iValue ); + return 1; + } + + return 0; } + + return 0; } -void HB_EXPORT hb_stornl( long lValue, int iParam, ... ) +int HB_EXPORT hb_stornl( long lValue, int iParam, ... ) { HB_TRACE(HB_TR_DEBUG, ("hb_stornl(%ld, %d, ...)", lValue, iParam)); @@ -763,13 +803,21 @@ void HB_EXPORT hb_stornl( long lValue, int iParam, ... ) hb_arraySet( pItem, va_arg( va, ULONG ), pItemNew ); va_end( va ); hb_itemRelease( pItemNew ); + return 1; } else if( bByRef || iParam == -1 ) + { hb_itemPutNL( pItem, lValue ); + return 1; + } + + return 0; } + + return 0; } -void HB_EXPORT hb_stornd( double dNumber, int iParam, ... ) +int HB_EXPORT hb_stornd( double dNumber, int iParam, ... ) { HB_TRACE(HB_TR_DEBUG, ("hb_stornd(%lf, %d, ...)", dNumber, iParam)); @@ -789,8 +837,16 @@ void HB_EXPORT hb_stornd( double dNumber, int iParam, ... ) hb_arraySet( pItem, va_arg( va, ULONG ), pItemNew ); va_end( va ); hb_itemRelease( pItemNew ); + return 1; } else if( bByRef || iParam == -1 ) + { hb_itemPutND( pItem, dNumber ); + return 1; + } + + return 0; } + + return 0; } \ No newline at end of file diff --git a/harbour/source/vm/maindllp.c b/harbour/source/vm/maindllp.c index 2b43fd527e..388e0a45bd 100644 --- a/harbour/source/vm/maindllp.c +++ b/harbour/source/vm/maindllp.c @@ -485,7 +485,7 @@ long hb_parnl( int iParam, ... ) /* retrieve a numeric parameter as a long */ return 0; } -void hb_storc( char * szText, int iParam, ... ) +int hb_storc( char * szText, int iParam, ... ) { FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); FARPROC pStorC = GetProcAddress( GetModuleHandle( NULL ), "_hb_storc" ); @@ -502,13 +502,21 @@ void hb_storc( char * szText, int iParam, ... ) va_end( va ); ( ( HB_STORC2) pStorC )( szText, iParam, ulArrayIndex ); + return 1; } else + { ( ( HB_STORC ) pStorC )( szText, iParam ); + return 1; + } + + return 0; } + + return 0; } -void hb_storclen( char * szText, ULONG ulLen, int iParam, ... ) +int hb_storclen( char * szText, ULONG ulLen, int iParam, ... ) { FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); FARPROC pStorC = GetProcAddress( GetModuleHandle( NULL ), "_hb_storclen" ); @@ -525,13 +533,21 @@ void hb_storclen( char * szText, ULONG ulLen, int iParam, ... ) va_end( va ); ( ( HB_STORCLEN2) pStorC )( szText, ulLen, iParam, ulArrayIndex ); + return 1; } else + { ( ( HB_STORCLEN ) pStorC )( szText, ulLen, iParam ); + return 1; + } + + return 0; } + + return 0; } -void hb_stords( char * szDate, int iParam, ... ) +int hb_stords( char * szDate, int iParam, ... ) { FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); FARPROC pStorDs = GetProcAddress( GetModuleHandle( NULL ), "_hb_stords" ); @@ -548,13 +564,22 @@ void hb_stords( char * szDate, int iParam, ... ) va_end( va ); ( ( HB_STORDS2) pStorDs )( szDate, iParam, ulArrayIndex ); + + return 1; } else + { ( ( HB_STORDS ) pStorDs )( szDate, iParam ); + return 1; + } + + return 0; } + + return 0; } -void hb_storl( int iLogical, int iParam, ... ) +int hb_storl( int iLogical, int iParam, ... ) { FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); FARPROC pStorL = GetProcAddress( GetModuleHandle( NULL ), "_hb_storl" ); @@ -571,13 +596,21 @@ void hb_storl( int iLogical, int iParam, ... ) va_end( va ); ( ( HB_STORL2) pStorL )( iLogical, iParam, ulArrayIndex ); + return 1; } else + { ( ( HB_STORL ) pStorL )( iLogical, iParam ); + return 1; + } + + return 0; } + + return 0; } -void hb_storni( int iValue, int iParam, ... ) +int hb_storni( int iValue, int iParam, ... ) { FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); FARPROC pStorNi = GetProcAddress( GetModuleHandle( NULL ), "_hb_storni" ); @@ -594,13 +627,21 @@ void hb_storni( int iValue, int iParam, ... ) va_end( va ); ( ( HB_STORNI2) pStorNi )( iValue, iParam, ulArrayIndex ); + return 1; } else + { ( ( HB_STORNI) pStorNi )( iValue, iParam ); + return 1; + } + + return 0; } + + return 0; } -void hb_stornl( long lValue, int iParam, ... ) +int hb_stornl( long lValue, int iParam, ... ) { FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); FARPROC pStorNl = GetProcAddress( GetModuleHandle( NULL ), "_hb_stornl" ); @@ -617,13 +658,21 @@ void hb_stornl( long lValue, int iParam, ... ) va_end( va ); ( ( HB_STORNL2) pStorNl )( lValue, iParam, ulArrayIndex ); + return 1; } else + { ( ( HB_STORNL) pStorNl )( lValue, iParam ); + return 1; + } + + return 0; } + + return 0; } -void hb_stornd( double dNumber, int iParam, ... ) +int hb_stornd( double dNumber, int iParam, ... ) { FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); FARPROC pStorNd = GetProcAddress( GetModuleHandle( NULL ), "_hb_stornd" ); @@ -640,10 +689,18 @@ void hb_stornd( double dNumber, int iParam, ... ) va_end( va ); ( ( HB_STORND2) pStorNd )( dNumber, iParam, ulArrayIndex ); + return 1; } else + { ( ( HB_STORND) pStorNd )( dNumber, iParam ); + return 1; + } + + return 0; } + + return 0; } BOOL hb_arrayNew( PHB_ITEM pItem, ULONG ulLen ) /* creates a new array */