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