]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add a low-level API to access interpreters, for David Beazley.
authorGuido van Rossum <guido@python.org>
Thu, 19 Jul 2001 12:19:27 +0000 (12:19 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 19 Jul 2001 12:19:27 +0000 (12:19 +0000)
SF patch #436376.

Include/pystate.h
Python/pystate.c

index 41024e84bdd0f7c7dfa4d283dc1fff6ddf057345..712e9dc2b56d53da0be8cfdff6fe8fc8580285b7 100644 (file)
@@ -100,6 +100,13 @@ extern DL_IMPORT(PyThreadState *) _PyThreadState_Current;
 #define PyThreadState_GET() (_PyThreadState_Current)
 #endif
 
+/* Routines for advanced debuggers, requested by David Beazley.
+   Don't use unless you know what you are doing! */
+DL_IMPORT(PyInterpreterState *) PyInterpreterState_Head(void);
+DL_IMPORT(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *);
+DL_IMPORT(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *);
+DL_IMPORT(PyThreadState *) PyThreadState_Next(PyThreadState *);
+
 #ifdef __cplusplus
 }
 #endif
index 2f15fdfe94efe5aa4b62837f35ad8ebc7d8095c4..9a41ccffd462574a15fd4050d5120d036aa4a2fd 100644 (file)
@@ -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;
+}