declarations yet, those come later.
#include <ctype.h>
-double atof(s)
- char *s;
+double atof(char *s)
{
double a = 0.0;
int e = 0;
static PyObject *filtertuple (PyObject *, PyObject *);
static PyObject *
-builtin___import__(self, args)
- PyObject *self;
- PyObject *args;
+builtin___import__(PyObject *self, PyObject *args)
{
char *name;
PyObject *globals = NULL;
static PyObject *
-builtin_abs(self, args)
- PyObject *self;
- PyObject *args;
+builtin_abs(PyObject *self, PyObject *args)
{
PyObject *v;
static PyObject *
-builtin_apply(self, args)
- PyObject *self;
- PyObject *args;
+builtin_apply(PyObject *self, PyObject *args)
{
PyObject *func, *alist = NULL, *kwdict = NULL;
PyObject *t = NULL, *retval = NULL;
static PyObject *
-builtin_buffer(self, args)
- PyObject *self;
- PyObject *args;
+builtin_buffer(PyObject *self, PyObject *args)
{
PyObject *ob;
int offset = 0;
static PyObject *
-builtin_unicode(self, args)
- PyObject *self;
- PyObject *args;
+builtin_unicode(PyObject *self, PyObject *args)
{
PyObject *v;
char *encoding = NULL;
static PyObject *
-builtin_callable(self, args)
- PyObject *self;
- PyObject *args;
+builtin_callable(PyObject *self, PyObject *args)
{
PyObject *v;
static PyObject *
-builtin_filter(self, args)
- PyObject *self;
- PyObject *args;
+builtin_filter(PyObject *self, PyObject *args)
{
PyObject *func, *seq, *result;
PySequenceMethods *sqf;
static PyObject *
-builtin_chr(self, args)
- PyObject *self;
- PyObject *args;
+builtin_chr(PyObject *self, PyObject *args)
{
long x;
char s[1];
static PyObject *
-builtin_unichr(self, args)
- PyObject *self;
- PyObject *args;
+builtin_unichr(PyObject *self, PyObject *args)
{
long x;
Py_UNICODE s[1];
static PyObject *
-builtin_cmp(self, args)
- PyObject *self;
- PyObject *args;
+builtin_cmp(PyObject *self, PyObject *args)
{
PyObject *a, *b;
int c;
static PyObject *
-builtin_coerce(self, args)
- PyObject *self;
- PyObject *args;
+builtin_coerce(PyObject *self, PyObject *args)
{
PyObject *v, *w;
PyObject *res;
static PyObject *
-builtin_compile(self, args)
- PyObject *self;
- PyObject *args;
+builtin_compile(PyObject *self, PyObject *args)
{
char *str;
char *filename;
#ifndef WITHOUT_COMPLEX
static PyObject *
-complex_from_string(v)
- PyObject *v;
+complex_from_string(PyObject *v)
{
extern double strtod(const char *, char **);
const char *s, *start;
}
static PyObject *
-builtin_complex(self, args)
- PyObject *self;
- PyObject *args;
+builtin_complex(PyObject *self, PyObject *args)
{
PyObject *r, *i, *tmp;
PyNumberMethods *nbr, *nbi = NULL;
#endif
static PyObject *
-builtin_dir(self, args)
- PyObject *self;
- PyObject *args;
+builtin_dir(PyObject *self, PyObject *args)
{
static char *attrlist[] = {"__members__", "__methods__", NULL};
PyObject *v = NULL, *l = NULL, *m = NULL;
static PyObject *
-builtin_divmod(self, args)
- PyObject *self;
- PyObject *args;
+builtin_divmod(PyObject *self, PyObject *args)
{
PyObject *v, *w;
static PyObject *
-builtin_eval(self, args)
- PyObject *self;
- PyObject *args;
+builtin_eval(PyObject *self, PyObject *args)
{
PyObject *cmd;
PyObject *globals = Py_None, *locals = Py_None;
static PyObject *
-builtin_execfile(self, args)
- PyObject *self;
- PyObject *args;
+builtin_execfile(PyObject *self, PyObject *args)
{
char *filename;
PyObject *globals = Py_None, *locals = Py_None;
static PyObject *
-builtin_getattr(self, args)
- PyObject *self;
- PyObject *args;
+builtin_getattr(PyObject *self, PyObject *args)
{
PyObject *v, *result, *dflt = NULL;
PyObject *name;
static PyObject *
-builtin_globals(self, args)
- PyObject *self;
- PyObject *args;
+builtin_globals(PyObject *self, PyObject *args)
{
PyObject *d;
static PyObject *
-builtin_hasattr(self, args)
- PyObject *self;
- PyObject *args;
+builtin_hasattr(PyObject *self, PyObject *args)
{
PyObject *v;
PyObject *name;
static PyObject *
-builtin_id(self, args)
- PyObject *self;
- PyObject *args;
+builtin_id(PyObject *self, PyObject *args)
{
PyObject *v;
static PyObject *
-builtin_map(self, args)
- PyObject *self;
- PyObject *args;
+builtin_map(PyObject *self, PyObject *args)
{
typedef struct {
PyObject *seq;
static PyObject *
-builtin_setattr(self, args)
- PyObject *self;
- PyObject *args;
+builtin_setattr(PyObject *self, PyObject *args)
{
PyObject *v;
PyObject *name;
static PyObject *
-builtin_delattr(self, args)
- PyObject *self;
- PyObject *args;
+builtin_delattr(PyObject *self, PyObject *args)
{
PyObject *v;
PyObject *name;
static PyObject *
-builtin_hash(self, args)
- PyObject *self;
- PyObject *args;
+builtin_hash(PyObject *self, PyObject *args)
{
PyObject *v;
long x;
static PyObject *
-builtin_hex(self, args)
- PyObject *self;
- PyObject *args;
+builtin_hex(PyObject *self, PyObject *args)
{
PyObject *v;
PyNumberMethods *nb;
static PyObject *builtin_raw_input(PyObject *, PyObject *);
static PyObject *
-builtin_input(self, args)
- PyObject *self;
- PyObject *args;
+builtin_input(PyObject *self, PyObject *args)
{
PyObject *line;
char *str;
static PyObject *
-builtin_intern(self, args)
- PyObject *self;
- PyObject *args;
+builtin_intern(PyObject *self, PyObject *args)
{
PyObject *s;
if (!PyArg_ParseTuple(args, "S:intern", &s))
static PyObject *
-builtin_int(self, args)
- PyObject *self;
- PyObject *args;
+builtin_int(PyObject *self, PyObject *args)
{
PyObject *v;
int base = -909; /* unlikely! */
static PyObject *
-builtin_long(self, args)
- PyObject *self;
- PyObject *args;
+builtin_long(PyObject *self, PyObject *args)
{
PyObject *v;
int base = -909; /* unlikely! */
static PyObject *
-builtin_float(self, args)
- PyObject *self;
- PyObject *args;
+builtin_float(PyObject *self, PyObject *args)
{
PyObject *v;
static PyObject *
-builtin_len(self, args)
- PyObject *self;
- PyObject *args;
+builtin_len(PyObject *self, PyObject *args)
{
PyObject *v;
long res;
static PyObject *
-builtin_list(self, args)
- PyObject *self;
- PyObject *args;
+builtin_list(PyObject *self, PyObject *args)
{
PyObject *v;
static PyObject *
-builtin_slice(self, args)
- PyObject *self;
- PyObject *args;
+builtin_slice(PyObject *self, PyObject *args)
{
PyObject *start, *stop, *step;
static PyObject *
-builtin_locals(self, args)
- PyObject *self;
- PyObject *args;
+builtin_locals(PyObject *self, PyObject *args)
{
PyObject *d;
static PyObject *
-min_max(args, sign)
- PyObject *args;
- int sign;
+min_max(PyObject *args, int sign)
{
int i;
PyObject *v, *w, *x;
}
static PyObject *
-builtin_min(self, v)
- PyObject *self;
- PyObject *v;
+builtin_min(PyObject *self, PyObject *v)
{
return min_max(v, -1);
}
static PyObject *
-builtin_max(self, v)
- PyObject *self;
- PyObject *v;
+builtin_max(PyObject *self, PyObject *v)
{
return min_max(v, 1);
}
static PyObject *
-builtin_oct(self, args)
- PyObject *self;
- PyObject *args;
+builtin_oct(PyObject *self, PyObject *args)
{
PyObject *v;
PyNumberMethods *nb;
static PyObject *
-builtin_open(self, args)
- PyObject *self;
- PyObject *args;
+builtin_open(PyObject *self, PyObject *args)
{
char *name;
char *mode = "r";
static PyObject *
-builtin_ord(self, args)
- PyObject *self;
- PyObject *args;
+builtin_ord(PyObject *self, PyObject *args)
{
PyObject *obj;
long ord;
static PyObject *
-builtin_pow(self, args)
- PyObject *self;
- PyObject *args;
+builtin_pow(PyObject *self, PyObject *args)
{
PyObject *v, *w, *z = Py_None;
}
static PyObject *
-builtin_range(self, args)
- PyObject *self;
- PyObject *args;
+builtin_range(PyObject *self, PyObject *args)
{
long ilow = 0, ihigh = 0, istep = 1;
long bign;
static PyObject *
-builtin_xrange(self, args)
- PyObject *self;
- PyObject *args;
+builtin_xrange(PyObject *self, PyObject *args)
{
long ilow = 0, ihigh = 0, istep = 1;
long n;
static PyObject *
-builtin_raw_input(self, args)
- PyObject *self;
- PyObject *args;
+builtin_raw_input(PyObject *self, PyObject *args)
{
PyObject *v = NULL;
PyObject *f;
static PyObject *
-builtin_reduce(self, args)
- PyObject *self;
- PyObject *args;
+builtin_reduce(PyObject *self, PyObject *args)
{
PyObject *seq, *func, *result = NULL;
PySequenceMethods *sqf;
static PyObject *
-builtin_reload(self, args)
- PyObject *self;
- PyObject *args;
+builtin_reload(PyObject *self, PyObject *args)
{
PyObject *v;
static PyObject *
-builtin_repr(self, args)
- PyObject *self;
- PyObject *args;
+builtin_repr(PyObject *self, PyObject *args)
{
PyObject *v;
static PyObject *
-builtin_round(self, args)
- PyObject *self;
- PyObject *args;
+builtin_round(PyObject *self, PyObject *args)
{
double x;
double f;
static PyObject *
-builtin_str(self, args)
- PyObject *self;
- PyObject *args;
+builtin_str(PyObject *self, PyObject *args)
{
PyObject *v;
static PyObject *
-builtin_tuple(self, args)
- PyObject *self;
- PyObject *args;
+builtin_tuple(PyObject *self, PyObject *args)
{
PyObject *v;
static PyObject *
-builtin_type(self, args)
- PyObject *self;
- PyObject *args;
+builtin_type(PyObject *self, PyObject *args)
{
PyObject *v;
static PyObject *
-builtin_vars(self, args)
- PyObject *self;
- PyObject *args;
+builtin_vars(PyObject *self, PyObject *args)
{
PyObject *v = NULL;
PyObject *d;
With an argument, equivalent to object.__dict__.";
static int
-abstract_issubclass(derived, cls, err, first)
- PyObject *derived;
- PyObject *cls;
- char *err;
- int first;
+abstract_issubclass(PyObject *derived, PyObject *cls, char *err, int first)
{
static PyObject *__bases__ = NULL;
PyObject *bases;
}
static PyObject *
-builtin_isinstance(self, args)
- PyObject *self;
- PyObject *args;
+builtin_isinstance(PyObject *self, PyObject *args)
{
PyObject *inst;
PyObject *cls;
static PyObject *
-builtin_issubclass(self, args)
- PyObject *self;
- PyObject *args;
+builtin_issubclass(PyObject *self, PyObject *args)
{
PyObject *derived;
PyObject *cls;
Noteworthy: None is the `nil' object; Ellipsis represents `...' in slices.";
PyObject *
-_PyBuiltin_Init()
+_PyBuiltin_Init(void)
{
PyObject *mod, *dict, *debug;
mod = Py_InitModule4("__builtin__", builtin_methods,
/* Helper for filter(): filter a tuple through a function */
static PyObject *
-filtertuple(func, tuple)
- PyObject *func;
- PyObject *tuple;
+filtertuple(PyObject *func, PyObject *tuple)
{
PyObject *result;
register int i, j;
/* Helper for filter(): filter a string through a function */
static PyObject *
-filterstring(func, strobj)
- PyObject *func;
- PyObject *strobj;
+filterstring(PyObject *func, PyObject *strobj)
{
PyObject *result;
register int i, j;
static long main_thread = 0;
void
-PyEval_InitThreads()
+PyEval_InitThreads(void)
{
if (interpreter_lock)
return;
}
void
-PyEval_AcquireLock()
+PyEval_AcquireLock(void)
{
PyThread_acquire_lock(interpreter_lock, 1);
}
void
-PyEval_ReleaseLock()
+PyEval_ReleaseLock(void)
{
PyThread_release_lock(interpreter_lock);
}
void
-PyEval_AcquireThread(tstate)
- PyThreadState *tstate;
+PyEval_AcquireThread(PyThreadState *tstate)
{
if (tstate == NULL)
Py_FatalError("PyEval_AcquireThread: NULL new thread state");
}
void
-PyEval_ReleaseThread(tstate)
- PyThreadState *tstate;
+PyEval_ReleaseThread(PyThreadState *tstate)
{
if (tstate == NULL)
Py_FatalError("PyEval_ReleaseThread: NULL thread state");
with and without threads: */
PyThreadState *
-PyEval_SaveThread()
+PyEval_SaveThread(void)
{
PyThreadState *tstate = PyThreadState_Swap(NULL);
if (tstate == NULL)
}
void
-PyEval_RestoreThread(tstate)
- PyThreadState *tstate;
+PyEval_RestoreThread(PyThreadState *tstate)
{
if (tstate == NULL)
Py_FatalError("PyEval_RestoreThread: NULL tstate");
static volatile int things_to_do = 0;
int
-Py_AddPendingCall(func, arg)
- int (*func)(ANY *);
- ANY *arg;
+Py_AddPendingCall(int (*func)(ANY *), ANY *arg)
{
static int busy = 0;
int i, j;
}
int
-Py_MakePendingCalls()
+Py_MakePendingCalls(void)
{
static int busy = 0;
#ifdef WITH_THREAD
PyObject *
-PyEval_EvalCode(co, globals, locals)
- PyCodeObject *co;
- PyObject *globals;
- PyObject *locals;
+PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals)
{
return eval_code2(co,
globals, locals,
#endif
static PyObject *
-eval_code2(co, globals, locals,
- args, argcount, kws, kwcount, defs, defcount, owner)
- PyCodeObject *co;
- PyObject *globals;
- PyObject *locals;
- PyObject **args;
- int argcount;
- PyObject **kws; /* length: 2*kwcount */
- int kwcount;
- PyObject **defs;
- int defcount;
- PyObject *owner;
+eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals,
+ PyObject **args, int argcount, PyObject **kws, int kwcount,
+ PyObject **defs, int defcount, PyObject *owner)
{
#ifdef DXPAIRS
int lastopcode = 0;
}
static void
-set_exc_info(tstate, type, value, tb)
- PyThreadState *tstate;
- PyObject *type;
- PyObject *value;
- PyObject *tb;
+set_exc_info(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb)
{
PyFrameObject *frame;
PyObject *tmp_type, *tmp_value, *tmp_tb;
}
static void
-reset_exc_info(tstate)
- PyThreadState *tstate;
+reset_exc_info(PyThreadState *tstate)
{
PyFrameObject *frame;
PyObject *tmp_type, *tmp_value, *tmp_tb;
/* Logic for the raise statement (too complicated for inlining).
This *consumes* a reference count to each of its arguments. */
static enum why_code
-do_raise(type, value, tb)
- PyObject *type, *value, *tb;
+do_raise(PyObject *type, PyObject *value, PyObject *tb)
{
if (type == NULL) {
/* Reraise */
}
static int
-unpack_sequence(v, argcnt, sp)
- PyObject *v;
- int argcnt;
- PyObject **sp;
+unpack_sequence(PyObject *v, int argcnt, PyObject **sp)
{
int i;
PyObject *w;
#ifdef LLTRACE
static int
-prtrace(v, str)
- PyObject *v;
- char *str;
+prtrace(PyObject *v, char *str)
{
printf("%s ", str);
if (PyObject_Print(v, stdout, 0) != 0)
#endif
static void
-call_exc_trace(p_trace, p_newtrace, f)
- PyObject **p_trace, **p_newtrace;
- PyFrameObject *f;
+call_exc_trace(PyObject **p_trace, PyObject **p_newtrace, PyFrameObject *f)
{
PyObject *type, *value, *traceback, *arg;
int err;
}
}
+/* PyObject **p_trace: in/out; may not be NULL;
+ may not point to NULL variable initially
+ PyObject **p_newtrace: in/out; may be NULL;
+ may point to NULL variable;
+ may be same variable as p_newtrace */
+
static int
-call_trace(p_trace, p_newtrace, f, msg, arg)
- PyObject **p_trace; /* in/out; may not be NULL;
- may not point to NULL variable initially */
- PyObject **p_newtrace; /* in/out; may be NULL;
- may point to NULL variable;
- may be same variable as p_newtrace */
- PyFrameObject *f;
- char *msg;
- PyObject *arg;
+call_trace(PyObject **p_trace, PyObject **p_newtrace, PyFrameObject *f,
+ char *msg, PyObject *arg)
{
PyThreadState *tstate = f->f_tstate;
PyObject *args, *what;
}
PyObject *
-PyEval_GetBuiltins()
+PyEval_GetBuiltins(void)
{
PyThreadState *tstate = PyThreadState_Get();
PyFrameObject *current_frame = tstate->frame;
}
PyObject *
-PyEval_GetLocals()
+PyEval_GetLocals(void)
{
PyFrameObject *current_frame = PyThreadState_Get()->frame;
if (current_frame == NULL)
}
PyObject *
-PyEval_GetGlobals()
+PyEval_GetGlobals(void)
{
PyFrameObject *current_frame = PyThreadState_Get()->frame;
if (current_frame == NULL)
}
PyObject *
-PyEval_GetFrame()
+PyEval_GetFrame(void)
{
PyFrameObject *current_frame = PyThreadState_Get()->frame;
return (PyObject *)current_frame;
}
int
-PyEval_GetRestricted()
+PyEval_GetRestricted(void)
{
PyFrameObject *current_frame = PyThreadState_Get()->frame;
return current_frame == NULL ? 0 : current_frame->f_restricted;
}
int
-Py_FlushLine()
+Py_FlushLine(void)
{
PyObject *f = PySys_GetObject("stdout");
if (f == NULL)
/* for backward compatibility: export this interface */
PyObject *
-PyEval_CallObject(func, arg)
- PyObject *func;
- PyObject *arg;
+PyEval_CallObject(PyObject *func, PyObject *arg)
{
return PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL);
}
PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL)
PyObject *
-PyEval_CallObjectWithKeywords(func, arg, kw)
- PyObject *func;
- PyObject *arg;
- PyObject *kw;
+PyEval_CallObjectWithKeywords(PyObject *func, PyObject *arg, PyObject *kw)
{
ternaryfunc call;
PyObject *result;
}
static PyObject *
-call_builtin(func, arg, kw)
- PyObject *func;
- PyObject *arg;
- PyObject *kw;
+call_builtin(PyObject *func, PyObject *arg, PyObject *kw)
{
if (PyCFunction_Check(func)) {
PyCFunction meth = PyCFunction_GetFunction(func);
}
static PyObject *
-call_function(func, arg, kw)
- PyObject *func;
- PyObject *arg;
- PyObject *kw;
+call_function(PyObject *func, PyObject *arg, PyObject *kw)
{
PyObject *class = NULL; /* == owner */
PyObject *argdefs;
"standard sequence type does not support step size other than one"
static PyObject *
-loop_subscript(v, w)
- PyObject *v, *w;
+loop_subscript(PyObject *v, PyObject *w)
{
PySequenceMethods *sq = v->ob_type->tp_as_sequence;
int i;
and error. Returns 1 on success.*/
int
-_PyEval_SliceIndex(v, pi)
- PyObject *v;
- int *pi;
+_PyEval_SliceIndex(PyObject *v, int *pi)
{
if (v != NULL) {
long x;
}
static PyObject *
-apply_slice(u, v, w) /* return u[v:w] */
- PyObject *u, *v, *w;
+apply_slice(PyObject *u, PyObject *v, PyObject *w) /* return u[v:w] */
{
int ilow = 0, ihigh = INT_MAX;
if (!_PyEval_SliceIndex(v, &ilow))
}
static int
-assign_slice(u, v, w, x) /* u[v:w] = x */
- PyObject *u, *v, *w, *x;
+assign_slice(PyObject *u, PyObject *v, PyObject *w, PyObject *x) /* u[v:w] = x */
{
int ilow = 0, ihigh = INT_MAX;
if (!_PyEval_SliceIndex(v, &ilow))
}
static PyObject *
-cmp_outcome(op, v, w)
- int op;
- register PyObject *v;
- register PyObject *w;
+cmp_outcome(int op, register PyObject *v, register PyObject *w)
{
register int cmp;
register int res = 0;
}
static int
-import_from(locals, v, name)
- PyObject *locals;
- PyObject *v;
- PyObject *name;
+import_from(PyObject *locals, PyObject *v, PyObject *name)
{
PyObject *w, *x;
if (!PyModule_Check(v)) {
}
static PyObject *
-build_class(methods, bases, name)
- PyObject *methods; /* dictionary */
- PyObject *bases; /* tuple containing classes */
- PyObject *name; /* string */
+build_class(PyObject *methods, PyObject *bases, PyObject *name)
{
int i, n;
if (!PyTuple_Check(bases)) {
}
static int
-exec_statement(f, prog, globals, locals)
- PyFrameObject *f;
- PyObject *prog;
- PyObject *globals;
- PyObject *locals;
+exec_statement(PyFrameObject *f, PyObject *prog, PyObject *globals,
+ PyObject *locals)
{
int n;
PyObject *v;
/* Hack for ni.py */
static PyObject *
-find_from_args(f, nexti)
- PyFrameObject *f;
- int nexti;
+find_from_args(PyFrameObject *f, int nexti)
{
int opcode;
int oparg;
#ifdef DYNAMIC_EXECUTION_PROFILE
PyObject *
-getarray(a)
- long a[256];
+getarray(long a[256])
{
int i;
PyObject *l = PyList_New(256);
}
PyObject *
-_Py_GetDXProfile(self, args)
- PyObject *self, *args;
+_Py_GetDXProfile(PyObject *self, PyObject *args)
{
#ifndef DXPAIRS
return getarray(dxp);
*/
static
-int import_encodings()
+int import_encodings(void)
{
PyObject *mod;
return NULL;
}
-void _PyCodecRegistry_Init()
+void _PyCodecRegistry_Init(void)
{
if (_PyCodec_SearchPath == NULL)
_PyCodec_SearchPath = PyList_New(0);
Py_FatalError("can't initialize codec registry");
}
-void _PyCodecRegistry_Fini()
+void _PyCodecRegistry_Fini(void)
{
Py_XDECREF(_PyCodec_SearchPath);
_PyCodec_SearchPath = NULL;
};
static PyObject *
-code_getattr(co, name)
- PyCodeObject *co;
- char *name;
+code_getattr(PyCodeObject *co, char *name)
{
return PyMember_Get((char *)co, code_memberlist, name);
}
static void
-code_dealloc(co)
- PyCodeObject *co;
+code_dealloc(PyCodeObject *co)
{
Py_XDECREF(co->co_code);
Py_XDECREF(co->co_consts);
}
static PyObject *
-code_repr(co)
- PyCodeObject *co;
+code_repr(PyCodeObject *co)
{
char buf[500];
int lineno = -1;
}
static int
-code_compare(co, cp)
- PyCodeObject *co, *cp;
+code_compare(PyCodeObject *co, PyCodeObject *cp)
{
int cmp;
cmp = PyObject_Compare(co->co_name, cp->co_name);
}
static long
-code_hash(co)
- PyCodeObject *co;
+code_hash(PyCodeObject *co)
{
long h, h0, h1, h2, h3, h4;
h0 = PyObject_Hash(co->co_name);
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"
PyCodeObject *
-PyCode_New(argcount, nlocals, stacksize, flags,
- code, consts, names, varnames, filename, name,
- firstlineno, lnotab)
- int argcount;
- int nlocals;
- int stacksize;
- int flags;
- PyObject *code;
- PyObject *consts;
- PyObject *names;
- PyObject *varnames;
- PyObject *filename;
- PyObject *name;
- int firstlineno;
- PyObject *lnotab;
+PyCode_New(int argcount, int nlocals, int stacksize, int flags,
+ PyObject *code, PyObject *consts, PyObject *names,
+ PyObject *varnames, PyObject *filename, PyObject *name,
+ int firstlineno, PyObject *lnotab)
{
PyCodeObject *co;
int i;
/* Error message including line number */
static void
-com_error(c, exc, msg)
- struct compiling *c;
- PyObject *exc;
- char *msg;
+com_error(struct compiling *c, PyObject *exc, char *msg)
{
size_t n = strlen(msg);
PyObject *v;
/* Interface to the block stack */
static void
-block_push(c, type)
- struct compiling *c;
- int type;
+block_push(struct compiling *c, int type)
{
if (c->c_nblocks >= CO_MAXBLOCKS) {
com_error(c, PyExc_SystemError,
}
static void
-block_pop(c, type)
- struct compiling *c;
- int type;
+block_pop(struct compiling *c, int type)
{
if (c->c_nblocks > 0)
c->c_nblocks--;
static PyObject *parsestr(char *);
static int
-com_init(c, filename)
- struct compiling *c;
- char *filename;
+com_init(struct compiling *c, char *filename)
{
memset((void *)c, '\0', sizeof(struct compiling));
if ((c->c_code = PyString_FromStringAndSize((char *)NULL,
}
static void
-com_free(c)
- struct compiling *c;
+com_free(struct compiling *c)
{
Py_XDECREF(c->c_code);
Py_XDECREF(c->c_consts);
}
static void
-com_push(c, n)
- struct compiling *c;
- int n;
+com_push(struct compiling *c, int n)
{
c->c_stacklevel += n;
if (c->c_stacklevel > c->c_maxstacklevel)
}
static void
-com_pop(c, n)
- struct compiling *c;
- int n;
+com_pop(struct compiling *c, int n)
{
if (c->c_stacklevel < n) {
/* fprintf(stderr,
}
static void
-com_done(c)
- struct compiling *c;
+com_done(struct compiling *c)
{
if (c->c_code != NULL)
_PyString_Resize(&c->c_code, c->c_nexti);
}
static void
-com_addbyte(c, byte)
- struct compiling *c;
- int byte;
+com_addbyte(struct compiling *c, int byte)
{
int len;
/*fprintf(stderr, "%3d: %3d\n", c->c_nexti, byte);*/
}
static void
-com_addint(c, x)
- struct compiling *c;
- int x;
+com_addint(struct compiling *c, int x)
{
com_addbyte(c, x & 0xff);
com_addbyte(c, x >> 8); /* XXX x should be positive */
}
static void
-com_add_lnotab(c, addr, line)
- struct compiling *c;
- int addr;
- int line;
+com_add_lnotab(struct compiling *c, int addr, int line)
{
int size;
char *p;
}
static void
-com_set_lineno(c, lineno)
- struct compiling *c;
- int lineno;
+com_set_lineno(struct compiling *c, int lineno)
{
c->c_lineno = lineno;
if (c->c_firstlineno == 0) {
}
static void
-com_addoparg(c, op, arg)
- struct compiling *c;
- int op;
- int arg;
+com_addoparg(struct compiling *c, int op, int arg)
{
if (op == SET_LINENO) {
com_set_lineno(c, arg);
}
static void
-com_addfwref(c, op, p_anchor)
- struct compiling *c;
- int op;
- int *p_anchor;
+com_addfwref(struct compiling *c, int op, int *p_anchor)
{
/* Compile a forward reference for backpatching */
int here;
}
static void
-com_backpatch(c, anchor)
- struct compiling *c;
- int anchor; /* Must be nonzero */
+com_backpatch(struct compiling *c, int anchor)
{
unsigned char *code = (unsigned char *) PyString_AsString(c->c_code);
int target = c->c_nexti;
/* Handle literals and names uniformly */
static int
-com_add(c, list, dict, v)
- struct compiling *c;
- PyObject *list;
- PyObject *dict;
- PyObject *v;
+com_add(struct compiling *c, PyObject *list, PyObject *dict, PyObject *v)
{
PyObject *w, *t, *np=NULL;
long n;
}
static int
-com_addconst(c, v)
- struct compiling *c;
- PyObject *v;
+com_addconst(struct compiling *c, PyObject *v)
{
return com_add(c, c->c_consts, c->c_const_dict, v);
}
static int
-com_addname(c, v)
- struct compiling *c;
- PyObject *v;
+com_addname(struct compiling *c, PyObject *v)
{
return com_add(c, c->c_names, c->c_name_dict, v);
}
#ifdef PRIVATE_NAME_MANGLING
static int
-com_mangle(c, name, buffer, maxlen)
- struct compiling *c;
- char *name;
- char *buffer;
- size_t maxlen;
+com_mangle(struct compiling *c, char *name, char *buffer, size_t maxlen)
{
/* Name mangling: __private becomes _classname__private.
This is independent from how the name is used. */
#endif
static void
-com_addopnamestr(c, op, name)
- struct compiling *c;
- int op;
- char *name;
+com_addopnamestr(struct compiling *c, int op, char *name)
{
PyObject *v;
int i;
}
static void
-com_addopname(c, op, n)
- struct compiling *c;
- int op;
- node *n;
+com_addopname(struct compiling *c, int op, node *n)
{
char *name;
char buffer[1000];
}
static PyObject *
-parsenumber(co, s)
- struct compiling *co;
- char *s;
+parsenumber(struct compiling *co, char *s)
{
extern double atof(const char *);
char *end;
}
static PyObject *
-parsestr(s)
- char *s;
+parsestr(char *s)
{
PyObject *v;
size_t len;
}
static PyObject *
-parsestrplus(n)
- node *n;
+parsestrplus(node *n)
{
PyObject *v;
int i;
}
static void
-com_list_constructor(c, n)
- struct compiling *c;
- node *n;
+com_list_constructor(struct compiling *c, node *n)
{
int len;
int i;
}
static void
-com_dictmaker(c, n)
- struct compiling *c;
- node *n;
+com_dictmaker(struct compiling *c, node *n)
{
int i;
/* dictmaker: test ':' test (',' test ':' value)* [','] */
}
static void
-com_atom(c, n)
- struct compiling *c;
- node *n;
+com_atom(struct compiling *c, node *n)
{
node *ch;
PyObject *v;
}
static void
-com_slice(c, n, op)
- struct compiling *c;
- node *n;
- int op;
+com_slice(struct compiling *c, node *n, int op)
{
if (NCH(n) == 1) {
com_addbyte(c, op);
}
static void
-com_argument(c, n, pkeywords)
- struct compiling *c;
- node *n; /* argument */
- PyObject **pkeywords;
+com_argument(struct compiling *c, node *n, PyObject **pkeywords)
{
node *m;
REQ(n, argument); /* [test '='] test; really [keyword '='] test */
}
static void
-com_call_function(c, n)
- struct compiling *c;
- node *n; /* EITHER arglist OR ')' */
+com_call_function(struct compiling *c, node *n)
{
if (TYPE(n) == RPAR) {
com_addoparg(c, CALL_FUNCTION, 0);
}
static void
-com_select_member(c, n)
- struct compiling *c;
- node *n;
+com_select_member(struct compiling *c, node *n)
{
com_addopname(c, LOAD_ATTR, n);
}
static void
-com_sliceobj(c, n)
- struct compiling *c;
- node *n;
+com_sliceobj(struct compiling *c, node *n)
{
int i=0;
int ns=2; /* number of slice arguments */
}
static void
-com_subscript(c, n)
- struct compiling *c;
- node *n;
+com_subscript(struct compiling *c, node *n)
{
node *ch;
REQ(n, subscript);
}
static void
-com_subscriptlist(c, n, assigning)
- struct compiling *c;
- node *n;
- int assigning;
+com_subscriptlist(struct compiling *c, node *n, int assigning)
{
int i, op;
REQ(n, subscriptlist);
}
static void
-com_apply_trailer(c, n)
- struct compiling *c;
- node *n;
+com_apply_trailer(struct compiling *c, node *n)
{
REQ(n, trailer);
switch (TYPE(CHILD(n, 0))) {
}
static void
-com_power(c, n)
- struct compiling *c;
- node *n;
+com_power(struct compiling *c, node *n)
{
int i;
REQ(n, power);
}
static void
-com_factor(c, n)
- struct compiling *c;
- node *n;
+com_factor(struct compiling *c, node *n)
{
REQ(n, factor);
if (TYPE(CHILD(n, 0)) == PLUS) {
}
static void
-com_term(c, n)
- struct compiling *c;
- node *n;
+com_term(struct compiling *c, node *n)
{
int i;
int op;
}
static void
-com_arith_expr(c, n)
- struct compiling *c;
- node *n;
+com_arith_expr(struct compiling *c, node *n)
{
int i;
int op;
}
static void
-com_shift_expr(c, n)
- struct compiling *c;
- node *n;
+com_shift_expr(struct compiling *c, node *n)
{
int i;
int op;
}
static void
-com_and_expr(c, n)
- struct compiling *c;
- node *n;
+com_and_expr(struct compiling *c, node *n)
{
int i;
int op;
}
static void
-com_xor_expr(c, n)
- struct compiling *c;
- node *n;
+com_xor_expr(struct compiling *c, node *n)
{
int i;
int op;
}
static void
-com_expr(c, n)
- struct compiling *c;
- node *n;
+com_expr(struct compiling *c, node *n)
{
int i;
int op;
}
static enum cmp_op
-cmp_type(n)
- node *n;
+cmp_type(node *n)
{
REQ(n, comp_op);
/* comp_op: '<' | '>' | '=' | '>=' | '<=' | '<>' | '!=' | '=='
}
static void
-com_comparison(c, n)
- struct compiling *c;
- node *n;
+com_comparison(struct compiling *c, node *n)
{
int i;
enum cmp_op op;
}
static void
-com_not_test(c, n)
- struct compiling *c;
- node *n;
+com_not_test(struct compiling *c, node *n)
{
REQ(n, not_test); /* 'not' not_test | comparison */
if (NCH(n) == 1) {
}
static void
-com_and_test(c, n)
- struct compiling *c;
- node *n;
+com_and_test(struct compiling *c, node *n)
{
int i;
int anchor;
}
static void
-com_test(c, n)
- struct compiling *c;
- node *n;
+com_test(struct compiling *c, node *n)
{
REQ(n, test); /* and_test ('or' and_test)* | lambdef */
if (NCH(n) == 1 && TYPE(CHILD(n, 0)) == lambdef) {
}
static void
-com_list(c, n, toplevel)
- struct compiling *c;
- node *n;
- int toplevel; /* If nonzero, *always* build a tuple */
+com_list(struct compiling *c, node *n, int toplevel)
{
/* exprlist: expr (',' expr)* [',']; likewise for testlist */
if (NCH(n) == 1 && !toplevel) {
static void com_assign(struct compiling *, node *, int);
static void
-com_assign_attr(c, n, assigning)
- struct compiling *c;
- node *n;
- int assigning;
+com_assign_attr(struct compiling *c, node *n, int assigning)
{
com_addopname(c, assigning ? STORE_ATTR : DELETE_ATTR, n);
com_pop(c, assigning ? 2 : 1);
}
static void
-com_assign_trailer(c, n, assigning)
- struct compiling *c;
- node *n;
- int assigning;
+com_assign_trailer(struct compiling *c, node *n, int assigning)
{
REQ(n, trailer);
switch (TYPE(CHILD(n, 0))) {
}
static void
-com_assign_tuple(c, n, assigning)
- struct compiling *c;
- node *n;
- int assigning;
+com_assign_tuple(struct compiling *c, node *n, int assigning)
{
int i;
if (TYPE(n) != testlist)
}
static void
-com_assign_list(c, n, assigning)
- struct compiling *c;
- node *n;
- int assigning;
+com_assign_list(struct compiling *c, node *n, int assigning)
{
int i;
if (assigning) {
}
static void
-com_assign_name(c, n, assigning)
- struct compiling *c;
- node *n;
- int assigning;
+com_assign_name(struct compiling *c, node *n, int assigning)
{
REQ(n, NAME);
com_addopname(c, assigning ? STORE_NAME : DELETE_NAME, n);
}
static void
-com_assign(c, n, assigning)
- struct compiling *c;
- node *n;
- int assigning;
+com_assign(struct compiling *c, node *n, int assigning)
{
/* Loop to avoid trivial recursion */
for (;;) {
/* Forward */ static node *get_rawdocstring(node *);
static void
-com_expr_stmt(c, n)
- struct compiling *c;
- node *n;
+com_expr_stmt(struct compiling *c, node *n)
{
REQ(n, expr_stmt); /* testlist ('=' testlist)* */
/* Forget it if we have just a doc string here */
}
static void
-com_assert_stmt(c, n)
- struct compiling *c;
- node *n;
+com_assert_stmt(struct compiling *c, node *n)
{
int a = 0, b = 0;
int i;
}
static void
-com_print_stmt(c, n)
- struct compiling *c;
- node *n;
+com_print_stmt(struct compiling *c, node *n)
{
int i;
REQ(n, print_stmt); /* 'print' (test ',')* [test] */
}
static void
-com_return_stmt(c, n)
- struct compiling *c;
- node *n;
+com_return_stmt(struct compiling *c, node *n)
{
REQ(n, return_stmt); /* 'return' [testlist] */
if (!c->c_infunction) {
}
static void
-com_raise_stmt(c, n)
- struct compiling *c;
- node *n;
+com_raise_stmt(struct compiling *c, node *n)
{
int i;
REQ(n, raise_stmt); /* 'raise' [test [',' test [',' test]]] */
}
static void
-com_import_stmt(c, n)
- struct compiling *c;
- node *n;
+com_import_stmt(struct compiling *c, node *n)
{
int i;
REQ(n, import_stmt);
}
static void
-com_global_stmt(c, n)
- struct compiling *c;
- node *n;
+com_global_stmt(struct compiling *c, node *n)
{
int i;
REQ(n, global_stmt);
}
static int
-com_newlocal_o(c, nameval)
- struct compiling *c;
- PyObject *nameval;
+com_newlocal_o(struct compiling *c, PyObject *nameval)
{
int i;
PyObject *ival;
}
static int
-com_addlocal_o(c, nameval)
- struct compiling *c;
- PyObject *nameval;
+com_addlocal_o(struct compiling *c, PyObject *nameval)
{
PyObject *ival = PyDict_GetItem(c->c_locals, nameval);
if (ival != NULL)
}
static int
-com_newlocal(c, name)
- struct compiling *c;
- char *name;
+com_newlocal(struct compiling *c, char *name)
{
PyObject *nameval = PyString_InternFromString(name);
int i;
}
static void
-com_exec_stmt(c, n)
- struct compiling *c;
- node *n;
+com_exec_stmt(struct compiling *c, node *n)
{
REQ(n, exec_stmt);
/* exec_stmt: 'exec' expr ['in' expr [',' expr]] */
}
static int
-is_constant_false(c, n)
- struct compiling *c;
- node *n;
+is_constant_false(struct compiling *c, node *n)
{
PyObject *v;
int i;
}
static void
-com_if_stmt(c, n)
- struct compiling *c;
- node *n;
+com_if_stmt(struct compiling *c, node *n)
{
int i;
int anchor = 0;
}
static void
-com_while_stmt(c, n)
- struct compiling *c;
- node *n;
+com_while_stmt(struct compiling *c, node *n)
{
int break_anchor = 0;
int anchor = 0;
}
static void
-com_for_stmt(c, n)
- struct compiling *c;
- node *n;
+com_for_stmt(struct compiling *c, node *n)
{
PyObject *v;
int break_anchor = 0;
*/
static void
-com_try_except(c, n)
- struct compiling *c;
- node *n;
+com_try_except(struct compiling *c, node *n)
{
int except_anchor = 0;
int end_anchor = 0;
}
static void
-com_try_finally(c, n)
- struct compiling *c;
- node *n;
+com_try_finally(struct compiling *c, node *n)
{
int finally_anchor = 0;
node *ch;
}
static void
-com_try_stmt(c, n)
- struct compiling *c;
- node *n;
+com_try_stmt(struct compiling *c, node *n)
{
REQ(n, try_stmt);
/* 'try' ':' suite (except_clause ':' suite)+ ['else' ':' suite]
}
static node *
-get_rawdocstring(n)
- node *n;
+get_rawdocstring(node *n)
{
int i;
}
static PyObject *
-get_docstring(n)
- node *n;
+get_docstring(node *n)
{
/* Don't generate doc-strings if run with -OO */
if (Py_OptimizeFlag > 1)
}
static void
-com_suite(c, n)
- struct compiling *c;
- node *n;
+com_suite(struct compiling *c, node *n)
{
REQ(n, suite);
/* simple_stmt | NEWLINE INDENT NEWLINE* (stmt NEWLINE*)+ DEDENT */
/* ARGSUSED */
static void
-com_continue_stmt(c, n)
- struct compiling *c;
- node *n; /* Not used, but passed for consistency */
+com_continue_stmt(struct compiling *c, node *n)
{
int i = c->c_nblocks;
if (i-- > 0 && c->c_block[i] == SETUP_LOOP) {
}
static int
-com_argdefs(c, n)
- struct compiling *c;
- node *n;
+com_argdefs(struct compiling *c, node *n)
{
int i, nch, nargs, ndefs;
if (TYPE(n) == lambdef) {
}
static void
-com_funcdef(c, n)
- struct compiling *c;
- node *n;
+com_funcdef(struct compiling *c, node *n)
{
PyObject *v;
REQ(n, funcdef); /* funcdef: 'def' NAME parameters ':' suite */
}
static void
-com_bases(c, n)
- struct compiling *c;
- node *n;
+com_bases(struct compiling *c, node *n)
{
int i;
REQ(n, testlist);
}
static void
-com_classdef(c, n)
- struct compiling *c;
- node *n;
+com_classdef(struct compiling *c, node *n)
{
int i;
PyObject *v;
}
static void
-com_node(c, n)
- struct compiling *c;
- node *n;
+com_node(struct compiling *c, node *n)
{
switch (TYPE(n)) {
static void com_fplist(struct compiling *, node *);
static void
-com_fpdef(c, n)
- struct compiling *c;
- node *n;
+com_fpdef(struct compiling *c, node *n)
{
REQ(n, fpdef); /* fpdef: NAME | '(' fplist ')' */
if (TYPE(CHILD(n, 0)) == LPAR)
}
static void
-com_fplist(c, n)
- struct compiling *c;
- node *n;
+com_fplist(struct compiling *c, node *n)
{
REQ(n, fplist); /* fplist: fpdef (',' fpdef)* [','] */
if (NCH(n) == 1) {
}
static void
-com_arglist(c, n)
- struct compiling *c;
- node *n;
+com_arglist(struct compiling *c, node *n)
{
int nch, i;
int complex = 0;
}
static void
-com_file_input(c, n)
- struct compiling *c;
- node *n;
+com_file_input(struct compiling *c, node *n)
{
int i;
PyObject *doc;
/* Top-level compile-node interface */
static void
-compile_funcdef(c, n)
- struct compiling *c;
- node *n;
+compile_funcdef(struct compiling *c, node *n)
{
PyObject *doc;
node *ch;
}
static void
-compile_lambdef(c, n)
- struct compiling *c;
- node *n;
+compile_lambdef(struct compiling *c, node *n)
{
node *ch;
REQ(n, lambdef); /* lambdef: 'lambda' [varargslist] ':' test */
}
static void
-compile_classdef(c, n)
- struct compiling *c;
- node *n;
+compile_classdef(struct compiling *c, node *n)
{
node *ch;
PyObject *doc;
}
static void
-compile_node(c, n)
- struct compiling *c;
- node *n;
+compile_node(struct compiling *c, node *n)
{
com_addoparg(c, SET_LINENO, n->n_lineno);
NB: this modifies the string object c->c_code! */
static void
-optimize(c)
- struct compiling *c;
+optimize(struct compiling *c)
{
unsigned char *next_instr, *cur_instr;
int opcode;
}
PyCodeObject *
-PyNode_Compile(n, filename)
- node *n;
- char *filename;
+PyNode_Compile(node *n, char *filename)
{
return jcompile(n, filename, NULL);
}
static PyCodeObject *
-icompile(n, base)
- node *n;
- struct compiling *base;
+icompile(node *n, struct compiling *base)
{
return jcompile(n, base->c_filename, base);
}
static PyCodeObject *
-jcompile(n, filename, base)
- node *n;
- char *filename;
- struct compiling *base;
+jcompile(node *n, char *filename, struct compiling *base)
{
struct compiling sc;
PyCodeObject *co;
}
int
-PyCode_Addr2Line(co, addrq)
- PyCodeObject *co;
- int addrq;
+PyCode_Addr2Line(PyCodeObject *co, int addrq)
{
int size = PyString_Size(co->co_lnotab) / 2;
unsigned char *p = (unsigned char*)PyString_AsString(co->co_lnotab);
#define BADEXIT -1
int
-dup2(fd1, fd2)
-int fd1, fd2;
+dup2(int fd1, int fd2)
{
if (fd1 != fd2) {
if (fcntl(fd1, F_GETFL) < 0)
};
static int
-aix_getoldmodules(modlistptr)
- void **modlistptr;
+aix_getoldmodules(void **modlistptr)
{
register ModulePtr modptr, prevmodptr;
register struct ld_info *ldiptr;
}
static int
-aix_bindnewmodule(newmoduleptr, modlistptr)
- void *newmoduleptr;
- void *modlistptr;
+aix_bindnewmodule(void *newmoduleptr, void *modlistptr)
{
register ModulePtr modptr;
}
static void
-aix_loaderror(pathname)
- char *pathname;
+aix_loaderror(char *pathname)
{
char *message[1024], errbuf[1024];
#endif
void
-PyErr_Restore(type, value, traceback)
- PyObject *type;
- PyObject *value;
- PyObject *traceback;
+PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback)
{
PyThreadState *tstate = PyThreadState_GET();
PyObject *oldtype, *oldvalue, *oldtraceback;
}
void
-PyErr_SetObject(exception, value)
- PyObject *exception;
- PyObject *value;
+PyErr_SetObject(PyObject *exception, PyObject *value)
{
Py_XINCREF(exception);
Py_XINCREF(value);
}
void
-PyErr_SetNone(exception)
- PyObject *exception;
+PyErr_SetNone(PyObject *exception)
{
PyErr_SetObject(exception, (PyObject *)NULL);
}
void
-PyErr_SetString(exception, string)
- PyObject *exception;
- const char *string;
+PyErr_SetString(PyObject *exception, const char *string)
{
PyObject *value = PyString_FromString(string);
PyErr_SetObject(exception, value);
PyObject *
-PyErr_Occurred()
+PyErr_Occurred(void)
{
PyThreadState *tstate = PyThreadState_Get();
int
-PyErr_GivenExceptionMatches(err, exc)
- PyObject *err, *exc;
+PyErr_GivenExceptionMatches(PyObject *err, PyObject *exc)
{
if (err == NULL || exc == NULL) {
/* maybe caused by "import exceptions" that failed early on */
int
-PyErr_ExceptionMatches(exc)
- PyObject *exc;
+PyErr_ExceptionMatches(PyObject *exc)
{
return PyErr_GivenExceptionMatches(PyErr_Occurred(), exc);
}
eval_code2(), do_raise(), and PyErr_Print()
*/
void
-PyErr_NormalizeException(exc, val, tb)
- PyObject **exc;
- PyObject **val;
- PyObject **tb;
+PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb)
{
PyObject *type = *exc;
PyObject *value = *val;
void
-PyErr_Fetch(p_type, p_value, p_traceback)
- PyObject **p_type;
- PyObject **p_value;
- PyObject **p_traceback;
+PyErr_Fetch(PyObject **p_type, PyObject **p_value, PyObject **p_traceback)
{
PyThreadState *tstate = PyThreadState_Get();
}
void
-PyErr_Clear()
+PyErr_Clear(void)
{
PyErr_Restore(NULL, NULL, NULL);
}
/* Convenience functions to set a type error exception and return 0 */
int
-PyErr_BadArgument()
+PyErr_BadArgument(void)
{
PyErr_SetString(PyExc_TypeError,
"illegal argument type for built-in operation");
}
PyObject *
-PyErr_NoMemory()
+PyErr_NoMemory(void)
{
/* raise the pre-allocated instance if it still exists */
if (PyExc_MemoryErrorInst)
}
PyObject *
-PyErr_SetFromErrnoWithFilename(exc, filename)
- PyObject *exc;
- char *filename;
+PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
{
PyObject *v;
char *s;
PyObject *
-PyErr_SetFromErrno(exc)
- PyObject *exc;
+PyErr_SetFromErrno(PyObject *exc)
{
return PyErr_SetFromErrnoWithFilename(exc, NULL);
}
#ifdef MS_WINDOWS
/* Windows specific error code handling */
PyObject *PyErr_SetFromWindowsErrWithFilename(
- int ierr,
+ int ierr,
const char *filename)
{
int len;
#endif /* MS_WINDOWS */
void
-PyErr_BadInternalCall()
+PyErr_BadInternalCall(void)
{
PyErr_SetString(PyExc_SystemError,
"bad argument to internal function");
}
-#ifdef HAVE_STDARG_PROTOTYPES
PyObject *
PyErr_Format(PyObject *exception, const char *format, ...)
-#else
-PyObject *
-PyErr_Format(exception, format, va_alist)
- PyObject *exception;
- const char *format;
- va_dcl
-#endif
{
va_list vargs;
char buffer[500]; /* Caller is responsible for limiting the format */
-#ifdef HAVE_STDARG_PROTOTYPES
va_start(vargs, format);
-#else
- va_start(vargs);
-#endif
vsprintf(buffer, format, vargs);
PyErr_SetString(exception, buffer);
PyObject *
-PyErr_NewException(name, base, dict)
- char *name; /* modulename.classname */
- PyObject *base;
- PyObject *dict;
+PyErr_NewException(char *name, PyObject *base, PyObject *dict)
{
char *dot;
PyObject *modulename = NULL;
/* Main program */
int
-Py_FrozenMain(argc, argv)
- int argc;
- char **argv;
+Py_FrozenMain(int argc, char **argv)
{
char *p;
int n, sts;
char *, char **, va_list *);
static char *skipitem(char **, va_list *);
-#ifdef HAVE_STDARG_PROTOTYPES
-/* VARARGS2 */
int PyArg_Parse(PyObject *args, char *format, ...)
-#else
-/* VARARGS */
-int PyArg_Parse(va_alist) va_dcl
-#endif
{
int retval;
va_list va;
-#ifdef HAVE_STDARG_PROTOTYPES
va_start(va, format);
-#else
- PyObject *args;
- char *format;
-
- va_start(va);
- args = va_arg(va, PyObject *);
- format = va_arg(va, char *);
-#endif
retval = vgetargs1(args, format, &va, 1);
va_end(va);
return retval;
}
-#ifdef HAVE_STDARG_PROTOTYPES
-/* VARARGS2 */
int PyArg_ParseTuple(PyObject *args, char *format, ...)
-#else
-/* VARARGS */
-int PyArg_ParseTuple(va_alist) va_dcl
-#endif
{
int retval;
va_list va;
-#ifdef HAVE_STDARG_PROTOTYPES
va_start(va, format);
-#else
- PyObject *args;
- char *format;
-
- va_start(va);
- args = va_arg(va, PyObject *);
- format = va_arg(va, char *);
-#endif
retval = vgetargs1(args, format, &va, 0);
va_end(va);
return retval;
int
-PyArg_VaParse(args, format, va)
- PyObject *args;
- char *format;
- va_list va;
+PyArg_VaParse(PyObject *args, char *format, va_list va)
{
va_list lva;
static int
-vgetargs1(args, format, p_va, compat)
- PyObject *args;
- char *format;
- va_list *p_va;
- int compat;
+vgetargs1(PyObject *args, char *format, va_list *p_va, int compat)
{
char msgbuf[256];
int levels[32];
static void
-seterror(iarg, msg, levels, fname, message)
- int iarg;
- char *msg;
- int *levels;
- char *fname;
- char *message;
+seterror(int iarg, char *msg, int *levels, char *fname, char *message)
{
char buf[256];
int i;
*/
static char *
-converttuple(arg, p_format, p_va, levels, msgbuf, toplevel)
- PyObject *arg;
- char **p_format;
- va_list *p_va;
- int *levels;
- char *msgbuf;
- int toplevel;
+converttuple(PyObject *arg, char **p_format, va_list *p_va, int *levels,
+ char *msgbuf, int toplevel)
{
int level = 0;
int n = 0;
/* Convert a single item. */
static char *
-convertitem(arg, p_format, p_va, levels, msgbuf)
- PyObject *arg;
- char **p_format;
- va_list *p_va;
- int *levels;
- char *msgbuf;
+convertitem(PyObject *arg, char **p_format, va_list *p_va, int *levels,
+ char *msgbuf)
{
char *msg;
char *format = *p_format;
by appending ", <actual argument type>" to error message. */
static char *
-convertsimple(arg, p_format, p_va, msgbuf)
- PyObject *arg;
- char **p_format;
- va_list *p_va;
- char *msgbuf;
+convertsimple(PyObject *arg, char **p_format, va_list *p_va, char *msgbuf)
{
char *msg = convertsimple1(arg, p_format, p_va);
if (msg != NULL) {
Don't call if a tuple is expected. */
static char *
-convertsimple1(arg, p_format, p_va)
- PyObject *arg;
- char **p_format;
- va_list *p_va;
+convertsimple1(PyObject *arg, char **p_format, va_list *p_va)
{
char *format = *p_format;
char c = *format++;
/* Support for keyword arguments donated by
Geoff Philbrick <philbric@delphi.hks.com> */
-#ifdef HAVE_STDARG_PROTOTYPES
-/* VARARGS2 */
int PyArg_ParseTupleAndKeywords(PyObject *args,
PyObject *keywords,
char *format,
char **kwlist, ...)
-#else
-/* VARARGS */
-int PyArg_ParseTupleAndKeywords(va_alist) va_dcl
-#endif
{
int retval;
va_list va;
-#ifdef HAVE_STDARG_PROTOTYPES
va_start(va, kwlist);
-#else
- PyObject *args;
- PyObject *keywords;
- char *format;
- char **kwlist;
-
- va_start(va);
- args = va_arg(va, PyObject *);
- keywords = va_arg(va, PyObject *);
- format = va_arg(va, char *);
- kwlist = va_arg(va, char **);
-#endif
retval = vgetargskeywords(args, keywords, format, kwlist, &va);
va_end(va);
return retval;
static int
-vgetargskeywords(args, keywords, format, kwlist, p_va)
- PyObject *args;
- PyObject *keywords;
- char *format;
- char **kwlist;
- va_list *p_va;
+vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
+ char **kwlist, va_list *p_va)
{
char msgbuf[256];
int levels[32];
static char *
-skipitem(p_format, p_va)
- char **p_format;
- va_list *p_va;
+skipitem(char **p_format, va_list *p_va)
{
char *format = *p_format;
char c = *format++;
#endif /* !COMPILER */
const char *
-Py_GetCompiler()
+Py_GetCompiler(void)
{
return COMPILER;
}
Copyright 1995-2000 Corporation for National Research Initiatives (CNRI)";
const char *
-Py_GetCopyright()
+Py_GetCopyright(void)
{
return cprt;
}
#define MAXPATHLEN 1024
#endif
-extern char *getwd();
+extern char *getwd(char *);
char *
-getcwd(buf, size)
- char *buf;
- int size;
+getcwd(char *buf, int size)
{
char localbuf[MAXPATHLEN+1];
char *ret;
#endif
char *
-getcwd(buf, size)
- char *buf;
- int size;
+getcwd(char *buf, int size)
{
FILE *fp;
char *p;
#endif
time_t
-PyOS_GetLastModificationTime(path, fp)
- char *path;
- FILE *fp;
+PyOS_GetLastModificationTime(char *path, FILE *fp)
{
struct stat st;
if (fstat(fileno(fp), &st) != 0)
#ifndef __BEOS__
-int getopt(argc,argv,optstring)
-int argc;
-char *argv[];
-char optstring[];
+int getopt(int argc, char *argv[], char optstring[])
#else
-int getopt( int argc, char *const *argv, const char *optstring )
+int getopt(int argc, char *const *argv, const char *optstring)
#endif
{
static char *opt_ptr = "";
#endif
const char *
-Py_GetPlatform()
+Py_GetPlatform(void)
{
return PLATFORM;
}
#include "patchlevel.h"
const char *
-Py_GetVersion()
+Py_GetVersion(void)
{
static char version[250];
sprintf(version, "%.80s (%.80s) %.80s", PY_VERSION,
#include "myproto.h"
#include "mymath.h"
-double hypot(x, y)
- double x;
- double y;
+double hypot(double x, double y)
{
double yx;
#endif
-extern time_t PyOS_GetLastModificationTime(); /* In getmtime.c */
+extern time_t PyOS_GetLastModificationTime(char *, FILE *);
+ /* In getmtime.c */
/* Magic word to reject .pyc files generated by other Python versions */
/* Change for each incompatible change */
/* XXX Perhaps the magic number should be frozen and a version field
added to the .pyc file header? */
/* New way to come up with the magic number: (YEAR-1995), MONTH, DAY */
-#define MAGIC (50428 | ((long)'\r'<<16) | ((long)'\n'<<24))
+#define MAGIC (50715 | ((long)'\r'<<16) | ((long)'\n'<<24))
/* Magic word as global; note that _PyImport_Init() can change the
value of this global to accommodate for alterations of how the
/* Initialize things */
void
-_PyImport_Init()
+_PyImport_Init(void)
{
const struct filedescr *scan;
struct filedescr *filetab;
}
void
-_PyImport_Fini()
+_PyImport_Fini(void)
{
Py_XDECREF(extensions);
extensions = NULL;
static int import_lock_level = 0;
static void
-lock_import()
+lock_import(void)
{
long me = PyThread_get_thread_ident();
if (me == -1)
}
static void
-unlock_import()
+unlock_import(void)
{
long me = PyThread_get_thread_ident();
if (me == -1)
/* Helper for sys */
PyObject *
-PyImport_GetModuleDict()
+PyImport_GetModuleDict(void)
{
PyInterpreterState *interp = PyThreadState_Get()->interp;
if (interp->modules == NULL)
/* Un-initialize things, as good as we can */
void
-PyImport_Cleanup()
+PyImport_Cleanup(void)
{
int pos, ndone;
char *name;
/* Helper for pythonrun.c -- return magic number */
long
-PyImport_GetMagicNumber()
+PyImport_GetMagicNumber(void)
{
return pyc_magic;
}
_PyImport_FindExtension(). */
PyObject *
-_PyImport_FixupExtension(name, filename)
- char *name;
- char *filename;
+_PyImport_FixupExtension(char *name, char *filename)
{
PyObject *modules, *mod, *dict, *copy;
if (extensions == NULL) {
}
PyObject *
-_PyImport_FindExtension(name, filename)
- char *name;
- char *filename;
+_PyImport_FindExtension(char *name, char *filename)
{
PyObject *dict, *mod, *mdict, *result;
if (extensions == NULL)
'NEW' REFERENCE! */
PyObject *
-PyImport_AddModule(name)
- char *name;
+PyImport_AddModule(char *name)
{
PyObject *modules = PyImport_GetModuleDict();
PyObject *m;
WITH INCREMENTED REFERENCE COUNT */
PyObject *
-PyImport_ExecCodeModule(name, co)
- char *name;
- PyObject *co;
+PyImport_ExecCodeModule(char *name, PyObject *co)
{
return PyImport_ExecCodeModuleEx(name, co, (char *)NULL);
}
PyObject *
-PyImport_ExecCodeModuleEx(name, co, pathname)
- char *name;
- PyObject *co;
- char *pathname;
+PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname)
{
PyObject *modules = PyImport_GetModuleDict();
PyObject *m, *d, *v;
Doesn't set an exception. */
static char *
-make_compiled_pathname(pathname, buf, buflen)
- char *pathname;
- char *buf;
- size_t buflen;
+make_compiled_pathname(char *pathname, char *buf, size_t buflen)
{
size_t len;
Doesn't set an exception. */
static FILE *
-check_compiled_module(pathname, mtime, cpathname)
- char *pathname;
- long mtime;
- char *cpathname;
+check_compiled_module(char *pathname, long mtime, char *cpathname)
{
FILE *fp;
long magic;
/* Read a code object from a file and check it for validity */
static PyCodeObject *
-read_compiled_module(cpathname, fp)
- char *cpathname;
- FILE *fp;
+read_compiled_module(char *cpathname, FILE *fp)
{
PyObject *co;
module object WITH INCREMENTED REFERENCE COUNT */
static PyObject *
-load_compiled_module(name, cpathname, fp)
- char *name;
- char *cpathname;
- FILE *fp;
+load_compiled_module(char *name, char *cpathname, FILE *fp)
{
long magic;
PyCodeObject *co;
/* Parse a source file and return the corresponding code object */
static PyCodeObject *
-parse_source_module(pathname, fp)
- char *pathname;
- FILE *fp;
+parse_source_module(char *pathname, FILE *fp)
{
PyCodeObject *co;
node *n;
remove the file. */
static void
-write_compiled_module(co, cpathname, mtime)
- PyCodeObject *co;
- char *cpathname;
- long mtime;
+write_compiled_module(PyCodeObject *co, char *cpathname, long mtime)
{
FILE *fp;
byte-compiled file, use that instead. */
static PyObject *
-load_source_module(name, pathname, fp)
- char *name;
- char *pathname;
- FILE *fp;
+load_source_module(char *name, char *pathname, FILE *fp)
{
time_t mtime;
FILE *fpc;
REFERENCE COUNT */
static PyObject *
-load_package(name, pathname)
- char *name;
- char *pathname;
+load_package(char *name, char *pathname)
{
PyObject *m, *d, *file, *path;
int err;
/* Helper to test for built-in module */
static int
-is_builtin(name)
- char *name;
+is_builtin(char *name)
{
int i;
for (i = 0; PyImport_Inittab[i].name != NULL; i++) {
static int find_init_module(char *); /* Forward */
static struct filedescr *
-find_module(realname, path, buf, buflen, p_fp)
- char *realname;
- PyObject *path;
- /* Output parameters: */
- char *buf;
- size_t buflen;
- FILE **p_fp;
+find_module(char *realname, PyObject *path, char *buf, size_t buflen,
+ FILE **p_fp)
{
int i, npath;
size_t len, namelen;
#include <ctype.h>
static int
-allcaps8x3(s)
- char *s;
+allcaps8x3(char *s)
{
/* Return 1 if s is an 8.3 filename in ALLCAPS */
char c;
#ifdef HAVE_STAT
/* Helper to look for __init__.py or __init__.py[co] in potential package */
static int
-find_init_module(buf)
- char *buf;
+find_init_module(char *buf)
{
size_t save_len = strlen(buf);
size_t i = save_len;
its module object WITH INCREMENTED REFERENCE COUNT */
static PyObject *
-load_module(name, fp, buf, type)
- char *name;
- FILE *fp;
- char *buf;
- int type;
+load_module(char *name, FILE *fp, char *buf, int type)
{
PyObject *modules;
PyObject *m;
an exception set if the initialization failed. */
static int
-init_builtin(name)
- char *name;
+init_builtin(char *name)
{
struct _inittab *p;
PyObject *mod;
/* Frozen modules */
static struct _frozen *
-find_frozen(name)
- char *name;
+find_frozen(char *name)
{
struct _frozen *p;
}
static PyObject *
-get_frozen_object(name)
- char *name;
+get_frozen_object(char *name)
{
struct _frozen *p = find_frozen(name);
int size;
This function is also used from frozenmain.c */
int
-PyImport_ImportFrozenModule(name)
- char *name;
+PyImport_ImportFrozenModule(char *name)
{
struct _frozen *p = find_frozen(name);
PyObject *co;
its module object WITH INCREMENTED REFERENCE COUNT */
PyObject *
-PyImport_ImportModule(name)
- char *name;
+PyImport_ImportModule(char *name)
{
static PyObject *fromlist = NULL;
if (fromlist == NULL && strchr(name, '.') != NULL) {
/* The Magnum Opus of dotted-name import :-) */
static PyObject *
-import_module_ex(name, globals, locals, fromlist)
- char *name;
- PyObject *globals;
- PyObject *locals;
- PyObject *fromlist;
+import_module_ex(char *name, PyObject *globals, PyObject *locals,
+ PyObject *fromlist)
{
char buf[MAXPATHLEN+1];
int buflen = 0;
}
PyObject *
-PyImport_ImportModuleEx(name, globals, locals, fromlist)
- char *name;
- PyObject *globals;
- PyObject *locals;
- PyObject *fromlist;
+PyImport_ImportModuleEx(char *name, PyObject *globals, PyObject *locals,
+ PyObject *fromlist)
{
PyObject *result;
lock_import();
}
static PyObject *
-get_parent(globals, buf, p_buflen)
- PyObject *globals;
- char *buf;
- int *p_buflen;
+get_parent(PyObject *globals, char *buf, int *p_buflen)
{
static PyObject *namestr = NULL;
static PyObject *pathstr = NULL;
If this is violated... Who cares? */
}
+/* altmod is either None or same as mod */
static PyObject *
-load_next(mod, altmod, p_name, buf, p_buflen)
- PyObject *mod;
- PyObject *altmod; /* Either None or same as mod */
- char **p_name;
- char *buf;
- int *p_buflen;
+load_next(PyObject *mod, PyObject *altmod, char **p_name, char *buf,
+ int *p_buflen)
{
char *name = *p_name;
char *dot = strchr(name, '.');
}
static int
-mark_miss(name)
- char *name;
+mark_miss(char *name)
{
PyObject *modules = PyImport_GetModuleDict();
return PyDict_SetItemString(modules, name, Py_None);
}
static int
-ensure_fromlist(mod, fromlist, buf, buflen, recursive)
- PyObject *mod;
- PyObject *fromlist;
- char *buf;
- int buflen;
- int recursive;
+ensure_fromlist(PyObject *mod, PyObject *fromlist, char *buf, int buflen,
+ int recursive)
{
int i;
}
static PyObject *
-import_submodule(mod, subname, fullname)
- PyObject *mod; /* May be None */
- char *subname;
- char *fullname;
+import_submodule(PyObject *mod, char *subname, char *fullname)
{
PyObject *modules = PyImport_GetModuleDict();
PyObject *m;
INCREMENTED REFERENCE COUNT */
PyObject *
-PyImport_ReloadModule(m)
- PyObject *m;
+PyImport_ReloadModule(PyObject *m)
{
PyObject *modules = PyImport_GetModuleDict();
PyObject *path = NULL;
will return <module "gencache"> instead of <module "win32com">. */
PyObject *
-PyImport_Import(module_name)
- PyObject *module_name;
+PyImport_Import(PyObject *module_name)
{
static PyObject *silly_list = NULL;
static PyObject *builtins_str = NULL;
*/
static PyObject *
-imp_get_magic(self, args)
- PyObject *self;
- PyObject *args;
+imp_get_magic(PyObject *self, PyObject *args)
{
char buf[4];
}
static PyObject *
-imp_get_suffixes(self, args)
- PyObject *self;
- PyObject *args;
+imp_get_suffixes(PyObject *self, PyObject *args)
{
PyObject *list;
struct filedescr *fdp;
}
static PyObject *
-call_find_module(name, path)
- char *name;
- PyObject *path; /* list or None or NULL */
+call_find_module(char *name, PyObject *path)
{
extern int fclose(FILE *);
PyObject *fob, *ret;
}
static PyObject *
-imp_find_module(self, args)
- PyObject *self;
- PyObject *args;
+imp_find_module(PyObject *self, PyObject *args)
{
char *name;
PyObject *path = NULL;
}
static PyObject *
-imp_init_builtin(self, args)
- PyObject *self;
- PyObject *args;
+imp_init_builtin(PyObject *self, PyObject *args)
{
char *name;
int ret;
}
static PyObject *
-imp_init_frozen(self, args)
- PyObject *self;
- PyObject *args;
+imp_init_frozen(PyObject *self, PyObject *args)
{
char *name;
int ret;
}
static PyObject *
-imp_get_frozen_object(self, args)
- PyObject *self;
- PyObject *args;
+imp_get_frozen_object(PyObject *self, PyObject *args)
{
char *name;
}
static PyObject *
-imp_is_builtin(self, args)
- PyObject *self;
- PyObject *args;
+imp_is_builtin(PyObject *self, PyObject *args)
{
char *name;
if (!PyArg_ParseTuple(args, "s:is_builtin", &name))
}
static PyObject *
-imp_is_frozen(self, args)
- PyObject *self;
- PyObject *args;
+imp_is_frozen(PyObject *self, PyObject *args)
{
char *name;
struct _frozen *p;
}
static FILE *
-get_file(pathname, fob, mode)
- char *pathname;
- PyObject *fob;
- char *mode;
+get_file(char *pathname, PyObject *fob, char *mode)
{
FILE *fp;
if (fob == NULL) {
}
static PyObject *
-imp_load_compiled(self, args)
- PyObject *self;
- PyObject *args;
+imp_load_compiled(PyObject *self, PyObject *args)
{
char *name;
char *pathname;
#ifdef HAVE_DYNAMIC_LOADING
static PyObject *
-imp_load_dynamic(self, args)
- PyObject *self;
- PyObject *args;
+imp_load_dynamic(PyObject *self, PyObject *args)
{
char *name;
char *pathname;
#endif /* HAVE_DYNAMIC_LOADING */
static PyObject *
-imp_load_source(self, args)
- PyObject *self;
- PyObject *args;
+imp_load_source(PyObject *self, PyObject *args)
{
char *name;
char *pathname;
#ifdef macintosh
static PyObject *
-imp_load_resource(self, args)
- PyObject *self;
- PyObject *args;
+imp_load_resource(PyObject *self, PyObject *args)
{
char *name;
char *pathname;
#endif /* macintosh */
static PyObject *
-imp_load_module(self, args)
- PyObject *self;
- PyObject *args;
+imp_load_module(PyObject *self, PyObject *args)
{
char *name;
PyObject *fob;
}
static PyObject *
-imp_load_package(self, args)
- PyObject *self;
- PyObject *args;
+imp_load_package(PyObject *self, PyObject *args)
{
char *name;
char *pathname;
}
static PyObject *
-imp_new_module(self, args)
- PyObject *self;
- PyObject *args;
+imp_new_module(PyObject *self, PyObject *args)
{
char *name;
if (!PyArg_ParseTuple(args, "s:new_module", &name))
};
static int
-setint(d, name, value)
- PyObject *d;
- char *name;
- int value;
+setint(PyObject *d, char *name, int value)
{
PyObject *v;
int err;
}
void
-initimp()
+initimp(void)
{
PyObject *m, *d;
After a similar function by Just van Rossum. */
int
-PyImport_ExtendInittab(newtab)
- struct _inittab *newtab;
+PyImport_ExtendInittab(struct _inittab *newtab)
{
static struct _inittab *our_copy = NULL;
struct _inittab *p;
/* Shorthand to add a single entry given a name and a function */
int
-PyImport_AppendInittab(name, initfunc)
- char *name;
- void (*initfunc)();
+PyImport_AppendInittab(char *name, void (*initfunc)(void))
{
struct _inittab newtab[2];
PyObject *
-_PyImport_LoadDynamicModule(name, pathname, fp)
- char *name;
- char *pathname;
- FILE *fp;
+_PyImport_LoadDynamicModule(char *name, char *pathname, FILE *fp)
{
PyObject *m, *d, *s;
char *lastdot, *shortname, *packagecontext;
else w_more(c, p)
static void
-w_more(c, p)
- char c;
- WFILE *p;
+w_more(char c, WFILE *p)
{
int size, newsize;
if (p->str == NULL)
}
static void
-w_string(s, n, p)
- char *s;
- int n;
- WFILE *p;
+w_string(char *s, int n, WFILE *p)
{
if (p->fp != NULL) {
fwrite(s, 1, n, p->fp);
}
static void
-w_short(x, p)
- int x;
- WFILE *p;
+w_short(int x, WFILE *p)
{
w_byte( x & 0xff, p);
w_byte((x>> 8) & 0xff, p);
}
static void
-w_long(x, p)
- long x;
- WFILE *p;
+w_long(long x, WFILE *p)
{
w_byte((int)( x & 0xff), p);
w_byte((int)((x>> 8) & 0xff), p);
#if SIZEOF_LONG > 4
static void
-w_long64(x, p)
- long x;
- WFILE *p;
+w_long64(long x, WFILE *p)
{
w_long(x, p);
w_long(x>>32, p);
#endif
static void
-w_object(v, p)
- PyObject *v;
- WFILE *p;
+w_object(PyObject *v, WFILE *p)
{
int i, n;
PyBufferProcs *pb;
}
void
-PyMarshal_WriteLongToFile(x, fp)
- long x;
- FILE *fp;
+PyMarshal_WriteLongToFile(long x, FILE *fp)
{
WFILE wf;
wf.fp = fp;
}
void
-PyMarshal_WriteObjectToFile(x, fp)
- PyObject *x;
- FILE *fp;
+PyMarshal_WriteObjectToFile(PyObject *x, FILE *fp)
{
WFILE wf;
wf.fp = fp;
#define r_byte(p) ((p)->fp ? getc((p)->fp) : rs_byte(p))
static int
-r_string(s, n, p)
- char *s;
- int n;
- RFILE *p;
+r_string(char *s, int n, RFILE *p)
{
if (p->fp != NULL)
return fread(s, 1, n, p->fp);
}
static int
-r_short(p)
- RFILE *p;
+r_short(RFILE *p)
{
register short x;
x = r_byte(p);
}
static long
-r_long(p)
- RFILE *p;
+r_long(RFILE *p)
{
register long x;
register FILE *fp = p->fp;
}
static long
-r_long64(p)
- RFILE *p;
+r_long64(RFILE *p)
{
register long x;
x = r_long(p);
}
static PyObject *
-r_object(p)
- RFILE *p;
+r_object(RFILE *p)
{
PyObject *v, *v2;
long i, n;
}
long
-PyMarshal_ReadLongFromFile(fp)
- FILE *fp;
+PyMarshal_ReadLongFromFile(FILE *fp)
{
RFILE rf;
rf.fp = fp;
}
PyObject *
-PyMarshal_ReadObjectFromFile(fp)
- FILE *fp;
+PyMarshal_ReadObjectFromFile(FILE *fp)
{
RFILE rf;
if (PyErr_Occurred()) {
}
PyObject *
-PyMarshal_ReadObjectFromString(str, len)
- char *str;
- int len;
+PyMarshal_ReadObjectFromString(char *str, int len)
{
RFILE rf;
if (PyErr_Occurred()) {
}
PyObject *
-PyMarshal_WriteObjectToString(x) /* wrs_object() */
- PyObject *x;
+PyMarshal_WriteObjectToString(PyObject *x) /* wrs_object() */
{
WFILE wf;
wf.fp = NULL;
/* And an interface for Python programs... */
static PyObject *
-marshal_dump(self, args)
- PyObject *self;
- PyObject *args;
+marshal_dump(PyObject *self, PyObject *args)
{
WFILE wf;
PyObject *x;
}
static PyObject *
-marshal_load(self, args)
- PyObject *self;
- PyObject *args;
+marshal_load(PyObject *self, PyObject *args)
{
RFILE rf;
PyObject *f;
}
static PyObject *
-marshal_dumps(self, args)
- PyObject *self;
- PyObject *args;
+marshal_dumps(PyObject *self, PyObject *args)
{
PyObject *x;
if (!PyArg_ParseTuple(args, "O:dumps", &x))
}
static PyObject *
-marshal_loads(self, args)
- PyObject *self;
- PyObject *args;
+marshal_loads(PyObject *self, PyObject *args)
{
RFILE rf;
PyObject *v;
};
void
-PyMarshal_Init()
+PyMarshal_Init(void)
{
(void) Py_InitModule("marshal", marshal_methods);
}
/* A perhaps slow but I hope correct implementation of memmove */
-extern char *memcpy();
+extern char *memcpy(char *, char *, int);
char *
-memmove(dst, src, n)
- char *dst;
- char *src;
- int n;
+memmove(char *dst, char *src, int n)
{
char *realdst = dst;
if (n <= 0)
This Python has API version %d, module %s has version %d.\n";
PyObject *
-Py_InitModule4(name, methods, doc, passthrough, module_api_version)
- char *name;
- PyMethodDef *methods;
- char *doc;
- PyObject *passthrough;
- int module_api_version;
+Py_InitModule4(char *name, PyMethodDef *methods, char *doc,
+ PyObject *passthrough, int module_api_version)
{
PyObject *m, *d, *v;
PyMethodDef *ml;
/* Helper for mkvalue() to scan the length of a format */
-static int countformat(char *format, int endchar);
-static int countformat(format, endchar)
- char *format;
- int endchar;
+static int countformat(char *format, int endchar)
{
int count = 0;
int level = 0;
static PyObject *
-do_mkdict(p_format, p_va, endchar, n)
- char **p_format;
- va_list *p_va;
- int endchar;
- int n;
+do_mkdict(char **p_format, va_list *p_va, int endchar, int n)
{
PyObject *d;
int i;
}
static PyObject *
-do_mklist(p_format, p_va, endchar, n)
- char **p_format;
- va_list *p_va;
- int endchar;
- int n;
+do_mklist(char **p_format, va_list *p_va, int endchar, int n)
{
PyObject *v;
int i;
}
static PyObject *
-do_mktuple(p_format, p_va, endchar, n)
- char **p_format;
- va_list *p_va;
- int endchar;
- int n;
+do_mktuple(char **p_format, va_list *p_va, int endchar, int n)
{
PyObject *v;
int i;
}
static PyObject *
-do_mkvalue(p_format, p_va)
- char **p_format;
- va_list *p_va;
+do_mkvalue(char **p_format, va_list *p_va)
{
for (;;) {
switch (*(*p_format)++) {
}
-#ifdef HAVE_STDARG_PROTOTYPES
-/* VARARGS 2 */
PyObject *Py_BuildValue(char *format, ...)
-#else
-/* VARARGS */
-PyObject *Py_BuildValue(va_alist) va_dcl
-#endif
{
va_list va;
PyObject* retval;
-#ifdef HAVE_STDARG_PROTOTYPES
va_start(va, format);
-#else
- char *format;
- va_start(va);
- format = va_arg(va, char *);
-#endif
retval = Py_VaBuildValue(format, va);
va_end(va);
return retval;
}
PyObject *
-Py_VaBuildValue(format, va)
- char *format;
- va_list va;
+Py_VaBuildValue(char *format, va_list va)
{
char *f = format;
int n = countformat(f, '\0');
}
-#ifdef HAVE_STDARG_PROTOTYPES
PyObject *
PyEval_CallFunction(PyObject *obj, char *format, ...)
-#else
-PyObject *
-PyEval_CallFunction(obj, format, va_alist)
- PyObject *obj;
- char *format;
- va_dcl
-#endif
{
va_list vargs;
PyObject *args;
PyObject *res;
-#ifdef HAVE_STDARG_PROTOTYPES
va_start(vargs, format);
-#else
- va_start(vargs);
-#endif
args = Py_VaBuildValue(format, vargs);
va_end(vargs);
}
-#ifdef HAVE_STDARG_PROTOTYPES
PyObject *
PyEval_CallMethod(PyObject *obj, char *methodname, char *format, ...)
-#else
-PyObject *
-PyEval_CallMethod(obj, methodname, format, va_alist)
- PyObject *obj;
- char *methodname;
- char *format;
- va_dcl
-#endif
{
va_list vargs;
PyObject *meth;
if (meth == NULL)
return NULL;
-#ifdef HAVE_STDARG_PROTOTYPES
va_start(vargs, format);
-#else
- va_start(vargs);
-#endif
args = Py_VaBuildValue(format, vargs);
va_end(vargs);
#endif
unsigned long
-PyOS_strtoul(str, ptr, base)
-register char * str;
-char ** ptr;
-int base;
+PyOS_strtoul(register char *str, char **ptr, int base)
{
register unsigned long result; /* return value of the function */
register int c; /* current input character */
}
long
-PyOS_strtol(str, ptr, base)
-char * str;
-char ** ptr;
-int base;
+PyOS_strtol(char *str, char **ptr, int base)
{
long result;
char sign;
warning when compiling an empty file. */
double
-PyFPE_dummy(dummy)
- void *dummy;
+PyFPE_dummy(void *dummy)
{
return 1.0;
}
PyInterpreterState *
-PyInterpreterState_New()
+PyInterpreterState_New(void)
{
PyInterpreterState *interp = PyMem_NEW(PyInterpreterState, 1);
void
-PyInterpreterState_Clear(interp)
- PyInterpreterState *interp;
+PyInterpreterState_Clear(PyInterpreterState *interp)
{
PyThreadState *p;
HEAD_LOCK();
static void
-zapthreads(interp)
- PyInterpreterState *interp;
+zapthreads(PyInterpreterState *interp)
{
PyThreadState *p;
/* No need to lock the mutex here because this should only happen
void
-PyInterpreterState_Delete(interp)
- PyInterpreterState *interp;
+PyInterpreterState_Delete(PyInterpreterState *interp)
{
PyInterpreterState **p;
zapthreads(interp);
PyThreadState *
-PyThreadState_New(interp)
- PyInterpreterState *interp;
+PyThreadState_New(PyInterpreterState *interp)
{
PyThreadState *tstate = PyMem_NEW(PyThreadState, 1);
void
-PyThreadState_Clear(tstate)
- PyThreadState *tstate;
+PyThreadState_Clear(PyThreadState *tstate)
{
if (Py_VerboseFlag && tstate->frame != NULL)
fprintf(stderr,
void
-PyThreadState_Delete(tstate)
- PyThreadState *tstate;
+PyThreadState_Delete(PyThreadState *tstate)
{
PyInterpreterState *interp;
PyThreadState **p;
PyThreadState *
-PyThreadState_Get()
+PyThreadState_Get(void)
{
if (_PyThreadState_Current == NULL)
Py_FatalError("PyThreadState_Get: no current thread");
PyThreadState *
-PyThreadState_Swap(new)
- PyThreadState *new;
+PyThreadState_Swap(PyThreadState *new)
{
PyThreadState *old = _PyThreadState_Current;
likely MemoryError) and the caller should pass on the exception. */
PyObject *
-PyThreadState_GetDict()
+PyThreadState_GetDict(void)
{
if (_PyThreadState_Current == NULL)
Py_FatalError("PyThreadState_GetDict: no current thread");
#ifdef macintosh
#include "macglue.h"
#endif
-extern char *Py_GetPath();
+extern char *Py_GetPath(void);
extern grammar _PyParser_Grammar; /* From graminit.c */
int _Py_AskYesNo(char *prompt);
#endif
-extern void _PyUnicode_Init();
-extern void _PyUnicode_Fini();
-extern void _PyCodecRegistry_Init();
-extern void _PyCodecRegistry_Fini();
+extern void _PyUnicode_Init(void);
+extern void _PyUnicode_Fini(void);
+extern void _PyCodecRegistry_Init(void);
+extern void _PyCodecRegistry_Fini(void);
int Py_DebugFlag; /* Needed by parser.c */
/* API to access the initialized flag -- useful for esoteric use */
int
-Py_IsInitialized()
+Py_IsInitialized(void)
{
return initialized;
}
*/
void
-Py_Initialize()
+Py_Initialize(void)
{
PyInterpreterState *interp;
PyThreadState *tstate;
*/
void
-Py_Finalize()
+Py_Finalize(void)
{
PyInterpreterState *interp;
PyThreadState *tstate;
*/
PyThreadState *
-Py_NewInterpreter()
+Py_NewInterpreter(void)
{
PyInterpreterState *interp;
PyThreadState *tstate, *save_tstate;
*/
void
-Py_EndInterpreter(tstate)
- PyThreadState *tstate;
+Py_EndInterpreter(PyThreadState *tstate)
{
PyInterpreterState *interp = tstate->interp;
static char *progname = "python";
void
-Py_SetProgramName(pn)
- char *pn;
+Py_SetProgramName(char *pn)
{
if (pn && *pn)
progname = pn;
}
char *
-Py_GetProgramName()
+Py_GetProgramName(void)
{
return progname;
}
static char *default_home = NULL;
void
-Py_SetPythonHome(home)
- char *home;
+Py_SetPythonHome(char *home)
{
default_home = home;
}
char *
-Py_GetPythonHome()
+Py_GetPythonHome(void)
{
char *home = default_home;
if (home == NULL)
/* Create __main__ module */
static void
-initmain()
+initmain(void)
{
PyObject *m, *d;
m = PyImport_AddModule("__main__");
/* Import the site module (not into __main__ though) */
static void
-initsite()
+initsite(void)
{
PyObject *m, *f;
m = PyImport_ImportModule("site");
/* Parse input from a file and execute it */
int
-PyRun_AnyFile(fp, filename)
- FILE *fp;
- char *filename;
+PyRun_AnyFile(FILE *fp, char *filename)
{
if (filename == NULL)
filename = "???";
}
int
-PyRun_InteractiveLoop(fp, filename)
- FILE *fp;
- char *filename;
+PyRun_InteractiveLoop(FILE *fp, char *filename)
{
PyObject *v;
int ret;
}
int
-PyRun_InteractiveOne(fp, filename)
- FILE *fp;
- char *filename;
+PyRun_InteractiveOne(FILE *fp, char *filename)
{
PyObject *m, *d, *v, *w;
node *n;
}
int
-PyRun_SimpleFile(fp, filename)
- FILE *fp;
- char *filename;
+PyRun_SimpleFile(FILE *fp, char *filename)
{
PyObject *m, *d, *v;
char *ext;
}
int
-PyRun_SimpleString(command)
- char *command;
+PyRun_SimpleString(char *command)
{
PyObject *m, *d, *v;
m = PyImport_AddModule("__main__");
}
static int
-parse_syntax_error(err, message, filename, lineno, offset, text)
- PyObject* err;
- PyObject** message;
- char** filename;
- int* lineno;
- int* offset;
- char** text;
+parse_syntax_error(PyObject *err, PyObject **message, char **filename,
+ int *lineno, int *offset, char **text)
{
long hold;
PyObject *v;
}
void
-PyErr_Print()
+PyErr_Print(void)
{
PyErr_PrintEx(1);
}
void
-PyErr_PrintEx(set_sys_last_vars)
- int set_sys_last_vars;
+PyErr_PrintEx(int set_sys_last_vars)
{
int err = 0;
PyObject *exception, *v, *tb, *f;
}
PyObject *
-PyRun_String(str, start, globals, locals)
- char *str;
- int start;
- PyObject *globals, *locals;
+PyRun_String(char *str, int start, PyObject *globals, PyObject *locals)
{
return run_err_node(PyParser_SimpleParseString(str, start),
"<string>", globals, locals);
}
PyObject *
-PyRun_File(fp, filename, start, globals, locals)
- FILE *fp;
- char *filename;
- int start;
- PyObject *globals, *locals;
+PyRun_File(FILE *fp, char *filename, int start, PyObject *globals,
+ PyObject *locals)
{
return run_err_node(PyParser_SimpleParseFile(fp, filename, start),
filename, globals, locals);
}
static PyObject *
-run_err_node(n, filename, globals, locals)
- node *n;
- char *filename;
- PyObject *globals, *locals;
+run_err_node(node *n, char *filename, PyObject *globals, PyObject *locals)
{
if (n == NULL)
return NULL;
}
static PyObject *
-run_node(n, filename, globals, locals)
- node *n;
- char *filename;
- PyObject *globals, *locals;
+run_node(node *n, char *filename, PyObject *globals, PyObject *locals)
{
PyCodeObject *co;
PyObject *v;
}
static PyObject *
-run_pyc_file(fp, filename, globals, locals)
- FILE *fp;
- char *filename;
- PyObject *globals, *locals;
+run_pyc_file(FILE *fp, char *filename, PyObject *globals, PyObject *locals)
{
PyCodeObject *co;
PyObject *v;
}
PyObject *
-Py_CompileString(str, filename, start)
- char *str;
- char *filename;
- int start;
+Py_CompileString(char *str, char *filename, int start)
{
node *n;
PyCodeObject *co;
/* Simplified interface to parsefile -- return node or set exception */
node *
-PyParser_SimpleParseFile(fp, filename, start)
- FILE *fp;
- char *filename;
- int start;
+PyParser_SimpleParseFile(FILE *fp, char *filename, int start)
{
node *n;
perrdetail err;
/* Simplified interface to parsestring -- return node or set exception */
node *
-PyParser_SimpleParseString(str, start)
- char *str;
- int start;
+PyParser_SimpleParseString(char *str, int start)
{
node *n;
perrdetail err;
/* Set the error appropriate to the given input error code (see errcode.h) */
static void
-err_input(err)
- perrdetail *err;
+err_input(perrdetail *err)
{
PyObject *v, *w, *errtype;
char *msg = NULL;
/* Print fatal error message and abort */
void
-Py_FatalError(msg)
- char *msg;
+Py_FatalError(char *msg)
{
fprintf(stderr, "Fatal Python error: %s\n", msg);
#ifdef macintosh
#endif
#define NEXITFUNCS 32
-static void (*exitfuncs[NEXITFUNCS])();
+static void (*exitfuncs[NEXITFUNCS])(void);
static int nexitfuncs = 0;
-int Py_AtExit(func)
- void (*func)(void);
+int Py_AtExit(void (*func)(void))
{
if (nexitfuncs >= NEXITFUNCS)
return -1;
}
static void
-call_sys_exitfunc()
+call_sys_exitfunc(void)
{
PyObject *exitfunc = PySys_GetObject("exitfunc");
}
static void
-call_ll_exitfuncs()
+call_ll_exitfuncs(void)
{
while (nexitfuncs > 0)
(*exitfuncs[--nexitfuncs])();
}
void
-Py_Exit(sts)
- int sts;
+Py_Exit(int sts)
{
Py_Finalize();
}
static void
-initsigs()
+initsigs(void)
{
#ifdef HAVE_SIGNAL_H
#ifdef SIGPIPE
/* Ask a yes/no question */
int
-_Py_AskYesNo(prompt)
- char *prompt;
+_Py_AskYesNo(char *prompt)
{
char buf[256];
Pretend that stdin is always interactive, other files never. */
int
-isatty(fd)
- int fd;
+isatty(int fd)
{
return fd == fileno(stdin);
}
* the descriptor is NULL or "<stdin>" or "???".
*/
int
-Py_FdIsInteractive(fp, filename)
- FILE *fp;
- char *filename;
+Py_FdIsInteractive(FILE *fp, char *filename)
{
if (isatty((int)fileno(fp)))
return 1;
/* ARGSUSED */
int
-PyErr_CheckSignals()
+PyErr_CheckSignals(void)
{
if (!PyOS_InterruptOccurred())
return 0;
#include "pgenheaders.h"
char *
-strdup(str)
- const char *str;
+strdup(const char *str)
{
if (str != NULL) {
register char *copy = malloc(strlen(str) + 1);
extern char *sys_errlist[];
char *
-strerror(err)
- int err;
+strerror(int err)
{
static char buf[20];
if (err >= 0 && err < sys_nerr)
static char MDMAXFRAC[] = "17976931348623157";
static double HUGE = 1.7976931348623157e308;
-extern double atof(); /* Only called when result known to be ok */
+extern double atof(const char *); /* Only called when result known to be ok */
#ifndef DONT_HAVE_ERRNO_H
#include <errno.h>
#endif
extern int errno;
-double strtod(str, ptr)
- char *str;
- char **ptr;
- {
+double strtod(char *str, char **ptr)
+{
int sign, scale, dotseen;
int esign, expt;
char *save;
(void) sprintf(dp, "E%d", expt);
errno = 0;
return atof(buffer)*sign;
- }
+}
#include "structmember.h"
static PyObject *
-listmembers(mlist)
- struct memberlist *mlist;
+listmembers(struct memberlist *mlist)
{
int i, n;
PyObject *v;
}
PyObject *
-PyMember_Get(addr, mlist, name)
- char *addr;
- struct memberlist *mlist;
- char *name;
+PyMember_Get(char *addr, struct memberlist *mlist, char *name)
{
struct memberlist *l;
}
int
-PyMember_Set(addr, mlist, name, v)
- char *addr;
- struct memberlist *mlist;
- char *name;
- PyObject *v;
+PyMember_Set(char *addr, struct memberlist *mlist, char *name, PyObject *v)
{
struct memberlist *l;
PyObject *oldv;
#endif
PyObject *
-PySys_GetObject(name)
- char *name;
+PySys_GetObject(char *name)
{
PyThreadState *tstate = PyThreadState_Get();
PyObject *sd = tstate->interp->sysdict;
}
FILE *
-PySys_GetFile(name, def)
- char *name;
- FILE *def;
+PySys_GetFile(char *name, FILE *def)
{
FILE *fp = NULL;
PyObject *v = PySys_GetObject(name);
}
int
-PySys_SetObject(name, v)
- char *name;
- PyObject *v;
+PySys_SetObject(char *name, PyObject *v)
{
PyThreadState *tstate = PyThreadState_Get();
PyObject *sd = tstate->interp->sysdict;
}
static PyObject *
-sys_exc_info(self, args)
- PyObject *self;
- PyObject *args;
+sys_exc_info(PyObject *self, PyObject *args)
{
PyThreadState *tstate;
if (!PyArg_ParseTuple(args, ":exc_info"))
This should be called from inside an except clause only.";
static PyObject *
-sys_exit(self, args)
- PyObject *self;
- PyObject *args;
+sys_exit(PyObject *self, PyObject *args)
{
/* Raise SystemExit so callers may catch it or clean up. */
PyErr_SetObject(PyExc_SystemExit, args);
exit status will be one (i.e., failure).";
static PyObject *
-sys_getdefaultencoding(self, args)
- PyObject *self;
- PyObject *args;
+sys_getdefaultencoding(PyObject *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ":getdefaultencoding"))
return NULL;
implementation.";
static PyObject *
-sys_setdefaultencoding(self, args)
- PyObject *self;
- PyObject *args;
+sys_setdefaultencoding(PyObject *self, PyObject *args)
{
char *encoding;
if (!PyArg_ParseTuple(args, "s:setdefaultencoding", &encoding))
Set the current default string encoding used by the Unicode implementation.";
static PyObject *
-sys_settrace(self, args)
- PyObject *self;
- PyObject *args;
+sys_settrace(PyObject *self, PyObject *args)
{
PyThreadState *tstate = PyThreadState_Get();
if (args == Py_None)
function call. See the debugger chapter in the library manual.";
static PyObject *
-sys_setprofile(self, args)
- PyObject *self;
- PyObject *args;
+sys_setprofile(PyObject *self, PyObject *args)
{
PyThreadState *tstate = PyThreadState_Get();
if (args == Py_None)
and return. See the profiler chapter in the library manual.";
static PyObject *
-sys_setcheckinterval(self, args)
- PyObject *self;
- PyObject *args;
+sys_setcheckinterval(PyObject *self, PyObject *args)
{
PyThreadState *tstate = PyThreadState_Get();
if (!PyArg_ParseTuple(args, "i:setcheckinterval", &tstate->interp->checkinterval))
#include <malloc.h>
static PyObject *
-sys_mdebug(self, args)
- PyObject *self;
- PyObject *args;
+sys_mdebug(PyObject *self, PyObject *args)
{
int flag;
if (!PyArg_ParseTuple(args, "i:mdebug", &flag))
#endif /* USE_MALLOPT */
static PyObject *
-sys_getrefcount(self, args)
- PyObject *self;
- PyObject *args;
+sys_getrefcount(PyObject *self, PyObject *args)
{
PyObject *arg;
if (!PyArg_ParseTuple(args, "O:getrefcount", &arg))
#ifdef COUNT_ALLOCS
static PyObject *
-sys_getcounts(self, args)
- PyObject *self, *args;
+sys_getcounts(PyObject *self, PyObject *args)
{
extern PyObject *get_counts(void);
};
static PyObject *
-list_builtin_module_names()
+list_builtin_module_names(void)
{
PyObject *list = PyList_New(0);
int i;
#endif
PyObject *
-_PySys_Init()
+_PySys_Init(void)
{
extern int fclose(FILE *);
PyObject *m, *v, *sysdict;
}
static PyObject *
-makepathobject(path, delim)
- char *path;
- int delim;
+makepathobject(char *path, int delim)
{
int i, n;
char *p;
}
void
-PySys_SetPath(path)
- char *path;
+PySys_SetPath(char *path)
{
PyObject *v;
if ((v = makepathobject(path, DELIM)) == NULL)
}
static PyObject *
-makeargvobject(argc, argv)
- int argc;
- char **argv;
+makeargvobject(int argc, char **argv)
{
PyObject *av;
if (argc <= 0 || argv == NULL) {
}
void
-PySys_SetArgv(argc, argv)
- int argc;
- char **argv;
+PySys_SetArgv(int argc, char **argv)
{
PyObject *av = makeargvobject(argc, argv);
PyObject *path = PySys_GetObject("path");
*/
static void
-mywrite(name, fp, format, va)
- char *name;
- FILE *fp;
- const char *format;
- va_list va;
+mywrite(char *name, FILE *fp, const char *format, va_list va)
{
PyObject *file;
PyObject *error_type, *error_value, *error_traceback;
}
void
-#ifdef HAVE_STDARG_PROTOTYPES
PySys_WriteStdout(const char *format, ...)
-#else
-PySys_WriteStdout(va_alist)
- va_dcl
-#endif
{
va_list va;
-#ifdef HAVE_STDARG_PROTOTYPES
va_start(va, format);
-#else
- char *format;
- va_start(va);
- format = va_arg(va, char *);
-#endif
mywrite("stdout", stdout, format, va);
va_end(va);
}
void
-#ifdef HAVE_STDARG_PROTOTYPES
PySys_WriteStderr(const char *format, ...)
-#else
-PySys_WriteStderr(va_alist)
- va_dcl
-#endif
{
va_list va;
-#ifdef HAVE_STDARG_PROTOTYPES
va_start(va, format);
-#else
- char *format;
- va_start(va);
- format = va_arg(va, char *);
-#endif
mywrite("stderr", stderr, format, va);
va_end(va);
}
#include <stdlib.h>
#else
#ifdef Py_DEBUG
-extern char *getenv();
+extern char *getenv(const char *);
#endif
#endif
#endif /* _POSIX_THREADS */
-#ifdef __STDC__
-#define _P(args) args
-#define _P0() (void)
-#define _P1(v,t) (t)
-#define _P2(v1,t1,v2,t2) (t1,t2)
-#else
-#define _P(args) ()
-#define _P0() ()
-#define _P1(v,t) (v) t;
-#define _P2(v1,t1,v2,t2) (v1,v2) t1; t2;
-#endif /* __STDC__ */
#ifdef Py_DEBUG
static int thread_debug = 0;
static void PyThread__init_thread(); /* Forward */
-void PyThread_init_thread _P0()
+void PyThread_init_thread(void)
{
#ifdef Py_DEBUG
char *p = getenv("THREADDEBUG");
/*
* Initialization.
*/
-static void PyThread__init_thread _P0()
+static void
+PyThread__init_thread(void)
{
cthread_init();
}
/*
* Thread support.
*/
-int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
+int
+PyThread_start_new_thread(func, void (*func)(void *), void *arg)
{
int success = 0; /* init not needed when SOLARIS_THREADS and */
/* C_THREADS implemented properly */
return success < 0 ? 0 : 1;
}
-long PyThread_get_thread_ident _P0()
+long
+PyThread_get_thread_ident(void)
{
if (!initialized)
PyThread_init_thread();
return (long) cthread_self();
}
-static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup)
+static void
+do_PyThread_exit_thread(int no_cleanup)
{
dprintf(("PyThread_exit_thread called\n"));
if (!initialized)
cthread_exit(0);
}
-void PyThread_exit_thread _P0()
+void
+PyThread_exit_thread(void)
{
do_PyThread_exit_thread(0);
}
-void PyThread__exit_thread _P0()
+void
+PyThread__exit_thread(void)
{
do_PyThread_exit_thread(1);
}
#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cleanup)
+static
+void do_PyThread_exit_prog(int status, int no_cleanup)
{
dprintf(("PyThread_exit_prog(%d) called\n", status));
if (!initialized)
exit(status);
}
-void PyThread_exit_prog _P1(status, int status)
+void
+PyThread_exit_prog(int status)
{
do_PyThread_exit_prog(status, 0);
}
-void PyThread__exit_prog _P1(status, int status)
+void
+PyThread__exit_prog(int status)
{
do_PyThread_exit_prog(status, 1);
}
/*
* Lock support.
*/
-PyThread_type_lock PyThread_allocate_lock _P0()
+PyThread_type_lock
+PyThread_allocate_lock(void)
{
mutex_t lock;
return (PyThread_type_lock) lock;
}
-void PyThread_free_lock _P1(lock, PyThread_type_lock lock)
+void
+PyThread_free_lock(PyThread_type_lock lock)
{
dprintf(("PyThread_free_lock(%p) called\n", lock));
mutex_free(lock);
}
-int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitflag)
+int
+PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
{
int success = FALSE;
return success;
}
-void PyThread_release_lock _P1(lock, PyThread_type_lock lock)
+void
+PyThread_release_lock(PyThread_type_lock lock)
{
dprintf(("PyThread_release_lock(%p) called\n", lock));
mutex_unlock((mutex_t )lock);
* semaphore using a condition.
*
*/
-PyThread_type_sema PyThread_allocate_sema _P1(value, int value)
+PyThread_type_sema
+PyThread_allocate_sema(int value)
{
char *sema = 0;
dprintf(("PyThread_allocate_sema called\n"));
return (PyThread_type_sema) sema;
}
-void PyThread_free_sema _P1(sema, PyThread_type_sema sema)
+void
+PyThread_free_sema(PyThread_type_sema sema)
{
dprintf(("PyThread_free_sema(%p) called\n", sema));
}
-int PyThread_down_sema _P2(sema, PyThread_type_sema sema, waitflag, int waitflag)
+int
+PyThread_down_sema(PyThread_type_sema sema, int waitflag)
{
dprintf(("PyThread_down_sema(%p, %d) called\n", sema, waitflag));
dprintf(("PyThread_down_sema(%p) return\n", sema));
return -1;
}
-void PyThread_up_sema _P1(sema, PyThread_type_sema sema)
+void
+PyThread_up_sema(PyThread_type_sema sema)
{
dprintf(("PyThread_up_sema(%p)\n", sema));
}
/*
* Initialization.
*/
-static void PyThread__init_thread _P0()
+static void
+PyThread__init_thread(void)
{
}
/*
* Thread support.
*/
-int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
+int
+PyThread_start_new_thread(void (*func)(void *), void *arg)
{
int success = 0; /* init not needed when SOLARIS_THREADS and */
/* C_THREADS implemented properly */
return success < 0 ? 0 : 1;
}
-long PyThread_get_thread_ident _P0()
+long
+PyThread_get_thread_ident(void)
{
if (!initialized)
PyThread_init_thread();
}
-static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup)
+static
+void do_PyThread_exit_thread(int no_cleanup)
{
dprintf(("PyThread_exit_thread called\n"));
if (!initialized)
exit(0);
}
-void PyThread_exit_thread _P0()
+void
+PyThread_exit_thread(void)
{
do_PyThread_exit_thread(0);
}
-void PyThread__exit_thread _P0()
+void
+PyThread__exit_thread(void)
{
do_PyThread_exit_thread(1);
}
#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cleanup)
+static
+void do_PyThread_exit_prog(int status, int no_cleanup)
{
dprintf(("PyThread_exit_prog(%d) called\n", status));
if (!initialized)
exit(status);
}
-void PyThread_exit_prog _P1(status, int status)
+void
+PyThread_exit_prog(int status)
{
do_PyThread_exit_prog(status, 0);
}
-void PyThread__exit_prog _P1(status, int status)
+void
+PyThread__exit_prog(int status)
{
do_PyThread_exit_prog(status, 1);
}
/*
* Lock support.
*/
-PyThread_type_lock PyThread_allocate_lock _P0()
+PyThread_type_lock
+PyThread_allocate_lock(void)
{
dprintf(("PyThread_allocate_lock called\n"));
return (PyThread_type_lock) lock;
}
-void PyThread_free_lock _P1(lock, PyThread_type_lock lock)
+void
+PyThread_free_lock(PyThread_type_lock lock)
{
dprintf(("PyThread_free_lock(%p) called\n", lock));
}
-int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitflag)
+int
+PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
{
int success;
return success;
}
-void PyThread_release_lock _P1(lock, PyThread_type_lock lock)
+void
+PyThread_release_lock(PyThread_type_lock lock)
{
dprintf(("PyThread_release_lock(%p) called\n", lock));
}
/*
* Semaphore support.
*/
-PyThread_type_sema PyThread_allocate_sema _P1(value, int value)
+PyThread_type_sema
+PyThread_allocate_sema(int value)
{
dprintf(("PyThread_allocate_sema called\n"));
if (!initialized)
return (PyThread_type_sema) sema;
}
-void PyThread_free_sema _P1(sema, PyThread_type_sema sema)
+void
+PyThread_free_sema(PyThread_type_sema sema)
{
dprintf(("PyThread_free_sema(%p) called\n", sema));
}
-int PyThread_down_sema _P2(sema, PyThread_type_sema sema, waitflag, int waitflag)
+int
+PyThread_down_sema(PyThread_type_sema sema, int waitflag)
{
dprintf(("PyThread_down_sema(%p, %d) called\n", sema, waitflag));
dprintf(("PyThread_down_sema(%p) return\n", sema));
return -1;
}
-void PyThread_up_sema _P1(sema, PyThread_type_sema sema)
+void
+PyThread_up_sema(PyThread_type_sema sema)
{
dprintf(("PyThread_up_sema(%p)\n", sema));
}
/*
* Initialization.
*/
-static void PyThread__init_thread _P0()
+static void PyThread__init_thread(void)
{
lwp_setstkcache(STACKSIZE, NSTACKS);
}
*/
-int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
+int PyThread_start_new_thread(void (*func)(void *), void *arg)
{
thread_t tid;
int success;
return success < 0 ? 0 : 1;
}
-long PyThread_get_thread_ident _P0()
+long PyThread_get_thread_ident(void)
{
thread_t tid;
if (!initialized)
return tid.thread_id;
}
-static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup)
+static void do_PyThread_exit_thread(int no_cleanup)
{
dprintf(("PyThread_exit_thread called\n"));
if (!initialized)
lwp_destroy(SELF);
}
-void PyThread_exit_thread _P0()
+void PyThread_exit_thread(void)
{
do_PyThread_exit_thread(0);
}
-void PyThread__exit_thread _P0()
+void PyThread__exit_thread(void)
{
do_PyThread_exit_thread(1);
}
#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cleanup)
+static void do_PyThread_exit_prog(int status, int no_cleanup)
{
dprintf(("PyThread_exit_prog(%d) called\n", status));
if (!initialized)
pod_exit(status);
}
-void PyThread_exit_prog _P1(status, int status)
+void PyThread_exit_prog(int status)
{
do_PyThread_exit_prog(status, 0);
}
-void PyThread__exit_prog _P1(status, int status)
+void PyThread__exit_prog(int status)
{
do_PyThread_exit_prog(status, 1);
}
/*
* Lock support.
*/
-PyThread_type_lock PyThread_allocate_lock _P0()
+PyThread_type_lock PyThread_allocate_lock(void)
{
struct lock *lock;
extern char *malloc();
return (PyThread_type_lock) lock;
}
-void PyThread_free_lock _P1(lock, PyThread_type_lock lock)
+void PyThread_free_lock(PyThread_type_lock lock)
{
dprintf(("PyThread_free_lock(%p) called\n", lock));
mon_destroy(((struct lock *) lock)->lock_monitor);
free((char *) lock);
}
-int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitflag)
+int PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
{
int success;
return success;
}
-void PyThread_release_lock _P1(lock, PyThread_type_lock lock)
+void PyThread_release_lock(PyThread_type_lock lock)
{
dprintf(("PyThread_release_lock(%p) called\n", lock));
(void) mon_enter(((struct lock *) lock)->lock_monitor);
/*
* Semaphore support.
*/
-PyThread_type_sema PyThread_allocate_sema _P1(value, int value)
+PyThread_type_sema PyThread_allocate_sema(int value)
{
PyThread_type_sema sema = 0;
dprintf(("PyThread_allocate_sema called\n"));
return (PyThread_type_sema) sema;
}
-void PyThread_free_sema _P1(sema, PyThread_type_sema sema)
+void PyThread_free_sema(PyThread_type_sema sema)
{
dprintf(("PyThread_free_sema(%p) called\n", sema));
}
-int PyThread_down_sema _P2(sema, PyThread_type_sema sema, waitflag, int waitflag)
+int PyThread_down_sema(PyThread_type_sema sema, int waitflag)
{
dprintf(("PyThread_down_sema(%p, %d) called\n", sema, waitflag));
dprintf(("PyThread_down_sema(%p) return\n", sema));
return -1;
}
-void PyThread_up_sema _P1(sema, PyThread_type_sema sema)
+void PyThread_up_sema(PyThread_type_sema sema)
{
dprintf(("PyThread_up_sema(%p)\n", sema));
}
SetEvent(mutex->hevent) ; /* Other threads are waiting, wake one on them up */
}
-PNRMUTEX AllocNonRecursiveMutex()
+PNRMUTEX AllocNonRecursiveMutex(void)
{
PNRMUTEX mutex = (PNRMUTEX)malloc(sizeof(NRMUTEX)) ;
if (mutex && !InitializeNonRecursiveMutex(mutex))
do_PyThread_exit_prog(status, 0);
}
-void PyThread__exit_prog _P1(int status)
+void PyThread__exit_prog(int status)
{
do_PyThread_exit_prog(status, 1);
}
/*
* Initialization of the C package, should not be needed.
*/
-static void PyThread__init_thread(void)
+static void
+PyThread__init_thread(void)
{
}
/*
* Thread support.
*/
-int PyThread_start_new_thread(void (*func)(void *), void *arg)
+int
+PyThread_start_new_thread(void (*func)(void *), void *arg)
{
int aThread;
int success = 1;
return success;
}
-long PyThread_get_thread_ident(void)
+long
+PyThread_get_thread_ident(void)
{
PPIB pib;
PTIB tib;
return tib->tib_ptib2->tib2_ultid;
}
-static void do_PyThread_exit_thread(int no_cleanup)
+static void
+do_PyThread_exit_thread(int no_cleanup)
{
dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident()));
if (!initialized)
_endthread();
}
-void PyThread_exit_thread(void)
+void
+PyThread_exit_thread(void)
{
do_PyThread_exit_thread(0);
}
-void PyThread__exit_thread(void)
+void
+PyThread__exit_thread(void)
{
do_PyThread_exit_thread(1);
}
#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog(int status, int no_cleanup)
+static void
+do_PyThread_exit_prog(int status, int no_cleanup)
{
dprintf(("PyThread_exit_prog(%d) called\n", status));
if (!initialized)
exit(status);
}
-void PyThread_exit_prog(int status)
+void
+PyThread_exit_prog(int status)
{
do_PyThread_exit_prog(status, 0);
}
-void PyThread__exit_prog _P1(int status)
+void
+PyThread__exit_prog(int status)
{
do_PyThread_exit_prog(status, 1);
}
* I [Dag] tried to implement it with mutex but I could find a way to
* tell whether a thread already own the lock or not.
*/
-PyThread_type_lock PyThread_allocate_lock(void)
+PyThread_type_lock
+PyThread_allocate_lock(void)
{
HMTX aLock;
APIRET rc;
return (PyThread_type_lock) aLock;
}
-void PyThread_free_lock(PyThread_type_lock aLock)
+void
+PyThread_free_lock(PyThread_type_lock aLock)
{
dprintf(("%ld: PyThread_free_lock(%p) called\n", PyThread_get_thread_ident(),aLock));
* and 0 if the lock was not acquired. This means a 0 is returned
* if the lock has already been acquired by this thread!
*/
-int PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
+int
+PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
{
int success = 1;
ULONG rc, count;
return success;
}
-void PyThread_release_lock(PyThread_type_lock aLock)
+void
+PyThread_release_lock(PyThread_type_lock aLock)
{
dprintf(("%ld: PyThread_release_lock(%p) called\n", PyThread_get_thread_ident(),aLock));
/*
* Semaphore support.
*/
-PyThread_type_sema PyThread_allocate_sema(int value)
+PyThread_type_sema
+PyThread_allocate_sema(int value)
{
return (PyThread_type_sema) 0;
}
-void PyThread_free_sema(PyThread_type_sema aSemaphore)
+void
+PyThread_free_sema(PyThread_type_sema aSemaphore)
{
}
-int PyThread_down_sema(PyThread_type_sema aSemaphore, int waitflag)
+int
+PyThread_down_sema(PyThread_type_sema aSemaphore, int waitflag)
{
return -1;
}
-void PyThread_up_sema(PyThread_type_sema aSemaphore)
+void
+PyThread_up_sema(PyThread_type_sema aSemaphore)
{
dprintf(("%ld: PyThread_up_sema(%p)\n", PyThread_get_thread_ident(), aSemaphore));
}
* Initialization.
*/
-static void PyThread__init_thread _P0()
+static void PyThread__init_thread(void)
{
pth_init();
}
*/
-int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
+int PyThread_start_new_thread(void (*func)(void *), void *arg)
{
pth_t th;
int success;
PyThread_init_thread();
th = pth_spawn(PTH_ATTR_DEFAULT,
- (void* (*)_P((void *)))func,
+ (void* (*)(void *))func,
(void *)arg
);
return th == NULL ? 0 : 1;
}
-long PyThread_get_thread_ident _P0()
+long PyThread_get_thread_ident(void)
{
volatile pth_t threadid;
if (!initialized)
return (long) *(long *) &threadid;
}
-static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup)
+static void do_PyThread_exit_thread(int no_cleanup)
{
dprintf(("PyThread_exit_thread called\n"));
if (!initialized) {
}
}
-void PyThread_exit_thread _P0()
+void PyThread_exit_thread(void)
{
do_PyThread_exit_thread(0);
}
-void PyThread__exit_thread _P0()
+void PyThread__exit_thread(void)
{
do_PyThread_exit_thread(1);
}
#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cleanup)
+static void do_PyThread_exit_prog(int status, int no_cleanup)
{
dprintf(("PyThread_exit_prog(%d) called\n", status));
if (!initialized)
exit(status);
}
-void PyThread_exit_prog _P1(status, int status)
+void PyThread_exit_prog(int status)
{
do_PyThread_exit_prog(status, 0);
}
-void PyThread__exit_prog _P1(status, int status)
+void PyThread__exit_prog(int status)
{
do_PyThread_exit_prog(status, 1);
}
/*
* Lock support.
*/
-PyThread_type_lock PyThread_allocate_lock _P0()
+PyThread_type_lock PyThread_allocate_lock(void)
{
pth_lock *lock;
int status, error = 0;
return (PyThread_type_lock) lock;
}
-void PyThread_free_lock _P1(lock, PyThread_type_lock lock)
+void PyThread_free_lock(PyThread_type_lock lock)
{
pth_lock *thelock = (pth_lock *)lock;
int status, error = 0;
free((void *)thelock);
}
-int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitflag)
+int PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
{
int success;
pth_lock *thelock = (pth_lock *)lock;
return success;
}
-void PyThread_release_lock _P1(lock, PyThread_type_lock lock)
+void PyThread_release_lock(PyThread_type_lock lock)
{
pth_lock *thelock = (pth_lock *)lock;
int status, error = 0;
int value;
};
-PyThread_type_sema PyThread_allocate_sema _P1(value, int value)
+PyThread_type_sema PyThread_allocate_sema(int value)
{
struct semaphore *sema;
int status, error = 0;
return (PyThread_type_sema) sema;
}
-void PyThread_free_sema _P1(sema, PyThread_type_sema sema)
+void PyThread_free_sema(PyThread_type_sema sema)
{
int status, error = 0;
struct semaphore *thesema = (struct semaphore *) sema;
free((void *) thesema);
}
-int PyThread_down_sema _P2(sema, PyThread_type_sema sema, waitflag, int waitflag)
+int PyThread_down_sema(PyThread_type_sema sema, int waitflag)
{
int status, error = 0, success;
struct semaphore *thesema = (struct semaphore *) sema;
return success;
}
-void PyThread_up_sema _P1(sema, PyThread_type_sema sema)
+void PyThread_up_sema(PyThread_type_sema sema)
{
int status, error = 0;
struct semaphore *thesema = (struct semaphore *) sema;
*/
#ifdef _HAVE_BSDI
-static void _noop()
+static
+void _noop(void)
{
}
-static void PyThread__init_thread _P0()
+static void
+PyThread__init_thread(void)
{
/* DO AN INIT BY STARTING THE THREAD */
static int dummy = 0;
#else /* !_HAVE_BSDI */
-static void PyThread__init_thread _P0()
+static void
+PyThread__init_thread(void)
{
#if defined(_AIX) && defined(__GNUC__)
pthread_init();
*/
-int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
+int
+PyThread_start_new_thread(void (*func)(void *), void *arg)
{
pthread_t th;
int success;
(pthread_addr_t)arg
#elif defined(PY_PTHREAD_D6)
pthread_attr_default,
- (void* (*)_P((void *)))func,
+ (void* (*)(void *))func,
arg
#elif defined(PY_PTHREAD_D7)
pthread_attr_default,
arg
#elif defined(PY_PTHREAD_STD)
(pthread_attr_t*)NULL,
- (void* (*)_P((void *)))func,
+ (void* (*)(void *))func,
(void *)arg
#endif
);
return success != 0 ? 0 : 1;
}
-long PyThread_get_thread_ident _P0()
+long
+PyThread_get_thread_ident(void)
{
volatile pthread_t threadid;
if (!initialized)
return (long) *(long *) &threadid;
}
-static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup)
+static void
+do_PyThread_exit_thread(int no_cleanup)
{
dprintf(("PyThread_exit_thread called\n"));
if (!initialized) {
}
}
-void PyThread_exit_thread _P0()
+void
+PyThread_exit_thread(void)
{
do_PyThread_exit_thread(0);
}
-void PyThread__exit_thread _P0()
+void
+PyThread__exit_thread(void)
{
do_PyThread_exit_thread(1);
}
#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cleanup)
+static void
+do_PyThread_exit_prog(int status, int no_cleanup)
{
dprintf(("PyThread_exit_prog(%d) called\n", status));
if (!initialized)
exit(status);
}
-void PyThread_exit_prog _P1(status, int status)
+void
+PyThread_exit_prog(int status)
{
do_PyThread_exit_prog(status, 0);
}
-void PyThread__exit_prog _P1(status, int status)
+void
+PyThread__exit_prog(int status)
{
do_PyThread_exit_prog(status, 1);
}
/*
* Lock support.
*/
-PyThread_type_lock PyThread_allocate_lock _P0()
+PyThread_type_lock
+PyThread_allocate_lock(void)
{
pthread_lock *lock;
int status, error = 0;
return (PyThread_type_lock) lock;
}
-void PyThread_free_lock _P1(lock, PyThread_type_lock lock)
+void
+PyThread_free_lock(PyThread_type_lock lock)
{
pthread_lock *thelock = (pthread_lock *)lock;
int status, error = 0;
free((void *)thelock);
}
-int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitflag)
+int
+PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
{
int success;
pthread_lock *thelock = (pthread_lock *)lock;
return success;
}
-void PyThread_release_lock _P1(lock, PyThread_type_lock lock)
+void
+PyThread_release_lock(PyThread_type_lock lock)
{
pthread_lock *thelock = (pthread_lock *)lock;
int status, error = 0;
int value;
};
-PyThread_type_sema PyThread_allocate_sema _P1(value, int value)
+PyThread_type_sema
+PyThread_allocate_sema(int value)
{
struct semaphore *sema;
int status, error = 0;
return (PyThread_type_sema) sema;
}
-void PyThread_free_sema _P1(sema, PyThread_type_sema sema)
+void
+PyThread_free_sema(PyThread_type_sema sema)
{
int status, error = 0;
struct semaphore *thesema = (struct semaphore *) sema;
free((void *) thesema);
}
-int PyThread_down_sema _P2(sema, PyThread_type_sema sema, waitflag, int waitflag)
+int
+PyThread_down_sema(PyThread_type_sema sema, int waitflag)
{
int status, error = 0, success;
struct semaphore *thesema = (struct semaphore *) sema;
return success;
}
-void PyThread_up_sema _P1(sema, PyThread_type_sema sema)
+void
+PyThread_up_sema(PyThread_type_sema sema)
{
int status, error = 0;
struct semaphore *thesema = (struct semaphore *) sema;
* exits. When that happens, we must see whether we have to exit as
* well (because of an PyThread_exit_prog()) or whether we should continue on.
*/
-static void exit_sig _P0()
+static void exit_sig(void)
{
d2printf(("exit_sig called\n"));
if (exiting && getpid() == my_pid) {
* This routine is called when a process calls exit(). If that wasn't
* done from the library, we do as if an PyThread_exit_prog() was intended.
*/
-static void maybe_exit _P0()
+static void maybe_exit(void)
{
dprintf(("maybe_exit called\n"));
if (exiting) {
/*
* Initialization.
*/
-static void PyThread__init_thread _P0()
+static void PyThread__init_thread(void)
{
#ifndef NO_EXIT_PROG
struct sigaction s;
* Thread support.
*/
-static void clean_threads _P0()
+static void clean_threads(void)
{
int i, j;
pid_t mypid, pid;
}
}
-int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
+int PyThread_start_new_thread(void (*func)(void *), void *arg)
{
#ifdef USE_DL
long addr, size;
return success < 0 ? 0 : 1;
}
-long PyThread_get_thread_ident _P0()
+long PyThread_get_thread_ident(void)
{
return getpid();
}
-static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup)
+static void do_PyThread_exit_thread(int no_cleanup)
{
dprintf(("PyThread_exit_thread called\n"));
if (!initialized)
_exit(0);
}
-void PyThread_exit_thread _P0()
+void PyThread_exit_thread(void)
{
do_PyThread_exit_thread(0);
}
-void PyThread__exit_thread _P0()
+void PyThread__exit_thread(void)
{
do_PyThread_exit_thread(1);
}
#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cleanup)
+static void do_PyThread_exit_prog(int status, int no_cleanup)
{
dprintf(("PyThread_exit_prog(%d) called\n", status));
if (!initialized)
do_PyThread_exit_thread(no_cleanup);
}
-void PyThread_exit_prog _P1(status, int status)
+void PyThread_exit_prog(int status)
{
do_PyThread_exit_prog(status, 0);
}
-void PyThread__exit_prog _P1(status, int status)
+void PyThread__exit_prog(int status)
{
do_PyThread_exit_prog(status, 1);
}
/*
* Lock support.
*/
-PyThread_type_lock PyThread_allocate_lock _P0()
+PyThread_type_lock PyThread_allocate_lock(void)
{
ulock_t lock;
return (PyThread_type_lock) lock;
}
-void PyThread_free_lock _P1(lock, PyThread_type_lock lock)
+void PyThread_free_lock(PyThread_type_lock lock)
{
dprintf(("PyThread_free_lock(%p) called\n", lock));
usfreelock((ulock_t) lock, shared_arena);
}
-int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitflag)
+int PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
{
int success;
return success;
}
-void PyThread_release_lock _P1(lock, PyThread_type_lock lock)
+void PyThread_release_lock(PyThread_type_lock lock)
{
dprintf(("PyThread_release_lock(%p) called\n", lock));
if (usunsetlock((ulock_t) lock) < 0)
/*
* Semaphore support.
*/
-PyThread_type_sema PyThread_allocate_sema _P1(value, int value)
+PyThread_type_sema PyThread_allocate_sema(int value)
{
usema_t *sema;
dprintf(("PyThread_allocate_sema called\n"));
return (PyThread_type_sema) sema;
}
-void PyThread_free_sema _P1(sema, PyThread_type_sema sema)
+void PyThread_free_sema(PyThread_type_sema sema)
{
dprintf(("PyThread_free_sema(%p) called\n", sema));
usfreesema((usema_t *) sema, shared_arena);
}
-int PyThread_down_sema _P2(sema, PyThread_type_sema sema, waitflag, int waitflag)
+int PyThread_down_sema(PyThread_type_sema sema, int waitflag)
{
int success;
return success;
}
-void PyThread_up_sema _P1(sema, PyThread_type_sema sema)
+void PyThread_up_sema(PyThread_type_sema sema)
{
dprintf(("PyThread_up_sema(%p)\n", sema));
if (usvsema((usema_t *) sema) < 0)
static int nkeys = 0;
static PyThread_type_lock keymutex = NULL;
-static struct key *find_key _P2(key, int key, value, void *value)
+static struct key *find_key(int key, void *value)
{
struct key *p;
long id = PyThread_get_thread_ident();
return p;
}
-int PyThread_create_key _P0()
+int PyThread_create_key(void)
{
if (keymutex == NULL)
keymutex = PyThread_allocate_lock();
return ++nkeys;
}
-void PyThread_delete_key _P1(key, int key)
+void PyThread_delete_key(int key)
{
struct key *p, **q;
PyThread_acquire_lock(keymutex, 1);
PyThread_release_lock(keymutex);
}
-int PyThread_set_key_value _P2(key, int key, value, void *value)
+int PyThread_set_key_value(int key, void *value)
{
struct key *p = find_key(key, value);
if (p == NULL)
return 0;
}
-void *PyThread_get_key_value _P1(key, int key)
+void *PyThread_get_key_value(int key)
{
struct key *p = find_key(key, NULL);
if (p == NULL)
/*
* Initialization.
*/
-static void PyThread__init_thread _P0()
+static void PyThread__init_thread(void)
{
}
* Thread support.
*/
struct func_arg {
- void (*func) _P((void *));
+ void (*func)(void *);
void *arg;
};
-static void *new_func _P1(funcarg, void *funcarg)
+static void *
+new_func(void *funcarg)
{
- void (*func) _P((void *));
+ void (*func)(void *);
void *arg;
func = ((struct func_arg *) funcarg)->func;
}
-int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
+int
+PyThread_start_new_thread(void (*func)(void *), void *arg)
{
struct func_arg *funcarg;
int success = 0; /* init not needed when SOLARIS_THREADS and */
return success < 0 ? 0 : 1;
}
-long PyThread_get_thread_ident _P0()
+long
+PyThread_get_thread_ident(void)
{
if (!initialized)
PyThread_init_thread();
return thr_self();
}
-static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup)
+static void
+do_PyThread_exit_thread(int no_cleanup)
{
dprintf(("PyThread_exit_thread called\n"));
if (!initialized)
thr_exit(0);
}
-void PyThread_exit_thread _P0()
+void
+PyThread_exit_thread(void)
{
do_PyThread_exit_thread(0);
}
-void PyThread__exit_thread _P0()
+void
+PyThread__exit_thread(void)
{
do_PyThread_exit_thread(1);
}
#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cleanup)
+static void
+do_PyThread_exit_prog(int status, int no_cleanup)
{
dprintf(("PyThread_exit_prog(%d) called\n", status));
if (!initialized)
exit(status);
}
-void PyThread_exit_prog _P1(status, int status)
+void
+PyThread_exit_prog(int status)
{
do_PyThread_exit_prog(status, 0);
}
-void PyThread__exit_prog _P1(status, int status)
+void
+PyThread__exit_prog(int status)
{
do_PyThread_exit_prog(status, 1);
}
/*
* Lock support.
*/
-PyThread_type_lock PyThread_allocate_lock _P0()
+PyThread_type_lock
+PyThread_allocate_lock(void)
{
mutex_t *lock;
return (PyThread_type_lock) lock;
}
-void PyThread_free_lock _P1(lock, PyThread_type_lock lock)
+void
+PyThread_free_lock(PyThread_type_lock lock)
{
dprintf(("PyThread_free_lock(%p) called\n", lock));
mutex_destroy((mutex_t *) lock);
free((void *) lock);
}
-int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitflag)
+int
+PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
{
int success;
return success;
}
-void PyThread_release_lock _P1(lock, PyThread_type_lock lock)
+void
+PyThread_release_lock(PyThread_type_lock lock)
{
dprintf(("PyThread_release_lock(%p) called\n", lock));
if (mutex_unlock((mutex_t *) lock))
/*
* Semaphore support.
*/
-PyThread_type_sema PyThread_allocate_sema _P1(value, int value)
+PyThread_type_sema
+PyThread_allocate_sema(int value)
{
sema_t *sema;
dprintf(("PyThread_allocate_sema called\n"));
return (PyThread_type_sema) sema;
}
-void PyThread_free_sema _P1(sema, PyThread_type_sema sema)
+void
+PyThread_free_sema(PyThread_type_sema sema)
{
dprintf(("PyThread_free_sema(%p) called\n", sema));
if (sema_destroy((sema_t *) sema))
free((void *) sema);
}
-int PyThread_down_sema _P2(sema, PyThread_type_sema sema, waitflag, int waitflag)
+int
+PyThread_down_sema(PyThread_type_sema sema, int waitflag)
{
int success;
return success;
}
-void PyThread_up_sema _P1(sema, PyThread_type_sema sema)
+void
+PyThread_up_sema(PyThread_type_sema sema)
{
dprintf(("PyThread_up_sema(%p)\n", sema));
if (sema_post((sema_t *) sema))
do_PyThread_exit_prog(status, 0);
}
-void PyThread__exit_prog _P1(int status)
+void PyThread__exit_prog(int status)
{
do_PyThread_exit_prog(status, 1);
}
};
static PyObject *
-tb_getattr(tb, name)
- tracebackobject *tb;
- char *name;
+tb_getattr(tracebackobject *tb, char *name)
{
return PyMember_Get((char *)tb, tb_memberlist, name);
}
static void
-tb_dealloc(tb)
- tracebackobject *tb;
+tb_dealloc(tracebackobject *tb)
{
Py_TRASHCAN_SAFE_BEGIN(tb)
Py_XDECREF(tb->tb_next);
};
static tracebackobject *
-newtracebackobject(next, frame, lasti, lineno)
- tracebackobject *next;
- PyFrameObject *frame;
- int lasti, lineno;
+newtracebackobject(tracebackobject *next, PyFrameObject *frame, int lasti,
+ int lineno)
{
tracebackobject *tb;
if ((next != NULL && !is_tracebackobject(next)) ||
}
int
-PyTraceBack_Here(frame)
- PyFrameObject *frame;
+PyTraceBack_Here(PyFrameObject *frame)
{
PyThreadState *tstate = frame->f_tstate;
tracebackobject *oldtb = (tracebackobject *) tstate->curexc_traceback;
}
static int
-tb_displayline(f, filename, lineno, name)
- PyObject *f;
- char *filename;
- int lineno;
- char *name;
+tb_displayline(PyObject *f, char *filename, int lineno, char *name)
{
int err = 0;
FILE *xfp;
}
static int
-tb_printinternal(tb, f, limit)
- tracebackobject *tb;
- PyObject *f;
- int limit;
+tb_printinternal(tracebackobject *tb, PyObject *f, int limit)
{
int err = 0;
int depth = 0;
}
int
-PyTraceBack_Print(v, f)
- PyObject *v;
- PyObject *f;
+PyTraceBack_Print(PyObject *v, PyObject *f)
{
int err;
PyObject *limitv;