From ea9cb5aebf38741871ad4f28971dcd23ddd77ad2 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Sun, 9 Jul 2000 00:20:36 +0000 Subject: [PATCH] ANSI-fication and Py_PROTO extermination. --- Include/abstract.h | 120 ++++++++++++++++++++-------------------- Include/bufferobject.h | 26 +++++---- Include/classobject.h | 65 +++++++++++----------- Include/cobject.h | 24 ++++---- Include/compile.h | 48 ++++++++-------- Include/complexobject.h | 34 ++++++------ Include/fileobject.h | 32 +++++------ Include/floatobject.h | 22 ++++---- Include/frameobject.h | 69 ++++++++++++----------- Include/funcobject.h | 34 ++++++------ Include/grammar.h | 90 +++++++++++++++--------------- Include/intobject.h | 30 +++++----- Include/listobject.h | 38 ++++++------- Include/methodobject.h | 46 ++++++++------- 14 files changed, 340 insertions(+), 338 deletions(-) diff --git a/Include/abstract.h b/Include/abstract.h index f1808061f12..6b96adf6c1d 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -233,7 +233,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ #define PyObject_DelAttr(O,A) PyObject_SetAttr((O),(A),NULL) - DL_IMPORT(int) PyObject_Cmp Py_PROTO((PyObject *o1, PyObject *o2, int *result)); + DL_IMPORT(int) PyObject_Cmp(PyObject *o1, PyObject *o2, int *result); /* Compare the values of o1 and o2 using a routine provided by @@ -281,7 +281,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(int) PyCallable_Check Py_PROTO((PyObject *o)); + DL_IMPORT(int) PyCallable_Check(PyObject *o); /* Determine if the object, o, is callable. Return 1 if the @@ -293,8 +293,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ - DL_IMPORT(PyObject *) PyObject_CallObject Py_PROTO((PyObject *callable_object, - PyObject *args)); + DL_IMPORT(PyObject *) PyObject_CallObject(PyObject *callable_object, + PyObject *args); /* @@ -306,8 +306,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyObject_CallFunction Py_PROTO((PyObject *callable_object, - char *format, ...)); + DL_IMPORT(PyObject *) PyObject_CallFunction(PyObject *callable_object, + char *format, ...); /* Call a callable Python object, callable_object, with a @@ -320,8 +320,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyObject_CallMethod Py_PROTO((PyObject *o, char *m, - char *format, ...)); + DL_IMPORT(PyObject *) PyObject_CallMethod(PyObject *o, char *m, + char *format, ...); /* Call the method named m of object o with a variable number of @@ -373,7 +373,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyObject_Type Py_PROTO((PyObject *o)); + DL_IMPORT(PyObject *) PyObject_Type(PyObject *o); /* On success, returns a type object corresponding to the object @@ -381,7 +381,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ equivalent to the Python expression: type(o). */ - DL_IMPORT(int) PyObject_Length Py_PROTO((PyObject *o)); + DL_IMPORT(int) PyObject_Length(PyObject *o); /* Return the length of object o. If the object, o, provides @@ -391,7 +391,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyObject_GetItem Py_PROTO((PyObject *o, PyObject *key)); + DL_IMPORT(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key); /* Return element of o corresponding to the object, key, or NULL @@ -400,7 +400,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(int) PyObject_SetItem Py_PROTO((PyObject *o, PyObject *key, PyObject *v)); + DL_IMPORT(int) PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v); /* Map the object, key, to the value, v. Returns @@ -408,7 +408,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ statement: o[key]=v. */ - DL_IMPORT(int) PyObject_DelItem Py_PROTO((PyObject *o, PyObject *key)); + DL_IMPORT(int) PyObject_DelItem(PyObject *o, PyObject *key); /* Delete the mapping for key from *o. Returns -1 on failure. @@ -464,7 +464,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ /* Number Protocol:*/ - DL_IMPORT(int) PyNumber_Check Py_PROTO((PyObject *o)); + DL_IMPORT(int) PyNumber_Check(PyObject *o); /* Returns 1 if the object, o, provides numeric protocols, and @@ -474,7 +474,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Add Py_PROTO((PyObject *o1, PyObject *o2)); + DL_IMPORT(PyObject *) PyNumber_Add(PyObject *o1, PyObject *o2); /* Returns the result of adding o1 and o2, or null on failure. @@ -483,7 +483,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Subtract Py_PROTO((PyObject *o1, PyObject *o2)); + DL_IMPORT(PyObject *) PyNumber_Subtract(PyObject *o1, PyObject *o2); /* Returns the result of subtracting o2 from o1, or null on @@ -492,7 +492,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Multiply Py_PROTO((PyObject *o1, PyObject *o2)); + DL_IMPORT(PyObject *) PyNumber_Multiply(PyObject *o1, PyObject *o2); /* Returns the result of multiplying o1 and o2, or null on @@ -502,7 +502,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Divide Py_PROTO((PyObject *o1, PyObject *o2)); + DL_IMPORT(PyObject *) PyNumber_Divide(PyObject *o1, PyObject *o2); /* Returns the result of dividing o1 by o2, or null on failure. @@ -511,7 +511,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Remainder Py_PROTO((PyObject *o1, PyObject *o2)); + DL_IMPORT(PyObject *) PyNumber_Remainder(PyObject *o1, PyObject *o2); /* Returns the remainder of dividing o1 by o2, or null on @@ -521,7 +521,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Divmod Py_PROTO((PyObject *o1, PyObject *o2)); + DL_IMPORT(PyObject *) PyNumber_Divmod(PyObject *o1, PyObject *o2); /* See the built-in function divmod. Returns NULL on failure. @@ -531,7 +531,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Power Py_PROTO((PyObject *o1, PyObject *o2, PyObject *o3)); + DL_IMPORT(PyObject *) PyNumber_Power(PyObject *o1, PyObject *o2, + PyObject *o3); /* See the built-in function pow. Returns NULL on failure. @@ -540,7 +541,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Negative Py_PROTO((PyObject *o)); + DL_IMPORT(PyObject *) PyNumber_Negative(PyObject *o); /* Returns the negation of o on success, or null on failure. @@ -548,7 +549,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Positive Py_PROTO((PyObject *o)); + DL_IMPORT(PyObject *) PyNumber_Positive(PyObject *o); /* Returns the (what?) of o on success, or NULL on failure. @@ -556,7 +557,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Absolute Py_PROTO((PyObject *o)); + DL_IMPORT(PyObject *) PyNumber_Absolute(PyObject *o); /* Returns the absolute value of o, or null on failure. This is @@ -564,7 +565,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Invert Py_PROTO((PyObject *o)); + DL_IMPORT(PyObject *) PyNumber_Invert(PyObject *o); /* Returns the bitwise negation of o on success, or NULL on @@ -574,7 +575,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Lshift Py_PROTO((PyObject *o1, PyObject *o2)); + DL_IMPORT(PyObject *) PyNumber_Lshift(PyObject *o1, PyObject *o2); /* Returns the result of left shifting o1 by o2 on success, or @@ -584,7 +585,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Rshift Py_PROTO((PyObject *o1, PyObject *o2)); + DL_IMPORT(PyObject *) PyNumber_Rshift(PyObject *o1, PyObject *o2); /* Returns the result of right shifting o1 by o2 on success, or @@ -593,7 +594,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_And Py_PROTO((PyObject *o1, PyObject *o2)); + DL_IMPORT(PyObject *) PyNumber_And(PyObject *o1, PyObject *o2); /* Returns the result of bitwise and of o1 and o2 on success, or @@ -603,7 +604,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Xor Py_PROTO((PyObject *o1, PyObject *o2)); + DL_IMPORT(PyObject *) PyNumber_Xor(PyObject *o1, PyObject *o2); /* Returns the bitwise exclusive or of o1 by o2 on success, or @@ -613,7 +614,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Or Py_PROTO((PyObject *o1, PyObject *o2)); + DL_IMPORT(PyObject *) PyNumber_Or(PyObject *o1, PyObject *o2); /* Returns the result of bitwise or or o1 and o2 on success, or @@ -641,7 +642,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Int Py_PROTO((PyObject *o)); + DL_IMPORT(PyObject *) PyNumber_Int(PyObject *o); /* Returns the o converted to an integer object on success, or @@ -650,7 +651,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Long Py_PROTO((PyObject *o)); + DL_IMPORT(PyObject *) PyNumber_Long(PyObject *o); /* Returns the o converted to a long integer object on success, @@ -659,7 +660,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PyNumber_Float Py_PROTO((PyObject *o)); + DL_IMPORT(PyObject *) PyNumber_Float(PyObject *o); /* Returns the o converted to a float object on success, or NULL @@ -670,7 +671,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ /* Sequence protocol:*/ - DL_IMPORT(int) PySequence_Check Py_PROTO((PyObject *o)); + DL_IMPORT(int) PySequence_Check(PyObject *o); /* Return 1 if the object provides sequence protocol, and zero @@ -680,14 +681,14 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(int) PySequence_Length Py_PROTO((PyObject *o)); + DL_IMPORT(int) PySequence_Length(PyObject *o); /* Return the length of sequence object o, or -1 on failure. */ - DL_IMPORT(PyObject *) PySequence_Concat Py_PROTO((PyObject *o1, PyObject *o2)); + DL_IMPORT(PyObject *) PySequence_Concat(PyObject *o1, PyObject *o2); /* Return the concatination of o1 and o2 on success, and NULL on @@ -696,7 +697,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PySequence_Repeat Py_PROTO((PyObject *o, int count)); + DL_IMPORT(PyObject *) PySequence_Repeat(PyObject *o, int count); /* Return the result of repeating sequence object o count times, @@ -705,14 +706,14 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PySequence_GetItem Py_PROTO((PyObject *o, int i)); + DL_IMPORT(PyObject *) PySequence_GetItem(PyObject *o, int i); /* Return the ith element of o, or NULL on failure. This is the equivalent of the Python expression: o[i]. */ - DL_IMPORT(PyObject *) PySequence_GetSlice Py_PROTO((PyObject *o, int i1, int i2)); + DL_IMPORT(PyObject *) PySequence_GetSlice(PyObject *o, int i1, int i2); /* Return the slice of sequence object o between i1 and i2, or @@ -721,7 +722,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(int) PySequence_SetItem Py_PROTO((PyObject *o, int i, PyObject *v)); + DL_IMPORT(int) PySequence_SetItem(PyObject *o, int i, PyObject *v); /* Assign object v to the ith element of o. Returns @@ -730,7 +731,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(int) PySequence_DelItem Py_PROTO((PyObject *o, int i)); + DL_IMPORT(int) PySequence_DelItem(PyObject *o, int i); /* Delete the ith element of object v. Returns @@ -738,7 +739,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ statement: del o[i]. */ - DL_IMPORT(int) PySequence_SetSlice Py_PROTO((PyObject *o, int i1, int i2, PyObject *v)); + DL_IMPORT(int) PySequence_SetSlice(PyObject *o, int i1, int i2, + PyObject *v); /* Assign the sequence object, v, to the slice in sequence @@ -746,7 +748,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ equivalent of the Python statement: o[i1:i2]=v. */ - DL_IMPORT(int) PySequence_DelSlice Py_PROTO((PyObject *o, int i1, int i2)); + DL_IMPORT(int) PySequence_DelSlice(PyObject *o, int i1, int i2); /* Delete the slice in sequence object, o, from i1 to i2. @@ -754,7 +756,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ statement: del o[i1:i2]. */ - DL_IMPORT(PyObject *) PySequence_Tuple Py_PROTO((PyObject *o)); + DL_IMPORT(PyObject *) PySequence_Tuple(PyObject *o); /* Returns the sequence, o, as a tuple on success, and NULL on failure. @@ -762,14 +764,14 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(PyObject *) PySequence_List Py_PROTO((PyObject *o)); + DL_IMPORT(PyObject *) PySequence_List(PyObject *o); /* Returns the sequence, o, as a list on success, and NULL on failure. This is equivalent to the Python expression: list(o) */ - DL_IMPORT(PyObject *) PySequence_Fast Py_PROTO((PyObject *o, const char* m)); + DL_IMPORT(PyObject *) PySequence_Fast(PyObject *o, const char* m); /* Returns the sequence, o, as a tuple, unless it's already a @@ -788,7 +790,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ PySequence_Fast, and that i is within bounds. */ - DL_IMPORT(int) PySequence_Count Py_PROTO((PyObject *o, PyObject *value)); + DL_IMPORT(int) PySequence_Count(PyObject *o, PyObject *value); /* Return the number of occurrences on value on o, that is, @@ -797,11 +799,11 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ expression: o.count(value). */ - DL_IMPORT(int) PySequence_Contains Py_PROTO((PyObject *o, PyObject *value)); + DL_IMPORT(int) PySequence_Contains(PyObject *o, PyObject *value); /* For DLL-level backwards compatibility */ #undef PySequence_In - DL_IMPORT(int) PySequence_In Py_PROTO((PyObject *o, PyObject *value)); + DL_IMPORT(int) PySequence_In(PyObject *o, PyObject *value); /* For source-level backwards compatibility */ #define PySequence_In PySequence_Contains @@ -812,7 +814,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ is equivalent to the Python expression: value in o. */ - DL_IMPORT(int) PySequence_Index Py_PROTO((PyObject *o, PyObject *value)); + DL_IMPORT(int) PySequence_Index(PyObject *o, PyObject *value); /* Return the first index for which o[i]=value. On error, @@ -822,7 +824,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ /* Mapping protocol:*/ - DL_IMPORT(int) PyMapping_Check Py_PROTO((PyObject *o)); + DL_IMPORT(int) PyMapping_Check(PyObject *o); /* Return 1 if the object provides mapping protocol, and zero @@ -831,7 +833,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ This function always succeeds. */ - DL_IMPORT(int) PyMapping_Length Py_PROTO((PyObject *o)); + DL_IMPORT(int) PyMapping_Length(PyObject *o); /* Returns the number of keys in object o on success, and -1 on @@ -841,7 +843,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ /* implemented as a macro: - int PyMapping_DelItemString Py_PROTO((PyObject *o, char *key)); + int PyMapping_DelItemString(PyObject *o, char *key); Remove the mapping for object, key, from the object *o. Returns -1 on failure. This is equivalent to @@ -851,7 +853,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ /* implemented as a macro: - int PyMapping_DelItem Py_PROTO((PyObject *o, PyObject *key)); + int PyMapping_DelItem(PyObject *o, PyObject *key); Remove the mapping for object, key, from the object *o. Returns -1 on failure. This is equivalent to @@ -859,7 +861,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ #define PyMapping_DelItem(O,K) PyDict_DelItem((O),(K)) - DL_IMPORT(int) PyMapping_HasKeyString Py_PROTO((PyObject *o, char *key)); + DL_IMPORT(int) PyMapping_HasKeyString(PyObject *o, char *key); /* On success, return 1 if the mapping object has the key, key, @@ -869,7 +871,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ This function always succeeds. */ - DL_IMPORT(int) PyMapping_HasKey Py_PROTO((PyObject *o, PyObject *key)); + DL_IMPORT(int) PyMapping_HasKey(PyObject *o, PyObject *key); /* Return 1 if the mapping object has the key, key, @@ -912,7 +914,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ #define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL) - DL_IMPORT(PyObject *) PyMapping_GetItemString Py_PROTO((PyObject *o, char *key)); + DL_IMPORT(PyObject *) PyMapping_GetItemString(PyObject *o, char *key); /* Return element of o corresponding to the object, key, or NULL @@ -920,8 +922,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ o[key]. */ - DL_IMPORT(int) PyMapping_SetItemString Py_PROTO((PyObject *o, char *key, - PyObject *value)); + DL_IMPORT(int) PyMapping_SetItemString(PyObject *o, char *key, + PyObject *value); /* Map the object, key, to the value, v. Returns diff --git a/Include/bufferobject.h b/Include/bufferobject.h index da978c258a4..5a205f3e7c6 100644 --- a/Include/bufferobject.h +++ b/Include/bufferobject.h @@ -1,9 +1,3 @@ -#ifndef Py_BUFFEROBJECT_H -#define Py_BUFFEROBJECT_H -#ifdef __cplusplus -extern "C" { -#endif - /*********************************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. @@ -18,6 +12,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. /* Note: the object's structure is private */ +#ifndef Py_BUFFEROBJECT_H +#define Py_BUFFEROBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + extern DL_IMPORT(PyTypeObject) PyBuffer_Type; @@ -25,16 +25,18 @@ extern DL_IMPORT(PyTypeObject) PyBuffer_Type; #define Py_END_OF_BUFFER (-1) -extern DL_IMPORT(PyObject *) PyBuffer_FromObject Py_PROTO((PyObject *base, int offset, int size)); -extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteObject Py_PROTO((PyObject *base, int offset, int size)); +extern DL_IMPORT(PyObject *) PyBuffer_FromObject(PyObject *base, + int offset, int size); +extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteObject(PyObject *base, + int offset, + int size); -extern DL_IMPORT(PyObject *) PyBuffer_FromMemory Py_PROTO((void *ptr, int size)); -extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteMemory Py_PROTO((void *ptr, int size)); +extern DL_IMPORT(PyObject *) PyBuffer_FromMemory(void *ptr, int size); +extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteMemory(void *ptr, int size); -extern DL_IMPORT(PyObject *) PyBuffer_New Py_PROTO((int size)); +extern DL_IMPORT(PyObject *) PyBuffer_New(int size); #ifdef __cplusplus } #endif #endif /* !Py_BUFFEROBJECT_H */ - diff --git a/Include/classobject.h b/Include/classobject.h index 7fcf6ec7896..2902e771e88 100644 --- a/Include/classobject.h +++ b/Include/classobject.h @@ -1,9 +1,3 @@ -#ifndef Py_CLASSOBJECT_H -#define Py_CLASSOBJECT_H -#ifdef __cplusplus -extern "C" { -#endif - /*********************************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. @@ -18,28 +12,34 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. /* Revealing some structures (not for general use) */ +#ifndef Py_CLASSOBJECT_H +#define Py_CLASSOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { - PyObject_HEAD - PyObject *cl_bases; /* A tuple of class objects */ - PyObject *cl_dict; /* A dictionary */ - PyObject *cl_name; /* A string */ - /* The following three are functions or NULL */ - PyObject *cl_getattr; - PyObject *cl_setattr; - PyObject *cl_delattr; + PyObject_HEAD + PyObject *cl_bases; /* A tuple of class objects */ + PyObject *cl_dict; /* A dictionary */ + PyObject *cl_name; /* A string */ + /* The following three are functions or NULL */ + PyObject *cl_getattr; + PyObject *cl_setattr; + PyObject *cl_delattr; } PyClassObject; typedef struct { - PyObject_HEAD - PyClassObject *in_class; /* The class object */ - PyObject *in_dict; /* A dictionary */ + PyObject_HEAD + PyClassObject *in_class; /* The class object */ + PyObject *in_dict; /* A dictionary */ } PyInstanceObject; typedef struct { - PyObject_HEAD - PyObject *im_func; /* The callable object implementing the method */ - PyObject *im_self; /* The instance it is bound to, or NULL */ - PyObject *im_class; /* The class that defined the method */ + PyObject_HEAD + PyObject *im_func; /* The callable object implementing the method */ + PyObject *im_self; /* The instance it is bound to, or NULL */ + PyObject *im_class; /* The class that defined the method */ } PyMethodObject; extern DL_IMPORT(PyTypeObject) PyClass_Type, PyInstance_Type, PyMethod_Type; @@ -48,13 +48,14 @@ extern DL_IMPORT(PyTypeObject) PyClass_Type, PyInstance_Type, PyMethod_Type; #define PyInstance_Check(op) ((op)->ob_type == &PyInstance_Type) #define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type) -extern DL_IMPORT(PyObject *) PyClass_New Py_PROTO((PyObject *, PyObject *, PyObject *)); -extern DL_IMPORT(PyObject *) PyInstance_New Py_PROTO((PyObject *, PyObject *, PyObject *)); -extern DL_IMPORT(PyObject *) PyMethod_New Py_PROTO((PyObject *, PyObject *, PyObject *)); +extern DL_IMPORT(PyObject *) PyClass_New(PyObject *, PyObject *, PyObject *); +extern DL_IMPORT(PyObject *) PyInstance_New(PyObject *, PyObject *, + PyObject *); +extern DL_IMPORT(PyObject *) PyMethod_New(PyObject *, PyObject *, PyObject *); -extern DL_IMPORT(PyObject *) PyMethod_Function Py_PROTO((PyObject *)); -extern DL_IMPORT(PyObject *) PyMethod_Self Py_PROTO((PyObject *)); -extern DL_IMPORT(PyObject *) PyMethod_Class Py_PROTO((PyObject *)); +extern DL_IMPORT(PyObject *) PyMethod_Function(PyObject *); +extern DL_IMPORT(PyObject *) PyMethod_Self(PyObject *); +extern DL_IMPORT(PyObject *) PyMethod_Class(PyObject *); /* Macros for direct access to these values. Type checks are *not* done, so use with care. */ @@ -65,12 +66,12 @@ extern DL_IMPORT(PyObject *) PyMethod_Class Py_PROTO((PyObject *)); #define PyMethod_GET_CLASS(meth) \ (((PyMethodObject *)meth) -> im_class) -extern DL_IMPORT(int) PyClass_IsSubclass Py_PROTO((PyObject *, PyObject *)); +extern DL_IMPORT(int) PyClass_IsSubclass(PyObject *, PyObject *); -extern DL_IMPORT(PyObject *) PyInstance_DoBinOp - Py_PROTO((PyObject *, PyObject *, - char *, char *, - PyObject * (*) Py_PROTO((PyObject *, PyObject *)) )); +extern DL_IMPORT(PyObject *) PyInstance_DoBinOp(PyObject *, PyObject *, + char *, char *, + PyObject * (*)(PyObject *, + PyObject *)); #ifdef __cplusplus } diff --git a/Include/cobject.h b/Include/cobject.h index 49c54509a0e..15850d916e3 100644 --- a/Include/cobject.h +++ b/Include/cobject.h @@ -1,9 +1,3 @@ -#ifndef Py_COBJECT_H -#define Py_COBJECT_H -#ifdef __cplusplus -extern "C" { -#endif - /*********************************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. @@ -23,6 +17,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +#ifndef Py_COBJECT_H +#define Py_COBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + extern DL_IMPORT(PyTypeObject) PyCObject_Type; #define PyCObject_Check(op) ((op)->ob_type == &PyCObject_Type) @@ -34,7 +34,7 @@ extern DL_IMPORT(PyTypeObject) PyCObject_Type; */ extern DL_IMPORT(PyObject *) -PyCObject_FromVoidPtr Py_PROTO((void *cobj, void (*destruct)(void*))); +PyCObject_FromVoidPtr(void *cobj, void (*destruct)(void*)); /* Create a PyCObject from a pointer to a C object, a description object, @@ -43,20 +43,20 @@ PyCObject_FromVoidPtr Py_PROTO((void *cobj, void (*destruct)(void*))); the PyCObject is destroyed. */ extern DL_IMPORT(PyObject *) -PyCObject_FromVoidPtrAndDesc Py_PROTO((void *cobj, void *desc, - void (*destruct)(void*,void*))); +PyCObject_FromVoidPtrAndDesc(void *cobj, void *desc, + void (*destruct)(void*,void*)); /* Retrieve a pointer to a C object from a PyCObject. */ extern DL_IMPORT(void *) -PyCObject_AsVoidPtr Py_PROTO((PyObject *)); +PyCObject_AsVoidPtr(PyObject *); /* Retrieve a pointer to a description object from a PyCObject. */ extern DL_IMPORT(void *) -PyCObject_GetDesc Py_PROTO((PyObject *)); +PyCObject_GetDesc(PyObject *); /* Import a pointer to a C object from a module using a PyCObject. */ extern DL_IMPORT(void *) -PyCObject_Import Py_PROTO((char *module_name, char *cobject_name)); +PyCObject_Import(char *module_name, char *cobject_name); #ifdef __cplusplus } diff --git a/Include/compile.h b/Include/compile.h index de1b5792dcf..56973cd4f24 100644 --- a/Include/compile.h +++ b/Include/compile.h @@ -1,9 +1,3 @@ -#ifndef Py_COMPILE_H -#define Py_COMPILE_H -#ifdef __cplusplus -extern "C" { -#endif - /*********************************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. @@ -16,22 +10,28 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. /* Definitions for bytecode */ +#ifndef Py_COMPILE_H +#define Py_COMPILE_H +#ifdef __cplusplus +extern "C" { +#endif + /* Bytecode object */ typedef struct { - PyObject_HEAD - int co_argcount; /* #arguments, except *args */ - int co_nlocals; /* #local variables */ - int co_stacksize; /* #entries needed for evaluation stack */ - int co_flags; /* CO_..., see below */ - PyObject *co_code; /* instruction opcodes */ - PyObject *co_consts; /* list (constants used) */ - PyObject *co_names; /* list of strings (names used) */ - PyObject *co_varnames; /* tuple of strings (local variable names) */ - /* The rest doesn't count for hash/cmp */ - PyObject *co_filename; /* string (where it was loaded from) */ - PyObject *co_name; /* string (name, for reference) */ - int co_firstlineno; /* first source line number */ - PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) */ + PyObject_HEAD + int co_argcount; /* #arguments, except *args */ + int co_nlocals; /* #local variables */ + int co_stacksize; /* #entries needed for evaluation stack */ + int co_flags; /* CO_..., see below */ + PyObject *co_code; /* instruction opcodes */ + PyObject *co_consts; /* list (constants used) */ + PyObject *co_names; /* list of strings (names used) */ + PyObject *co_varnames; /* tuple of strings (local variable names) */ + /* The rest doesn't count for hash/cmp */ + PyObject *co_filename; /* string (where it was loaded from) */ + PyObject *co_name; /* string (name, for reference) */ + int co_firstlineno; /* first source line number */ + PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) */ } PyCodeObject; /* Masks for co_flags above */ @@ -48,11 +48,11 @@ extern DL_IMPORT(PyTypeObject) PyCode_Type; /* Public interface */ struct _node; /* Declare the existence of this type */ -DL_IMPORT(PyCodeObject *) PyNode_Compile Py_PROTO((struct _node *, char *)); -DL_IMPORT(PyCodeObject *) PyCode_New Py_PROTO(( +DL_IMPORT(PyCodeObject *) PyNode_Compile(struct _node *, char *); +DL_IMPORT(PyCodeObject *) PyCode_New( int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *, - PyObject *, PyObject *, int, PyObject *)); /* same as struct above */ -DL_IMPORT(int) PyCode_Addr2Line Py_PROTO((PyCodeObject *, int)); + PyObject *, PyObject *, int, PyObject *); /* same as struct above */ +DL_IMPORT(int) PyCode_Addr2Line(PyCodeObject *, int); /* for internal use only */ #define _PyCode_GETCODEPTR(co, pp) \ diff --git a/Include/complexobject.h b/Include/complexobject.h index ef62964c36f..ef5016fe41a 100644 --- a/Include/complexobject.h +++ b/Include/complexobject.h @@ -1,14 +1,14 @@ +/* Complex number structure */ + #ifndef COMPLEXOBJECT_H #define COMPLEXOBJECT_H #ifdef __cplusplus extern "C" { #endif -/* Complex number structure */ - typedef struct { - double real; - double imag; + double real; + double imag; } Py_complex; /* Operations on complex numbers from complexmodule.c */ @@ -20,12 +20,12 @@ typedef struct { #define c_quot _Py_c_quot #define c_pow _Py_c_pow -extern DL_IMPORT(Py_complex) c_sum Py_PROTO((Py_complex, Py_complex)); -extern DL_IMPORT(Py_complex) c_diff Py_PROTO((Py_complex, Py_complex)); -extern DL_IMPORT(Py_complex) c_neg Py_PROTO((Py_complex)); -extern DL_IMPORT(Py_complex) c_prod Py_PROTO((Py_complex, Py_complex)); -extern DL_IMPORT(Py_complex) c_quot Py_PROTO((Py_complex, Py_complex)); -extern DL_IMPORT(Py_complex) c_pow Py_PROTO((Py_complex, Py_complex)); +extern DL_IMPORT(Py_complex) c_sum(Py_complex, Py_complex); +extern DL_IMPORT(Py_complex) c_diff(Py_complex, Py_complex); +extern DL_IMPORT(Py_complex) c_neg(Py_complex); +extern DL_IMPORT(Py_complex) c_prod(Py_complex, Py_complex); +extern DL_IMPORT(Py_complex) c_quot(Py_complex, Py_complex); +extern DL_IMPORT(Py_complex) c_pow(Py_complex, Py_complex); /* Complex object interface */ @@ -36,20 +36,20 @@ real and imaginary parts. */ typedef struct { - PyObject_HEAD - Py_complex cval; + PyObject_HEAD + Py_complex cval; } PyComplexObject; extern DL_IMPORT(PyTypeObject) PyComplex_Type; #define PyComplex_Check(op) ((op)->ob_type == &PyComplex_Type) -extern DL_IMPORT(PyObject *) PyComplex_FromCComplex Py_PROTO((Py_complex)); -extern DL_IMPORT(PyObject *) PyComplex_FromDoubles Py_PROTO((double real, double imag)); +extern DL_IMPORT(PyObject *) PyComplex_FromCComplex(Py_complex); +extern DL_IMPORT(PyObject *) PyComplex_FromDoubles(double real, double imag); -extern DL_IMPORT(double) PyComplex_RealAsDouble Py_PROTO((PyObject *op)); -extern DL_IMPORT(double) PyComplex_ImagAsDouble Py_PROTO((PyObject *op)); -extern DL_IMPORT(Py_complex) PyComplex_AsCComplex Py_PROTO((PyObject *op)); +extern DL_IMPORT(double) PyComplex_RealAsDouble(PyObject *op); +extern DL_IMPORT(double) PyComplex_ImagAsDouble(PyObject *op); +extern DL_IMPORT(Py_complex) PyComplex_AsCComplex(PyObject *op); #ifdef __cplusplus } diff --git a/Include/fileobject.h b/Include/fileobject.h index c30d63baa05..7c6bfac1857 100644 --- a/Include/fileobject.h +++ b/Include/fileobject.h @@ -1,9 +1,3 @@ -#ifndef Py_FILEOBJECT_H -#define Py_FILEOBJECT_H -#ifdef __cplusplus -extern "C" { -#endif - /*********************************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. @@ -16,20 +10,26 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. /* File object interface */ +#ifndef Py_FILEOBJECT_H +#define Py_FILEOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + extern DL_IMPORT(PyTypeObject) PyFile_Type; #define PyFile_Check(op) ((op)->ob_type == &PyFile_Type) -extern DL_IMPORT(PyObject *) PyFile_FromString Py_PROTO((char *, char *)); -extern DL_IMPORT(void) PyFile_SetBufSize Py_PROTO((PyObject *, int)); -extern DL_IMPORT(PyObject *) PyFile_FromFile - Py_PROTO((FILE *, char *, char *, int (*)Py_FPROTO((FILE *)))); -extern DL_IMPORT(FILE *) PyFile_AsFile Py_PROTO((PyObject *)); -extern DL_IMPORT(PyObject *) PyFile_Name Py_PROTO((PyObject *)); -extern DL_IMPORT(PyObject *) PyFile_GetLine Py_PROTO((PyObject *, int)); -extern DL_IMPORT(int) PyFile_WriteObject Py_PROTO((PyObject *, PyObject *, int)); -extern DL_IMPORT(int) PyFile_SoftSpace Py_PROTO((PyObject *, int)); -extern DL_IMPORT(int) PyFile_WriteString Py_PROTO((char *, PyObject *)); +extern DL_IMPORT(PyObject *) PyFile_FromString(char *, char *); +extern DL_IMPORT(void) PyFile_SetBufSize(PyObject *, int); +extern DL_IMPORT(PyObject *) PyFile_FromFile(FILE *, char *, char *, + int (*)(FILE *)); +extern DL_IMPORT(FILE *) PyFile_AsFile(PyObject *); +extern DL_IMPORT(PyObject *) PyFile_Name(PyObject *); +extern DL_IMPORT(PyObject *) PyFile_GetLine(PyObject *, int); +extern DL_IMPORT(int) PyFile_WriteObject(PyObject *, PyObject *, int); +extern DL_IMPORT(int) PyFile_SoftSpace(PyObject *, int); +extern DL_IMPORT(int) PyFile_WriteString(char *, PyObject *); #ifdef __cplusplus } diff --git a/Include/floatobject.h b/Include/floatobject.h index 2d104679fe8..fd7f9d25490 100644 --- a/Include/floatobject.h +++ b/Include/floatobject.h @@ -1,9 +1,3 @@ -#ifndef Py_FLOATOBJECT_H -#define Py_FLOATOBJECT_H -#ifdef __cplusplus -extern "C" { -#endif - /*********************************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. @@ -20,18 +14,24 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. PyFloatObject represents a (double precision) floating point number. */ +#ifndef Py_FLOATOBJECT_H +#define Py_FLOATOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { - PyObject_HEAD - double ob_fval; + PyObject_HEAD + double ob_fval; } PyFloatObject; extern DL_IMPORT(PyTypeObject) PyFloat_Type; #define PyFloat_Check(op) ((op)->ob_type == &PyFloat_Type) -extern DL_IMPORT(PyObject *) PyFloat_FromString Py_PROTO((PyObject*, char**)); -extern DL_IMPORT(PyObject *) PyFloat_FromDouble Py_PROTO((double)); -extern DL_IMPORT(double) PyFloat_AsDouble Py_PROTO((PyObject *)); +extern DL_IMPORT(PyObject *) PyFloat_FromString(PyObject*, char**); +extern DL_IMPORT(PyObject *) PyFloat_FromDouble(double); +extern DL_IMPORT(double) PyFloat_AsDouble(PyObject *); /* Macro, trading safety for speed */ #define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval) diff --git a/Include/frameobject.h b/Include/frameobject.h index 58545fb9238..5021d4ed489 100644 --- a/Include/frameobject.h +++ b/Include/frameobject.h @@ -1,9 +1,3 @@ -#ifndef Py_FRAMEOBJECT_H -#define Py_FRAMEOBJECT_H -#ifdef __cplusplus -extern "C" { -#endif - /*********************************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. @@ -16,32 +10,38 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. /* Frame object interface */ +#ifndef Py_FRAMEOBJECT_H +#define Py_FRAMEOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { - int b_type; /* what kind of block this is */ - int b_handler; /* where to jump to find handler */ - int b_level; /* value stack level to pop to */ + int b_type; /* what kind of block this is */ + int b_handler; /* where to jump to find handler */ + int b_level; /* value stack level to pop to */ } PyTryBlock; typedef struct _frame { - PyObject_HEAD - struct _frame *f_back; /* previous frame, or NULL */ - PyCodeObject *f_code; /* code segment */ - PyObject *f_builtins; /* builtin symbol table (PyDictObject) */ - PyObject *f_globals; /* global symbol table (PyDictObject) */ - PyObject *f_locals; /* local symbol table (PyDictObject) */ - PyObject **f_valuestack; /* points after the last local */ - PyObject *f_trace; /* Trace function */ - PyObject *f_exc_type, *f_exc_value, *f_exc_traceback; - PyThreadState *f_tstate; - int f_lasti; /* Last instruction if called */ - int f_lineno; /* Current line number */ - int f_restricted; /* Flag set if restricted operations + PyObject_HEAD + struct _frame *f_back; /* previous frame, or NULL */ + PyCodeObject *f_code; /* code segment */ + PyObject *f_builtins; /* builtin symbol table (PyDictObject) */ + PyObject *f_globals; /* global symbol table (PyDictObject) */ + PyObject *f_locals; /* local symbol table (PyDictObject) */ + PyObject **f_valuestack; /* points after the last local */ + PyObject *f_trace; /* Trace function */ + PyObject *f_exc_type, *f_exc_value, *f_exc_traceback; + PyThreadState *f_tstate; + int f_lasti; /* Last instruction if called */ + int f_lineno; /* Current line number */ + int f_restricted; /* Flag set if restricted operations in this scope */ - int f_iblock; /* index in f_blockstack */ - PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */ - int f_nlocals; /* number of locals */ - int f_stacksize; /* size of value stack */ - PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */ + int f_iblock; /* index in f_blockstack */ + PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */ + int f_nlocals; /* number of locals */ + int f_stacksize; /* size of value stack */ + PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */ } PyFrameObject; @@ -51,9 +51,8 @@ extern DL_IMPORT(PyTypeObject) PyFrame_Type; #define PyFrame_Check(op) ((op)->ob_type == &PyFrame_Type) -DL_IMPORT(PyFrameObject *) PyFrame_New - Py_PROTO((PyThreadState *, PyCodeObject *, - PyObject *, PyObject *)); +DL_IMPORT(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *, + PyObject *, PyObject *); /* The rest of the interface is specific for frame objects */ @@ -80,17 +79,17 @@ DL_IMPORT(PyFrameObject *) PyFrame_New /* Block management functions */ -DL_IMPORT(void) PyFrame_BlockSetup Py_PROTO((PyFrameObject *, int, int, int)); -DL_IMPORT(PyTryBlock *) PyFrame_BlockPop Py_PROTO((PyFrameObject *)); +DL_IMPORT(void) PyFrame_BlockSetup(PyFrameObject *, int, int, int); +DL_IMPORT(PyTryBlock *) PyFrame_BlockPop(PyFrameObject *); /* Extend the value stack */ -DL_IMPORT(PyObject **) PyFrame_ExtendStack Py_PROTO((PyFrameObject *, int, int)); +DL_IMPORT(PyObject **) PyFrame_ExtendStack(PyFrameObject *, int, int); /* Conversions between "fast locals" and locals in dictionary */ -DL_IMPORT(void) PyFrame_LocalsToFast Py_PROTO((PyFrameObject *, int)); -DL_IMPORT(void) PyFrame_FastToLocals Py_PROTO((PyFrameObject *)); +DL_IMPORT(void) PyFrame_LocalsToFast(PyFrameObject *, int); +DL_IMPORT(void) PyFrame_FastToLocals(PyFrameObject *); #ifdef __cplusplus } diff --git a/Include/funcobject.h b/Include/funcobject.h index dc9a9426dc0..e85fc1a6115 100644 --- a/Include/funcobject.h +++ b/Include/funcobject.h @@ -1,9 +1,3 @@ -#ifndef Py_FUNCOBJECT_H -#define Py_FUNCOBJECT_H -#ifdef __cplusplus -extern "C" { -#endif - /*********************************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. @@ -16,24 +10,30 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. /* Function object interface */ +#ifndef Py_FUNCOBJECT_H +#define Py_FUNCOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { - PyObject_HEAD - PyObject *func_code; - PyObject *func_globals; - PyObject *func_defaults; - PyObject *func_doc; - PyObject *func_name; + PyObject_HEAD + PyObject *func_code; + PyObject *func_globals; + PyObject *func_defaults; + PyObject *func_doc; + PyObject *func_name; } PyFunctionObject; extern DL_IMPORT(PyTypeObject) PyFunction_Type; #define PyFunction_Check(op) ((op)->ob_type == &PyFunction_Type) -extern DL_IMPORT(PyObject *) PyFunction_New Py_PROTO((PyObject *, PyObject *)); -extern DL_IMPORT(PyObject *) PyFunction_GetCode Py_PROTO((PyObject *)); -extern DL_IMPORT(PyObject *) PyFunction_GetGlobals Py_PROTO((PyObject *)); -extern DL_IMPORT(PyObject *) PyFunction_GetDefaults Py_PROTO((PyObject *)); -extern DL_IMPORT(int) PyFunction_SetDefaults Py_PROTO((PyObject *, PyObject *)); +extern DL_IMPORT(PyObject *) PyFunction_New(PyObject *, PyObject *); +extern DL_IMPORT(PyObject *) PyFunction_GetCode(PyObject *); +extern DL_IMPORT(PyObject *) PyFunction_GetGlobals(PyObject *); +extern DL_IMPORT(PyObject *) PyFunction_GetDefaults(PyObject *); +extern DL_IMPORT(int) PyFunction_SetDefaults(PyObject *, PyObject *); /* Macros for direct access to these values. Type checks are *not* done, so use with care. */ diff --git a/Include/grammar.h b/Include/grammar.h index a15316eca28..ba67f90152f 100644 --- a/Include/grammar.h +++ b/Include/grammar.h @@ -1,9 +1,3 @@ -#ifndef Py_GRAMMAR_H -#define Py_GRAMMAR_H -#ifdef __cplusplus -extern "C" { -#endif - /*********************************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. @@ -16,13 +10,19 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. /* Grammar interface */ +#ifndef Py_GRAMMAR_H +#define Py_GRAMMAR_H +#ifdef __cplusplus +extern "C" { +#endif + #include "bitset.h" /* Sigh... */ /* A label of an arc */ typedef struct { - int lb_type; - char *lb_str; + int lb_type; + char *lb_str; } label; #define EMPTY 0 /* Label number 0 is by definition the empty label */ @@ -30,72 +30,72 @@ typedef struct { /* A list of labels */ typedef struct { - int ll_nlabels; - label *ll_label; + int ll_nlabels; + label *ll_label; } labellist; /* An arc from one state to another */ typedef struct { - short a_lbl; /* Label of this arc */ - short a_arrow; /* State where this arc goes to */ + short a_lbl; /* Label of this arc */ + short a_arrow; /* State where this arc goes to */ } arc; /* A state in a DFA */ typedef struct { - int s_narcs; - arc *s_arc; /* Array of arcs */ + int s_narcs; + arc *s_arc; /* Array of arcs */ - /* Optional accelerators */ - int s_lower; /* Lowest label index */ - int s_upper; /* Highest label index */ - int *s_accel; /* Accelerator */ - int s_accept; /* Nonzero for accepting state */ + /* Optional accelerators */ + int s_lower; /* Lowest label index */ + int s_upper; /* Highest label index */ + int *s_accel; /* Accelerator */ + int s_accept; /* Nonzero for accepting state */ } state; /* A DFA */ typedef struct { - int d_type; /* Non-terminal this represents */ - char *d_name; /* For printing */ - int d_initial; /* Initial state */ - int d_nstates; - state *d_state; /* Array of states */ - bitset d_first; + int d_type; /* Non-terminal this represents */ + char *d_name; /* For printing */ + int d_initial; /* Initial state */ + int d_nstates; + state *d_state; /* Array of states */ + bitset d_first; } dfa; /* A grammar */ typedef struct { - int g_ndfas; - dfa *g_dfa; /* Array of DFAs */ - labellist g_ll; - int g_start; /* Start symbol of the grammar */ - int g_accel; /* Set if accelerators present */ + int g_ndfas; + dfa *g_dfa; /* Array of DFAs */ + labellist g_ll; + int g_start; /* Start symbol of the grammar */ + int g_accel; /* Set if accelerators present */ } grammar; /* FUNCTIONS */ -grammar *newgrammar Py_PROTO((int start)); -dfa *adddfa Py_PROTO((grammar *g, int type, char *name)); -int addstate Py_PROTO((dfa *d)); -void addarc Py_PROTO((dfa *d, int from, int to, int lbl)); -dfa *PyGrammar_FindDFA Py_PROTO((grammar *g, int type)); -char *typename Py_PROTO((grammar *g, int lbl)); +grammar *newgrammar(int start); +dfa *adddfa(grammar *g, int type, char *name); +int addstate(dfa *d); +void addarc(dfa *d, int from, int to, int lbl); +dfa *PyGrammar_FindDFA(grammar *g, int type); +char *typename(grammar *g, int lbl); -int addlabel Py_PROTO((labellist *ll, int type, char *str)); -int findlabel Py_PROTO((labellist *ll, int type, char *str)); -char *PyGrammar_LabelRepr Py_PROTO((label *lb)); -void translatelabels Py_PROTO((grammar *g)); +int addlabel(labellist *ll, int type, char *str); +int findlabel(labellist *ll, int type, char *str); +char *PyGrammar_LabelRepr(label *lb); +void translatelabels(grammar *g); -void addfirstsets Py_PROTO((grammar *g)); +void addfirstsets(grammar *g); -void PyGrammar_AddAccelerators Py_PROTO((grammar *g)); -void PyGrammar_RemoveAccelerators Py_PROTO((grammar *)); +void PyGrammar_AddAccelerators(grammar *g); +void PyGrammar_RemoveAccelerators(grammar *); -void printgrammar Py_PROTO((grammar *g, FILE *fp)); -void printnonterminals Py_PROTO((grammar *g, FILE *fp)); +void printgrammar(grammar *g, FILE *fp); +void printnonterminals(grammar *g, FILE *fp); #ifdef __cplusplus } diff --git a/Include/intobject.h b/Include/intobject.h index 50a74746b20..925e19a35fb 100644 --- a/Include/intobject.h +++ b/Include/intobject.h @@ -1,9 +1,3 @@ -#ifndef Py_INTOBJECT_H -#define Py_INTOBJECT_H -#ifdef __cplusplus -extern "C" { -#endif - /*********************************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. @@ -29,20 +23,26 @@ The type PyIntObject is (unfortunately) exposed here so we can declare _Py_TrueStruct and _Py_ZeroStruct below; don't use this. */ +#ifndef Py_INTOBJECT_H +#define Py_INTOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { - PyObject_HEAD - long ob_ival; + PyObject_HEAD + long ob_ival; } PyIntObject; extern DL_IMPORT(PyTypeObject) PyInt_Type; #define PyInt_Check(op) ((op)->ob_type == &PyInt_Type) -extern DL_IMPORT(PyObject *) PyInt_FromString Py_PROTO((char*, char**, int)); -extern DL_IMPORT(PyObject *) PyInt_FromUnicode Py_PROTO((Py_UNICODE*, int, int)); -extern DL_IMPORT(PyObject *) PyInt_FromLong Py_PROTO((long)); -extern DL_IMPORT(long) PyInt_AsLong Py_PROTO((PyObject *)); -extern DL_IMPORT(long) PyInt_GetMax Py_PROTO((void)); +extern DL_IMPORT(PyObject *) PyInt_FromString(char*, char**, int); +extern DL_IMPORT(PyObject *) PyInt_FromUnicode(Py_UNICODE*, int, int); +extern DL_IMPORT(PyObject *) PyInt_FromLong(long); +extern DL_IMPORT(long) PyInt_AsLong(PyObject *); +extern DL_IMPORT(long) PyInt_GetMax(void); /* @@ -68,8 +68,8 @@ extern DL_IMPORT(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct; /* Don't use these * into the main Python shared library/DLL. Guido thinks I'm weird for * building it this way. :-) [cjh] */ -extern DL_IMPORT(unsigned long) PyOS_strtoul Py_PROTO((char *, char **, int)); -extern DL_IMPORT(long) PyOS_strtol Py_PROTO((char *, char **, int)); +extern DL_IMPORT(unsigned long) PyOS_strtoul(char *, char **, int); +extern DL_IMPORT(long) PyOS_strtol(char *, char **, int); #ifdef __cplusplus } diff --git a/Include/listobject.h b/Include/listobject.h index e6f008ed1fa..0fea447877e 100644 --- a/Include/listobject.h +++ b/Include/listobject.h @@ -1,9 +1,3 @@ -#ifndef Py_LISTOBJECT_H -#define Py_LISTOBJECT_H -#ifdef __cplusplus -extern "C" { -#endif - /*********************************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. @@ -28,26 +22,32 @@ inserted in the list. Similarly, PyList_GetItem does not increment the returned item's reference count. */ +#ifndef Py_LISTOBJECT_H +#define Py_LISTOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { - PyObject_VAR_HEAD - PyObject **ob_item; + PyObject_VAR_HEAD + PyObject **ob_item; } PyListObject; extern DL_IMPORT(PyTypeObject) PyList_Type; #define PyList_Check(op) ((op)->ob_type == &PyList_Type) -extern DL_IMPORT(PyObject *) PyList_New Py_PROTO((int size)); -extern DL_IMPORT(int) PyList_Size Py_PROTO((PyObject *)); -extern DL_IMPORT(PyObject *) PyList_GetItem Py_PROTO((PyObject *, int)); -extern DL_IMPORT(int) PyList_SetItem Py_PROTO((PyObject *, int, PyObject *)); -extern DL_IMPORT(int) PyList_Insert Py_PROTO((PyObject *, int, PyObject *)); -extern DL_IMPORT(int) PyList_Append Py_PROTO((PyObject *, PyObject *)); -extern DL_IMPORT(PyObject *) PyList_GetSlice Py_PROTO((PyObject *, int, int)); -extern DL_IMPORT(int) PyList_SetSlice Py_PROTO((PyObject *, int, int, PyObject *)); -extern DL_IMPORT(int) PyList_Sort Py_PROTO((PyObject *)); -extern DL_IMPORT(int) PyList_Reverse Py_PROTO((PyObject *)); -extern DL_IMPORT(PyObject *) PyList_AsTuple Py_PROTO((PyObject *)); +extern DL_IMPORT(PyObject *) PyList_New(int size); +extern DL_IMPORT(int) PyList_Size(PyObject *); +extern DL_IMPORT(PyObject *) PyList_GetItem(PyObject *, int); +extern DL_IMPORT(int) PyList_SetItem(PyObject *, int, PyObject *); +extern DL_IMPORT(int) PyList_Insert(PyObject *, int, PyObject *); +extern DL_IMPORT(int) PyList_Append(PyObject *, PyObject *); +extern DL_IMPORT(PyObject *) PyList_GetSlice(PyObject *, int, int); +extern DL_IMPORT(int) PyList_SetSlice(PyObject *, int, int, PyObject *); +extern DL_IMPORT(int) PyList_Sort(PyObject *); +extern DL_IMPORT(int) PyList_Reverse(PyObject *); +extern DL_IMPORT(PyObject *) PyList_AsTuple(PyObject *); /* Macro, trading safety for speed */ #define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i]) diff --git a/Include/methodobject.h b/Include/methodobject.h index c01e8a8f6a2..ace58d31bad 100644 --- a/Include/methodobject.h +++ b/Include/methodobject.h @@ -1,9 +1,3 @@ -#ifndef Py_METHODOBJECT_H -#define Py_METHODOBJECT_H -#ifdef __cplusplus -extern "C" { -#endif - /*********************************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. @@ -16,6 +10,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. /* Method object interface */ +#ifndef Py_METHODOBJECT_H +#define Py_METHODOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + extern DL_IMPORT(PyTypeObject) PyCFunction_Type; #define PyCFunction_Check(op) ((op)->ob_type == &PyCFunction_Type) @@ -24,9 +24,9 @@ typedef PyObject *(*PyCFunction) Py_FPROTO((PyObject *, PyObject *)); typedef PyObject *(*PyCFunctionWithKeywords) Py_FPROTO((PyObject *, PyObject *, PyObject *)); -extern DL_IMPORT(PyCFunction) PyCFunction_GetFunction Py_PROTO((PyObject *)); -extern DL_IMPORT(PyObject *) PyCFunction_GetSelf Py_PROTO((PyObject *)); -extern DL_IMPORT(int) PyCFunction_GetFlags Py_PROTO((PyObject *)); +extern DL_IMPORT(PyCFunction) PyCFunction_GetFunction(PyObject *); +extern DL_IMPORT(PyObject *) PyCFunction_GetSelf(PyObject *); +extern DL_IMPORT(int) PyCFunction_GetFlags(PyObject *); /* Macros for direct access to these values. Type checks are *not* done, so use with care. */ @@ -38,35 +38,33 @@ extern DL_IMPORT(int) PyCFunction_GetFlags Py_PROTO((PyObject *)); (((PyCFunctionObject *)func) -> m_ml -> ml_flags) struct PyMethodDef { - char *ml_name; - PyCFunction ml_meth; - int ml_flags; - char *ml_doc; + char *ml_name; + PyCFunction ml_meth; + int ml_flags; + char *ml_doc; }; typedef struct PyMethodDef PyMethodDef; -extern DL_IMPORT(PyObject *) Py_FindMethod - Py_PROTO((PyMethodDef[], PyObject *, char *)); +extern DL_IMPORT(PyObject *) Py_FindMethod(PyMethodDef[], PyObject *, char *); -extern DL_IMPORT(PyObject *) PyCFunction_New - Py_PROTO((PyMethodDef *, PyObject *)); +extern DL_IMPORT(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *); /* Flag passed to newmethodobject */ #define METH_VARARGS 0x0001 #define METH_KEYWORDS 0x0002 typedef struct PyMethodChain { - PyMethodDef *methods; /* Methods of this type */ - struct PyMethodChain *link; /* NULL or base type */ + PyMethodDef *methods; /* Methods of this type */ + struct PyMethodChain *link; /* NULL or base type */ } PyMethodChain; -extern DL_IMPORT(PyObject *) Py_FindMethodInChain - Py_PROTO((PyMethodChain *, PyObject *, char *)); +extern DL_IMPORT(PyObject *) Py_FindMethodInChain(PyMethodChain *, PyObject *, + char *); typedef struct { - PyObject_HEAD - PyMethodDef *m_ml; - PyObject *m_self; + PyObject_HEAD + PyMethodDef *m_ml; + PyObject *m_self; } PyCFunctionObject; #ifdef __cplusplus