mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Ported to Universal Header 2.0.1f (i.e. CW6)
This commit is contained in:
parent
a0e76bebd3
commit
7d0bc8343f
32 changed files with 519 additions and 490 deletions
|
@ -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,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Generated from 'Moes:CW5 GOLD \304:Metrowerks C/C++ \304:Headers \304:Universal Headers 2.0a3 \304:Sound.h'
|
||||
# Generated from 'Moes:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Sound.h'
|
||||
|
||||
f = SndFunction(void, 'SetSoundVol',
|
||||
(short, 'level', InMode),
|
||||
|
@ -100,7 +100,7 @@ functions.append(f)
|
|||
|
||||
f = SndFunction(void, 'Comp3to1',
|
||||
(InOutBuffer, 'buffer', InOutMode),
|
||||
(InOutBuf128, 'state', InOutMode),
|
||||
(StateBlock, 'state', InOutMode),
|
||||
(unsigned_long, 'numChannels', InMode),
|
||||
(unsigned_long, 'whichChannel', InMode),
|
||||
)
|
||||
|
@ -108,7 +108,7 @@ functions.append(f)
|
|||
|
||||
f = SndFunction(void, 'Exp1to3',
|
||||
(InOutBuffer, 'buffer', InOutMode),
|
||||
(InOutBuf128, 'state', InOutMode),
|
||||
(StateBlock, 'state', InOutMode),
|
||||
(unsigned_long, 'numChannels', InMode),
|
||||
(unsigned_long, 'whichChannel', InMode),
|
||||
)
|
||||
|
@ -116,7 +116,7 @@ functions.append(f)
|
|||
|
||||
f = SndFunction(void, 'Comp6to1',
|
||||
(InOutBuffer, 'buffer', InOutMode),
|
||||
(InOutBuf128, 'state', InOutMode),
|
||||
(StateBlock, 'state', InOutMode),
|
||||
(unsigned_long, 'numChannels', InMode),
|
||||
(unsigned_long, 'whichChannel', InMode),
|
||||
)
|
||||
|
@ -124,7 +124,7 @@ functions.append(f)
|
|||
|
||||
f = SndFunction(void, 'Exp1to6',
|
||||
(InOutBuffer, 'buffer', InOutMode),
|
||||
(InOutBuf128, 'state', InOutMode),
|
||||
(StateBlock, 'state', InOutMode),
|
||||
(unsigned_long, 'numChannels', InMode),
|
||||
(unsigned_long, 'whichChannel', InMode),
|
||||
)
|
||||
|
|
|
@ -43,6 +43,9 @@ class SoundScanner(Scanner):
|
|||
'GetSoundPreference',
|
||||
'SetSoundPreference',
|
||||
'GetCompressionInfo',
|
||||
# And 3.1 calls, ditto...
|
||||
'SndGetInfo',
|
||||
'SndSetInfo',
|
||||
|
||||
]
|
||||
|
||||
|
@ -89,8 +92,11 @@ class SoundScanner(Scanner):
|
|||
[("InOutBuffer", "buffer", "InOutMode")]),
|
||||
|
||||
# Ditto
|
||||
([("void_ptr", "inState", "InMode"), ("void", "outState", "OutMode")],
|
||||
[("InOutBuf128", "state", "InOutMode")]),
|
||||
## ([("void_ptr", "inState", "InMode"), ("void", "outState", "OutMode")],
|
||||
## [("InOutBuf128", "state", "InOutMode")]),
|
||||
([("StateBlockPtr", "inState", "InMode"), ("StateBlockPtr", "outState", "InMode")],
|
||||
[("StateBlock", "state", "InOutMode")]),
|
||||
|
||||
]
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -81,7 +81,8 @@ SndCompletionUPP = SndCompletionProcPtr
|
|||
|
||||
NumVersion = OpaqueByValueType('NumVersion', 'NumVer')
|
||||
|
||||
InOutBuf128 = FixedInputOutputBufferType(128)
|
||||
##InOutBuf128 = FixedInputOutputBufferType(128)
|
||||
StateBlock = StructInputOutputBufferType('StateBlock')
|
||||
|
||||
AudioSelectionPtr = FakeType('0') # XXX
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue