annotate Modules/puremodule.c @ 5817:48b94de85bf3 legacy-trunk

Extensive changes by AMK.
author Guido van Rossum <guido@python.org>
date Thu, 17 Jul 1997 16:29:42 +0000
parents 994376af9064
children dc65c5f6ad7c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4981
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1 /* This module exports the C API to such Pure Software Inc. (tm) (now
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
2 * called Pure Atria Corporation) products as Purify (tm) and Quantify
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
3 * (tm). Other packages could be added, but I didn't have those products
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
4 * and thus lack the API documentation.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
5 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
6 * Currently supported: Quantify 2.x, Purify 3.x
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
7 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
8 * You need to decide which products you want to incorporate into the
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
9 * module when you compile this file. The way to do this is to edit
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
10 * <Python>/Modules/Setup to pass the appropriate flags to the compiler.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
11 * -DWITH_PURIFY compiles in the Purify support, and -DWITH_QUANTIFY
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
12 * compiles in the Quantify support. -DWITH_ALL_PURE compiles in both.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
13 * You can also build a Purify'd or Quantify'd interpreter by passing in
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
14 * the LINKCC variable to make. E.g. if you want to build a Purify'd
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
15 * interpreter and are using gcc, build Python with this command:
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
16 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
17 * make LINKCC='purify gcc'
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
18 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
19 * It would be nice (and probably easy) to provide this file as a shared
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
20 * library, however since it doesn't appear that Pure gives us shared
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
21 * libraries of the stubs, it doesn't really matter. For now, you have to
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
22 * link this file in statically.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
23 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
24 * Major bogosity. The purify.h header file exports purify_exit(), but
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
25 * guess what? It is not defined in the libpurify_stubs.a file! I tried
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
26 * to fake one here, hoping the Pure linker would Do The Right Thing when
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
27 * instrumented for Purify, but it doesn't seem to, so I don't export
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
28 * purify_exit() to the Python layer. In Python you should raise a
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
29 * SystemExit exception anyway.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
30 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
31 * The actual purify.h and quantify.h files which embody the APIs are
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
32 * copyrighted by Pure Software, Inc. and are only attainable through them.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
33 * This module assumes you have legally installed licenses of their
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
34 * software. Contact them on the Web via <http://www.pureatria.com/>
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
35 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
36 * Author: Barry Warsaw <bwarsaw@python.org>
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
37 * <bwarsaw@cnri.reston.va.us>
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
38 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
39
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
40 #include "Python.h"
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
41
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
42 #if defined(WITH_PURIFY) || defined(WITH_ALL_PURE)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
43 # include <purify.h>
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
44 # define HAS_PURIFY_EXIT 0 /* See note at top of file */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
45 # define PURE_PURIFY_VERSION 3 /* not provided by purify.h */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
46 #endif
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
47 #if defined(WITH_QUANTIFY) || defined(WITH_ALL_PURE)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
48 # include <quantify.h>
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
49 # define PURE_QUANTIFY_VERSION 2 /* not provided by quantify.h */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
50 #endif
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
51 #if defined(PURIFY_H) || defined(QUANTIFY_H)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
52 # define COMMON_PURE_FUNCTIONS
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
53 #endif /* PURIFY_H || QUANTIFY_H */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
54
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
55 typedef int (*VoidArgFunc)(void);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
56 typedef int (*StringArgFunc)(char*);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
57 typedef int (*PrintfishFunc)(const char*, ...);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
58 typedef int (*StringIntArgFunc)(const char*, int);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
59
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
60
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
61
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
62 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
63 call_voidarg_function(func, self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
64 VoidArgFunc func;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
65 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
66 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
67 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
68 int status;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
69
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
70 if (!PyArg_ParseTuple(args, ""))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
71 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
72
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
73 status = func();
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
74 return Py_BuildValue("i", status);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
75 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
76
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
77 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
78 call_stringarg_function(func, self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
79 StringArgFunc func;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
80 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
81 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
82 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
83 int status;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
84 char* stringarg;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
85
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
86 if (!PyArg_ParseTuple(args, "s", &stringarg))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
87 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
88
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
89 status = func(stringarg);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
90 return Py_BuildValue("i", status);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
91 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
92
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
93 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
94 call_stringorint_function(func, self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
95 StringArgFunc func;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
96 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
97 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
98 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
99 int status;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
100 int intarg;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
101 char* stringarg;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
102
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
103 /* according to the quantify.h file, the argument to
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
104 * quantify_*_recording_system_call can be an integer or a string,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
105 * but the functions are prototyped as taking a single char*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
106 * argument. Yikes!
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
107 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
108 if (PyArg_ParseTuple(args, "i", &intarg))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
109 /* func is prototyped as int(*)(char*)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
110 * better shut up the compiler
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
111 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
112 status = func((char*)intarg);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
113
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
114 else {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
115 PyErr_Clear();
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
116 if (!PyArg_ParseTuple(args, "s", &stringarg))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
117 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
118 else
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
119 status = func(stringarg);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
120 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
121 return Py_BuildValue("i", status);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
122 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
123
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
124 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
125 call_printfish_function(func, self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
126 PrintfishFunc func;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
127 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
128 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
129 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
130 /* we support the printf() style vararg functions by requiring the
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
131 * formatting be done in Python. At the C level we pass just a string
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
132 * to the printf() style function.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
133 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
134 int status;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
135 char* argstring;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
136
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
137 if (!PyArg_ParseTuple(args, "s", &argstring))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
138 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
139
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
140 status = func("%s", argstring);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
141 return Py_BuildValue("i", status);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
142 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
143
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
144 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
145 call_intasaddr_function(func, self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
146 StringArgFunc func;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
147 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
148 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
149 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
150 long memrep;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
151 int id;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
152
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
153 if (!PyArg_ParseTuple(args, "l", &memrep))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
154 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
155
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
156 id = func((char*)memrep);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
157 return Py_BuildValue("i", id);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
158 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
159
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
160 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
161 call_stringandint_function(func, self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
162 StringIntArgFunc func;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
163 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
164 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
165 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
166 long srcrep;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
167 int size;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
168 int status;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
169
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
170 if (!PyArg_ParseTuple(args, "li", &srcrep, &size))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
171 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
172
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
173 status = func((char*)srcrep, size);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
174 return Py_BuildValue("i", status);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
175 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
176
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
177
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
178
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
179 /* functions common to all products
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
180 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
181 * N.B. These printf() style functions are a bit of a kludge. Since the
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
182 * API doesn't provide vprintf versions of them, we can't call them
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
183 * directly. They don't support all the standard printf % modifiers
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
184 * anyway. The way to use these is to use Python's % string operator to do
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
185 * the formatting. By the time these functions get the thing to print,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
186 * it's already a string, and they just use "%s" as the format string.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
187 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
188
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
189 #ifdef COMMON_PURE_FUNCTIONS
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
190
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
191 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
192 pure_pure_logfile_printf(PyObject* self, PyObject* args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
193 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
194 return call_printfish_function(pure_logfile_printf, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
195 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
196
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
197 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
198 pure_pure_printf(PyObject* self, PyObject* args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
199 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
200 return call_printfish_function(pure_printf, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
201 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
202
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
203 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
204 pure_pure_printf_with_banner(PyObject* self, PyObject* args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
205 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
206 return call_printfish_function(pure_printf_with_banner, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
207 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
208
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
209
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
210 #endif /* COMMON_PURE_FUNCTIONS */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
211
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
212
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
213
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
214 /* Purify functions
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
215 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
216 * N.B. There are some interfaces described in the purify.h file that are
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
217 * not described in the manual.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
218 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
219 * Unsigned longs purify_report_{address,number,type,result} are not
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
220 * accessible from the Python layer since they seem mostly useful when
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
221 * purify_stop_here() is called by the (C) debugger. The same is true of
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
222 * the purify_stop_here_internal() function so it isn't exported either.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
223 * And purify_stop_here() should never be called directly.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
224 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
225 * The header file says purify_{new,all,clear_new}_reports() are obsolete
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
226 * so they aren't exported.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
227 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
228 * None of the custom dynamic loader functions are exported.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
229 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
230 * purify_unsafe_memcpy() isn't exported.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
231 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
232 * purify_{start,size}_of_block() aren't exported.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
233 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
234 * The manual that I have says that the prototype for the second argument
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
235 * to purify_map_pool is:
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
236 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
237 * void (*fn)(char*)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
238 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
239 * but the purify.h file declares it as:
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
240 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
241 * void (*fn)(char*, int, void*)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
242 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
243 * and does not explain what the other arguments are for. I support the
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
244 * latter but I don't know if I do it right or usefully.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
245 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
246 * The header file says that purify_describe() returns a char* which is the
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
247 * pointer passed to it. The manual says it returns an int, but I believe
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
248 * that is a typo.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
249 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
250 #ifdef PURIFY_H
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
251
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
252 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
253 pure_purify_all_inuse(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
254 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
255 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
256 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
257 return call_voidarg_function(purify_all_inuse, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
258 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
259 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
260 pure_purify_all_leaks(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
261 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
262 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
263 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
264 return call_voidarg_function(purify_all_leaks, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
265 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
266 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
267 pure_purify_new_inuse(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
268 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
269 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
270 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
271 return call_voidarg_function(purify_new_inuse, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
272 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
273 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
274 pure_purify_new_leaks(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
275 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
276 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
277 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
278 return call_voidarg_function(purify_new_leaks, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
279 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
280 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
281 pure_purify_clear_inuse(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
282 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
283 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
284 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
285 return call_voidarg_function(purify_clear_inuse, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
286 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
287 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
288 pure_purify_clear_leaks(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
289 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
290 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
291 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
292 return call_voidarg_function(purify_clear_leaks, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
293 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
294 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
295 pure_purify_all_fds_inuse(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
296 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
297 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
298 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
299 return call_voidarg_function(purify_all_fds_inuse, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
300 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
301 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
302 pure_purify_new_fds_inuse(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
303 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
304 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
305 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
306 return call_voidarg_function(purify_new_fds_inuse, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
307 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
308 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
309 pure_purify_printf_with_call_chain(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
310 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
311 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
312 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
313 return call_printfish_function(purify_printf_with_call_chain,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
314 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
315 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
316 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
317 pure_purify_set_pool_id(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
318 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
319 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
320 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
321 long memrep;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
322 int id;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
323
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
324 if (!PyArg_ParseTuple(args, "li", &memrep, &id))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
325 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
326
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
327 purify_set_pool_id((char*)memrep, id);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
328 Py_INCREF(Py_None);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
329 return Py_None;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
330 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
331 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
332 pure_purify_get_pool_id(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
333 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
334 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
335 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
336 return call_intasaddr_function(purify_get_pool_id, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
337 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
338 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
339 pure_purify_set_user_data(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
340 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
341 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
342 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
343 long memrep;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
344 long datarep;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
345
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
346 if (!PyArg_ParseTuple(args, "ll", &memrep, &datarep))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
347 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
348
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
349 purify_set_user_data((char*)memrep, (void*)datarep);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
350 Py_INCREF(Py_None);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
351 return Py_None;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
352 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
353 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
354 pure_purify_get_user_data(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
355 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
356 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
357 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
358 /* can't use call_intasaddr_function() since purify_get_user_data()
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
359 * returns a void*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
360 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
361 long memrep;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
362 void* data;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
363
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
364 if (!PyArg_ParseTuple(args, "l", &memrep))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
365 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
366
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
367 data = purify_get_user_data((char*)memrep);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
368 return Py_BuildValue("l", (long)data);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
369 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
370
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
371
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
372 /* this global variable is shared by both mapping functions:
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
373 * pure_purify_map_pool() and pure_purify_map_pool_id(). Since they cache
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
374 * this variable it should be safe in the face of recursion or cross
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
375 * calling.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
376 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
377 * Further note that the prototype for the callback function is wrong in
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
378 * the Purify manual. The manual says the function takes a single char*,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
379 * but the header file says it takes an additional int and void*. I have
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
380 * no idea what these are for!
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
381 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
382 static PyObject* MapCallable = NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
383
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
384 static void
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
385 map_pool_callback(mem, user_size, user_aux_data)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
386 char* mem;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
387 int user_size;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
388 void *user_aux_data;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
389 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
390 long memrep = (long)mem;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
391 long user_aux_data_rep = (long)user_aux_data;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
392 PyObject* result;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
393 PyObject* memobj = Py_BuildValue("lil", memrep, user_size,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
394 user_aux_data_rep);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
395
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
396 if (memobj == NULL)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
397 return;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
398
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
399 result = PyEval_CallObject(MapCallable, memobj);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
400 Py_DECREF(result);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
401 Py_DECREF(memobj);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
402 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
403
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
404 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
405 pure_purify_map_pool(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
406 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
407 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
408 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
409 /* cache global variable in case of recursion */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
410 PyObject* saved_callable = MapCallable;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
411 PyObject* arg_callable;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
412 int id;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
413
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
414 if (!PyArg_ParseTuple(args, "iO", &id, &arg_callable))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
415 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
416
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
417 if (!PyCallable_Check(arg_callable)) {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
418 PyErr_SetString(PyExc_TypeError,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
419 "Second argument must be callable");
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
420 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
421 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
422 MapCallable = arg_callable;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
423 purify_map_pool(id, map_pool_callback);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
424 MapCallable = saved_callable;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
425
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
426 Py_INCREF(Py_None);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
427 return Py_None;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
428 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
429
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
430 static void
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
431 PurifyMapPoolIdCallback(id)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
432 int id;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
433 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
434 PyObject* result;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
435 PyObject* intobj = Py_BuildValue("i", id);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
436
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
437 if (intobj == NULL)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
438 return;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
439
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
440 result = PyEval_CallObject(MapCallable, intobj);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
441 Py_DECREF(result);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
442 Py_DECREF(intobj);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
443 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
444
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
445 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
446 pure_purify_map_pool_id(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
447 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
448 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
449 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
450 /* cache global variable in case of recursion */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
451 PyObject* saved_callable = MapCallable;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
452 PyObject* arg_callable;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
453
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
454 if (!PyArg_ParseTuple(args, "O", &arg_callable))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
455 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
456
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
457 if (!PyCallable_Check(arg_callable)) {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
458 PyErr_SetString(PyExc_TypeError, "Argument must be callable.");
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
459 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
460 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
461
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
462 MapCallable = arg_callable;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
463 purify_map_pool_id(PurifyMapPoolIdCallback);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
464 MapCallable = saved_callable;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
465
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
466 Py_INCREF(Py_None);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
467 return Py_None;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
468 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
469
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
470
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
471
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
472 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
473 pure_purify_new_messages(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
474 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
475 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
476 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
477 return call_voidarg_function(purify_new_messages, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
478 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
479 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
480 pure_purify_all_messages(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
481 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
482 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
483 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
484 return call_voidarg_function(purify_all_messages, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
485 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
486 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
487 pure_purify_clear_messages(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
488 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
489 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
490 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
491 return call_voidarg_function(purify_clear_messages, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
492 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
493 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
494 pure_purify_clear_new_messages(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
495 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
496 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
497 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
498 return call_voidarg_function(purify_clear_new_messages, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
499 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
500 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
501 pure_purify_start_batch(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
502 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
503 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
504 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
505 return call_voidarg_function(purify_start_batch, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
506 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
507 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
508 pure_purify_start_batch_show_first(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
509 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
510 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
511 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
512 return call_voidarg_function(purify_start_batch_show_first,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
513 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
514 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
515 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
516 pure_purify_stop_batch(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
517 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
518 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
519 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
520 return call_voidarg_function(purify_stop_batch, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
521 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
522 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
523 pure_purify_name_thread(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
524 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
525 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
526 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
527 /* can't strictly use call_stringarg_function since
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
528 * purify_name_thread takes a const char*, not a char*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
529 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
530 int status;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
531 char* stringarg;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
532
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
533 if (!PyArg_ParseTuple(args, "s", &stringarg))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
534 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
535
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
536 status = purify_name_thread(stringarg);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
537 return Py_BuildValue("i", status);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
538 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
539 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
540 pure_purify_watch(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
541 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
542 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
543 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
544 return call_intasaddr_function(purify_watch, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
545 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
546 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
547 pure_purify_watch_1(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
548 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
549 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
550 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
551 return call_intasaddr_function(purify_watch_1, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
552 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
553 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
554 pure_purify_watch_2(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
555 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
556 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
557 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
558 return call_intasaddr_function(purify_watch_2, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
559 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
560 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
561 pure_purify_watch_4(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
562 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
563 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
564 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
565 return call_intasaddr_function(purify_watch_4, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
566 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
567 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
568 pure_purify_watch_8(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
569 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
570 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
571 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
572 return call_intasaddr_function(purify_watch_8, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
573 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
574 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
575 pure_purify_watch_w_1(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
576 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
577 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
578 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
579 return call_intasaddr_function(purify_watch_w_1, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
580 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
581 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
582 pure_purify_watch_w_2(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
583 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
584 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
585 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
586 return call_intasaddr_function(purify_watch_w_2, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
587 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
588 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
589 pure_purify_watch_w_4(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
590 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
591 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
592 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
593 return call_intasaddr_function(purify_watch_w_4, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
594 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
595 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
596 pure_purify_watch_w_8(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
597 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
598 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
599 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
600 return call_intasaddr_function(purify_watch_w_8, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
601 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
602 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
603 pure_purify_watch_r_1(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
604 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
605 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
606 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
607 return call_intasaddr_function(purify_watch_r_1, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
608 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
609 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
610 pure_purify_watch_r_2(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
611 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
612 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
613 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
614 return call_intasaddr_function(purify_watch_r_2, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
615 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
616 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
617 pure_purify_watch_r_4(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
618 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
619 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
620 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
621 return call_intasaddr_function(purify_watch_r_4, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
622 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
623 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
624 pure_purify_watch_r_8(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
625 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
626 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
627 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
628 return call_intasaddr_function(purify_watch_r_8, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
629 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
630 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
631 pure_purify_watch_rw_1(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
632 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
633 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
634 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
635 return call_intasaddr_function(purify_watch_rw_1, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
636 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
637 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
638 pure_purify_watch_rw_2(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
639 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
640 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
641 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
642 return call_intasaddr_function(purify_watch_rw_2, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
643 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
644 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
645 pure_purify_watch_rw_4(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
646 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
647 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
648 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
649 return call_intasaddr_function(purify_watch_rw_4, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
650 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
651 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
652 pure_purify_watch_rw_8(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
653 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
654 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
655 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
656 return call_intasaddr_function(purify_watch_rw_8, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
657 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
658
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
659 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
660 pure_purify_watch_n(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
661 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
662 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
663 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
664 long addrrep;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
665 unsigned int size;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
666 char* type;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
667 int status;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
668
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
669 if (!PyArg_ParseTuple(args, "lis", &addrrep, &size, &type))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
670 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
671
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
672 status = purify_watch_n((char*)addrrep, size, type);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
673 return Py_BuildValue("i", status);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
674 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
675
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
676 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
677 pure_purify_watch_info(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
678 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
679 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
680 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
681 return call_voidarg_function(purify_watch_info, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
682 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
683
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
684 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
685 pure_purify_watch_remove(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
686 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
687 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
688 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
689 int watchno;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
690 int status;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
691
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
692 if (!PyArg_ParseTuple(args, "i", &watchno))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
693 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
694
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
695 status = purify_watch_remove(watchno);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
696 return Py_BuildValue("i", status);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
697 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
698
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
699 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
700 pure_purify_watch_remove_all(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
701 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
702 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
703 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
704 return call_voidarg_function(purify_watch_remove_all, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
705 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
706 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
707 pure_purify_describe(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
708 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
709 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
710 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
711 long addrrep;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
712 char* rtn;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
713
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
714 if (!PyArg_ParseTuple(args, "l", &addrrep))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
715 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
716
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
717 rtn = purify_describe((char*)addrrep);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
718 return Py_BuildValue("l", (long)rtn);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
719 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
720
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
721 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
722 pure_purify_what_colors(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
723 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
724 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
725 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
726 long addrrep;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
727 unsigned int size;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
728 int status;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
729
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
730 if (!PyArg_ParseTuple(args, "li", &addrrep, &size))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
731 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
732
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
733 status = purify_what_colors((char*)addrrep, size);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
734 return Py_BuildValue("i", status);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
735 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
736
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
737 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
738 pure_purify_is_running(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
739 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
740 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
741 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
742 return call_voidarg_function(purify_is_running, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
743 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
744
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
745 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
746 pure_purify_assert_is_readable(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
747 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
748 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
749 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
750 return call_stringandint_function(purify_assert_is_readable,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
751 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
752 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
753 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
754 pure_purify_assert_is_writable(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
755 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
756 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
757 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
758 return call_stringandint_function(purify_assert_is_writable,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
759 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
760 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
761
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
762 #if HAS_PURIFY_EXIT
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
763
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
764 /* I wish I could include this, but I can't. See the notes at the top of
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
765 * the file.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
766 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
767
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
768 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
769 pure_purify_exit(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
770 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
771 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
772 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
773 int status;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
774
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
775 if (!PyArg_ParseTuple(args, "i", &status))
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
776 return NULL;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
777
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
778 /* purify_exit doesn't always act like exit(). See the manual */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
779 purify_exit(status);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
780 Py_INCREF(Py_None);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
781 return Py_None;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
782 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
783 #endif /* HAS_PURIFY_EXIT */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
784
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
785 #endif /* PURIFY_H */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
786
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
787
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
788
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
789 /* Quantify functions
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
790 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
791 * N.B. Some of these functions are only described in the quantify.h file,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
792 * not in the version of the hardcopy manual that I had. If you're not
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
793 * sure what some of these do, check the header file, it is documented
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
794 * fairly well.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
795 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
796 * None of the custom dynamic loader functions are exported.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
797 *
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
798 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
799 #ifdef QUANTIFY_H
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
800
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
801 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
802 pure_quantify_is_running(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
803 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
804 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
805 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
806 return call_voidarg_function(quantify_is_running, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
807 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
808 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
809 pure_quantify_help(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
810 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
811 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
812 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
813 return call_voidarg_function(quantify_help, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
814 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
815 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
816 pure_quantify_print_recording_state(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
817 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
818 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
819 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
820 return call_voidarg_function(quantify_print_recording_state,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
821 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
822 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
823 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
824 pure_quantify_start_recording_data(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
825 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
826 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
827 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
828 return call_voidarg_function(quantify_start_recording_data,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
829 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
830 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
831 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
832 pure_quantify_stop_recording_data(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
833 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
834 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
835 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
836 return call_voidarg_function(quantify_stop_recording_data, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
837 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
838 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
839 pure_quantify_is_recording_data(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
840 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
841 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
842 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
843 return call_voidarg_function(quantify_is_recording_data, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
844 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
845 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
846 pure_quantify_start_recording_system_calls(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
847 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
848 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
849 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
850 return call_voidarg_function(quantify_start_recording_system_calls,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
851 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
852 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
853 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
854 pure_quantify_stop_recording_system_calls(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
855 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
856 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
857 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
858 return call_voidarg_function(quantify_stop_recording_system_calls,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
859 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
860 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
861 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
862 pure_quantify_is_recording_system_calls(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
863 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
864 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
865 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
866 return call_voidarg_function(quantify_is_recording_system_calls,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
867 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
868 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
869 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
870 pure_quantify_start_recording_system_call(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
871 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
872 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
873 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
874 return call_stringorint_function(quantify_start_recording_system_call,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
875 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
876 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
877 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
878 pure_quantify_stop_recording_system_call(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
879 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
880 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
881 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
882 return call_stringorint_function(quantify_stop_recording_system_call,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
883 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
884 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
885 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
886 pure_quantify_is_recording_system_call(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
887 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
888 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
889 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
890 return call_stringorint_function(quantify_is_recording_system_call,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
891 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
892 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
893 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
894 pure_quantify_start_recording_dynamic_library_data(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
895 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
896 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
897 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
898 return call_voidarg_function(
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
899 quantify_start_recording_dynamic_library_data,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
900 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
901 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
902 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
903 pure_quantify_stop_recording_dynamic_library_data(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
904 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
905 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
906 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
907 return call_voidarg_function(
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
908 quantify_stop_recording_dynamic_library_data,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
909 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
910 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
911 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
912 pure_quantify_is_recording_dynamic_library_data(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
913 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
914 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
915 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
916 return call_voidarg_function(
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
917 quantify_is_recording_dynamic_library_data,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
918 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
919 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
920 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
921 pure_quantify_start_recording_register_window_traps(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
922 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
923 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
924 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
925 return call_voidarg_function(
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
926 quantify_start_recording_register_window_traps,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
927 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
928 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
929 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
930 pure_quantify_stop_recording_register_window_traps(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
931 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
932 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
933 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
934 return call_voidarg_function(
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
935 quantify_stop_recording_register_window_traps,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
936 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
937 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
938 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
939 pure_quantify_is_recording_register_window_traps(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
940 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
941 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
942 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
943 return call_voidarg_function(
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
944 quantify_is_recording_register_window_traps,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
945 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
946 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
947 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
948 pure_quantify_disable_recording_data(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
949 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
950 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
951 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
952 return call_voidarg_function(quantify_disable_recording_data,
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
953 self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
954 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
955 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
956 pure_quantify_clear_data(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
957 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
958 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
959 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
960 return call_voidarg_function(quantify_clear_data, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
961 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
962 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
963 pure_quantify_save_data(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
964 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
965 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
966 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
967 return call_voidarg_function(quantify_save_data, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
968 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
969 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
970 pure_quantify_save_data_to_file(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
971 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
972 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
973 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
974 return call_stringarg_function(quantify_save_data_to_file, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
975 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
976 static PyObject*
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
977 pure_quantify_add_annotation(self, args)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
978 PyObject *self;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
979 PyObject *args;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
980 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
981 return call_stringarg_function(quantify_add_annotation, self, args);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
982 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
983
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
984 #endif /* QUANTIFY_H */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
985
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
986
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
987
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
988 /* external interface
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
989 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
990 static struct PyMethodDef
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
991 pure_methods[] = {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
992 #ifdef COMMON_PURE_FUNCTIONS
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
993 {"pure_logfile_printf", pure_pure_logfile_printf, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
994 {"pure_printf", pure_pure_printf, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
995 {"pure_printf_with_banner", pure_pure_printf_with_banner, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
996 #endif /* COMMON_PURE_FUNCTIONS */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
997 #ifdef PURIFY_H
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
998 {"purify_all_inuse", pure_purify_all_inuse, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
999 {"purify_all_leaks", pure_purify_all_leaks, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1000 {"purify_new_inuse", pure_purify_new_inuse, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1001 {"purify_new_leaks", pure_purify_new_leaks, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1002 {"purify_clear_inuse", pure_purify_clear_inuse, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1003 {"purify_clear_leaks", pure_purify_clear_leaks, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1004 {"purify_all_fds_inuse", pure_purify_all_fds_inuse, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1005 {"purify_new_fds_inuse", pure_purify_new_fds_inuse, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1006 /* see purify.h */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1007 {"purify_logfile_printf", pure_pure_logfile_printf, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1008 {"purify_printf", pure_pure_printf, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1009 {"purify_printf_with_banner", pure_pure_printf_with_banner, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1010 /**/
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1011 {"purify_printf_with_call_chain", pure_purify_printf_with_call_chain, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1012 {"purify_set_pool_id", pure_purify_set_pool_id, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1013 {"purify_get_pool_id", pure_purify_get_pool_id, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1014 {"purify_set_user_data", pure_purify_set_user_data, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1015 {"purify_get_user_data", pure_purify_get_user_data, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1016 {"purify_map_pool", pure_purify_map_pool, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1017 {"purify_map_pool_id", pure_purify_map_pool_id, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1018 {"purify_new_messages", pure_purify_new_messages, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1019 {"purify_all_messages", pure_purify_all_messages, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1020 {"purify_clear_messages", pure_purify_clear_messages, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1021 {"purify_clear_new_messages", pure_purify_clear_new_messages, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1022 {"purify_start_batch", pure_purify_start_batch, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1023 {"purify_start_batch_show_first", pure_purify_start_batch_show_first, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1024 {"purify_stop_batch", pure_purify_stop_batch, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1025 {"purify_name_thread", pure_purify_name_thread, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1026 {"purify_watch", pure_purify_watch, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1027 {"purify_watch_1", pure_purify_watch_1, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1028 {"purify_watch_2", pure_purify_watch_2, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1029 {"purify_watch_4", pure_purify_watch_4, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1030 {"purify_watch_8", pure_purify_watch_8, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1031 {"purify_watch_w_1", pure_purify_watch_w_1, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1032 {"purify_watch_w_2", pure_purify_watch_w_2, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1033 {"purify_watch_w_4", pure_purify_watch_w_4, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1034 {"purify_watch_w_8", pure_purify_watch_w_8, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1035 {"purify_watch_r_1", pure_purify_watch_r_1, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1036 {"purify_watch_r_2", pure_purify_watch_r_2, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1037 {"purify_watch_r_4", pure_purify_watch_r_4, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1038 {"purify_watch_r_8", pure_purify_watch_r_8, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1039 {"purify_watch_rw_1", pure_purify_watch_rw_1, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1040 {"purify_watch_rw_2", pure_purify_watch_rw_2, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1041 {"purify_watch_rw_4", pure_purify_watch_rw_4, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1042 {"purify_watch_rw_8", pure_purify_watch_rw_8, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1043 {"purify_watch_n", pure_purify_watch_n, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1044 {"purify_watch_info", pure_purify_watch_info, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1045 {"purify_watch_remove", pure_purify_watch_remove, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1046 {"purify_watch_remove_all", pure_purify_watch_remove_all, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1047 {"purify_describe", pure_purify_describe, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1048 {"purify_what_colors", pure_purify_what_colors, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1049 {"purify_is_running", pure_purify_is_running, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1050 {"purify_assert_is_readable", pure_purify_assert_is_readable, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1051 {"purify_assert_is_writable", pure_purify_assert_is_writable, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1052 #if HAS_PURIFY_EXIT
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1053 /* I wish I could include this, but I can't. See the notes at the
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1054 * top of the file.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1055 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1056 {"purify_exit", pure_purify_exit, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1057 #endif /* HAS_PURIFY_EXIT */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1058 #endif /* PURIFY_H */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1059 #ifdef QUANTIFY_H
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1060 {"quantify_is_running", pure_quantify_is_running, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1061 {"quantify_help", pure_quantify_help, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1062 {"quantify_print_recording_state", pure_quantify_print_recording_state, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1063 {"quantify_start_recording_data", pure_quantify_start_recording_data, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1064 {"quantify_stop_recording_data", pure_quantify_stop_recording_data, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1065 {"quantify_is_recording_data", pure_quantify_is_recording_data, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1066 {"quantify_start_recording_system_calls",
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1067 pure_quantify_start_recording_system_calls, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1068 {"quantify_stop_recording_system_calls",
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1069 pure_quantify_stop_recording_system_calls, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1070 {"quantify_is_recording_system_calls",
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1071 pure_quantify_is_recording_system_calls, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1072 {"quantify_start_recording_system_call",
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1073 pure_quantify_start_recording_system_call, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1074 {"quantify_stop_recording_system_call",
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1075 pure_quantify_stop_recording_system_call, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1076 {"quantify_is_recording_system_call",
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1077 pure_quantify_is_recording_system_call, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1078 {"quantify_start_recording_dynamic_library_data",
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1079 pure_quantify_start_recording_dynamic_library_data, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1080 {"quantify_stop_recording_dynamic_library_data",
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1081 pure_quantify_stop_recording_dynamic_library_data, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1082 {"quantify_is_recording_dynamic_library_data",
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1083 pure_quantify_is_recording_dynamic_library_data, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1084 {"quantify_start_recording_register_window_traps",
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1085 pure_quantify_start_recording_register_window_traps, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1086 {"quantify_stop_recording_register_window_traps",
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1087 pure_quantify_stop_recording_register_window_traps, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1088 {"quantify_is_recording_register_window_traps",
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1089 pure_quantify_is_recording_register_window_traps, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1090 {"quantify_disable_recording_data",
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1091 pure_quantify_disable_recording_data, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1092 {"quantify_clear_data", pure_quantify_clear_data, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1093 {"quantify_save_data", pure_quantify_save_data, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1094 {"quantify_save_data_to_file", pure_quantify_save_data_to_file, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1095 {"quantify_add_annotation", pure_quantify_add_annotation, 1},
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1096 #endif /* QUANTIFY_H */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1097 {NULL, NULL} /* sentinel */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1098 };
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1099
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1100
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1101
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1102 static void
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1103 ins(d, name, val)
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1104 PyObject *d;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1105 char* name;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1106 long val;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1107 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1108 PyObject *v = PyInt_FromLong(val);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1109 if (v) {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1110 (void)PyDict_SetItemString(d, name, v);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1111 Py_DECREF(v);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1112 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1113 }
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1114
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1115
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1116 void
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1117 initpure()
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1118 {
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1119 PyObject *m, *d;
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1120
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1121 m = Py_InitModule("pure", pure_methods);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1122 d = PyModule_GetDict(m);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1123
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1124 /* this is bogus because we should be able to find this information
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1125 * out from the header files. Pure's current versions don't
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1126 * include this information!
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1127 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1128 #ifdef PURE_PURIFY_VERSION
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1129 ins(d, "PURIFY_VERSION", PURE_PURIFY_VERSION);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1130 #else
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1131 PyDict_SetItemString(d, "PURIFY_VERSION", Py_None);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1132 #endif
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1133
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1134 /* these aren't terribly useful because purify_exit() isn't
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1135 * exported correctly. See the note at the top of the file.
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1136 */
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1137 #ifdef PURIFY_EXIT_ERRORS
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1138 ins(d, "PURIFY_EXIT_ERRORS", PURIFY_EXIT_ERRORS);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1139 #endif
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1140 #ifdef PURIFY_EXIT_LEAKS
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1141 ins(d, "PURIFY_EXIT_LEAKS", PURIFY_EXIT_LEAKS);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1142 #endif
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1143 #ifdef PURIFY_EXIT_PLEAKS
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1144 ins(d, "PURIFY_EXIT_PLEAKS", PURIFY_EXIT_PLEAKS);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1145 #endif
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1146
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1147
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1148 #ifdef PURE_QUANTIFY_VERSION
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1149 ins(d, "QUANTIFY_VERSION", PURE_QUANTIFY_VERSION);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1150 #else
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1151 PyDict_SetItemString(d, "QUANTIFY_VERSION", Py_None);
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1152 #endif
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1153 if (PyErr_Occurred())
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1154 Py_FatalError("couldn't initialize the pure module");
994376af9064 (puremodule.c): New module which exports the Purify and Quantify C API
Barry Warsaw <barry@python.org>
parents:
diff changeset
1155 }