Changeset 391 for python/trunk/Doc/c-api/sys.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/c-api/sys.rst
r2 r391 7 7 8 8 9 .. c function:: int Py_FdIsInteractive(FILE *fp, const char *filename)9 .. c:function:: int Py_FdIsInteractive(FILE *fp, const char *filename) 10 10 11 11 Return true (nonzero) if the standard I/O file *fp* with name *filename* is 12 12 deemed interactive. This is the case for files for which ``isatty(fileno(fp))`` 13 is true. If the global flag :c data:`Py_InteractiveFlag` is true, this function13 is true. If the global flag :c:data:`Py_InteractiveFlag` is true, this function 14 14 also returns true if the *filename* pointer is *NULL* or if the name is equal to 15 15 one of the strings ``'<stdin>'`` or ``'???'``. 16 16 17 17 18 .. cfunction:: long PyOS_GetLastModificationTime(char *filename) 19 20 Return the time of last modification of the file *filename*. The result is 21 encoded in the same way as the timestamp returned by the standard C library 22 function :cfunc:`time`. 23 24 25 .. cfunction:: void PyOS_AfterFork() 18 .. c:function:: void PyOS_AfterFork() 26 19 27 20 Function to update some internal state after a process fork; this should be … … 31 24 32 25 33 .. c function:: int PyOS_CheckStack()26 .. c:function:: int PyOS_CheckStack() 34 27 35 28 Return true when the interpreter runs out of stack space. This is a reliable … … 40 33 41 34 42 .. c function:: PyOS_sighandler_t PyOS_getsig(int i)35 .. c:function:: PyOS_sighandler_t PyOS_getsig(int i) 43 36 44 37 Return the current signal handler for signal *i*. This is a thin wrapper around 45 either :c func:`sigaction` or :cfunc:`signal`. Do not call those functions46 directly! :c type:`PyOS_sighandler_t` is a typedef alias for :ctype:`void38 either :c:func:`sigaction` or :c:func:`signal`. Do not call those functions 39 directly! :c:type:`PyOS_sighandler_t` is a typedef alias for :c:type:`void 47 40 (\*)(int)`. 48 41 49 42 50 .. c function:: PyOS_sighandler_t PyOS_setsig(int i, PyOS_sighandler_t h)43 .. c:function:: PyOS_sighandler_t PyOS_setsig(int i, PyOS_sighandler_t h) 51 44 52 45 Set the signal handler for signal *i* to be *h*; return the old signal handler. 53 This is a thin wrapper around either :c func:`sigaction` or :cfunc:`signal`. Do54 not call those functions directly! :c type:`PyOS_sighandler_t` is a typedef55 alias for :c type:`void (\*)(int)`.46 This is a thin wrapper around either :c:func:`sigaction` or :c:func:`signal`. Do 47 not call those functions directly! :c:type:`PyOS_sighandler_t` is a typedef 48 alias for :c:type:`void (\*)(int)`. 56 49 57 50 .. _systemfunctions: … … 64 57 :mod:`sys` module's dict, which is contained in the internal thread state structure. 65 58 66 .. c function:: PyObject *PySys_GetObject(char *name)59 .. c:function:: PyObject *PySys_GetObject(char *name) 67 60 68 61 Return the object *name* from the :mod:`sys` module or *NULL* if it does 69 62 not exist, without setting an exception. 70 63 71 .. c function:: FILE *PySys_GetFile(char *name, FILE *def)64 .. c:function:: FILE *PySys_GetFile(char *name, FILE *def) 72 65 73 Return the :c type:`FILE*` associated with the object *name* in the66 Return the :c:type:`FILE*` associated with the object *name* in the 74 67 :mod:`sys` module, or *def* if *name* is not in the module or is not associated 75 with a :c type:`FILE*`.68 with a :c:type:`FILE*`. 76 69 77 .. c function:: int PySys_SetObject(char *name, PyObject *v)70 .. c:function:: int PySys_SetObject(char *name, PyObject *v) 78 71 79 72 Set *name* in the :mod:`sys` module to *v* unless *v* is *NULL*, in which … … 81 74 on error. 82 75 83 .. c function:: void PySys_ResetWarnOptions()76 .. c:function:: void PySys_ResetWarnOptions() 84 77 85 78 Reset :data:`sys.warnoptions` to an empty list. 86 79 87 .. c function:: void PySys_AddWarnOption(char *s)80 .. c:function:: void PySys_AddWarnOption(char *s) 88 81 89 82 Append *s* to :data:`sys.warnoptions`. 90 83 91 .. c function:: void PySys_SetPath(char *path)84 .. c:function:: void PySys_SetPath(char *path) 92 85 93 86 Set :data:`sys.path` to a list object of paths found in *path* which should … … 95 88 (``:`` on Unix, ``;`` on Windows). 96 89 97 .. c function:: void PySys_WriteStdout(const char *format, ...)90 .. c:function:: void PySys_WriteStdout(const char *format, ...) 98 91 99 92 Write the output string described by *format* to :data:`sys.stdout`. No … … 111 104 is written to the real (C level) *stdout*. 112 105 113 .. c function:: void PySys_WriteStderr(const char *format, ...)106 .. c:function:: void PySys_WriteStderr(const char *format, ...) 114 107 115 108 As above, but write to :data:`sys.stderr` or *stderr* instead. … … 122 115 123 116 124 .. c function:: void Py_FatalError(const char *message)117 .. c:function:: void Py_FatalError(const char *message) 125 118 126 119 .. index:: single: abort() … … 130 123 make it dangerous to continue using the Python interpreter; e.g., when the 131 124 object administration appears to be corrupted. On Unix, the standard C library 132 function :c func:`abort` is called which will attempt to produce a :file:`core`125 function :c:func:`abort` is called which will attempt to produce a :file:`core` 133 126 file. 134 127 135 128 136 .. c function:: void Py_Exit(int status)129 .. c:function:: void Py_Exit(int status) 137 130 138 131 .. index:: … … 140 133 single: exit() 141 134 142 Exit the current process. This calls :c func:`Py_Finalize` and then calls the135 Exit the current process. This calls :c:func:`Py_Finalize` and then calls the 143 136 standard C library function ``exit(status)``. 144 137 145 138 146 .. c function:: int Py_AtExit(void (*func) ())139 .. c:function:: int Py_AtExit(void (*func) ()) 147 140 148 141 .. index:: … … 150 143 single: cleanup functions 151 144 152 Register a cleanup function to be called by :c func:`Py_Finalize`. The cleanup145 Register a cleanup function to be called by :c:func:`Py_Finalize`. The cleanup 153 146 function will be called with no arguments and should return no value. At most 154 147 32 cleanup functions can be registered. When the registration is successful, 155 :c func:`Py_AtExit` returns ``0``; on failure, it returns ``-1``. The cleanup148 :c:func:`Py_AtExit` returns ``0``; on failure, it returns ``-1``. The cleanup 156 149 function registered last is called first. Each cleanup function will be called 157 150 at most once. Since Python's internal finalization will have completed before
Note:
See TracChangeset
for help on using the changeset viewer.