2011-01-12 02:03 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbmxml/hbmxml.c
    + Enabled function pointer support with new PHB_ITEM based
      callback system.
    ! MXMLSETERRORCALLBACK() fixed to reset error handler to NULL
      if wrong (or no) parameter is passed.
    ! Replaced hb_vmProc() with hb_vmSend().
    ! Fixed some missed locations still using dynsyms directly.

  * contrib/hbmxml/tests/custom.prg
  * contrib/hbmxml/tests/testmxml.prg
  * contrib/hbmxml/tests/reminder.prg
    * Switched back to use function pointers.

  * contrib/hbsqlit3/hbsqlit3.c
  * contrib/hbxdiff/hbxdiff.c
    * Renamed variables to reflect recent changes.
This commit is contained in:
Viktor Szakats
2011-01-12 01:04:42 +00:00
parent b2bacdfcef
commit b9fb99bd54
7 changed files with 116 additions and 119 deletions

View File

@@ -16,6 +16,24 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-01-12 02:03 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbmxml/hbmxml.c
+ Enabled function pointer support with new PHB_ITEM based
callback system.
! MXMLSETERRORCALLBACK() fixed to reset error handler to NULL
if wrong (or no) parameter is passed.
! Replaced hb_vmProc() with hb_vmSend().
! Fixed some missed locations still using dynsyms directly.
* contrib/hbmxml/tests/custom.prg
* contrib/hbmxml/tests/testmxml.prg
* contrib/hbmxml/tests/reminder.prg
* Switched back to use function pointers.
* contrib/hbsqlit3/hbsqlit3.c
* contrib/hbxdiff/hbxdiff.c
* Renamed variables to reflect recent changes.
2011-01-12 01:23 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbsqlit3/hbsqlit3.c
+ Enabled function pointers. It's even easier I thought since

View File

