⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 puremodule.c

📁 python s60 1.4.5版本的源代码
💻 C
📖 第 1 页 / 共 3 页
字号:
	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 PyMethodDef
pure_methods[] = {
#ifdef COMMON_PURE_FUNCTIONS
    {"pure_logfile_printf",            pure_pure_logfile_printf,            1},
    {"pure_printf",                    pure_pure_printf,                    1},
    {"pure_printf_with_banner",        pure_pure_printf_with_banner,        1},
#endif /* COMMON_PURE_FUNCTIONS */
#ifdef PURIFY_H
    {"purify_all_inuse",               pure_purify_all_inuse,               1},
    {"purify_all_leaks",               pure_purify_all_leaks,               1},
    {"purify_new_inuse",               pure_purify_new_inuse,               1},
    {"purify_new_leaks",               pure_purify_new_leaks,               1},
    {"purify_clear_inuse",             pure_purify_clear_inuse,             1},
    {"purify_clear_leaks",             pure_purify_clear_leaks,             1},
    {"purify_all_fds_inuse",           pure_purify_all_fds_inuse,           1},
    {"purify_new_fds_inuse",           pure_purify_new_fds_inuse,           1},
    /* see purify.h */
    {"purify_logfile_printf",          pure_pure_logfile_printf,            1},
    {"purify_printf",                  pure_pure_printf,                    1},
    {"purify_printf_with_banner",      pure_pure_printf_with_banner,        1},
    /**/
    {"purify_printf_with_call_chain",  pure_purify_printf_with_call_chain,  1},
    {"purify_set_pool_id",             pure_purify_set_pool_id,             1},
    {"purify_get_pool_id",             pure_purify_get_pool_id,             1},
    {"purify_set_user_data",           pure_purify_set_user_data,           1},
    {"purify_get_user_data",           pure_purify_get_user_data,           1},
    {"purify_map_pool",                pure_purify_map_pool,                1},
    {"purify_map_pool_id",             pure_purify_map_pool_id,             1},
    {"purify_new_messages",            pure_purify_new_messages,            1},
    {"purify_all_messages",            pure_purify_all_messages,            1},
    {"purify_clear_messages",          pure_purify_clear_messages,          1},
    {"purify_clear_new_messages",      pure_purify_clear_new_messages,      1},
    {"purify_start_batch",             pure_purify_start_batch,             1},
    {"purify_start_batch_show_first",  pure_purify_start_batch_show_first,  1},
    {"purify_stop_batch",              pure_purify_stop_batch,              1},
    {"purify_name_thread",             pure_purify_name_thread,             1},
    {"purify_watch",                   pure_purify_watch,                   1},
    {"purify_watch_1",                 pure_purify_watch_1,                 1},
    {"purify_watch_2",                 pure_purify_watch_2,                 1},
    {"purify_watch_4",                 pure_purify_watch_4,                 1},
    {"purify_watch_8",                 pure_purify_watch_8,                 1},
    {"purify_watch_w_1",               pure_purify_watch_w_1,               1},
    {"purify_watch_w_2",               pure_purify_watch_w_2,               1},
    {"purify_watch_w_4",               pure_purify_watch_w_4,               1},
    {"purify_watch_w_8",               pure_purify_watch_w_8,               1},
    {"purify_watch_r_1",               pure_purify_watch_r_1,               1},
    {"purify_watch_r_2",               pure_purify_watch_r_2,               1},
    {"purify_watch_r_4",               pure_purify_watch_r_4,               1},
    {"purify_watch_r_8",               pure_purify_watch_r_8,               1},
    {"purify_watch_rw_1",              pure_purify_watch_rw_1,              1},
    {"purify_watch_rw_2",              pure_purify_watch_rw_2,              1},
    {"purify_watch_rw_4",              pure_purify_watch_rw_4,              1},
    {"purify_watch_rw_8",              pure_purify_watch_rw_8,              1},
    {"purify_watch_n",                 pure_purify_watch_n,                 1},
    {"purify_watch_info",              pure_purify_watch_info,              1},
    {"purify_watch_remove",            pure_purify_watch_remove,            1},
    {"purify_watch_remove_all",        pure_purify_watch_remove_all,        1},
    {"purify_describe",                pure_purify_describe,                1},
    {"purify_what_colors",             pure_purify_what_colors,             1},
    {"purify_is_running",              pure_purify_is_running,              1},
    {"purify_assert_is_readable",      pure_purify_assert_is_readable,      1},
    {"purify_assert_is_writable",      pure_purify_assert_is_writable,      1},
#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,                    1},
#endif /* HAS_PURIFY_EXIT */
#endif /* PURIFY_H */
#ifdef QUANTIFY_H
    {"quantify_is_running",            pure_quantify_is_running,            1},
    {"quantify_help",                  pure_quantify_help,                  1},
    {"quantify_print_recording_state", pure_quantify_print_recording_state, 1},
    {"quantify_start_recording_data",  pure_quantify_start_recording_data,  1},
    {"quantify_stop_recording_data",   pure_quantify_stop_recording_data,   1},
    {"quantify_is_recording_data",     pure_quantify_is_recording_data,  1},
    {"quantify_start_recording_system_calls",
     pure_quantify_start_recording_system_calls, 1},
    {"quantify_stop_recording_system_calls",
     pure_quantify_stop_recording_system_calls, 1},
    {"quantify_is_recording_system_calls",
     pure_quantify_is_recording_system_calls, 1},
    {"quantify_start_recording_system_call",
     pure_quantify_start_recording_system_call, 1},
    {"quantify_stop_recording_system_call",
     pure_quantify_stop_recording_system_call, 1},
    {"quantify_is_recording_system_call",
     pure_quantify_is_recording_system_call, 1},
    {"quantify_start_recording_dynamic_library_data",
     pure_quantify_start_recording_dynamic_library_data, 1},
    {"quantify_stop_recording_dynamic_library_data",
     pure_quantify_stop_recording_dynamic_library_data, 1},
    {"quantify_is_recording_dynamic_library_data",
     pure_quantify_is_recording_dynamic_library_data, 1},
    {"quantify_start_recording_register_window_traps",
     pure_quantify_start_recording_register_window_traps, 1},
    {"quantify_stop_recording_register_window_traps",
     pure_quantify_stop_recording_register_window_traps, 1},
    {"quantify_is_recording_register_window_traps",
     pure_quantify_is_recording_register_window_traps, 1},
    {"quantify_disable_recording_data",
     pure_quantify_disable_recording_data, 1},
    {"quantify_clear_data",        pure_quantify_clear_data,        1},
    {"quantify_save_data",         pure_quantify_save_data,         1},
    {"quantify_save_data_to_file", pure_quantify_save_data_to_file, 1},
    {"quantify_add_annotation",    pure_quantify_add_annotation,    1},
#endif /* QUANTIFY_H */
    {NULL,  NULL}			     /* sentinel */
};



static void
ins(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);
	}
}


void
initpure()
{
	PyObject *m, *d;

	m = Py_InitModule("pure", pure_methods);
	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
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -