ANSI-fication and Py_PROTO extermination.
This commit is contained in:
parent
5eb6d4e3bf
commit
ea9cb5aebf
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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,6 +12,12 @@ 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 */
|
||||
|
@ -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 *,
|
||||
extern DL_IMPORT(PyObject *) PyInstance_DoBinOp(PyObject *, PyObject *,
|
||||
char *, char *,
|
||||
PyObject * (*) Py_PROTO((PyObject *, PyObject *)) ));
|
||||
PyObject * (*)(PyObject *,
|
||||
PyObject *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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,6 +10,12 @@ 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
|
||||
|
@ -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) \
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/* Complex number structure */
|
||||
|
||||
#ifndef COMPLEXOBJECT_H
|
||||
#define COMPLEXOBJECT_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Complex number structure */
|
||||
|
||||
typedef struct {
|
||||
double real;
|
||||
double imag;
|
||||
|
@ -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 */
|
||||
|
@ -44,12 +44,12 @@ 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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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,6 +14,12 @@ 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;
|
||||
|
@ -29,9 +29,9 @@ 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)
|
||||
|
|
|
@ -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,6 +10,12 @@ 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 */
|
||||
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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,6 +10,12 @@ 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;
|
||||
|
@ -29,11 +29,11 @@ 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. */
|
||||
|
|
|
@ -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,6 +10,12 @@ 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 */
|
||||
|
@ -77,25 +77,25 @@ typedef struct {
|
|||
|
||||
/* 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
|
||||
}
|
||||
|
|
|
@ -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,6 +23,12 @@ 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;
|
||||
|
@ -38,11 +38,11 @@ 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
|
||||
}
|
||||
|
|
|
@ -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,6 +22,12 @@ 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;
|
||||
|
@ -37,17 +37,17 @@ 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])
|
||||
|
|
|
@ -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. */
|
||||
|
@ -45,11 +45,9 @@ struct PyMethodDef {
|
|||
};
|
||||
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
|
||||
|
@ -60,8 +58,8 @@ typedef struct PyMethodChain {
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue