Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f19b9511
Kaydet (Commit)
f19b9511
authored
Ara 02, 2007
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add documentation for PySys_* functions.
Written by Charlie Shepherd for GHOP. Also fixes #1245.
üst
968a3e57
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
2 deletions
+83
-2
ACKS.txt
Doc/ACKS.txt
+1
-0
init.rst
Doc/c-api/init.rst
+0
-2
utilities.rst
Doc/c-api/utilities.rst
+60
-0
refcounts.dat
Doc/data/refcounts.dat
+22
-0
No files found.
Doc/ACKS.txt
Dosyayı görüntüle @
f19b9511
...
...
@@ -160,6 +160,7 @@ docs@python.org), and we'll be glad to correct the problem.
* Barry Scott
* Joakim Sernbrant
* Justin Sheehy
* Charlie Shepherd
* Michael Simcich
* Ionel Simionescu
* Michael Sloan
...
...
Doc/c-api/init.rst
Dosyayı görüntüle @
f19b9511
...
...
@@ -364,8 +364,6 @@ Initialization, Finalization, and Threads
.. % XXX impl. doesn't seem consistent in allowing 0/NULL for the params;
.. % check w/ Guido.
.. % XXX Other PySys thingies (doesn't really belong in this chapter)
.. _threads:
...
...
Doc/c-api/utilities.rst
Dosyayı görüntüle @
f19b9511
...
...
@@ -66,6 +66,66 @@ Operating System Utilities
not call those functions directly! :ctype:`PyOS_sighandler_t` is a typedef
alias for :ctype:`void (\*)(int)`.
.. _systemfunctions:
System Functions
================
These are utility functions that make functionality from the :mod:`sys` module
accessible to C code. They all work with the current interpreter thread's
:mod:`sys` module's dict, which is contained in the internal thread state structure.
.. cfunction:: PyObject *PySys_GetObject(char *name)
Return the object *name* from the :mod:`sys` module or *NULL* if it does
not exist, without setting an exception.
.. cfunction:: FILE *PySys_GetFile(char *name, FILE *def)
Return the :ctype:`FILE*` associated with the object *name* in the
:mod:`sys` module, or *def* if *name* is not in the module or is not associated
with a :ctype:`FILE*`.
.. cfunction:: int PySys_SetObject(char *name, PyObject *v)
Set *name* in the :mod:`sys` module to *v* unless *v* is *NULL*, in which
case *name* is deleted from the sys module. Returns ``0`` on success, ``-1``
on error.
.. cfunction:: void PySys_ResetWarnOptions(void)
Reset :data:`sys.warnoptions` to an empty list.
.. cfunction:: void PySys_AddWarnOption(char *s)
Append *s* to :data:`sys.warnoptions`.
.. cfunction:: void PySys_SetPath(char *path)
Set :data:`sys.path` to a list object of paths found in *path* which should
be a list of paths separated with the platform's search path delimiter
(``:`` on Unix, ``;`` on Windows).
.. cfunction:: void PySys_WriteStdout(const char *format, ...)
Write the output string described by *format* to :data:`sys.stdout`. No
exceptions are raised, even if truncation occurs (see below).
*format* should limit the total size of the formatted output string to
1000 bytes or less -- after 1000 bytes, the output string is truncated.
In particular, this means that no unrestricted "%s" formats should occur;
these should be limited using "%.<N>s" where <N> is a decimal number
calculated so that <N> plus the maximum size of other formatted text does not
exceed 1000 bytes. Also watch out for "%f", which can print hundreds of
digits for very large numbers.
If a problem occurs, or :data:`sys.stdout` is unset, the formatted message
is written to the real (C level) *stdout*.
.. cfunction:: void PySys_WriteStderr(const char *format, ...)
As above, but write to :data:`sys.stderr` or *stderr* instead.
.. _processcontrol:
...
...
Doc/data/refcounts.dat
Dosyayı görüntüle @
f19b9511
...
...
@@ -1251,10 +1251,32 @@ PyString_AsEncodedString:PyObject*:str::
PyString_AsEncodedString:const char*:encoding::
PyString_AsEncodedString:const char*:errors::
PySys_AddWarnOption:void:::
PySys_AddWarnOption:char*:s::
PySys_GetFile:FILE*:::
PySys_GetFile:char*:name::
PySys_GetFile:FILE*:def::
PySys_GetObject:PyObject*::0:
PySys_GetObject:char*:name::
PySys_SetArgv:int:::
PySys_SetArgv:int:argc::
PySys_SetArgv:char**:argv::
PySys_SetObject:int:::
PySys_SetObject:char*:name::
PySys_SetObject:PyObject*:v:+1:
PySys_ResetWarnOptions:void:::
PySys_WriteStdout:void:::
PySys_WriteStdout:char*:format::
PySys_WriteStderr:void:::
PySys_WriteStderr:char*:format::
PyThreadState_Clear:void:::
PyThreadState_Clear:PyThreadState*:tstate::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment