• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4 
5 PyDoc_STRVAR(_testmultiphase_StateAccessType_get_defining_module__doc__,
6 "get_defining_module($self, /)\n"
7 "--\n"
8 "\n"
9 "Return the module of the defining class.\n"
10 "\n"
11 "Also tests that result of _PyType_GetModuleByDef matches defining_class\'s\n"
12 "module.");
13 
14 #define _TESTMULTIPHASE_STATEACCESSTYPE_GET_DEFINING_MODULE_METHODDEF    \
15     {"get_defining_module", (PyCFunction)(void(*)(void))_testmultiphase_StateAccessType_get_defining_module, METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _testmultiphase_StateAccessType_get_defining_module__doc__},
16 
17 static PyObject *
18 _testmultiphase_StateAccessType_get_defining_module_impl(StateAccessTypeObject *self,
19                                                          PyTypeObject *cls);
20 
21 static PyObject *
_testmultiphase_StateAccessType_get_defining_module(StateAccessTypeObject * self,PyTypeObject * cls,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)22 _testmultiphase_StateAccessType_get_defining_module(StateAccessTypeObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
23 {
24     PyObject *return_value = NULL;
25     static const char * const _keywords[] = { NULL};
26     static _PyArg_Parser _parser = {":get_defining_module", _keywords, 0};
27 
28     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser
29         )) {
30         goto exit;
31     }
32     return_value = _testmultiphase_StateAccessType_get_defining_module_impl(self, cls);
33 
34 exit:
35     return return_value;
36 }
37 
38 PyDoc_STRVAR(_testmultiphase_StateAccessType_getmodulebydef_bad_def__doc__,
39 "getmodulebydef_bad_def($self, /)\n"
40 "--\n"
41 "\n"
42 "Test that result of _PyType_GetModuleByDef with a bad def is NULL.");
43 
44 #define _TESTMULTIPHASE_STATEACCESSTYPE_GETMODULEBYDEF_BAD_DEF_METHODDEF    \
45     {"getmodulebydef_bad_def", (PyCFunction)(void(*)(void))_testmultiphase_StateAccessType_getmodulebydef_bad_def, METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _testmultiphase_StateAccessType_getmodulebydef_bad_def__doc__},
46 
47 static PyObject *
48 _testmultiphase_StateAccessType_getmodulebydef_bad_def_impl(StateAccessTypeObject *self,
49                                                             PyTypeObject *cls);
50 
51 static PyObject *
_testmultiphase_StateAccessType_getmodulebydef_bad_def(StateAccessTypeObject * self,PyTypeObject * cls,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)52 _testmultiphase_StateAccessType_getmodulebydef_bad_def(StateAccessTypeObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
53 {
54     PyObject *return_value = NULL;
55     static const char * const _keywords[] = { NULL};
56     static _PyArg_Parser _parser = {":getmodulebydef_bad_def", _keywords, 0};
57 
58     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser
59         )) {
60         goto exit;
61     }
62     return_value = _testmultiphase_StateAccessType_getmodulebydef_bad_def_impl(self, cls);
63 
64 exit:
65     return return_value;
66 }
67 
68 PyDoc_STRVAR(_testmultiphase_StateAccessType_increment_count_clinic__doc__,
69 "increment_count_clinic($self, /, n=1, *, twice=False)\n"
70 "--\n"
71 "\n"
72 "Add \'n\' from the module-state counter.\n"
73 "\n"
74 "Pass \'twice\' to double that amount.\n"
75 "\n"
76 "This tests Argument Clinic support for defining_class.");
77 
78 #define _TESTMULTIPHASE_STATEACCESSTYPE_INCREMENT_COUNT_CLINIC_METHODDEF    \
79     {"increment_count_clinic", (PyCFunction)(void(*)(void))_testmultiphase_StateAccessType_increment_count_clinic, METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _testmultiphase_StateAccessType_increment_count_clinic__doc__},
80 
81 static PyObject *
82 _testmultiphase_StateAccessType_increment_count_clinic_impl(StateAccessTypeObject *self,
83                                                             PyTypeObject *cls,
84                                                             int n, int twice);
85 
86 static PyObject *
_testmultiphase_StateAccessType_increment_count_clinic(StateAccessTypeObject * self,PyTypeObject * cls,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)87 _testmultiphase_StateAccessType_increment_count_clinic(StateAccessTypeObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
88 {
89     PyObject *return_value = NULL;
90     static const char * const _keywords[] = {"n", "twice", NULL};
91     static _PyArg_Parser _parser = {"|i$p:increment_count_clinic", _keywords, 0};
92     int n = 1;
93     int twice = 0;
94 
95     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
96         &n, &twice)) {
97         goto exit;
98     }
99     return_value = _testmultiphase_StateAccessType_increment_count_clinic_impl(self, cls, n, twice);
100 
101 exit:
102     return return_value;
103 }
104 
105 PyDoc_STRVAR(_testmultiphase_StateAccessType_get_count__doc__,
106 "get_count($self, /)\n"
107 "--\n"
108 "\n"
109 "Return the value of the module-state counter.");
110 
111 #define _TESTMULTIPHASE_STATEACCESSTYPE_GET_COUNT_METHODDEF    \
112     {"get_count", (PyCFunction)(void(*)(void))_testmultiphase_StateAccessType_get_count, METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _testmultiphase_StateAccessType_get_count__doc__},
113 
114 static PyObject *
115 _testmultiphase_StateAccessType_get_count_impl(StateAccessTypeObject *self,
116                                                PyTypeObject *cls);
117 
118 static PyObject *
_testmultiphase_StateAccessType_get_count(StateAccessTypeObject * self,PyTypeObject * cls,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)119 _testmultiphase_StateAccessType_get_count(StateAccessTypeObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
120 {
121     PyObject *return_value = NULL;
122     static const char * const _keywords[] = { NULL};
123     static _PyArg_Parser _parser = {":get_count", _keywords, 0};
124 
125     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser
126         )) {
127         goto exit;
128     }
129     return_value = _testmultiphase_StateAccessType_get_count_impl(self, cls);
130 
131 exit:
132     return return_value;
133 }
134 /*[clinic end generated code: output=eb1b8c2ee6290be3 input=a9049054013a1b77]*/
135