33[clinic start generated code]*/
44
55PyDoc_STRVAR (winsound_PlaySound__doc__ ,
6- "PlaySound($module, sound, flags, / )\n"
6+ "PlaySound($module, /, sound, flags )\n"
77"--\n"
88"\n"
99"A wrapper around the Windows PlaySound API.\n"
@@ -14,19 +14,21 @@ PyDoc_STRVAR(winsound_PlaySound__doc__,
1414" Flag values, ored together. See module documentation." );
1515
1616#define WINSOUND_PLAYSOUND_METHODDEF \
17- {"PlaySound", (PyCFunction)winsound_PlaySound, METH_VARARGS, winsound_PlaySound__doc__},
17+ {"PlaySound", (PyCFunction)winsound_PlaySound, METH_VARARGS|METH_KEYWORDS , winsound_PlaySound__doc__},
1818
1919static PyObject *
2020winsound_PlaySound_impl (PyObject * module , PyObject * sound , int flags );
2121
2222static PyObject *
23- winsound_PlaySound (PyObject * module , PyObject * args )
23+ winsound_PlaySound (PyObject * module , PyObject * args , PyObject * kwargs )
2424{
2525 PyObject * return_value = NULL ;
26+ static const char * const _keywords [] = {"sound" , "flags" , NULL };
27+ static _PyArg_Parser _parser = {"Oi:PlaySound" , _keywords , 0 };
2628 PyObject * sound ;
2729 int flags ;
2830
29- if (!PyArg_ParseTuple (args , "Oi:PlaySound" ,
31+ if (!_PyArg_ParseTupleAndKeywordsFast (args , kwargs , & _parser ,
3032 & sound , & flags )) {
3133 goto exit ;
3234 }
@@ -37,7 +39,7 @@ winsound_PlaySound(PyObject *module, PyObject *args)
3739}
3840
3941PyDoc_STRVAR (winsound_Beep__doc__ ,
40- "Beep($module, frequency, duration, / )\n"
42+ "Beep($module, /, frequency, duration )\n"
4143"--\n"
4244"\n"
4345"A wrapper around the Windows Beep API.\n"
@@ -49,19 +51,21 @@ PyDoc_STRVAR(winsound_Beep__doc__,
4951" How long the sound should play, in milliseconds." );
5052
5153#define WINSOUND_BEEP_METHODDEF \
52- {"Beep", (PyCFunction)winsound_Beep, METH_VARARGS, winsound_Beep__doc__},
54+ {"Beep", (PyCFunction)winsound_Beep, METH_VARARGS|METH_KEYWORDS , winsound_Beep__doc__},
5355
5456static PyObject *
5557winsound_Beep_impl (PyObject * module , int frequency , int duration );
5658
5759static PyObject *
58- winsound_Beep (PyObject * module , PyObject * args )
60+ winsound_Beep (PyObject * module , PyObject * args , PyObject * kwargs )
5961{
6062 PyObject * return_value = NULL ;
63+ static const char * const _keywords [] = {"frequency" , "duration" , NULL };
64+ static _PyArg_Parser _parser = {"ii:Beep" , _keywords , 0 };
6165 int frequency ;
6266 int duration ;
6367
64- if (!PyArg_ParseTuple (args , "ii:Beep" ,
68+ if (!_PyArg_ParseTupleAndKeywordsFast (args , kwargs , & _parser ,
6569 & frequency , & duration )) {
6670 goto exit ;
6771 }
@@ -72,32 +76,34 @@ winsound_Beep(PyObject *module, PyObject *args)
7276}
7377
7478PyDoc_STRVAR (winsound_MessageBeep__doc__ ,
75- "MessageBeep($module, x=MB_OK, / )\n"
79+ "MessageBeep($module, /, type=MB_OK )\n"
7680"--\n"
7781"\n"
7882"Call Windows MessageBeep(x).\n"
7983"\n"
8084"x defaults to MB_OK." );
8185
8286#define WINSOUND_MESSAGEBEEP_METHODDEF \
83- {"MessageBeep", (PyCFunction)winsound_MessageBeep, METH_VARARGS, winsound_MessageBeep__doc__},
87+ {"MessageBeep", (PyCFunction)winsound_MessageBeep, METH_VARARGS|METH_KEYWORDS , winsound_MessageBeep__doc__},
8488
8589static PyObject *
86- winsound_MessageBeep_impl (PyObject * module , int x );
90+ winsound_MessageBeep_impl (PyObject * module , int type );
8791
8892static PyObject *
89- winsound_MessageBeep (PyObject * module , PyObject * args )
93+ winsound_MessageBeep (PyObject * module , PyObject * args , PyObject * kwargs )
9094{
9195 PyObject * return_value = NULL ;
92- int x = MB_OK ;
96+ static const char * const _keywords [] = {"type" , NULL };
97+ static _PyArg_Parser _parser = {"|i:MessageBeep" , _keywords , 0 };
98+ int type = MB_OK ;
9399
94- if (!PyArg_ParseTuple (args , "|i:MessageBeep" ,
95- & x )) {
100+ if (!_PyArg_ParseTupleAndKeywordsFast (args , kwargs , & _parser ,
101+ & type )) {
96102 goto exit ;
97103 }
98- return_value = winsound_MessageBeep_impl (module , x );
104+ return_value = winsound_MessageBeep_impl (module , type );
99105
100106exit :
101107 return return_value ;
102108}
103- /*[clinic end generated code: output=b999334e2e444ad2 input=a9049054013a1b77]*/
109+ /*[clinic end generated code: output=40b3d3ef2faefb15 input=a9049054013a1b77]*/
0 commit comments