[Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.79,1.80

Fred L. Drake python-dev@python.org
Thu, 31 Aug 2000 22:30:03 -0700


Update of /cvsroot/python/python/dist/src/Doc/api
In directory slayer.i.sourceforge.net:/tmp/cvs-serv10464/api

Modified Files:
	api.tex 
Log Message:

Document PyImport_AppendInittab(), PyImport_ExtendInittab(), and
struct _inittab.

This closes SourceForge bug #111499.


Index: api.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -r1.79 -r1.80
*** api.tex	2000/09/01 02:47:25	1.79
--- api.tex	2000/09/01 05:30:00	1.80
***************
*** 1239,1243 ****
  as generated by the \program{freeze}\index{freeze utility} utility
  (see \file{Tools/freeze/} in the Python source distribution).  Its
! definition is:
  
  \begin{verbatim}
--- 1239,1243 ----
  as generated by the \program{freeze}\index{freeze utility} utility
  (see \file{Tools/freeze/} in the Python source distribution).  Its
! definition, found in \file{Include/import.h}, is:
  
  \begin{verbatim}
***************
*** 1257,1260 ****
--- 1257,1298 ----
  dynamically created collection of frozen modules.
  \end{cvardesc}
+ 
+ \begin{cfuncdesc}{int}{PyImport_AppendInittab}{char *name,
+                                                void (*initfunc)(void)}
+ Add a single module to the existing table of built-in modules.  This
+ is a convenience wrapper around \cfunction{PyImport_ExtendInittab()},
+ returning \code{-1} if the table could not be extended.  The new
+ module can be imported by the name \var{name}, and uses the function
+ \var{initfunc} as the initialization function called on the first
+ attempted import.  This should be called before
+ \cfunction{Py_Initialize()}.
+ \end{cfuncdesc}
+ 
+ \begin{ctypedesc}[_inittab]{struct _inittab}
+ Structure describing a single entry in the list of built-in modules.
+ Each of these structures gives the name and initialization function
+ for a module built into the interpreter.  Programs which embed Python
+ may use an array of these structures in conjunction with
+ \cfunction{PyImport_ExtendInittab()} to provide additional built-in
+ modules.  The structure is defined in \file{Include/import.h} as:
+ 
+ \begin{verbatim}
+ struct _inittab {
+     char *name;
+     void (*initfunc)(void);
+ };
+ \end{verbatim}
+ \end{ctypedesc}
+ 
+ \begin{cfuncdesc}{int}{PyImport_ExtendInittab}{struct _inittab *newtab}
+ Add a collection of modules to the table of built-in modules.  The
+ \var{newtab} array must end with a sentinel entry which contains
+ \NULL{} for the \member{name} field; failure to provide the sentinel
+ value can result in a memory fault.  Returns \code{0} on success or
+ \code{-1} if insufficient memory could be allocated to extend the
+ internal table.  In the event of failure, no modules are added to the
+ internal table.  This should be called before
+ \cfunction{Py_Initialize()}.
+ \end{cfuncdesc}