summaryrefslogtreecommitdiff
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-07-19 12:19:27 +0000
committerGuido van Rossum <guido@python.org>2001-07-19 12:19:27 +0000
commit44973ef1a0ebef07a5b8dc404749fdc359bd23ff (patch)
tree33afb67eec53c06ae0311de3ac9957e403348eb9 /Python/pystate.c
parent2e57b73dc76b240231bebee9538f9bd6d4ad6f4b (diff)
downloadcpython-44973ef1a0ebef07a5b8dc404749fdc359bd23ff.tar.gz
Add a low-level API to access interpreters, for David Beazley.
SF patch #436376.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 2f15fdfe94..9a41ccffd4 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -264,3 +264,28 @@ PyThreadState_GetDict(void)
_PyThreadState_Current->dict = PyDict_New();
return _PyThreadState_Current->dict;
}
+
+
+/* Routines for advanced debuggers, requested by David Beazley.
+ Don't use unless you know what you are doing! */
+
+PyInterpreterState *
+PyInterpreterState_Head(void)
+{
+ return interp_head;
+}
+
+PyInterpreterState *
+PyInterpreterState_Next(PyInterpreterState *interp) {
+ return interp->next;
+}
+
+PyThreadState *
+PyInterpreterState_ThreadHead(PyInterpreterState *interp) {
+ return interp->tstate_head;
+}
+
+PyThreadState *
+PyThreadState_Next(PyThreadState *tstate) {
+ return tstate->next;
+}