-char *macstrerror PROTO((int)); /* strerror with mac errors */
-object *PyErr_Mac PROTO((object *, int)); /* Exception with a mac error */
-int PyMac_Idle PROTO((void)); /* Idle routine */
\ No newline at end of file
+char *macstrerror Py_PROTO((int)); /* strerror with mac errors */
+PyObject *PyErr_Mac Py_PROTO((PyObject *, int)); /* Exception with a mac error */
+int PyMac_Idle Py_PROTO((void)); /* Idle routine */
#include "Python.h"
#include "macglue.h"
-#include <stdio.h>
-#include <string.h>
#include <errno.h>
#include <OSUtils.h> /* for Set(Current)A5 */
/* Resource objects */
typedef struct {
- OB_HEAD
+ PyObject_HEAD
Handle h;
} RsrcObject;
type = PyString_FromStringAndSize((char *)&info.fdType, 4);
creator = PyString_FromStringAndSize((char *)&info.fdCreator, 4);
res = Py_BuildValue("OO", type, creator);
- DECREF(type);
- DECREF(creator);
+ Py_DECREF(type);
+ Py_DECREF(creator);
return res;
}
info.fdCreator = creator;
if ((err = SetFInfo(name, 0, &info)) != noErr) {
errno = err;
- err_errno(MacOS_Error);
+ PyErr_SetFromErrno(MacOS_Error);
return NULL;
}
Py_INCREF(Py_None);
}
typedef struct {
- OB_HEAD
+ PyObject_HEAD
SndChannelPtr chan;
} SndChObject;
s->chan = NULL;
SndDisposeChannel(chan, quitNow);
if (userInfo != 0)
- DEL(userInfo);
+ PyMem_DEL(userInfo);
}
}
Py_DECREF(args);
if (res == NULL)
return -1;
- DECREF(res);
+ Py_DECREF(res);
return 0;
}
if (!PyArg_ParseTuple(args, "h|lO", &synth, &init, &callback))
return NULL;
if (callback != NULL) {
- p = NEW(cbinfo, 1);
+ p = PyMem_NEW(cbinfo, 1);
if (p == NULL)
return PyErr_NoMemory();
p->A5 = SetCurrentA5();
err = SndNewChannel(&chan, synth, init, userroutine);
if (err) {
if (p)
- DEL(p);
+ PyMem_DEL(p);
return PyErr_Mac(MacOS_Error, (int)err);
}
res = (PyObject *)SndCh_FromSndChannelPtr(chan);
if (res == NULL) {
SndDisposeChannel(chan, 1);
- DEL(p);
+ PyMem_DEL(p);
}
else {
chan->userInfo = (long)p;
/* Set a MAC-specific error from errno, and return NULL; return None if no error */
PyObject *
-PyErr_Mac(object *eobj, int err)
+PyErr_Mac(PyObject *eobj, int err)
{
char *msg;
PyObject *v;