home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 May / PCWorld_2002-05_cd.bin / Software / TemaCD / activepython / ActivePython-2.1.1.msi / Python21_include_pythonrun.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-26  |  4.5 KB  |  131 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. typedef struct {
  11.     int cf_nested_scopes;
  12. } PyCompilerFlags;
  13.  
  14. DL_IMPORT(void) Py_SetProgramName(char *);
  15. DL_IMPORT(char *) Py_GetProgramName(void);
  16.  
  17. DL_IMPORT(void) Py_SetPythonHome(char *);
  18. DL_IMPORT(char *) Py_GetPythonHome(void);
  19.  
  20. DL_IMPORT(void) Py_Initialize(void);
  21. DL_IMPORT(void) Py_Finalize(void);
  22. DL_IMPORT(int) Py_IsInitialized(void);
  23. DL_IMPORT(PyThreadState *) Py_NewInterpreter(void);
  24. DL_IMPORT(void) Py_EndInterpreter(PyThreadState *);
  25.  
  26. DL_IMPORT(int) PyRun_AnyFile(FILE *, char *);
  27. DL_IMPORT(int) PyRun_AnyFileEx(FILE *, char *, int);
  28.  
  29. DL_IMPORT(int) PyRun_AnyFileFlags(FILE *, char *, PyCompilerFlags *);
  30. DL_IMPORT(int) PyRun_AnyFileExFlags(FILE *, char *, int, PyCompilerFlags *);
  31.  
  32. DL_IMPORT(int) PyRun_SimpleString(char *);
  33. DL_IMPORT(int) PyRun_SimpleFile(FILE *, char *);
  34. DL_IMPORT(int) PyRun_SimpleFileEx(FILE *, char *, int);
  35. DL_IMPORT(int) PyRun_SimpleFileExFlags(FILE *, char *, int, PyCompilerFlags *);
  36. DL_IMPORT(int) PyRun_InteractiveOne(FILE *, char *);
  37. DL_IMPORT(int) PyRun_InteractiveOneFlags(FILE *, char *, PyCompilerFlags *);
  38. DL_IMPORT(int) PyRun_InteractiveLoop(FILE *, char *);
  39. DL_IMPORT(int) PyRun_InteractiveLoopFlags(FILE *, char *, PyCompilerFlags *);
  40.  
  41. DL_IMPORT(struct _node *) PyParser_SimpleParseString(char *, int);
  42. DL_IMPORT(struct _node *) PyParser_SimpleParseFile(FILE *, char *, int);
  43.  
  44. DL_IMPORT(PyObject *) PyRun_String(char *, int, PyObject *, PyObject *);
  45. DL_IMPORT(PyObject *) PyRun_File(FILE *, char *, int, PyObject *, PyObject *);
  46. DL_IMPORT(PyObject *) PyRun_FileEx(FILE *, char *, int,
  47.                    PyObject *, PyObject *, int);
  48. DL_IMPORT(PyObject *) PyRun_StringFlags(char *, int, PyObject *, PyObject *,
  49.                     PyCompilerFlags *);
  50. DL_IMPORT(PyObject *) PyRun_FileFlags(FILE *, char *, int, PyObject *, 
  51.                       PyObject *, PyCompilerFlags *);
  52. DL_IMPORT(PyObject *) PyRun_FileExFlags(FILE *, char *, int, PyObject *, 
  53.                     PyObject *, int, PyCompilerFlags *);
  54.  
  55. DL_IMPORT(PyObject *) Py_CompileString(char *, char *, int);
  56. DL_IMPORT(PyObject *) Py_CompileStringFlags(char *, char *, int,
  57.                         PyCompilerFlags *);
  58. DL_IMPORT(struct symtable *) Py_SymtableString(char *, char *, int);
  59.  
  60. DL_IMPORT(void) PyErr_Print(void);
  61. DL_IMPORT(void) PyErr_PrintEx(int);
  62. DL_IMPORT(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
  63.  
  64. DL_IMPORT(int) Py_AtExit(void (*func)(void));
  65.  
  66. DL_IMPORT(void) Py_Exit(int);
  67.  
  68. DL_IMPORT(int) Py_FdIsInteractive(FILE *, char *);
  69.  
  70. /* In getpath.c */
  71. DL_IMPORT(char *) Py_GetProgramFullPath(void);
  72. DL_IMPORT(char *) Py_GetPrefix(void);
  73. DL_IMPORT(char *) Py_GetExecPrefix(void);
  74. DL_IMPORT(char *) Py_GetPath(void);
  75.  
  76. /* In their own files */
  77. DL_IMPORT(const char *) Py_GetVersion(void);
  78. DL_IMPORT(const char *) Py_GetPlatform(void);
  79. DL_IMPORT(const char *) Py_GetCopyright(void);
  80. DL_IMPORT(const char *) Py_GetCompiler(void);
  81. DL_IMPORT(const char *) Py_GetBuildInfo(void);
  82.  
  83. /* Internal -- various one-time initializations */
  84. DL_IMPORT(PyObject *) _PyBuiltin_Init(void);
  85. DL_IMPORT(PyObject *) _PySys_Init(void);
  86. DL_IMPORT(void) _PyImport_Init(void);
  87. DL_IMPORT(void) init_exceptions(void);
  88.  
  89. /* Various internal finalizers */
  90. DL_IMPORT(void) fini_exceptions(void);
  91. DL_IMPORT(void) _PyImport_Fini(void);
  92. DL_IMPORT(void) PyMethod_Fini(void);
  93. DL_IMPORT(void) PyFrame_Fini(void);
  94. DL_IMPORT(void) PyCFunction_Fini(void);
  95. DL_IMPORT(void) PyTuple_Fini(void);
  96. DL_IMPORT(void) PyString_Fini(void);
  97. DL_IMPORT(void) PyInt_Fini(void);
  98. DL_IMPORT(void) PyFloat_Fini(void);
  99. DL_IMPORT(void) PyOS_FiniInterrupts(void);
  100.  
  101. /* Stuff with no proper home (yet) */
  102. DL_IMPORT(char *) PyOS_Readline(char *);
  103. extern DL_IMPORT(int) (*PyOS_InputHook)(void);
  104. extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer)(char *);
  105.  
  106. /* Stack size, in "pointers" (so we get extra safety margins
  107.    on 64-bit platforms).  On a 32-bit platform, this translates
  108.    to a 8k margin. */
  109. #define PYOS_STACK_MARGIN 2048
  110.  
  111. #if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER)
  112. /* Enable stack checking under Microsoft C */
  113. #define USE_STACKCHECK
  114. #endif
  115.  
  116. #ifdef USE_STACKCHECK
  117. /* Check that we aren't overflowing our stack */
  118. DL_IMPORT(int) PyOS_CheckStack(void);
  119. #endif
  120.  
  121. /* Signals */
  122. typedef void (*PyOS_sighandler_t)(int);
  123. DL_IMPORT(PyOS_sighandler_t) PyOS_getsig(int);
  124. DL_IMPORT(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t);
  125.  
  126.  
  127. #ifdef __cplusplus
  128. }
  129. #endif
  130. #endif /* !Py_PYTHONRUN_H */
  131.