Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e0d9a83b
Commit
e0d9a83b
authored
Sep 01, 2000
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document PyImport_AppendInittab(), PyImport_ExtendInittab(), and
struct _inittab. This closes SourceForge bug #111499.
parent
045946d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
1 deletion
+39
-1
Doc/api/api.tex
Doc/api/api.tex
+39
-1
No files found.
Doc/api/api.tex
View file @
e0d9a83b
...
...
@@ -1238,7 +1238,7 @@ already imported.)
This is the structure type definition for frozen module descriptors,
as generated by the
\program
{
freeze
}
\index
{
freeze utility
}
utility
(see
\file
{
Tools/freeze/
}
in the Python source distribution). Its
definition is:
definition
, found in
\file
{
Include/import.h
}
,
is:
\begin{verbatim}
struct
_
frozen
{
...
...
@@ -1257,6 +1257,44 @@ this table. Third-party code could play tricks with this to provide a
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}
\chapter
{
Abstract Objects Layer
\label
{
abstract
}}
...
...
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