Kaydet (Commit) 8ca687a6 authored tarafından Guido van Rossum's avatar Guido van Rossum

use Py_PROTO macro

üst 8ba873b8
......@@ -247,7 +247,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
#define PyObject_DelAttr(O,A) PyObject_SetAttr((O),(A),NULL)
int PyObject_Cmp(PyObject *o1, PyObject *o2, int *result);
int PyObject_Cmp Py_PROTO((PyObject *o1, PyObject *o2, int *result));
/*
Compare the values of o1 and o2 using a routine provided by
......@@ -295,7 +295,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
int PyCallable_Check(PyObject *o);
int PyCallable_Check Py_PROTO((PyObject *o));
/*
Determine if the object, o, is callable. Return 1 if the
......@@ -307,7 +307,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
PyObject *PyObject_CallObject(PyObject *callable_object, PyObject *args);
PyObject *PyObject_CallObject Py_PROTO((PyObject *callable_object,
PyObject *args));
/*
......@@ -319,7 +320,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyObject_CallFunction(PyObject *callable_object, char *format, ...);
PyObject *PyObject_CallFunction Py_PROTO((PyObject *callable_object,
char *format, ...));
/*
Call a callable Python object, callable_object, with a
......@@ -332,7 +334,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyObject_CallMethod(PyObject *o, char *m, char *format, ...);
PyObject *PyObject_CallMethod Py_PROTO((PyObject *o, char *m,
char *format, ...));
/*
Call the method named m of object o with a variable number of
......@@ -372,7 +375,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyObject_Type(PyObject *o);
PyObject *PyObject_Type Py_PROTO((PyObject *o));
/*
On success, returns a type object corresponding to the object
......@@ -380,7 +383,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
equivalent to the Python expression: type(o).
*/
int PyObject_Length(PyObject *o);
int PyObject_Length Py_PROTO((PyObject *o));
/*
Return the length of object o. If the object, o, provides
......@@ -390,7 +393,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyObject_GetItem(PyObject *o, PyObject *key);
PyObject *PyObject_GetItem Py_PROTO((PyObject *o, PyObject *key));
/*
Return element of o corresponding to the object, key, or NULL
......@@ -399,7 +402,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
int PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v);
int PyObject_SetItem Py_PROTO((PyObject *o, PyObject *key, PyObject *v));
/*
Map the object, key, to the value, v. Returns
......@@ -410,7 +413,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* Number Protocol:*/
int PyNumber_Check(PyObject *o);
int PyNumber_Check Py_PROTO((PyObject *o));
/*
Returns 1 if the object, o, provides numeric protocols, and
......@@ -420,7 +423,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Add(PyObject *o1, PyObject *o2);
PyObject *PyNumber_Add Py_PROTO((PyObject *o1, PyObject *o2));
/*
Returns the result of adding o1 and o2, or null on failure.
......@@ -429,7 +432,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Subtract(PyObject *o1, PyObject *o2);
PyObject *PyNumber_Subtract Py_PROTO((PyObject *o1, PyObject *o2));
/*
Returns the result of subtracting o2 from o1, or null on
......@@ -438,7 +441,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Multiply(PyObject *o1, PyObject *o2);
PyObject *PyNumber_Multiply Py_PROTO((PyObject *o1, PyObject *o2));
/*
Returns the result of multiplying o1 and o2, or null on
......@@ -448,7 +451,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Divide(PyObject *o1, PyObject *o2);
PyObject *PyNumber_Divide Py_PROTO((PyObject *o1, PyObject *o2));
/*
Returns the result of dividing o1 by o2, or null on failure.
......@@ -457,7 +460,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Remainder(PyObject *o1, PyObject *o2);
PyObject *PyNumber_Remainder Py_PROTO((PyObject *o1, PyObject *o2));
/*
Returns the remainder of dividing o1 by o2, or null on
......@@ -467,7 +470,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Divmod(PyObject *o1, PyObject *o2);
PyObject *PyNumber_Divmod Py_PROTO((PyObject *o1, PyObject *o2));
/*
See the built-in function divmod. Returns NULL on failure.
......@@ -477,7 +480,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Power(PyObject *o1, PyObject *o2, PyObject *o3);
PyObject *PyNumber_Power Py_PROTO((PyObject *o1, PyObject *o2, PyObject *o3));
/*
See the built-in function pow. Returns NULL on failure.
......@@ -486,7 +489,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Negative(PyObject *o);
PyObject *PyNumber_Negative Py_PROTO((PyObject *o));
/*
Returns the negation of o on success, or null on failure.
......@@ -494,7 +497,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Positive(PyObject *o);
PyObject *PyNumber_Positive Py_PROTO((PyObject *o));
/*
Returns the (what?) of o on success, or NULL on failure.
......@@ -502,7 +505,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Absolute(PyObject *o);
PyObject *PyNumber_Absolute Py_PROTO((PyObject *o));
/*
Returns the absolute value of o, or null on failure. This is
......@@ -510,7 +513,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Invert(PyObject *o);
PyObject *PyNumber_Invert Py_PROTO((PyObject *o));
/*
Returns the bitwise negation of o on success, or NULL on
......@@ -520,7 +523,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Lshift(PyObject *o1, PyObject *o2);
PyObject *PyNumber_Lshift Py_PROTO((PyObject *o1, PyObject *o2));
/*
Returns the result of left shifting o1 by o2 on success, or
......@@ -530,7 +533,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Rshift(PyObject *o1, PyObject *o2);
PyObject *PyNumber_Rshift Py_PROTO((PyObject *o1, PyObject *o2));
/*
Returns the result of right shifting o1 by o2 on success, or
......@@ -539,7 +542,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_And(PyObject *o1, PyObject *o2);
PyObject *PyNumber_And Py_PROTO((PyObject *o1, PyObject *o2));
/*
Returns the result of "anding" o2 and o2 on success and NULL
......@@ -549,7 +552,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Xor(PyObject *o1, PyObject *o2);
PyObject *PyNumber_Xor Py_PROTO((PyObject *o1, PyObject *o2));
/*
Returns the bitwise exclusive or of o1 by o2 on success, or
......@@ -559,7 +562,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Or(PyObject *o1, PyObject *o2);
PyObject *PyNumber_Or Py_PROTO((PyObject *o1, PyObject *o2));
/*
Returns the result or o1 and o2 on success, or NULL on
......@@ -579,7 +582,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Int(PyObject *o);
PyObject *PyNumber_Int Py_PROTO((PyObject *o));
/*
Returns the o converted to an integer object on success, or
......@@ -588,7 +591,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Long(PyObject *o);
PyObject *PyNumber_Long Py_PROTO((PyObject *o));
/*
Returns the o converted to a long integer object on success,
......@@ -597,7 +600,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PyNumber_Float(PyObject *o);
PyObject *PyNumber_Float Py_PROTO((PyObject *o));
/*
Returns the o converted to a float object on success, or NULL
......@@ -608,7 +611,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* Sequence protocol:*/
int PySequence_Check(PyObject *o);
int PySequence_Check Py_PROTO((PyObject *o));
/*
Return 1 if the object provides sequence protocol, and zero
......@@ -618,7 +621,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PySequence_Concat(PyObject *o1, PyObject *o2);
PyObject *PySequence_Concat Py_PROTO((PyObject *o1, PyObject *o2));
/*
Return the concatination of o1 and o2 on success, and NULL on
......@@ -627,7 +630,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PySequence_Repeat(PyObject *o, int count);
PyObject *PySequence_Repeat Py_PROTO((PyObject *o, int count));
/*
Return the result of repeating sequence object o count times,
......@@ -636,7 +639,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PySequence_GetItem(PyObject *o, int i);
PyObject *PySequence_GetItem Py_PROTO((PyObject *o, int i));
/*
Return the ith element of o, or NULL on failure. This is the
......@@ -644,7 +647,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
PyObject *PySequence_GetSlice(PyObject *o, int i1, int i2);
PyObject *PySequence_GetSlice Py_PROTO((PyObject *o, int i1, int i2));
/*
Return the slice of sequence object o between i1 and i2, or
......@@ -653,7 +656,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
int PySequence_SetItem(PyObject *o, int i, PyObject *v);
int PySequence_SetItem Py_PROTO((PyObject *o, int i, PyObject *v));
/*
Assign object v to the ith element of o. Returns
......@@ -662,7 +665,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
int PySequence_SetSlice(PyObject *o, int i1, int i2, PyObject *v);
int PySequence_SetSlice Py_PROTO((PyObject *o, int i1, int i2, PyObject *v));
/*
Assign the sequence object, v, to the slice in sequence
......@@ -670,14 +673,14 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
equivalent of the Python statement: o[i1:i2]=v.
*/
PyObject *PySequence_Tuple(PyObject *o);
PyObject *PySequence_Tuple Py_PROTO((PyObject *o));
/*
Returns the o as a tuple on success, and NULL on failure.
This is equivalent to the Python expression: tuple(o)
*/
int PySequence_Count(PyObject *o, PyObject *value);
int PySequence_Count Py_PROTO((PyObject *o, PyObject *value));
/*
Return the number of occurrences on value on o, that is,
......@@ -686,7 +689,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
expression: o.count(value).
*/
int PySequence_In(PyObject *o, PyObject *value);
int PySequence_In Py_PROTO((PyObject *o, PyObject *value));
/*
Determine if o contains value. If an item in o is equal to
......@@ -694,7 +697,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
is equivalent to the Python expression: value in o.
*/
int PySequence_Index(PyObject *o, PyObject *value);
int PySequence_Index Py_PROTO((PyObject *o, PyObject *value));
/*
Return the first index for which o[i]=value. On error,
......@@ -704,7 +707,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* Mapping protocol:*/
int PyMapping_Check(PyObject *o);
int PyMapping_Check Py_PROTO((PyObject *o));
/*
Return 1 if the object provides mapping protocol, and zero
......@@ -713,7 +716,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
This function always succeeds.
*/
int PyMapping_Length(PyObject *o);
int PyMapping_Length Py_PROTO((PyObject *o));
/*
Returns the number of keys in object o on success, and -1 on
......@@ -721,7 +724,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
this is equivalent to the Python expression: len(o).
*/
int PyMapping_DelItemString(PyObject *o, char *key);
int PyMapping_DelItemString Py_PROTO((PyObject *o, char *key));
/*
Remove the mapping for object, key, from the object *o.
......@@ -729,7 +732,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
the Python statement: del o[key].
*/
int PyMapping_DelItem(PyObject *o, PyObject *key);
int PyMapping_DelItem Py_PROTO((PyObject *o, PyObject *key));
/*
Remove the mapping for object, key, from the object *o.
......@@ -737,7 +740,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
the Python statement: del o[key].
*/
int PyMapping_HasKeyString(PyObject *o, char *key);
int PyMapping_HasKeyString Py_PROTO((PyObject *o, char *key));
/*
On success, return 1 if the mapping object has the key, key,
......@@ -747,7 +750,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
This function always succeeds.
*/
int PyMapping_HasKey(PyObject *o, PyObject *key);
int PyMapping_HasKey Py_PROTO((PyObject *o, PyObject *key));
/*
Return 1 if the mapping object has the key, key,
......@@ -790,7 +793,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
#define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)
PyObject *PyMapping_GetItemString(PyObject *o, char *key);
PyObject *PyMapping_GetItemString Py_PROTO((PyObject *o, char *key));
/*
Return element of o corresponding to the object, key, or NULL
......@@ -798,7 +801,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
o[key].
*/
int PyMapping_SetItemString(PyObject *o, char *key, PyObject *value);
int PyMapping_SetItemString Py_PROTO((PyObject *o, char *key,
PyObject *value));
/*
Map the object, key, to the value, v. Returns
......@@ -807,4 +811,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
#ifdef __cplusplus
}
#endif
#endif /* Py_ABSTRACTOBJECT_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment