cinap_lenrekadd hg and python4bb9e2215 years agoHistory
988 lines · 30.6 KB · C
RawDownload
}static PyObject*pure_purify_watch_w_2(PyObject *self, PyObject *args){	return call_intasaddr_function(purify_watch_w_2, self, args);}static PyObject*pure_purify_watch_w_4(PyObject *self, PyObject *args){	return call_intasaddr_function(purify_watch_w_4, self, args);}static PyObject*pure_purify_watch_w_8(PyObject *self, PyObject *args){	return call_intasaddr_function(purify_watch_w_8, self, args);}static PyObject*pure_purify_watch_r_1(PyObject *self, PyObject *args){	return call_intasaddr_function(purify_watch_r_1, self, args);}static PyObject*pure_purify_watch_r_2(PyObject *self, PyObject *args){	return call_intasaddr_function(purify_watch_r_2, self, args);}static PyObject*pure_purify_watch_r_4(PyObject *self, PyObject *args){	return call_intasaddr_function(purify_watch_r_4, self, args);}static PyObject*pure_purify_watch_r_8(PyObject *self, PyObject *args){	return call_intasaddr_function(purify_watch_r_8, self, args);}static PyObject*pure_purify_watch_rw_1(PyObject *self, PyObject *args){	return call_intasaddr_function(purify_watch_rw_1, self, args);}static PyObject*pure_purify_watch_rw_2(PyObject *self, PyObject *args){	return call_intasaddr_function(purify_watch_rw_2, self, args);}static PyObject*pure_purify_watch_rw_4(PyObject *self, PyObject *args){	return call_intasaddr_function(purify_watch_rw_4, self, args);}static PyObject*pure_purify_watch_rw_8(PyObject *self, PyObject *args){	return call_intasaddr_function(purify_watch_rw_8, self, args);} static PyObject*pure_purify_watch_n(PyObject *self, PyObject *args){	long addrrep;	unsigned int size;	char* type;	int status; 	if (!PyArg_ParseTuple(args, "lis:purify_watch_n", &addrrep, &size, &type))		return NULL; 	status = purify_watch_n((char*)addrrep, size, type);	return Py_BuildValue("i", status);} static PyObject*pure_purify_watch_info(PyObject *self, PyObject *args){	return call_voidarg_function(purify_watch_info, self, args);} static PyObject*pure_purify_watch_remove(PyObject *self, PyObject *args){	int watchno;	int status; 	if (!PyArg_ParseTuple(args, "i:purify_watch_remove", &watchno))		return NULL; 	status = purify_watch_remove(watchno);	return Py_BuildValue("i", status);} static PyObject*pure_purify_watch_remove_all(PyObject *self, PyObject *args){	return call_voidarg_function(purify_watch_remove_all, self, args);}static PyObject*pure_purify_describe(PyObject *self, PyObject *args){	long addrrep;	char* rtn; 	if (!PyArg_ParseTuple(args, "l:purify_describe", &addrrep))		return NULL; 	rtn = purify_describe((char*)addrrep);	return Py_BuildValue("l", (long)rtn);} static PyObject*pure_purify_what_colors(PyObject *self, PyObject *args){	long addrrep;	unsigned int size;	int status;    	if (!PyArg_ParseTuple(args, "li:purify_what_colors", &addrrep, &size))		return NULL; 	status = purify_what_colors((char*)addrrep, size);	return Py_BuildValue("i", status);} static PyObject*pure_purify_is_running(PyObject *self, PyObject *args){	return call_voidarg_function(purify_is_running, self, args);} static PyObject*pure_purify_assert_is_readable(PyObject *self, PyObject *args){	return call_stringandint_function(purify_assert_is_readable,					  self, args);}static PyObject*pure_purify_assert_is_writable(PyObject *self, PyObject *args){	return call_stringandint_function(purify_assert_is_writable,					  self, args);} #if HAS_PURIFY_EXIT /* I wish I could include this, but I can't.  See the notes at the top of * the file. */ static PyObject*pure_purify_exit(PyObject *self, PyObject *args){	int status; 	if (!PyArg_ParseTuple(args, "i:purify_exit", &status))		return NULL;         /* purify_exit doesn't always act like exit(). See the manual */	purify_exit(status);	Py_INCREF(Py_None);	return Py_None;}#endif /* HAS_PURIFY_EXIT */ #endif /* PURIFY_H */  /* Quantify functions * * N.B. Some of these functions are only described in the quantify.h file, * not in the version of the hardcopy manual that I had.  If you're not * sure what some of these do, check the header file, it is documented * fairly well. * * None of the custom dynamic loader functions are exported. * */#ifdef QUANTIFY_H static PyObject*pure_quantify_is_running(PyObject *self, PyObject *args){	return call_voidarg_function(quantify_is_running, self, args);}static PyObject*pure_quantify_help(PyObject *self, PyObject *args){	return call_voidarg_function(quantify_help, self, args);}static PyObject*pure_quantify_print_recording_state(PyObject *self, PyObject *args){	return call_voidarg_function(quantify_print_recording_state,				     self, args);}static PyObject*pure_quantify_start_recording_data(PyObject *self, PyObject *args){	return call_voidarg_function(quantify_start_recording_data,				     self, args);}static PyObject*pure_quantify_stop_recording_data(PyObject *self, PyObject *args){	return call_voidarg_function(quantify_stop_recording_data, self, args);}static PyObject*pure_quantify_is_recording_data(PyObject *self, PyObject *args){	return call_voidarg_function(quantify_is_recording_data, self, args);}static PyObject*pure_quantify_start_recording_system_calls(PyObject *self, PyObject *args){	return call_voidarg_function(quantify_start_recording_system_calls,				     self, args);}static PyObject*pure_quantify_stop_recording_system_calls(PyObject *self, PyObject *args){	return call_voidarg_function(quantify_stop_recording_system_calls,				     self, args);}static PyObject*pure_quantify_is_recording_system_calls(PyObject *self, PyObject *args){	return call_voidarg_function(quantify_is_recording_system_calls,				     self, args);}static PyObject*pure_quantify_start_recording_system_call(PyObject *self, PyObject *args){	return call_stringorint_function(quantify_start_recording_system_call,					   self, args);}static PyObject*pure_quantify_stop_recording_system_call(PyObject *self, PyObject *args){	return call_stringorint_function(quantify_stop_recording_system_call,					 self, args);}static PyObject*pure_quantify_is_recording_system_call(PyObject *self, PyObject *args){	return call_stringorint_function(quantify_is_recording_system_call,					 self, args);}static PyObject*pure_quantify_start_recording_dynamic_library_data(PyObject *self, PyObject *args){	return call_voidarg_function(		quantify_start_recording_dynamic_library_data,		self, args);}static PyObject*pure_quantify_stop_recording_dynamic_library_data(PyObject *self, PyObject *args){	return call_voidarg_function(		quantify_stop_recording_dynamic_library_data,		self, args);}static PyObject*pure_quantify_is_recording_dynamic_library_data(PyObject *self, PyObject *args){	return call_voidarg_function(		quantify_is_recording_dynamic_library_data,		self, args);}static PyObject*pure_quantify_start_recording_register_window_traps(PyObject *self, PyObject *args){	return call_voidarg_function(		quantify_start_recording_register_window_traps,		self, args);}static PyObject*pure_quantify_stop_recording_register_window_traps(PyObject *self, PyObject *args){	return call_voidarg_function(		quantify_stop_recording_register_window_traps,		self, args);}static PyObject*pure_quantify_is_recording_register_window_traps(PyObject *self, PyObject *args){	return call_voidarg_function(		quantify_is_recording_register_window_traps,		self, args);}static PyObject*pure_quantify_disable_recording_data(PyObject *self, PyObject *args){	return call_voidarg_function(quantify_disable_recording_data,				     self, args);}static PyObject*pure_quantify_clear_data(PyObject *self, PyObject *args){	return call_voidarg_function(quantify_clear_data, self, args);}static PyObject*pure_quantify_save_data(PyObject *self, PyObject *args){	return call_voidarg_function(quantify_save_data, self, args);}static PyObject*pure_quantify_save_data_to_file(PyObject *self, PyObject *args){	return call_stringarg_function(quantify_save_data_to_file, self, args);}static PyObject*pure_quantify_add_annotation(PyObject *self, PyObject *args){	return call_stringarg_function(quantify_add_annotation, self, args);} #endif /* QUANTIFY_H */  /* external interface */static struct PyMethodDefpure_methods[] = {#ifdef COMMON_PURE_FUNCTIONS    {"pure_logfile_printf",            pure_pure_logfile_printf,            METH_VARARGS},    {"pure_printf",                    pure_pure_printf,                    METH_VARARGS},    {"pure_printf_with_banner",        pure_pure_printf_with_banner,        METH_VARARGS},#endif /* COMMON_PURE_FUNCTIONS */#ifdef PURIFY_H    {"purify_all_inuse",               pure_purify_all_inuse,               METH_VARARGS},    {"purify_all_leaks",               pure_purify_all_leaks,               METH_VARARGS},    {"purify_new_inuse",               pure_purify_new_inuse,               METH_VARARGS},    {"purify_new_leaks",               pure_purify_new_leaks,               METH_VARARGS},    {"purify_clear_inuse",             pure_purify_clear_inuse,             METH_VARARGS},    {"purify_clear_leaks",             pure_purify_clear_leaks,             METH_VARARGS},    {"purify_all_fds_inuse",           pure_purify_all_fds_inuse,           METH_VARARGS},    {"purify_new_fds_inuse",           pure_purify_new_fds_inuse,           METH_VARARGS},    /* see purify.h */    {"purify_logfile_printf",          pure_pure_logfile_printf,            METH_VARARGS},    {"purify_printf",                  pure_pure_printf,                    METH_VARARGS},    {"purify_printf_with_banner",      pure_pure_printf_with_banner,        METH_VARARGS},    /**/    {"purify_printf_with_call_chain",  pure_purify_printf_with_call_chain,  METH_VARARGS},    {"purify_set_pool_id",             pure_purify_set_pool_id,             METH_VARARGS},    {"purify_get_pool_id",             pure_purify_get_pool_id,             METH_VARARGS},    {"purify_set_user_data",           pure_purify_set_user_data,           METH_VARARGS},    {"purify_get_user_data",           pure_purify_get_user_data,           METH_VARARGS},    {"purify_map_pool",                pure_purify_map_pool,                METH_VARARGS},    {"purify_map_pool_id",             pure_purify_map_pool_id,             METH_VARARGS},    {"purify_new_messages",            pure_purify_new_messages,            METH_VARARGS},    {"purify_all_messages",            pure_purify_all_messages,            METH_VARARGS},    {"purify_clear_messages",          pure_purify_clear_messages,          METH_VARARGS},    {"purify_clear_new_messages",      pure_purify_clear_new_messages,      METH_VARARGS},    {"purify_start_batch",             pure_purify_start_batch,             METH_VARARGS},    {"purify_start_batch_show_first",  pure_purify_start_batch_show_first,  METH_VARARGS},    {"purify_stop_batch",              pure_purify_stop_batch,              METH_VARARGS},    {"purify_name_thread",             pure_purify_name_thread,             METH_VARARGS},    {"purify_watch",                   pure_purify_watch,                   METH_VARARGS},    {"purify_watch_1",                 pure_purify_watch_1,                 METH_VARARGS},    {"purify_watch_2",                 pure_purify_watch_2,                 METH_VARARGS},    {"purify_watch_4",                 pure_purify_watch_4,                 METH_VARARGS},    {"purify_watch_8",                 pure_purify_watch_8,                 METH_VARARGS},    {"purify_watch_w_1",               pure_purify_watch_w_1,               METH_VARARGS},    {"purify_watch_w_2",               pure_purify_watch_w_2,               METH_VARARGS},    {"purify_watch_w_4",               pure_purify_watch_w_4,               METH_VARARGS},    {"purify_watch_w_8",               pure_purify_watch_w_8,               METH_VARARGS},    {"purify_watch_r_1",               pure_purify_watch_r_1,               METH_VARARGS},    {"purify_watch_r_2",               pure_purify_watch_r_2,               METH_VARARGS},    {"purify_watch_r_4",               pure_purify_watch_r_4,               METH_VARARGS},    {"purify_watch_r_8",               pure_purify_watch_r_8,               METH_VARARGS},    {"purify_watch_rw_1",              pure_purify_watch_rw_1,              METH_VARARGS},    {"purify_watch_rw_2",              pure_purify_watch_rw_2,              METH_VARARGS},    {"purify_watch_rw_4",              pure_purify_watch_rw_4,              METH_VARARGS},    {"purify_watch_rw_8",              pure_purify_watch_rw_8,              METH_VARARGS},    {"purify_watch_n",                 pure_purify_watch_n,                 METH_VARARGS},    {"purify_watch_info",              pure_purify_watch_info,              METH_VARARGS},    {"purify_watch_remove",            pure_purify_watch_remove,            METH_VARARGS},    {"purify_watch_remove_all",        pure_purify_watch_remove_all,        METH_VARARGS},    {"purify_describe",                pure_purify_describe,                METH_VARARGS},    {"purify_what_colors",             pure_purify_what_colors,             METH_VARARGS},    {"purify_is_running",              pure_purify_is_running,              METH_VARARGS},    {"purify_assert_is_readable",      pure_purify_assert_is_readable,      METH_VARARGS},    {"purify_assert_is_writable",      pure_purify_assert_is_writable,      METH_VARARGS},#if HAS_PURIFY_EXIT    /* I wish I could include this, but I can't.  See the notes at the     * top of the file.     */    {"purify_exit",                    pure_purify_exit,                    METH_VARARGS},#endif /* HAS_PURIFY_EXIT */#endif /* PURIFY_H */#ifdef QUANTIFY_H    {"quantify_is_running",            pure_quantify_is_running,            METH_VARARGS},    {"quantify_help",                  pure_quantify_help,                  METH_VARARGS},    {"quantify_print_recording_state", pure_quantify_print_recording_state, METH_VARARGS},    {"quantify_start_recording_data",  pure_quantify_start_recording_data,  METH_VARARGS},    {"quantify_stop_recording_data",   pure_quantify_stop_recording_data,   METH_VARARGS},    {"quantify_is_recording_data",     pure_quantify_is_recording_data,  METH_VARARGS},    {"quantify_start_recording_system_calls",     pure_quantify_start_recording_system_calls, METH_VARARGS},    {"quantify_stop_recording_system_calls",     pure_quantify_stop_recording_system_calls, METH_VARARGS},    {"quantify_is_recording_system_calls",     pure_quantify_is_recording_system_calls, METH_VARARGS},    {"quantify_start_recording_system_call",     pure_quantify_start_recording_system_call, METH_VARARGS},    {"quantify_stop_recording_system_call",     pure_quantify_stop_recording_system_call, METH_VARARGS},    {"quantify_is_recording_system_call",     pure_quantify_is_recording_system_call, METH_VARARGS},    {"quantify_start_recording_dynamic_library_data",     pure_quantify_start_recording_dynamic_library_data, METH_VARARGS},    {"quantify_stop_recording_dynamic_library_data",     pure_quantify_stop_recording_dynamic_library_data, METH_VARARGS},    {"quantify_is_recording_dynamic_library_data",     pure_quantify_is_recording_dynamic_library_data, METH_VARARGS},    {"quantify_start_recording_register_window_traps",     pure_quantify_start_recording_register_window_traps, METH_VARARGS},    {"quantify_stop_recording_register_window_traps",     pure_quantify_stop_recording_register_window_traps, METH_VARARGS},    {"quantify_is_recording_register_window_traps",     pure_quantify_is_recording_register_window_traps, METH_VARARGS},    {"quantify_disable_recording_data",     pure_quantify_disable_recording_data, METH_VARARGS},    {"quantify_clear_data",        pure_quantify_clear_data,        METH_VARARGS},    {"quantify_save_data",         pure_quantify_save_data,         METH_VARARGS},    {"quantify_save_data_to_file", pure_quantify_save_data_to_file, METH_VARARGS},    {"quantify_add_annotation",    pure_quantify_add_annotation,    METH_VARARGS},#endif /* QUANTIFY_H */    {NULL,  NULL}			     /* sentinel */};  static voidins(d, name, val)	PyObject *d;	char* name;	long val;{	PyObject *v = PyInt_FromLong(val);	if (v) {		(void)PyDict_SetItemString(d, name, v);		Py_DECREF(v);	}}  voidinitpure(){	PyObject *m, *d; 	m = Py_InitModule("pure", pure_methods);	if (m == NULL)    		return;	d = PyModule_GetDict(m);         /* this is bogus because we should be able to find this information         * out from the header files.  Pure's current versions don't         * include this information!         */#ifdef PURE_PURIFY_VERSION	ins(d, "PURIFY_VERSION", PURE_PURIFY_VERSION);#else	PyDict_SetItemString(d, "PURIFY_VERSION", Py_None);#endif         /* these aren't terribly useful because purify_exit() isn't         * exported correctly.  See the note at the top of the file.         */#ifdef PURIFY_EXIT_ERRORS	ins(d, "PURIFY_EXIT_ERRORS", PURIFY_EXIT_ERRORS);#endif#ifdef PURIFY_EXIT_LEAKS	ins(d, "PURIFY_EXIT_LEAKS",  PURIFY_EXIT_LEAKS);#endif#ifdef PURIFY_EXIT_PLEAKS	ins(d, "PURIFY_EXIT_PLEAKS", PURIFY_EXIT_PLEAKS);#endif  #ifdef PURE_QUANTIFY_VERSION	ins(d, "QUANTIFY_VERSION", PURE_QUANTIFY_VERSION);#else	PyDict_SetItemString(d, "QUANTIFY_VERSION", Py_None);#endif}

Lines 501–988 of 988. Previous lines