ANSI-fication and Py_PROTO extermination.

This commit is contained in:
Fred Drake 2000-07-09 00:55:06 +00:00
parent ea9cb5aebf
commit 3cf4d2b3ea
10 changed files with 166 additions and 173 deletions

View file

@ -1,9 +1,3 @@
#ifndef Py_MODULEOBJECT_H
#define Py_MODULEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************** /***********************************************************
Copyright (c) 2000, BeOpen.com. Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives. Copyright (c) 1995-2000, Corporation for National Research Initiatives.
@ -16,15 +10,21 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Module object interface */ /* Module object interface */
#ifndef Py_MODULEOBJECT_H
#define Py_MODULEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
extern DL_IMPORT(PyTypeObject) PyModule_Type; extern DL_IMPORT(PyTypeObject) PyModule_Type;
#define PyModule_Check(op) ((op)->ob_type == &PyModule_Type) #define PyModule_Check(op) ((op)->ob_type == &PyModule_Type)
extern DL_IMPORT(PyObject *) PyModule_New Py_PROTO((char *)); extern DL_IMPORT(PyObject *) PyModule_New(char *);
extern DL_IMPORT(PyObject *) PyModule_GetDict Py_PROTO((PyObject *)); extern DL_IMPORT(PyObject *) PyModule_GetDict(PyObject *);
extern DL_IMPORT(char *) PyModule_GetName Py_PROTO((PyObject *)); extern DL_IMPORT(char *) PyModule_GetName(PyObject *);
extern DL_IMPORT(char *) PyModule_GetFilename Py_PROTO((PyObject *)); extern DL_IMPORT(char *) PyModule_GetFilename(PyObject *);
extern DL_IMPORT(void) _PyModule_Clear Py_PROTO((PyObject *)); extern DL_IMPORT(void) _PyModule_Clear(PyObject *);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -1,9 +1,3 @@
#ifndef Py_OBJIMPL_H
#define Py_OBJIMPL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************** /***********************************************************
Copyright (c) 2000, BeOpen.com. Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives. Copyright (c) 1995-2000, Corporation for National Research Initiatives.
@ -14,6 +8,12 @@ See the file "Misc/COPYRIGHT" for information on usage and
redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
******************************************************************/ ******************************************************************/
#ifndef Py_OBJIMPL_H
#define Py_OBJIMPL_H
#ifdef __cplusplus
extern "C" {
#endif
#include "mymalloc.h" #include "mymalloc.h"
/* /*
@ -137,9 +137,9 @@ extern void PyCore_OBJECT_FREE_FUNC PyCore_OBJECT_FREE_PROTO;
as Python. These wrappers *do not* make sure that allocating 0 as Python. These wrappers *do not* make sure that allocating 0
bytes returns a non-NULL pointer. Returned pointers must be checked bytes returns a non-NULL pointer. Returned pointers must be checked
for NULL explicitly; no action is performed on failure. */ for NULL explicitly; no action is performed on failure. */
extern DL_IMPORT(ANY *) PyObject_Malloc Py_PROTO((size_t)); extern DL_IMPORT(ANY *) PyObject_Malloc(size_t);
extern DL_IMPORT(ANY *) PyObject_Realloc Py_PROTO((ANY *, size_t)); extern DL_IMPORT(ANY *) PyObject_Realloc(ANY *, size_t);
extern DL_IMPORT(void) PyObject_Free Py_PROTO((ANY *)); extern DL_IMPORT(void) PyObject_Free(ANY *);
/* Macros */ /* Macros */
#define PyObject_MALLOC(n) PyCore_OBJECT_MALLOC(n) #define PyObject_MALLOC(n) PyCore_OBJECT_MALLOC(n)
@ -152,11 +152,12 @@ extern DL_IMPORT(void) PyObject_Free Py_PROTO((ANY *));
*/ */
/* Functions */ /* Functions */
extern DL_IMPORT(PyObject *) PyObject_Init Py_PROTO((PyObject *, PyTypeObject *)); extern DL_IMPORT(PyObject *) PyObject_Init(PyObject *, PyTypeObject *);
extern DL_IMPORT(PyVarObject *) PyObject_InitVar Py_PROTO((PyVarObject *, PyTypeObject *, int)); extern DL_IMPORT(PyVarObject *) PyObject_InitVar(PyVarObject *,
extern DL_IMPORT(PyObject *) _PyObject_New Py_PROTO((PyTypeObject *)); PyTypeObject *, int);
extern DL_IMPORT(PyVarObject *) _PyObject_NewVar Py_PROTO((PyTypeObject *, int)); extern DL_IMPORT(PyObject *) _PyObject_New(PyTypeObject *);
extern DL_IMPORT(void) _PyObject_Del Py_PROTO((PyObject *)); extern DL_IMPORT(PyVarObject *) _PyObject_NewVar(PyTypeObject *, int);
extern DL_IMPORT(void) _PyObject_Del(PyObject *);
#define PyObject_New(type, typeobj) \ #define PyObject_New(type, typeobj) \
( (type *) _PyObject_New(typeobj) ) ( (type *) _PyObject_New(typeobj) )
@ -240,10 +241,10 @@ extern DL_IMPORT(void) _PyObject_Del Py_PROTO((PyObject *));
#else #else
/* Add the object into the container set */ /* Add the object into the container set */
extern DL_IMPORT(void) _PyGC_Insert Py_PROTO((PyObject *)); extern DL_IMPORT(void) _PyGC_Insert(PyObject *);
/* Remove the object from the container set */ /* Remove the object from the container set */
extern DL_IMPORT(void) _PyGC_Remove Py_PROTO((PyObject *)); extern DL_IMPORT(void) _PyGC_Remove(PyObject *);
#define PyObject_GC_Init(op) _PyGC_Insert((PyObject *)op) #define PyObject_GC_Init(op) _PyGC_Insert((PyObject *)op)
#define PyObject_GC_Fini(op) _PyGC_Remove((PyObject *)op) #define PyObject_GC_Fini(op) _PyGC_Remove((PyObject *)op)

View file

@ -1,9 +1,3 @@
#ifndef Py_PYTHONRUN_H
#define Py_PYTHONRUN_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************** /***********************************************************
Copyright (c) 2000, BeOpen.com. Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives. Copyright (c) 1995-2000, Corporation for National Research Initiatives.
@ -16,77 +10,83 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Interfaces to parse and execute pieces of python code */ /* Interfaces to parse and execute pieces of python code */
DL_IMPORT(void) Py_SetProgramName Py_PROTO((char *)); #ifndef Py_PYTHONRUN_H
DL_IMPORT(char *) Py_GetProgramName Py_PROTO((void)); #define Py_PYTHONRUN_H
#ifdef __cplusplus
extern "C" {
#endif
DL_IMPORT(void) Py_SetPythonHome Py_PROTO((char *)); DL_IMPORT(void) Py_SetProgramName(char *);
DL_IMPORT(char *) Py_GetPythonHome Py_PROTO((void)); DL_IMPORT(char *) Py_GetProgramName(void);
DL_IMPORT(void) Py_Initialize Py_PROTO((void)); DL_IMPORT(void) Py_SetPythonHome(char *);
DL_IMPORT(void) Py_Finalize Py_PROTO((void)); DL_IMPORT(char *) Py_GetPythonHome(void);
DL_IMPORT(int) Py_IsInitialized Py_PROTO((void));
DL_IMPORT(PyThreadState *) Py_NewInterpreter Py_PROTO((void));
DL_IMPORT(void) Py_EndInterpreter Py_PROTO((PyThreadState *));
DL_IMPORT(int) PyRun_AnyFile Py_PROTO((FILE *, char *)); DL_IMPORT(void) Py_Initialize(void);
DL_IMPORT(void) Py_Finalize(void);
DL_IMPORT(int) Py_IsInitialized(void);
DL_IMPORT(PyThreadState *) Py_NewInterpreter(void);
DL_IMPORT(void) Py_EndInterpreter(PyThreadState *);
DL_IMPORT(int) PyRun_SimpleString Py_PROTO((char *)); DL_IMPORT(int) PyRun_AnyFile(FILE *, char *);
DL_IMPORT(int) PyRun_SimpleFile Py_PROTO((FILE *, char *));
DL_IMPORT(int) PyRun_InteractiveOne Py_PROTO((FILE *, char *));
DL_IMPORT(int) PyRun_InteractiveLoop Py_PROTO((FILE *, char *));
DL_IMPORT(struct _node *) PyParser_SimpleParseString Py_PROTO((char *, int)); DL_IMPORT(int) PyRun_SimpleString(char *);
DL_IMPORT(struct _node *) PyParser_SimpleParseFile Py_PROTO((FILE *, char *, int)); DL_IMPORT(int) PyRun_SimpleFile(FILE *, char *);
DL_IMPORT(int) PyRun_InteractiveOne(FILE *, char *);
DL_IMPORT(int) PyRun_InteractiveLoop(FILE *, char *);
DL_IMPORT(PyObject *) PyRun_String Py_PROTO((char *, int, PyObject *, PyObject *)); DL_IMPORT(struct _node *) PyParser_SimpleParseString(char *, int);
DL_IMPORT(PyObject *) PyRun_File Py_PROTO((FILE *, char *, int, PyObject *, PyObject *)); DL_IMPORT(struct _node *) PyParser_SimpleParseFile(FILE *, char *, int);
DL_IMPORT(PyObject *) Py_CompileString Py_PROTO((char *, char *, int)); DL_IMPORT(PyObject *) PyRun_String(char *, int, PyObject *, PyObject *);
DL_IMPORT(PyObject *) PyRun_File(FILE *, char *, int, PyObject *, PyObject *);
DL_IMPORT(void) PyErr_Print Py_PROTO((void)); DL_IMPORT(PyObject *) Py_CompileString(char *, char *, int);
DL_IMPORT(void) PyErr_PrintEx Py_PROTO((int));
DL_IMPORT(int) Py_AtExit Py_PROTO((void (*func) Py_PROTO((void)))); DL_IMPORT(void) PyErr_Print(void);
DL_IMPORT(void) PyErr_PrintEx(int);
DL_IMPORT(void) Py_Exit Py_PROTO((int)); DL_IMPORT(int) Py_AtExit(void (*func)(void));
DL_IMPORT(int) Py_FdIsInteractive Py_PROTO((FILE *, char *)); DL_IMPORT(void) Py_Exit(int);
DL_IMPORT(int) Py_FdIsInteractive(FILE *, char *);
/* In getpath.c */ /* In getpath.c */
DL_IMPORT(char *) Py_GetProgramFullPath Py_PROTO((void)); DL_IMPORT(char *) Py_GetProgramFullPath(void);
DL_IMPORT(char *) Py_GetPrefix Py_PROTO((void)); DL_IMPORT(char *) Py_GetPrefix(void);
DL_IMPORT(char *) Py_GetExecPrefix Py_PROTO((void)); DL_IMPORT(char *) Py_GetExecPrefix(void);
DL_IMPORT(char *) Py_GetPath Py_PROTO((void)); DL_IMPORT(char *) Py_GetPath(void);
/* In their own files */ /* In their own files */
DL_IMPORT(const char *) Py_GetVersion Py_PROTO((void)); DL_IMPORT(const char *) Py_GetVersion(void);
DL_IMPORT(const char *) Py_GetPlatform Py_PROTO((void)); DL_IMPORT(const char *) Py_GetPlatform(void);
DL_IMPORT(const char *) Py_GetCopyright Py_PROTO((void)); DL_IMPORT(const char *) Py_GetCopyright(void);
DL_IMPORT(const char *) Py_GetCompiler Py_PROTO((void)); DL_IMPORT(const char *) Py_GetCompiler(void);
DL_IMPORT(const char *) Py_GetBuildInfo Py_PROTO((void)); DL_IMPORT(const char *) Py_GetBuildInfo(void);
/* Internal -- various one-time initializations */ /* Internal -- various one-time initializations */
DL_IMPORT(PyObject *) _PyBuiltin_Init Py_PROTO((void)); DL_IMPORT(PyObject *) _PyBuiltin_Init(void);
DL_IMPORT(PyObject *) _PySys_Init Py_PROTO((void)); DL_IMPORT(PyObject *) _PySys_Init(void);
DL_IMPORT(void) _PyImport_Init Py_PROTO((void)); DL_IMPORT(void) _PyImport_Init(void);
DL_IMPORT(void) init_exceptions Py_PROTO((void)); DL_IMPORT(void) init_exceptions(void);
/* Various internal finalizers */ /* Various internal finalizers */
DL_IMPORT(void) fini_exceptions Py_PROTO((void)); DL_IMPORT(void) fini_exceptions(void);
DL_IMPORT(void) _PyImport_Fini Py_PROTO((void)); DL_IMPORT(void) _PyImport_Fini(void);
DL_IMPORT(void) PyMethod_Fini Py_PROTO((void)); DL_IMPORT(void) PyMethod_Fini(void);
DL_IMPORT(void) PyFrame_Fini Py_PROTO((void)); DL_IMPORT(void) PyFrame_Fini(void);
DL_IMPORT(void) PyCFunction_Fini Py_PROTO((void)); DL_IMPORT(void) PyCFunction_Fini(void);
DL_IMPORT(void) PyTuple_Fini Py_PROTO((void)); DL_IMPORT(void) PyTuple_Fini(void);
DL_IMPORT(void) PyString_Fini Py_PROTO((void)); DL_IMPORT(void) PyString_Fini(void);
DL_IMPORT(void) PyInt_Fini Py_PROTO((void)); DL_IMPORT(void) PyInt_Fini(void);
DL_IMPORT(void) PyFloat_Fini Py_PROTO((void)); DL_IMPORT(void) PyFloat_Fini(void);
DL_IMPORT(void) PyOS_FiniInterrupts Py_PROTO((void)); DL_IMPORT(void) PyOS_FiniInterrupts(void);
/* Stuff with no proper home (yet) */ /* Stuff with no proper home (yet) */
DL_IMPORT(char *) PyOS_Readline Py_PROTO((char *)); DL_IMPORT(char *) PyOS_Readline(char *);
extern DL_IMPORT(int) (*PyOS_InputHook) Py_PROTO((void)); extern DL_IMPORT(int) (*PyOS_InputHook)(void);
extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer) Py_PROTO((char *)); extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer)(char *);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -1,6 +1,3 @@
#ifndef Py_PYTHREAD_H
#define Py_PYTHREAD_H
/*********************************************************** /***********************************************************
Copyright (c) 2000, BeOpen.com. Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives. Copyright (c) 1995-2000, Corporation for National Research Initiatives.
@ -11,17 +8,12 @@ See the file "Misc/COPYRIGHT" for information on usage and
redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
******************************************************************/ ******************************************************************/
#ifndef Py_PYTHREAD_H
#define Py_PYTHREAD_H
#define NO_EXIT_PROG /* don't define PyThread_exit_prog() */ #define NO_EXIT_PROG /* don't define PyThread_exit_prog() */
/* (the result is no use of signals on SGI) */ /* (the result is no use of signals on SGI) */
#ifndef Py_PROTO
#if defined(__STDC__) || defined(__cplusplus)
#define Py_PROTO(args) args
#else
#define Py_PROTO(args) ()
#endif
#endif
typedef void *PyThread_type_lock; typedef void *PyThread_type_lock;
typedef void *PyThread_type_sema; typedef void *PyThread_type_sema;
@ -29,35 +21,35 @@ typedef void *PyThread_type_sema;
extern "C" { extern "C" {
#endif #endif
DL_IMPORT(void) PyThread_init_thread Py_PROTO((void)); DL_IMPORT(void) PyThread_init_thread(void);
DL_IMPORT(int) PyThread_start_new_thread Py_PROTO((void (*)(void *), void *)); DL_IMPORT(int) PyThread_start_new_thread(void (*)(void *), void *);
DL_IMPORT(void) PyThread_exit_thread Py_PROTO((void)); DL_IMPORT(void) PyThread_exit_thread(void);
DL_IMPORT(void) PyThread__PyThread_exit_thread Py_PROTO((void)); DL_IMPORT(void) PyThread__PyThread_exit_thread(void);
DL_IMPORT(long) PyThread_get_thread_ident Py_PROTO((void)); DL_IMPORT(long) PyThread_get_thread_ident(void);
DL_IMPORT(PyThread_type_lock) PyThread_allocate_lock Py_PROTO((void)); DL_IMPORT(PyThread_type_lock) PyThread_allocate_lock(void);
DL_IMPORT(void) PyThread_free_lock Py_PROTO((PyThread_type_lock)); DL_IMPORT(void) PyThread_free_lock(PyThread_type_lock);
DL_IMPORT(int) PyThread_acquire_lock Py_PROTO((PyThread_type_lock, int)); DL_IMPORT(int) PyThread_acquire_lock(PyThread_type_lock, int);
#define WAIT_LOCK 1 #define WAIT_LOCK 1
#define NOWAIT_LOCK 0 #define NOWAIT_LOCK 0
DL_IMPORT(void) PyThread_release_lock Py_PROTO((PyThread_type_lock)); DL_IMPORT(void) PyThread_release_lock(PyThread_type_lock);
DL_IMPORT(PyThread_type_sema) PyThread_allocate_sema Py_PROTO((int)); DL_IMPORT(PyThread_type_sema) PyThread_allocate_sema(int);
DL_IMPORT(void) PyThread_free_sema Py_PROTO((PyThread_type_sema)); DL_IMPORT(void) PyThread_free_sema(PyThread_type_sema);
DL_IMPORT(int) PyThread_down_sema Py_PROTO((PyThread_type_sema, int)); DL_IMPORT(int) PyThread_down_sema(PyThread_type_sema, int);
#define WAIT_SEMA 1 #define WAIT_SEMA 1
#define NOWAIT_SEMA 0 #define NOWAIT_SEMA 0
DL_IMPORT(void) PyThread_up_sema Py_PROTO((PyThread_type_sema)); DL_IMPORT(void) PyThread_up_sema(PyThread_type_sema);
#ifndef NO_EXIT_PROG #ifndef NO_EXIT_PROG
DL_IMPORT(void) PyThread_exit_prog Py_PROTO((int)); DL_IMPORT(void) PyThread_exit_prog(int);
DL_IMPORT(void) PyThread__PyThread_exit_prog Py_PROTO((int)); DL_IMPORT(void) PyThread__PyThread_exit_prog(int);
#endif #endif
DL_IMPORT(int) PyThread_create_key Py_PROTO((void)); DL_IMPORT(int) PyThread_create_key(void);
DL_IMPORT(void) PyThread_delete_key Py_PROTO((int)); DL_IMPORT(void) PyThread_delete_key(int);
DL_IMPORT(int) PyThread_set_key_value Py_PROTO((int, void *)); DL_IMPORT(int) PyThread_set_key_value(int, void *);
DL_IMPORT(void *) PyThread_get_key_value Py_PROTO((int)); DL_IMPORT(void *) PyThread_get_key_value(int);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -22,4 +22,4 @@ extern DL_IMPORT(PyTypeObject) PyRange_Type;
#define PyRange_Check(op) ((op)->ob_type == &PyRange_Type) #define PyRange_Check(op) ((op)->ob_type == &PyRange_Type)
extern DL_IMPORT(PyObject *) PyRange_New Py_PROTO((long, long, long, int)); extern DL_IMPORT(PyObject *) PyRange_New(long, long, long, int);

View file

@ -20,18 +20,18 @@ let these be any arbitrary python type.
*/ */
typedef struct { typedef struct {
PyObject_HEAD PyObject_HEAD
PyObject *start, *stop, *step; PyObject *start, *stop, *step;
} PySliceObject; } PySliceObject;
extern DL_IMPORT(PyTypeObject) PySlice_Type; extern DL_IMPORT(PyTypeObject) PySlice_Type;
#define PySlice_Check(op) ((op)->ob_type == &PySlice_Type) #define PySlice_Check(op) ((op)->ob_type == &PySlice_Type)
DL_IMPORT(PyObject *) PySlice_New Py_PROTO(( DL_IMPORT(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
PyObject* start, PyObject* stop, PyObject* step)); PyObject* step);
DL_IMPORT(int) PySlice_GetIndices Py_PROTO(( DL_IMPORT(int) PySlice_GetIndices(PySliceObject *r, int length,
PySliceObject *r, int length, int *start, int *stop, int *step)); int *start, int *stop, int *step);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -1,9 +1,3 @@
#ifndef Py_STRINGOBJECT_H
#define Py_STRINGOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************** /***********************************************************
Copyright (c) 2000, BeOpen.com. Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives. Copyright (c) 1995-2000, Corporation for National Research Initiatives.
@ -16,6 +10,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* String object interface */ /* String object interface */
#ifndef Py_STRINGOBJECT_H
#define Py_STRINGOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
/* /*
Type PyStringObject represents a character string. An extra zero byte is Type PyStringObject represents a character string. An extra zero byte is
reserved at the end to ensure it is zero-terminated, but a size is reserved at the end to ensure it is zero-terminated, but a size is
@ -46,32 +46,32 @@ functions should be applied to nil objects.
#endif #endif
typedef struct { typedef struct {
PyObject_VAR_HEAD PyObject_VAR_HEAD
#ifdef CACHE_HASH #ifdef CACHE_HASH
long ob_shash; long ob_shash;
#endif #endif
#ifdef INTERN_STRINGS #ifdef INTERN_STRINGS
PyObject *ob_sinterned; PyObject *ob_sinterned;
#endif #endif
char ob_sval[1]; char ob_sval[1];
} PyStringObject; } PyStringObject;
extern DL_IMPORT(PyTypeObject) PyString_Type; extern DL_IMPORT(PyTypeObject) PyString_Type;
#define PyString_Check(op) ((op)->ob_type == &PyString_Type) #define PyString_Check(op) ((op)->ob_type == &PyString_Type)
extern DL_IMPORT(PyObject *) PyString_FromStringAndSize Py_PROTO((const char *, int)); extern DL_IMPORT(PyObject *) PyString_FromStringAndSize(const char *, int);
extern DL_IMPORT(PyObject *) PyString_FromString Py_PROTO((const char *)); extern DL_IMPORT(PyObject *) PyString_FromString(const char *);
extern DL_IMPORT(int) PyString_Size Py_PROTO((PyObject *)); extern DL_IMPORT(int) PyString_Size(PyObject *);
extern DL_IMPORT(char *) PyString_AsString Py_PROTO((PyObject *)); extern DL_IMPORT(char *) PyString_AsString(PyObject *);
extern DL_IMPORT(void) PyString_Concat Py_PROTO((PyObject **, PyObject *)); extern DL_IMPORT(void) PyString_Concat(PyObject **, PyObject *);
extern DL_IMPORT(void) PyString_ConcatAndDel Py_PROTO((PyObject **, PyObject *)); extern DL_IMPORT(void) PyString_ConcatAndDel(PyObject **, PyObject *);
extern DL_IMPORT(int) _PyString_Resize Py_PROTO((PyObject **, int)); extern DL_IMPORT(int) _PyString_Resize(PyObject **, int);
extern DL_IMPORT(PyObject *) PyString_Format Py_PROTO((PyObject *, PyObject *)); extern DL_IMPORT(PyObject *) PyString_Format(PyObject *, PyObject *);
#ifdef INTERN_STRINGS #ifdef INTERN_STRINGS
extern DL_IMPORT(void) PyString_InternInPlace Py_PROTO((PyObject **)); extern DL_IMPORT(void) PyString_InternInPlace(PyObject **);
extern DL_IMPORT(PyObject *) PyString_InternFromString Py_PROTO((const char *)); extern DL_IMPORT(PyObject *) PyString_InternFromString(const char *);
#else #else
#define PyString_InternInPlace(p) #define PyString_InternInPlace(p)
#define PyString_InternFromString(cp) PyString_FromString(cp) #define PyString_InternFromString(cp) PyString_FromString(cp)

View file

@ -1,9 +1,3 @@
#ifndef Py_SYSMODULE_H
#define Py_SYSMODULE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************** /***********************************************************
Copyright (c) 2000, BeOpen.com. Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives. Copyright (c) 1995-2000, Corporation for National Research Initiatives.
@ -16,11 +10,17 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* System module interface */ /* System module interface */
DL_IMPORT(PyObject *) PySys_GetObject Py_PROTO((char *)); #ifndef Py_SYSMODULE_H
DL_IMPORT(int) PySys_SetObject Py_PROTO((char *, PyObject *)); #define Py_SYSMODULE_H
DL_IMPORT(FILE *) PySys_GetFile Py_PROTO((char *, FILE *)); #ifdef __cplusplus
DL_IMPORT(void) PySys_SetArgv Py_PROTO((int, char **)); extern "C" {
DL_IMPORT(void) PySys_SetPath Py_PROTO((char *)); #endif
DL_IMPORT(PyObject *) PySys_GetObject(char *);
DL_IMPORT(int) PySys_SetObject(char *, PyObject *);
DL_IMPORT(FILE *) PySys_GetFile(char *, FILE *);
DL_IMPORT(void) PySys_SetArgv(int, char **);
DL_IMPORT(void) PySys_SetPath(char *);
#ifdef HAVE_STDARG_PROTOTYPES #ifdef HAVE_STDARG_PROTOTYPES
DL_IMPORT(void) PySys_WriteStdout(const char *format, ...); DL_IMPORT(void) PySys_WriteStdout(const char *format, ...);

View file

@ -1,9 +1,3 @@
#ifndef Py_TOKEN_H
#define Py_TOKEN_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************** /***********************************************************
Copyright (c) 2000, BeOpen.com. Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives. Copyright (c) 1995-2000, Corporation for National Research Initiatives.
@ -16,6 +10,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Token types */ /* Token types */
#ifndef Py_TOKEN_H
#define Py_TOKEN_H
#ifdef __cplusplus
extern "C" {
#endif
#define ENDMARKER 0 #define ENDMARKER 0
#define NAME 1 #define NAME 1
#define NUMBER 2 #define NUMBER 2
@ -68,8 +68,8 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
extern DL_IMPORT(char *) _PyParser_TokenNames[]; /* Token names */ extern DL_IMPORT(char *) _PyParser_TokenNames[]; /* Token names */
extern DL_IMPORT(int) PyToken_OneChar Py_PROTO((int)); extern DL_IMPORT(int) PyToken_OneChar(int);
extern DL_IMPORT(int) PyToken_TwoChars Py_PROTO((int, int)); extern DL_IMPORT(int) PyToken_TwoChars(int, int);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -1,9 +1,3 @@
#ifndef Py_TUPLEOBJECT_H
#define Py_TUPLEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************** /***********************************************************
Copyright (c) 2000, BeOpen.com. Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives. Copyright (c) 1995-2000, Corporation for National Research Initiatives.
@ -16,6 +10,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Tuple object interface */ /* Tuple object interface */
#ifndef Py_TUPLEOBJECT_H
#define Py_TUPLEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
/* /*
Another generally useful object type is an tuple of object pointers. Another generally useful object type is an tuple of object pointers.
This is a mutable type: the tuple items can be changed (but not their This is a mutable type: the tuple items can be changed (but not their
@ -29,20 +29,20 @@ returned item's reference count.
*/ */
typedef struct { typedef struct {
PyObject_VAR_HEAD PyObject_VAR_HEAD
PyObject *ob_item[1]; PyObject *ob_item[1];
} PyTupleObject; } PyTupleObject;
extern DL_IMPORT(PyTypeObject) PyTuple_Type; extern DL_IMPORT(PyTypeObject) PyTuple_Type;
#define PyTuple_Check(op) ((op)->ob_type == &PyTuple_Type) #define PyTuple_Check(op) ((op)->ob_type == &PyTuple_Type)
extern DL_IMPORT(PyObject *) PyTuple_New Py_PROTO((int size)); extern DL_IMPORT(PyObject *) PyTuple_New(int size);
extern DL_IMPORT(int) PyTuple_Size Py_PROTO((PyObject *)); extern DL_IMPORT(int) PyTuple_Size(PyObject *);
extern DL_IMPORT(PyObject *) PyTuple_GetItem Py_PROTO((PyObject *, int)); extern DL_IMPORT(PyObject *) PyTuple_GetItem(PyObject *, int);
extern DL_IMPORT(int) PyTuple_SetItem Py_PROTO((PyObject *, int, PyObject *)); extern DL_IMPORT(int) PyTuple_SetItem(PyObject *, int, PyObject *);
extern DL_IMPORT(PyObject *) PyTuple_GetSlice Py_PROTO((PyObject *, int, int)); extern DL_IMPORT(PyObject *) PyTuple_GetSlice(PyObject *, int, int);
extern DL_IMPORT(int) _PyTuple_Resize Py_PROTO((PyObject **, int, int)); extern DL_IMPORT(int) _PyTuple_Resize(PyObject **, int, int);
/* Macro, trading safety for speed */ /* Macro, trading safety for speed */
#define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i]) #define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])