#include "structmember.h"
PyObject *
-PyFunction_New(code, globals)
- PyObject *code;
- PyObject *globals;
+PyFunction_New(PyObject *code, PyObject *globals)
{
PyFunctionObject *op = PyObject_NEW(PyFunctionObject,
&PyFunction_Type);
}
PyObject *
-PyFunction_GetCode(op)
- PyObject *op;
+PyFunction_GetCode(PyObject *op)
{
if (!PyFunction_Check(op)) {
PyErr_BadInternalCall();
}
PyObject *
-PyFunction_GetGlobals(op)
- PyObject *op;
+PyFunction_GetGlobals(PyObject *op)
{
if (!PyFunction_Check(op)) {
PyErr_BadInternalCall();
}
PyObject *
-PyFunction_GetDefaults(op)
- PyObject *op;
+PyFunction_GetDefaults(PyObject *op)
{
if (!PyFunction_Check(op)) {
PyErr_BadInternalCall();
}
int
-PyFunction_SetDefaults(op, defaults)
- PyObject *op;
- PyObject *defaults;
+PyFunction_SetDefaults(PyObject *op, PyObject *defaults)
{
if (!PyFunction_Check(op)) {
PyErr_BadInternalCall();
};
static PyObject *
-func_getattr(op, name)
- PyFunctionObject *op;
- char *name;
+func_getattr(PyFunctionObject *op, char *name)
{
if (name[0] != '_' && PyEval_GetRestricted()) {
PyErr_SetString(PyExc_RuntimeError,
}
static int
-func_setattr(op, name, value)
- PyFunctionObject *op;
- char *name;
- PyObject *value;
+func_setattr(PyFunctionObject *op, char *name, PyObject *value)
{
if (PyEval_GetRestricted()) {
PyErr_SetString(PyExc_RuntimeError,
}
static void
-func_dealloc(op)
- PyFunctionObject *op;
+func_dealloc(PyFunctionObject *op)
{
PyObject_GC_Fini(op);
Py_DECREF(op->func_code);
}
static PyObject*
-func_repr(op)
- PyFunctionObject *op;
+func_repr(PyFunctionObject *op)
{
char buf[140];
if (op->func_name == Py_None)
}
static int
-func_compare(f, g)
- PyFunctionObject *f, *g;
+func_compare(PyFunctionObject *f, PyFunctionObject *g)
{
int c;
if (f->func_globals != g->func_globals)
}
static long
-func_hash(f)
- PyFunctionObject *f;
+func_hash(PyFunctionObject *f)
{
long h,x;
h = PyObject_Hash(f->func_code);
static PyCFunctionObject *free_list = NULL;
PyObject *
-PyCFunction_New(ml, self)
- PyMethodDef *ml;
- PyObject *self;
+PyCFunction_New(PyMethodDef *ml, PyObject *self)
{
PyCFunctionObject *op;
op = free_list;
}
PyCFunction
-PyCFunction_GetFunction(op)
- PyObject *op;
+PyCFunction_GetFunction(PyObject *op)
{
if (!PyCFunction_Check(op)) {
PyErr_BadInternalCall();
}
PyObject *
-PyCFunction_GetSelf(op)
- PyObject *op;
+PyCFunction_GetSelf(PyObject *op)
{
if (!PyCFunction_Check(op)) {
PyErr_BadInternalCall();
}
int
-PyCFunction_GetFlags(op)
- PyObject *op;
+PyCFunction_GetFlags(PyObject *op)
{
if (!PyCFunction_Check(op)) {
PyErr_BadInternalCall();
/* Methods (the standard built-in methods, that is) */
static void
-meth_dealloc(m)
- PyCFunctionObject *m;
+meth_dealloc(PyCFunctionObject *m)
{
Py_XDECREF(m->m_self);
m->m_self = (PyObject *)free_list;
}
static PyObject *
-meth_getattr(m, name)
- PyCFunctionObject *m;
- char *name;
+meth_getattr(PyCFunctionObject *m, char *name)
{
if (strcmp(name, "__name__") == 0) {
return PyString_FromString(m->m_ml->ml_name);
}
static PyObject *
-meth_repr(m)
- PyCFunctionObject *m;
+meth_repr(PyCFunctionObject *m)
{
char buf[200];
if (m->m_self == NULL)
}
static int
-meth_compare(a, b)
- PyCFunctionObject *a, *b;
+meth_compare(PyCFunctionObject *a, PyCFunctionObject *b)
{
if (a->m_self != b->m_self)
return (a->m_self < b->m_self) ? -1 : 1;
}
static long
-meth_hash(a)
- PyCFunctionObject *a;
+meth_hash(PyCFunctionObject *a)
{
long x,y;
if (a->m_self == NULL)
/* List all methods in a chain -- helper for findmethodinchain */
static PyObject *
-listmethodchain(chain)
- PyMethodChain *chain;
+listmethodchain(PyMethodChain *chain)
{
PyMethodChain *c;
PyMethodDef *ml;
/* Find a method in a method chain */
PyObject *
-Py_FindMethodInChain(chain, self, name)
- PyMethodChain *chain;
- PyObject *self;
- char *name;
+Py_FindMethodInChain(PyMethodChain *chain, PyObject *self, char *name)
{
if (name[0] == '_' && name[1] == '_') {
if (strcmp(name, "__methods__") == 0)
/* Find a method in a single method list */
PyObject *
-Py_FindMethod(methods, self, name)
- PyMethodDef *methods;
- PyObject *self;
- char *name;
+Py_FindMethod(PyMethodDef *methods, PyObject *self, char *name)
{
PyMethodChain chain;
chain.methods = methods;
/* Clear out the free list */
void
-PyCFunction_Fini()
+PyCFunction_Fini(void)
{
while (free_list) {
PyCFunctionObject *v = free_list;
} PyModuleObject;
PyObject *
-PyModule_New(name)
- char *name;
+PyModule_New(char *name)
{
PyModuleObject *m;
PyObject *nameobj;
}
PyObject *
-PyModule_GetDict(m)
- PyObject *m;
+PyModule_GetDict(PyObject *m)
{
if (!PyModule_Check(m)) {
PyErr_BadInternalCall();
}
char *
-PyModule_GetName(m)
- PyObject *m;
+PyModule_GetName(PyObject *m)
{
PyObject *nameobj;
if (!PyModule_Check(m)) {
}
char *
-PyModule_GetFilename(m)
- PyObject *m;
+PyModule_GetFilename(PyObject *m)
{
PyObject *fileobj;
if (!PyModule_Check(m)) {
}
void
-_PyModule_Clear(m)
- PyObject *m;
+_PyModule_Clear(PyObject *m)
{
/* To make the execution order of destructors for global
objects a bit more predictable, we first zap all objects
/* Methods */
static void
-module_dealloc(m)
- PyModuleObject *m;
+module_dealloc(PyModuleObject *m)
{
if (m->md_dict != NULL) {
_PyModule_Clear((PyObject *)m);
}
static PyObject *
-module_repr(m)
- PyModuleObject *m;
+module_repr(PyModuleObject *m)
{
char buf[400];
char *name;
}
static PyObject *
-module_getattr(m, name)
- PyModuleObject *m;
- char *name;
+module_getattr(PyModuleObject *m, char *name)
{
PyObject *res;
if (strcmp(name, "__dict__") == 0) {
}
static int
-module_setattr(m, name, v)
- PyModuleObject *m;
- char *name;
- PyObject *v;
+module_setattr(PyModuleObject *m, char *name, PyObject *v)
{
if (name[0] == '_' && strcmp(name, "__dict__") == 0) {
PyErr_SetString(PyExc_TypeError,