summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/snd/Sndmodule.c
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-06-09 20:56:31 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-06-09 20:56:31 (GMT)
commit7d0bc8343f55f2e467abb2ce50b76b054897d72f (patch)
treec3a2618e7c6c09c201d03bb67dc1038cab7dc534 /Mac/Modules/snd/Sndmodule.c
parenta0e76bebd3ddb05461c9f692ff1f53267203aaae (diff)
downloadcpython-7d0bc8343f55f2e467abb2ce50b76b054897d72f.zip
cpython-7d0bc8343f55f2e467abb2ce50b76b054897d72f.tar.gz
cpython-7d0bc8343f55f2e467abb2ce50b76b054897d72f.tar.bz2
Ported to Universal Header 2.0.1f (i.e. CW6)
Diffstat (limited to 'Mac/Modules/snd/Sndmodule.c')
-rw-r--r--Mac/Modules/snd/Sndmodule.c72
1 files changed, 32 insertions, 40 deletions
diff --git a/Mac/Modules/snd/Sndmodule.c b/Mac/Modules/snd/Sndmodule.c
index 62e9d85..fbc8ff2 100644
--- a/Mac/Modules/snd/Sndmodule.c
+++ b/Mac/Modules/snd/Sndmodule.c
@@ -496,15 +496,14 @@ static PyObject *Snd_Comp3to1(_self, _args)
char *buffer__out__;
long buffer__len__;
int buffer__in_len__;
- char *state__in__;
- char state__out__[128];
- int state__len__;
+ StateBlock *state__in__;
+ StateBlock state__out__;
int state__in_len__;
unsigned long numChannels;
unsigned long whichChannel;
if (!PyArg_ParseTuple(_args, "s#s#ll",
&buffer__in__, &buffer__in_len__,
- &state__in__, &state__in_len__,
+ (char **)&state__in__, &state__in_len__,
&numChannels,
&whichChannel))
return NULL;
@@ -514,19 +513,18 @@ static PyObject *Snd_Comp3to1(_self, _args)
goto buffer__error__;
}
buffer__len__ = buffer__in_len__;
- if (state__in_len__ != 128)
+ if (state__in_len__ != sizeof(StateBlock))
{
- PyErr_SetString(PyExc_TypeError, "buffer length should be 128");
+ PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(StateBlock)");
goto state__error__;
}
- state__len__ = state__in_len__;
Comp3to1(buffer__in__, buffer__out__, (long)buffer__len__,
- state__in__, state__out__,
+ state__in__, &state__out__,
numChannels,
whichChannel);
_res = Py_BuildValue("s#s#",
buffer__out__, (int)buffer__len__,
- state__out__, (int)128);
+ (char *)&state__out__, (int)sizeof(StateBlock));
state__error__: ;
free(buffer__out__);
buffer__error__: ;
@@ -542,15 +540,14 @@ static PyObject *Snd_Exp1to3(_self, _args)
char *buffer__out__;
long buffer__len__;
int buffer__in_len__;
- char *state__in__;
- char state__out__[128];
- int state__len__;
+ StateBlock *state__in__;
+ StateBlock state__out__;
int state__in_len__;
unsigned long numChannels;
unsigned long whichChannel;
if (!PyArg_ParseTuple(_args, "s#s#ll",
&buffer__in__, &buffer__in_len__,
- &state__in__, &state__in_len__,
+ (char **)&state__in__, &state__in_len__,
&numChannels,
&whichChannel))
return NULL;
@@ -560,19 +557,18 @@ static PyObject *Snd_Exp1to3(_self, _args)
goto buffer__error__;
}
buffer__len__ = buffer__in_len__;
- if (state__in_len__ != 128)
+ if (state__in_len__ != sizeof(StateBlock))
{
- PyErr_SetString(PyExc_TypeError, "buffer length should be 128");
+ PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(StateBlock)");
goto state__error__;
}
- state__len__ = state__in_len__;
Exp1to3(buffer__in__, buffer__out__, (long)buffer__len__,
- state__in__, state__out__,
+ state__in__, &state__out__,
numChannels,
whichChannel);
_res = Py_BuildValue("s#s#",
buffer__out__, (int)buffer__len__,
- state__out__, (int)128);
+ (char *)&state__out__, (int)sizeof(StateBlock));
state__error__: ;
free(buffer__out__);
buffer__error__: ;
@@ -588,15 +584,14 @@ static PyObject *Snd_Comp6to1(_self, _args)
char *buffer__out__;
long buffer__len__;
int buffer__in_len__;
- char *state__in__;
- char state__out__[128];
- int state__len__;
+ StateBlock *state__in__;
+ StateBlock state__out__;
int state__in_len__;
unsigned long numChannels;
unsigned long whichChannel;
if (!PyArg_ParseTuple(_args, "s#s#ll",
&buffer__in__, &buffer__in_len__,
- &state__in__, &state__in_len__,
+ (char **)&state__in__, &state__in_len__,
&numChannels,
&whichChannel))
return NULL;
@@ -606,19 +601,18 @@ static PyObject *Snd_Comp6to1(_self, _args)
goto buffer__error__;
}
buffer__len__ = buffer__in_len__;
- if (state__in_len__ != 128)
+ if (state__in_len__ != sizeof(StateBlock))
{
- PyErr_SetString(PyExc_TypeError, "buffer length should be 128");
+ PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(StateBlock)");
goto state__error__;
}
- state__len__ = state__in_len__;
Comp6to1(buffer__in__, buffer__out__, (long)buffer__len__,
- state__in__, state__out__,
+ state__in__, &state__out__,
numChannels,
whichChannel);
_res = Py_BuildValue("s#s#",
buffer__out__, (int)buffer__len__,
- state__out__, (int)128);
+ (char *)&state__out__, (int)sizeof(StateBlock));
state__error__: ;
free(buffer__out__);
buffer__error__: ;
@@ -634,15 +628,14 @@ static PyObject *Snd_Exp1to6(_self, _args)
char *buffer__out__;
long buffer__len__;
int buffer__in_len__;
- char *state__in__;
- char state__out__[128];
- int state__len__;
+ StateBlock *state__in__;
+ StateBlock state__out__;
int state__in_len__;
unsigned long numChannels;
unsigned long whichChannel;
if (!PyArg_ParseTuple(_args, "s#s#ll",
&buffer__in__, &buffer__in_len__,
- &state__in__, &state__in_len__,
+ (char **)&state__in__, &state__in_len__,
&numChannels,
&whichChannel))
return NULL;
@@ -652,19 +645,18 @@ static PyObject *Snd_Exp1to6(_self, _args)
goto buffer__error__;
}
buffer__len__ = buffer__in_len__;
- if (state__in_len__ != 128)
+ if (state__in_len__ != sizeof(StateBlock))
{
- PyErr_SetString(PyExc_TypeError, "buffer length should be 128");
+ PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(StateBlock)");
goto state__error__;
}
- state__len__ = state__in_len__;
Exp1to6(buffer__in__, buffer__out__, (long)buffer__len__,
- state__in__, state__out__,
+ state__in__, &state__out__,
numChannels,
whichChannel);
_res = Py_BuildValue("s#s#",
buffer__out__, (int)buffer__len__,
- state__out__, (int)128);
+ (char *)&state__out__, (int)sizeof(StateBlock));
state__error__: ;
free(buffer__out__);
buffer__error__: ;
@@ -776,13 +768,13 @@ static PyMethodDef Snd_methods[] = {
{"MACEVersion", (PyCFunction)Snd_MACEVersion, 1,
"() -> (NumVersion _rv)"},
{"Comp3to1", (PyCFunction)Snd_Comp3to1, 1,
- "(Buffer buffer, Buffer state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, Buffer state)"},
+ "(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)"},
{"Exp1to3", (PyCFunction)Snd_Exp1to3, 1,
- "(Buffer buffer, Buffer state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, Buffer state)"},
+ "(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)"},
{"Comp6to1", (PyCFunction)Snd_Comp6to1, 1,
- "(Buffer buffer, Buffer state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, Buffer state)"},
+ "(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)"},
{"Exp1to6", (PyCFunction)Snd_Exp1to6, 1,
- "(Buffer buffer, Buffer state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, Buffer state)"},
+ "(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)"},
{"GetSysBeepVolume", (PyCFunction)Snd_GetSysBeepVolume, 1,
"() -> (long level)"},
{"SetSysBeepVolume", (PyCFunction)Snd_SetSysBeepVolume, 1,