home *** CD-ROM | disk | FTP | other *** search
/ Freelog 33 / Freelog033.iso / Progr / Python-2.2.1.exe / PYTHONRUN.H < prev    next >
Encoding:
C/C++ Source or Header  |  2001-08-31  |  4.9 KB  |  138 lines

  1.  
  2. /* Interfaces to parse and execute pieces of python code */
  3.  
  4. #ifndef Py_PYTHONRUN_H
  5. #define Py_PYTHONRUN_H
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9.  
  10. #define PyCF_MASK (CO_GENERATOR_ALLOWED | CO_FUTURE_DIVISION)
  11. #define PyCF_MASK_OBSOLETE (CO_NESTED)
  12.  
  13. typedef struct {
  14.     int cf_flags;  /* bitmask of CO_xxx flags relevant to future */
  15. } PyCompilerFlags;
  16.  
  17. DL_IMPORT(void) Py_SetProgramName(char *);
  18. DL_IMPORT(char *) Py_GetProgramName(void);
  19.  
  20. DL_IMPORT(void) Py_SetPythonHome(char *);
  21. DL_IMPORT(char *) Py_GetPythonHome(void);
  22.  
  23. DL_IMPORT(void) Py_Initialize(void);
  24. DL_IMPORT(void) Py_Finalize(void);
  25. DL_IMPORT(int) Py_IsInitialized(void);
  26. DL_IMPORT(PyThreadState *) Py_NewInterpreter(void);
  27. DL_IMPORT(void) Py_EndInterpreter(PyThreadState *);
  28.  
  29. DL_IMPORT(int) PyRun_AnyFile(FILE *, char *);
  30. DL_IMPORT(int) PyRun_AnyFileEx(FILE *, char *, int);
  31.  
  32. DL_IMPORT(int) PyRun_AnyFileFlags(FILE *, char *, PyCompilerFlags *);
  33. DL_IMPORT(int) PyRun_AnyFileExFlags(FILE *, char *, int, PyCompilerFlags *);
  34.  
  35. DL_IMPORT(int) PyRun_SimpleString(char *);
  36. DL_IMPORT(int) PyRun_SimpleStringFlags(char *, PyCompilerFlags *);
  37. DL_IMPORT(int) PyRun_SimpleFile(FILE *, char *);
  38. DL_IMPORT(int) PyRun_SimpleFileEx(FILE *, char *, int);
  39. DL_IMPORT(int) PyRun_SimpleFileExFlags(FILE *, char *, int, PyCompilerFlags *);
  40. DL_IMPORT(int) PyRun_InteractiveOne(FILE *, char *);
  41. DL_IMPORT(int) PyRun_InteractiveOneFlags(FILE *, char *, PyCompilerFlags *);
  42. DL_IMPORT(int) PyRun_InteractiveLoop(FILE *, char *);
  43. DL_IMPORT(int) PyRun_InteractiveLoopFlags(FILE *, char *, PyCompilerFlags *);
  44.  
  45. DL_IMPORT(struct _node *) PyParser_SimpleParseString(char *, int);
  46. DL_IMPORT(struct _node *) PyParser_SimpleParseFile(FILE *, char *, int);
  47. DL_IMPORT(struct _node *) PyParser_SimpleParseStringFlags(char *, int, int);
  48. DL_IMPORT(struct _node *) PyParser_SimpleParseFileFlags(FILE *, char *,
  49.                             int, int);
  50.  
  51. DL_IMPORT(PyObject *) PyRun_String(char *, int, PyObject *, PyObject *);
  52. DL_IMPORT(PyObject *) PyRun_File(FILE *, char *, int, PyObject *, PyObject *);
  53. DL_IMPORT(PyObject *) PyRun_FileEx(FILE *, char *, int,
  54.                    PyObject *, PyObject *, int);
  55. DL_IMPORT(PyObject *) PyRun_StringFlags(char *, int, PyObject *, PyObject *,
  56.                     PyCompilerFlags *);
  57. DL_IMPORT(PyObject *) PyRun_FileFlags(FILE *, char *, int, PyObject *, 
  58.                       PyObject *, PyCompilerFlags *);
  59. DL_IMPORT(PyObject *) PyRun_FileExFlags(FILE *, char *, int, PyObject *, 
  60.                     PyObject *, int, PyCompilerFlags *);
  61.  
  62. DL_IMPORT(PyObject *) Py_CompileString(char *, char *, int);
  63. DL_IMPORT(PyObject *) Py_CompileStringFlags(char *, char *, int,
  64.                         PyCompilerFlags *);
  65. DL_IMPORT(struct symtable *) Py_SymtableString(char *, char *, int);
  66.  
  67. DL_IMPORT(void) PyErr_Print(void);
  68. DL_IMPORT(void) PyErr_PrintEx(int);
  69. DL_IMPORT(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
  70.  
  71. DL_IMPORT(int) Py_AtExit(void (*func)(void));
  72.  
  73. DL_IMPORT(void) Py_Exit(int);
  74.  
  75. DL_IMPORT(int) Py_FdIsInteractive(FILE *, char *);
  76.  
  77. /* In getpath.c */
  78. DL_IMPORT(char *) Py_GetProgramFullPath(void);
  79. DL_IMPORT(char *) Py_GetPrefix(void);
  80. DL_IMPORT(char *) Py_GetExecPrefix(void);
  81. DL_IMPORT(char *) Py_GetPath(void);
  82.  
  83. /* In their own files */
  84. DL_IMPORT(const char *) Py_GetVersion(void);
  85. DL_IMPORT(const char *) Py_GetPlatform(void);
  86. DL_IMPORT(const char *) Py_GetCopyright(void);
  87. DL_IMPORT(const char *) Py_GetCompiler(void);
  88. DL_IMPORT(const char *) Py_GetBuildInfo(void);
  89.  
  90. /* Internal -- various one-time initializations */
  91. DL_IMPORT(PyObject *) _PyBuiltin_Init(void);
  92. DL_IMPORT(PyObject *) _PySys_Init(void);
  93. DL_IMPORT(void) _PyImport_Init(void);
  94. DL_IMPORT(void) _PyExc_Init(void);
  95.  
  96. /* Various internal finalizers */
  97. DL_IMPORT(void) _PyExc_Fini(void);
  98. DL_IMPORT(void) _PyImport_Fini(void);
  99. DL_IMPORT(void) PyMethod_Fini(void);
  100. DL_IMPORT(void) PyFrame_Fini(void);
  101. DL_IMPORT(void) PyCFunction_Fini(void);
  102. DL_IMPORT(void) PyTuple_Fini(void);
  103. DL_IMPORT(void) PyString_Fini(void);
  104. DL_IMPORT(void) PyInt_Fini(void);
  105. DL_IMPORT(void) PyFloat_Fini(void);
  106. DL_IMPORT(void) PyOS_FiniInterrupts(void);
  107.  
  108. /* Stuff with no proper home (yet) */
  109. DL_IMPORT(char *) PyOS_Readline(char *);
  110. extern DL_IMPORT(int) (*PyOS_InputHook)(void);
  111. extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer)(char *);
  112.  
  113. /* Stack size, in "pointers" (so we get extra safety margins
  114.    on 64-bit platforms).  On a 32-bit platform, this translates
  115.    to a 8k margin. */
  116. #define PYOS_STACK_MARGIN 2048
  117.  
  118. #if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER)
  119. /* Enable stack checking under Microsoft C */
  120. #define USE_STACKCHECK
  121. #endif
  122.  
  123. #ifdef USE_STACKCHECK
  124. /* Check that we aren't overflowing our stack */
  125. DL_IMPORT(int) PyOS_CheckStack(void);
  126. #endif
  127.  
  128. /* Signals */
  129. typedef void (*PyOS_sighandler_t)(int);
  130. DL_IMPORT(PyOS_sighandler_t) PyOS_getsig(int);
  131. DL_IMPORT(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t);
  132.  
  133.  
  134. #ifdef __cplusplus
  135. }
  136. #endif
  137. #endif /* !Py_PYTHONRUN_H */
  138.