greenlet-excstate / greenlet.h

/* vim:set noet ts=8 sw=8 : */

/* Greenlet object interface */

#ifdef __cplusplus
extern "C" {

#include <Python.h>

typedef struct _greenlet {
	char* stack_start;
	char* stack_stop;
	char* stack_copy;
	long stack_saved;
	struct _greenlet* stack_prev;
	struct _greenlet* parent;
	PyObject* run_info;
	struct _frame* top_frame;
	int recursion_depth;
	PyObject* weakreflist;
} PyGreenlet;

static PyTypeObject PyGreen_Type;

#define PyGreen_Check(op)      PyObject_TypeCheck(op, &PyGreen_Type)
#define PyGreen_STARTED(op)    (((PyGreenlet*)(op))->stack_stop != NULL)
#define PyGreen_ACTIVE(op)     (((PyGreenlet*)(op))->stack_start != NULL)
#define PyGreen_GET_PARENT(op) (((PyGreenlet*)(op))->parent)

PyObject* PyGreen_New(PyObject* run, PyObject* parent);
PyObject* PyGreen_Current(void);
PyObject* PyGreen_Switch(PyObject* g, PyObject* args);  /* g.switch(*args) */
int PyGreen_SetParent(PyObject* g, PyObject* nparent);  /* g.parent = ... */

#ifdef __cplusplus
#endif /* !Py_GREENLETOBJECT_H */
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.