@@ -2982,6 +2982,66 @@ unsafe fn restore_all_patches() -> c_int {
29822982 }
29832983}
29842984
2985+ unsafe extern "C" fn py_uuid1 (
2986+ _self : * mut PyObject ,
2987+ args : * const * mut PyObject ,
2988+ nargs : Py_ssize_t ,
2989+ kwnames : * mut PyObject ,
2990+ ) -> * mut PyObject {
2991+ unsafe {
2992+ if load_uuid_references ( ) < 0 {
2993+ return ptr:: null_mut ( ) ;
2994+ }
2995+ uuid1_vectorcall ( ptr:: null_mut ( ) , args, nargs as usize , kwnames)
2996+ }
2997+ }
2998+
2999+ unsafe extern "C" fn py_uuid3 (
3000+ _self : * mut PyObject ,
3001+ args : * const * mut PyObject ,
3002+ nargs : Py_ssize_t ,
3003+ kwnames : * mut PyObject ,
3004+ ) -> * mut PyObject {
3005+ unsafe {
3006+ if load_uuid_references ( ) < 0 {
3007+ return ptr:: null_mut ( ) ;
3008+ }
3009+ uuid3_vectorcall ( ptr:: null_mut ( ) , args, nargs as usize , kwnames)
3010+ }
3011+ }
3012+
3013+ unsafe extern "C" fn py_uuid4 (
3014+ _self : * mut PyObject ,
3015+ _args : * const * mut PyObject ,
3016+ nargs : Py_ssize_t ,
3017+ kwnames : * mut PyObject ,
3018+ ) -> * mut PyObject {
3019+ unsafe {
3020+ if load_uuid_references ( ) < 0 {
3021+ return ptr:: null_mut ( ) ;
3022+ }
3023+ if nargs != 0 || keyword_count ( kwnames) != 0 {
3024+ PyErr_SetString ( PyExc_TypeError , c"uuid4() takes no arguments" . as_ptr ( ) ) ;
3025+ return ptr:: null_mut ( ) ;
3026+ }
3027+ allocate_uuid ( uuid:: Uuid :: new_v4 ( ) . as_u128 ( ) )
3028+ }
3029+ }
3030+
3031+ unsafe extern "C" fn py_uuid5 (
3032+ _self : * mut PyObject ,
3033+ args : * const * mut PyObject ,
3034+ nargs : Py_ssize_t ,
3035+ kwnames : * mut PyObject ,
3036+ ) -> * mut PyObject {
3037+ unsafe {
3038+ if load_uuid_references ( ) < 0 {
3039+ return ptr:: null_mut ( ) ;
3040+ }
3041+ uuid5_vectorcall ( ptr:: null_mut ( ) , args, nargs as usize , kwnames)
3042+ }
3043+ }
3044+
29853045unsafe extern "C" fn py_uuid6 (
29863046 _self : * mut PyObject ,
29873047 args : * const * mut PyObject ,
@@ -3150,7 +3210,7 @@ unsafe fn register_reseed_at_fork() -> c_int {
31503210 }
31513211}
31523212
3153- static mut METHODS : [ PyMethodDef ; 9 ] = [ PyMethodDef :: zeroed ( ) ; 9 ] ;
3213+ static mut METHODS : [ PyMethodDef ; 12 ] = [ PyMethodDef :: zeroed ( ) ; 12 ] ;
31543214
31553215unsafe fn init_methods ( ) {
31563216 unsafe {
@@ -3179,38 +3239,70 @@ unsafe fn init_methods() {
31793239 ml_doc : c"Return whether uuid vectorcall patches are installed." . as_ptr ( ) ,
31803240 } ;
31813241 METHODS [ 3 ] = PyMethodDef {
3242+ ml_name : c"uuid1" . as_ptr ( ) ,
3243+ ml_meth : PyMethodDefPointer {
3244+ PyCFunctionFastWithKeywords : py_uuid1,
3245+ } ,
3246+ ml_flags : METH_FASTCALL | METH_KEYWORDS ,
3247+ ml_doc : c"Generate a version 1 UUID." . as_ptr ( ) ,
3248+ } ;
3249+ METHODS [ 4 ] = PyMethodDef {
3250+ ml_name : c"uuid3" . as_ptr ( ) ,
3251+ ml_meth : PyMethodDefPointer {
3252+ PyCFunctionFastWithKeywords : py_uuid3,
3253+ } ,
3254+ ml_flags : METH_FASTCALL | METH_KEYWORDS ,
3255+ ml_doc : c"Generate a version 3 UUID." . as_ptr ( ) ,
3256+ } ;
3257+ METHODS [ 5 ] = PyMethodDef {
3258+ ml_name : c"uuid4" . as_ptr ( ) ,
3259+ ml_meth : PyMethodDefPointer {
3260+ PyCFunctionFastWithKeywords : py_uuid4,
3261+ } ,
3262+ ml_flags : METH_FASTCALL | METH_KEYWORDS ,
3263+ ml_doc : c"Generate a version 4 UUID." . as_ptr ( ) ,
3264+ } ;
3265+ METHODS [ 6 ] = PyMethodDef {
3266+ ml_name : c"uuid5" . as_ptr ( ) ,
3267+ ml_meth : PyMethodDefPointer {
3268+ PyCFunctionFastWithKeywords : py_uuid5,
3269+ } ,
3270+ ml_flags : METH_FASTCALL | METH_KEYWORDS ,
3271+ ml_doc : c"Generate a version 5 UUID." . as_ptr ( ) ,
3272+ } ;
3273+ METHODS [ 7 ] = PyMethodDef {
31823274 ml_name : c"uuid6" . as_ptr ( ) ,
31833275 ml_meth : PyMethodDefPointer {
31843276 PyCFunctionFastWithKeywords : py_uuid6,
31853277 } ,
31863278 ml_flags : METH_FASTCALL | METH_KEYWORDS ,
31873279 ml_doc : c"Generate a version 6 UUID." . as_ptr ( ) ,
31883280 } ;
3189- METHODS [ 4 ] = PyMethodDef {
3281+ METHODS [ 8 ] = PyMethodDef {
31903282 ml_name : c"uuid7" . as_ptr ( ) ,
31913283 ml_meth : PyMethodDefPointer {
31923284 PyCFunctionFastWithKeywords : py_uuid7,
31933285 } ,
31943286 ml_flags : METH_FASTCALL | METH_KEYWORDS ,
31953287 ml_doc : c"Generate a version 7 UUID." . as_ptr ( ) ,
31963288 } ;
3197- METHODS [ 5 ] = PyMethodDef {
3289+ METHODS [ 9 ] = PyMethodDef {
31983290 ml_name : c"uuid8" . as_ptr ( ) ,
31993291 ml_meth : PyMethodDefPointer {
32003292 PyCFunctionFastWithKeywords : py_uuid8,
32013293 } ,
32023294 ml_flags : METH_FASTCALL | METH_KEYWORDS ,
32033295 ml_doc : c"Generate a version 8 UUID." . as_ptr ( ) ,
32043296 } ;
3205- METHODS [ 6 ] = PyMethodDef {
3297+ METHODS [ 10 ] = PyMethodDef {
32063298 ml_name : c"reseed_rng" . as_ptr ( ) ,
32073299 ml_meth : PyMethodDefPointer {
32083300 PyCFunction : py_reseed_rng,
32093301 } ,
32103302 ml_flags : METH_NOARGS ,
32113303 ml_doc : c"Reseed the Rust random number generator." . as_ptr ( ) ,
32123304 } ;
3213- METHODS [ 8 ] = PyMethodDef :: zeroed ( ) ;
3305+ METHODS [ 11 ] = PyMethodDef :: zeroed ( ) ;
32143306 }
32153307}
32163308
0 commit comments