diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8e9d2e5f0e..54cb218a6a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -10,6 +10,44 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2012-11-23 12:50 UTC+0100 Viktor Szakats (harbour syenar.net) + * contrib/xhb/hbcompat.h + + added compatibility macros from xhb repository + (untested) + * formatting + + * contrib/xhb/hbdll.ch + * contrib/xhb/htmlform.ch + * contrib/xhb/ttable.ch + * contrib/hbamf/amfdec.c + * contrib/hbamf/amfenc.c + * contrib/hbamf/hbamf.hbc + * formatting, converted commented code to #if 0/#endif + blocks, removed excessive {} blocks + + * contrib/hbnf/aredit.prg + * contrib/hbnf/popadder.prg + * added two TODOs to avoid NextKey() + ; NextKey() is also used in these files: + hbct/keysec.prg + hbmysql/tsqlbrw.prg + hbodbc/browodbc.prg + hbodbc/browodbc.prg + xhb/xhbmemo.prg + xhb/xhbtedit.prg + ; Przemek, if you see this, would you mind doing it + where it's possible to avoid? + + * contrib/hbnf/calendar.prg + * minor cleanups + + * contrib/xhb/xhbfunc.c + * src/rtl/philes.c + * deprecated HB_OSPATHSEPARATOR() with HB_LEGACY_LEVEL4 (after + next release). Use HB_PS() instead. + HB_OSPATHSEPARATOR() will continue to live as an xhb compatibility + function after that. + 2012-11-23 00:17 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/xhb/xhbfunc.c * src/rtl/console.c diff --git a/harbour/contrib/hbamf/amfdec.c b/harbour/contrib/hbamf/amfdec.c index b16426f50f..34998413f6 100644 --- a/harbour/contrib/hbamf/amfdec.c +++ b/harbour/contrib/hbamf/amfdec.c @@ -115,9 +115,10 @@ static HB_BOOL amfX_decode_double( amfContext * context, double * val ) * Put bytes from byte array into double * TOFIX: does this aligment work on any platform? - union aligned { - double d_val; - char c_val[8]; + union aligned + { + double d_val; + char c_val[ 8 ]; } d; */ @@ -302,7 +303,7 @@ static HB_BOOL amf3_decode_dynamic_dict( amfContext * context, PHB_ITEM pItem ) PHB_ITEM pValue; HB_BOOL result; - for( ;; ) + for(;; ) { pKey = hb_itemNew( NULL ); if( ! amf3_deserialize_string( context, pKey ) ) @@ -916,14 +917,10 @@ static HB_BOOL amf3_decode_externalizable( amfContext * context, PHB_ITEM pItem if( HB_IS_INTEGER( pPos ) ) { if( ! readBytes( context, hb_itemGetNI( pPos ) ) ) - { result = HB_FALSE; - } } else - { result = HB_FALSE; - } hb_itemMove( hb_stackReturnItem(), pRetCopy ); @@ -996,9 +993,7 @@ static HB_BOOL amf3_deserialize_obj( amfContext * context, PHB_ITEM pItem, HB_BO hb_itemRelease( pClass ); if( ! readByte( context ) ) /* Skip array type marker */ - { return HB_FALSE; - } return amf3_deserialize_array( context, pItem, HB_TRUE ); } @@ -1008,9 +1003,7 @@ static HB_BOOL amf3_deserialize_obj( amfContext * context, PHB_ITEM pItem, HB_BO hb_itemRelease( pClass ); if( ! readByte( context ) ) /* Skip array type marker */ - { return HB_FALSE; - } return amf3_deserialize_obj( context, pItem, HB_TRUE ); } @@ -1065,7 +1058,9 @@ static HB_BOOL amf3_deserialize_obj( amfContext * context, PHB_ITEM pItem, HB_BO else { /* Create obj_val for all typed objs. */ - /* obj_val = PyObject_CallMethod(class_def, "getInstance", NULL); */ +#if 0 + obj_val = PyObject_CallMethod( class_def, "getInstance", NULL ); +#endif } if( ! HB_IS_OBJECT( pItem ) ) @@ -1079,11 +1074,11 @@ static HB_BOOL amf3_deserialize_obj( amfContext * context, PHB_ITEM pItem, HB_BO if( proxy ) { - /* If this is an ObjectProxy, - we need to add another reference, - so there is one that - points to the obj and one that points - to the proxy. */ + /* If this is an ObjectProxy, + we need to add another reference, + so there is one that + points to the obj and one that points + to the proxy. */ amf3_add_reference( pHash, pItem ); } @@ -1100,7 +1095,9 @@ static HB_BOOL amf3_deserialize_obj( amfContext * context, PHB_ITEM pItem, HB_BO } else if( obj_type == 2 ) { - /* result = decode_typed_obj_AMF3(context, obj_val, class_def_dict); */ +#if 0 + result = decode_typed_obj_AMF3( context, obj_val, class_def_dict ); +#endif } hb_itemRelease( pClass ); @@ -1278,8 +1275,10 @@ HB_FUNC( AMF3_DECODE ) hb_itemRelease( context->str_ref ); hb_itemRelease( context->class_ref ); - /*if(context->conv_function) - hb_itemRelease(context->conv_function);*/ +#if 0 + if( context->conv_function ) + hb_itemRelease( context->conv_function ); +#endif hb_xfree( context ); } diff --git a/harbour/contrib/hbamf/amfenc.c b/harbour/contrib/hbamf/amfenc.c index cbbf04ef23..61d5d13bb2 100644 --- a/harbour/contrib/hbamf/amfenc.c +++ b/harbour/contrib/hbamf/amfenc.c @@ -54,21 +54,13 @@ extern HB_BOOL hbamf_is_cls_externalizable( HB_USHORT uiClass ); static void _ref_realItemPtr( PHB_ITEM pKey, PHB_ITEM pItem ) { if( HB_IS_STRING( pItem ) ) - { hb_itemPutPtr( pKey, ( void * ) hb_itemGetCPtr( pItem ) ); - } else if( HB_IS_ARRAY( pItem ) ) - { hb_itemPutPtr( pKey, hb_arrayId( pItem ) ); - } else if( HB_IS_HASH( pItem ) ) - { hb_itemPutPtr( pKey, hb_hashId( pItem ) ); - } else if( HB_IS_DATETIME( pItem ) ) - { hb_itemCopy( pKey, pItem ); - } } static HB_ISIZ bufferGrow( amfContext * context, HB_ISIZ len ) @@ -83,9 +75,8 @@ static HB_ISIZ bufferGrow( amfContext * context, HB_ISIZ len ) { context->cBuf = ( char * ) hb_xrealloc( context->cBuf, sizeof( char ) * current_len ); if( ! context->cBuf ) - { return -1; - } + context->length = current_len; } return current_len; @@ -195,9 +186,7 @@ static HB_BOOL amf3_encode_int( amfContext * context, int value ) tmp[ 3 ] = ( char ) ( value & 0xff ); } else - { return HB_FALSE; - } if( ( HB_SIZE ) writeBuffer( context, tmp, tmp_size ) != tmp_size ) return HB_FALSE; @@ -227,13 +216,14 @@ static HB_BOOL amf3_write_int( amfContext * context, PHB_ITEM pItem ) } } -/* - static HB_BOOL amf3_encode_float(amfContext * context, PHB_ITEM pItem) - { - float n = (float)hb_itemGetND(pItem); - return amfX_encode_double(context, (double)n); - } - */ +#if 0 +static HB_BOOL amf3_encode_float( amfContext * context, PHB_ITEM pItem ) +{ + float n = ( float ) hb_itemGetND( pItem ); + + return amfX_encode_double( context, ( double ) n ); +} +#endif static HB_BOOL amf3_encode_nil( amfContext * context ) { @@ -409,25 +399,24 @@ static HB_BOOL amf3_serialize_string( amfContext * context, PHB_ITEM pItem ) return amf3_encode_string( context, pItem ); } -/* - static HB_BOOL amf3_serialize_object_as_string(amfContext * context, PHB_ITEM pItem) - { +#if 0 +static HB_BOOL amf3_serialize_object_as_string( amfContext * context, PHB_ITEM pItem ) +{ PHB_ITEM pStr; - HB_BOOL result; + HB_BOOL result; - if( HB_IS_STRING(pItem) || HB_IS_MEMO( pItem ) ) - return amf3_serialize_string(context, pItem); + if( HB_IS_STRING( pItem ) || HB_IS_MEMO( pItem ) ) + return amf3_serialize_string( context, pItem ); - if(!hb_itemPutC(pStr, hb_itemGetCPtr(pItem))) + if( ! hb_itemPutC( pStr, hb_itemGetCPtr( pItem ) ) ) return HB_FALSE; - result = amf3_serialize_string(context, pStr); + result = amf3_serialize_string( context, pStr ); - hb_itemRelease(pStr); + hb_itemRelease( pStr ); return result; - } - - */ +} +#endif static HB_BOOL amf3_encode_hash( amfContext * context, PHB_ITEM pItem ) { @@ -516,9 +505,7 @@ static HB_BOOL amf3_serialize_hash( amfContext * context, PHB_ITEM pItem ) HB_BOOL result = amf3_encode_reference( context, context->obj_ref, pItem, 0 ); if( result > -1 ) - { return result; - } return amf3_encode_hash( context, pItem ); } @@ -649,22 +636,14 @@ static int amf3_encode_class_def( amfContext * context, PHB_ITEM pClass ) } if( hb_hashGetCItemPos( pClass, "CLASS_DEF" ) == 0 ) - { return 0; - } if( hb_hashGetCItemPos( pClass, "EXTERNALIZABLE_CLASS_DEF" ) != 0 ) - { header = EXTERNALIZABLE; - } else if( hb_hashGetCItemPos( pClass, "DYNAMIC_CLASS_DEF" ) != 0 ) - { header = DYNAMIC; - } else - { header = STATIC; - } class_alias = hb_hashGetCItemPtr( pClass, "alias" ); if( ! class_alias ) @@ -673,44 +652,35 @@ static int amf3_encode_class_def( amfContext * context, PHB_ITEM pClass ) if( header == EXTERNALIZABLE ) { if( ! amf3_encode_int( context, header ) ) - { return 0; - } + result = amf3_serialize_string( context, class_alias ); return result; } static_attrs = hb_hashGetCItemPtr( pClass, "static_attrs" ); if( ! static_attrs ) - { return 0; - } static_attr_len = hb_arrayLen( static_attrs ); /* array this is -- hb_itemGetCLen(static_attrs); */ if( static_attr_len == -1 || static_attr_len > ( MAX_INT >> 4 ) ) - { return 0; - } header |= ( ( int ) static_attr_len ) << 4; if( ! amf3_encode_int( context, header ) ) - { return 0; - } result = amf3_serialize_string( context, class_alias ); /* not needed hb_itemRelease(class_alias); */ if( ! result ) - { return 0; - } for( i = 0; i < static_attr_len; i++ ) { attr_name = hb_itemArrayGet( static_attrs, i ); if( ! attr_name ) { - /* not needed hb_itemRelease(static_attrs); */ + /* not needed hb_itemRelease( static_attrs ); */ return 0; } result = amf3_serialize_string( context, attr_name ); @@ -793,17 +763,18 @@ static PHB_ITEM class_def_from_class( /* amfContext * context, */ PHB_ITEM pItem hb_itemRelease( pValue ); } -/* if we ever want to store the objects dynamically +/* if we ever want to store the objects dynamically */ +#if 0 hb_itemPutC( pKey, "DYNAMIC_CLASS_DEF" ); hb_itemNew( pValue ); - if( !hb_hashAdd( pClass, pKey, pValue ) ) + if( ! hb_hashAdd( pClass, pKey, pValue ) ) { hb_itemRelease( pKey ); hb_itemRelease( pValue ); hb_itemRelease( pClass ); return NULL; } - */ +#endif return pClass; } @@ -847,13 +818,9 @@ static HB_BOOL amf3_encode_object( amfContext * context, PHB_ITEM pItem ) PHB_ITEM pObject; if( pItem == hb_stackReturnItem() ) - { pObject = pRetCopy; - } else - { pObject = pItem; - } hb_itemMove( pRetCopy, hb_stackReturnItem() ); @@ -1001,22 +968,15 @@ static HB_BOOL amf3_encode( amfContext * context, PHB_ITEM pItem ) if( context->conv_function ) amf3_conversion_out( context, pItem ); + if( HB_IS_NIL( pItem ) ) - { result = amf3_encode_nil( context ); - } else if( HB_IS_LOGICAL( pItem ) ) - { result = amf3_encode_bool( context, pItem ); - } else if( HB_IS_INTEGER( pItem ) || HB_IS_LONG( pItem ) ) - { result = amf3_write_int( context, pItem ); - } else if( HB_IS_DOUBLE( pItem ) ) - { result = amfX_write_double( context, pItem ); - } else if( HB_IS_STRING( pItem ) || HB_IS_MEMO( pItem ) ) { if( context->encode_ba ) @@ -1056,9 +1016,7 @@ static HB_BOOL amf3_encode( amfContext * context, PHB_ITEM pItem ) result = amf3_serialize_array( context, pItem ); } else if( HB_IS_HASH( pItem ) ) - { result = amf3_write_hash( context, pItem ); - } return result; } @@ -1071,7 +1029,9 @@ static amfContext * context_setup( PHB_ITEM pFuncSym, HB_BOOL use_refs, HB_BOOL memset( context, 0, sizeof( amfContext ) ); context->cBuf = ( char * ) hb_xgrab( sizeof( char ) * 8 ); - /* memset( context->cBuf, 0, sizeof( char ) * 8 ); */ +#if 0 + memset( context->cBuf, 0, sizeof( char ) * 8 ); +#endif context->position = 0; context->length = sizeof( char ) * 8; context->str_rtrim = str_rtrim; @@ -1326,7 +1286,6 @@ HB_FUNC( AMF3_FROMWA ) while( ( nCount == 0 || uiRecCount <= nCount ) && ( ! pWhile || hb_itemGetL( hb_vmEvalBlock( pWhile ) ) ) ) { - if( SELF_EOF( pArea, &bEof ) != HB_SUCCESS ) break; @@ -1335,7 +1294,6 @@ HB_FUNC( AMF3_FROMWA ) if( ! pFor || hb_itemGetL( hb_vmEvalBlock( pFor ) ) ) { - if( bAsArray ) { writeByte( context, ARRAY_TYPE ); @@ -1362,11 +1320,12 @@ HB_FUNC( AMF3_FROMWA ) } else { - PHB_ITEM pValue = hb_itemNew( NULL ); writeByte( context, OBJECT_TYPE ); - /* amf3_encode_int(context, ((int) 1) << 1 | REFERENCE_BIT); */ +#if 0 + amf3_encode_int( context, ( ( int ) 1 ) << 1 | REFERENCE_BIT ); +#endif writeByte( context, DYNAMIC ); writeByte( context, EMPTY_STRING_TYPE ); if( bNoFieldPassed ) @@ -1433,7 +1392,9 @@ HB_FUNC( AMF3_ENCODE ) memset( context, 0, sizeof( amfContext ) ); context->cBuf = ( char * ) hb_xgrab( sizeof( char ) * 8 ); - /* memset( context->cBuf, 0, sizeof( char ) * 8 ); */ +#if 0 + memset( context->cBuf, 0, sizeof( char ) * 8 ); +#endif context->position = 0; context->length = sizeof( char ) * 8; context->str_rtrim = HB_FALSE; @@ -1466,8 +1427,10 @@ HB_FUNC( AMF3_ENCODE ) if( context->use_strstr ) hb_itemRelease( context->strstr_ref ); - /*if(context->conv_function) - hb_itemRelease(context->conv_function);*/ +#if 0 + if( context->conv_function ) + hb_itemRelease( context->conv_function ); +#endif if( ! lRetval ) { diff --git a/harbour/contrib/hbamf/hbamf.hbc b/harbour/contrib/hbamf/hbamf.hbc index 2f097b5818..20aee876a4 100644 --- a/harbour/contrib/hbamf/hbamf.hbc +++ b/harbour/contrib/hbamf/hbamf.hbc @@ -7,4 +7,3 @@ description=AMF file format handling incpaths=. libs=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF} - diff --git a/harbour/contrib/hbnf/aredit.prg b/harbour/contrib/hbnf/aredit.prg index 01af5b74e8..67759eccca 100644 --- a/harbour/contrib/hbnf/aredit.prg +++ b/harbour/contrib/hbnf/aredit.prg @@ -102,6 +102,7 @@ FUNCTION ft_ArEdit( nTop, nLeft, nBot, nRight, ; exit_requested := .F. DO WHILE ! exit_requested + /* TODO: avoid NextKey() */ DO WHILE NextKey() == 0 .AND. ! b:stabilize() ENDDO diff --git a/harbour/contrib/hbnf/calendar.prg b/harbour/contrib/hbnf/calendar.prg index 1411e2496e..874748923a 100644 --- a/harbour/contrib/hbnf/calendar.prg +++ b/harbour/contrib/hbnf/calendar.prg @@ -26,15 +26,15 @@ FUNCTION ft_Calendar( nRow, nCol, cColor, lShadow, lShowHelp ) - LOCAL nJump := 0, nKey := 0, cSavColor, cSaveScreen, cSaveCursor - LOCAL aRetVal[ 8 ] - LOCAL nHelpRow, cSaveHelp, lHelpIsDisplayed := .F. + LOCAL nJump := 0, nKey := 0, cSavColor, cSaveScreen, cSaveCursor + LOCAL aRetVal[ 8 ] + LOCAL nHelpRow, cSaveHelp, lHelpIsDisplayed := .F. - __defaultNIL( @nRow, 1 ) // check display row - __defaultNIL( @nCol, 63 ) // check display col + __defaultNIL( @nRow, 1 ) // check display row + __defaultNIL( @nCol, 63 ) // check display col __defaultNIL( @cColor, "W+/G" ) // check display color - __defaultNIL( @lShadow, .F. ) // check shadow switch - __defaultNIL( @lShowHelp, .F. ) // check help switch + __defaultNIL( @lShadow, .F. ) // check shadow switch + __defaultNIL( @lShowHelp, .F. ) // check help switch nRow := iif( nRow < 1 .OR. nRow > 21, 1, nRow ) // check row bounds nCol := iif( nCol < 1 .OR. nCol > 63, 63, nCol ) // check col bounds @@ -93,7 +93,6 @@ FUNCTION ft_Calendar( nRow, nCol, cColor, lShadow, lShowHelp ) "Hit Ins to reset to today's date, F1 to get this help, ESC to quit." ) ENDIF - OTHERWISE ENDCASE aRetVal[ 1 ] := Date() + nJump @@ -121,9 +120,9 @@ FUNCTION ft_Calendar( nRow, nCol, cColor, lShadow, lShowHelp ) aRetVal[ 8 ] := Time() ENDDO - SetColor( cSavColor ) // restore colors. - SetCursor( cSaveCursor ) // restore cursor. - RestScreen( nRow - 1, nCol - 1, nRow + 3, nCol + 17, cSaveScreen ) // restore screen. + SetColor( cSavColor ) // restore colors + SetCursor( cSaveCursor ) // restore cursor + RestScreen( nRow - 1, nCol - 1, nRow + 3, nCol + 17, cSaveScreen ) // restore screen IF lHelpIsDisplayed RestScreen( nHelpRow - 1, 1, nHelpRow + 7, 80, cSaveHelp ) ENDIF diff --git a/harbour/contrib/hbnf/popadder.prg b/harbour/contrib/hbnf/popadder.prg index b293b77331..27d97b60d1 100644 --- a/harbour/contrib/hbnf/popadder.prg +++ b/harbour/contrib/hbnf/popadder.prg @@ -800,6 +800,7 @@ STATIC FUNCTION _ftSetLastKey( nLastKey ) STATIC FUNCTION _ftPushKeys() + /* TODO: avoid NextKey() */ DO WHILE NextKey() != 0 AAdd( t_aKeys, Inkey() ) ENDDO diff --git a/harbour/contrib/xhb/hbcompat.h b/harbour/contrib/xhb/hbcompat.h index 4b3c211a83..5a3aad4faa 100644 --- a/harbour/contrib/xhb/hbcompat.h +++ b/harbour/contrib/xhb/hbcompat.h @@ -64,8 +64,44 @@ #define hb_retclen_buffer( szText, ulLen ) hb_retclenAdopt( ( szText ), ( ulLen ) ) #define hb_retc_const( szText ) hb_retcStatic( ( szText ) ) - #define hb_storclen_buffer hb_storclenAdopt - #define hb_itemPutCLConst hb_itemPutCRawStatic + #define hb_storclen_buffer hb_storclenAdopt + #define hb_itemPutCLConst hb_itemPutCRawStatic + + #define HB_MAXINT HB_LONG + #define HB_BOOL BOOL + #define HB_TRUE TRUE + #define HB_FALSE FALSE + #define HB_U32 UINT32 + #define HB_U8 BYTE + #define HB_UINT UINT + #define HB_U16 UINT16 + #define HB_I32 INT32 + #define HB_ISCHAR ISCHAR + #define HB_ISBLOCK ISBLOCK + #define HB_ISPOINTER ISPOINTER + #define HB_ISOBJECT ISOBJECT + #define HB_ISARRAY ISARRAY + #define HB_ISLOG ISLOG + #define HB_ISNIL ISNIL + #define HB_ISBYREF ISBYREF + #define HB_ISNUM ISNUM + #define hb_parldef( l1, l2 ) ( ISLOG( l1 ) ? hb_parl( l1 ) : l2 ) + #define hb_parnidef( n1, n2 ) ( ISNUM( n1 ) ? hb_parni( n1 ) : n2 ) + #define hb_parnldef( n1, n2 ) ( ISNUM( n1 ) ? hb_parnl( n1 ) : n2 ) + #define hb_parnintdef( n1, n2 ) ( ISNUM( n1 ) ? hb_parnint( n1 ) : n2 ) + #define HB_BYTE BYTE + #define HB_USHORT USHORT + #define HB_UCHAR UCHAR + #define HB_FT_IMAGE HB_FT_PICTURE + #define HB_I64 INT64 + #define hb_gcMark hb_gcItemRef + #define hb_vmAtQuit hb_vmAtExit + #define HB_FSNAMECONV hb_fsNameConv + #define hb_cdpFindExt hb_cdpFind + #define hb_itemPutTS hb_itemPutDTS + #define HB_IS_TIMESTAMP HB_IS_TIMEFLAG + #define HB_CDP_ISBINSORT( cdp ) 0 + #define HB_PFS PFLL #else @@ -73,8 +109,8 @@ #define hb_retclenAdopt( szText, ulLen ) hb_retclen_buffer( ( szText ), ( ulLen ) ) #define hb_retcStatic( szText ) hb_retc_const( ( szText ) ) - #define hb_storclenAdopt hb_storclen_buffer - #define hb_itemPutCRawStatic hb_itemPutCLConst + #define hb_storclenAdopt hb_storclen_buffer + #define hb_itemPutCRawStatic hb_itemPutCLConst #endif diff --git a/harbour/contrib/xhb/hbdll.ch b/harbour/contrib/xhb/hbdll.ch index e896b7ecd5..660439fc00 100644 --- a/harbour/contrib/xhb/hbdll.ch +++ b/harbour/contrib/xhb/hbdll.ch @@ -52,96 +52,96 @@ #include "dll.ch" #ifndef __DLL_CH - #define __DLL_CH +#define __DLL_CH - #define DC_MICROSOFT 0x0000 // Default - #define DC_BORLAND 0x0001 // Borland compat - #define DC_CALL_CDECL DLL_CDECL - #define DC_CALL_STD DLL_STDCALL - #define DC_RETVAL_MATH4 0x0100 // Return value in ST - #define DC_RETVAL_MATH8 0x0200 // Return value in ST +#define DC_MICROSOFT 0x0000 // Default +#define DC_BORLAND 0x0001 // Borland compat +#define DC_CALL_CDECL DLL_CDECL +#define DC_CALL_STD DLL_STDCALL +#define DC_RETVAL_MATH4 0x0100 // Return value in ST +#define DC_RETVAL_MATH8 0x0200 // Return value in ST - // Avoid xHarbour code when included by dllcall.c - #if defined( __PLATFORM__WINDOWS ) +// Avoid xHarbour code when included by dllcall.c +#if defined( __PLATFORM__WINDOWS ) - #include "cstruct.ch" - #include "wintypes.ch" +#include "cstruct.ch" +#include "wintypes.ch" - // Native syntax - #xcommand IMPORT [] [ ] ; - ( [ [, ] ] ) FROM [ OF ] <(DllName)> => ; - [] FUNCTION ( [, ] ) ;; - THREAD STATIC t_cTemplate ;; - IF t_cTemplate == NIL ;; - t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.CallConvention.>, , DC_CALL_STD ), iif( <.DllFuncName.>, #, # ) ) ;; - END ;; - IF <.ArgName.>;; - RETURN DllExecuteCall( t_cTemplate, [, ] ) ;; - END ;; - RETURN DllExecuteCall( t_cTemplate ) +// Native syntax +#xcommand IMPORT [] [ ] ; + ( [ [, ] ] ) FROM [ OF ] <(DllName)> => ; + [] FUNCTION ( [, ] ) ;; + THREAD STATIC t_cTemplate ;; + IF t_cTemplate == NIL ;; + t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.CallConvention.>, , DC_CALL_STD ), iif( <.DllFuncName.>, #, # ) ) ;; + END ;; + IF <.ArgName.>;; + RETURN DllExecuteCall( t_cTemplate, [, ] ) ;; + END ;; + RETURN DllExecuteCall( t_cTemplate ) - #xcommand IMPORT [] [ ] ; - ( [ [, ] ] ) FROM <(DllName)> [EXPORTED AS ] => ; - [] FUNCTION ( [, ] ) ;; - THREAD STATIC t_cTemplate ;; - IF t_cTemplate == NIL ;; - t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.CallConvention.>, , DC_CALL_STD ), iif( <.DllFuncName.>, #, # ) ) ;; - END ;; - IF <.ArgName.>;; - RETURN DllExecuteCall( t_cTemplate, [, ] ) ;; - END ;; - RETURN DllExecuteCall( t_cTemplate ) +#xcommand IMPORT [] [ ] ; + ( [ [, ] ] ) FROM <(DllName)> [EXPORTED AS ] => ; + [] FUNCTION ( [, ] ) ;; + THREAD STATIC t_cTemplate ;; + IF t_cTemplate == NIL ;; + t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.CallConvention.>, , DC_CALL_STD ), iif( <.DllFuncName.>, #, # ) ) ;; + END ;; + IF <.ArgName.>;; + RETURN DllExecuteCall( t_cTemplate, [, ] ) ;; + END ;; + RETURN DllExecuteCall( t_cTemplate ) - #xcommand IMPORT [] [ ] ; - ( [0] [ [, ] ] ) FROM <(DllName)> [EXPORTED AS ] => ; - [] FUNCTION ( [, ] ) ;; - THREAD STATIC t_cTemplate ;; - IF t_cTemplate == NIL ;; - t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.CallConvention.>, , DC_CALL_STD ), iif( <.DllFuncName.>, #, # ) ) ;; - END ;; - IF <.ArgName.>;; - RETURN DllExecuteCall( t_cTemplate, [, ] ) ;; - END ;; - RETURN DllExecuteCall( t_cTemplate ) +#xcommand IMPORT [] [ ] ; + ( [0] [ [, ] ] ) FROM <(DllName)> [EXPORTED AS ] => ; + [] FUNCTION ( [, ] ) ;; + THREAD STATIC t_cTemplate ;; + IF t_cTemplate == NIL ;; + t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.CallConvention.>, , DC_CALL_STD ), iif( <.DllFuncName.>, #, # ) ) ;; + END ;; + IF <.ArgName.>;; + RETURN DllExecuteCall( t_cTemplate, [, ] ) ;; + END ;; + RETURN DllExecuteCall( t_cTemplate ) - #xcommand IMPORT [] [ ] ; - ( [0] [ [, ] ] ) FROM [ OF ] <(DllName)> => ; - [] FUNCTION ( [, ] ) ;; - THREAD STATIC t_cTemplate ;; - IF t_cTemplate == NIL ;; - t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.CallConvention.>, , DC_CALL_STD ), iif( <.DllFuncName.>, #, # ) ) ;; - END ;; - IF <.ArgName.>;; - RETURN DllExecuteCall( t_cTemplate, [, ] ) ;; - END ;; - RETURN DllExecuteCall( t_cTemplate ) +#xcommand IMPORT [] [ ] ; + ( [0] [ [, ] ] ) FROM [ OF ] <(DllName)> => ; + [] FUNCTION ( [, ] ) ;; + THREAD STATIC t_cTemplate ;; + IF t_cTemplate == NIL ;; + t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.CallConvention.>, , DC_CALL_STD ), iif( <.DllFuncName.>, #, # ) ) ;; + END ;; + IF <.ArgName.>;; + RETURN DllExecuteCall( t_cTemplate, [, ] ) ;; + END ;; + RETURN DllExecuteCall( t_cTemplate ) - // FoxPro syntax - #xcommand DECLARE IN <(DllName)> [AS <(DllFuncName)>] [ [@] [] [, [@] []]] => ; - FUNCTION ( ... ) ;; - THREAD STATIC t_cTemplate ;; - IF t_cTemplate == NIL ;; - t_cTemplate := DllPrepareCall( <(DllName)>, DC_CALL_STD, iif( <.DllFuncName.>, <(DllFuncName)>, # ) ) ;; - END ;; - RETURN DllExecuteCall( t_cTemplate, ... ) +// FoxPro syntax +#xcommand DECLARE IN <(DllName)> [AS <(DllFuncName)>] [ [@] [] [, [@] []]] => ; + FUNCTION ( ... ) ;; + THREAD STATIC t_cTemplate ;; + IF t_cTemplate == NIL ;; + t_cTemplate := DllPrepareCall( <(DllName)>, DC_CALL_STD, iif( <.DllFuncName.>, <(DllFuncName)>, # ) ) ;; + END ;; + RETURN DllExecuteCall( t_cTemplate, ... ) - // FWH - #xcommand DLL [] FUNCTION ( [ AS ] [, AS ] ) AS [] [ FROM ] LIB <(DllName)> => ; - [] FUNCTION ( [, ] ) ;; - THREAD STATIC t_cTemplate ;; - IF t_cTemplate == NIL ;; - t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.Pascal.>, DC_CALL_STD, DC_CALL_CDECL ), iif( <.DllFuncName.>, <(DllFuncName)>, # ) ) ;; - END ;; - RETURN DllExecuteCall( t_cTemplate [, ] [, ] ) +// FWH +#xcommand DLL [] FUNCTION ( [ AS ] [, AS ] ) AS [] [ FROM ] LIB <(DllName)> => ; + [] FUNCTION ( [, ] ) ;; + THREAD STATIC t_cTemplate ;; + IF t_cTemplate == NIL ;; + t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.Pascal.>, DC_CALL_STD, DC_CALL_CDECL ), iif( <.DllFuncName.>, <(DllFuncName)>, # ) ) ;; + END ;; + RETURN DllExecuteCall( t_cTemplate [, ] [, ] ) - #xcommand DLL32 [] FUNCTION ( [ AS ] [, AS ] ) AS [] [ FROM ] LIB <(DllName)> => ; - [] FUNCTION ( [, ] ) ;; - THREAD STATIC t_cTemplate ;; - IF t_cTemplate == NIL ;; - t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.Pascal.>, DC_CALL_STD, DC_CALL_CDECL ), iif( <.DllFuncName.>, <(DllFuncName)>, # ) ) ;; - END ;; - RETURN DllExecuteCall( t_cTemplate [, ] [, ] ) +#xcommand DLL32 [] FUNCTION ( [ AS ] [, AS ] ) AS [] [ FROM ] LIB <(DllName)> => ; + [] FUNCTION ( [, ] ) ;; + THREAD STATIC t_cTemplate ;; + IF t_cTemplate == NIL ;; + t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.Pascal.>, DC_CALL_STD, DC_CALL_CDECL ), iif( <.DllFuncName.>, <(DllFuncName)>, # ) ) ;; + END ;; + RETURN DllExecuteCall( t_cTemplate [, ] [, ] ) - #endif +#endif #endif diff --git a/harbour/contrib/xhb/htmlform.ch b/harbour/contrib/xhb/htmlform.ch index e51a33f064..65b477ddfc 100644 --- a/harbour/contrib/xhb/htmlform.ch +++ b/harbour/contrib/xhb/htmlform.ch @@ -46,7 +46,7 @@ #ifndef _FORMS_CH -#xCommand DEFINE FORM ; +#xcommand DEFINE FORM ; [NAME ] ; [METHOD ] ; [ACTION ] ; @@ -80,14 +80,14 @@ [:setOnReset( <(onreset)> ) ] -#xCommand ACTIVATE ; +#xcommand ACTIVATE ; =>; :Put( .T. ) ; :End() // --> Controls -#xCommand CONTROL ; +#xcommand CONTROL ; [OF ]; [] ; [ALIGN ]; @@ -136,7 +136,7 @@