VOID Rtn(RTN rtn, VOID * v) { RTN_Open(rtn); UINT32 insNum2 = 0; RTN_Close(rtn);// The rtn is intentionally closed and then it is opened again. // This is done in order to check the correctness of both // "RTN_NumIns" and "RTN_InsTail" independently. UINT32 insNum1 = RTN_NumIns(rtn); RTN_Open(rtn); for (INS ins = RTN_InsTail(rtn); INS_Valid(ins); ins = INS_Prev(ins)) { insNum2++; } TEST(insNum1 == insNum2, "RTN_NumIns failed"); RTN_Close(rtn); }
int rtn_num_ins (lua_State *L) { RTN* v1 = check_rtn(L,1); UINT32 r = RTN_NumIns(*v1); lua_pushnumber(L, r); return 1; }
PyObject* Python_RTN_NumIns(PyObject* self, PyObject* args) { PyObject* rtn; PyArg_ParseTuple(args, "L", &rtn); RTN rtn_object = *(RTN*) rtn; return Py_BuildValue("L", RTN_NumIns(rtn_object)); }