@@ -40,6 +40,8 @@ typedef struct {
4040 DBM * di_dbm ;
4141} dbmobject ;
4242
43+ #include "clinic/_dbmmodule.c.h"
44+
4345static PyTypeObject Dbmtype ;
4446
4547#define is_dbmobject (v ) (Py_TYPE(v) == &Dbmtype)
@@ -277,39 +279,9 @@ dbm.dbm.get
277279Return the value for key if present, otherwise default.
278280[clinic start generated code]*/
279281
280- PyDoc_STRVAR (dbm_dbm_get__doc__ ,
281- "get($self, key, default=None, /)\n"
282- "--\n"
283- "\n"
284- "Return the value for key if present, otherwise default." );
285-
286- #define DBM_DBM_GET_METHODDEF \
287- {"get", (PyCFunction)dbm_dbm_get, METH_VARARGS, dbm_dbm_get__doc__},
288-
289- static PyObject *
290- dbm_dbm_get_impl (dbmobject * dp , const char * key , Py_ssize_clean_t key_length , PyObject * default_value );
291-
292- static PyObject *
293- dbm_dbm_get (dbmobject * dp , PyObject * args )
294- {
295- PyObject * return_value = NULL ;
296- const char * key ;
297- Py_ssize_clean_t key_length ;
298- PyObject * default_value = Py_None ;
299-
300- if (!PyArg_ParseTuple (args ,
301- "s#|O:get" ,
302- & key , & key_length , & default_value ))
303- goto exit ;
304- return_value = dbm_dbm_get_impl (dp , key , key_length , default_value );
305-
306- exit :
307- return return_value ;
308- }
309-
310282static PyObject *
311283dbm_dbm_get_impl (dbmobject * dp , const char * key , Py_ssize_clean_t key_length , PyObject * default_value )
312- /*[clinic end generated code: output=452ea11394e7e92d input=aecf5efd2f2b1a3b]*/
284+ /*[clinic end generated code: output=c2bdccaa734ad349 input=aecf5efd2f2b1a3b]*/
313285{
314286 datum dbm_key , val ;
315287
@@ -449,47 +421,9 @@ Return a database object.
449421
450422[clinic start generated code]*/
451423
452- PyDoc_STRVAR (dbmopen__doc__ ,
453- "open($module, filename, flags=\'r\', mode=0o666, /)\n"
454- "--\n"
455- "\n"
456- "Return a database object.\n"
457- "\n"
458- " filename\n"
459- " The filename to open.\n"
460- " flags\n"
461- " How to open the file. \"r\" for reading, \"w\" for writing, etc.\n"
462- " mode\n"
463- " If creating a new file, the mode bits for the new file\n"
464- " (e.g. os.O_RDWR)." );
465-
466- #define DBMOPEN_METHODDEF \
467- {"open", (PyCFunction)dbmopen, METH_VARARGS, dbmopen__doc__},
468-
469- static PyObject *
470- dbmopen_impl (PyModuleDef * module , const char * filename , const char * flags , int mode );
471-
472- static PyObject *
473- dbmopen (PyModuleDef * module , PyObject * args )
474- {
475- PyObject * return_value = NULL ;
476- const char * filename ;
477- const char * flags = "r" ;
478- int mode = 438 ;
479-
480- if (!PyArg_ParseTuple (args ,
481- "s|si:open" ,
482- & filename , & flags , & mode ))
483- goto exit ;
484- return_value = dbmopen_impl (module , filename , flags , mode );
485-
486- exit :
487- return return_value ;
488- }
489-
490424static PyObject *
491425dbmopen_impl (PyModuleDef * module , const char * filename , const char * flags , int mode )
492- /*[clinic end generated code: output=9a7b725f9c4dcec2 input=6499ab0fab1333ac]*/
426+ /*[clinic end generated code: output=8b618fe06b92bf86 input=6499ab0fab1333ac]*/
493427{
494428 int iflags ;
495429
0 commit comments