Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 24e6219

Browse files
committed
Add documentation for Py_Main() and PyThreadState_GetDict().
1 parent fc43d00 commit 24e6219

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Doc/api/api.tex

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,19 @@ \chapter{The Very High Level Layer \label{veryhigh}}
609609
to these functions if it is certain that they were created by the same
610610
library that the Python runtime is using.
611611

612+
\begin{cfuncdesc}{int}{Py_Main}{int argc, char **argv}
613+
The main program for the standard interpreter. This is made
614+
available for programs which embed Python. The \var{argc} and
615+
\var{argv} parameters should be prepared exactly as those which are
616+
passed to a C program's \cfunction{main()} function. It is
617+
important to note that the argument list may be modified (but the
618+
contents of the strings pointed to by the argument list are not).
619+
The return value will be the integer passed to the
620+
\function{sys.exit()} function, \code{1} if the interpreter exits
621+
due to an exception, or \code{2} if the parameter list does not
622+
represent a valid Python command line.
623+
\end{cfuncdesc}
624+
612625
\begin{cfuncdesc}{int}{PyRun_AnyFile}{FILE *fp, char *filename}
613626
If \var{fp} refers to a file associated with an interactive device
614627
(console or terminal input or \UNIX{} pseudo-terminal), return the
@@ -4631,6 +4644,14 @@ \section{Thread State and the Global Interpreter Lock
46314644
must be held.
46324645
\end{cfuncdesc}
46334646

4647+
\begin{cfuncdesc}{PyObject*}{PyThreadState_GetDict}{}
4648+
Return a dictionary in which extensions can store thread-specific
4649+
state information. Each extension should use a unique key to use to
4650+
store state in the dictionary. If this function returns \NULL, an
4651+
exception has been raised and the caller should allow it to
4652+
propogate.
4653+
\end{cfuncdesc}
4654+
46344655

46354656
\chapter{Memory Management \label{memory}}
46364657
\sectionauthor{Vladimir Marangozov}{[email protected]}

0 commit comments

Comments
 (0)