@@ -94,7 +94,8 @@ pysqlite_connection_rollback(pysqlite_Connection *self, PyObject *Py_UNUSED(igno
94
94
}
95
95
96
96
PyDoc_STRVAR (pysqlite_connection_create_function__doc__ ,
97
- "create_function($self, /, name, narg, func, *, deterministic=False)\n"
97
+ "create_function($self, /, name, narg, func, *, deterministic=False,\n"
98
+ " directonly=False, innocuous=False)\n"
98
99
"--\n"
99
100
"\n"
100
101
"Creates a new function. Non-standard." );
@@ -105,20 +106,23 @@ PyDoc_STRVAR(pysqlite_connection_create_function__doc__,
105
106
static PyObject *
106
107
pysqlite_connection_create_function_impl (pysqlite_Connection * self ,
107
108
const char * name , int narg ,
108
- PyObject * func , int deterministic );
109
+ PyObject * func , int deterministic ,
110
+ int directonly , int innocuous );
109
111
110
112
static PyObject *
111
113
pysqlite_connection_create_function (pysqlite_Connection * self , PyObject * const * args , Py_ssize_t nargs , PyObject * kwnames )
112
114
{
113
115
PyObject * return_value = NULL ;
114
- static const char * const _keywords [] = {"name" , "narg" , "func" , "deterministic" , NULL };
116
+ static const char * const _keywords [] = {"name" , "narg" , "func" , "deterministic" , "directonly" , "innocuous" , NULL };
115
117
static _PyArg_Parser _parser = {NULL , _keywords , "create_function" , 0 };
116
- PyObject * argsbuf [4 ];
118
+ PyObject * argsbuf [6 ];
117
119
Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE (kwnames ) : 0 ) - 3 ;
118
120
const char * name ;
119
121
int narg ;
120
122
PyObject * func ;
121
123
int deterministic = 0 ;
124
+ int directonly = 0 ;
125
+ int innocuous = 0 ;
122
126
123
127
args = _PyArg_UnpackKeywords (args , nargs , NULL , kwnames , & _parser , 3 , 3 , 0 , argsbuf );
124
128
if (!args ) {
@@ -145,19 +149,38 @@ pysqlite_connection_create_function(pysqlite_Connection *self, PyObject *const *
145
149
if (!noptargs ) {
146
150
goto skip_optional_kwonly ;
147
151
}
148
- deterministic = PyObject_IsTrue (args [3 ]);
149
- if (deterministic < 0 ) {
152
+ if (args [3 ]) {
153
+ deterministic = PyObject_IsTrue (args [3 ]);
154
+ if (deterministic < 0 ) {
155
+ goto exit ;
156
+ }
157
+ if (!-- noptargs ) {
158
+ goto skip_optional_kwonly ;
159
+ }
160
+ }
161
+ if (args [4 ]) {
162
+ directonly = PyObject_IsTrue (args [4 ]);
163
+ if (directonly < 0 ) {
164
+ goto exit ;
165
+ }
166
+ if (!-- noptargs ) {
167
+ goto skip_optional_kwonly ;
168
+ }
169
+ }
170
+ innocuous = PyObject_IsTrue (args [5 ]);
171
+ if (innocuous < 0 ) {
150
172
goto exit ;
151
173
}
152
174
skip_optional_kwonly :
153
- return_value = pysqlite_connection_create_function_impl (self , name , narg , func , deterministic );
175
+ return_value = pysqlite_connection_create_function_impl (self , name , narg , func , deterministic , directonly , innocuous );
154
176
155
177
exit :
156
178
return return_value ;
157
179
}
158
180
159
181
PyDoc_STRVAR (pysqlite_connection_create_aggregate__doc__ ,
160
- "create_aggregate($self, /, name, n_arg, aggregate_class)\n"
182
+ "create_aggregate($self, /, name, n_arg, aggregate_class, *,\n"
183
+ " deterministic=False, directonly=False, innocuous=False)\n"
161
184
"--\n"
162
185
"\n"
163
186
"Creates a new aggregate. Non-standard." );
@@ -168,18 +191,24 @@ PyDoc_STRVAR(pysqlite_connection_create_aggregate__doc__,
168
191
static PyObject *
169
192
pysqlite_connection_create_aggregate_impl (pysqlite_Connection * self ,
170
193
const char * name , int n_arg ,
171
- PyObject * aggregate_class );
194
+ PyObject * aggregate_class ,
195
+ int deterministic , int directonly ,
196
+ int innocuous );
172
197
173
198
static PyObject *
174
199
pysqlite_connection_create_aggregate (pysqlite_Connection * self , PyObject * const * args , Py_ssize_t nargs , PyObject * kwnames )
175
200
{
176
201
PyObject * return_value = NULL ;
177
- static const char * const _keywords [] = {"name" , "n_arg" , "aggregate_class" , NULL };
202
+ static const char * const _keywords [] = {"name" , "n_arg" , "aggregate_class" , "deterministic" , "directonly" , "innocuous" , NULL };
178
203
static _PyArg_Parser _parser = {NULL , _keywords , "create_aggregate" , 0 };
179
- PyObject * argsbuf [3 ];
204
+ PyObject * argsbuf [6 ];
205
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE (kwnames ) : 0 ) - 3 ;
180
206
const char * name ;
181
207
int n_arg ;
182
208
PyObject * aggregate_class ;
209
+ int deterministic = 0 ;
210
+ int directonly = 0 ;
211
+ int innocuous = 0 ;
183
212
184
213
args = _PyArg_UnpackKeywords (args , nargs , NULL , kwnames , & _parser , 3 , 3 , 0 , argsbuf );
185
214
if (!args ) {
@@ -203,7 +232,33 @@ pysqlite_connection_create_aggregate(pysqlite_Connection *self, PyObject *const
203
232
goto exit ;
204
233
}
205
234
aggregate_class = args [2 ];
206
- return_value = pysqlite_connection_create_aggregate_impl (self , name , n_arg , aggregate_class );
235
+ if (!noptargs ) {
236
+ goto skip_optional_kwonly ;
237
+ }
238
+ if (args [3 ]) {
239
+ deterministic = PyObject_IsTrue (args [3 ]);
240
+ if (deterministic < 0 ) {
241
+ goto exit ;
242
+ }
243
+ if (!-- noptargs ) {
244
+ goto skip_optional_kwonly ;
245
+ }
246
+ }
247
+ if (args [4 ]) {
248
+ directonly = PyObject_IsTrue (args [4 ]);
249
+ if (directonly < 0 ) {
250
+ goto exit ;
251
+ }
252
+ if (!-- noptargs ) {
253
+ goto skip_optional_kwonly ;
254
+ }
255
+ }
256
+ innocuous = PyObject_IsTrue (args [5 ]);
257
+ if (innocuous < 0 ) {
258
+ goto exit ;
259
+ }
260
+ skip_optional_kwonly :
261
+ return_value = pysqlite_connection_create_aggregate_impl (self , name , n_arg , aggregate_class , deterministic , directonly , innocuous );
207
262
208
263
exit :
209
264
return return_value ;
@@ -719,4 +774,4 @@ pysqlite_connection_exit(pysqlite_Connection *self, PyObject *const *args, Py_ss
719
774
#ifndef PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF
720
775
#define PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF
721
776
#endif /* !defined(PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF) */
722
- /*[clinic end generated code: output=7cb13d491a5970aa input=a9049054013a1b77]*/
777
+ /*[clinic end generated code: output=33bcda978b5bc004 input=a9049054013a1b77]*/
0 commit comments