ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c

have already been checked in)

UNTESTED!
This commit is contained in:
Peter Schneider-Kamp 2000-07-10 17:04:33 +00:00
parent 10723347c6
commit 6a85027a97
7 changed files with 769 additions and 2295 deletions

View file

@ -29,8 +29,7 @@ staticforward PyTypeObject Fhtype;
#define is_fhobject(v) ((v)->ob_type == &Fhtype)
static PyObject *
newfhobject(fh)
fmfonthandle fh;
newfhobject(fmfonthandle fh)
{
fhobject *fhp;
if (fh == NULL) {
@ -48,9 +47,7 @@ newfhobject(fh)
/* Font Handle methods */
static PyObject *
fh_scalefont(self, args)
fhobject *self;
PyObject *args;
fh_scalefont(fhobject *self, PyObject *args)
{
double size;
if (!PyArg_Parse(args, "d", &size))
@ -61,9 +58,7 @@ PyObject *args;
/* XXX fmmakefont */
static PyObject *
fh_setfont(self, args)
fhobject *self;
PyObject *args;
fh_setfont(fhobject *self, PyObject *args)
{
if (!PyArg_NoArgs(args))
return NULL;
@ -73,9 +68,7 @@ PyObject *args;
}
static PyObject *
fh_getfontname(self, args)
fhobject *self;
PyObject *args;
fh_getfontname(fhobject *self, PyObject *args)
{
char fontname[256];
int len;
@ -90,9 +83,7 @@ PyObject *args;
}
static PyObject *
fh_getcomment(self, args)
fhobject *self;
PyObject *args;
fh_getcomment(fhobject *self, PyObject *args)
{
char comment[256];
int len;
@ -107,9 +98,7 @@ PyObject *args;
}
static PyObject *
fh_getfontinfo(self, args)
fhobject *self;
PyObject *args;
fh_getfontinfo(fhobject *self, PyObject *args)
{
fmfontinfo info;
if (!PyArg_NoArgs(args))
@ -131,17 +120,13 @@ PyObject *args;
#if 0
static PyObject *
fh_getwholemetrics(self, args)
fhobject *self;
PyObject *args;
fh_getwholemetrics(fhobject *self, PyObject *args)
{
}
#endif
static PyObject *
fh_getstrwidth(self, args)
fhobject *self;
PyObject *args;
fh_getstrwidth(fhobject *self, PyObject *args)
{
char *str;
if (!PyArg_Parse(args, "s", &str))
@ -163,16 +148,13 @@ static PyMethodDef fh_methods[] = {
};
static PyObject *
fh_getattr(fhp, name)
fhobject *fhp;
char *name;
fh_getattr(fhobject *fhp, char *name)
{
return Py_FindMethod(fh_methods, (PyObject *)fhp, name);
}
static void
fh_dealloc(fhp)
fhobject *fhp;
fh_dealloc(fhobject *fhp)
{
fmfreefont(fhp->fh_fh);
PyObject_Del(fhp);
@ -197,8 +179,7 @@ static PyTypeObject Fhtype = {
/* Font Manager functions */
static PyObject *
fm_init(self, args)
PyObject *self, *args;
fm_init(PyObject *self, *args)
{
if (!PyArg_NoArgs(args))
return NULL;
@ -208,8 +189,7 @@ fm_init(self, args)
}
static PyObject *
fm_findfont(self, args)
PyObject *self, *args;
fm_findfont(PyObject *self, *args)
{
char *str;
if (!PyArg_Parse(args, "s", &str))
@ -218,8 +198,7 @@ fm_findfont(self, args)
}
static PyObject *
fm_prstr(self, args)
PyObject *self, *args;
fm_prstr(PyObject *self, *args)
{
char *str;
if (!PyArg_Parse(args, "s", &str))
@ -234,8 +213,7 @@ fm_prstr(self, args)
static PyObject *fontlist;
static void
clientproc(fontname)
char *fontname;
clientproc(char *fontname)
{
int err;
PyObject *v;
@ -255,8 +233,7 @@ clientproc(fontname)
}
static PyObject *
fm_enumerate(self, args)
PyObject *self, *args;
fm_enumerate(PyObject *self, PyObject *args)
{
PyObject *res;
if (!PyArg_NoArgs(args))
@ -271,8 +248,7 @@ fm_enumerate(self, args)
}
static PyObject *
fm_setpath(self, args)
PyObject *self, *args;
fm_setpath(PyObject *self, PyObject *args)
{
char *str;
if (!PyArg_Parse(args, "s", &str))
@ -283,8 +259,7 @@ fm_setpath(self, args)
}
static PyObject *
fm_fontpath(self, args)
PyObject *self, *args;
fm_fontpath(PyObject *self, *args)
{
if (!PyArg_NoArgs(args))
return NULL;