GNU Info

Info Node: (python2.1-api.info)Include Files

(python2.1-api.info)Include Files


Next: Objects Prev: Introduction Up: Introduction
Enter node , (file) or (file)node

Include Files
=============

All function, type and macro definitions needed to use the Python/C API
are included in your code by the following line:

     #include "Python.h"

This implies inclusion of the following standard headers: `<stdio.h>',
`<string.h>', `<errno.h>', `<limits.h>', and `<stdlib.h>' (if
available).

All user visible names defined by Python.h (except those defined by the
included standard headers) have one of the prefixes `Py' or `_Py'.
Names beginning with `_Py' are for internal use by the Python
implementation and should not be used by extension writers.  Structure
member names do not have a reserved prefix.

*Important:* user code should never define names that begin with `Py'
or `_Py'.  This confuses the reader, and jeopardizes the portability of
the user code to future Python versions, which may define additional
names beginning with one of these prefixes.

The header files are typically installed with Python.  On UNIX, these
are located in the directories ``prefix'/include/pythonVERSION/' and
``exec_prefix'/include/pythonVERSION/', where `prefix' and
`exec_prefix' are defined by the corresponding parameters to Python's
`configure' script and VERSION is `sys.version[:3]'.  On Windows, the
headers are installed in ``prefix'/include', where `prefix' is the
installation directory specified to the installer.

To include the headers, place both directories (if different) on your
compiler's search path for includes.  Do _not_ place the parent
directories on the search path and then use `#include
<python2.1/Python.h>'; this will break on multi-platform builds since
the platform independent headers under `prefix' include the platform
specific headers from `exec_prefix'.

C++ users should note that though the API is defined entirely using C,
the header files do properly declare the entry points to be `extern
"C"', so there is no need to do anything special to use the API from
C++.


automatically generated by info2www version 1.2.2.9