@@ -100,18 +100,6 @@ static void hb_cbs_var_init( void * cargo )
pCbs->sax_cb = NULL;
}
static void hb_cbs_var_release( void * cargo )
{
HB_CBS_VAR * pCbs = ( HB_CBS_VAR * ) cargo;
if( pCbs->type_cb )
hb_itemRelease( pCbs->type_cb );
if( pCbs->save_cb )
hb_itemRelease( pCbs->save_cb );
if( pCbs->sax_cb )
hb_itemRelease( pCbs->sax_cb );
}
static void hb_custom_cbs_var_init( void * cargo )
{
HB_CUSTOM_CBS_VAR * pCCbs = ( HB_CUSTOM_CBS_VAR * ) cargo;
@@ -145,7 +133,7 @@ static void hb_error_cb_var_release( void * cargo )
hb_itemRelease( pError_cb->error_cb );
}
static HB_TSD_NEW( s_cbs_var, sizeof( HB_CBS_VAR ), hb_cbs_var_init, hb_cbs_var_release );
static HB_TSD_NEW( s_cbs_var, sizeof( HB_CBS_VAR ), hb_cbs_var_init, NULL );
static HB_TSD_NEW( s_custom_cbs_var, sizeof( HB_CUSTOM_CBS_VAR ), hb_custom_cbs_var_init, hb_custom_cbs_var_release );
static HB_TSD_NEW( s_error_cb_var, sizeof( HB_ERROR_CB_VAR ), hb_error_cb_var_init, hb_error_cb_var_release );
@@ -765,9 +753,9 @@ static mxml_type_t type_cb( mxml_node_t * node )
if( pCbs != NULL )
{
PHB_ITEM pBlock = pCbs->type_cb;
PHB_ITEM pCallback = pCbs->type_cb;
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
int iResult;
PHB_ITEM pNode = hb_itemNew( NULL );
@@ -775,7 +763,7 @@ static mxml_type_t type_cb( mxml_node_t * node )
hbmxml_node_ItemPut( pNode, node, 0 );
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
hb_vmPushItemRef( pNode );
hb_vmSend( 1 );
@@ -815,9 +803,9 @@ HB_FUNC( MXMLLOADFILE )
}
}
if( HB_ISBLOCK( 3 ) )
if( HB_ISBLOCK( 3 ) || HB_ISSYMBOL( 3 ) )
{
pCbs->type_cb = hb_itemNew( hb_param( 3, HB_IT_BLOCK ) );
pCbs->type_cb = hb_param( 3, HB_IT_BLOCK | HB_IT_SYMBOL );
cb = type_cb;
}
else if( HB_ISNUM( 3 ) )
@@ -876,9 +864,9 @@ HB_FUNC( MXMLLOADSTRING )
}
}
if( HB_ISBLOCK( 3 ) )
if( HB_ISBLOCK( 3 ) || HB_ISSYMBOL( 3 ) )
{
pCbs->type_cb = hb_itemNew( hb_param( 3, HB_IT_BLOCK ) );
pCbs->type_cb = hb_param( 3, HB_IT_BLOCK | HB_IT_SYMBOL );
cb = type_cb;
}
else if( HB_ISNUM( 3 ) )
@@ -1169,9 +1157,9 @@ static void sax_cb( mxml_node_t * node, mxml_sax_event_t event, void * data )
if( node != NULL && pCbs != NULL )
{
PHB_ITEM pBlock = pCbs->sax_cb;
PHB_ITEM pCallback = pCbs->sax_cb;
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
PHB_ITEM pNode = hb_itemNew( NULL );
HB_USHORT uPCount = 2;
@@ -1179,7 +1167,7 @@ static void sax_cb( mxml_node_t * node, mxml_sax_event_t event, void * data )
hbmxml_node_ItemPut( pNode, node, 0 );
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
hb_vmPushItemRef( pNode );
hb_vmPushInteger( ( int ) ( event + 1 ) );
@@ -1188,7 +1176,7 @@ static void sax_cb( mxml_node_t * node, mxml_sax_event_t event, void * data )
hb_vmPush( ( PHB_ITEM ) data );
uPCount += 1;
}
hb_vmProc( uPCount );
hb_vmSend( uPCount );
hb_itemRelease( pNode );
hb_vmRequestRestore();
@@ -1230,9 +1218,9 @@ HB_FUNC( MXMLSAXLOADFILE )
}
}
if( HB_ISBLOCK( 3 ) )
if( HB_ISBLOCK( 3 ) || HB_ISSYMBOL( 3 ) )
{
pCbs->type_cb = hb_itemNew( hb_param( 3, HB_IT_BLOCK ) );
pCbs->type_cb = hb_param( 3, HB_IT_BLOCK | HB_IT_SYMBOL );
cb = type_cb;
}
else if( HB_ISNUM( 3 ) )
@@ -1249,15 +1237,10 @@ HB_FUNC( MXMLSAXLOADFILE )
}
}
if( HB_ISBLOCK( 4 ) )
if( HB_ISBLOCK( 4 ) || HB_ISSYMBOL( 4 ) )
{
PHB_ITEM pDynSym = hb_dynsymNew( hb_itemGetSymbol( hb_param( 4, HB_IT_SYMBOL ) ) );
if( pDynSym && hb_dynsymIsFunction( pDynSym ) )
{
pCbs->sax_cb = pDynSym;
cb_sax = sax_cb;
}
pCbs->sax_cb = hb_param( 4, HB_IT_BLOCK | HB_IT_SYMBOL );
cb_sax = sax_cb;
}
file = hb_fopen( hb_parstr_utf8( 2, &hFree, NULL ), "rb" );
@@ -1311,9 +1294,9 @@ HB_FUNC( MXMLSAXLOADSTRING )
}
}
if( HB_ISBLOCK( 3 ) )
if( HB_ISBLOCK( 3 ) || HB_ISSYMBOL( 3 ) )
{
pCbs->type_cb = hb_itemNew( hb_param( 3, HB_IT_BLOCK ) );
pCbs->type_cb = hb_param( 3, HB_IT_BLOCK | HB_IT_SYMBOL );
cb = type_cb;
}
else if( HB_ISNUM( 3 ) )
@@ -1330,15 +1313,10 @@ HB_FUNC( MXMLSAXLOADSTRING )
}
}
if( HB_ISBLOCK( 4 ) )
if( HB_ISBLOCK( 4 ) || HB_ISSYMBOL( 4 ) )
{
PHB_ITEM pDynSym = hb_dynsymNew( hb_itemGetSymbol( hb_param( 4, HB_IT_SYMBOL ) ) );
if( pDynSym && hb_dynsymIsFunction( pDynSym ) )
{
pCbs->sax_cb = pDynSym;
cb_sax = sax_cb;
}
pCbs->sax_cb = hb_param( 4, HB_IT_BLOCK | HB_IT_SYMBOL );
cb_sax = sax_cb;
}
s = hb_parstr_utf8( 2, &hFree, NULL );
@@ -1364,9 +1342,9 @@ static const char * save_cb( mxml_node_t * node, int where )
if( node != NULL && pCbs != NULL )
{
PHB_ITEM pBlock = pCbs->save_cb;
PHB_ITEM pCallback = pCbs->save_cb;
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
PHB_ITEM pNode = hb_itemNew( NULL );
PHB_ITEM pResult;
@@ -1376,7 +1354,7 @@ static const char * save_cb( mxml_node_t * node, int where )
hbmxml_node_ItemPut( pNode, node, 0 );
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
hb_vmPushItemRef( pNode );
hb_vmPushInteger( where );
hb_vmSend( 2 );
@@ -1422,9 +1400,9 @@ HB_FUNC( MXMLSAVEALLOCSTRING )
char buffer[ BUFFER_SIZE ];
int bytes;
if( HB_ISBLOCK( 2 ) )
if( HB_ISBLOCK( 2 ) || HB_ISSYMBOL( 2 ) )
{
pCbs->save_cb = hb_itemNew( hb_param( 2, HB_IT_BLOCK ) );
pCbs->save_cb = hb_param( 2, HB_IT_BLOCK | HB_IT_SYMBOL );
cb = save_cb;
}
@@ -1463,9 +1441,9 @@ HB_FUNC( MXMLSAVEFILE )
mxml_save_cb_t cb = MXML_NO_CALLBACK;
HB_CBS_VAR * pCbs = ( HB_CBS_VAR * ) hb_stackGetTSD( &s_cbs_var );
if( HB_ISBLOCK( 3 ) )
if( HB_ISBLOCK( 3 ) || HB_ISSYMBOL( 3 ) )
{
pCbs->save_cb = hb_itemNew( hb_param( 3, HB_IT_BLOCK ) );
pCbs->save_cb = hb_param( 3, HB_IT_BLOCK | HB_IT_SYMBOL );
cb = save_cb;
}
@@ -1500,9 +1478,9 @@ HB_FUNC( MXMLSAVESTRING )
char * buffer;
HB_SIZE buffer_size;
if( HB_ISBLOCK( 3 ) )
if( HB_ISBLOCK( 3 ) || HB_ISSYMBOL( 3 ) )
{
pCbs->save_cb = hb_itemNew( hb_param( 3, HB_IT_BLOCK ) );
pCbs->save_cb = hb_param( 3, HB_IT_BLOCK | HB_IT_SYMBOL );
cb = save_cb;
}
@@ -1575,15 +1553,15 @@ static void error_cb( const char * pszErrorMsg )
if( pError_cb != NULL )
{
PHB_ITEM pBlock = pError_cb->error_cb;
PHB_ITEM pCallback = pError_cb->error_cb;
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
hb_itemPutCConst( hb_stackAllocItem(), pszErrorMsg );
hb_vmProc( 1 );
hb_vmSend( 1 );
hb_vmRequestRestore();
}
}
@@ -1591,14 +1569,16 @@ static void error_cb( const char * pszErrorMsg )
HB_FUNC( MXMLSETERRORCALLBACK )
{
if( HB_ISBLOCK( 1 ) )
if( HB_ISBLOCK( 1 ) || HB_ISSYMBOL( 1 ) )
{
HB_ERROR_CB_VAR * pError_cb = ( HB_ERROR_CB_VAR * ) hb_stackGetTSD( &s_error_cb_var );
pError_cb->error_cb = hb_itemNew( hb_param( 1, HB_IT_BLOCK ) );
pError_cb->error_cb = hb_itemNew( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
mxmlSetErrorCallback( error_cb );
}
else
mxmlSetErrorCallback( NULL );
}
/* int mxmlSetInteger( mxml_node_t * node, int integer ) */
@@ -1828,9 +1808,9 @@ static int custom_load_cb( mxml_node_t * node, const char * data )
if( node != NULL && pCCbs != NULL && data != NULL )
{
PHB_ITEM pBlock = pCCbs->load_cb;
PHB_ITEM pCallback = pCCbs->load_cb;
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
PHB_ITEM pNode = hb_itemNew( NULL );
int iResult;
@@ -1838,7 +1818,7 @@ static int custom_load_cb( mxml_node_t * node, const char * data )
hbmxml_node_ItemPut( pNode, node, 0 );
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
hb_vmPushItemRef( pNode );
hb_itemPutCConst( hb_stackAllocItem(), data );
@@ -1863,9 +1843,9 @@ static char * custom_save_cb( mxml_node_t * node )
if( node != NULL && pCCbs != NULL )
{
PHB_ITEM pBlock = pCCbs->save_cb;
PHB_ITEM pCallback = pCCbs->save_cb;
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
PHB_ITEM pNode = hb_itemNew( NULL );
char * pszResult;
@@ -1873,7 +1853,7 @@ static char * custom_save_cb( mxml_node_t * node )
hbmxml_node_ItemPut( pNode, node, 0 );
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
hb_vmPushItemRef( pNode );
hb_vmSend( 1 );
@@ -1893,17 +1873,16 @@ static char * custom_save_cb( mxml_node_t * node )
HB_FUNC( MXMLSETCUSTOMHANDLERS )
{
mxml_custom_load_cb_t load = NULL;
mxml_custom_save_cb_t save = NULL;
if( HB_ISBLOCK( 1 ) && HB_ISBLOCK( 2 ) )
if( ( HB_ISBLOCK( 1 ) || HB_ISSYMBOL( 1 ) ) &&
( HB_ISBLOCK( 2 ) || HB_ISSYMBOL( 2 ) ) )
{
HB_CUSTOM_CBS_VAR * pCCbs = ( HB_CUSTOM_CBS_VAR * ) hb_stackGetTSD( &s_custom_cbs_var );
pCCbs->load_cb = hb_itemNew( hb_param( 1, HB_IT_BLOCK ) );
pCCbs->save_cb = hb_itemNew( hb_param( 2, HB_IT_BLOCK ) );
load = custom_load_cb;
save = custom_save_cb;
pCCbs->load_cb = hb_itemNew( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
pCCbs->save_cb = hb_itemNew( hb_param( 2, HB_IT_BLOCK | HB_IT_SYMBOL ) );
mxmlSetCustomHandlers( custom_load_cb, custom_save_cb );
}
mxmlSetCustomHandlers( load, save );
else
mxmlSetCustomHandlers( NULL, NULL );
}

View File

@@ -12,14 +12,14 @@ PROCEDURE main()
LOCAL tree, node
LOCAL xData
mxmlSetErrorCallback( {| cErrorMsg | my_mxmlError( cErrorMsg ) } )
mxmlSetCustomHandlers( {| node, cString | load_c( node, cString ) }, {| node | save_c( node ) } )
mxmlSetErrorCallback( @my_mxmlError() )
mxmlSetCustomHandlers( @load_c(), @save_c() )
IF ! hb_FileExists( "cust.xml" )
create_cust()
ENDIF
tree := mxmlLoadFile( tree, "cust.xml", {| node | type_cb( node ) } )
tree := mxmlLoadFile( tree, "cust.xml", @type_cb() )
node := mxmlFindElement( tree, tree, "hash", NIL, NIL, MXML_DESCEND )
IF Empty( node )
@@ -39,7 +39,7 @@ PROCEDURE main()
ENDIF
xData := mxmlGetCustom( node )
IF hb_isHash( xData ) .AND. "Today" $ xData
IF hb_isHash( xData ) .AND. hb_hHasKey( xData, "Today" )
OutStd( xData[ "Today" ], hb_eol() )
ENDIF
@@ -65,7 +65,7 @@ STATIC PROCEDURE create_cust()
mxmlElementSetAttr( element, "type", "custom" )
mxmlElementSetAttr( element, "checksum", hb_md5( _ENCODE( node ) ) )
mxmlSaveFile( tree, "cust.xml", {| node, where | whitespace_cb( node, where ) } )
mxmlSaveFile( tree, "cust.xml", @whitespace_cb() )
RETURN

View File

@@ -11,7 +11,7 @@ PROCEDURE main()
LOCAL xml
mxmlSetErrorCallback( {| cErrorMsg | my_mxmlError( cErrorMsg ) } )
mxmlSetErrorCallback( @my_mxmlError() )
IF hb_fileExists( "rem.xml" )
xml := simplexml_load_file( "rem.xml" )
@@ -46,7 +46,7 @@ PROCEDURE my_mxmlError( cErrorMsg )
STATIC FUNCTION simplexml_load_file( file )
RETURN mxmlLoadString( NIL, hb_memoRead( file ), {| node | type_cb( node ) } )
RETURN mxmlLoadString( NIL, hb_memoRead( file ), @type_cb() )
STATIC FUNCTION asXML( xml )

View File

@@ -458,14 +458,14 @@ PROCEDURE Main( cFileArg )
*/
IF Left( cFileArg, 1 ) == "<"
hTree := mxmlLoadString( nil, cFileArg, {| node | type_cb( node ) } )
hTree := mxmlLoadString( nil, cFileArg, @type_cb() )
ELSE
/*
* Read the file...
*/
hTree := mxmlLoadFile( nil, cFileArg, {| node | type_cb( node ) } )
hTree := mxmlLoadFile( nil, cFileArg, @type_cb() )
ENDIF
IF Empty( hTree )
@@ -503,7 +503,7 @@ PROCEDURE Main( cFileArg )
*/
FErase( "out.xml" )
mxmlSaveFile( hTree, "out.xml", {| node, where | whitespace_cb( node, where ) } )
mxmlSaveFile( hTree, "out.xml", @whitespace_cb() )
/* XXX: */
/*
@@ -511,7 +511,7 @@ PROCEDURE Main( cFileArg )
*/
cStr := Space( 16384 )
IF ( nNum := mxmlSaveString( hTree, @cStr, {| node, where | whitespace_cb( node, where ) } ) ) > 0
IF ( nNum := mxmlSaveString( hTree, @cStr, @whitespace_cb() ) ) > 0
OutStd( cStr + hb_eol() )
ENDIF
@@ -526,14 +526,14 @@ PROCEDURE Main( cFileArg )
*/
IF Left( cFileArg, 1 ) == "<"
mxmlSAXLoadString( nil, cFileArg, {| node | type_cb( node ) }, {| hNode, hEvent, hData | sax_cb( hNode, hEvent, hData ) }, nil )
mxmlSAXLoadString( nil, cFileArg, @type_cb(), @sax_cb(), nil )
ELSE
/*
* Read the file...
*/
mxmlSAXLoadFile( nil, cFileArg, {| node | type_cb( node ) }, {| hNode, hEvent, hData | sax_cb( hNode, hEvent, hData ) }, nil )
mxmlSAXLoadFile( nil, cFileArg, @type_cb(), @sax_cb(), nil )
ENDIF
IF cFileArg == "test.xml"

View File

@@ -262,9 +262,9 @@ static void * hb_sqlite3_param( int iParam, int iType, HB_BOOL fError )
static int callback( void * Cargo, int argc, char ** argv, char ** azColName )
{
PHB_ITEM pBlock = ( PHB_ITEM ) Cargo;
PHB_ITEM pCallback = ( PHB_ITEM ) Cargo;
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
PHB_ITEM pArrayValue = hb_itemArrayNew( argc );
PHB_ITEM pArrayColName = hb_itemArrayNew( argc );
@@ -277,7 +277,7 @@ static int callback( void * Cargo, int argc, char ** argv, char ** azColName )
}
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
hb_vmPushInteger( argc );
hb_vmPush( pArrayValue );
hb_vmPush( pArrayColName );
@@ -300,9 +300,9 @@ static int authorizer( void * Cargo, int iAction, const char * sName1, const cha
const char * sName3,
const char * sName4 )
{
PHB_ITEM pBlock = ( PHB_ITEM ) Cargo;
PHB_ITEM pCallback = ( PHB_ITEM ) Cargo;
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
int iRes;
PHB_ITEM pItem1 = hb_itemPutStrUTF8( NULL, sName1 );
@@ -311,7 +311,7 @@ static int authorizer( void * Cargo, int iAction, const char * sName1, const cha
PHB_ITEM pItem4 = hb_itemPutStrUTF8( NULL, sName4 );
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
hb_vmPushInteger( iAction );
hb_vmPush( pItem1 );
hb_vmPush( pItem2 );
@@ -336,14 +336,14 @@ static int authorizer( void * Cargo, int iAction, const char * sName1, const cha
static int busy_handler( void * Cargo, int iNumberOfTimes )
{
PHB_ITEM pBlock = ( PHB_ITEM ) Cargo;
PHB_ITEM pCallback = ( PHB_ITEM ) Cargo;
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
int iRes;
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
hb_vmPushInteger( iNumberOfTimes );
hb_vmSend( 1 );
@@ -359,14 +359,14 @@ static int busy_handler( void * Cargo, int iNumberOfTimes )
static int progress_handler( void * Cargo )
{
PHB_ITEM pBlock = ( PHB_ITEM ) Cargo;
PHB_ITEM pCallback = ( PHB_ITEM ) Cargo;
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
int iRes;
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
hb_vmSend( 0 );
iRes = hb_parni( -1 );
@@ -381,14 +381,14 @@ static int progress_handler( void * Cargo )
static int hook_commit( void * Cargo )
{
PHB_ITEM pBlock = ( PHB_ITEM ) Cargo;
PHB_ITEM pCallback = ( PHB_ITEM ) Cargo;
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
int iRes;
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
hb_vmSend( 0 );
iRes = hb_parni( -1 );
@@ -403,12 +403,12 @@ static int hook_commit( void * Cargo )
static void hook_rollback( void * Cargo )
{
PHB_ITEM pBlock = ( PHB_ITEM ) Cargo;
PHB_ITEM pCallback = ( PHB_ITEM ) Cargo;
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
hb_vmSend( 0 );
hb_vmRequestRestore();
@@ -417,15 +417,15 @@ static void hook_rollback( void * Cargo )
static void func( sqlite3_context * ctx, int argc, sqlite3_value ** argv )
{
PHB_ITEM pBlock = ( PHB_ITEM ) sqlite3_user_data( ctx );
PHB_ITEM pCallback = ( PHB_ITEM ) sqlite3_user_data( ctx );
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
PHB_ITEM pResult;
int i;
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
hb_vmPushInteger( argc );
if( argc > 0 )

View File

@@ -380,15 +380,15 @@ static int xdlt_outf( void * priv, mmbuffer_t * mb, int nbuf )
static int xdlt_outb( void * priv, mmbuffer_t * mb, int nbuf )
{
PHB_ITEM pBlock = ( PHB_ITEM ) priv;
PHB_ITEM pCallback = ( PHB_ITEM ) priv;
if( pBlock && hb_vmRequestReenter() )
if( pCallback && hb_vmRequestReenter() )
{
int iResult;
int i;
hb_vmPushEvalSym();
hb_vmPush( pBlock );
hb_vmPush( pCallback );
for( i = 0; i < nbuf; i++ )
hb_vmPushString( ( const char * ) mb[ i ].ptr, mb[ i ].size );
@@ -429,9 +429,9 @@ HB_FUNC( XDL_DIFF )
}
else if( HB_ISBLOCK( 5 ) || HB_ISSYMBOL( 5 ) )
{
PHB_ITEM pBlock = hb_param( 5, HB_IT_BLOCK | HB_IT_SYMBOL );
PHB_ITEM pCallback = hb_param( 5, HB_IT_BLOCK | HB_IT_SYMBOL );
ecb.priv = ( void * ) pBlock;
ecb.priv = ( void * ) pCallback;
ecb.outf = xdlt_outb;
hb_retni( xdl_diff( phb_mmf1->mmf, phb_mmf2->mmf, &xpp, &xecfg, &ecb ) );
@@ -501,9 +501,9 @@ HB_FUNC( XDL_BDIFF )
}
else if( HB_ISBLOCK( 4 ) || HB_ISSYMBOL( 4 ) )
{
PHB_ITEM pBlock = hb_param( 4, HB_IT_BLOCK | HB_IT_SYMBOL );
PHB_ITEM pCallback = hb_param( 4, HB_IT_BLOCK | HB_IT_SYMBOL );
ecb.priv = ( void * ) pBlock;
ecb.priv = ( void * ) pCallback;
ecb.outf = xdlt_outb;
hb_retni( xdl_bdiff( phb_mmf1->mmf, phb_mmf2->mmf, &bdp, &ecb ) );
@@ -539,9 +539,9 @@ HB_FUNC( XDL_RABDIFF )
}
else if( HB_ISBLOCK( 3 ) || HB_ISSYMBOL( 3 ) )
{
PHB_ITEM pBlock = hb_param( 3, HB_IT_BLOCK | HB_IT_SYMBOL );
PHB_ITEM pCallback = hb_param( 3, HB_IT_BLOCK | HB_IT_SYMBOL );
ecb.priv = ( void * ) pBlock;
ecb.priv = ( void * ) pCallback;
ecb.outf = xdlt_outb;
hb_retni( xdl_rabdiff( phb_mmf1->mmf, phb_mmf2->mmf, &ecb ) );
@@ -573,9 +573,9 @@ HB_FUNC( XDL_BPATCH )
}
else if( HB_ISBLOCK( 3 ) || HB_ISSYMBOL( 3 ) )
{
PHB_ITEM pBlock = hb_param( 3, HB_IT_BLOCK | HB_IT_SYMBOL );
PHB_ITEM pCallback = hb_param( 3, HB_IT_BLOCK | HB_IT_SYMBOL );
ecb.priv = ( void * ) pBlock;
ecb.priv = ( void * ) pCallback;
ecb.outf = xdlt_outb;
hb_retni( xdl_bpatch( phb_mmf1->mmf, phb_mmf2->mmf, &ecb ) );