_BreakPoint( ) API Library Routine Example

The following example uses the macro _BreakPoint( ) to place an INT 3 that debuggers recognize as a breakpoint.

Visual FoxPro Code

SET LIBRARY TO BPOINT  

C Code

#include <pro_ext.h>

FAR Example(ParamBlk FAR *parm)
{
   int RetValue;

   _BreakPoint(); // debugger breaks execution here

   _HLock(parm->p[0].val.ev_handle);
   _HLock(parm->p[1].val.ev_handle);

   RetValue = _StrCmp(_HandToPtr(parm->p[0].val.ev_handle),
      _HandToPtr(parm->p[1].val.ev_handle));

   _RetInt(RetValue, 10); // does return control here

   _HUnLock(parm->p[0].val.ev_handle);
   _HUnLock(parm->p[1].val.ev_handle);
}

FoxInfo myFoxInfo[] = {
   {"STRCMP", (FPFI) Example, 2, "C,C"},
};
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};