diff options
Diffstat (limited to 'PC/clinic/winreg.c.h')
-rw-r--r-- | PC/clinic/winreg.c.h | 135 |
1 files changed, 85 insertions, 50 deletions
diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index f6ae2c0b92..c7d5b9e452 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -77,24 +77,26 @@ PyDoc_STRVAR(winreg_HKEYType___exit____doc__, "\n"); #define WINREG_HKEYTYPE___EXIT___METHODDEF \ - {"__exit__", (PyCFunction)winreg_HKEYType___exit__, METH_VARARGS|METH_KEYWORDS, winreg_HKEYType___exit____doc__}, + {"__exit__", (PyCFunction)winreg_HKEYType___exit__, METH_FASTCALL, winreg_HKEYType___exit____doc__}, static PyObject * winreg_HKEYType___exit___impl(PyHKEYObject *self, PyObject *exc_type, PyObject *exc_value, PyObject *traceback); static PyObject * -winreg_HKEYType___exit__(PyHKEYObject *self, PyObject *args, PyObject *kwargs) +winreg_HKEYType___exit__(PyHKEYObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"exc_type", "exc_value", "traceback", NULL}; + static const char * const _keywords[] = {"exc_type", "exc_value", "traceback", NULL}; + static _PyArg_Parser _parser = {"OOO:__exit__", _keywords, 0}; PyObject *exc_type; PyObject *exc_value; PyObject *traceback; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:__exit__", _keywords, - &exc_type, &exc_value, &traceback)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &exc_type, &exc_value, &traceback)) { goto exit; + } return_value = winreg_HKEYType___exit___impl(self, exc_type, exc_value, traceback); exit: @@ -147,11 +149,13 @@ winreg_ConnectRegistry(PyObject *module, PyObject *args) HKEY _return_value; if (!PyArg_ParseTuple(args, "ZO&:ConnectRegistry", - &computer_name, clinic_HKEY_converter, &key)) + &computer_name, clinic_HKEY_converter, &key)) { goto exit; + } _return_value = winreg_ConnectRegistry_impl(module, computer_name, key); - if (_return_value == NULL) + if (_return_value == NULL) { goto exit; + } return_value = PyHKEY_FromHKEY(_return_value); exit: @@ -192,11 +196,13 @@ winreg_CreateKey(PyObject *module, PyObject *args) HKEY _return_value; if (!PyArg_ParseTuple(args, "O&Z:CreateKey", - clinic_HKEY_converter, &key, &sub_key)) + clinic_HKEY_converter, &key, &sub_key)) { goto exit; + } _return_value = winreg_CreateKey_impl(module, key, sub_key); - if (_return_value == NULL) + if (_return_value == NULL) { goto exit; + } return_value = PyHKEY_FromHKEY(_return_value); exit: @@ -229,29 +235,32 @@ PyDoc_STRVAR(winreg_CreateKeyEx__doc__, "If the function fails, an OSError exception is raised."); #define WINREG_CREATEKEYEX_METHODDEF \ - {"CreateKeyEx", (PyCFunction)winreg_CreateKeyEx, METH_VARARGS|METH_KEYWORDS, winreg_CreateKeyEx__doc__}, + {"CreateKeyEx", (PyCFunction)winreg_CreateKeyEx, METH_FASTCALL, winreg_CreateKeyEx__doc__}, static HKEY winreg_CreateKeyEx_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, int reserved, REGSAM access); static PyObject * -winreg_CreateKeyEx(PyObject *module, PyObject *args, PyObject *kwargs) +winreg_CreateKeyEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"key", "sub_key", "reserved", "access", NULL}; + static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL}; + static _PyArg_Parser _parser = {"O&Z|ii:CreateKeyEx", _keywords, 0}; HKEY key; Py_UNICODE *sub_key; int reserved = 0; REGSAM access = KEY_WRITE; HKEY _return_value; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&Z|ii:CreateKeyEx", _keywords, - clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; + } _return_value = winreg_CreateKeyEx_impl(module, key, sub_key, reserved, access); - if (_return_value == NULL) + if (_return_value == NULL) { goto exit; + } return_value = PyHKEY_FromHKEY(_return_value); exit: @@ -290,8 +299,9 @@ winreg_DeleteKey(PyObject *module, PyObject *args) Py_UNICODE *sub_key; if (!PyArg_ParseTuple(args, "O&u:DeleteKey", - clinic_HKEY_converter, &key, &sub_key)) + clinic_HKEY_converter, &key, &sub_key)) { goto exit; + } return_value = winreg_DeleteKey_impl(module, key, sub_key); exit: @@ -324,25 +334,27 @@ PyDoc_STRVAR(winreg_DeleteKeyEx__doc__, "On unsupported Windows versions, NotImplementedError is raised."); #define WINREG_DELETEKEYEX_METHODDEF \ - {"DeleteKeyEx", (PyCFunction)winreg_DeleteKeyEx, METH_VARARGS|METH_KEYWORDS, winreg_DeleteKeyEx__doc__}, + {"DeleteKeyEx", (PyCFunction)winreg_DeleteKeyEx, METH_FASTCALL, winreg_DeleteKeyEx__doc__}, static PyObject * winreg_DeleteKeyEx_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, REGSAM access, int reserved); static PyObject * -winreg_DeleteKeyEx(PyObject *module, PyObject *args, PyObject *kwargs) +winreg_DeleteKeyEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"key", "sub_key", "access", "reserved", NULL}; + static const char * const _keywords[] = {"key", "sub_key", "access", "reserved", NULL}; + static _PyArg_Parser _parser = {"O&u|ii:DeleteKeyEx", _keywords, 0}; HKEY key; Py_UNICODE *sub_key; REGSAM access = KEY_WOW64_64KEY; int reserved = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&u|ii:DeleteKeyEx", _keywords, - clinic_HKEY_converter, &key, &sub_key, &access, &reserved)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + clinic_HKEY_converter, &key, &sub_key, &access, &reserved)) { goto exit; + } return_value = winreg_DeleteKeyEx_impl(module, key, sub_key, access, reserved); exit: @@ -374,8 +386,9 @@ winreg_DeleteValue(PyObject *module, PyObject *args) Py_UNICODE *value; if (!PyArg_ParseTuple(args, "O&Z:DeleteValue", - clinic_HKEY_converter, &key, &value)) + clinic_HKEY_converter, &key, &value)) { goto exit; + } return_value = winreg_DeleteValue_impl(module, key, value); exit: @@ -411,8 +424,9 @@ winreg_EnumKey(PyObject *module, PyObject *args) int index; if (!PyArg_ParseTuple(args, "O&i:EnumKey", - clinic_HKEY_converter, &key, &index)) + clinic_HKEY_converter, &key, &index)) { goto exit; + } return_value = winreg_EnumKey_impl(module, key, index); exit: @@ -457,8 +471,9 @@ winreg_EnumValue(PyObject *module, PyObject *args) int index; if (!PyArg_ParseTuple(args, "O&i:EnumValue", - clinic_HKEY_converter, &key, &index)) + clinic_HKEY_converter, &key, &index)) { goto exit; + } return_value = winreg_EnumValue_impl(module, key, index); exit: @@ -483,8 +498,9 @@ winreg_ExpandEnvironmentStrings(PyObject *module, PyObject *arg) PyObject *return_value = NULL; Py_UNICODE *string; - if (!PyArg_Parse(arg, "u:ExpandEnvironmentStrings", &string)) + if (!PyArg_Parse(arg, "u:ExpandEnvironmentStrings", &string)) { goto exit; + } return_value = winreg_ExpandEnvironmentStrings_impl(module, string); exit: @@ -522,8 +538,9 @@ winreg_FlushKey(PyObject *module, PyObject *arg) PyObject *return_value = NULL; HKEY key; - if (!PyArg_Parse(arg, "O&:FlushKey", clinic_HKEY_converter, &key)) + if (!PyArg_Parse(arg, "O&:FlushKey", clinic_HKEY_converter, &key)) { goto exit; + } return_value = winreg_FlushKey_impl(module, key); exit: @@ -574,8 +591,9 @@ winreg_LoadKey(PyObject *module, PyObject *args) Py_UNICODE *file_name; if (!PyArg_ParseTuple(args, "O&uu:LoadKey", - clinic_HKEY_converter, &key, &sub_key, &file_name)) + clinic_HKEY_converter, &key, &sub_key, &file_name)) { goto exit; + } return_value = winreg_LoadKey_impl(module, key, sub_key, file_name); exit: @@ -602,29 +620,32 @@ PyDoc_STRVAR(winreg_OpenKey__doc__, "If the function fails, an OSError exception is raised."); #define WINREG_OPENKEY_METHODDEF \ - {"OpenKey", (PyCFunction)winreg_OpenKey, METH_VARARGS|METH_KEYWORDS, winreg_OpenKey__doc__}, + {"OpenKey", (PyCFunction)winreg_OpenKey, METH_FASTCALL, winreg_OpenKey__doc__}, static HKEY winreg_OpenKey_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, int reserved, REGSAM access); static PyObject * -winreg_OpenKey(PyObject *module, PyObject *args, PyObject *kwargs) +winreg_OpenKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"key", "sub_key", "reserved", "access", NULL}; + static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL}; + static _PyArg_Parser _parser = {"O&Z|ii:OpenKey", _keywords, 0}; HKEY key; Py_UNICODE *sub_key; int reserved = 0; REGSAM access = KEY_READ; HKEY _return_value; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&Z|ii:OpenKey", _keywords, - clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; + } _return_value = winreg_OpenKey_impl(module, key, sub_key, reserved, access); - if (_return_value == NULL) + if (_return_value == NULL) { goto exit; + } return_value = PyHKEY_FromHKEY(_return_value); exit: @@ -651,29 +672,32 @@ PyDoc_STRVAR(winreg_OpenKeyEx__doc__, "If the function fails, an OSError exception is raised."); #define WINREG_OPENKEYEX_METHODDEF \ - {"OpenKeyEx", (PyCFunction)winreg_OpenKeyEx, METH_VARARGS|METH_KEYWORDS, winreg_OpenKeyEx__doc__}, + {"OpenKeyEx", (PyCFunction)winreg_OpenKeyEx, METH_FASTCALL, winreg_OpenKeyEx__doc__}, static HKEY winreg_OpenKeyEx_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, int reserved, REGSAM access); static PyObject * -winreg_OpenKeyEx(PyObject *module, PyObject *args, PyObject *kwargs) +winreg_OpenKeyEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"key", "sub_key", "reserved", "access", NULL}; + static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL}; + static _PyArg_Parser _parser = {"O&Z|ii:OpenKeyEx", _keywords, 0}; HKEY key; Py_UNICODE *sub_key; int reserved = 0; REGSAM access = KEY_READ; HKEY _return_value; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&Z|ii:OpenKeyEx", _keywords, - clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; + } _return_value = winreg_OpenKeyEx_impl(module, key, sub_key, reserved, access); - if (_return_value == NULL) + if (_return_value == NULL) { goto exit; + } return_value = PyHKEY_FromHKEY(_return_value); exit: @@ -707,8 +731,9 @@ winreg_QueryInfoKey(PyObject *module, PyObject *arg) PyObject *return_value = NULL; HKEY key; - if (!PyArg_Parse(arg, "O&:QueryInfoKey", clinic_HKEY_converter, &key)) + if (!PyArg_Parse(arg, "O&:QueryInfoKey", clinic_HKEY_converter, &key)) { goto exit; + } return_value = winreg_QueryInfoKey_impl(module, key); exit: @@ -749,8 +774,9 @@ winreg_QueryValue(PyObject *module, PyObject *args) Py_UNICODE *sub_key; if (!PyArg_ParseTuple(args, "O&Z:QueryValue", - clinic_HKEY_converter, &key, &sub_key)) + clinic_HKEY_converter, &key, &sub_key)) { goto exit; + } return_value = winreg_QueryValue_impl(module, key, sub_key); exit: @@ -787,8 +813,9 @@ winreg_QueryValueEx(PyObject *module, PyObject *args) Py_UNICODE *name; if (!PyArg_ParseTuple(args, "O&Z:QueryValueEx", - clinic_HKEY_converter, &key, &name)) + clinic_HKEY_converter, &key, &name)) { goto exit; + } return_value = winreg_QueryValueEx_impl(module, key, name); exit: @@ -830,8 +857,9 @@ winreg_SaveKey(PyObject *module, PyObject *args) Py_UNICODE *file_name; if (!PyArg_ParseTuple(args, "O&u:SaveKey", - clinic_HKEY_converter, &key, &file_name)) + clinic_HKEY_converter, &key, &file_name)) { goto exit; + } return_value = winreg_SaveKey_impl(module, key, file_name); exit: @@ -883,8 +911,9 @@ winreg_SetValue(PyObject *module, PyObject *args) Py_ssize_clean_t value_length; if (!PyArg_ParseTuple(args, "O&Zku#:SetValue", - clinic_HKEY_converter, &key, &sub_key, &type, &value, &value_length)) + clinic_HKEY_converter, &key, &sub_key, &type, &value, &value_length)) { goto exit; + } return_value = winreg_SetValue_impl(module, key, sub_key, type, value, value_length); exit: @@ -907,7 +936,7 @@ PyDoc_STRVAR(winreg_SetValueEx__doc__, " An integer that specifies the type of the data, one of:\n" " REG_BINARY -- Binary data in any form.\n" " REG_DWORD -- A 32-bit number.\n" -" REG_DWORD_LITTLE_ENDIAN -- A 32-bit number in little-endian format.\n" +" REG_DWORD_LITTLE_ENDIAN -- A 32-bit number in little-endian format. Equivalent to REG_DWORD\n" " REG_DWORD_BIG_ENDIAN -- A 32-bit number in big-endian format.\n" " REG_EXPAND_SZ -- A null-terminated string that contains unexpanded\n" " references to environment variables (for example,\n" @@ -917,6 +946,8 @@ PyDoc_STRVAR(winreg_SetValueEx__doc__, " by two null characters. Note that Python handles\n" " this termination automatically.\n" " REG_NONE -- No defined value type.\n" +" REG_QWORD -- A 64-bit number.\n" +" REG_QWORD_LITTLE_ENDIAN -- A 64-bit number in little-endian format. Equivalent to REG_QWORD.\n" " REG_RESOURCE_LIST -- A device-driver resource list.\n" " REG_SZ -- A null-terminated string.\n" " value\n" @@ -950,8 +981,9 @@ winreg_SetValueEx(PyObject *module, PyObject *args) PyObject *value; if (!PyArg_ParseTuple(args, "O&ZOkO:SetValueEx", - clinic_HKEY_converter, &key, &value_name, &reserved, &type, &value)) + clinic_HKEY_converter, &key, &value_name, &reserved, &type, &value)) { goto exit; + } return_value = winreg_SetValueEx_impl(module, key, value_name, reserved, type, value); exit: @@ -985,8 +1017,9 @@ winreg_DisableReflectionKey(PyObject *module, PyObject *arg) PyObject *return_value = NULL; HKEY key; - if (!PyArg_Parse(arg, "O&:DisableReflectionKey", clinic_HKEY_converter, &key)) + if (!PyArg_Parse(arg, "O&:DisableReflectionKey", clinic_HKEY_converter, &key)) { goto exit; + } return_value = winreg_DisableReflectionKey_impl(module, key); exit: @@ -1018,8 +1051,9 @@ winreg_EnableReflectionKey(PyObject *module, PyObject *arg) PyObject *return_value = NULL; HKEY key; - if (!PyArg_Parse(arg, "O&:EnableReflectionKey", clinic_HKEY_converter, &key)) + if (!PyArg_Parse(arg, "O&:EnableReflectionKey", clinic_HKEY_converter, &key)) { goto exit; + } return_value = winreg_EnableReflectionKey_impl(module, key); exit: @@ -1049,11 +1083,12 @@ winreg_QueryReflectionKey(PyObject *module, PyObject *arg) PyObject *return_value = NULL; HKEY key; - if (!PyArg_Parse(arg, "O&:QueryReflectionKey", clinic_HKEY_converter, &key)) + if (!PyArg_Parse(arg, "O&:QueryReflectionKey", clinic_HKEY_converter, &key)) { goto exit; + } return_value = winreg_QueryReflectionKey_impl(module, key); exit: return return_value; } -/*[clinic end generated code: output=7b8940a23f605ddc input=a9049054013a1b77]*/ +/*[clinic end generated code: output=16dd06be6e14b86e input=a9049054013a1b77]*/ |