Header And Logo

PostgreSQL
| The world's most advanced open source database.

plpy_main.h

Go to the documentation of this file.
00001 /*
00002  * src/pl/plpython/plpy_main.h
00003  */
00004 
00005 #ifndef PLPY_MAIN_H
00006 #define PLPY_MAIN_H
00007 
00008 #include "plpy_procedure.h"
00009 
00010 /* the interpreter's globals dict */
00011 extern PyObject *PLy_interp_globals;
00012 
00013 /*
00014  * A stack of PL/Python execution contexts. Each time user-defined Python code
00015  * is called, an execution context is created and put on the stack. After the
00016  * Python code returns, the context is destroyed.
00017  */
00018 typedef struct PLyExecutionContext
00019 {
00020     PLyProcedure *curr_proc;    /* the currently executing procedure */
00021     MemoryContext scratch_ctx;  /* a context for things like type I/O */
00022     struct PLyExecutionContext *next;   /* previous stack level */
00023 } PLyExecutionContext;
00024 
00025 /* Get the current execution context */
00026 extern PLyExecutionContext *PLy_current_execution_context(void);
00027 
00028 #endif   /* PLPY_MAIN_H */