Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

py.h File Reference


Detailed Description

Include file for Python extension modules using the Python sobject extension.

This file must be included by a Python extension module wishing to use the sobject-module's C API. Before this file is included, the preprocessor symbol MODULE_NAME must be defined to a unique name identifying the module using the sobject-module C API. MODULE_NAME must expand to a valid C identifier.

The MODULE_NAME is used to construct a global variable name for the sobject-module C API's export table (a table holding pointers to exported variables and functions). Since multiple extension modules might use the sobject-module C API, different global symbol names must be used for every extension module to prevent a name clash.

Before the API can be used, the extension macro has to do the following:

The initialization function sobj_py_import() takes no arguments and returns an integer. On success, the value 0 is returned. In case of an initialization error, the value -1 is returned.

Go to the source code of this file.

Type Objects

#define SOBJ_PY_SObjectType   ((PyTypeObject *)SOBJ_PY_SYM(SObjectType))
 The type object for simple objects.
#define SOBJ_PY_ClassEnvType   ((PyTypeObject *)SOBJ_PY_SYM(ClassEnvType))
 The type object for class environment objects.
#define SOBJ_PY_EnvType   ((PyTypeObject *)SOBJ_PY_SYM(EnvType))
 The type objects for environment objects.

API Function Types

These function types are used by the Python module API.

typedef PyObject * sobj_py_wrap__fntype (struct sobj *sobj)
 Function type for the sobj_py_wrap() function.
typedef sobjsobj_py_unwrap__fntype (PyObject *pyobj)
 Function type for the sobj_py_unwrap() function.
typedef int sobj_py_Check__fntype (PyObject *pyobj)
 Function type for the type check functions.
typedef sobjsobj_py_PyObject_to_sobj__fntype (PyObject *pyobj, const char *cn)
 Function type for the sobj_py_PyObject_to_sobj() function.

Defines

#define sobj_py_wrap   ((sobj_py_wrap__fntype *)SOBJ_PY_SYM(wrap))
 Wrap a simple object into a Python object.
#define sobj_py_unwrap   ((sobj_py_unwrap__fntype *)SOBJ_PY_SYM(unwrap))
 Unwrap a simple object from a Python object.
#define sobj_py_PyObject_to_sobj   ((sobj_py_PyObject_to_sobj__fntype *)SOBJ_PY_SYM(PyObject_to_sobj))
 Convert a Python object to a simple object.
#define sobj_py_SObject_Check   ((sobj_py_Check__fntype *)SOBJ_PY_SYM(SObject_Check))
 Check if a Python object is an instance of a simple object.
#define sobj_py_ClassEnv_Check   ((sobj_py_Check__fntype *)SOBJ_PY_SYM(ClassEnv_Check))
 Check if a Python object is an instance of a simple object class environment.
#define sobj_py_Env_Check   ((sobj_py_Check__fntype *)SOBJ_PY_SYM(Env_Check))
 Check if a Python object is an instance of a simple object environment.
#define sobj_py_SObject_CheckExact   ((sobj_py_Check__fntype *)SOBJ_PY_SYM(SObject_CheckExact))
 Check if a Python object is an exact instance of a simple object.
#define sobj_py_ClassEnv_CheckExact   ((sobj_py_Check__fntype *)SOBJ_PY_SYM(ClassEnv_CheckExact))
 Check if a Python object is an exact instance of a simple object class environment.
#define sobj_py_Env_CheckExact   ((sobj_py_Check__fntype *)SOBJ_PY_SYM(Env_CheckExact))
 Check if a Python object is an exact instance of a simple object environment.


Generated on Sat Jul 23 16:04:40 2005 for sobject by  doxygen 1.3.9.1