2 * src/pl/plpython/plpy_main.h
8 #include "plpy_procedure.h"
10 /* the interpreter's globals dict */
11 extern PyObject
*PLy_interp_globals
;
14 * A stack of PL/Python execution contexts. Each time user-defined Python code
15 * is called, an execution context is created and put on the stack. After the
16 * Python code returns, the context is destroyed.
18 typedef struct PLyExecutionContext
20 PLyProcedure
*curr_proc
; /* the currently executing procedure */
21 MemoryContext scratch_ctx
; /* a context for things like type I/O */
22 struct PLyExecutionContext
*next
; /* previous stack level */
23 } PLyExecutionContext
;
25 /* Get the current execution context */
26 extern PLyExecutionContext
*PLy_current_execution_context(void);
28 /* Get the scratch memory context for specified execution context */
29 extern MemoryContext
PLy_get_scratch_context(PLyExecutionContext
*context
);
31 #endif /* PLPY_MAIN_H */